/* Colors of India: daisyUI-style tool UI on a warm base.
   Themes: [data-theme=light|dark]. Primary: --accent (+ --accent-content). Sidebar: [data-sidebar=collapsed]. */

:root {
  --font-sans: "Geist", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", "Noto Sans Tamil", "Noto Sans Devanagari", "Noto Sans Telugu", sans-serif;
  --font-mono: "Geist Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --accent: #0F5F7C;
  --accent-content: #FFFFFF;
  --r: 16px;
  --r-sm: 10px;
  --r-xs: 6px;
  --r-pill: 999px;
  --topbar: 64px;
  --sidebar-w: 248px;
  --side-panel: 340px;
  /* Toran: a row of pennants in sindoor, turmeric, peacock and paan. */
  --toran: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='6'%3E%3Cpath fill='%23D42A1F' d='M0 0h16L8 6z'/%3E%3Cpath fill='%23E7A81E' d='M16 0h16l-8 6z'/%3E%3Cpath fill='%230F5F7C' d='M32 0h16l-8 6z'/%3E%3Cpath fill='%232F7D4B' d='M48 0h16l-8 6z'/%3E%3C/svg%3E");
  /* Jaali: a lattice screen, drawn thin. */
  --jaali: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40' fill='none' stroke='%23C58E2E' stroke-opacity='.5'%3E%3Cpath d='M20 0 40 20 20 40 0 20z'/%3E%3Cpath d='M20 9 31 20 20 31 9 20z'/%3E%3Ccircle cx='20' cy='20' r='2.5'/%3E%3C/svg%3E");
  /* Kolam: a looping line with a dot in each eye. */
  --kolam: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='14' viewBox='0 0 28 14' fill='none' stroke='%23C58E2E' stroke-opacity='.75'%3E%3Cpath d='M0 7c3.5-7 10.5-7 14 0s10.5 7 14 0'/%3E%3Cpath d='M0 7c3.5 7 10.5 7 14 0s10.5-7 14 0'/%3E%3Ccircle cx='7' cy='7' r='1.3' fill='%23C58E2E' stroke='none'/%3E%3Ccircle cx='21' cy='7' r='1.3' fill='%23C58E2E' stroke='none'/%3E%3C/svg%3E");
  /* Motifs (ogee lattice with flowers, boteh/paisley, buta, chakra) as colored images; dark theme swaps the gold. */
  --p-ogee: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2248%22 height=%2248%22 viewBox=%220 0 48 48%22%3E%3Cg fill=%22none%22 stroke=%22%23A9791F%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%221%22%3E%3Cpath d=%22M0 24C12 24 12 0 24 0C36 0 36 24 48 24%22/%3E%3Cpath d=%22M0 24C12 24 12 48 24 48C36 48 36 24 48 24%22/%3E%3Cg transform=%22translate(24 24) scale(.74) translate(-24 -24)%22%3E%3Cpath d=%22M0 24C12 24 12 0 24 0C36 0 36 24 48 24%22/%3E%3Cpath d=%22M0 24C12 24 12 48 24 48C36 48 36 24 48 24%22/%3E%3C/g%3E%3Cg transform=%22translate(24 24)%22%3E%3Cellipse cx=%220%22 cy=%22-4.4%22 rx=%221.8%22 ry=%222.9%22 transform=%22rotate(0)%22/%3E%3Cellipse cx=%220%22 cy=%22-4.4%22 rx=%221.8%22 ry=%222.9%22 transform=%22rotate(60)%22/%3E%3Cellipse cx=%220%22 cy=%22-4.4%22 rx=%221.8%22 ry=%222.9%22 transform=%22rotate(120)%22/%3E%3Cellipse cx=%220%22 cy=%22-4.4%22 rx=%221.8%22 ry=%222.9%22 transform=%22rotate(180)%22/%3E%3Cellipse cx=%220%22 cy=%22-4.4%22 rx=%221.8%22 ry=%222.9%22 transform=%22rotate(240)%22/%3E%3Cellipse cx=%220%22 cy=%22-4.4%22 rx=%221.8%22 ry=%222.9%22 transform=%22rotate(300)%22/%3E%3C/g%3E%3C/g%3E%3Cg fill=%22%23A9791F%22%3E%3Ccircle cx=%2224%22 cy=%2224%22 r=%221.3%22/%3E%3Ccircle cx=%220%22 cy=%2224%22 r=%221.4%22/%3E%3Ccircle cx=%2248%22 cy=%2224%22 r=%221.4%22/%3E%3Ccircle cx=%2224%22 cy=%220%22 r=%221.4%22/%3E%3Ccircle cx=%2224%22 cy=%2248%22 r=%221.4%22/%3E%3C/g%3E%3C/svg%3E");
  --p-buta: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2264%22 height=%2264%22 viewBox=%220 0 64 64%22%3E%3Cg fill=%22none%22 stroke=%22%23A9791F%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%221.1%22%3E%3Cpath d=%22M32 4c6 8 12 12 12 22 0 8-5 12-12 12S20 34 20 26C20 16 26 12 32 4z%22/%3E%3Cpath d=%22M32 12c3 5 7 8 7 14 0 5-3 8-7 8s-7-3-7-8c0-6 4-9 7-14z%22/%3E%3Cpath d=%22M32 38v22M32 50c-6-1-10-5-11-10M32 50c6-1 10-5 11-10M32 58c-4 0-7-2-8-5M32 58c4 0 7-2 8-5%22/%3E%3Ccircle cx=%2232%22 cy=%2224%22 r=%222.6%22/%3E%3C/g%3E%3C/svg%3E");
}
html[data-sidebar="collapsed"] { --sidebar-w: 72px; }

