:root {
  --bg: #09090c;
  --surface: #121218;
  --surface-hover: #1b1b24;
  --border: #262633;
  --border-strong: #3a3a4d;
  --text: #f4f4f7;
  --text-muted: #a1a1b5;
  --lime: #c6ff4d;
  --lime-ink: #09090c;
  --pink: #ff4d8d;
  --pink-ink: #09090c;
  --cyan: #4de2ff;
  --radius: 14px;
  --radius-sm: 10px;
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  background:
    radial-gradient(900px 420px at 88% -8%, rgba(198, 255, 77, 0.08), transparent 60%),
    radial-gradient(700px 380px at 8% 12%, rgba(255, 77, 141, 0.07), transparent 55%),
    var(--bg);
  line-height: 1.5;
  padding-bottom: 112px;
}

body[data-mode="bio"],
body[data-mode="cop"],
body[data-mode="dictionary"],
body[data-mode="detail"],
body[data-mode="404"] {
  padding-bottom: 32px;
}

a { color: inherit; text-decoration: none; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--lime);
  color: var(--lime-ink);
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 700;
  z-index: 70;
}
.skip-link:focus { left: 12px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.short-page-main {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh + 160px);
}
.short-page-main > .site-footer {
  margin-top: auto;
}
.short-lead-wrap {
  min-height: calc(100vh + 40px);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(9, 9, 12, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 60px;
  flex-wrap: wrap;
  padding: 8px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 1.15rem;
}

.brand-mark { width: 28px; height: 28px; border-radius: 8px; display: block; }

.brand-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--lime);
  border: 1px solid rgba(198, 255, 77, 0.35);
  padding: 2px 7px;
  border-radius: 999px;
}

.nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav a {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  display: inline-flex;
  align-items: center;
}
.nav a:hover, .nav a[aria-current="page"] {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}
.nav a.nav-cop {
  color: var(--lime);
  border-color: rgba(198, 255, 77, 0.35);
}
.nav a.nav-cop[aria-current="page"], .nav a.nav-cop:hover {
  background: var(--lime);
  color: var(--lime-ink);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
  padding-top: 14px;
}
.breadcrumb a:hover { color: var(--lime); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr);
  gap: 20px;
  align-items: end;
  padding: 28px 0 18px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.65rem, 3.5vw, 2.7rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.hero-sub {
  margin: 0;
  color: var(--text-muted);
  max-width: 60ch;
  font-size: 0.96rem;
}

.hero-stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat-k { font-family: var(--font-mono); font-size: 1.08rem; font-weight: 700; color: var(--lime); }
.stat-l { font-size: 0.76rem; color: var(--text-muted); }

.controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.controls-top {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.search-wrap { flex: 1 1 220px; position: relative; }

.search-input {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.95rem;
  font-family: inherit;
}
.search-input:focus { outline: 2px solid var(--lime); outline-offset: 1px; border-color: var(--lime); }

.tab-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.tab-scroll::-webkit-scrollbar { display: none; }
.tab-scroll .chip { flex-shrink: 0; }

.tools-panel {
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.tools-toggle {
  display: none;
  appearance: none;
  width: 100%;
  background: transparent;
  border: 0;
  padding: 6px 0;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  align-items: center;
  justify-content: space-between;
  text-align: left;
}
.tools-toggle::after { content: "+"; color: var(--lime); font-size: 1rem; }
.tools-toggle[aria-expanded="true"]::after { content: "-"; }

.tools-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.chip {
  appearance: none;
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip[aria-pressed="true"] {
  background: var(--lime);
  color: var(--lime-ink);
  border-color: var(--lime);
}
.chip.chip-pink[aria-pressed="true"] {
  background: var(--pink);
  color: var(--pink-ink);
  border-color: var(--pink);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 14px 0 10px;
  flex-wrap: wrap;
}
.section-hint {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}
.search-scope-note {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--cyan);
}
.search-scope-note[hidden] { display: none; }
.section-count { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); }
.section-meta { display: flex; align-items: center; gap: 8px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 10px;
}

/* Non-nested accessible tile: primary <button class="tile-copy"> + sibling <div class="tile-actions"> */
.tile {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  content-visibility: auto;
  contain-intrinsic-size: auto 118px;
  transition: transform 0.12s ease, border-color 0.14s ease, background 0.14s ease;
}
.tile:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.tile.just-copied { border-color: var(--lime); box-shadow: 0 0 0 1px var(--lime); }
.tile.tile-alert { border-color: rgba(255, 77, 141, 0.4); }

.tile-copy {
  appearance: none;
  background: transparent;
  border: 0;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  width: 100%;
  padding: 14px 12px 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.tile-copy:focus-visible { outline: 2px solid var(--lime); outline-offset: -2px; }

.tile-glyph {
  font-size: 1.55rem;
  line-height: 1.3;
  min-width: 0;
  word-break: break-word;
}
.tile-glyph.is-symbol { font-size: 1.12rem; font-family: var(--font-sans); }

.tile-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 4px 10px 10px;
}

.mini-btn {
  appearance: none;
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 32px;
  min-height: 32px;
  padding: 4px 8px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font-mono);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mini-btn:hover, .mini-btn.active { color: var(--lime); border-color: var(--lime); }
.mini-btn.mini-help:hover, .mini-btn.mini-help:focus-visible {
  color: var(--lime-ink);
  background: var(--lime);
  border-color: var(--lime);
}
.mini-clear { padding: 4px 10px; }
.mini-clear[hidden] { display: none; }
.mini-clear:hover, .mini-btn.mini-rm:hover, .mini-btn.mini-rm:focus-visible {
  color: var(--pink-ink);
  background: var(--pink);
  border-color: var(--pink);
}

.emoji-subbar {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.emoji-subbar[hidden],
.case-upgrade[hidden],
.tone-row[hidden],
.context-promo[hidden],
[data-android-cta][hidden],
.case-full-link[hidden] {
  display: none;
}

.tone-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-wrap: wrap;
}
.tone-row.cop-tone { margin-left: 0; margin-top: 10px; }

.tone-btn {
  appearance: none;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  padding: 0;
}
.tone-btn[aria-checked="true"] {
  border-color: var(--lime);
  box-shadow: 0 0 0 1px var(--lime);
}

/* Case File modal */
.case-modal {
  width: min(490px, calc(100% - 28px));
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.75);
}
.case-modal::backdrop { background: rgba(5, 5, 8, 0.76); backdrop-filter: blur(6px); }
.case-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.case-glyph { font-size: 3rem; line-height: 1.15; margin-bottom: 6px; }
.case-glyph.is-wide { font-size: 1.6rem; word-break: break-word; }
.case-title { margin: 0; font-size: 1.15rem; }
.case-close {
  appearance: none;
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
}
.case-close:hover { color: var(--text); border-color: var(--border-strong); }

.vibe-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  margin-top: 6px;
}
.vibe-certified { background: rgba(198, 255, 77, 0.14); color: var(--lime); border: 1px solid rgba(198, 255, 77, 0.4); }
.vibe-aesthetic { background: rgba(77, 226, 255, 0.14); color: var(--cyan); border: 1px solid rgba(77, 226, 255, 0.4); }
.vibe-context { background: rgba(255, 196, 61, 0.14); color: #ffc43d; border: 1px solid rgba(255, 196, 61, 0.4); }
.vibe-alert { background: rgba(255, 77, 141, 0.16); color: var(--pink); border: 1px solid rgba(255, 77, 141, 0.45); }

.case-section { margin-top: 12px; }
.case-k { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); letter-spacing: 0.04em; margin-bottom: 4px; }
.case-text { margin: 0; font-size: 0.92rem; line-height: 1.5; }
.case-example { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 0.9rem; color: var(--text); }
.case-upgrade {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 77, 141, 0.1);
  border: 1px solid rgba(255, 77, 141, 0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.84rem;
}
.case-full-link {
  display: inline-flex;
  align-items: center;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--cyan);
  text-decoration: underline;
}

/* Panels, Bio Decorator, Vibe Police */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 20px;
}
.panel h2 { margin: 0 0 6px; font-size: 1.2rem; }
.panel-sub { margin: 0 0 14px; color: var(--text-muted); font-size: 0.92rem; }

.textarea {
  width: 100%;
  min-height: 92px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
}
.textarea:focus { outline: 2px solid var(--lime); border-color: var(--lime); }

.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.btn-sm { padding: 6px 11px; font-size: 0.8rem; }

.btn {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  padding: 10px 15px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
.btn-pink { background: var(--pink); color: var(--pink-ink); border-color: var(--pink); }
.btn:hover:not(:disabled) { filter: brightness(1.06); }

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin-top: 14px;
  min-height: 360px;
}

