/* Scout Recorder: document pages (/guide, /update, /app/support,
   /app/privacy, /privacy). Builds on base.css. */

/* Back to the landing page instead of its nav, like iOS's back button:
   these pages are mostly opened from the app or the App Store. */
.back {
  position: fixed;
  top: max(12px, calc(env(safe-area-inset-top) + 6px));
  left: max(12px, env(safe-area-inset-left));
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 7px 14px 7px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--forest-deep) 72%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  color: var(--cream);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s;
}
.back:hover { background: var(--forest-deep); }
.back svg { width: 20px; height: 20px; fill: none; stroke: var(--marigold); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.doc-hero {
  position: relative;
  background:
    radial-gradient(60% 90% at 80% 30%, #3a5030 0%, transparent 70%),
    var(--forest-deep);
  color: var(--cream);
  padding: calc(104px + env(safe-area-inset-top)) 0 72px;
  overflow: hidden;
}
.doc-hero .topo { color: color-mix(in srgb, var(--cream) 7%, transparent); }
.doc-hero__inner { position: relative; max-width: 860px; }
.doc-hero h1 {
  font-weight: 850;
  font-size: clamp(44px, 6.4vw, 88px);
  line-height: .95;
  letter-spacing: -.045em;
}
.doc-hero h1 em { font-style: italic; font-weight: 300; letter-spacing: -.035em; color: var(--marigold); }
.doc-hero .lede { margin-top: 24px; }

/* Document body: running text in a ~65ch column, sections set apart by
   space alone. Only one element per page gets a fill: the download, or
   the policy summary. The long policy gets a section index in the margin. */
.doc { padding-block: clamp(48px, 7vw, 88px) clamp(80px, 10vw, 130px); background: var(--cream); }
.doc__col { max-width: 44rem; min-width: 0; }
.doc__grid { display: grid; grid-template-columns: 13rem minmax(0, 44rem); gap: clamp(32px, 6vw, 88px); align-items: start; }
.doc-section { scroll-margin-top: 110px; }
.doc__col > * + * { margin-top: clamp(48px, 6vw, 64px); }

.doc h2 { font-size: clamp(24px, 2.6vw, 30px); font-weight: 800; letter-spacing: -.03em; line-height: 1.15; color: var(--forest); text-wrap: balance; margin-bottom: 14px; }
.doc h3 { font-size: 18px; font-weight: 800; letter-spacing: -.015em; color: var(--forest); margin: 32px 0 10px; }
.doc p, .doc li, .doc dd, .doc address { font-size: 17px; line-height: 1.65; color: var(--text); }
.doc p + p, .doc p + ul, .doc ul + p { margin-top: 14px; }
.doc ul { margin: 14px 0 0; padding-left: 1.2em; }
.doc ul li + li { margin-top: 6px; }
.doc ul li::marker { color: var(--olive); }
.doc address { font-style: normal; margin-top: 10px; }
.doc a { color: var(--forest); font-weight: 600; text-decoration-color: var(--marigold); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.doc a:hover { text-decoration-color: var(--forest); }
code {
  font: 600 .88em ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--paper);
  color: var(--forest);
}
.note { color: var(--text-soft) !important; font-size: 15px !important; }
.updated { margin-top: 18px; font-size: 14px !important; color: var(--olive) !important; }

/* Section index (long policy) */
.toc { position: sticky; top: 110px; }
.toc__title { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--olive); margin-bottom: 12px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; border-left: 2px solid var(--line); }
.toc a { display: block; padding: 5px 0 5px 14px; margin-left: -2px; border-left: 2px solid transparent; font-size: 14.5px; font-weight: 600; color: var(--text-soft); text-decoration: none; }
.toc a:hover { color: var(--forest); border-left-color: var(--marigold); }
@media (max-width: 900px) {
  .doc__grid { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; }
  .toc ol { border-left: 0; display: flex; flex-wrap: wrap; gap: 6px 8px; }
  .toc a { padding: 5px 11px; margin: 0; border: 0; border-radius: 999px; background: var(--paper); font-size: 13.5px; }
}

/* Legal basis per purpose: label / value, the way these policies are set */
.facts { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 8px 20px; margin: 14px 0 0; }
.facts dt { padding-top: 4px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--olive); }
.facts dd { margin: 0; }
@media (max-width: 520px) { .facts { grid-template-columns: minmax(0, 1fr); gap: 0; } .facts dd { margin-bottom: 10px; } }

/* Firmware download on /update, the support address on /app/support:
   each page's one filled element */