:root, [data-theme="light"] {
  color-scheme: light;
  --bg: #F3EDE1;
  --surface: #FFFDF8;
  --surface-2: #F8F3E9;
  --surface-3: #EAE1CF;
  --border: #E6DDCB;
  --border-strong: #D3C8B0;
  --text: #1E1A14;
  --text-2: #4A4338;
  --muted: #6B6253;
  --ink: #26211A;
  --on-ink: #FBF6EA;
  --hover: rgba(60, 40, 10, 0.06);
  --swatch-edge: rgba(0, 0, 0, 0.1);
  --shadow-sm: 0 1px 2px rgba(60, 40, 10, 0.07), 0 1px 1px rgba(60, 40, 10, 0.04);
  --pop-shadow: 0 12px 32px rgba(60, 40, 10, 0.14), 0 1px 3px rgba(60, 40, 10, 0.08);
  --accent-text: color-mix(in oklab, var(--accent) 55%, #111111);
  --ok-bg: #E6F1E4; --ok-text: #2A5A2F;
  --warn-bg: #FBF0CF; --warn-text: #7A5200;
  --bad-bg: #FBE4E3; --bad-text: #9A2B29;
}
[data-theme="dark"] {
  color-scheme: dark;
  --p-ogee: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2248%22 height=%2248%22 viewBox=%220 0 48 48%22%3E%3Cg fill=%22none%22 stroke=%22%23E3B04B%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%221%22%3E%3Cpath d=%22M0 24C12 24 12 0 24 0C36 0 36 24 48 24%22/%3E%3Cpath d=%22M0 24C12 24 12 48 24 48C36 48 36 24 48 24%22/%3E%3Cg transform=%22translate(24 24) scale(.74) translate(-24 -24)%22%3E%3Cpath d=%22M0 24C12 24 12 0 24 0C36 0 36 24 48 24%22/%3E%3Cpath d=%22M0 24C12 24 12 48 24 48C36 48 36 24 48 24%22/%3E%3C/g%3E%3Cg transform=%22translate(24 24)%22%3E%3Cellipse cx=%220%22 cy=%22-4.4%22 rx=%221.8%22 ry=%222.9%22 transform=%22rotate(0)%22/%3E%3Cellipse cx=%220%22 cy=%22-4.4%22 rx=%221.8%22 ry=%222.9%22 transform=%22rotate(60)%22/%3E%3Cellipse cx=%220%22 cy=%22-4.4%22 rx=%221.8%22 ry=%222.9%22 transform=%22rotate(120)%22/%3E%3Cellipse cx=%220%22 cy=%22-4.4%22 rx=%221.8%22 ry=%222.9%22 transform=%22rotate(180)%22/%3E%3Cellipse cx=%220%22 cy=%22-4.4%22 rx=%221.8%22 ry=%222.9%22 transform=%22rotate(240)%22/%3E%3Cellipse cx=%220%22 cy=%22-4.4%22 rx=%221.8%22 ry=%222.9%22 transform=%22rotate(300)%22/%3E%3C/g%3E%3C/g%3E%3Cg fill=%22%23E3B04B%22%3E%3Ccircle cx=%2224%22 cy=%2224%22 r=%221.3%22/%3E%3Ccircle cx=%220%22 cy=%2224%22 r=%221.4%22/%3E%3Ccircle cx=%2248%22 cy=%2224%22 r=%221.4%22/%3E%3Ccircle cx=%2224%22 cy=%220%22 r=%221.4%22/%3E%3Ccircle cx=%2224%22 cy=%2248%22 r=%221.4%22/%3E%3C/g%3E%3C/svg%3E");
  --p-buta: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2264%22 height=%2264%22 viewBox=%220 0 64 64%22%3E%3Cg fill=%22none%22 stroke=%22%23E3B04B%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%221.1%22%3E%3Cpath d=%22M32 4c6 8 12 12 12 22 0 8-5 12-12 12S20 34 20 26C20 16 26 12 32 4z%22/%3E%3Cpath d=%22M32 12c3 5 7 8 7 14 0 5-3 8-7 8s-7-3-7-8c0-6 4-9 7-14z%22/%3E%3Cpath d=%22M32 38v22M32 50c-6-1-10-5-11-10M32 50c6-1 10-5 11-10M32 58c-4 0-7-2-8-5M32 58c4 0 7-2 8-5%22/%3E%3Ccircle cx=%2232%22 cy=%2224%22 r=%222.6%22/%3E%3C/g%3E%3C/svg%3E");
  --bg: #14110E;
  --surface: #1E1B16;
  --surface-2: #27231D;
  --surface-3: #332E26;
  --border: #322D25;
  --border-strong: #4A4337;
  --text: #EFE8D9;
  --text-2: #CFC6B3;
  --muted: #A39A87;
  --ink: #EFE8D9;
  --on-ink: #14110E;
  --hover: rgba(255, 240, 210, 0.07);
  --swatch-edge: rgba(255, 255, 255, 0.12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --pop-shadow: 0 14px 36px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--border);
  --accent-text: color-mix(in oklab, var(--accent) 50%, #FFFFFF);
  --ok-bg: #1E2B1F; --ok-text: #9BD2A0;
  --warn-bg: #2E2614; --warn-text: #E7C46B;
  --bad-bg: #331C1C; --bad-text: #F0A3A0;
}
:root {
  --accent-soft: color-mix(in oklab, var(--accent) 13%, var(--surface));
  --accent-ring: color-mix(in oklab, var(--accent) 55%, transparent);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 2px; }
h1 { font-size: 26px; line-height: 1.2; letter-spacing: -0.02em; font-weight: 600; margin: 0; text-wrap: balance; }
h2 { font-size: 15px; line-height: 1.3; letter-spacing: -0.01em; font-weight: 600; margin: 0; }
h3 { font-size: 13px; font-weight: 600; margin: 0; }
p { margin: 0; }
code, .mono { font-family: var(--font-mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.i { width: 16px; height: 16px; flex: none; }
.i-fill { display: none; }
[hidden] { display: none !important; }

.skip { position: absolute; left: 12px; top: -40px; z-index: 100; background: var(--ink); color: var(--on-ink); padding: 8px 12px; border-radius: var(--r-sm); text-decoration: none; }
.skip:focus { top: 10px; }

/* ---------- shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar);
  display: flex; align-items: center; gap: 12px;
  padding: 6px 16px 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.topbar::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--toran) repeat-x; background-size: 64px 6px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 15px; letter-spacing: -0.01em; text-decoration: none; white-space: nowrap; }
.brand-mark { flex: none; }
.cmdk { position: relative; flex: 0 1 420px; min-width: 0; margin-left: 8px; }
.cmdk .input { width: 100%; padding-right: 48px; }
.cmdk .kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.i-mobile { display: none; }

.layout { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: calc(100vh - var(--topbar)); transition: grid-template-columns 0.2s ease-out; }
.sidebar {
  position: sticky; top: var(--topbar);
  height: calc(100vh - var(--topbar));
  overflow-x: hidden; overflow-y: auto;
  display: flex; flex-direction: column; justify-content: space-between;
  border-right: 1px solid var(--border);
  padding: 14px 12px 18px;
  background: var(--surface);
}
.nav-group { margin-bottom: 12px; }
.nav-label { font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 12px 6px; white-space: nowrap; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 12px;
  height: 40px; padding: 0 12px; margin-bottom: 2px;
  border-radius: var(--r-sm);
  text-decoration: none; color: var(--text-2); font-size: 14px; white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.nav-link .i { width: 20px; height: 20px; }
.nav-link:hover { background: var(--hover); color: var(--text); }
.nav-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.nav-link[aria-current="page"] .i-reg { display: none; }
.nav-link[aria-current="page"] .i-fill { display: block; }
.side-art { display: grid; place-items: center; color: var(--border-strong); padding-top: 12px; }
.side-art .i { width: 40px; height: 40px; }
.scrim { display: none; }

@media (min-width: 901px) {
  html[data-sidebar="collapsed"] .nav-label { height: 1px; padding: 0; margin: 10px 14px; background: var(--border); overflow: hidden; }
  html[data-sidebar="collapsed"] .nav-label span { display: none; }
  html[data-sidebar="collapsed"] .nav-link { justify-content: center; padding: 0; }
  html[data-sidebar="collapsed"] .nav-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  html[data-sidebar="collapsed"] .side-art .i { width: 28px; height: 28px; }
}

.main { padding: 28px 36px 64px; min-width: 0; }
.container { max-width: 1240px; margin: 0 auto; }
.page-head {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 20px; padding: 18px 22px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-sm);
}
.page-head::after {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 46%;
  background: var(--jaali); background-size: 40px 40px; opacity: 0.55;
  -webkit-mask-image: linear-gradient(to left, #000, transparent 85%); mask-image: linear-gradient(to left, #000, transparent 85%);
  pointer-events: none;
}
.ph-icon { flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--accent-text); }
.ph-icon .i { width: 26px; height: 26px; }
.ph-text { position: relative; z-index: 1; min-width: 0; }
.page-head h1 { font-size: 24px; }
.page-head p { margin-top: 2px; color: var(--muted); max-width: 70ch; }

/* ---------- components ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 14px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  border-radius: var(--r-sm); box-shadow: var(--shadow-sm);
  font: 500 13.5px/1 var(--font-sans);
  cursor: pointer; text-decoration: none; white-space: nowrap; user-select: none;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn .i { width: 18px; height: 18px; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn-primary { background: var(--accent); color: var(--accent-content); border-color: var(--accent); }
.btn-primary:hover { background: color-mix(in oklab, var(--accent) 88%, #000); }
.btn-neutral { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--hover); }
.btn-icon { width: 38px; padding: 0; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-sm.btn-icon { width: 30px; padding: 0; }
.btn-sm .i { width: 16px; height: 16px; }
.fav.is-on { color: #D42A1F; }
.fav.is-on .i-reg { display: none; }
.fav.is-on .i-fill { display: block; }

.join { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); }
.join button, .join a {
  height: 30px; padding: 0 11px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; background: transparent; color: var(--muted);
  border-radius: calc(var(--r-sm) - 3px);
  font: 500 12.5px/1 var(--font-sans); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.join button:hover, .join a:hover { color: var(--text); background: var(--hover); }
.join [aria-pressed="true"], .join [aria-current="true"] { background: var(--ink); color: var(--on-ink); }
.join .icon-only { width: 32px; padding: 0; }
.join .i { width: 16px; height: 16px; }

.input, .select {
  height: 38px; min-width: 0;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  border-radius: var(--r-sm); padding: 0 12px; font-size: 13.5px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder { color: var(--muted); }
.input:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 22%, transparent); }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8984' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 14px;
}
input[type="date"].input { padding-right: 8px; }
.field { position: relative; display: flex; align-items: center; min-width: 0; }
.field > .i { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.field > .input { padding-left: 36px; width: 100%; }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
.kbd { font: 11px/1.5 var(--font-mono); border: 1px solid var(--border-strong); border-bottom-width: 2px; background: var(--surface-2); border-radius: var(--r-xs); padding: 0 6px; color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-sm); }
.card-pad { padding: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.card-head h2 { font-size: 13.5px; }

.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: var(--r-pill); font: 600 11px/1 var(--font-sans); letter-spacing: 0.02em; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok-text); border-color: transparent; }
.badge-warn { background: var(--warn-bg); color: var(--warn-text); border-color: transparent; }
.badge-bad { background: var(--bad-bg); color: var(--bad-text); border-color: transparent; }

.toggle-row { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.toggle { appearance: none; -webkit-appearance: none; flex: none; width: 34px; height: 20px; margin: 0; border-radius: var(--r-pill); background: var(--surface-3); border: 1px solid var(--border-strong); position: relative; cursor: pointer; transition: background 0.15s; }
.toggle::before { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: var(--r-pill); background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); transition: transform 0.15s; }
.toggle:checked { background: var(--accent); border-color: var(--accent); }
.toggle:checked::before { transform: translateX(14px); background: var(--accent-content); }

.tabs { display: inline-flex; max-width: 100%; gap: 2px; padding: 4px; border-radius: var(--r-sm); background: var(--surface-3); overflow-x: auto; }
.tab { height: 34px; padding: 0 16px; border: 0; border-radius: calc(var(--r-sm) - 2px); background: none; color: var(--muted); font-weight: 500; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.toolbar .grow { flex: 1 1 260px; }
.toolbar .spacer { flex: 1; }
.count { font-size: 12px; color: var(--muted); margin: 0 0 12px; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: var(--r); }
.more { display: flex; justify-content: center; margin-top: 18px; }

.listbox { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--pop-shadow); padding: 4px; max-height: 360px; overflow-y: auto; }
.lb-label { font-size: 11px; color: var(--muted); padding: 8px 8px 4px; }
.option { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: var(--r-sm); cursor: pointer; font-size: 13px; text-decoration: none; color: var(--text); }
.option:hover, .option[aria-selected="true"] { background: var(--hover); }
.option .sw { width: 18px; height: 18px; border-radius: var(--r-xs); box-shadow: inset 0 0 0 1px var(--swatch-edge); flex: none; }
.option .end { margin-left: auto; color: var(--muted); font: 11.5px var(--font-mono); }
.lb-empty { padding: 12px 8px; color: var(--muted); font-size: 13px; }

.dropdown { position: relative; }
.dropdown > summary { list-style: none; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 180px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--pop-shadow); padding: 4px; }
.dropdown-panel a, .dropdown-panel button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; background: none; border-radius: var(--r-sm); text-align: left; font-size: 13px; text-decoration: none; cursor: pointer; color: var(--text); }
.dropdown-panel a:hover, .dropdown-panel button:hover { background: var(--hover); }
.dropdown-panel [aria-current="true"] { font-weight: 600; }
.accent-panel { width: 220px; }
.dot { width: 10px; height: 10px; border-radius: var(--r-pill); flex: none; box-shadow: inset 0 0 0 1px var(--swatch-edge); }
.dropdown-panel .dot { width: 14px; height: 14px; border-radius: var(--r-xs); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 8px); background: var(--ink); color: var(--on-ink); padding: 8px 14px; border-radius: var(--r-sm); font-size: 13px; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 100; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.sw-dot { display: inline-block; width: 16px; height: 16px; border-radius: var(--r-xs); box-shadow: inset 0 0 0 1px var(--swatch-edge); vertical-align: middle; flex: none; }

/* key/value rows */
.kv { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 14px; border-top: 1px solid var(--border); min-height: 44px; }
.kv:first-child { border-top: 0; }
.kv-label { color: var(--muted); font-size: 12.5px; flex: none; }
.kv-value { display: flex; align-items: center; gap: 6px; min-width: 0; }
.kv-value .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* code block */
.code { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.code-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 6px 6px 12px; border-bottom: 1px solid var(--border); font: 12px var(--font-mono); color: var(--muted); }
.code-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code pre { margin: 0; padding: 12px; max-height: 360px; overflow: auto; font: 12px/1.6 var(--font-mono); color: var(--text-2); white-space: pre; }

/* two-column tool layout */
.tool { display: grid; grid-template-columns: minmax(0, 1fr) var(--side-panel); gap: 20px; align-items: start; }
.tool-side { position: sticky; top: calc(var(--topbar) + 16px); display: flex; flex-direction: column; gap: 16px; }
.side-title { font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* anchor picker */
.picker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.preset { width: 26px; height: 26px; padding: 0; border: 0; border-radius: var(--r-xs); box-shadow: inset 0 0 0 1px var(--swatch-edge); cursor: pointer; transition: transform 0.1s; }
.preset:hover { transform: translateY(-1px); }
.preset[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text); }
.combo { position: relative; flex: 0 1 280px; min-width: 200px; }
.picker .spacer { flex: 1; }

/* ---------- color cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 12px; list-style: none; padding: 0; margin: 0; }
.ccard { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; transition: border-color 0.15s, box-shadow 0.2s; }
.ccard:hover { border-color: var(--border-strong); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04); }
.ccard-swatch { aspect-ratio: 4 / 3; border-bottom: 1px solid var(--border); }
.ccard-body { padding: 10px 10px 8px 12px; display: flex; flex-direction: column; gap: 4px; }
.ccard-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.ccard-name { font-weight: 500; font-size: 13.5px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccard-name::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.ccard-no { font: 11.5px var(--font-mono); color: var(--muted); flex: none; }
.ccard-val { position: relative; z-index: 2; min-width: 0; margin: 0 0 0 -5px; padding: 3px 5px; border: 0; border-radius: var(--r-xs); background: none; text-align: left; cursor: copy; font: 12px var(--font-mono); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccard-val:hover { background: var(--hover); color: var(--text); }
.ccard-actions { display: flex; gap: 0; position: relative; z-index: 2; margin-right: -4px; }

/* all colors */
.family-group { margin-bottom: 28px; }
.family-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.family-head span { color: var(--muted); font-size: 12px; }
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 4px; list-style: none; margin: 0; padding: 0; }
.chip { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--r-sm); text-decoration: none; min-width: 0; }
.chip:hover { background: var(--hover); }
.chip .sw { width: 30px; height: 30px; border-radius: var(--r-xs); box-shadow: inset 0 0 0 1px var(--swatch-edge); flex: none; }
.chip-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.chip-text b { font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-text span { font: 11.5px var(--font-mono); color: var(--muted); }

/* table */
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); max-height: calc(100vh - 240px); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 0 12px; height: 36px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.table th button:hover { color: var(--text); }
.table th[aria-sort] button { color: var(--text); }
.table td { padding: 7px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--hover); }
.table td a { text-decoration: none; font-weight: 500; }
.table td a:hover { text-decoration: underline; }
.table .mono { color: var(--text-2); }

/* detail and explorer hero */
.hero-swatch { border-radius: var(--r); min-height: 300px; padding: 22px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: inset 0 0 0 1px var(--swatch-edge); }
.hero-swatch .hero-no { font: 12px var(--font-mono); opacity: 0.85; }
.hero-swatch h1, .hero-swatch .hero-name { font-size: 32px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.hero-swatch .hero-sub { margin-top: 4px; font-size: 13.5px; opacity: 0.85; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 20px; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }
.pair-list { list-style: none; margin: 0; padding: 0; }
.pair-list li + li { border-top: 1px solid var(--border); }
.pair-list a { display: flex; align-items: center; gap: 10px; padding: 9px 14px; text-decoration: none; }
.pair-list a:hover { background: var(--hover); }
.pair-list .sw { width: 22px; height: 22px; border-radius: var(--r-xs); box-shadow: inset 0 0 0 1px var(--swatch-edge); flex: none; }
.pair-list .pl-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.pair-list .pl-text span { font-size: 11.5px; color: var(--muted); }
.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.link-grid .btn { justify-content: space-between; }
.prevnext { display: flex; justify-content: space-between; gap: 8px; margin-top: 20px; }

/* explorer */
.spectrum { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; }
.spectrum button { aspect-ratio: 1; border: 0; padding: 0; border-radius: var(--r-xs); cursor: pointer; box-shadow: inset 0 0 0 1px var(--swatch-edge); }
.spectrum button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--text); position: relative; z-index: 1; }
.fchips { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 13px; border: 1px solid var(--border-strong); border-radius: var(--r-pill); background: var(--surface); color: var(--text-2); font-size: 13px; cursor: pointer; text-decoration: none; }
.fchip:hover { color: var(--text); background: var(--surface-2); }
.fchip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.fchip .dot { width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--swatch-edge); }
.stepper { display: grid; grid-template-columns: 34px 1fr 34px; gap: 8px; }

