/* SmartBox in-app Help page.

   Same visual language as the rest of smartboxorganizer.app (system font,
   white and #f5f5f7 surfaces, pill labels, blue accent, dark mode through
   prefers-color-scheme), but no site chrome: these pages are loaded inside
   the app's WKWebView, where a navbar would take the user out of the app.
   Shared by help.html and every <lang>/help.html. */

:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --card: #ffffff;
  --text: #1d1d1f;
  --text-2: #515154;
  --text-3: #86868b;
  --line: rgba(0, 0, 0, 0.1);
  --link: #0066cc;
  --accent: #007aff;
  --accent-ink: #ffffff;
  --blue: #007aff;
  --pink: #ff2d55;
  --orange: #ff9500;
  --green: #34c759;
  --teal: #30b0c7;
  --indigo: #5856d6;
  --purple: #af52de;
  --tint: 12%;
  --radius: 20px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-alt: #1c1c1e;
    --card: #1c1c1e;
    --text: #f5f5f7;
    --text-2: #c7c7cc;
    --text-3: #8e8e93;
    --line: rgba(255, 255, 255, 0.16);
    --link: #2997ff;
    --accent: #0a84ff;
    --blue: #0a84ff;
    --pink: #ff375f;
    --orange: #ff9f0a;
    --green: #30d158;
    --teal: #40c8e0;
    --indigo: #5e5ce6;
    --purple: #bf5af2;
    --tint: 22%;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.12; letter-spacing: -0.03em; }
p, ul, ol { margin: 0; }

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px max(20px, env(safe-area-inset-right)) max(64px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}

/* ---------- Page head ---------- */

.page-head { text-align: center; padding: 20px 0 8px; }
.page-head h1 { font-size: clamp(32px, 8vw, 46px); letter-spacing: -0.04em; }
.page-head p { margin-top: 12px; color: var(--text-2); font-size: 19px; line-height: 1.4; }

/* Search (shown by js/help.js) */
.search { margin: 28px 0 0; position: relative; }
.search[hidden] { display: none; }
.search input {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 14px;
  background: var(--bg-alt);
  color: var(--text);
  font: inherit;
  font-size: 17px;
  padding: 13px 16px 13px 46px;
  outline: none;
}
.search input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.search input::placeholder { color: var(--text-3); }
.search svg { position: absolute; left: 15px; top: 50%; width: 19px; height: 19px; margin-top: -9.5px; color: var(--text-3); pointer-events: none; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.no-results { margin: 24px 0 0; text-align: center; color: var(--text-3); }
.no-results[hidden] { display: none; }

/* ---------- Contents ---------- */

.toc { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 28px 0 0; }
@media (min-width: 560px) { .toc { grid-template-columns: 1fr 1fr; } }
.toc a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 14px;
  background: var(--bg-alt);
  color: var(--text);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.toc a:hover { text-decoration: none; background: color-mix(in srgb, var(--bg-alt) 85%, var(--text) 15%); }
.toc a[hidden] { display: none; }
.toc .n {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  background: color-mix(in srgb, var(--c, var(--blue)) calc(var(--tint) + 4%), transparent);
  color: var(--c, var(--blue));
}

/* Section colours, shared by the contents list and the section icons */
.c-blue { --c: var(--blue); }
.c-pink { --c: var(--pink); }
.c-orange { --c: var(--orange); }
.c-green { --c: var(--green); }
.c-teal { --c: var(--teal); }
.c-indigo { --c: var(--indigo); }
.c-purple { --c: var(--purple); }

/* ---------- Sections ---------- */

main > section, .wrap > section { margin-top: 56px; padding-top: 56px; border-top: 1px solid var(--line); scroll-margin-top: 8px; }
main > section:first-of-type, .wrap > section:first-of-type { margin-top: 40px; }
section[hidden] { display: none; }

section h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: clamp(26px, 6vw, 32px);
  margin-bottom: 20px;
}
section h2 .h-text { display: block; min-width: 0; }
section h2 .h-num {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--c, var(--blue));
}
.icon-tile {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--c, var(--blue)) calc(var(--tint) + 4%), transparent);
  color: var(--c, var(--blue));
}
.icon-tile svg { width: 25px; height: 25px; display: block; }

