/* Stylzo design system ---------------------------------------------------- */
:root {
  --paper: #f6f4fb; --surface: #ffffff; --surface-2: #f0edf9;
  --ink: #1b1533; --muted: #5d5678; --line: #ded8ee;
  --accent: #4b2fe0; --accent-2: #e02fa0; --on-accent: #ffffff;
  --mark: #ffd84d; --ok: #1f9d55; --warn: #c58a00; --bad: #d13b5e;
  --radius: 14px; --radius-sm: 8px; --radius-pill: 999px;
  --shadow: 0 1px 2px rgb(27 21 51 / .06), 0 8px 24px -12px rgb(27 21 51 / .18);
  --shadow-lg: 0 2px 4px rgb(27 21 51 / .07), 0 24px 48px -20px rgb(27 21 51 / .3);
  --grad: linear-gradient(120deg, var(--accent), var(--accent-2));
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --glyphs: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Noto Sans Math", "Noto Sans Symbols 2", "Apple Symbols", system-ui, sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 1rem/1.6 var(--body); overflow-wrap: break-word;
  background-image:
    radial-gradient(60rem 30rem at -10% -5%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    radial-gradient(50rem 30rem at 110% 10%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 60%),
    radial-gradient(40rem 26rem at 50% 115%, color-mix(in srgb, #7ef0c0 12%, transparent), transparent 60%);
  background-repeat: no-repeat;
}
::selection { background: var(--mark); color: #1c1633; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.wrap { width: min(100% - 2rem, 68rem); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }
[hidden] { display: none !important; }

/* Header ------------------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 0;
}
.site-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: var(--grad); opacity: .9;
}
.bar { display: flex; align-items: center; gap: 1.25rem; padding-block: .7rem; }
.brand { font: 700 1.5rem/1 var(--glyphs); color: var(--ink); text-decoration: none; margin-right: auto; letter-spacing: .01em; }
.brand-dot { color: var(--accent-2); }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; list-style: none; margin: 0; padding: 0; }
.nav > li { position: relative; }
.nav a { color: var(--ink); text-decoration: none; padding: .45rem .65rem; border-radius: var(--radius-sm); display: inline-block; font-weight: 500; font-size: .96rem; }
.nav a:hover, .nav a:focus-visible { background: var(--surface-2); text-decoration: none; }
.nav > li > a[aria-current="page"] { background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--accent); }
/* Keyword board nav item: sits a touch lower and carries the brand gradient */
.nav-board { top: .3rem; }
.nav-board > a {
  font-weight: 700; letter-spacing: .01em;
  background: linear-gradient(120deg, var(--accent), var(--accent-2), #7a3ff2, var(--accent));
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  animation: nav-board-flow 6s linear infinite;
}
.nav-board > a:hover, .nav-board > a:focus-visible {
  background: none; -webkit-text-fill-color: var(--accent-2); color: var(--accent-2);
  box-shadow: inset 0 -2px 0 var(--accent-2); text-decoration: none;
}
.nav-board > a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent-2); }
@keyframes nav-board-flow { to { background-position: 300% 0; } }
@media (prefers-reduced-motion: reduce) { .nav-board > a { animation: none; } }
.nav-sub-label > a::after { content: " ▾"; font-size: .7em; color: var(--muted); }
.subnav {
  position: absolute; top: calc(100% + .35rem); left: 0; min-width: 11rem;
  list-style: none; margin: 0; padding: .4rem; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: .16s ease;
  z-index: 50;
}
.has-sub:hover .subnav, .has-sub:focus-within .subnav { opacity: 1; visibility: visible; transform: translateY(0); }
.subnav a { display: block; padding: .45rem .7rem; border-radius: var(--radius-sm); }
.bar-actions { display: flex; align-items: center; gap: .5rem; }
.nav-toggle { display: none; }
.icon-btn {
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  width: 2.4rem; height: 2.4rem; border-radius: 50%; display: inline-grid; place-items: center;
  cursor: pointer; text-decoration: none;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.mobile-nav { border-top: 1px solid var(--line); background: var(--surface); }
.mobile-nav ul { list-style: none; margin: 0; padding: .5rem 0; }
.mobile-nav a { display: block; padding: .6rem 1rem; color: var(--ink); text-decoration: none; font-weight: 500; }
.mobile-nav a:hover { background: var(--surface-2); }
.mobile-nav .mobile-child a { padding-left: 2rem; font-weight: 400; color: var(--muted); }

/* Layout ------------------------------------------------------------------ */
main { padding-block: 1.5rem 4rem; position: relative; z-index: 1; }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: .75rem; }
.crumbs a { color: var(--muted); }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0 0 .5rem; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 6vw, 3.6rem); letter-spacing: -.015em; max-width: 22ch; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-top: 2.75rem; }
h3 { font-size: 1.1rem; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 62ch; margin: 0 0 1.5rem; }
.muted { color: var(--muted); }
/* The next step after a library page: a sentence that links onward to the tool
   that does the next job. Sits between the answer block and the long list. */
.next-step { color: var(--muted); max-width: 62ch; margin: -1rem 0 2rem; }
.accent-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Hero -------------------------------------------------------------------- */
.hero { position: relative; padding: 1.5rem 0 .5rem; }
.hero h1 { margin-bottom: .75rem; }
.hero-3d { position: relative; height: 380px; border-radius: var(--radius); overflow: hidden; pointer-events: none; z-index: 0; box-shadow: 0 20px 44px -22px var(--accent); opacity: 0; transform: translateY(10px) scale(.985); transition: opacity .7s ease, transform .7s cubic-bezier(.22,.68,.32,1); }
.hero-3d[data-ready="true"] { opacity: 1; transform: none; }
.hero-3d > div { height: 100%; }
.hero-3d-skeleton { position: absolute; inset: 0; border-radius: var(--radius); background: radial-gradient(60% 80% at 30% 40%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%), var(--surface-2); }
.hero-3d canvas { width: 100%; height: 100%; display: block; opacity: .95; border-radius: var(--radius); }
@media (min-width: 861px) {
  .hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 1.5rem 2rem; align-items: start; }
  .hero > *:not(.hero-3d) { grid-column: 1; min-width: 0; }
  .hero > .hero-3d { grid-column: 2; grid-row: 1 / span 6; height: 420px; position: sticky; top: 5rem; }
}
@media (max-width: 640px) { .hero-3d { height: 260px; } }
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem; font: 600 .8rem/1 var(--body);
  text-transform: uppercase; letter-spacing: .12em; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  padding: .45rem .8rem; border-radius: var(--radius-pill); margin-bottom: 1rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }

/* Generator input --------------------------------------------------------- */
.gen {
  margin: 1.5rem 0 1.75rem; border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow);
  background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box;
  border: 2px solid transparent;
}
.gen-label { display: block; font-weight: 600; margin-bottom: .4rem; }
textarea {
  width: 100%; font: 400 1.5rem/1.4 var(--display); color: var(--ink);
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius-sm);
  padding: .9rem 1rem; resize: vertical; min-height: 4.5rem;
}
textarea:hover { border-color: var(--muted); }
textarea:focus-visible { border-color: var(--accent); outline-offset: 0; }
.gen-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: .6rem; }
.count { color: var(--muted); font-size: .9rem; margin-right: auto; font-variant-numeric: tabular-nums; }

/* Buttons, chips, badges -------------------------------------------------- */
.btn {
  font: 600 .95rem var(--body); background: var(--accent); color: var(--on-accent);
  border: 2px solid var(--accent); border-radius: var(--radius-sm); padding: .5rem 1.15rem;
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center;
  gap: .4rem; min-height: 2.5rem; justify-content: center; transition: .15s ease;
  box-shadow: 0 8px 18px -10px var(--accent);
}
.btn.grad { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 10px 22px -10px var(--accent-2); }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--surface); box-shadow: none; }
.btn.subtle { background: var(--surface-2); border-color: transparent; color: var(--ink); }
.btn.small { font-size: .85rem; padding: .3rem .75rem; min-height: 2rem; }
.btn.done, .btn.done:hover { background: var(--mark); border-color: var(--mark); color: #1c1633; transform: none; box-shadow: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn[hidden] { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.5rem; }
.chips a {
  border: 1px solid var(--line); border-radius: var(--radius-pill); padding: .3rem .85rem;
  color: var(--ink); text-decoration: none; font-size: .92rem;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 25%, var(--line));
}
.chips a:hover { border-color: var(--accent); color: var(--accent); }
.chips a[aria-current="page"] { background: var(--grad); color: #fff; border-color: transparent; }
.badge {
  display: inline-block; font-size: .75rem; font-weight: 600; padding: .15rem .55rem;
  border-radius: var(--radius-pill); background: var(--surface-2); color: var(--muted);
}
.badge.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.badge.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.badge.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.badge.hot { background: color-mix(in srgb, var(--accent-2) 16%, transparent); color: var(--accent-2); }

/* Search ------------------------------------------------------------------ */
.search { position: relative; margin: .5rem 0 1.25rem; }
.search input {
  width: 100%; font: 500 1rem var(--body); color: var(--ink); background: var(--surface);
  border: 2px solid var(--line); border-radius: var(--radius-pill); padding: .7rem 1.1rem .7rem 2.6rem;
}
.search input:focus-visible { border-color: var(--accent); outline-offset: 0; }
.search::before {
  content: ""; position: absolute; left: .95rem; top: 50%; width: .95rem; height: .95rem;
  transform: translateY(-58%); opacity: .55;
  background: currentColor; color: var(--muted);
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="black" d="M10 2a8 8 0 1 0 4.9 14.32l5.39 5.4 1.42-1.42-5.4-5.39A8 8 0 0 0 10 2Zm0 2a6 6 0 1 1 0 12 6 6 0 0 1 0-12Z"/></svg>') center/contain no-repeat;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="black" d="M10 2a8 8 0 1 0 4.9 14.32l5.39 5.4 1.42-1.42-5.4-5.39A8 8 0 0 0 10 2Zm0 2a6 6 0 1 1 0 12 6 6 0 0 1 0-12Z"/></svg>') center/contain no-repeat;
}
.filter-count { color: var(--muted); font-size: .9rem; margin: -0.75rem 0 1rem; }