.download, .contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 32px;
  padding: clamp(24px, 4vw, 34px);
  border-radius: 20px;
  background: var(--forest);
  color: var(--cream);
}
.download h2, .contact h2 { color: var(--cream); margin-bottom: 4px; }
.download .meta { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; color: color-mix(in srgb, var(--cream) 80%, transparent); }
.download .older { margin-top: 6px; font-size: 14px; color: color-mix(in srgb, var(--cream) 60%, transparent); }
.download .older a { color: var(--marigold); font-weight: 600; text-underline-offset: 3px; }

/* Install steps: numbered because the order matters */
.steps { list-style: none; margin: 18px 0 0; padding: 0; counter-reset: step; display: grid; gap: 16px; }
.steps li { counter-increment: step; position: relative; padding-left: 46px; }
.steps li + li { margin-top: 0; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 1px;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--forest);
  color: var(--marigold);
  font-size: 14px;
  font-weight: 800;
}
.steps + p { margin-top: 18px; }
.steps + .note { margin-top: 20px; }

/* Release notes: version in its own column, like a changelog */
.changelog { display: grid; margin-top: 8px; }
.release { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 4px 24px; padding-block: 22px; border-top: 1px solid var(--line); }
.release h3 { margin: 0; font-size: 20px; font-variant-numeric: tabular-nums; }
.release .date { display: block; margin: 2px 0 0; font-size: 13.5px; font-weight: 500; letter-spacing: 0; color: var(--olive); }
.release ul { margin: 0; }
.release li { font-size: 16px; }
@media (max-width: 560px) { .release { grid-template-columns: minmax(0, 1fr); } .release ul { margin-top: 8px; } }

/* Support address */
.contact__address { font-size: 17px; font-weight: 600; color: color-mix(in srgb, var(--cream) 80%, transparent) !important; }

/* Support questions: one row each, opened in place */
.faq { display: grid; margin-top: 8px; border-bottom: 1px solid var(--line); }
.faq details { border-top: 1px solid var(--line); }
.faq summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-block: 18px;
  cursor: pointer;
  list-style: none;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.015em;
  color: var(--forest);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; font-size: 22px; line-height: 1; font-weight: 600; color: var(--olive); }
.faq details[open] summary::after { content: "−"; }
.faq details > p { margin: 0 0 14px; }
.faq details > p:last-child { padding-bottom: 8px; }