/* generator */
.gen { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.gen-col { display: flex; flex-direction: column; min-width: 0; }
.gen-col + .gen-col { border-left: 1px solid var(--border); }
.gen-swatch { height: 320px; padding: 10px; display: flex; flex-direction: column; justify-content: space-between; }
.gen-tools { display: flex; justify-content: flex-end; gap: 2px; }
.gen-tools .btn { color: inherit; }
.gen-tools .btn:hover { background: color-mix(in oklab, currentColor 12%, transparent); }
.gen-tools .btn[aria-pressed="true"] { background: color-mix(in oklab, currentColor 18%, transparent); }
.gen-sample { padding: 6px; display: flex; flex-direction: column; gap: 8px; }
.gen-sample .rule { width: 22px; height: 2px; }
.gen-sample strong { font-size: 17px; line-height: 1.25; font-weight: 600; }
.gen-sample p { font-size: 12.5px; line-height: 1.5; }
.gen-sample span { align-self: flex-start; padding: 5px 10px; font-size: 12px; font-weight: 600; border-radius: var(--r-xs); }
.gen-info { padding: 12px; display: flex; flex-direction: column; gap: 5px; border-top: 1px solid var(--border); }
.gen-role { font-size: 12px; color: var(--muted); }
.gen-name { font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.gen-name:hover { text-decoration: underline; }
.gen-val { display: flex; align-items: center; justify-content: space-between; gap: 4px; font: 12px var(--font-mono); color: var(--text-2); }
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding: 8px 8px 8px 14px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
.bar-note { font-size: 12.5px; color: var(--muted); }

/* palette ideas */
.idea { margin-bottom: 22px; }
.idea-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border-radius: var(--r); overflow: hidden; box-shadow: inset 0 0 0 1px var(--swatch-edge); }
.strip a { height: 104px; padding: 8px; display: flex; align-items: flex-end; text-decoration: none; min-width: 0; }
.strip span { font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip small { display: block; font: 11px var(--font-mono); opacity: 0.85; }

/* usage cards */
.ucards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.ucard { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.ucard-preview { padding: 20px; min-height: 150px; display: flex; flex-direction: column; gap: 6px; }
.ucard-preview strong { font-size: 22px; line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; }
.ucard-preview span { font-size: 15px; }
.ucard-preview p { font-size: 12.5px; margin-top: auto; max-width: 34ch; }
.ucard-foot { padding: 10px 10px 10px 12px; display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--border); font-size: 12.5px; }
.ucard-foot .row { justify-content: space-between; flex-wrap: nowrap; }
.ucard-foot .names { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }

/* gradients */
.gcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.gcard { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.gcard-preview { display: block; width: 100%; height: 130px; border: 0; cursor: pointer; }
.gcard-foot { padding: 10px 10px 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.gcard-foot .mono { color: var(--muted); font-size: 11.5px; }

/* palette role strip (scene) */
.roles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.role { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; background: var(--surface); min-width: 0; }
.role-sw { height: 52px; }
.role-info { padding: 8px 10px; font-size: 12px; line-height: 1.35; }
.role-info b { display: block; font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-info span { color: var(--muted); }

/* scenes: mocks scale with their container */
.section-head .count { margin: 0 0 0 6px; font-weight: 400; }

/* theme generator: product mock driven by --m-* variables */
.app-mock {
  container-type: inline-size;
  display: grid; grid-template-columns: 188px minmax(0, 1fr);
  border: 1px solid var(--m-border); border-radius: var(--r); overflow: hidden;
  background: var(--m-background); color: var(--m-foreground);
  font: 13px/1.5 var(--font-sans);
}
.m-side { background: var(--m-sidebar); color: var(--m-sidebar-foreground); border-right: 1px solid var(--m-border); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; }
.m-logo { display: flex; align-items: center; gap: 8px; font-weight: 600; padding: 4px 8px 14px; }
.m-logo i { width: 20px; height: 20px; background: var(--m-primary); border-radius: var(--m-r); display: block; }
.m-nav { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: var(--m-r); color: var(--m-muted-foreground); }
.m-nav.on { background: var(--m-sidebar-accent); color: var(--m-sidebar-accent-foreground); font-weight: 500; }
.m-nav .i { width: 15px; height: 15px; }
.m-main { padding: 16px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.m-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.m-crumb { font-size: 11.5px; color: var(--m-muted-foreground); }
.m-title { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.m-search { height: 32px; width: 180px; border: 1px solid var(--m-input); border-radius: var(--m-r); background: var(--m-background); display: flex; align-items: center; gap: 6px; padding: 0 9px; color: var(--m-muted-foreground); font-size: 12px; }
.m-iconbtn { width: 32px; height: 32px; border: 1px solid var(--m-border); border-radius: var(--m-r); display: grid; place-items: center; position: relative; }
.m-iconbtn::after { content: ""; position: absolute; top: 6px; right: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--m-destructive); }
.m-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.m-card { background: var(--m-card); color: var(--m-card-foreground); border: 1px solid var(--m-border); border-radius: var(--m-r); padding: 14px; min-width: 0; }
.m-card-title { font-size: 12px; color: var(--m-muted-foreground); }
.m-big { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin: 2px 0 6px; }
.m-delta { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: var(--m-r); }
.m-grid2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; }
.m-chart { width: 100%; height: 150px; margin-top: 8px; }
.m-legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11.5px; color: var(--m-muted-foreground); margin-top: 8px; }
.m-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.m-bars { display: flex; height: 8px; border-radius: var(--m-r); overflow: hidden; margin-top: 10px; }
.m-tabs { display: flex; gap: 4px; padding: 3px; background: var(--m-muted); border-radius: var(--m-r); margin: 10px 0 12px; }
.m-tabs span { flex: 1; text-align: center; padding: 5px; font-size: 12px; border-radius: max(0px, calc(var(--m-r) - 2px)); color: var(--m-muted-foreground); }
.m-tabs span.on { background: var(--m-background); color: var(--m-foreground); font-weight: 500; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06); }
.m-label { font-size: 12px; font-weight: 500; margin: 8px 0 4px; display: block; }
.m-input { height: 32px; border: 1px solid var(--m-input); border-radius: var(--m-r); background: var(--m-background); padding: 0 10px; display: flex; align-items: center; font-size: 12.5px; }
.m-switch-row { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; font-size: 12.5px; }
.m-switch { width: 32px; height: 18px; border-radius: 999px; background: var(--m-primary); position: relative; }
.m-switch::after { content: ""; position: absolute; top: 2px; right: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--m-primary-foreground); }
.m-btns { display: flex; gap: 8px; margin-top: 14px; }
.m-btn { height: 32px; padding: 0 12px; border-radius: var(--m-r); display: inline-flex; align-items: center; font-size: 12.5px; font-weight: 500; }
.m-btn-primary { background: var(--m-primary); color: var(--m-primary-foreground); }
.m-btn-secondary { background: var(--m-secondary); color: var(--m-secondary-foreground); }
.m-btn-outline { border: 1px solid var(--m-border); }
.m-btn-danger { background: var(--m-destructive); color: var(--m-destructive-foreground); }
.m-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 6px; }
.m-table th { text-align: left; font-weight: 500; color: var(--m-muted-foreground); font-size: 11.5px; padding: 6px 0; border-bottom: 1px solid var(--m-border); }
.m-table td { padding: 8px 0; border-bottom: 1px solid var(--m-border); }
.m-table tr:last-child td { border-bottom: 0; }
.m-badge { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 500; }
.m-alert { border: 1px solid var(--m-border); background: var(--m-accent); color: var(--m-accent-foreground); border-radius: var(--m-r); padding: 10px 12px; font-size: 12.5px; display: flex; gap: 8px; align-items: flex-start; }
@container (max-width: 640px) {
  .m-stats, .m-grid2 { grid-template-columns: 1fr; }
  .m-search { display: none; }
}

/* token list */
.tokens { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.token { display: flex; align-items: center; gap: 8px; padding: 6px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); font-size: 12px; min-width: 0; cursor: pointer; text-align: left; }
.token:hover { border-color: var(--border-strong); }
.token .sw-dot { width: 22px; height: 22px; }
.token div { min-width: 0; line-height: 1.3; }
.token b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.token span { font: 11px var(--font-mono); color: var(--muted); }

/* terminal */
.term { border-radius: var(--r); overflow: hidden; box-shadow: 0 0 0 1px var(--border); font: 12.5px/1.6 var(--font-mono); }
.term-bar { height: 36px; display: flex; align-items: center; justify-content: center; position: relative; font-size: 12px; opacity: 0.9; }
.term-dots { position: absolute; left: 14px; display: flex; gap: 7px; }
.term-dots i { width: 11px; height: 11px; border-radius: 50%; display: block; opacity: 0.9; }
.term-body { padding: 14px 18px 18px; white-space: pre; overflow-x: auto; min-height: 420px; }
.term-body b { font-weight: 700; }
.ansi { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; }
.ansi button { height: 30px; border: 0; padding: 0; border-radius: var(--r-xs); cursor: pointer; box-shadow: inset 0 0 0 1px var(--swatch-edge); }

/* color of the day */

/* saved */
.saved-pal { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
.saved-pal + .saved-pal { margin-top: 8px; }
.saved-pal .strip a { height: 56px; }
.section { margin-top: 28px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }

/* prose (skills) */
.prose { max-width: 760px; }
.prose h2 { font-size: 18px; margin: 32px 0 10px; }
.prose p { margin: 0 0 12px; color: var(--text-2); line-height: 1.65; }
.prose ul { margin: 0 0 12px; padding-left: 20px; color: var(--text-2); line-height: 1.7; }
.prose code { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-xs); padding: 0 4px; }
.prose .code { margin: 0 0 16px; }

/* ---------- shared bits for the tool pages ---------- */
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.hint { font-size: 12px; line-height: 1.45; color: var(--muted); }
.opt-block { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.opt-block + .opt-block { border-top: 1px solid var(--border); }
.opt-block.row-between { flex-direction: row; }
.opt-label { font-size: 13px; font-weight: 500; }
.opt-list { gap: 0; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 34px; font-size: 13px; cursor: pointer; }
.seg { display: flex; }
.seg button { flex: 1; }
.side-sec h3 { margin: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.side-sec + .side-sec { margin-top: 4px; }
.tool-main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.bar.sticky { position: sticky; bottom: 12px; z-index: 20; box-shadow: var(--pop-shadow); margin-top: 16px; }
.bar-status { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dot-status { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.dot-status.ok { background: #2F7D4B; }
.dot-status.warn { background: #E7A81E; }
.dropdown-panel.up { top: auto; bottom: calc(100% + 6px); }

/* ---------- color of the day ---------- */
.today-stage { display: grid; place-items: center; min-height: 480px; padding: 28px; border: 1px solid var(--border); border-radius: var(--r); background: color-mix(in oklab, var(--accent) 6%, var(--surface-2)); }
.today-stage img { max-width: 100%; max-height: 640px; width: auto; height: auto; border-radius: 6px; box-shadow: var(--pop-shadow); }
.today-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.continue h3 { margin: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.copybox { margin: 0; padding: 12px; max-height: 260px; overflow: auto; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); font: 12.5px/1.6 var(--font-sans); white-space: pre-wrap; word-break: break-word; }

/* ---------- scene preview ---------- */
.role { display: block; text-decoration: none; color: inherit; }
.scene-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.scene-bar .mode { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.scene-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.scene-grid.single { grid-template-columns: 1fr; }
.scene-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-sm); }
.scene-stage { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 240px; padding: 20px; border: 0; background: color-mix(in oklab, var(--accent) 6%, var(--surface-2)); cursor: zoom-in; }
.scene-grid.single .scene-stage { min-height: 460px; padding: 36px; cursor: zoom-out; }
.scene-info { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px 14px; border-top: 1px solid var(--border); }
.scene-title { display: flex; align-items: center; gap: 8px; }
.scene-title h3 { font-size: 14px; }
.scene-title .spacer { flex: 1; }
.scene-desc { font-size: 12.5px; color: var(--muted); }
.scene-kv { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 4px 10px; margin: 0; font-size: 12.5px; }
.scene-kv dt { color: var(--muted); }
.scene-kv dd { margin: 0; }

.mock { position: relative; container-type: inline-size; overflow: hidden; width: 100%; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.05); }
.mock-in { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 5cqi; }
.mock-eyebrow { font-size: 2cqi; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; }
.mock-title { font-size: 5.6cqi; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; margin: 1.4cqi 0; }
.mock-body { font-size: 2.3cqi; line-height: 1.5; }
.mock-cta { display: inline-block; align-self: flex-start; margin-top: 3cqi; padding: 1.4cqi 3cqi; font-size: 2.2cqi; font-weight: 600; border-radius: 0.8cqi; }
.mock-web { aspect-ratio: 16 / 10; }
.mock-web .mock-in { padding: 4cqi 5cqi; }
.mock-nav { display: flex; justify-content: space-between; align-items: center; font-size: 2.4cqi; }
.mock-nav .logo { display: flex; gap: 1cqi; align-items: center; font-weight: 700; }
.mock-nav .logo i { width: 2.6cqi; height: 2.6cqi; display: block; border-radius: 0.5cqi; }
.mock-nav nav { display: flex; gap: 3cqi; opacity: 0.85; }
.mock-hero { flex: 1; display: grid; grid-template-columns: 1.2fr 1fr; gap: 5cqi; align-items: center; }
.mock-art { aspect-ratio: 1; border-radius: 1.4cqi; display: grid; place-items: center; font-size: 12cqi; font-weight: 800; }
.mock-slide { aspect-ratio: 16 / 9; }
.mock-slide .mock-in { padding: 6cqi; display: grid; grid-template-columns: 1.3fr 1fr; gap: 5cqi; align-items: center; }
.mock-slide .num { aspect-ratio: 1; display: grid; place-items: center; font-size: 13cqi; font-weight: 700; border-radius: 1cqi; }
.mock-slide .foot { position: absolute; left: 6cqi; right: 6cqi; bottom: 3.5cqi; display: flex; justify-content: space-between; padding-top: 1.5cqi; border-top: 1px solid currentColor; font-size: 1.8cqi; opacity: 0.8; }
.mock-phone { width: 46%; aspect-ratio: 9 / 18; border-radius: 12% / 6%; }
.mock-phone .mock-in { padding: 10cqi 8cqi; gap: 5cqi; }
.mock-phone .mock-title { font-size: 10cqi; margin: 0; }
.mock-phone .mock-body { font-size: 5cqi; }
.mock-phone .tile { border-radius: 5cqi; padding: 7cqi; display: flex; flex-direction: column; gap: 2cqi; }
.mock-phone .tile b { font-size: 12cqi; line-height: 1; }
.mock-phone .tile span { font-size: 4.6cqi; }
.mock-phone .rowx { display: flex; justify-content: space-between; align-items: center; font-size: 5cqi; padding: 3cqi 0; border-bottom: 1px solid; }
.mock-phone .mock-cta { align-self: stretch; margin-top: auto; text-align: center; font-size: 5.4cqi; padding: 4.4cqi; border-radius: 4cqi; }
.mock-cover, .mock-social { width: 58%; aspect-ratio: 3 / 4; }
.mock-cover .mock-in { align-items: center; justify-content: center; text-align: center; padding: 10cqi 8cqi; gap: 3cqi; }
.mock-cover .mock-eyebrow { font-size: 3.4cqi; }
.mock-cover .mock-title { font-size: 10cqi; margin: 2cqi 0 0; }
.mock-cover .rule { display: block; width: 14cqi; height: 0.9cqi; border-radius: 1cqi; }
.mock-cover .mock-body { font-size: 4cqi; }
.mock-cover .by { margin-top: auto; font-size: 3.4cqi; opacity: 0.8; }
.mock-poster { width: 58%; aspect-ratio: 3 / 4; }
.mock-poster .mock-in { padding: 8cqi 7cqi; text-align: center; align-items: center; }
.mock-poster .mock-title { font-size: 11cqi; margin: 6cqi 0 4cqi; }
.mock-poster .mock-body { font-size: 4.2cqi; }
.mock-poster .mock-cta { align-self: center; font-size: 4cqi; padding: 2.4cqi 5cqi; margin-top: 7cqi; border-radius: 1.4cqi; }
.mock-poster .mock-eyebrow { font-size: 3.6cqi; }
.mock-poster .date { margin-top: auto; font-size: 3.6cqi; font-weight: 600; }
.mock-brand { aspect-ratio: 16 / 10; }
.mock-brand .mock-in { flex-direction: row; align-items: center; gap: 6cqi; padding: 6cqi; }
.mock-brand .brand-l, .mock-brand .brand-r { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2cqi; }
.mock-brand .mark { width: 11cqi; height: 11cqi; display: grid; place-items: center; border-radius: 2.4cqi; font-size: 6cqi; font-weight: 800; }
.mock-brand .mock-title { font-size: 6cqi; margin: 0; }
.mock-brand .bars { display: flex; height: 9cqi; border-radius: 1.2cqi; overflow: hidden; }
.mock-brand .bsw { display: flex; align-items: center; gap: 2cqi; font-size: 2.6cqi; }
.mock-brand .bsw i { width: 3.4cqi; height: 3.4cqi; border-radius: 50%; }
.mock-social .mock-in { padding: 9cqi 8cqi; gap: 4cqi; }
.mock-social .tag { align-self: flex-start; padding: 1.2cqi 3.4cqi; border-radius: 99px; font-size: 3.2cqi; font-weight: 600; }
.mock-social .mock-title { font-size: 10.5cqi; margin: 0; }
.mock-social .mock-body { font-size: 4cqi; }
.mock-social .by { margin-top: auto; font-size: 3.6cqi; font-weight: 600; }
.scene-grid.single .mock-web, .scene-grid.single .mock-slide, .scene-grid.single .mock-brand { max-width: 880px; }
.scene-grid.single .mock-poster, .scene-grid.single .mock-cover, .scene-grid.single .mock-social { width: min(52%, 400px); }
.scene-grid.single .mock-phone { width: min(40%, 300px); }

/* ---------- palette ideas ---------- */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.pcard { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-sm); transition: border-color 0.15s, box-shadow 0.15s; }
.pcard.is-selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-ring); }
.pcard-pick { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.pbars { display: grid; grid-template-columns: repeat(5, 1fr); height: 120px; }
.plabels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 8px 10px 10px; }
.plabels span { display: flex; flex-direction: column; min-width: 0; }
.plabels small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; color: var(--muted); }
.plabels b { font: 500 10.5px var(--font-mono); }
.pdemo { position: relative; display: flex; flex-direction: column; gap: 6px; height: 120px; padding: 14px; }
.pdemo-bar { display: block; width: 22px; height: 3px; }
.pdemo b { font-size: 15px; }
.pdemo span { font-size: 11px; }
.pdemo em { margin-top: auto; align-self: flex-start; padding: 4px 10px; border-radius: 6px; font-size: 11px; font-style: normal; font-weight: 600; }
.pcard-foot { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 8px; border-top: 1px solid var(--border); }
.pcard-foot .hint { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-foot .row { flex: none; flex-wrap: nowrap; }
.pname { font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pname:hover { text-decoration: underline; }

/* ---------- palette generator ---------- */
.gen-swatch { height: 280px; }
.gen-val { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; padding: 2px 0; border: 0; background: none; text-align: left; cursor: copy; font: 12px var(--font-mono); color: var(--text-2); }
.gen-val .i { width: 12px; height: 12px; opacity: 0.45; }
.gen-val:hover { color: var(--text); }
.gen-val:hover .i { opacity: 1; }
.gen-val.sub { color: var(--muted); }
.gen-badge { margin-top: 6px; min-height: 22px; }
.gen-alts { display: flex; gap: 6px; margin-top: 8px; min-height: 18px; }
.alt { width: 18px; height: 18px; padding: 0; border: 1px solid var(--swatch-edge); border-radius: 50%; cursor: pointer; transition: transform 0.12s; }
.alt:hover { transform: scale(1.2); }

/* ---------- gradients ---------- */
.gdetail-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; }
.gdetail-body { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; padding: 0 16px 16px; }
.gstack { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--r-sm); box-shadow: inset 0 0 0 1px var(--swatch-edge); }
.gstack button { flex: 1; height: 38px; padding: 0; border: 0; cursor: copy; }
.gstack.big { min-height: 280px; }
.gstack.big button { height: auto; }
.gtable-head, .gtable-row { display: grid; grid-template-columns: 1.6fr 1fr 0.9fr 0.6fr; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.gtable-head { padding-top: 0; font-size: 12px; color: var(--muted); }
.gtable-row a { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--accent-text); }
.gtable-row i { flex: none; width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--swatch-edge); }
.gsets { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.gset { overflow: hidden; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-sm); }
.gset .gstack { border-radius: 0; box-shadow: none; }
.gset-body { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; }
.gset-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; font-size: 12px; }
.gset-chips span { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gset-chips i { flex: none; width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--swatch-edge); }