.bio-card {
  appearance: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 12px 12px;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.bio-card:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.bio-card.just-copied { border-color: var(--lime); box-shadow: 0 0 0 1px var(--lime); }
.tile-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; }
.bio-copy-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--lime);
  border: 1px solid rgba(198, 255, 77, 0.35);
  border-radius: 6px;
  padding: 2px 7px;
  flex-shrink: 0;
}

.limit-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; min-height: 28px; }
.limit-pill {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 9px;
}
.limit-pill.is-over { color: var(--pink); border-color: var(--pink); }

.sr-copy-ta {
  position: fixed;
  left: -9999px;
  top: 0;
  opacity: 0;
}

.accent-note {
  margin: 8px 0 0;
  font-size: 0.82rem;
  color: var(--cyan);
  background: rgba(77, 226, 255, 0.08);
  border: 1px solid rgba(77, 226, 255, 0.25);
  border-radius: 8px;
  padding: 7px 10px;
}
.accent-note[hidden] { display: none; }

.guide-article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-top: 18px;
}
.guide-article h2 { margin: 18px 0 8px; font-size: 1.15rem; }
.guide-article h2:first-child { margin-top: 0; }
.guide-article p { margin: 0 0 12px; color: var(--text-muted); font-size: 0.94rem; line-height: 1.65; }
.guide-article ul { margin: 8px 0 14px; padding-left: 20px; color: var(--text-muted); font-size: 0.92rem; line-height: 1.65; }
.guide-article a:not(.btn):not(.promo-cta) { color: var(--cyan); text-decoration: underline; }

.hub-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.hub-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.hub-card:hover { border-color: var(--lime); }
.hub-card h2 { margin: 0; font-size: 1.02rem; }
.hub-card p { margin: 0; font-size: 0.86rem; color: var(--text-muted); line-height: 1.5; }
.hub-card-cta { font-family: var(--font-mono); font-size: 0.78rem; color: var(--lime); }

.copy-count-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--lime);
  margin-left: 4px;
}

.cop-report {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 16px;
  align-items: start;
}
.cop-box { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; }
.cop-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 77, 141, 0.18);
  color: var(--pink);
  border: 1px solid rgba(255, 77, 141, 0.45);
  margin-bottom: 8px;
}
.cop-badge.clean { background: rgba(198, 255, 77, 0.14); color: var(--lime); border-color: rgba(198, 255, 77, 0.4); }
.cop-badge.neutral { background: var(--surface); color: var(--text-muted); border-color: var(--border-strong); }

.cop-translated {
  font-size: 1.18rem;
  margin: 10px 0 12px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  word-break: break-word;
}
.cop-translated.is-placeholder { color: var(--text-muted); font-size: 0.95rem; }
.violation-list { margin: 8px 0 0; padding-left: 18px; color: var(--text-muted); font-size: 0.88rem; }
.ticket-canvas { width: 100%; max-width: 360px; height: auto; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); display: block; }

/* Meaning cards, dictionary, editorial guides, FAQs */
.meaning-guide { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--border); }
.meaning-guide h2 { font-size: 1.04rem; margin: 0 0 6px; }
.meaning-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; margin: 14px 0 0; }
.meaning-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.meaning-card dt { font-weight: 700; font-size: 0.92rem; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.meaning-card dt a:hover { color: var(--lime); text-decoration: underline; }
.meaning-glyph { font-size: 1.25rem; }
.meaning-card dd { margin: 0; font-size: 0.84rem; color: var(--text-muted); line-height: 1.48; }
.meaning-ex { display: block; margin-top: 6px; font-family: var(--font-mono); font-size: 0.78rem; color: var(--text); }

.intro-guide {
  margin-top: 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.intro-guide h2 { margin: 0 0 8px; font-size: 1.05rem; }
.intro-guide p { margin: 0 0 10px; color: var(--text-muted); font-size: 0.92rem; line-height: 1.6; }
.intro-guide p:last-child { margin-bottom: 0; }

.compare-wrap { overflow-x: auto; margin-top: 16px; }
.compare-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; font-size: 0.9rem; }
.compare-table th, .compare-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.compare-table th { font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-muted); background: var(--bg); }
.compare-emoji { font-size: 1.45rem; white-space: nowrap; }
.compare-emoji a:hover { opacity: 0.8; }
.compare-code { font-family: var(--font-mono); font-size: 0.74rem; color: var(--pink); display: block; margin-bottom: 2px; }

.faq-section { margin-top: 28px; display: grid; gap: 8px; }
.faq-section h2 { font-size: 1rem; margin: 0 0 6px; color: var(--text-muted); }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.faq-item summary { cursor: pointer; font-weight: 600; font-size: 0.92rem; }
.faq-item p { margin: 8px 0 0; color: var(--text-muted); font-size: 0.88rem; }

