@font-face { font-family: "Figtree"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/static/fonts/figtree-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF; }

/* Dark by default (Spotify-style, see DESIGN.md); light only when the visitor picks it */
:root {
  --bg: #121212; --card: #181818; --soft: #1f1f1f; --raise: #2a2a2a; --ink: #ffffff; --muted: #b3b3b3; --line: #2e2e2e;
  --accent: #ff5fa8; --accent-ink: #121212; --accent-soft: rgba(255, 95, 168, .12); --ok: #4cd68a; --warn: #ffa42b;
  --radius: 8px; --shadow: none; --menu-shadow: 0 8px 24px rgba(0, 0, 0, .5);
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sym: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Segoe UI Symbol", "Noto Sans Math", "Noto Sans Symbols 2", "Cambria Math", "Apple Symbols", sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f6f5f2; --card: #ffffff; --soft: #ecebe6; --raise: #e2e0da; --ink: #121212; --muted: #5f5f66; --line: #e2e0da;
  --accent: #c41d6d; --accent-ink: #ffffff; --accent-soft: rgba(196, 29, 109, .08); --ok: #11804f; --warn: #9a5b00;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05); --menu-shadow: 0 8px 24px rgba(0, 0, 0, .14);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 9999px; z-index: 100; font-weight: 700; }
.skip:focus { left: 8px; }

/* Header: logo, grouped menus, find, theme, mobile menu */
.top { background: var(--bg); position: relative; z-index: 40; }
.top-in { display: flex; align-items: center; gap: 10px; min-height: 64px; }
.logo { font-weight: 800; font-size: 20px; text-decoration: none; color: var(--ink); letter-spacing: -.02em; white-space: nowrap; margin-right: 8px; }
.logo b { color: var(--accent); }
.mainnav { display: flex; align-items: center; gap: 2px; }
.mainnav > a, .dd > summary { display: inline-flex; align-items: center; gap: 4px; padding: 8px 14px; border-radius: 9999px; color: var(--muted);
  font-size: 15px; font-weight: 700; text-decoration: none; cursor: pointer; list-style: none; white-space: nowrap; }
.dd > summary::-webkit-details-marker { display: none; }
.dd > summary::after { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); margin-left: 4px; }
.mainnav > a:hover, .dd > summary:hover, .dd[open] > summary, .mainnav > a[aria-current], .dd.cur > summary { color: var(--ink); background: var(--soft); }
.dd { position: relative; border: 0; padding: 0; }
.dd-menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 320px; background: var(--card); border-radius: 12px; padding: 8px;
  box-shadow: var(--menu-shadow); display: grid; gap: 2px; border: 1px solid var(--line); }