/* ---------- usage cards ---------- */
.slider { display: flex; align-items: center; gap: 8px; }
.slider input { width: 120px; accent-color: var(--accent); }
.ublock { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--r-sm); }
.ucard-foot .names a { text-decoration: none; }
.ucard-foot .names a:hover { text-decoration: underline; }
.ucard-foot .row-between { flex-wrap: nowrap; }

/* ---------- responsive ---------- */
@media (max-width: 1400px) {
  .tool-wide { grid-template-columns: 1fr; }
  .tool-wide .tool-side { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: start; }
}
@media (max-width: 1180px) {
  .tool { grid-template-columns: 1fr; }
  .tool-side { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: start; }
}
@media (max-width: 1000px) {
  .gdetail-body { grid-template-columns: 1fr; }
  .gen { grid-template-columns: 1fr; }
  .gen-col + .gen-col { border-left: 0; border-top: 1px solid var(--border); }
  .gen-swatch { height: auto; min-height: 120px; }
  .roles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .i-desktop { display: none; }
  .i-mobile { display: block; }
  .layout { transition: none; }
  .sidebar { position: fixed; left: 0; top: var(--topbar); bottom: 0; width: 280px; height: auto; z-index: 45; transform: translateX(-100%); transition: transform 0.2s ease-out; background: var(--surface); }
  body.drawer-open .sidebar { transform: none; box-shadow: var(--pop-shadow); }
  body.drawer-open .scrim { display: block; position: fixed; inset: var(--topbar) 0 0 0; background: rgba(0, 0, 0, 0.35); z-index: 44; }
  .main { padding: 20px 16px 48px; }
  .hide-md { display: none !important; }
  .app-mock { grid-template-columns: 1fr; }
  .m-side { display: none; }
}
@media (max-width: 640px) {
  .bar.sticky { position: static; }
  .brand-text, .hide-sm { display: none !important; }
  .cmdk .kbd { display: none; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .scene-grid, .ucards, .gcards, .pgrid { grid-template-columns: 1fr; }
  .page-head { padding: 14px 16px; }
  .slider { display: none; }
  .hero-swatch { min-height: 220px; }
  .hero-swatch h1, .hero-swatch .hero-name { font-size: 26px; }
  .spectrum { grid-template-columns: repeat(8, 1fr); }
  h1 { font-size: 22px; }
}
/* ---------- footer ---------- */
.site-foot { position: relative; margin-top: 64px; color: var(--muted); font-size: 13px; }
.kolam { height: 14px; margin-bottom: 24px; background: var(--kolam) repeat-x left center; background-size: 28px 14px; opacity: 0.9; animation: march 14s linear infinite; }
.foot-grid { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px 40px; flex-wrap: wrap; }
.foot-main { max-width: 680px; }
.foot-brand { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 8px; font-weight: 650; font-size: 14px; color: var(--text); text-decoration: none; }
.foot-tag { color: var(--muted); max-width: 62ch; text-wrap: pretty; }
.foot-links { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; padding: 0; margin: 14px 0 0; }
.foot-links a { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size 0.25s, color 0.15s; }
.foot-links a:hover { color: var(--accent-text); background-size: 100% 1px; }
.foot-links .i { width: 16px; height: 16px; }
.foot-links .copy { color: var(--muted); }
.foot-langs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); }
.foot-langs a { color: var(--muted); text-decoration: none; transition: color 0.15s; }
.foot-langs a:hover { color: var(--text); }
.foot-langs a[aria-current] { color: var(--text); font-weight: 600; }
.foot-credit { margin-top: 20px; padding-top: 14px; border-top: 1px dashed var(--border-strong); font-size: 12px; line-height: 1.7; }
.foot-credit a { color: var(--text-2); text-underline-offset: 3px; }
.foot-credit a:hover { color: var(--accent-text); }

