/* Neat Mail AI — manual landing + shared offline manual (dark theme) */
:root {
  --bg: #12151e;
  --bg-elevated: #1a1f2e;
  --accent: #00aeef;
  --accent-muted: rgba(0, 174, 239, 0.12);
  --text: #e8eaed;
  --text-secondary: #9aa0a6;
  --border: #2a3142;
  --font: "Segoe UI", system-ui, -apple-system, "Malgun Gothic", "Microsoft YaHei", sans-serif;
  --fs-root: 17px;
  --fs-body: 1.06rem;
  --fs-lead: 1.12rem;
  --fs-h1: 1.75rem;
  --fs-h2: 1.2rem;
  --max-content: 840px;
}

* { box-sizing: border-box; }
html { font-size: var(--fs-root); }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: var(--fs-body);
  line-height: 1.65;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: 14px 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.site-header .brand {
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: 0.02em;
  color: var(--text);
}
.site-header .brand span { color: var(--accent); }

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
}
.header-actions a { font-size: 1rem; padding: 7px 14px; border-radius: 6px; }
.header-actions a.home { color: var(--text-secondary); }
.header-actions a.home:hover { color: var(--text); }
.header-actions a.cta {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.header-actions a.cta:hover { filter: brightness(1.08); text-decoration: none; }

/* Google AdSense (display unit; class name used by Google) */
.manual-ad {
  max-width: min(920px, 100%);
  margin: 16px auto;
  padding: 0 20px;
  text-align: center;
}
.manual-ad ins.adsbygoogle { background: transparent; }

.lang-picker {
  max-width: 720px;
  margin: 40px auto 48px;
  padding: 0 20px;
}
.lang-picker h1 { text-align: center; margin-bottom: 12px; font-size: 1.85rem; }

.landing-intro {
  text-align: center;
  color: var(--text-secondary);
  font-size: var(--fs-lead);
  line-height: 1.65;
  max-width: 42rem;
  margin: 0 auto 20px;
}
.landing-intro p { margin: 0; }

.landing-screenshot {
  margin: 0 auto 24px;
  max-width: min(920px, 100%);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
  background: var(--bg-elevated);
}
.landing-screenshot img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

.landing-store {
  text-align: center;
  margin: 0 0 28px;
}
.landing-store .store-badge {
  display: inline-block;
  line-height: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.landing-store .store-badge:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-muted);
  text-decoration: none;
}
.landing-store .store-badge img {
  display: block;
  width: 200px;
  height: auto;
  max-width: min(200px, 100%);
}

.lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.lang-card {
  display: block;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 16px;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.lang-card:hover {
  border-color: var(--accent);
  background: rgba(0, 174, 239, 0.06);
  text-decoration: none;
}
.lang-card strong { display: block; font-size: 1.12rem; margin-bottom: 6px; }
.lang-card span { font-size: 0.98rem; color: var(--text-secondary); }

/* --- Chapter pages (layout + TOC + article body) --- */
.layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 0;
  max-width: 1280px;
  margin: 0 auto;
  min-height: calc(100vh - 58px);
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .toc {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 50vh;
    overflow-y: auto;
  }
}

.toc {
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  padding: 16px 14px 32px;
}
.toc > h2 {
  margin: 0 0 14px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  font-weight: 600;
}

.toc-group { margin-bottom: 18px; }
.toc-group h3 {
  margin: 0 0 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.toc-group ol {
  margin: 0;
  padding: 0 0 0 1rem;
  list-style-position: outside;
}
.toc-group li { margin: 7px 0; font-size: 0.98rem; line-height: 1.45; }
.toc-group li a { color: var(--text); }
.toc-group li a:hover { color: var(--accent); }
.toc-group li.active a {
  color: var(--accent);
  font-weight: 600;
}

main {
  padding: 22px 26px 48px;
  max-width: var(--max-content);
}
main h1 {
  margin: 0 0 14px;
  font-size: var(--fs-h1);
  line-height: 1.25;
  font-weight: 700;
}
main h2 {
  margin: 22px 0 10px;
  font-size: var(--fs-h2);
  font-weight: 600;
  color: var(--text);
}

.question-lead {
  font-size: var(--fs-lead);
  color: var(--text-secondary);
  margin: 0 0 18px;
  line-height: 1.55;
}

ol.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
ol.steps > li {
  position: relative;
  margin: 0 0 18px;
  padding: 0 0 0 2.5rem;
  border-left: 2px solid var(--border);
}
ol.steps > li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--accent-muted);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1.75rem;
  text-align: center;
}
.step-title {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
ol.steps li p { margin: 0; color: var(--text-secondary); }
ol.steps li p strong { color: var(--text); }

main code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.92em;
  background: rgba(0, 0, 0, 0.35);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.note {
  background: var(--accent-muted);
  border-left: 3px solid var(--accent);
  padding: 12px 14px;
  margin: 16px 0;
  font-size: 0.92rem;
}

.screenshot-placeholder { margin: 20px 0; }
.screenshot-frame {
  min-height: 200px;
  border-radius: 8px;
  border: 1px dashed var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 0.98rem;
}

.index-toc .toc-group { margin-bottom: 22px; }
.index-toc .toc-group ol { list-style: decimal; padding-left: 1.25rem; }
