:root {
  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-2: #eaf0ee;
  --ink: #0f172a;
  --ink-2: #3f4b5c;
  --ink-3: #6b7686;
  --line: #d9e1de;
  --accent: #0b7a6f;
  --accent-ink: #08655c;
  --accent-soft: #d8efeb;
  --live: #d92d4a;
  --focus: #2563eb;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(15 23 42 / 6%), 0 6px 20px rgb(15 23 42 / 6%);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1210;
    --surface: #151c19;
    --surface-2: #1d2622;
    --ink: #e8efec;
    --ink-2: #b8c4c0;
    --ink-3: #8a9893;
    --line: #2a3531;
    --accent: #35c2b2;
    --accent-ink: #5fd6c8;
    --accent-soft: #123631;
    --live: #ff6b81;
    --focus: #8cc4ff;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 6px 20px rgb(0 0 0 / 25%);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 var(--font);
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--accent-ink); text-underline-offset: 2px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
code, kbd { font-family: var(--mono); font-size: 0.88em; }
code { background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 5px; }
kbd { background: var(--surface); border: 1px solid var(--line); border-bottom-width: 2px; padding: 0.05em 0.4em; border-radius: 6px; white-space: nowrap; }
pre { background: var(--surface-2); padding: 14px 16px; border-radius: 10px; overflow-x: auto; font-size: 0.9em; }
pre code { background: none; padding: 0; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 10; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 780px; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.header-inner { display: flex; align-items: center; gap: 20px; min-height: 64px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.2rem; letter-spacing: -0.01em; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: #fff; }
.brand-mark svg { width: 20px; height: 20px; }
.site-nav { margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: 0.95rem; white-space: nowrap; }
.site-nav a:hover, .site-nav a[aria-current="page"] { background: var(--surface-2); color: var(--ink); }
@media (max-width: 760px) {
  .header-inner { gap: 4px; padding-top: 10px; }
  .site-nav { margin: 0 -16px; padding: 0 12px 8px; width: calc(100% + 32px); }
}

/* Breadcrumbs */
.crumbs { margin: 22px 0 0; font-size: 0.88rem; color: var(--ink-3); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line); }
.crumbs a { color: var(--ink-3); }

/* Page head */
.page-head { padding: 18px 0 8px; }
.page-head h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 12px; }
.lead { font-size: 1.15rem; color: var(--ink-2); margin: 0 0 18px; }
.home-head { text-align: center; padding: 34px 0 6px; }
.home-head h1 { font-size: clamp(2rem, 6vw, 3rem); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 10px; }
.home-head .lead { max-width: 600px; margin: 0 auto 18px; }

/* Article body */
.prose h2 { font-size: 1.45rem; line-height: 1.25; margin: 2.2em 0 0.6em; letter-spacing: -0.01em; }
.prose h3 { font-size: 1.12rem; margin: 1.8em 0 0.4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 0.3em 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: 0.95rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-weight: 650; color: var(--ink-2); background: var(--surface-2); }
.prose blockquote { margin: 1.2em 0; padding: 4px 18px; border-left: 4px solid var(--accent); color: var(--ink-2); }
.note { background: var(--surface-2); border-radius: var(--radius); padding: 14px 18px; margin: 1.4em 0; }
.note p { margin: 0.3em 0; }

