/* glyph-guide.com accent: the glyph finder, big symbol cells, a light/dark pair over the factory's dark base,
   and polish rules (sticky search row, copy flash, theme switch, back-to-top). Light applies when the system
   prefers it without an explicit choice, or when the page switch says light; an explicit dark beats both. */

/* ------------------------------------------------------------- polish -- */
.gchips { display: flex; flex-wrap: wrap; gap: .45rem; margin: 1rem 0 .4rem; }
.gchip {
  cursor: pointer; font: 620 .84rem/1 var(--font); color: var(--ink-2); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: 999px; padding: .45rem .8rem; transition: color .15s, background-color .15s, border-color .15s;
}
.gchip:hover { color: var(--ink); background: var(--surface-2); }
.gchip.on { color: var(--accent-ink); background: var(--grad); border-color: transparent; }
.gcount-line { margin: .7rem 0 .9rem; font-size: .85rem; color: var(--muted); }
.gcount-line b { color: var(--ink); font: 700 .95rem/1 var(--mono); }
.ggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .6rem; }
.gtile {
  display: flex; flex-direction: column; align-items: center; gap: .18rem; cursor: pointer; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: .8rem .6rem .7rem;
  transition: transform .15s ease, border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.gtile:hover { transform: translateY(-2px); border-color: rgba(125, 130, 240, .5); background: var(--surface-2); box-shadow: var(--glow); }
.gtile.copied { border-color: var(--good); background: var(--good-soft); }
.gtile-g { font-size: 1.9rem; line-height: 1.15; color: var(--ink); }
.gtile-n { font-size: .78rem; font-weight: 600; color: var(--ink-2); }
.gtile-c { font: 500 .7rem/1.3 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.gtile-empty { grid-column: 1 / -1; color: var(--muted); font-size: .92rem; margin: .4rem 0; }
.gtile mark, .g-big mark { background: var(--accent-soft); color: inherit; border-radius: 4px; padding: 0 .15em; }
.glyph-table .g-big { font-size: 1.5rem; line-height: 1; color: var(--ink); cursor: pointer; }
.glyph-table .mono-ic { font: 500 .84rem/1.4 var(--mono); color: var(--ink-2); white-space: nowrap; }
.glyph-table code { font-size: .82em; }
.glyph-table thead th { position: sticky; top: 0; z-index: 2; }
.grow-copy.copied { background: var(--good-soft); }
@media (max-width: 560px) { .ggrid { grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); } }

/* finder search stays reachable while the grid scrolls */
@media (min-width: 900px) {
  .tool .fields { position: sticky; top: .4rem; z-index: 3; background: linear-gradient(rgba(15, 18, 28, .92), rgba(15, 18, 28, .78) 70%, transparent);
    padding: .3rem .2rem .55rem; margin: -.2rem -.2rem 0; }
}

/* ---------------------------------------------------------- theme parts -- */
.theme-toggle {
  float: right; margin: .1rem 0 .7rem .7rem; display: inline-flex; align-items: center; justify-content: center;
  width: 2.2rem; height: 2.2rem; border-radius: 999px; cursor: pointer; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--line-2); transition: color .15s, background-color .15s;
}
.theme-toggle:hover { color: var(--ink); background: var(--surface-3); }
.theme-toggle svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.to-top {
  position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 40; width: 2.5rem; height: 2.5rem; border-radius: 999px; cursor: pointer;
  display: grid; place-items: center; color: var(--accent-ink); background: var(--grad); border: 0;
  box-shadow: 0 12px 28px -10px rgba(79, 70, 229, .55); transition: transform .15s;
}
.to-top:hover { transform: translateY(-2px); }
.to-top svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------- light pair
   Light tokens and the re-tuned surfaces, once for "system light without a choice" and once for an explicit
   light choice. The selector list is identical in both blocks; only the gate differs. */
html[data-theme="light"] { color-scheme: light; }
@media (prefers-color-scheme: light) { html:not([data-theme]) { color-scheme: light; } }

html[data-theme="light"] {
  --bg: #f7f9fc; --panel: #ffffff; --surface: rgba(15, 23, 42, .04); --surface-2: rgba(15, 23, 42, .07);
  --surface-3: rgba(15, 23, 42, .1); --ink: #0b1220; --text: #3c4757; --ink-2: #44526a; --muted: #5d6a80;
  --line: rgba(15, 23, 42, .1); --line-2: rgba(15, 23, 42, .18); --accent: #4f46e5; --accent-hi: #4338ca;
  --accent-2: #0e7490; --accent-ink: #ffffff; --accent-soft: #eef2ff; --good: #047857; --good-soft: #e7f6ef;
  --warn: #be123c; --warn-soft: #fdf0f3; --focus: #4f46e5;
  --grad: linear-gradient(120deg, #6366f1 0%, #4f46e5 42%, #0891b2 100%);
  --grad-warm: linear-gradient(120deg, #f97316 0%, #e11d48 100%);
  --grad-good: linear-gradient(120deg, #059669 0%, #0891b2 100%);
  --shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 18px 36px -24px rgba(15, 23, 42, .35);
  --glow: 0 12px 28px -14px rgba(79, 70, 229, .35);
}

html[data-theme="light"] body::before {
  background: radial-gradient(52rem 34rem at 12% -8%, rgba(79, 70, 229, .1), transparent 62%),
    radial-gradient(46rem 30rem at 92% -4%, rgba(8, 145, 178, .08), transparent 60%); }
html[data-theme="light"] body::after {
  background-image: linear-gradient(rgba(15, 23, 42, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(15, 23, 42, .045) 1px, transparent 1px); }
html[data-theme="light"] .site-header { background: rgba(252, 253, 255, .82); }
html[data-theme="light"] .hero h1 { background: none; color: var(--ink); }
html[data-theme="light"] code, html[data-theme="light"] kbd { color: #3730a3; background: #eef2ff; border-color: #e0e7ff; }
html[data-theme="light"] .input, html[data-theme="light"] textarea.input, html[data-theme="light"] select.input { background-color: #ffffff; }
html[data-theme="light"] select.input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234f46e5' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
html[data-theme="light"] .formula { background: rgba(255, 255, 255, .8); }
html[data-theme="light"] .cta-band { background: linear-gradient(125deg, #eef2ff, #ecfeff 55%, #f0fdfa); border-color: rgba(79, 70, 229, .3); }
html[data-theme="light"] .stat::after { background: radial-gradient(circle, rgba(79, 70, 229, .08), transparent 70%); }
html[data-theme="light"] .menu summary, html[data-theme="light"] .lang-menu summary, html[data-theme="light"] .sec-more { background: #ffffff; }
html[data-theme="light"] .menu .nav, html[data-theme="light"] .lang-menu ul { background: #ffffff; box-shadow: 0 22px 44px -22px rgba(15, 23, 42, .3); }
html[data-theme="light"] ::selection { background: rgba(99, 102, 241, .3); color: #0b1220; }
@media (min-width: 900px) { html[data-theme="light"] .tool .fields { background: linear-gradient(rgba(252, 253, 255, .92), rgba(252, 253, 255, .78) 70%, transparent); } }
