/* Snappy Mail user guide (docs.snappymail.app), in the Snappyhost brand like snappymail.app:
   forest #123026, emerald #14A06A, emerald-deep #0B7A4A, mint #57E0A8, Plus Jakarta Sans.
   The orange #F97316 matches the numbered callouts drawn on the screenshots. */

:root {
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --forest: #123026;
  --forest-900: #0c1f17;
  --emerald: #14a06a;
  --emerald-deep: #0b7a4a;
  --mint: #57e0a8;
  --callout: #f97316;

  --bg: #ffffff;
  --bg-2: #f4f7f3;
  --card: #ffffff;
  --ink: #0f221c;
  --text: #1b2d26;
  --text-2: #42574d;
  --text-3: #6b7f75;
  --border: #e2e7e0;
  --border-2: #d2dbd4;
  --link: var(--emerald-deep);
  --tile: #e6f4ec;
  --note-bg: #eef7f1;
  --warn-bg: #fff6ec;
  --warn-border: #f6d7b4;
  --nav-bg: rgba(255, 255, 255, .88);
  --shadow: 0 1px 2px rgba(12, 31, 23, .05), 0 10px 30px -14px rgba(12, 31, 23, .22);
  --radius: 14px;
  --sidebar: 268px;
  color-scheme: light;
}
/* Light is the default; dark is opt-in from the header toggle (theme.js applies a saved choice before paint) */
:root[data-theme="dark"] {
  --bg: #08140f;
  --bg-2: #0c1b15;
  --card: #10221a;
  --ink: #f1f7f3;
  --text: #dfeae4;
  --text-2: #a9bdb3;
  --text-3: #7d9389;
  --border: #1b3128;
  --border-2: #274234;
  --link: var(--mint);
  --tile: rgba(87, 224, 168, .12);
  --note-bg: rgba(87, 224, 168, .08);
  --warn-bg: rgba(249, 115, 22, .08);
  --warn-border: rgba(249, 115, 22, .3);
  --nav-bg: rgba(8, 20, 15, .84);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -12px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 92px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16.5px/1.7 var(--font); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--emerald) 60%, transparent); outline-offset: 3px; border-radius: 4px; }