/* Dictation tool */
.tool { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 18px; margin: 8px 0 26px; }
.tool-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; justify-content: space-between; }
.mic {
  display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font: inherit; font-weight: 700; font-size: 1.05rem;
  background: var(--accent); color: #fff; border: 0; border-radius: 999px; padding: 12px 22px 12px 14px; min-height: 52px;
}
.mic:hover { filter: brightness(1.08); }
.mic .mic-icon { width: 28px; height: 28px; background: rgb(255 255 255 / 18%); border-radius: 50%; padding: 4px; }
.mic[aria-pressed="true"] { background: var(--live); }
.mic[aria-pressed="true"] .mic-icon { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgb(255 255 255 / 45%); } 50% { box-shadow: 0 0 0 8px rgb(255 255 255 / 0%); } }
@media (prefers-reduced-motion: reduce) { .mic[aria-pressed="true"] .mic-icon { animation: none; } }
@media (prefers-color-scheme: dark) {
  .mic, .brand-mark { color: #04211d; }
  .mic .mic-icon { background: rgb(0 0 0 / 12%); }
  .mic[aria-pressed="true"] { color: #2a0610; }
}
.tool-lang { display: inline-flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--ink-2); }
.tool-lang select { font: inherit; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.tool-status { margin: 12px 0 10px; font-size: 0.95rem; color: var(--ink-2); min-height: 1.5em; }
.tool-box textarea {
  width: 100%; min-height: 260px; resize: vertical; font: 1.1rem/1.6 var(--font); color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
}
.tool-box textarea:focus { outline: 3px solid var(--focus); outline-offset: 1px; }
.tool-interim { margin: 8px 2px 0; min-height: 1.6em; color: var(--ink-3); font-style: italic; }
.tool-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.tool-count { color: var(--ink-3); font-size: 0.9rem; }
.tool-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.tool-unsupported { margin-top: 14px; background: var(--accent-soft); border-radius: 12px; padding: 12px 16px; }
.tool-unsupported p { margin: 0; }
.tool-debug { margin-top: 14px; border: 1px dashed var(--line); border-radius: 12px; padding: 10px 14px; }
.tool-debug summary { cursor: pointer; font-weight: 650; }
.tool-debug pre { max-height: 260px; overflow: auto; font-size: 0.78rem; white-space: pre-wrap; word-break: break-word; }
.tool-privacy { margin: 14px 0 0; font-size: 0.82rem; color: var(--ink-3); }

/* Cards and lists */
.card-list { list-style: none; padding: 0 !important; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.card-list li { margin: 0 !important; }
.card-list a { display: block; height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--ink); }
.card-list a:hover { border-color: var(--accent); }
.card-list strong { display: block; margin-bottom: 2px; }
.card-list span { color: var(--ink-2); font-size: 0.92rem; line-height: 1.45; display: block; }

/* Offers */
.offer { margin: 2em 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.offer-heading { font-weight: 700; margin: 0 0 12px; }
.offer-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.offer-card { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 10px; background: var(--surface-2); text-decoration: none; color: var(--ink); }
.offer-card:hover { outline: 2px solid var(--accent); }
.offer-card span { font-size: 0.9rem; color: var(--ink-2); line-height: 1.45; }
.offer-card .offer-cta { margin-top: auto; padding-top: 6px; font-weight: 700; color: var(--accent-ink); }
.offer-disclosure { margin: 12px 0 0; font-size: 0.8rem; color: var(--ink-3); }

/* Promo slots */
.promo { display: flex; justify-content: center; margin: 2em auto; }
.promo a { display: block; line-height: 0; border-radius: 16px; }
.promo img { display: block; height: auto; }
.promo-rect { min-height: 250px; }
.promo-banner { margin: 0 auto 28px; padding: 0 16px; }
.promo-banner img { width: 728px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font: inherit; font-weight: 650; font-size: 0.95rem;
  background: var(--ink); color: var(--bg); border: 1px solid var(--ink); border-radius: 999px; padding: 8px 16px; text-decoration: none;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn svg { width: 18px; height: 18px; }

/* Article footer */
.article-foot { margin: 3em 0 0; padding-top: 1.4em; border-top: 1px solid var(--line); }
.article-foot h2 { font-size: 1.1rem; margin: 0 0 12px; }
.share-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 26px; color: var(--ink-3); font-size: 0.88rem; }

/* Footer */
.site-footer { margin-top: 72px; border-top: 1px solid var(--line); background: var(--surface-2); padding: 34px 0 26px; font-size: 0.92rem; }
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 24px; }
.footer-cols h2 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); margin: 0 0 8px; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; }
.footer-cols li { margin: 4px 0; }
.footer-cols a { color: var(--ink-2); text-decoration: none; }
.footer-cols a:hover { color: var(--accent-ink); text-decoration: underline; }
.footer-bottom { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--ink-3); }
.footer-bottom p { margin: 0; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 650;
  transition: opacity 0.18s, transform 0.18s; z-index: 20;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* 404 */
.not-found { text-align: center; padding: 60px 0 20px; }
.not-found .big { width: 72px; height: 72px; color: var(--accent); }