/* App policy summary: the one filled element on /app/privacy */
.summary-panel { padding: clamp(22px, 4vw, 32px); border-radius: 20px; background: var(--paper); }
.summary-panel h2 { margin-bottom: 18px; }
.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 28px; margin: 0; padding: 0; list-style: none; }
.summary li { display: flex; gap: 14px; align-items: flex-start; margin: 0 !important; font-weight: 700; line-height: 1.35; color: var(--forest); }
.summary svg { flex: none; width: 24px; height: 24px; margin-top: 1px; fill: none; stroke: var(--forest); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.summary span { display: block; margin-top: 3px; font-size: 15px; font-weight: 400; line-height: 1.45; color: var(--text-soft); }
@media (max-width: 600px) { .summary { grid-template-columns: 1fr; } }

/* Placeholder still to be filled in; must not ship */
mark.todo { padding: 1px 6px; border-radius: 6px; background: #ffd9cc; color: #8a2a0e; font-weight: 600; }

/* Guide: a light's colour next to its name, in a .facts list */
.facts--wide { grid-template-columns: 9.5rem minmax(0, 1fr); }
.dot { display: inline-block; width: 11px; height: 11px; margin-right: 8px; border-radius: 50%; vertical-align: -1px; background: var(--c); box-shadow: 0 0 0 1px color-mix(in srgb, var(--forest) 25%, transparent); }
.dot--purple { --c: #9b5de5; }
.dot--yellow { --c: #f2c230; }
.dot--white { --c: #fff; }
.dot--blue { --c: #3a7bf2; }
.dot--cyan { --c: #3cc8d8; }
.dot--orange { --c: #f08a24; }
.dot--green { --c: #4caf50; }
.dot--red { --c: #e0402a; }
/* Troubleshooting: one red dot per blink, ahead of the heading */
.blinks { display: inline-flex; gap: 4px; margin-right: 10px; }
.blinks .dot { margin-right: 0; }
/* A whole section folded away (the guide's Advanced and Troubleshooting).
   A link to an id inside opens it. */
.fold { border-block: 1px solid var(--line); }
.fold summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-block: 18px; cursor: pointer; list-style: none; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary h2 { margin: 0; }
.fold summary::after { content: "+"; flex: none; font-size: 28px; line-height: 1; font-weight: 600; color: var(--olive); }
.fold[open] summary::after { content: "−"; }
.fold__body { padding-bottom: 28px; scroll-margin-top: 140px; }
.fold__body > h3:first-child { margin-top: 4px; }
.fold__body [id] { scroll-margin-top: 110px; }
.doc-section:has(> .fold) + .doc-section:has(> .fold) { margin-top: 0; }
.doc-section:has(> .fold) + .doc-section:has(> .fold) .fold { border-top: 0; }

/* Settings editor (/guide/settings): the file bar is the page's one
   filled element; the settings below are rows like iOS Settings. */
.filebar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 32px;
  padding: clamp(24px, 4vw, 34px);
  border-radius: 20px;
  background: var(--forest);
  color: var(--cream);
}
.filebar h2 { color: var(--cream); margin-bottom: 4px; }
.filebar__status { font-size: 15px !important; font-weight: 600; color: color-mix(in srgb, var(--cream) 80%, transparent) !important; overflow-wrap: anywhere; }
.filebar__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.filebar input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.filebar.is-dragging { outline: 3px dashed var(--marigold); outline-offset: 4px; }
button.btn { border: 0; cursor: pointer; font-family: inherit; }

.settings-group h3 { margin: 0 0 4px; }
.settings-group + .settings-group { margin-top: 36px; }
.setting { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 20px; padding-block: 14px; border-top: 1px solid var(--line); }
.setting:last-of-type { border-bottom: 1px solid var(--line); }
.setting label { font-size: 17px; font-weight: 600; color: var(--text); }
.setting .hint { display: block; font-size: 14.5px; font-weight: 400; color: var(--text-soft); }
.setting select, .setting input {
  min-width: 10.5rem;
  padding: 9px 36px 9px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23384b31' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 14px center / 11px no-repeat;
  color: var(--forest);
  font: 600 15.5px var(--font);
  -webkit-appearance: none;
  appearance: none;
}
.setting input { width: 10.5rem; padding-right: 14px; background-image: none; }
.setting select.is-set, .setting input.is-set { background-color: var(--marigold); color: var(--forest-ink); }
.settings-group .note { margin-top: 10px; }

.preview summary { cursor: pointer; font-weight: 700; color: var(--forest); }
.preview pre {
  margin: 14px 0 0;
  padding: 18px 20px;
  border-radius: 14px;
  background: var(--paper);
  color: var(--forest-ink);
  font: 500 13.5px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Instructions opened in place over the page (the guide's card erase):
   a popover, so it opens and closes without script. */
.linklike { padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--forest); text-decoration: underline 2px var(--marigold); text-underline-offset: 4px; cursor: pointer; }
.linklike:hover { text-decoration-color: var(--forest); }
.modal {
  width: min(34rem, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: clamp(22px, 4vw, 32px);
  border: 0;
  border-radius: 20px;
  background: var(--cream);
  color: var(--text);
  box-shadow: 0 30px 80px -20px rgba(23, 32, 20, .6);
}
.modal::backdrop { background: color-mix(in srgb, var(--forest-ink) 55%, transparent); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal__head { display: flex; justify-content: space-between; align-items: start; gap: 16px; margin-bottom: 12px; }
.modal h2 { font-size: clamp(22px, 2.4vw, 26px); font-weight: 800; letter-spacing: -.03em; line-height: 1.15; color: var(--forest); }
.modal__close { flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--paper); color: var(--forest); font: 600 22px/1 var(--font); cursor: pointer; }
.modal p, .modal li { font-size: 16.5px; line-height: 1.6; }
.modal .steps { margin-top: 16px; }

/* The guide's switch between doing things on Scout and in the app:
   radio buttons, so it needs no script. Parts for one way only carry
   .for-alone or .for-app. */
.howto { display: inline-flex; margin-top: 32px; padding: 5px; border-radius: 999px; background: color-mix(in srgb, var(--cream) 8%, transparent); box-shadow: inset 0 0 0 1.5px var(--line-light); }
.howto input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.howto label { padding: 12px 22px; border-radius: 999px; font-size: 16px; font-weight: 700; color: color-mix(in srgb, var(--cream) 80%, transparent); cursor: pointer; transition: background .2s, color .2s; }
.howto input:checked + label { background: var(--marigold); color: var(--forest-ink); }
.howto input:focus-visible + label { outline: 3px solid var(--marigold); outline-offset: 3px; }
body:has(#howto-app:checked) .for-alone,
body:has(#howto-alone:checked) .for-app { display: none; }
.doc div.for-app > p + p, .doc div.for-alone > p + p { margin-top: 14px; }