.sprite { display: none; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 8px 14px; border-radius: 8px; background: var(--emerald-deep); color: #fff; font-weight: 700; }
.skip:focus { left: 8px; }

/* ---------- Header ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: var(--nav-bg); -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px); border-bottom: 1px solid var(--border); }
.nav-in { display: flex; align-items: center; gap: 16px; height: 68px; width: min(1320px, 100% - 40px); margin-inline: auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; font-size: 19px; letter-spacing: -.03em; text-decoration: none; white-space: nowrap; }
.brand-mark { width: 32px; height: 32px; border-radius: 8px; }
.brand-tag { padding: 2px 9px; border-radius: 999px; background: var(--tile); color: var(--link); font-size: 12.5px; font-weight: 700; letter-spacing: 0; }
.nav-links { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav-links a { padding: 8px 12px; color: var(--text); font-size: 15px; font-weight: 600; text-decoration: none; border-radius: 8px; }
.nav-links a:hover { background: var(--bg-2); color: var(--link); }
.nav-links .cta { color: #fff; background: var(--emerald); }
.nav-links .cta:hover { color: #fff; background: var(--emerald-deep); }
.theme-toggle { width: 40px; height: 40px; flex: none; display: grid; place-items: center; padding: 0; border-radius: 8px; border: 1px solid var(--border-2); background: transparent; color: var(--text); cursor: pointer; }
.theme-toggle:hover { border-color: var(--emerald); color: var(--link); }
.theme-toggle .ic { width: 19px; height: 19px; }
.theme-toggle .i-sun, :root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }

/* ---------- Hero ---------- */
.hero {
  color: #fff;
  background:
    radial-gradient(45% 70% at 15% 0%, rgba(87, 224, 168, .22), transparent 70%),
    radial-gradient(40% 60% at 90% 40%, rgba(20, 160, 106, .25), transparent 70%),
    linear-gradient(180deg, var(--forest-900), var(--forest));
}
.hero-in { width: min(1320px, 100% - 40px); margin-inline: auto; padding: 56px 0 52px; }
.eyebrow { display: inline-block; margin-bottom: 12px; padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); color: #cfe3d9; font-size: 13px; font-weight: 600; }
.hero h1 { margin: 0 0 12px; font-size: clamp(32px, 5vw, 50px); line-height: 1.08; letter-spacing: -.035em; font-weight: 800; }
.hero h1 span { color: var(--mint); }
.hero p { margin: 0; max-width: 680px; color: #c4d8ce; font-size: 18px; }
.hero-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.chip-link { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14); color: #fff; font-size: 14.5px; font-weight: 600; text-decoration: none; }
.chip-link:hover { background: rgba(255, 255, 255, .13); }
.chip-link .ic { width: 17px; height: 17px; color: var(--mint); }

/* ---------- Layout: contents + article ---------- */
.layout { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); gap: 56px; width: min(1320px, 100% - 40px); margin-inline: auto; padding: 40px 0 80px; }
.toc { position: sticky; top: 92px; align-self: start; max-height: calc(100vh - 110px); overflow-y: auto; padding-right: 6px; font-size: 14.5px; }
.toc summary { display: none; }
.toc-title { margin: 0 0 10px; color: var(--text-3); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 1px 0; }
.toc a { display: block; padding: 6px 12px; border-radius: 8px; color: var(--text-2); text-decoration: none; line-height: 1.4; border-left: 2px solid transparent; }
.toc a:hover { color: var(--ink); background: var(--bg-2); }
.toc a.active { color: var(--link); background: var(--tile); font-weight: 700; }
.toc ol ol a { padding-left: 26px; font-size: 13.5px; }

.article { min-width: 0; max-width: 860px; }
.article > section { padding-bottom: 28px; margin-bottom: 40px; border-bottom: 1px solid var(--border); }
.article > section:last-child { border-bottom: 0; }
.article h2 { display: flex; align-items: center; gap: 12px; margin: 0 0 6px; color: var(--ink); font-size: 30px; line-height: 1.2; letter-spacing: -.03em; font-weight: 800; }
.article h2 .num { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--tile); color: var(--link); font-size: 16px; font-weight: 800; letter-spacing: 0; }
.article h3 { margin: 34px 0 6px; color: var(--ink); font-size: 21px; line-height: 1.3; letter-spacing: -.02em; font-weight: 750; }
.article p { margin: 10px 0; }
.lede { color: var(--text-2); font-size: 18px; }
.article ul, .article ol { padding-left: 22px; }
.article li { margin: 6px 0; }
.article li::marker { color: var(--text-3); }

