/* Ferna TTS – guide pages (shared by install.html and manual.html) */
:root {
  --navy: #0f172a; --navy-2: #1e293b; --slate: #475569; --slate-light: #94a3b8;
  --bg: #f8fafc; --surface: #fff; --border: #e2e8f0;
  --accent: #2563eb; --accent-dark: #1d4ed8; --accent-soft: #eff6ff;
  --ok: #047857; --ok-soft: #ecfdf5; --warn: #92400e; --warn-soft: #fef3c7;
  --radius: 14px; --shadow: 0 10px 30px -14px rgba(15, 23, 42, .25);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--bg); color: var(--slate);
  font: 16px/1.7 "Inter", "Noto Sans Sinhala", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
h1, h2, h3, h4 { color: var(--navy); line-height: 1.25; letter-spacing: -.015em; }
img, svg { max-width: 100%; }
code, kbd { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .88em; }
code { background: #f1f5f9; border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; color: var(--navy-2); overflow-wrap: anywhere; }
kbd {
  display: inline-block; min-width: 1.7em; text-align: center; padding: 1px 7px;
  background: #fff; border: 1px solid #cbd5e1; border-bottom-width: 3px; border-radius: 6px;
  color: var(--navy); font-weight: 600; white-space: nowrap;
}

/* top bar */
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(15, 23, 42, .94); backdrop-filter: blur(10px); }
.topbar .in { max-width: 1120px; margin: 0 auto; padding: 0 16px; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand small { display: block; font-size: .66rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--slate-light); }
.topnav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.topnav a { color: #cbd5e1; text-decoration: none; font-size: .9rem; font-weight: 500; padding: 7px 12px; border-radius: 8px; }
.topnav a:hover, .topnav a[aria-current="page"] { color: #fff; background: rgba(37, 99, 235, .3); }

/* hero */
.hero { background: radial-gradient(800px 360px at 85% -20%, rgba(37, 99, 235, .4), transparent 60%), var(--navy); color: #cbd5e1; }
.hero .in { max-width: 1120px; margin: 0 auto; padding: 48px 16px 44px; }
.crumb { font-size: .82rem; color: var(--slate-light); margin: 0 0 14px; }
.crumb a { color: #93c5fd; text-decoration: none; }
.hero h1 { color: #fff; font-size: clamp(1.9rem, 4.4vw, 2.8rem); margin: 0 0 10px; font-weight: 800; }
.hero p.lead { font-size: 1.08rem; max-width: 720px; margin: 0 0 22px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { font-size: .78rem; font-weight: 600; padding: 4px 11px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); color: #e2e8f0; }

/* layout */
.layout { max-width: 1120px; margin: 0 auto; padding: 36px 16px 64px; display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; align-items: start; }
.toc { position: sticky; top: 84px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 18px 14px; font-size: .9rem; }
.toc h2 { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--slate-light); margin: 0 0 10px; }
.toc ol { margin: 0; padding-left: 20px; }
.toc li { margin: 4px 0; }
.toc a { color: var(--navy-2); text-decoration: none; }
.toc a:hover { color: var(--accent); }
.toc .print { margin-top: 14px; width: 100%; }

.doc section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 30px; margin-bottom: 22px; }
.doc h2 { font-size: 1.4rem; margin: 0 0 12px; display: flex; align-items: center; gap: 12px; }
.doc h2 .n { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: .95rem; }
.doc h3 { font-size: 1.08rem; margin: 22px 0 8px; }
.doc p { margin: 0 0 12px; }
.doc ul, .doc ol { margin: 0 0 12px; padding-left: 22px; }
.doc li { margin: 5px 0; }
.doc ol.steps { counter-reset: s; list-style: none; padding: 0; }
.doc ol.steps > li { counter-increment: s; position: relative; padding: 2px 0 6px 40px; }
.doc ol.steps > li::before {
  content: counter(s); position: absolute; left: 0; top: 2px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; font-size: .85rem; display: grid; place-items: center;
}

.note, .warn, .tip { border-radius: 12px; padding: 14px 16px; margin: 14px 0; font-size: .95rem; border: 1px solid; }
.note { background: var(--accent-soft); border-color: #bfdbfe; color: #1e3a8a; }
.warn { background: var(--warn-soft); border-color: #fde68a; color: var(--warn); }
.tip { background: var(--ok-soft); border-color: #a7f3d0; color: #065f46; }
.note b, .warn b, .tip b { color: inherit; }

table { width: 100%; border-collapse: collapse; margin: 8px 0 14px; font-size: .94rem; }
.tbl { overflow-x: auto; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--bg); color: var(--navy); font-weight: 600; font-size: .84rem; text-transform: uppercase; letter-spacing: .04em; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  padding: 11px 20px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .95rem;
  text-decoration: none; transition: transform .2s, box-shadow .2s, background-color .2s;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 20px -8px rgba(37, 99, 235, .7); }
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-2px); }
.btn-light { background: #fff; color: var(--navy); border-color: var(--border); }
.btn-light:hover { border-color: var(--navy); transform: translateY(-2px); }
.btn-ghost { background: rgba(255, 255, 255, .06); color: #e2e8f0; border-color: rgba(255, 255, 255, .2); }
.btn-ghost:hover { background: rgba(255, 255, 255, .14); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* little UI illustrations */
.win-dialog { max-width: 460px; margin: 14px 0; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid #1e40af; }
.win-dialog .bar { background: #1e40af; color: #fff; font-size: .78rem; padding: 6px 12px; }
.win-dialog .body { background: #2563eb; color: #fff; padding: 16px 18px; font-size: .9rem; line-height: 1.5; }
.win-dialog .body b { font-size: 1.15rem; display: block; margin-bottom: 6px; color: #fff; }
.win-dialog .body u { color: #fff; }
.win-dialog .foot { background: #1d4ed8; padding: 10px 14px; display: flex; justify-content: flex-end; gap: 8px; }
.win-dialog .foot span { background: #fff; color: var(--navy); border-radius: 4px; padding: 4px 14px; font-size: .82rem; font-weight: 600; }
.win-dialog .foot span.hl { outline: 3px solid #fbbf24; }

.ctrlbar { display: inline-flex; align-items: center; gap: 4px; background: var(--navy); color: #fff; border-radius: 12px; padding: 6px 8px; box-shadow: var(--shadow); margin: 6px 0 12px; flex-wrap: wrap; }
.ctrlbar span { min-width: 34px; height: 30px; padding: 0 8px; border-radius: 8px; display: grid; place-items: center; font-size: .85rem; background: rgba(255, 255, 255, .08); }
.ctrlbar span.on { background: var(--accent); }
.ctrlbar span.grip { background: none; color: var(--slate-light); letter-spacing: -2px; }

.footer { background: var(--navy); color: var(--slate-light); font-size: .86rem; }
.footer .in { max-width: 1120px; margin: 0 auto; padding: 24px 16px; display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; }
.footer a { color: #cbd5e1; text-decoration: none; }
.footer a:hover { color: #fff; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 22px; padding-top: 24px; }
  .toc { position: static; }
}
@media (max-width: 560px) {
  .doc section { padding: 20px 18px; }
  .topnav a { padding: 6px 8px; font-size: .84rem; }
  .brand small { display: none; }
  .hero .in { padding: 34px 16px 32px; }
}

@media print {
  html { scroll-padding-top: 0; }
  body { background: #fff; font-size: 11pt; }
  .topbar, .toc, .no-print, .footer .links { display: none !important; }
  .hero { background: none; color: var(--slate); }
  .hero .in { padding: 0 0 12px; }
  .hero h1 { color: var(--navy); }
  .pill { color: var(--slate); border-color: var(--border); background: none; }
  .crumb { display: none; }
  .layout { display: block; padding: 0; }
  .doc section { border: none; padding: 8px 0; margin: 0 0 8px; break-inside: avoid-page; }
  .doc h2 { break-after: avoid; }
  .footer { background: none; color: var(--slate); border-top: 1px solid var(--border); }
  .footer .in { padding: 10px 0 0; }
  a { color: inherit; text-decoration: none; }
}