/* Contextual PhaseHarbor card (locked-in & cozy collections only, dismissible) */
.context-promo {
  margin-top: 24px;
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: radial-gradient(380px 120px at 0% 0%, rgba(77, 226, 255, 0.08), transparent 70%), var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.context-promo-copy { flex: 1 1 280px; font-size: 0.88rem; color: var(--text-muted); }
.context-promo-copy strong { color: var(--text); }
.context-promo-actions { display: flex; align-items: center; gap: 8px; }
.promo-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(77, 226, 255, 0.4);
  background: rgba(77, 226, 255, 0.1);
  color: var(--cyan);
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}
.promo-cta:hover { background: var(--cyan); color: #061318; }
.promo-cta[hidden], .footer-maker a[hidden], .context-promo[hidden] { display: none; }
.promo-dismiss {
  appearance: none;
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 36px;
  height: 36px;
  font-size: 1rem;
  cursor: pointer;
}
.promo-dismiss:hover { color: var(--text); border-color: var(--border-strong); }

.seo-links { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border); }
.seo-links h2 { font-size: 0.95rem; margin: 0 0 12px; color: var(--text-muted); }
.pill-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-links a {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
}
.pill-links a:hover { color: var(--lime); border-color: var(--lime); }

.site-footer {
  margin-top: 28px;
  padding: 18px 0 12px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.84rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.footer-maker {
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
}
.footer-maker a {
  color: var(--cyan);
  font-weight: 700;
  text-decoration: underline;
  display: inline-flex;
  align-items: center;
}

.preset-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.preset-label { font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-muted); margin-right: 4px; }

/* Floating Combo Tray */
.dock {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: min(780px, calc(100% - 24px));
  background: rgba(18, 18, 24, 0.95);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 40;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
}
.dock[hidden] { display: none; }
.dock-input {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 1rem;
  font-family: inherit;
}
.tray-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.toast {
  position: fixed;
  top: 76px;
  right: 20px;
  background: var(--lime);
  color: var(--lime-ink);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.84rem;
  padding: 8px 14px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 65;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* Individual emoji/combo detail page hero */
.detail-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-top: 14px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 20px;
  align-items: center;
}
.detail-glyph { font-size: 4.2rem; line-height: 1.1; }
.detail-glyph.is-wide { font-size: 2.5rem; }
.detail-hero h1 { margin: 0 0 6px; font-size: clamp(1.5rem, 3vw, 2.2rem); }
.detail-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }

@media (max-width: 780px) {
  .hero { grid-template-columns: 1fr; padding: 16px 0 12px; gap: 10px; }
  .hero-stat-box { display: none; }
  .cop-report { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .detail-hero { grid-template-columns: 1fr; text-align: left; }
}

@media (pointer: coarse), (max-width: 780px) {
  .chip, .btn, .nav a, .pill-links a, .footer-maker a { min-height: 44px; }
  .mini-btn { min-width: 44px; min-height: 44px; }
  .tone-btn { width: 40px; height: 40px; }
  .search-input, .dock-input, .textarea { font-size: 16px; }
}

@media (max-width: 640px) {
  .tools-toggle { display: flex; min-height: 44px; }
  .tools-body { display: none; margin-top: 8px; }
  .tools-body.is-open { display: flex; }
  .dock.is-empty { display: none; }
  .toast {
    top: auto;
    bottom: 84px;
    left: 50%;
    right: auto;
    transform: translate(-50%, 6px);
  }
  .toast.show { transform: translate(-50%, 0); }
}

@media (max-width: 520px) {
  .wrap { padding: 0 14px; }
  .topbar-inner { gap: 6px; min-height: 52px; }
  .brand { font-size: 1rem; gap: 8px; }
  .nav a { padding: 6px 10px; font-size: 0.82rem; }
  .hero { padding: 10px 0 8px; }
  .hero h1 { font-size: 1.48rem; margin-bottom: 4px; }
  .hero-sub { font-size: 0.86rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .controls { padding: 10px; gap: 8px; margin-bottom: 10px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile-actions { gap: 4px; padding: 4px 6px 8px; }
  .result-grid { grid-template-columns: 1fr; }
  .dock { width: calc(100% - 16px); padding: 8px; gap: 6px; }
  .dock .btn { padding: 8px 10px; font-size: 0.82rem; }
  #dock-mix, .tray-count { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
