/* The NotaBene User Guide — one stylesheet for every page (tools/user-guide.py copies it).
   The system's font and colours, NotaBene's blue (#2872FA) for links and the marks of a topic,
   and the dark appearance by `prefers-color-scheme`, which the app's web view follows
   (measured in G0, design/user-guide.md §7a). */
:root {
  color-scheme: light dark;
  --ink: #1d1d1f; --secondary: #6e6e73; --paper: #ffffff; --rule: #d2d2d7;
  --accent: #2872FA; --tint: rgba(40, 114, 250, 0.08);
}
@media (prefers-color-scheme: dark) {
  :root { --ink: #f5f5f7; --secondary: #a1a1a6; --paper: #1c1c1e; --rule: #3a3a3c; --tint: rgba(40, 114, 250, 0.16); }
}
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: -apple-system-body; font-family: -apple-system, system-ui, sans-serif; line-height: 1.55;
}
main { max-width: 680px; margin: 0 auto; padding: 28px 28px 48px; }
h1 { font-size: 1.9em; line-height: 1.2; margin: 0 0 0.6em; font-weight: 700; }
h2 { font-size: 1.25em; margin: 1.6em 0 0.4em; }
h3 { font-size: 1.05em; margin: 1.3em 0 0.3em; }
p, ul, ol { margin: 0 0 0.9em; }
li { margin: 0.25em 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: ui-monospace, Menlo, monospace; font-size: 0.92em; background: var(--tint); padding: 0.05em 0.3em; border-radius: 4px; }
.box { border-left: 3px solid var(--accent); background: var(--tint); padding: 10px 14px; border-radius: 0 8px 8px 0; margin: 0 0 1em; }
.box.note { border-left-color: var(--secondary); background: rgba(127, 127, 127, 0.1); }
.lede, .stamp { color: var(--secondary); }
.stamp { font-size: 0.9em; margin-top: -0.4em; }

/* The platform switch, as a segmented control: what is said for one platform only. */
.platforms { display: inline-flex; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; margin: 0 0 1.2em; }
.platforms button {
  font: inherit; font-size: 0.9em; color: var(--ink); background: transparent; border: 0;
  padding: 4px 14px; cursor: pointer;
}
.platforms button + button { border-left: 1px solid var(--rule); }
.platforms button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.only { display: none; }
.only.shown { display: block; }

/* The start page's chapters. */
.chapters { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 1.4em; }
.chapter { border: 1px solid var(--rule); border-radius: 12px; padding: 12px 16px; }
.chapter h2 { margin: 0 0 0.3em; font-size: 1.05em; }
.chapter ul { list-style: none; padding: 0; margin: 0; }

/* Previous and next, at the foot of a topic. */
.pager { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--rule); margin-top: 2em; padding-top: 1em; }
.pager .next { margin-left: auto; text-align: right; }
.release { border-top: 1px solid var(--rule); padding-top: 0.4em; }

/* A picture with numbers (G2): the window as it is, and the numbers over it — HTML, so they stay
   sharp at any size and light up with their line of the legend. Their places are the classes
   tools/user-guide.py appends below. */
.glance { margin: 0 0 1.4em; }
.glance .shot { position: relative; line-height: 0; }
.glance .shot img { width: 100%; height: auto; border-radius: 10px; box-shadow: 0 1px 6px rgba(0, 0, 0, 0.18); }
.mk {
  position: absolute; transform: translate(-50%, -50%); width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: #fff; font: 700 13px/24px -apple-system, system-ui, sans-serif;
  text-align: center; box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(0, 0, 0, 0.35); cursor: default;
}
.mk.hot { transform: translate(-50%, -50%) scale(1.25); }
.legend { list-style: none; padding: 0; margin: 0.9em 0 0; }
.legend li { display: flex; gap: 10px; padding: 5px 8px; border-radius: 8px; }
.legend li .n {
  flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff;
  font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; margin-top: 2px;
}
.legend li.hot { background: var(--tint); }
/* A phone's picture is tall: narrow, with its legend beside it where there is room. */
.glance.iphone { display: flex; gap: 20px; align-items: flex-start; }
.glance.iphone .shot { flex: 0 0 260px; }
.glance.iphone .legend { margin-top: 0; }
@media (max-width: 560px) {
  .glance.iphone { display: block; }
  .glance.iphone .shot { max-width: 260px; margin: 0 auto; }
  .glance.iphone .legend { margin-top: 0.9em; }
}