.dd-menu.cols { grid-template-columns: 1fr 1fr; min-width: 560px; }
.dd-menu a, .mnav-list a { display: flex; flex-direction: column; gap: 1px; padding: 9px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.dd-menu a:hover, .dd-menu a[aria-current], .mnav-list a:hover, .mnav-list a[aria-current] { background: var(--soft); }
.dd-menu b, .mnav-list b { font-size: 15px; font-weight: 700; }
.dd-menu small, .mnav-list small { font-family: var(--sym); font-size: 15px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.find { margin-left: auto; position: relative; }
.find input { width: 210px; height: 40px; border: 0; background: var(--soft); border-radius: 9999px; padding: 0 16px 0 38px; font-size: 14px; outline: none; }
.find input:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.find::before { content: ""; position: absolute; left: 15px; top: 13px; width: 10px; height: 10px; border: 2px solid var(--muted); border-radius: 50%; }
.find::after { content: ""; position: absolute; left: 26px; top: 25px; width: 6px; height: 2px; background: var(--muted); transform: rotate(45deg); }
.icon-btn { border: 0; background: var(--soft); color: var(--ink); border-radius: 50%; width: 40px; height: 40px; cursor: pointer; flex: none; font-size: 16px; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--raise); }
.mnav { display: none; }
.mnav > summary { list-style: none; }
.mnav > summary::-webkit-details-marker { display: none; }
.mnav-panel { position: absolute; left: 0; right: 0; top: 64px; background: var(--bg); padding: 8px 16px 24px; box-shadow: var(--menu-shadow); max-height: calc(100vh - 64px); overflow-y: auto; }
.mnav-list h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 16px 12px 6px; }
.mnav-list .find { margin: 8px 0 0; } .mnav-list .find input { width: 100%; }
.crumbs { font-size: 13px; color: var(--muted); padding: 2px 0 0; }
.crumbs a { color: var(--muted); text-decoration: none; } .crumbs a:hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 1180px) { .top-in > .find { display: none; } }
@media (max-width: 1180px) { #theme { margin-left: auto; } }
@media (max-width: 860px) { .mainnav { display: none; } .mnav { display: block; } }

/* Hero */
.hero { padding: 22px 0 6px; }
h1 { font-size: clamp(28px, 4.6vw, 44px); font-weight: 800; line-height: 1.08; margin: 0 0 8px; letter-spacing: -.03em; }
.lede { color: var(--muted); margin: 0; max-width: 760px; }

/* Input bar, sticky so it stays in reach while scrolling the styles */
.bar { position: sticky; top: 0; z-index: 20; background: var(--bg); padding: 12px 0 10px; }
.field { position: relative; }
#in { width: 100%; min-height: 56px; max-height: 140px; resize: vertical; border: 2px solid transparent; background: var(--soft);
  border-radius: var(--radius); padding: 14px 92px 14px 16px; font-size: 18px; line-height: 1.4; outline: none; box-shadow: var(--shadow); }
#in:focus { border-color: var(--accent); }
.field-tools { position: absolute; right: 10px; top: 10px; display: flex; align-items: center; gap: 6px; }
#count { font-size: 12px; color: var(--muted); }
#clear { border: 0; background: var(--soft); border-radius: 999px; padding: 6px 10px; cursor: pointer; font-size: 13px; }