section h3 { margin-top: 34px; font-size: 21px; letter-spacing: -0.02em; line-height: 1.2; }
section > p + p, section > p + ul, section > p + ol, section > ul + p, section > ol + p,
section > h3 + p, section > h3 + ul, section > h3 + ol, section > h2 + p { margin-top: 14px; }
section > ul + ul, section > ol + ul, section > ul + ol { margin-top: 14px; }
section > .table-scroll + p, section > p + .table-scroll, section > h3 + .table-scroll, section > h2 + .table-scroll { margin-top: 16px; }
section > .note, section > .warn, section > figure { margin-top: 18px; }
section > p + .note, section > p + .warn { margin-top: 18px; }
section p, section li { color: var(--text-2); }
section p b, section li b, section p strong { color: var(--text); font-weight: 600; }

ul, ol { padding-left: 22px; }
li { margin-top: 8px; }
li:first-child { margin-top: 0; }
li > ul, li > ol { margin-top: 8px; }
ul li::marker { color: var(--text-3); }

/* Numbered steps */
ol { list-style: none; padding-left: 0; counter-reset: step; }
ol > li { counter-increment: step; position: relative; padding-left: 40px; margin-top: 12px; min-height: 28px; }
ol > li:first-child { margin-top: 0; }
ol > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent) calc(var(--tint) + 4%), transparent);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
}

/* App labels: the exact name of a button, row or screen */
.ui {
  display: inline;
  padding: 1px 8px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) calc(var(--tint) + 2%), transparent);
  color: color-mix(in srgb, var(--accent) 75%, var(--text));
  font-weight: 600;
  font-size: 0.94em;
  letter-spacing: -0.01em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Subscription tag after a feature: <span class="tier">Unlimited</span> */
.tier {
  display: inline-block;
  margin-left: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--purple) calc(var(--tint) + 4%), transparent);
  color: color-mix(in srgb, var(--purple) 70%, var(--text));
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: 2px;
  white-space: nowrap;
}
.tier-limited {
  background: color-mix(in srgb, var(--teal) calc(var(--tint) + 4%), transparent);
  color: color-mix(in srgb, var(--teal) 70%, var(--text));
}

/* Callouts */
.note, .warn {
  padding: 16px 18px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--blue) var(--tint), transparent);
  font-size: 16px;
  line-height: 1.5;
}
.warn { background: color-mix(in srgb, var(--orange) calc(var(--tint) + 3%), transparent); }
.note, .warn, .note b, .warn b { color: var(--text); }
.note b, .warn b { font-weight: 700; }

/* ---------- Tables ---------- */

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 18px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.45; }
th, td { padding: 13px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
tr:last-child > th, tr:last-child > td { border-bottom: 0; }
tbody th { width: 34%; font-weight: 600; color: var(--text); }
td { color: var(--text-2); }
thead th { background: var(--bg-alt); font-size: 14px; font-weight: 600; color: var(--text-2); text-align: center; }
thead th:first-child { text-align: left; }
thead + tbody td { text-align: center; color: var(--text); }
@media (max-width: 520px) {
  th, td { padding: 11px 12px; }
  tbody th { width: 38%; }
  /* Plan comparison: three narrow value columns */
  thead + tbody td { padding-left: 4px; padding-right: 4px; font-size: 14px; line-height: 1.3; hyphens: auto; -webkit-hyphens: auto; }
  thead th { padding-left: 4px; padding-right: 4px; font-size: 12.5px; }
  thead + tbody th { width: 34%; padding-right: 6px; }
}

/* ---------- Media slots ---------- */

figure.media { margin: 18px 0 0; }
figure.media img { display: block; width: 100%; height: auto; border-radius: 16px; border: 1px solid var(--line); }
figure.media figcaption { margin-top: 8px; font-size: 14px; color: var(--text-3); text-align: center; }

/* ---------- Back to top and footer ---------- */

.top-link { display: inline-block; margin-top: 28px; font-size: 14px; color: var(--text-3); }
.top-link:hover { color: var(--link); text-decoration: none; }

.page-foot {
  margin-top: 64px;
  padding: 36px 28px;
  border-radius: 24px;
  background: var(--bg-alt);
  text-align: center;
}
.page-foot h2 { display: block; margin: 0; font-size: 26px; }
.page-foot p { margin-top: 10px; color: var(--text-2); }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