/* ── On the site only (body.web, G5): a bar, the contents beside the page, a search ─────────
   The app shows its own contents and search natively; on the site the page brings them. A
   narrow screen folds the contents behind a button, over the page. */
body.web { font: 17px/1.55 -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; }
.web .skip { position: absolute; left: -9999px; }
.web .skip:focus { left: 12px; top: 8px; z-index: 10; background: var(--paper); padding: 6px 10px; }
.web .top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px;
  padding: 10px 20px; background: var(--paper); border-bottom: 1px solid var(--rule);
}
.web .brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); }
.web .brand img { border-radius: 6px; }
.web .guide-home { color: var(--secondary); }
.web .spacer { flex: 1; }
.web .lang { display: flex; gap: 8px; font-size: 0.85em; color: var(--secondary); }
.web .lang [aria-current] { color: var(--ink); font-weight: 600; }
.web .beta {
  background: var(--accent); color: #fff; padding: 6px 14px; border-radius: 999px; font-size: 0.9em; font-weight: 600;
}
.web .beta:hover { text-decoration: none; filter: brightness(1.08); }
.web .toc-toggle { display: none; }
.web .layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); max-width: 1100px; margin: 0 auto; }
.web .toc {
  position: sticky; top: 53px; align-self: start; max-height: calc(100vh - 53px); overflow: auto;
  padding: 20px 16px 40px 20px; border-right: 1px solid var(--rule); font-size: 0.92em;
}
.web .search {
  width: 100%; box-sizing: border-box; font: inherit; padding: 7px 10px; margin: 0 0 14px;
  border: 1px solid var(--rule); border-radius: 8px; background: var(--paper); color: var(--ink);
}
.web .toc .sh { margin: 16px 0 4px; font-size: 0.8em; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--secondary); }
.web .toc .it { display: block; padding: 4px 8px; border-radius: 6px; color: var(--ink); }
.web .toc .it:hover { background: var(--tint); text-decoration: none; }
.web .toc .it.sel { background: var(--accent); color: #fff; }
.web .results { list-style: none; padding: 0; margin: 0; }
.web .results li { padding: 6px 8px; border-radius: 6px; }
.web .results li span { display: block; font-size: 0.85em; color: var(--secondary); }
.web .results li.none { color: var(--secondary); }
.web main { margin: 0; }
@media (max-width: 820px) {
  .web .layout { display: block; }
  .web .guide-home, .web .beta { display: none; }
  .web .toc-toggle {
    display: inline-block; font: inherit; font-size: 0.9em; padding: 5px 12px; border-radius: 999px;
    border: 1px solid var(--rule); background: var(--paper); color: var(--ink);
  }
  /* Open, the contents take the page's place rather than floating over it: nothing to
     scroll inside, and the page is one tap on a topic away. */
  .web .toc { display: none; position: static; max-height: none; border-right: 0; padding: 16px; }
  .web .toc.open { display: block; }
  .web .toc.open + main { display: none; }
  .web main { padding: 20px 16px 40px; }
}

/* The numbers' places over the pictures — written by tools/user-guide.py. */
.mk-glance-mac-1{left:10.08%;top:11.24%}
.mk-glance-mac-2{left:17.35%;top:31.79%}
.mk-glance-mac-3{left:45.5%;top:30.0%}
.mk-glance-mac-4{left:89.47%;top:13.11%}
.mk-glance-mac-5{left:97.7%;top:3.3%}
.mk-glance-ipad-1{left:11.0%;top:20.0%}
.mk-glance-ipad-2{left:17.0%;top:36.0%}
.mk-glance-ipad-3{left:44.0%;top:37.0%}
.mk-glance-ipad-4{left:85.0%;top:21.0%}
.mk-glance-ipad-5{left:49.0%;top:10.0%}
.mk-glance-iphone-1{left:92.0%;top:20.3%}
.mk-glance-iphone-2{left:92.0%;top:30.2%}
.mk-glance-iphone-3{left:94.68%;top:22.43%}
.mk-glance-iphone-4{left:88.06%;top:91.76%}
.mk-glance-iphone-5{left:8.0%;top:91.8%}
.mk-glance-iphone-6{left:90.5%;top:9.7%}