/* Filters */
.tools { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 12px 0 4px; }
.opt { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.opt select, .opt input[type=search] { min-width: 0; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 7px 10px; max-width: 220px; }
#glitchbox[hidden] { display: none; }
#glitch { accent-color: var(--accent); width: 120px; }

.recent { display: flex; gap: 6px; align-items: center; overflow-x: auto; scrollbar-width: none; margin: 8px 0 0; }
.recent[hidden] { display: none; }
.recent::-webkit-scrollbar { display: none; }
.recent-lab { font-size: 13px; color: var(--muted); flex: none; }
.recent-item { flex: none; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 1px dashed var(--line);
  background: transparent; border-radius: 8px; padding: 4px 8px; cursor: pointer; font-family: var(--sym); font-size: 14px; }

/* Grid of styles */
#grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; padding: 10px 0 30px; }
.grid-div { grid-column: 1 / -1; font-size: 15px; color: var(--muted); margin: 14px 0 0; font-weight: 600; }
.card { position: relative; background: var(--card); border: 1px solid transparent; border-radius: var(--radius); padding: 10px 14px 12px;
  cursor: pointer; box-shadow: var(--shadow); transition: background .12s, border-color .12s, transform .12s; min-width: 0; outline: none; overflow: hidden; }
:root[data-theme="light"] .card { border-color: var(--line); }
.card:hover, .card:focus-visible { background: var(--raise); }
.card:focus-visible { border-color: var(--accent); }
.card:active { transform: scale(.99); }
.card-top { display: flex; align-items: center; gap: 8px; min-height: 24px; }
.nm { font-size: 11.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.miss { font-size: 11.5px; color: var(--warn); margin-right: auto; }
.star { border: 0; background: none; cursor: pointer; font-size: 18px; line-height: 1; padding: 4px 6px; color: var(--muted); border-radius: 8px; }
.star:hover { background: var(--soft); }
.is-fav .star { color: #e2a400; }
.out { font-family: var(--sym); font-size: var(--out-size, 22px); line-height: 1.5; margin-top: 2px; word-break: break-word; overflow-wrap: anywhere; min-height: 33px; max-height: 140px; overflow: hidden; padding: 4px 0; }
.tap { position: absolute; right: 12px; bottom: 10px; font-size: 12px; font-weight: 700; color: var(--accent); opacity: 0; transition: opacity .12s; }
.card:hover .tap, .card:focus-visible .tap { opacity: 1; }
.card.copied { border-color: var(--ok); }
.card.copied .tap { opacity: 1; color: var(--ok); }
.empty { grid-column: 1 / -1; color: var(--muted); text-align: center; padding: 30px 0; }

/* Builder and unfancy panels */
.panel[hidden] { display: none; }
.box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 12px 0 30px; box-shadow: var(--shadow); }
.form { margin-top: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.form label { min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.form select { width: 100%; min-width: 0; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 9px 10px; font-weight: 400; color: var(--ink); }
.result { font-family: var(--sym); font-size: 26px; line-height: 1.5; padding: 16px; overflow: hidden; border-radius: 12px; background: var(--soft); margin: 0 0 6px;
  word-break: break-word; overflow-wrap: anywhere; min-height: 72px; transition: outline-color .2s; outline: 2px solid transparent; }
.result.copied { outline-color: var(--ok); }
.meta { font-size: 13px; color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn { border: 0; background: var(--accent); color: var(--accent-ink); padding: 10px 20px; border-radius: 9999px; font-weight: 700; cursor: pointer; letter-spacing: .02em; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: var(--soft); color: var(--ink); }
.btn.ghost:hover { background: var(--raise); filter: none; }
#u-in { width: 100%; min-height: 90px; border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 12px; font-family: var(--sym); font-size: 18px; }

/* Content */
.content { border-top: 1px solid var(--line); padding: 26px 0 10px; }
.content .wrap > * { max-width: 760px; }
.content h2 { font-size: 24px; font-weight: 800; letter-spacing: -.015em; margin: 34px 0 8px; }
.content h3 { font-size: 18px; margin: 22px 0 6px; }
.content table { border-collapse: collapse; width: 100%; font-size: 15px; margin: 10px 0; }
.content th, .content td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; vertical-align: top; }
.content td.s { font-family: var(--sym); font-size: 18px; overflow-wrap: anywhere; word-break: break-all; }
.tscroll { overflow-x: auto; }
.abc td:first-child { white-space: nowrap; font-size: 14px; }
@media (max-width: 640px) { .abc th:nth-child(4), .abc td:nth-child(4) { display: none; } .abc td:first-child { white-space: normal; } }
.content .note { background: var(--soft); border-left: 3px solid var(--accent); border-radius: 8px; padding: 12px 14px; }
.content details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.content summary { cursor: pointer; font-weight: 700; }
.related { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.related a { background: var(--soft); padding: 9px 16px; border-radius: 9999px; text-decoration: none; color: var(--ink); font-size: 15px; font-weight: 700; }
.related a:hover { background: var(--raise); }


#toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 10px 18px;
  border-radius: 999px; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; z-index: 50; max-width: 90vw; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
  #grid { grid-template-columns: 1fr; gap: 8px; }
  .tap { opacity: 1; }
    .opt select { max-width: 160px; }
  .hero { padding-top: 16px; }
    .form { grid-template-columns: 1fr 1fr; gap: 10px; }
  .form select { padding: 8px 6px; }
  .result { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Make-your-own preview: a generic profile card and a chat bubble (no app branding) */
.pv { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-top: 16px; }
.pv-profile { display: flex; gap: 12px; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; min-width: 0; }
.pv-profile > div { min-width: 0; }
.pv-avatar { width: 46px; height: 46px; border-radius: 50%; flex: none; background: linear-gradient(135deg, #ff5fa8, #ffa42b); }
.pv-name { font-family: var(--sym); font-weight: 700; font-size: 17px; overflow-wrap: anywhere; }
.pv-handle { font-size: 13px; color: var(--muted); }
.pv-chat { background: #1e1f22; border-radius: 12px; padding: 14px; display: flex; align-items: center; min-width: 0; }
.pv-bubble { background: #5b5bd6; color: #fff; border-radius: 16px 16px 4px 16px; padding: 8px 12px; margin-left: auto; font-family: var(--sym); font-size: 16px; overflow-wrap: anywhere; max-width: 100%; }

/* Picture generators (bubble letters, ambigram) */
.gtool { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; margin: 18px 0 26px; }
.gpanel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 14px; box-shadow: var(--shadow); }
.grp { display: grid; gap: 7px; }
.lbl { font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.gpanel input[type=text], .gpanel select, .copyin { height: 40px; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 0 10px; font-size: 16px; width: 100%; min-width: 0; }
.gpanel input[type=color] { width: 56px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: none; padding: 2px; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seg .btn { padding: 8px 14px; }
.btn[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 1px; }
.chk { display: flex; gap: 8px; align-items: center; font-size: 15px; }
.gstage { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; min-width: 0; }
.gstage svg { width: 100%; height: auto; display: block; background: #fff; border-radius: 8px; }
.copyin { font-family: var(--sym); font-size: 20px; flex: 1; }
.h2s { font-size: 20px; margin: 0 0 4px; }
.copytext .grp { margin-top: 12px; }
@media (max-width: 820px) { .gtool { grid-template-columns: 1fr; } .gstage { order: -1; } }
@media print { .top, .foot, .gpanel, .copytext, .content, .hero { display: none !important; } .gtool { display: block; } .gstage { border: 0; padding: 0; } }

/* Symbols */
.sym-h { font-size: 15px; color: var(--muted); margin: 18px 0 8px; font-weight: 650; }
.sym-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; }
.sym-row.wide { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.sym { height: 48px; border: 1px solid var(--line); background: var(--card); border-radius: 10px; font-family: var(--sym); font-size: 22px; cursor: pointer; padding: 0 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sym-row.wide .sym { font-size: 17px; }
.sym:hover, .sym:focus-visible { border-color: var(--accent); }
.sym:active { transform: scale(.96); }
#sym-grid { padding-bottom: 30px; }
#sym-chips { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.trayrow { position: sticky; top: 0; z-index: 10; background: var(--bg); padding: 10px 0; }
.trayrow[hidden] { display: none; }
.deco-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin-top: 12px; }
.deco { text-align: left; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 10px 12px; font-family: var(--sym); font-size: 18px; cursor: pointer; overflow-wrap: anywhere; }
.deco:hover { border-color: var(--accent); }

/* Superscript / subscript */
.ss-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 16px; }
.ss-card { margin: 0; display: grid; gap: 10px; align-content: start; }
.ss-area { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); resize: vertical; font-family: var(--sym); font-size: 22px; line-height: 1.5; padding: 10px 12px; outline: none; }
.ss-area:focus { border-color: var(--accent); }
.ss-result { font-size: 26px; }
.ss-report { min-height: 24px; color: var(--muted); font-size: 15px; margin: 10px 2px 26px; }
.ss-report.is-warn { color: var(--warn); }
.ss-modes { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 15px; }
.ss-modes legend { margin-bottom: 6px; width: 100%; }
.ss-radio, .switch { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; cursor: pointer; font-size: 15px; }
.ss-radio input, .switch input { accent-color: var(--accent); width: 18px; height: 18px; }
.ss-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 14px; }
.ss-chip { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 48px; min-height: 52px; padding: 4px 8px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; }
.ss-chip b { font: 400 24px/1.1 var(--sym); } .ss-chip span { font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 3px; }
.ss-chip:hover { border-color: var(--accent); }
.content .source { font-size: 14px; color: var(--muted); }
@media (max-width: 640px) { .ss-grid { grid-template-columns: minmax(0, 1fr); } }
.icon-btn.sm { width: 34px; height: 34px; font-size: 13px; font-weight: 800; }
.sizes { gap: 4px; }

/* Example phrases: quiet text links, wrap instead of sliding */
.presets { margin: 8px 2px 0; font-size: 14px; color: var(--muted); line-height: 1.9; }
.presets span { font-weight: 700; margin-right: 2px; }
.presets button { border: 0; background: none; padding: 0 2px; margin: 0 6px 0 0; cursor: pointer; color: var(--ink); font-size: 14px;
  text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; text-decoration-thickness: 2px; }
.presets button:hover { text-decoration-color: var(--accent); }

/* Mode switch: one segmented control, clearly not a filter */
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--soft); padding: 4px; border-radius: 9999px; margin: 14px 0 4px; max-width: 560px; }
.tab { border: 0; background: transparent; color: var(--muted); padding: 9px 10px; border-radius: 9999px; cursor: pointer; font-size: 14px; font-weight: 700; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
:root[data-theme="light"] .tab[aria-selected="true"] { box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

/* Filters: wrap on every screen, counts show what each holds, extras behind "+ more" on phones */
#chips { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--soft); color: var(--ink); padding: 7px 12px; border-radius: 9999px;
  cursor: pointer; font-size: 14px; font-weight: 700; }
.chip small { font-size: 12px; font-weight: 700; color: var(--muted); }
.chip:hover { background: var(--raise); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.chip[aria-pressed="true"] small { color: inherit; opacity: .75; }
.chips-more { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.chip.extra { display: none; }
#chips.open .chip.extra { display: inline-flex; }
@media (min-width: 900px) { .chip.extra { display: inline-flex; } .chips-more { display: none; } }
@media (max-width: 640px) { .tab { font-size: 13px; padding: 9px 6px; } .tabs { max-width: none; } }

/* Card: the Copy button stretches over the whole card; Share and Favourite sit above it */
.copy-btn { all: unset; display: block; cursor: pointer; }
.copy-btn::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.copy-btn:focus-visible { outline: none; }
.card:has(.copy-btn:focus-visible) { border-color: var(--accent); background: var(--raise); }
.card-top .star, .card-top .share { position: relative; z-index: 2; }
.share { border: 0; background: none; cursor: pointer; font-size: 15px; line-height: 1; padding: 6px 7px; color: var(--muted); border-radius: 50%; opacity: 0; transition: opacity .12s; margin-left: auto; }
.miss:not(:empty) ~ .share { margin-left: 0; }
.share + .star { margin-left: 0; }
.card:hover .share, .share:focus-visible { opacity: 1; }
.share:hover, .star:hover { background: var(--soft); color: var(--ink); }
.card.pinned { box-shadow: 0 0 0 2px var(--accent); }
@media (hover: none) { .share { opacity: 1; } }

/* Discord colored text */
.ansi { display: grid; gap: 12px; }
.ansi-ed { min-height: 90px; background: #2b2d31; color: #dbdee1; border-radius: 8px; padding: 12px 14px; font: 15px/1.5 ui-monospace, Menlo, Consolas, monospace; outline: none; white-space: pre-wrap; overflow-wrap: anywhere; }
.ansi-ed:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.ansi-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ansi-row .lbl { width: 92px; }
.sws { display: flex; gap: 6px; flex-wrap: wrap; }
.sw { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; }
.sw:hover { transform: scale(1.1); }
.ansi-out { margin: 0; background: var(--soft); border-radius: 8px; padding: 10px 12px; font: 13px/1.45 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); max-height: 160px; overflow: auto; }
/* Off-screen cards skip layout and paint until scrolled near (keeps typing smooth on slow phones) */
#grid .card { content-visibility: auto; contain-intrinsic-size: auto 112px; }
.stbl td:first-child { font-weight: 700; white-space: nowrap; }
.stbl td.s { white-space: nowrap; }
.stbl td:nth-child(3) { color: var(--muted); font-size: 14px; }
@media (max-width: 640px) { .stbl td:first-child, .stbl td.s { white-space: normal; } .stbl th:nth-child(4), .stbl td:nth-child(4) { display: none; } }
/* Language switcher */
.langsw > summary { font-size: 13px; padding: 8px 12px; }
.langsw .dd-menu { left: auto; right: 0; min-width: 180px; }
@media (max-width: 860px) { .top-in > .langsw { display: none; } }
/* Logo: mark + wordmark */
.logo { display: inline-flex; align-items: center; gap: 9px; }
.logo-mark { width: 32px; height: 32px; flex: none; display: block; }
.logo-word { font-size: 21px; font-weight: 800; letter-spacing: -.03em; }
@media (max-width: 380px) { .logo-word { font-size: 18px; } .logo-mark { width: 28px; height: 28px; } }

/* Footer: brand block + link columns + bottom bar */
.foot { background: var(--card); margin-top: 48px; padding: 44px 0 28px; font-size: 14px; color: var(--muted); }
.foot-top { display: grid; grid-template-columns: minmax(220px, 1fr) 3fr; gap: 40px; }
.foot-brand p { margin: 14px 0 16px; line-height: 1.55; max-width: 300px; }
.foot-langs { display: flex; flex-wrap: wrap; gap: 6px; }
.foot-langs a { padding: 6px 12px; border-radius: 9999px; background: var(--soft); color: var(--ink); text-decoration: none; font-weight: 700; font-size: 13px; }
.foot-langs a:hover { background: var(--raise); }
.foot-langs a[aria-current] { background: var(--accent); color: var(--accent-ink); }
.foot-cols { display: grid; grid-template-columns: 2fr 1fr 1.2fr 1fr; gap: 28px; }
.fcol h2 { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 0 0 12px; }
.fcol ul { list-style: none; margin: 0; padding: 0; }
.fcol.fonts ul { columns: 2; column-gap: 24px; }
.fcol li { break-inside: avoid; }
.fcol a { display: inline-block; padding: 5px 0; color: var(--ink); text-decoration: none; font-size: 14px; }
.fcol a:hover { color: var(--accent); }
.foot-bottom { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 36px; padding-top: 20px; font-size: 13px; }
.foot-bottom a { color: var(--muted); }
.foot-bottom a:hover { color: var(--ink); }
@media (max-width: 1000px) { .foot-top { grid-template-columns: 1fr; gap: 28px; } }
@media (max-width: 760px) {
  .foot-cols { grid-template-columns: 1fr 1fr; gap: 24px 20px; }
  .fcol.fonts { grid-column: 1 / -1; }
  .foot-bottom { flex-direction: column; }
}

/* Touch targets (UI/UX audit 2 Oct 2026): main controls at least 40 to 44 px on phones */
.icon-btn { width: 44px; height: 44px; }
.icon-btn.sm { width: 40px; height: 40px; }
#clear { padding: 10px 14px; min-height: 40px; }
.presets button { padding: 7px 4px; margin-right: 4px; min-height: 36px; }
.tab { min-height: 44px; }
.chip { min-height: 38px; }
#glitch, .opt input[type=range] { height: 32px; }
.star, .share { min-width: 40px; min-height: 40px; display: inline-grid; place-items: center; }
.foot-bottom a, .foot-bottom span { display: inline-flex; align-items: center; min-height: 32px; }
.recent-item { min-height: 36px; }
.related a { min-height: 40px; display: inline-flex; align-items: center; }
.sym { height: 52px; }
.faq summary, details.faq-item summary, .content summary { padding: 10px 0; min-height: 44px; display: flex; align-items: center; cursor: pointer; }
select { min-height: 40px; }
.copy-btn { min-height: 40px; }

/* One-topic symbol pages (2 Oct 2026) */
.sym-h .cnt { font-weight: 500; font-size: 13px; color: var(--muted); margin-left: 4px; }
.sset[hidden], .sym[hidden] { display: none; }
.setlinks { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 0; }
.setlinks a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px; border-radius: 9999px; background: var(--soft); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; }
.setlinks a span { font-family: var(--sym); }
.setlinks a:hover, .setlinks a[aria-current] { background: var(--raise); outline: 2px solid var(--accent); }
.ctbl td.s { font-size: 24px; }
.ctbl code { font-size: 13px; }

/* Invisible characters */
.inv-big { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 10px 0 14px; }
.inv-show { font-family: var(--sym); font-size: 30px; color: var(--muted); }
.inv-gap { background: color-mix(in srgb, var(--accent) 25%, transparent); border-radius: 4px; }
.inv-many { gap: 10px; } .inv-many input { width: 90px; } .inv-many select { width: auto; max-width: 100%; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); padding: 0 8px; }
.inv-list { display: grid; gap: 8px; margin: 10px 0 30px; }
.inv-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.inv-row b { display: block; font-size: 15px; } .inv-row small { color: var(--muted); font-size: 13px; }
.inv-row .w { font-family: var(--sym); font-size: 22px; color: var(--muted); white-space: pre; }
.inv-in { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 12px; font-size: 16px; margin-top: 8px; }
.inv-stat { font-weight: 650; min-height: 1.4em; margin: 8px 0; }
.inv-out { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--soft); border-radius: 12px; padding: 12px; margin: 0 0 12px; font-size: 15px; max-height: 260px; overflow: auto; }
.inv-out[hidden] { display: none; }
.inv-tag { display: inline-block; background: var(--accent); color: var(--accent-ink); border-radius: 6px; padding: 0 5px; margin: 0 1px; font-size: 11px; font-weight: 700; vertical-align: 2px; }
@media (max-width: 520px) { .inv-row { grid-template-columns: 1fr auto; } .inv-row .w { display: none; } }
.sym-row.wide .sym { height: auto; min-height: 48px; white-space: normal; overflow-wrap: anywhere; text-overflow: clip; padding: 8px 10px; line-height: 1.35; }

/* Picture letters: graffiti and tattoo (2 Oct 2026) */
.lt-stage svg { width: 100%; height: auto; display: block; border-radius: 12px; background: repeating-conic-gradient(#e7e7e7 0 25%, #fff 0 50%) 0 0 / 20px 20px; }
.lt-bar { display: grid; gap: 12px; }
.lt-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin: 0 0 30px; }
.lt-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: grid; gap: 10px; }
.lt-card h2 { font-size: 16px; margin: 0; display: flex; justify-content: space-between; gap: 8px; }
.lt-card h2 small { color: var(--muted); font-weight: 500; font-size: 13px; }
.lt-pic svg { width: 100%; height: auto; display: block; border-radius: 10px; }
.lt-pic { min-height: 90px; }
@media (max-width: 400px) { .lt-cards { grid-template-columns: minmax(0, 1fr); } }
@media print { #lt .gpanel, .lt-bar, .lt-card .seg { display: none !important; } }

/* ASCII art */
.fg-cards { display: grid; gap: 14px; margin: 0 0 30px; }
.fg-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.fg-card h2 { font-size: 16px; margin: 0 0 8px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; }
.fg-card h2 small { color: var(--muted); font-weight: 500; font-size: 13px; }
.fg-card pre { margin: 0 0 10px; padding: 12px; background: var(--bg); border-radius: 10px; overflow-x: auto; font: 13px/1.2 ui-monospace, Menlo, Consolas, "Courier New", monospace; white-space: pre; }

/* Cookie banner (GA4 consent, basic mode) */
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50; max-width: 560px; margin: 0 auto; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,.35); padding: 14px 16px; display: grid; gap: 10px; }
.consent[hidden] { display: none; }
.consent p { margin: 0; font-size: 14px; line-height: 1.5; }
.consent a { color: var(--accent); }
.consent-btns { display: flex; gap: 8px; justify-content: flex-end; }
.consent-btns .btn { min-height: 44px; }
.content td, .content th { overflow-wrap: anywhere; }
.lt-bar .seg { flex-wrap: wrap; }
@media (max-width: 400px) { .tab { white-space: normal; line-height: 1.2; padding: 6px 4px; } }

/* Case converter */
.cc { display: grid; gap: 12px; }
.cc-in { width: 100%; min-height: 180px; resize: vertical; border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 12px; padding: 14px; font-size: 17px; line-height: 1.5; }
.cc-in:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
.cc-stats { margin: 0; font-size: 14px; color: var(--muted); min-height: 1.4em; }
.cc-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.cc-btns .btn { min-height: 44px; font-family: var(--mono, ui-monospace, Menlo, Consolas, monospace); font-weight: 600; letter-spacing: 0; }
.cc-sub { margin: 4px 0 -4px; }
.cc-actions { border-top: 1px solid var(--line); padding-top: 12px; }
