:root {
  --bg: #ffffff;
  --surface: #f3f5fb;
  --ink: #101828;
  --muted: #5d6579;
  --line: #e1e5ef;
  --accent: #2457ff;
  --accent-soft: #e8eeff;
  --on-accent: #ffffff;
  --ok: #0e9f6e;
  --radius: 14px;
  --max: 780px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1020;
    --surface: #161a2e;
    --ink: #eef1fa;
    --muted: #a6adc4;
    --line: #272d47;
    --accent: #7590ff;
    --accent-soft: #1d2647;
    --on-accent: #0d1020;
    --ok: #34c98d;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Sora", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.6rem, 5vw, 2.3rem); margin: 0 0 .5rem; }
h2 { font-size: clamp(1.25rem, 3.6vw, 1.6rem); margin: 2.6rem 0 .8rem; }
h3 { font-size: 1.05rem; margin: 1.4rem 0 .4rem; }
p, li { max-width: 68ch; }
p { margin: 0 0 1rem; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 18px; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 10; }
.site-header .wrap { display: flex; align-items: center; gap: 14px; height: 56px; }
.brand { font-weight: 700; text-decoration: none; color: var(--ink); white-space: nowrap; font-size: 1.05rem; }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-left: auto; }
.nav::-webkit-scrollbar { display: none; }
.nav a { text-decoration: none; color: var(--muted); font-size: .9rem; padding: 6px 10px; border-radius: 999px; white-space: nowrap; }
.nav a[aria-current="page"], .nav a:hover { color: var(--ink); background: var(--surface); }

/* Hero + generator */
.hero { padding: 28px 0 8px; }
.hero .lead { color: var(--muted); font-size: 1.05rem; }
.crumbs { font-size: .85rem; color: var(--muted); margin: 14px 0 0; }
.crumbs a { color: var(--muted); }

.gen { margin: 18px 0 8px; }
.gen textarea {
  width: 100%; min-height: 84px; resize: vertical;
  font: inherit; font-size: 1.15rem; color: var(--ink);
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; outline: none;
}
.gen textarea:focus { border-color: var(--accent); }
.gen-hint { font-size: .85rem; color: var(--muted); margin: 8px 2px 0; }
.gen-results { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.gen-row {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name copy" "text copy";
  gap: 2px 12px; align-items: center;
  padding: 10px 14px; border-top: 1px solid var(--line);
}
.gen-row:first-child { border-top: 0; }
.gen-row:nth-child(even) { background: var(--surface); }
.gen-name { grid-area: name; font-size: .72rem; color: var(--muted); text-transform: none; }
.gen-text { grid-area: text; font-size: 1.35rem; line-height: 1.4; overflow-wrap: anywhere; }
.gen-copy {
  grid-area: copy; font: inherit; font-size: .85rem; font-weight: 600;
  background: var(--accent); color: var(--on-accent); border: 0; border-radius: 999px;
  padding: 8px 14px; cursor: pointer; min-width: 84px;
}
.gen-copy:hover { filter: brightness(1.08); }
.gen-copy.is-copied { background: var(--ok); color: #fff; }

/* Platform chips */
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 18px 0 8px; }
.chips a {
  display: block; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
.chips a:hover { border-color: var(--accent); }
.chips strong { display: block; font-size: .95rem; }
.chips span { font-size: .8rem; color: var(--muted); }

/* Content */
.content { padding-bottom: 40px; }
.content ul, .content ol { padding-left: 1.2rem; }
.content li { margin: .3rem 0; }
.example { font-size: 1.15rem; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; margin: .5rem 0 1.2rem; }
.table-wrap { overflow-x: auto; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; }
td .big { font-size: 1.3rem; }
code, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; background: var(--surface); padding: 1px 6px; border-radius: 6px; }

/* Symbol grids */
.sym-grid { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 14px; }
.sym {
  font-size: 1.35rem; line-height: 1; padding: 9px 11px; min-width: 44px; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; user-select: none;
}
.sym:hover { border-color: var(--accent); }
.sym.is-copied { background: var(--accent-soft); border-color: var(--accent); }
.sym-note { font-size: .85rem; color: var(--muted); margin: -6px 0 14px; }

/* FAQ */
.faq details { border-top: 1px solid var(--line); padding: 10px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; }
.faq summary::marker { color: var(--accent); }
.faq p { margin: .6rem 0 .2rem; color: var(--muted); }

/* Ads */
.ad { margin: 22px 0; min-height: 90px; }

/* Toast */
#toast {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 10px);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: .9rem;
  opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; z-index: 20; max-width: 90vw; overflow-wrap: anywhere;
}
#toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 24px 0 36px; color: var(--muted); font-size: .88rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 10px; }
.site-footer a { color: var(--muted); }

/* 404 */
.notfound { padding: 60px 0; }

@media (min-width: 640px) {
  .gen-row { grid-template-columns: 150px 1fr auto; grid-template-areas: "name text copy"; }
  .gen-name { font-size: .78rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #toast { transition: none; }
}