/* ---------- value index dialog ---------- */
.vi { border: 0; padding: 0; background: transparent; color: var(--text); width: min(660px, calc(100vw - 24px)); max-height: calc(100vh - 32px); margin: auto; overflow: visible; }
.vi::backdrop { background: rgba(28, 16, 4, 0.52); backdrop-filter: blur(3px); }
.vi[open]::backdrop { animation: fade 0.2s ease-out; }
.vi[open] .vi-box { animation: pop-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
.vi-box { position: relative; display: flex; flex-direction: column; max-height: calc(100vh - 32px); padding: 22px 22px 8px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--pop-shadow); }
.vi-box::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--toran) repeat-x; background-size: 64px 6px; }
.vi-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.vi-head h2 { font-size: 18px; letter-spacing: -0.01em; }
.vi-lede { margin-top: 6px; color: var(--muted); max-width: 56ch; }
.vi-tools { display: flex; gap: 10px; margin-top: 16px; }
.vi-tools .field { flex: 1 1 0; }
.vi-count { margin: 12px 0 6px; font: 12.5px var(--font-mono); color: var(--muted); }
.vi-list { list-style: none; margin: 0 -10px; padding: 0 10px 12px; overflow-y: auto; flex: 1; min-height: 0; overscroll-behavior: contain; }
.vi-list li { content-visibility: auto; contain-intrinsic-size: auto 48px; }
.vi-row { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 14px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--r-sm); background: none; text-align: left; cursor: copy; transition: background 0.12s; }
.vi-row:hover { background: var(--hover); }
.vi-row .sw { width: 30px; height: 30px; border-radius: var(--r-xs); box-shadow: inset 0 0 0 1px var(--swatch-edge); transition: transform 0.2s; }
.vi-row:hover .sw { transform: scale(1.08); }
.vi-name { font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vi-meta { font: 12.5px var(--font-mono); color: var(--muted); }
.vi-row.copied { background: var(--accent-soft); }

/* ---------- home: tools, material, author ---------- */
.home-sec { margin-top: 60px; }
.sec-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.sec-head::after { content: ""; order: 3; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-strong), transparent); }
.sec-tag { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px 0 10px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-text); font-weight: 650; font-size: 14px; }
.sec-tag .i { width: 18px; height: 18px; transform-origin: 50% 90%; }
#tools .sec-tag .i { animation: flicker 2.8s ease-in-out infinite; }
.sec-head p { color: var(--muted); }
.tool-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tool-card { position: relative; display: flex; align-items: flex-start; gap: 14px; height: 100%; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-sm); text-decoration: none; transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s; }
.tool-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--pop-shadow); }
.tc-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tc-text b { font-size: 14.5px; font-weight: 600; }
.tc-text span { color: var(--muted); font-size: 13px; }
.tc-go { margin-left: auto; flex: none; color: var(--muted); transition: transform 0.2s, color 0.2s; }
.tool-card:hover .tc-go, .author-link:hover .tc-go { transform: translate(2px, -2px); color: var(--accent-text); }
.stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 2px; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-sm); transition: transform 0.2s, border-color 0.2s; }
.stat:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.stat b { font-size: 36px; line-height: 1.1; font-weight: 650; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat > span:last-child { color: var(--muted); }
.stat-ic { position: absolute; right: 14px; top: 14px; color: var(--accent); opacity: 0.16; transition: transform 0.4s, opacity 0.3s; }
.stat-ic .i { width: 52px; height: 52px; }
.stat:hover .stat-ic { opacity: 0.28; }
.author-card { display: flex; align-items: center; flex-wrap: wrap; gap: 18px 22px; padding: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.author-card::after { content: ""; position: absolute; inset: 0 0 0 auto; width: 46%; background: var(--jaali); background-size: 40px 40px; opacity: 0.5; pointer-events: none; -webkit-mask-image: linear-gradient(to left, #000, transparent); mask-image: linear-gradient(to left, #000, transparent); }
.author-mark .brand-mark { animation: spin-mark 16s linear infinite; }
@keyframes spin-mark { from { transform: rotate(45deg); } to { transform: rotate(405deg); } }
.author-mark { flex: none; display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; background: var(--accent-soft); }
.author-text { position: relative; z-index: 1; flex: 1 1 260px; min-width: 0; }
.author-text b { font-size: 17px; font-weight: 650; }
.author-text p { margin-top: 2px; color: var(--muted); max-width: 52ch; }
.author-links { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; }
.author-link { padding: 0 12px; }
.author-link .tc-go { width: 14px; height: 14px; margin-left: 2px; }

/* ---------- motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes march { to { background-position-x: 28px; } }
@keyframes march-toran { to { background-position-x: 64px; } }
@keyframes flicker { 0%, 100% { transform: scale(1, 1); } 18% { transform: scale(0.97, 1.05); } 36% { transform: scale(1.02, 0.97); } 58% { transform: scale(0.98, 1.06); } 80% { transform: scale(1.01, 0.99); } }
@keyframes heart { 0% { transform: scale(0.6); } 45% { transform: scale(1.4); } 100% { transform: scale(1); } }
@keyframes gulal { from { opacity: 1; transform: translate(0, 0) scale(1); } to { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.3); } }

.main { animation: fade 0.35s ease-out; }
.topbar::before { animation: march-toran 24s linear infinite; }
.page-head .ph-icon { animation: pop-in 0.5s cubic-bezier(0.3, 1.4, 0.5, 1) backwards; }
.ccard { animation: rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; animation-delay: calc(var(--i, 0) * 26ms); transition: border-color 0.15s, box-shadow 0.2s, transform 0.2s; }
.ccard:hover { transform: translateY(-3px); box-shadow: var(--pop-shadow); }
.ccard-swatch { transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1); }
.ccard:hover .ccard-swatch { transform: scale(1.06); }
.side-art .i { animation: flicker 5s ease-in-out infinite; transform-origin: 50% 90%; }
.gh-link .i { transition: transform 0.25s; }
.gh-link:hover .i { transform: scale(1.12); }
.fav.pop .i-fill { animation: heart 0.45s cubic-bezier(0.3, 1.5, 0.5, 1); }
.btn-primary:hover { box-shadow: 0 4px 14px color-mix(in oklab, var(--accent) 35%, transparent); }
.will-in { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease-out, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); transition-delay: calc(var(--i, 0) * 70ms); }
.will-in.in { opacity: 1; transform: none; }
.gulal { position: fixed; z-index: 200; width: 0; height: 0; pointer-events: none; }
.gulal i { position: absolute; left: 0; top: 0; width: var(--s); height: var(--s); border-radius: 50%; animation: gulal 0.7s ease-out forwards; }

/* Motifs, kept faint: textile-print ground on the page, buttis on cards, a chakra in the footer and dialog. */
body::before { content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; background: var(--p-ogee) 0 0 / 40px 40px repeat; opacity: 0.045; }
[data-theme="dark"] body::before { opacity: 0.03; }
.layout { position: relative; z-index: 1; }
.tool-card::after { content: ""; position: absolute; right: 8px; bottom: 6px; width: 56px; height: 56px; pointer-events: none; background: var(--p-buta) center / contain no-repeat; opacity: 0.3; transition: opacity 0.25s; }
.tool-card:hover::after { opacity: 0.85; }

/* Hanging ornament: a swinging charm from the top-right corner. */
.orn { position: absolute; top: -15px; right: 18px; z-index: -1; width: 64px; height: 230px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.orn-i { display: block; width: 100%; height: 100%; background: url("/assets/img/ornament.webp") 50% 0 / contain no-repeat; transform-origin: 50% 18px; will-change: transform; filter: drop-shadow(0 3px 3px rgba(40, 24, 4, 0.16)); }
@media (min-width: 701px) { .topbar-right { margin-right: 104px; } }
@media (max-width: 700px) { .orn { display: none; } }

/* Loading state: a diya with a flickering flame. */
.loader { min-height: 42vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 13px; animation: fade 0.4s 0.15s ease-out backwards; }
[data-app-root]:has(> :not([data-loader])) > [data-loader] { display: none; }
.diya-load { width: 72px; height: 72px; overflow: visible; }
.dl-flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flame 1.6s ease-in-out infinite; }
.dl-core { animation-duration: 1.1s; animation-delay: -0.4s; }
.dl-glow { animation: glow 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 50%; }
@keyframes flame { 0%, 100% { transform: scale(1, 1) skewX(0); } 25% { transform: scale(0.94, 1.08) skewX(-3deg); } 50% { transform: scale(1.04, 0.95) skewX(2deg); } 75% { transform: scale(0.96, 1.06) skewX(-1.5deg); } }
@keyframes glow { 0%, 100% { opacity: 0.75; transform: scale(1); } 50% { opacity: 1; transform: scale(1.1); } }

/* Sidebar tooltip (collapsed sidebar shows names on hover). */
.tip { position: fixed; z-index: 90; padding: 6px 10px; border-radius: var(--r-sm); background: var(--ink); color: var(--on-ink); font: 500 13px/1.2 var(--font-sans); white-space: nowrap; pointer-events: none; opacity: 0; transform: translate(-4px, -50%); transition: opacity 0.12s, transform 0.15s; box-shadow: var(--pop-shadow); }
.tip::before { content: ""; position: absolute; left: -4px; top: 50%; width: 8px; height: 8px; margin-top: -4px; background: inherit; transform: rotate(45deg); border-radius: 2px; }
.tip.show { opacity: 1; transform: translate(0, -50%); }

@media (max-width: 1100px) { .tool-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .tool-cards { grid-template-columns: 1fr; }
  .foot-langs { margin-top: 4px; }
  .vi-row { grid-template-columns: 26px 1fr auto; gap: 10px; }
  .vi-row .sw { width: 26px; height: 26px; }
  .vi-tools { flex-direction: column; }
  .author-links { width: 100%; }
}

/* ---------- states of India ---------- */
.scards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.scard { display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-sm); animation: rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; animation-delay: calc(var(--i, 0) * 30ms); transition: border-color 0.15s, box-shadow 0.2s, transform 0.2s; }
.scard:hover { transform: translateY(-3px); box-shadow: var(--pop-shadow); }
.scard-pal { display: flex; height: 112px; border-bottom: 1px solid var(--border); }
.scard-sw { flex: 1 1 0; min-width: 0; display: grid; align-items: end; justify-items: center; padding: 0 0 8px; border: 0; cursor: copy; transition: flex-grow 0.35s cubic-bezier(0.2, 0.7, 0.2, 1); }
.scard-sw span { font: 11px var(--font-mono); opacity: 0; transform: translateY(4px); transition: opacity 0.2s, transform 0.2s; }
.scard-sw:hover { flex-grow: 2.2; }
.scard-sw:hover span, .scard-sw:focus-visible span { opacity: 0.95; transform: none; }
.scard-body { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 14px; flex: 1; }
.scard-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.scard-row h2 { font-size: 16px; letter-spacing: -0.01em; }
.scard-note { color: var(--muted); font-size: 13px; text-wrap: pretty; }
.scard-colors { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 1px; }
.scard-colors li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 3px 0; font-size: 13px; }
.scard-colors a { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; min-width: 0; }
.scard-colors a:hover { text-decoration: underline; text-underline-offset: 3px; }
.scard-colors .mono { color: var(--muted); font-size: 12px; }
.scard-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 8px; }
@media (max-width: 640px) { .scards { grid-template-columns: 1fr; } .scard-sw span { opacity: 0.9; transform: none; font-size: 9.5px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