/* Steps that refer to the numbered callouts on a screenshot */
ol.steps { list-style: none; padding: 0; counter-reset: step; }
ol.steps > li { position: relative; padding-left: 40px; margin: 12px 0; }
ol.steps > li::before {
  counter-increment: step; content: counter(step); position: absolute; left: 0; top: 2px;
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--callout); color: #fff; font-size: 13px; font-weight: 800; box-shadow: 0 0 0 2px var(--bg);
}
ol.steps.plain > li::before { background: var(--tile); color: var(--link); }
.mark { display: inline-grid; place-items: center; width: 22px; height: 22px; margin: 0 2px; border-radius: 50%; background: var(--callout); color: #fff; font-size: 12px; font-weight: 800; vertical-align: 2px; }

/* Screenshots */
.shot { margin: 22px 0 26px; }
.shot a { display: block; width: fit-content; max-width: 100%; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; cursor: zoom-in; background: var(--card); }
.shot.full a { width: 100%; }
.shot.full img, .pair .shot img, .phones .shot img { width: 100%; }
.shot figcaption { margin-top: 10px; color: var(--text-3); font-size: 14px; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.pair .shot { margin: 18px 0; }
.phones { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 22px 0; }
.phones .shot { margin: 0; }
.phones .shot a { border-radius: 22px; }

/* Notes and tables */
.note, .warn { display: flex; gap: 12px; margin: 18px 0; padding: 14px 16px; border-radius: 12px; font-size: 15px; line-height: 1.6; }
.note { background: var(--note-bg); border: 1px solid color-mix(in srgb, var(--emerald) 22%, transparent); }
.warn { background: var(--warn-bg); border: 1px solid var(--warn-border); }
.note .ic { color: var(--emerald); margin-top: 3px; }
.warn .ic { color: var(--callout); margin-top: 3px; }
.note p, .warn p { margin: 0; }
.note p + p, .warn p + p { margin-top: 6px; }
kbd { display: inline-block; min-width: 24px; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--border-2); border-bottom-width: 2px; background: var(--card); color: var(--ink); font: 600 13px/1.6 var(--font); text-align: center; }
code { padding: 1px 6px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--border); font: 13.5px var(--mono); }
.ui { font-weight: 700; color: var(--ink); }
.table-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--border); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
th { background: var(--bg-2); color: var(--text-2); font-size: 13px; font-weight: 700; letter-spacing: .02em; }
tr:last-child td { border-bottom: 0; }
.cols { columns: 2; column-gap: 32px; }
.cols li { break-inside: avoid; }
details.faq { margin: 10px 0; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
details.faq summary { padding: 14px 18px; cursor: pointer; color: var(--ink); font-weight: 700; list-style: none; display: flex; align-items: center; gap: 10px; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: ""; width: 9px; height: 9px; margin-left: auto; border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3); transform: rotate(45deg); transition: transform .2s; }
details.faq[open] summary::after { transform: rotate(-135deg); }
details.faq > div { padding: 0 18px 14px; color: var(--text-2); }
details.faq > div p { margin: 6px 0; }

/* ---------- Footer ---------- */
.foot { background: var(--forest-900); color: #b9cdc3; font-size: 14.5px; }
.foot-in { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; width: min(1320px, 100% - 40px); margin-inline: auto; padding: 30px 0; }
.foot .brand { color: #fff; font-size: 17px; }
.foot a { color: #e2efe8; }
.foot .grow { flex: 1; }

/* ---------- Image viewer ---------- */
.viewer { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 24px; border: 0; background: rgba(4, 12, 9, .97); display: none; place-items: center; }
.viewer[open] { display: grid; }
.viewer::backdrop { background: transparent; }
.viewer img { max-width: min(100%, 1600px); max-height: calc(100vh - 90px); width: auto; height: auto; border-radius: 12px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); cursor: zoom-out; }
.viewer p { margin: 12px 0 0; color: #cfe3d9; font-size: 14.5px; text-align: center; }
.viewer-close { position: fixed; top: 14px; right: 14px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; }
.viewer-close:hover { background: rgba(255, 255, 255, .22); }

/* ---------- Smaller screens ---------- */
@media (max-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 18px; }
  .toc { position: static; max-height: none; margin-bottom: 28px; padding: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
  .toc summary { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; cursor: pointer; color: var(--ink); font-weight: 700; list-style: none; }
  .toc summary::-webkit-details-marker { display: none; }
  .toc summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3); transform: rotate(45deg); }
  .toc[open] summary::after { transform: rotate(-135deg); }
  .toc .toc-title { display: none; }
  .toc > ol { padding: 0 10px 12px; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav-in, .hero-in, .layout, .foot-in { width: calc(100% - 32px); }
  .nav-in { height: 60px; gap: 8px; }
  .nav-links a:not(.cta) { display: none; }
  .brand-tag { display: none; }
  .hero-in { padding: 36px 0 34px; }
  .hero p { font-size: 16.5px; }
  .article h2 { font-size: 25px; }
  .article h3 { font-size: 19px; }
  .pair { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .phones { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols { columns: 1; }
  .viewer { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
@media print {
  .nav, .toc, .foot, .theme-toggle { display: none !important; }
  .layout { display: block; width: auto; padding: 0; }
  .shot a { box-shadow: none; }
  .article > section { break-inside: avoid-page; }
}