/* Style rows -------------------------------------------------------------- */
.rows {
  list-style: none; margin: 1rem 0 0; padding: .5rem; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
}
.row {
  display: grid; grid-template-columns: 11.5rem 1fr auto; gap: 1rem; align-items: center;
  padding: .8rem .85rem; border-radius: var(--radius-sm); border-bottom: 1px solid var(--line);
  content-visibility: auto; contain-intrinsic-size: auto 4.5rem; cursor: pointer;
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.row:last-child { border-bottom: 0; }
.row:hover {
  background: color-mix(in srgb, var(--accent) 9%, var(--surface-2));
  transform: translateY(-2px); box-shadow: var(--shadow);
}
.row-meta { min-width: 0; }
.row-name { font: 600 1rem var(--body); margin: 0; }
.row-name a { color: var(--ink); text-decoration: none; }
.row-name a:hover { color: var(--accent); text-decoration: underline; }
.row-support { margin: 0; font-size: .82rem; color: var(--muted); }
.row-support::before { content: ""; display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; margin-right: .4rem; background: var(--muted); }
.row-support[data-support="safe"]::before { background: var(--ok); }
.row-support[data-support="good"]::before { background: var(--warn); }
.row-support[data-support="limited"]::before { background: var(--bad); }
.out {
  margin: 0; font: 400 1.4rem/1.7 var(--glyphs); white-space: pre-wrap;
  overflow-wrap: anywhere; word-break: break-word; padding-block: .2rem; min-width: 0;
}
.rows.big { background: transparent; border: 0; box-shadow: none; padding: 0; }
.rows.big .row { border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.rows.big .out { font-size: clamp(1.6rem, 4vw, 2.2rem); }
.out-xl { font-size: clamp(1.6rem, 5vw, 2.6rem); }
.row-actions { display: flex; align-items: center; gap: .5rem; }
.icon-btn.fav { width: 2.2rem; height: 2.2rem; font-size: .95rem; color: var(--muted); }
.icon-btn.fav[aria-pressed="true"] { color: var(--accent-2); border-color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 10%, var(--surface)); }
.load-more { display: flex; justify-content: center; margin-top: 1.5rem; gap: 1rem; align-items: center; }
.load-more .muted { font-size: .9rem; }

/* Sections and cards ------------------------------------------------------ */
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .75rem; margin-top: 2.75rem; }
.section-head h2 { margin-top: 0; }
.section-head .more-link { font-size: .95rem; font-weight: 600; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.card h3 { margin-top: 0; }
.card p { margin: .35rem 0 .75rem; color: var(--muted); font-size: .95rem; }
.card .card-link { font-weight: 600; text-decoration: none; }
.card-emoji { font-size: 1.9rem; line-height: 1; display: block; margin-bottom: .5rem; }
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem; box-shadow: var(--shadow);
}
.prose { max-width: 42rem; }
.prose p { margin: 0 0 1rem; }
.prose h2:first-child { margin-top: 0; }
.more { margin-top: 1.25rem; }
.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }

/* Library pages (symbols / emoji / kaomoji) -------------------------------- */
.lib-group { margin-top: 2rem; }
.lib-group > h2 { margin-top: 0; font-size: 1.35rem; }
.lib-group .muted { margin-top: -.25rem; }
.lib-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
  gap: .5rem; margin-top: .9rem;
}
.lib-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem;
  min-height: 5.5rem; padding: .55rem .3rem; text-align: center; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--ink); font: 400 1.65rem/1 var(--glyphs); transition: .13s ease;
}
.lib-item:hover, .lib-item:focus-visible { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 10px 18px -10px var(--accent); }
.lib-item .lib-name {
  font: 500 .7rem/1.25 var(--body); color: var(--muted); max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lib-item.is-copied { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, var(--surface)); }
.lib-grid.kao .lib-item { font-size: 1.2rem; }

/* Tabs -------------------------------------------------------------------- */
.tabbar { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0 1.25rem; border-bottom: 1px solid var(--line); padding-bottom: .6rem; }
.tabbar button {
  font: 600 .9rem var(--body); background: none; border: 0; color: var(--muted);
  padding: .4rem .8rem; border-radius: var(--radius-pill); cursor: pointer;
}
.tabbar button:hover { background: var(--surface-2); color: var(--ink); }
.tabbar button[aria-selected="true"] { background: var(--ink); color: var(--paper); }

/* Tools ------------------------------------------------------------------- */
.tool-layout { display: grid; grid-template-columns: 16rem 1fr; gap: 1.25rem; margin-top: 1.25rem; align-items: start; }
.tool-nav { display: flex; flex-direction: column; gap: .3rem; position: sticky; top: 5rem; }
.tool-nav button {
  font: 600 .95rem var(--body); text-align: left; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6rem .8rem; cursor: pointer;
}
.tool-nav button:hover { border-color: var(--accent); color: var(--accent); }
.tool-nav button[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tool-panel label { display: block; font-weight: 600; margin-bottom: .35rem; font-size: .92rem; }
.tool-panel textarea { min-height: 9rem; font-size: 1.1rem; }
.tool-panel .gen-tools { margin-top: .75rem; }
.tool-out {
  margin-top: .9rem; padding: .9rem 1rem; background: var(--paper); border: 1px dashed var(--line);
  border-radius: var(--radius-sm); font: 400 1.15rem/1.6 var(--glyphs); white-space: pre-wrap;
  overflow-wrap: anywhere; min-height: 3.5rem;
}
.tool-out .metric { display: flex; flex-wrap: wrap; gap: 1.25rem; font: 600 1.05rem var(--body); color: var(--ink); }
.tool-out .metric span b { display: block; font-size: 1.5rem; font-family: var(--display); }
.tool-options { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.tool-options button { font: 500 .88rem var(--body); background: var(--surface-2); border: 1px solid transparent; border-radius: var(--radius-pill); padding: .35rem .8rem; cursor: pointer; color: var(--ink); }
.tool-options button:hover { border-color: var(--accent); }
.tool-options.field-row { align-items: center; }
.field-input {
  font: 500 .95rem var(--body); padding: .5rem .7rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.field-input:focus-visible { border-color: var(--accent); outline-offset: 0; }

/* Studio ------------------------------------------------------------------ */
.studio-layout { display: grid; grid-template-columns: minmax(0, 1fr) 18rem; gap: 1.25rem; margin-top: 1.25rem; align-items: start; }
.studio-stage {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem; box-shadow: var(--shadow); overflow: auto;
}
.studio-stage canvas { width: 100%; height: auto; display: block; border-radius: var(--radius-sm); background: #12101d; }
.studio-controls { display: flex; flex-direction: column; gap: .9rem; position: sticky; top: 5rem; }
.studio-controls .panel { padding: 1rem; }
.studio-controls label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .3rem; }
.studio-controls select, .studio-controls input[type="text"], .studio-controls input[type="number"] {
  width: 100%; font: 500 .95rem var(--body); color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .5rem .6rem;
}
.studio-controls input[type="range"] { width: 100%; accent-color: var(--accent); }
.studio-controls .swatches { display: flex; flex-wrap: wrap; gap: .4rem; }
.studio-controls .swatches button {
  width: 1.8rem; height: 1.8rem; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; padding: 0;
}
.studio-controls .swatches button[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--paper); }
.studio-style-select { margin-top: .5rem; width: 100%; font: 500 .9rem var(--body); color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .35rem; }
.swatches button[data-color="#ffffff"] { background: #ffffff; }
.swatches button[data-color="#ffd84d"] { background: #ffd84d; }
.swatches button[data-color="#1b1533"] { background: #1b1533; }
.swatches button[data-color="#ff8ad8"] { background: #ff8ad8; }
.swatches button[data-color="#7ef0c0"] { background: #7ef0c0; }
.swatches button[data-color="#a99bff"] { background: #a99bff; }
.swatches button[data-bg="midnight"] { background: #12101d; }
.swatches button[data-bg="violet"] { background: linear-gradient(120deg, #4b2fe0, #e02fa0); }
.swatches button[data-bg="sunset"] { background: linear-gradient(120deg, #ff9d3c, #ff4d6d); }
.swatches button[data-bg="paper"] { background: #f6f4fb; }
.swatches button[data-bg="mint"] { background: linear-gradient(120deg, #0f9d76, #7ef0c0); }
.studio-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.studio-note { font-size: .82rem; color: var(--muted); }

/* Account ----------------------------------------------------------------- */
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.auth-state { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.auth-note { font-size: .88rem; color: var(--muted); }
.fav-list { list-style: none; margin: .75rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.fav-list a { border: 1px solid var(--line); border-radius: var(--radius-pill); padding: .3rem .8rem; text-decoration: none; color: var(--ink); background: var(--surface); font-size: .9rem; }
.fav-list a:hover { border-color: var(--accent); color: var(--accent); }

/* Admin ------------------------------------------------------------------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .75rem; margin-top: 1.25rem; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; }
.stat-card b { display: block; font-size: 1.7rem; font-family: var(--display); line-height: 1.1; }
.stat-card span { color: var(--muted); font-size: .85rem; }
.table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: .93rem; }
.table th, .table td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
.table th { color: var(--muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; }
.table caption { text-align: left; color: var(--muted); font-size: .85rem; padding-bottom: .5rem; }
.table tbody th { text-transform: none; letter-spacing: 0; font-size: .95rem; color: var(--ink); }

/* Key facts. A definition list rather than cards, because the point of the
   block is that each label and value stay paired when the text is extracted
   out of its visual container by a reader or a model. */
.facts { margin: 1rem 0; display: grid; gap: .85rem; }
.facts > div { display: grid; gap: .15rem; border-left: 3px solid var(--line); padding-left: .9rem; }
.facts dt { color: var(--muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; }
.facts dd { margin: 0; line-height: 1.55; }
.facts dd b { font-family: var(--display); }
.key-form { display: flex; gap: .6rem; margin-top: 1rem; flex-wrap: wrap; }
.key-form input {
  font: 500 .95rem var(--body); color: var(--ink); background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: .5rem .7rem; min-width: 16rem;
}

/* Footer ------------------------------------------------------------------ */
.site-footer { border-top: 1px solid var(--line); padding: 2.5rem 0 1.5rem; color: var(--muted); font-size: .93rem; background: var(--surface); }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 1.5rem; }
.foot-grid h2 { font: 700 .8rem/1 var(--body); text-transform: uppercase; letter-spacing: .1em; color: var(--ink); margin: 0 0 .75rem; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.foot-grid a { color: var(--muted); text-decoration: none; }
.foot-grid a:hover { color: var(--accent); text-decoration: underline; }
.foot-wordmark { font: 700 1.4rem/1 var(--glyphs); color: var(--ink); margin: 0 0 .6rem; }
.foot-brand p.muted { margin: 0; max-width: 34ch; }
.foot-base { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: space-between; margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.foot-base p { margin: 0; }

/* Toast & misc ------------------------------------------------------------- */
.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 1rem);
  background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: #fff; padding: .65rem 1.1rem; border-radius: var(--radius-pill);
  opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; max-width: 90vw;
  z-index: 90; box-shadow: var(--shadow-lg); font-size: .93rem;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
code { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--surface-2); padding: .1rem .35rem; border-radius: 4px; font-size: .92em; }
pre code { display: block; padding: .8rem; overflow: auto; }

/* Motion helpers (JS sets the hidden state; no content is hidden without JS) */
.js-motion [data-reveal] { opacity: 0; }

@media (max-width: 900px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .tool-layout, .studio-layout { grid-template-columns: 1fr; }
  .tool-nav { flex-direction: row; flex-wrap: wrap; position: static; }
  .studio-controls { position: static; }
}
@media (max-width: 720px) {
  .nav { display: none; }
  .nav-toggle { display: inline-grid; }
  .row { grid-template-columns: 1fr auto; }
  .row-meta { grid-column: 1 / -1; display: flex; gap: .75rem; align-items: baseline; flex-wrap: wrap; }
  .bar { gap: .75rem 1rem; }
  .brand { font-size: 1.3rem; }
  .hero-3d { height: 260px; }
}
@media (max-width: 480px) {
  .foot-grid { grid-template-columns: 1fr; }
  .lib-grid { grid-template-columns: repeat(auto-fill, minmax(5.4rem, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .toast { transition: none; }
}

/* SEO keyword dashboard --------------------------------------------------- */
.kw-layout { display: grid; grid-template-columns: 17rem 1fr; gap: 1.5rem; margin-top: 1.5rem; align-items: start; }
.kw-drawer-toggle { display: none; width: 100%; margin-bottom: .75rem; }
.kw-sidebar {
  position: sticky; top: 5rem; max-height: calc(100vh - 6.5rem); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .75rem; box-shadow: var(--shadow);
}
.kw-sidebar-title { font: 600 .78rem var(--body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: .25rem .5rem .6rem; }
.kw-cat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .15rem; }
.kw-cat {
  display: grid; grid-template-columns: 1.4rem 1fr auto; align-items: center; gap: .5rem;
  width: 100%; text-align: left; background: transparent; border: 2px solid transparent;
  border-radius: var(--radius-sm); padding: .5rem .55rem; cursor: pointer;
  color: var(--ink); font: 500 .9rem/1.3 var(--body);
}
.kw-cat:hover { background: var(--surface-2); }
.kw-cat[aria-pressed="true"] { background: var(--grad); color: #fff; border-color: transparent; }
.kw-cat-icon { font: 1.05rem var(--glyphs); }
.kw-cat-count {
  font-variant-numeric: tabular-nums; font-size: .8rem; font-weight: 600;
  background: var(--surface-2); color: var(--muted);
  border-radius: var(--radius-pill); padding: .05rem .5rem; min-width: 1.6rem; text-align: center;
}
.kw-cat[aria-pressed="true"] .kw-cat-count { background: rgb(255 255 255 / .22); color: #fff; }

.kw-main { min-width: 0; }
.kw-controls { display: grid; gap: 1rem; margin: 1.5rem 0 .75rem; }
.kw-search label, .kw-sort label { display: block; font: 600 .85rem var(--body); margin-bottom: .35rem; }
.kw-search input {
  width: 100%; font: 1rem var(--body); color: var(--ink); background: var(--surface);
  border: 2px solid var(--line); border-radius: var(--radius-sm); padding: .6rem .8rem;
}
.kw-search input:focus-visible { border-color: var(--accent); outline-offset: 0; }
.kw-status { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.kw-status legend { font: 600 .85rem var(--body); padding: 0 0 .4rem; }
.kw-status-option {
  display: inline-flex; align-items: center; gap: .4rem; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  padding: .3rem .8rem; font-size: .88rem; background: var(--surface);
}
.kw-status-option:hover { border-color: var(--accent); }
.kw-status-option:has(input:checked) { background: var(--grad); color: #fff; border-color: transparent; }
.kw-status-option input { accent-color: var(--accent); margin: 0; }
.kw-status-option:has(input:checked) input { accent-color: #fff; }
.kw-count { color: var(--muted); font-size: .9rem; margin: 0 0 .75rem; }
.kw-rows .kw-row { grid-template-columns: 1fr; }
.kw-detail { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .5rem 1rem; margin: .75rem 0 0; }
.kw-detail div { min-width: 0; }
.kw-detail dt { font: 600 .72rem var(--body); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.kw-detail dd { margin: .1rem 0 0; font-size: .9rem; overflow-wrap: anywhere; }
.row-support[data-status-badge] { text-transform: capitalize; }
.row-support[data-status-badge="mapped"]::before { background: var(--ok); }
.row-support[data-status-badge="skipped"]::before { background: var(--warn); }
.row-support[data-status-badge="planned"]::before { background: var(--accent); }
.row-support[data-status-badge="needs-review"]::before,
.row-support[data-status-badge="unmapped"]::before { background: var(--bad); }
.kw-empty {
  background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 1.5rem; text-align: center; color: var(--muted);
}

/* Landing pages ----------------------------------------------------------- */
.style-cards { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }
.style-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.15rem; box-shadow: var(--shadow);
}
.style-card h3 { margin-bottom: .35rem; }
.style-card h3 a { color: var(--ink); text-decoration: none; }
.style-card h3 a:hover { color: var(--accent); text-decoration: underline; }
.style-card p { margin: 0; font-size: .93rem; }
.chip-list { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.chip-phrase, .chip-list a {
  display: inline-block; padding: .35rem .8rem; border-radius: var(--radius-pill);
  font-size: .9rem; background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line)); color: var(--ink);
  text-decoration: none;
}
.chip-list a:hover { border-color: var(--accent); color: var(--accent); }
.variations { margin-top: 2.5rem; }

/* /styles dashboard rules ------------------------------------------------ */
/* Sticky keyword dashboard on the left, in-page material panel on the right.
   The panel holds the same rows as /styles/<slug>, so copy and live typing
   work identically; the sidebar only swaps which keyword the panel shows. */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.kw-dash {
  display: grid; grid-template-columns: 19.5rem minmax(0, 1fr);
  gap: 1.5rem; align-items: start; margin-top: 2rem;
}
.kw-dash-side {
  grid-column: 1; grid-row: 1;
  position: sticky; top: 5.5rem; max-height: calc(100vh - 7rem);
  display: flex; flex-direction: column; min-height: 0;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 2px solid transparent; border-radius: var(--radius);
  background:
    linear-gradient(color-mix(in srgb, var(--surface) 90%, transparent), color-mix(in srgb, var(--surface) 90%, transparent)) padding-box,
    linear-gradient(120deg, #22d3ee, #7c3aed, #ff3fa4, #22d3ee) border-box;
  background-size: auto, 300% 100%;
  animation: kw-neon-border 7s linear infinite, kw-neon-glow 3.6s ease-in-out infinite;
  box-shadow: var(--shadow), 0 0 14px rgb(124 58 237 / .3), 0 0 28px rgb(255 63 164 / .2);
  overflow: hidden;
}
@keyframes kw-neon-border { to { background-position: 0 0, 300% 0; } }
@keyframes kw-neon-glow {
  50% { box-shadow: var(--shadow), 0 0 22px rgb(34 211 238 / .5), 0 0 46px rgb(255 63 164 / .35); }
}
@media (prefers-reduced-motion: reduce) {
  .kw-dash-side { animation: none; background-size: auto, 200% 100%; }
}
.kw-dash-main { grid-column: 2; grid-row: 1; min-width: 0; }

/* Sidebar tools: filter + position progress */
.kw-dash-tools {
  padding: .85rem .9rem .7rem; border-bottom: 1px solid var(--line);
  background: linear-gradient(var(--surface), var(--surface)) padding-box;
}
.kw-dash-tools .search { margin: 0 0 .65rem; }
.kw-dash-tools .search input { font-size: .92rem; padding: .5rem 1rem .5rem 2.4rem; }
.kw-progress { display: grid; gap: .3rem; }
.kw-progress-label {
  font: 600 .74rem var(--body); text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); display: flex; justify-content: space-between;
}
.kw-progress-track {
  display: block; height: .38rem; border-radius: var(--radius-pill);
  background: var(--surface-2); overflow: hidden;
}
.kw-progress-fill {
  display: block; height: 100%; border-radius: inherit; background: var(--grad);
  transition: width .5s cubic-bezier(.22,.68,.32,1);
}

/* Prev/next between keyword pages */
.kw-pager {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  margin-top: 2rem;
}
.kw-pager a { flex: 1 1 12rem; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: var(--radius); }
.kw-pager a:last-child { text-align: right; }
.kw-pager a:hover { border-color: var(--grad); }

/* Sticky keyword list */
.kw-boards { overflow-y: auto; overscroll-behavior: contain; padding: .65rem; flex: 1; min-height: 0; }
.kw-boards h2 {
  font: 600 .78rem var(--body); text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); margin: 0 0 .5rem; padding-inline: .35rem;
}
.kw-boards::-webkit-scrollbar { width: .5rem; }
.kw-boards::-webkit-scrollbar-thumb { background: var(--line); border-radius: var(--radius-pill); }
.kw-boards::-webkit-scrollbar-thumb:hover { background: var(--accent); }
.kw-boards-list {
  list-style: none; counter-reset: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: .3rem;
}
.kw-boards-list li { margin: 0; }
.kw-boards-list a {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 2.1rem minmax(0, 1fr); grid-template-areas: "num name" "num emoji";
  align-items: start; column-gap: .55rem; row-gap: .1rem;
  padding: .55rem .65rem; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease, color .18s ease;
}
/* Shine sweep on hover */
.kw-boards-list a::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgb(255 255 255 / .45) 50%, transparent 70%);
  transform: translateX(-130%); transition: transform .6s ease;
}
.kw-boards-list a:hover::before, .kw-boards-list a:focus-visible::before { transform: translateX(130%); }
.kw-boards-list a:hover, .kw-boards-list a:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  transform: translateX(3px); box-shadow: var(--shadow);
}
.kw-boards-list a[aria-current="page"] {
  background: var(--grad); border-color: transparent; color: #fff;
  box-shadow: 0 10px 22px -12px var(--accent-2);
}
.kw-boards-list a[aria-current="page"]:hover { transform: translateX(3px) scale(1.01); }
.kw-boards-num {
  grid-area: num; justify-self: center; margin-top: .15rem;
  font: 600 .74rem/1 var(--body); color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: var(--radius-pill); padding: .3rem 0; min-width: 2rem; text-align: center;
  font-variant-numeric: tabular-nums;
}
.kw-boards-list a[aria-current="page"] .kw-boards-num { background: rgb(255 255 255 / .22); color: #fff; }
.kw-boards-name {
  grid-area: name; font-weight: 600; font-size: .9rem; line-height: 1.35;
  white-space: normal; overflow-wrap: anywhere; text-wrap: pretty;
}
.kw-boards-emoji {
  grid-area: emoji; font: 400 .95rem/1.3 var(--glyphs);
  letter-spacing: .06em; white-space: nowrap; overflow: hidden;
  opacity: .95; transition: opacity .18s ease, transform .18s ease;
}
.kw-boards-list a:hover .kw-boards-emoji { opacity: 1; transform: scale(1.06); transform-origin: left center; }
.kw-boards-list a[aria-current="page"] .kw-boards-emoji { opacity: 1; }
/* Staggered entrance; only armed once the dashboard script has loaded. */
.js-motion .kw-boards-list li {
  animation: kw-item-in .5s cubic-bezier(.22,.68,.32,1) both;
  animation-delay: calc(var(--i, 0) * 28ms);
}
@keyframes kw-item-in {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: none; }
}
.kw-empty {
  margin: .5rem 0 0; padding: 1.25rem .75rem; text-align: center;
  border: 1px dashed var(--line); border-radius: var(--radius-sm);
  color: var(--muted); font-size: .9rem;
}

/* Material panel */
.kw-panel {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.4rem 1.4rem 1.1rem;
}
.kw-panel::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: var(--grad); opacity: .95;
}
.kw-panel-head { animation: kw-panel-in .45s cubic-bezier(.22,.68,.32,1) both; }
.kw-panel .kw-panel-head h2 { margin-top: 0; font-size: clamp(1.5rem, 3.2vw, 2.2rem); }
.kw-eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font: 600 .78rem/1 var(--body); text-transform: uppercase; letter-spacing: .12em;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent);
  padding: .4rem .8rem; border-radius: var(--radius-pill); margin-bottom: .75rem;
}
.kw-eyebrow::before {
  content: ""; width: .5rem; height: .5rem; border-radius: 50%;
  background: var(--grad); animation: kw-pulse 2.2s ease-in-out infinite;
}
@keyframes kw-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: .55; }
}
@keyframes kw-panel-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
/* Loading shimmer over the panel while the keyword's rows are fetched. */
.kw-panel.is-loading .rows { opacity: .18; filter: grayscale(.4); pointer-events: none; transition: opacity .2s ease, filter .2s ease; }
.kw-panel.is-loading::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgb(75 47 224 / .08) 50%, transparent 65%) no-repeat;
  background-size: 220% 100%; animation: kw-shimmer 1s linear infinite;
}
@keyframes kw-shimmer {
  from { background-position: 120% 0; }
  to { background-position: -120% 0; }
}
/* Rows stagger in after a keyword swap. */
.kw-swap .row {
  animation: kw-row-in .45s cubic-bezier(.22,.68,.32,1) both;
  animation-delay: calc(var(--i, 0) * 20ms);
}
@keyframes kw-row-in {
  from { opacity: 0; transform: translateY(10px) scale(.99); }
  to { opacity: 1; transform: none; }
}
.kw-panel .rows { margin-top: .75rem; }

/* Scroll reveals ----------------------------------------------------------- */
/* Only applied by /js/reveal.js. Content is visible by default, so the page
   stays readable without JS. */
[data-reveal="pending"] { opacity: 0; transform: translateY(14px); }
.reveal-armed { transition: opacity .55s ease, transform .55s cubic-bezier(.22,.68,.32,1); will-change: opacity, transform; }
[data-reveal="shown"] { opacity: 1; transform: none; will-change: auto; }

/* Home page ---------------------------------------------------------------- */
.how-steps { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); counter-reset: how; }
.how-steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.15rem; box-shadow: var(--shadow); }
.how-steps h3 { display: flex; gap: .55rem; align-items: baseline; font-size: 1.05rem; margin-bottom: .3rem; }
.how-steps h3::before {
  counter-increment: how; content: counter(how);
  font: 600 .85rem/1.6 var(--body); color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: var(--radius-pill); min-width: 1.6rem; height: 1.6rem; text-align: center; flex: none;
}
.how-steps p { margin: 0; font-size: .93rem; }
.how-note { margin-top: 1.25rem; }
.dest-list { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; gap: .85rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.dest-list li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1.1rem; box-shadow: var(--shadow); }
.dest-list a { font-weight: 600; color: var(--ink); text-decoration: none; }
.dest-list a:hover, .dest-list a:focus-visible { color: var(--accent); text-decoration: underline; }
.dest-list p { margin: .3rem 0 0; font-size: .92rem; color: var(--muted); }
.home-section > .muted { max-width: 62ch; }
.preview-grid {
  list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; gap: .75rem;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}
.preview-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .85rem 1rem; box-shadow: var(--shadow); min-width: 0;
}
.preview-name { font-size: .95rem; margin-bottom: .35rem; }
.preview-name a { color: var(--ink); text-decoration: none; }
.preview-name a:hover, .preview-name a:focus-visible { color: var(--accent); text-decoration: underline; }
.preview-out {
  margin: 0; font-family: var(--glyphs); font-size: 1.15rem; line-height: 1.35;
  overflow-wrap: anywhere; min-height: 2.7rem;
}
.preview-support { margin: .4rem 0 0; font-size: .8rem; color: var(--muted); }
.preview-support a { color: inherit; }

@media (max-width: 900px) {
  .kw-layout { grid-template-columns: 1fr; }
  .kw-drawer-toggle { display: inline-flex; }
  .kw-sidebar { position: static; max-height: none; display: none; }
  .kw-sidebar.is-open { display: block; }
  /* Dashboard stacks: keyword picker on top, material panel below. */
  .kw-dash { grid-template-columns: 1fr; gap: 1rem; }
  .kw-dash-side { grid-column: 1; grid-row: 1; position: static; max-height: none; }
  .kw-dash-main { grid-column: 1; grid-row: 2; }
  .kw-boards { max-height: 17rem; }
  .kw-boards-list { flex-direction: row; overflow-x: auto; overscroll-behavior-x: contain; padding-bottom: .35rem; }
  .kw-boards-list li { flex: none; min-width: 14rem; max-width: 18rem; width: max-content; animation-name: kw-item-in-x; }
  .js-motion .kw-boards-list li { animation-name: kw-item-in-x; }
  @keyframes kw-item-in-x {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
  }
}

/* Style page examples ------------------------------------------------------- */
/* Real rendered output, with the typed input shown underneath so a reader can
   see exactly how the characters were produced. */
.style-examples { margin: 2rem 0; }
.style-examples h2 { margin-bottom: .3rem; }
.example-list { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .75rem; }
.example-list li {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: .8rem 1rem; background: var(--surface);
}
.example-label {
  display: block; font: 600 .72rem var(--body); text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); margin-bottom: .35rem;
}
.example-out {
  margin: 0 0 .35rem; font-size: 1.1rem; line-height: 1.4;
  word-break: break-word;
}
/* The typed source, so the transformation is legible rather than magic. */
.example-plain { font-size: .78rem; color: var(--muted); font-family: ui-monospace, Menlo, Consolas, monospace; }

/* Answer-first blocks -------------------------------------------------------- */
/* Used to answer the page's core question in one or two sentences before the
   longer prose, both for readers who scan and for AI engines that need a
   self-contained passage to quote. Deliberately understated: it must not read
   as an ad or an interstitial. */
.quick-answer {
  margin: 2rem 0; padding: 1.1rem 1.25rem;
  border: 1px solid var(--line); border-left: 3px solid var(--grad);
  border-radius: var(--radius); background: var(--surface-2);
}
.quick-answer h2 { margin: 0 0 .5rem; font-size: 1.05rem; line-height: 1.35; }
.quick-answer p { margin: 0; }

/* Reduced motion: reveal.js already skips the animation, this stops the
   transition from running if the class is applied another way. */
@media (prefers-reduced-motion: reduce) {
  .reveal-armed { transition: none; }
  [data-reveal="pending"] { opacity: 1; transform: none; }
}

/* Advertising ----------------------------------------------------------- */
/* Ad units collapse to nothing when ads are unconfigured, so an unconfigured
   build never shows an ad-shaped gap. min-height reserves no space until the
   creative actually loads, which avoids a layout shift on slow connections. */
.ad-slot { display: block; margin: 2rem 0; min-height: 0; }
.ad-slot:empty { display: none; }
/* Consent withdrawn: the <ins> was emptied, so collapse the whole slot rather
   than leaving the label above a blank box. Not keyed off :has(ins:empty),
   which would also hide the slot while the tag is still filling it. */
.ad-slot[data-withdrawn] { display: none; }
/* Google's own policy asks for ads to be distinguishable from site content. */
.ad-label {
  display: block; margin: 0 0 .5rem;
  font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); text-align: center;
}
/* A responsive unit needs a block-level container. Set here rather than with an
   inline style attribute, so the server HTML stays free of style="" (which the
   integration suite asserts). */
.ad-slot .adsbygoogle { display: block; }

/* Consent banner: fixed so it cannot shift the page, and high in the stacking
   order so a later ad refresh cannot cover it. */
.consent {
  position: fixed; inset: auto 0 0 0; z-index: 60;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: .75rem 1.25rem; padding: .9rem 1.25rem calc(.9rem + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--line);
  box-shadow: 0 -4px 20px rgb(0 0 0 / .12);
}
.consent-text { margin: 0; font-size: .9rem; max-width: 56ch; }
.consent-text a { text-decoration: underline; }
.consent-actions { display: flex; gap: .6rem; }
.linkish {
  background: none; border: 0; padding: 0; font: inherit; color: inherit;
  text-decoration: underline; cursor: pointer;
}
