/* Ryan Upscales — matte modern UI */
:root {
  --bg: #0b0f17;
  --bg-2: #0e131d;
  --surface: #121826;
  --surface-2: #161d2c;
  --surface-3: #1c2436;
  --surface-hover: #1a2233;
  --border: rgba(255, 255, 255, .06);
  --border-strong: rgba(255, 255, 255, .11);
  --text: #e6eaf2;
  --text-2: #a3adc2;
  --text-3: #6b7690;
  --accent: #3b82f6;
  --accent-2: #60a5fa;
  --accent-soft: rgba(59, 130, 246, .12);
  --accent-ring: rgba(96, 165, 250, .45);
  --ok: #34d399;
  --ok-soft: rgba(52, 211, 153, .12);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, .12);
  --err: #f87171;
  --err-soft: rgba(248, 113, 113, .12);
  --violet: #a78bfa;
  --violet-soft: rgba(167, 139, 250, .13);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 6px 24px -8px rgba(0, 0, 0, .55), 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .7);
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 18px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t: 170ms;
  --sidebar-w: 256px;
  --topbar-h: 60px;
  --tabbar-h: 64px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #eef1f6;
  --bg-2: #e7ebf2;
  --surface: #f8f9fb;
  --surface-2: #ffffff;
  --surface-3: #edf0f5;
  --surface-hover: #f1f4f8;
  --border: rgba(15, 23, 42, .08);
  --border-strong: rgba(15, 23, 42, .14);
  --text: #111827;
  --text-2: #4b5567;
  --text-3: #7c8699;
  --accent: #2563eb;
  --accent-2: #3b82f6;
  --accent-soft: rgba(37, 99, 235, .09);
  --accent-ring: rgba(37, 99, 235, .35);
  --ok: #059669;
  --ok-soft: rgba(5, 150, 105, .1);
  --warn: #b45309;
  --warn-soft: rgba(217, 119, 6, .12);
  --err: #dc2626;
  --err-soft: rgba(220, 38, 38, .09);
  --violet: #7c3aed;
  --violet-soft: rgba(124, 58, 237, .09);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 6px 20px -10px rgba(15, 23, 42, .18), 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-lg: 0 24px 60px -16px rgba(15, 23, 42, .3);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  font-feature-settings: "cv11", "ss01";
}
img, video, canvas, svg { display: block; max-width: 100%; }
:where(svg[aria-hidden="true"]) { width: 16px; height: 16px; flex: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.015em; line-height: 1.25; }
p { margin: 0; }
code, kbd, pre, .mono { font-family: var(--mono); }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 6px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 1000; background: var(--accent); color: #fff; padding: 10px 14px; border-radius: 10px; }
.skip-link:focus { top: 12px; }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 0 14px;
  border-radius: 11px; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text);
  font-weight: 550; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), transform var(--t) var(--ease), box-shadow var(--t) var(--ease), color var(--t);
  user-select: none; -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  border-color: transparent; color: #fff;
  box-shadow: 0 6px 18px -8px rgba(59, 130, 246, .7), inset 0 1px 0 rgba(255, 255, 255, .15);
}
.btn-primary:hover { background: linear-gradient(180deg, #74b1fb, #4a8ef7); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }
.btn-danger { color: var(--err); }
.btn-danger:hover { background: var(--err-soft); border-color: transparent; }
.btn-danger-solid { background: var(--err); color: #fff; border-color: transparent; }
.btn-danger-solid:hover { background: #ef5b5b; }
.btn-sm { min-height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 9px; }
.btn-lg { min-height: 48px; padding: 0 22px; font-size: 15px; border-radius: 13px; }
.btn-icon { width: 38px; padding: 0; }
.btn-icon.btn-sm { width: 30px; }
.btn-block { width: 100%; }

/* ---------- Inputs ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12px; font-weight: 600; color: var(--text-2); letter-spacing: .01em; }
.hint { font-size: 12px; color: var(--text-3); }
.input, .select, .textarea {
  width: 100%; min-height: 40px; padding: 8px 12px;
  background: var(--bg-2); border: 1px solid var(--border-strong); border-radius: 11px;
  color: var(--text); transition: border-color var(--t), box-shadow var(--t), background var(--t);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: rgba(255, 255, 255, .16); }
:root[data-theme="light"] .input:hover, :root[data-theme="light"] .select:hover, :root[data-theme="light"] .textarea:hover { border-color: rgba(15, 23, 42, .22); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%237c8699' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.input-sm { min-height: 32px; padding: 4px 10px; font-size: 13px; border-radius: 9px; }
.search-input { position: relative; }
.search-input svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.search-input .input { padding-left: 36px; }

/* range */
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--accent) var(--fill, 50%), var(--surface-3) var(--fill, 50%)); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--surface-3); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--accent); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; margin-top: -7px; background: #fff; border: 0; box-shadow: 0 0 0 4px var(--accent-soft), 0 1px 3px rgba(0,0,0,.4); transition: box-shadow var(--t); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 0 4px var(--accent-soft), 0 1px 3px rgba(0,0,0,.4); }
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 5px var(--accent-ring); }

/* switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; min-height: 32px; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 36px; height: 21px; border-radius: 21px; background: var(--surface-3); border: 1px solid var(--border-strong); position: relative; transition: background var(--t), border-color var(--t); flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #cfd6e4; transition: transform var(--t) var(--ease), background var(--t); box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch input:checked + .track { background: var(--accent); border-color: transparent; }
.switch input:checked + .track::after { transform: translateX(15px); background: #fff; }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--accent-ring); }
.switch .switch-label { font-size: 13.5px; color: var(--text); }
.switch .switch-sub { display: block; font-size: 12px; color: var(--text-3); }

.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; min-height: 32px; font-size: 13.5px; user-select: none; }
.check input { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--border-strong); background: var(--bg-2); display: grid; place-items: center; margin: 0; transition: background var(--t), border-color var(--t); cursor: pointer; flex: none; }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after { content: ""; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }

/* segmented */
.seg { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; max-width: 100%; }
.seg button { min-height: 32px; padding: 0 13px; border: 0; border-radius: 9px; background: transparent; color: var(--text-2); font-weight: 550; font-size: 13px; cursor: pointer; transition: background var(--t), color var(--t); }
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.seg button svg { width: 15px; height: 15px; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"], .seg button[aria-checked="true"] { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-sm); }
:root[data-theme="light"] .seg button[aria-pressed="true"], :root[data-theme="light"] .seg button[aria-checked="true"] { background: #fff; }
.seg.seg-block { display: flex; }
.seg.seg-block button { flex: 1; }

/* chips */
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: transparent; color: var(--text-2); font-size: 12.5px; font-weight: 550; cursor: pointer; transition: all var(--t); }
.chip:hover { color: var(--text); background: var(--surface-hover); }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: rgba(96,165,250,.35); color: var(--accent-2); }
.chip .count { font-size: 11px; color: var(--text-3); }

/* badges / pills */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: .01em; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-err { background: var(--err-soft); color: var(--err); }
.badge-accent { background: var(--accent-soft); color: var(--accent-2); }
.badge-violet { background: var(--violet-soft); color: var(--violet); }
.badge-new { background: linear-gradient(90deg, #3b82f6, #8b5cf6); color: #fff; height: 18px; font-size: 10px; letter-spacing: .06em; padding: 0 7px; }
.badge.pulse::before { animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; font-size: 11px; border-radius: 6px; background: var(--surface-3); border: 1px solid var(--border-strong); border-bottom-width: 2px; color: var(--text-2); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); min-width: 0; }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h2, .card-head h3 { font-size: 14.5px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.card-head h2 svg, .card-head h3 svg { width: 17px; height: 17px; flex: none; color: var(--accent-2); }
.card-head .sub { font-size: 12.5px; color: var(--text-3); font-weight: 450; }
.card-body { padding: 18px 20px; }
.section-title { font-size: 12px; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; margin: 0 0 10px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; border: 0; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.stack-lg { display: flex; flex-direction: column; gap: 20px; }
.grow { flex: 1; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.text-ok { color: var(--ok); } .text-warn { color: var(--warn); } .text-err { color: var(--err); } .text-accent { color: var(--accent-2); }

/* ---------- Auth ---------- */
.auth-screen { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; position: relative; overflow: hidden; }
.auth-screen::before { content: ""; position: absolute; inset: -30% -10% auto -10%; height: 70%; background: radial-gradient(ellipse at 50% 0%, rgba(59,130,246,.16), transparent 60%); pointer-events: none; }
.auth-card { width: 100%; max-width: 400px; position: relative; padding: 32px 28px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.auth-card .brand { justify-content: center; margin-bottom: 8px; }
.auth-card .brand-mark { width: 40px; height: 40px; }
.auth-card .brand-name { font-size: 20px; }
.auth-card .tagline { text-align: center; color: var(--text-2); font-size: 13.5px; margin-bottom: 24px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.auth-foot { margin-top: 18px; text-align: center; font-size: 13px; color: var(--text-2); }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent-2); cursor: pointer; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }
.form-error { color: var(--err); font-size: 13px; background: var(--err-soft); padding: 9px 12px; border-radius: 10px; }

/* ---------- Brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none !important; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-name { font-weight: 750; font-size: 16px; letter-spacing: -.02em; }
.brand-name span { color: var(--accent-2); }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.shell > .main { grid-column: 2; grid-row: 1; }
.shell > .sidebar { grid-column: 1; grid-row: 1; }
.sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: var(--bg-2); border-right: 1px solid var(--border); padding: 16px 12px; gap: 8px; overflow-y: auto; z-index: 30; }
.sidebar .brand { padding: 4px 8px 14px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 12px; border-radius: 11px; color: var(--text-2); font-weight: 550; font-size: 13.5px; text-decoration: none !important; transition: background var(--t), color var(--t); position: relative; }
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav-item:hover { background: var(--surface-hover); color: var(--text); }
.nav-item[aria-current="page"] { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.nav-item[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-item[aria-current="page"] svg { color: var(--accent-2); opacity: 1; }
.nav-item .nav-count { margin-left: auto; font-size: 11px; background: var(--accent-soft); color: var(--accent-2); border-radius: 999px; padding: 1px 7px; font-weight: 650; }
.nav-sep { font-size: 11px; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; padding: 14px 12px 6px; }
.sidebar-recent { display: flex; flex-direction: column; gap: 2px; }
.recent-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; color: var(--text-2); text-decoration: none !important; font-size: 12.5px; transition: background var(--t); min-width: 0; }
.recent-item:hover { background: var(--surface-hover); color: var(--text); }
.recent-item img, .recent-item .thumb-ph { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; background: var(--surface-3); flex: none; }
.recent-item .meta { min-width: 0; flex: 1; }
.recent-item .meta div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; }
.avatar { width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(135deg, #1e3a8a, #3b82f6); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; text-transform: uppercase; }
.credit-pill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-2); font-weight: 650; font-size: 12.5px; border: 1px solid rgba(96,165,250,.2); white-space: nowrap; cursor: pointer; }
.credit-pill svg { width: 14px; height: 14px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 28px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.2) blur(10px); -webkit-backdrop-filter: saturate(1.2) blur(10px); border-bottom: 1px solid var(--border); }
.topbar .brand { display: none; }
.topbar-title { font-weight: 650; font-size: 15px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.palette-trigger { display: inline-flex; align-items: center; gap: 10px; min-width: 220px; height: 36px; padding: 0 8px 0 12px; border-radius: 11px; border: 1px solid var(--border-strong); background: var(--bg-2); color: var(--text-3); cursor: pointer; font-size: 13px; transition: border-color var(--t); }
.palette-trigger:hover { border-color: var(--accent-ring); color: var(--text-2); }
.palette-trigger svg { width: 15px; height: 15px; }
.palette-trigger kbd { margin-left: auto; }
.banners { display: flex; flex-direction: column; }
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 28px; font-size: 13px; font-weight: 550; border-bottom: 1px solid var(--border); }
.banner svg { width: 16px; height: 16px; flex: none; }
.banner-warn { background: var(--warn-soft); color: var(--warn); }
.banner-demo { background: var(--violet-soft); color: var(--violet); }
.banner-err { background: var(--err-soft); color: var(--err); }
.content { padding: 28px; max-width: 1480px; width: 100%; margin: 0 auto; flex: 1; }
.view { animation: viewIn 220ms var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.view-head h1 { font-size: 24px; font-weight: 700; }
.view-head p { color: var(--text-2); margin-top: 4px; }
.tabbar { display: none; }
.sidebar-backdrop { display: none; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; border-radius: 22px; padding: 28px 30px; margin-bottom: 20px; background: radial-gradient(900px 300px at 0% 0%, rgba(59,130,246,.14), transparent 60%), radial-gradient(600px 240px at 100% 100%, rgba(139,92,246,.08), transparent 60%), var(--surface); border: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.hero h1 { font-size: 30px; font-weight: 780; letter-spacing: -.03em; }
.hero h1 span { background: linear-gradient(90deg, var(--accent-2), #a78bfa); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--text-2); margin-top: 6px; font-size: 15px; max-width: 560px; }
.hero-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.engine-pills { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.engine-pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--border); font-size: 11.5px; font-weight: 550; color: var(--text-2); }
.engine-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.engine-pill.on::before { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.engine-pill.off { opacity: .6; }
.hero-credits { display: flex; align-items: baseline; gap: 6px; padding: 10px 16px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--border); }
.hero-credits strong { font-size: 22px; font-weight: 750; letter-spacing: -.02em; }
.hero-credits span { color: var(--text-3); font-size: 12.5px; }

/* ---------- Studio layout ---------- */
.studio-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); gap: 20px; align-items: start; }
.studio-left, .studio-right { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.studio-right { position: sticky; top: calc(var(--topbar-h) + 20px); }
.honesty { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--bg-2); border: 1px dashed var(--border-strong); color: var(--text-2); font-size: 12.5px; }
.honesty svg { width: 16px; height: 16px; flex: none; margin-top: 1px; color: var(--accent-2); }

.dropzone { position: relative; border: 1.5px dashed var(--border-strong); border-radius: var(--r-lg); background: repeating-linear-gradient(-45deg, transparent 0 12px, rgba(255,255,255,.012) 12px 24px), var(--surface); min-height: 280px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 32px 20px; cursor: pointer; transition: border-color var(--t), background var(--t), transform var(--t); }
.dropzone:hover { border-color: var(--accent-ring); }
.dropzone.drag { border-color: var(--accent-2); background: var(--accent-soft); transform: scale(1.005); }
.dropzone .dz-icon { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); margin-bottom: 6px; }
.dropzone .dz-icon svg { width: 28px; height: 28px; }
.dropzone h3 { font-size: 17px; font-weight: 650; }
.dropzone p { color: var(--text-2); font-size: 13.5px; }
.dropzone .dz-formats { font-size: 12px; color: var(--text-3); }
.dz-compact { min-height: 0; padding: 14px; flex-direction: row; gap: 12px; justify-content: flex-start; text-align: left; }
.dz-compact .dz-icon { width: 38px; height: 38px; border-radius: 12px; margin: 0; }
.dz-compact .dz-icon svg { width: 18px; height: 18px; }
.dz-compact h3 { font-size: 14px; }
.dz-compact p { font-size: 12.5px; }

.progress { height: 6px; background: var(--surface-3); border-radius: 6px; overflow: hidden; position: relative; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 6px; transition: width 300ms var(--ease); }
.progress.indeterminate > span { width: 30% !important; animation: indet 1.2s infinite var(--ease); }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(400%); } }
.progress-lg { height: 10px; }
.progress.ok > span { background: var(--ok); }
.progress.err > span { background: var(--err); }
.upload-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--border); }
.upload-row .grow .progress { margin-top: 6px; }

.preview-card { overflow: hidden; }
.preview-stage { position: relative; background: var(--bg-2); background-image: linear-gradient(45deg, rgba(255,255,255,.025) 25%, transparent 25%), linear-gradient(-45deg, rgba(255,255,255,.025) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(255,255,255,.025) 75%), linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.025) 75%); background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0; display: grid; place-items: center; min-height: 260px; max-height: 560px; padding: 16px; }
.preview-wrap { position: relative; max-width: 100%; max-height: 528px; line-height: 0; }
.preview-wrap img { max-height: 528px; width: auto; max-width: 100%; border-radius: 8px; box-shadow: var(--shadow); }
.tile-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; border-radius: 8px; overflow: hidden; }
.tile-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.tile-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -2px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.stat { padding: 12px 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--border); min-width: 0; }
.stat .k { font-size: 11.5px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.stat .v { font-size: 16px; font-weight: 680; margin-top: 3px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meters { display: flex; flex-direction: column; gap: 10px; }
.meter { display: grid; grid-template-columns: 90px 1fr 40px; align-items: center; gap: 12px; font-size: 12.5px; }
.meter .bar { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.meter .bar span { display: block; height: 100%; border-radius: 6px; transition: width 500ms var(--ease); }
.meter .val { text-align: right; font-family: var(--mono); color: var(--text-2); font-size: 12px; }
.alert { display: flex; gap: 12px; padding: 12px 14px; border-radius: 12px; font-size: 13px; align-items: flex-start; }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert strong { display: block; margin-bottom: 2px; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }
.alert-warn { background: var(--warn-soft); color: var(--warn); border: 1px solid rgba(251,191,36,.18); }
.alert-warn .alert-text { color: var(--text); }
.alert-err { background: var(--err-soft); color: var(--err); border: 1px solid rgba(248,113,113,.2); }
.alert-info { background: var(--accent-soft); color: var(--accent-2); border: 1px solid rgba(96,165,250,.18); }
.alert-ok { background: var(--ok-soft); color: var(--ok); border: 1px solid rgba(52,211,153,.18); }
.alert .alert-text { color: var(--text); }

/* batch list */
.batch-list { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; }
.batch-item { flex: none; width: 84px; border-radius: 12px; overflow: hidden; border: 2px solid transparent; background: var(--bg-2); cursor: pointer; padding: 0; transition: border-color var(--t), transform var(--t); position: relative; }
.batch-item:hover { transform: translateY(-2px); }
.batch-item[aria-pressed="true"] { border-color: var(--accent); }
.batch-item img { width: 100%; height: 64px; object-fit: cover; }
.batch-item span { display: block; font-size: 10.5px; padding: 4px 6px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* command cards */
.cmd-groups { display: flex; flex-direction: column; gap: 16px; }
.cmd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.cmd-card { position: relative; text-align: left; padding: 13px 14px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--border); cursor: pointer; display: flex; flex-direction: column; gap: 5px; min-height: 92px; transition: transform var(--t) var(--ease), border-color var(--t), background var(--t), box-shadow var(--t); color: var(--text); }
.cmd-card:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.cmd-card[aria-checked="true"] { border-color: var(--accent); background: linear-gradient(180deg, var(--accent-soft), transparent 70%), var(--bg-2); box-shadow: 0 0 0 3px var(--accent-soft); }
.cmd-card .code { font-family: var(--mono); font-size: 11px; color: var(--accent-2); font-weight: 600; letter-spacing: .02em; }
.cmd-card .name { font-weight: 650; font-size: 13.5px; }
.cmd-card .sum { font-size: 12px; color: var(--text-3); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cmd-card .badge-new { position: absolute; top: 10px; right: 10px; }
.cmd-card[disabled] { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }

/* chain builder */
.chain { display: flex; flex-direction: column; gap: 8px; }
.chain-step { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 8px; border-radius: 13px; background: var(--bg-2); border: 1px solid var(--border); transition: border-color var(--t), transform var(--t), opacity var(--t), box-shadow var(--t); }
.chain-step.dragging { opacity: .5; }
.chain-step.drop-before { box-shadow: 0 -3px 0 0 var(--accent); }
.chain-step.drop-after { box-shadow: 0 3px 0 0 var(--accent); }
.chain-step.unavailable { border-color: rgba(248,113,113,.35); }
.chain-step .grip { cursor: grab; color: var(--text-3); padding: 6px 2px; display: grid; place-items: center; touch-action: none; }
.chain-step .grip svg { width: 16px; height: 16px; }
.chain-step .num { width: 24px; height: 24px; border-radius: 8px; background: var(--surface-3); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--text-2); flex: none; }
.chain-step .info { flex: 1; min-width: 0; }
.chain-step .info .n { font-weight: 620; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chain-step .info .r { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chain-step .cost { font-family: var(--mono); font-size: 12px; color: var(--text-2); white-space: nowrap; }
.chain-step .acts { display: flex; gap: 2px; }
.chain-step .acts .btn { width: 30px; min-height: 30px; padding: 0; }
.chain-arrow { display: flex; justify-content: center; color: var(--text-3); height: 6px; margin: -4px 0; }
.chain-empty { padding: 18px; text-align: center; border: 1px dashed var(--border-strong); border-radius: 13px; color: var(--text-3); font-size: 13px; }
.engine-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.engine-opt { text-align: left; padding: 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--border); cursor: pointer; display: flex; flex-direction: column; gap: 4px; transition: border-color var(--t), transform var(--t); color: var(--text); }
.engine-opt:hover:not([disabled]) { border-color: var(--accent-ring); transform: translateY(-1px); }
.engine-opt[disabled] { opacity: .45; cursor: not-allowed; }
.engine-opt .top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.engine-opt .n { font-weight: 640; font-size: 13.5px; }
.engine-opt .d { font-size: 12px; color: var(--text-3); line-height: 1.4; }
.engine-opt .why { font-size: 11.5px; color: var(--err); }

/* accordion */
.acc { border-top: 1px solid var(--border); }
.acc:first-child { border-top: 0; }
.acc > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px; cursor: pointer; font-weight: 620; font-size: 13.5px; min-height: 48px; transition: background var(--t); }
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary:hover { background: var(--surface-hover); }
.acc > summary .chev { transition: transform var(--t) var(--ease); color: var(--text-3); width: 16px; height: 16px; }
.acc[open] > summary .chev { transform: rotate(180deg); }
.acc > .acc-body { padding: 4px 20px 18px; display: flex; flex-direction: column; gap: 14px; }
.slider-field { display: flex; flex-direction: column; gap: 2px; }
.slider-field .row-between .val { font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.toggle-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; }

/* estimate */
.estimate-total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.estimate-total .credits { font-size: 32px; font-weight: 780; letter-spacing: -.03em; line-height: 1; }
.estimate-total .credits small { font-size: 13px; color: var(--text-3); font-weight: 550; margin-left: 4px; letter-spacing: 0; }
.estimate-total .usd { font-family: var(--mono); color: var(--text-2); font-size: 13px; }
.breakdown { display: flex; flex-direction: column; gap: 0; margin-top: 12px; font-size: 13px; }
.breakdown div { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.breakdown div:last-child { border-bottom: 0; }
.breakdown span:last-child { font-family: var(--mono); color: var(--text-2); white-space: nowrap; }
.outdims { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--border); font-size: 13px; flex-wrap: wrap; }
.outdims .arrow { color: var(--text-3); }
.outdims strong { font-family: var(--mono); font-weight: 600; }

/* skeleton */
.skel { position: relative; overflow: hidden; background: var(--surface-3); border-radius: 8px; }
.skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.05), transparent); animation: shimmer 1.3s infinite; }
:root[data-theme="light"] .skel::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent); }
@keyframes shimmer { to { transform: translateX(100%); } }
.skel-line { height: 12px; margin: 8px 0; }
.skel-card { height: 92px; border-radius: 14px; }

/* ---------- Modal / drawer / sheet ---------- */
.overlay { position: fixed; inset: 0; background: rgba(3, 6, 12, .62); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn 160ms var(--ease); }
:root[data-theme="light"] .overlay { background: rgba(15, 23, 42, .35); }
@keyframes fadeIn { from { opacity: 0; } }
.modal { width: 100%; max-width: 520px; max-height: calc(100dvh - 40px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 20px; box-shadow: var(--shadow-lg); animation: popIn 200ms var(--ease); overflow: hidden; }
.modal-wide { max-width: 760px; }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; }
.modal-head h2 { font-size: 17px; font-weight: 680; }
.modal-body { padding: 4px 20px 16px; overflow-y: auto; color: var(--text-2); }
.modal-body p + p { margin-top: 8px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--bg-2); flex-wrap: wrap; }
.drawer-overlay { justify-content: flex-end; padding: 0; align-items: stretch; }
.drawer { width: 100%; max-width: 620px; height: 100%; background: var(--surface); border-left: 1px solid var(--border-strong); display: flex; flex-direction: column; animation: slideIn 220ms var(--ease); box-shadow: var(--shadow-lg); }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } }
.drawer .modal-body { flex: 1; }
.summary-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin: 8px 0; }
.summary-list > div { display: flex; justify-content: space-between; gap: 14px; padding: 9px 12px; font-size: 13px; border-bottom: 1px solid var(--border); }
.summary-list > div:last-child { border-bottom: 0; }
.summary-list > div > span:first-child { color: var(--text-3); }
.summary-list > div > span:last-child { color: var(--text); text-align: right; font-weight: 550; overflow-wrap: anywhere; }

/* toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); font-size: 13.5px; animation: toastIn 220ms var(--ease); }
.toast.out { animation: toastOut 180ms var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }
.toast .ti { width: 20px; height: 20px; flex: none; }
.toast.ok .ti { color: var(--ok); } .toast.err .ti { color: var(--err); } .toast.warn .ti { color: var(--warn); } .toast.info .ti { color: var(--accent-2); }
.toast .tmsg { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast .tmsg strong { display: block; font-weight: 650; }
.toast .tmsg span { color: var(--text-2); font-size: 12.5px; }
.toast button { background: none; border: 0; color: var(--text-3); cursor: pointer; padding: 2px; }

/* palette */
.palette { width: 100%; max-width: 600px; align-self: flex-start; margin-top: 12vh; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; animation: popIn 180ms var(--ease); }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.palette-input svg { width: 18px; height: 18px; color: var(--text-3); }
.palette-input input { flex: 1; height: 54px; border: 0; background: transparent; font-size: 15px; outline: none; }
.palette-list { max-height: 50vh; overflow-y: auto; padding: 6px; }
.palette-group { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); padding: 10px 10px 4px; }
.palette-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 8px 10px; border-radius: 10px; border: 0; background: transparent; text-align: left; cursor: pointer; color: var(--text); }
.palette-item .pi-icon { width: 30px; height: 30px; border-radius: 9px; background: var(--surface-3); display: grid; place-items: center; color: var(--text-2); flex: none; }
.palette-item .pi-icon svg { width: 15px; height: 15px; }
.palette-item .pi-sub { font-size: 12px; color: var(--text-3); }
.palette-item .pi-code { font-family: var(--mono); font-size: 11.5px; color: var(--accent-2); margin-left: auto; }
.palette-item[aria-selected="true"] { background: var(--accent-soft); }
.palette-item[aria-selected="true"] .pi-icon { background: var(--accent); color: #fff; }
.palette-foot { display: flex; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); background: var(--bg-2); }
.shortcut-list { display: grid; grid-template-columns: 1fr auto; gap: 10px 20px; align-items: center; font-size: 13.5px; color: var(--text); }
.shortcut-list .keys { display: flex; gap: 4px; justify-content: flex-end; }

/* ---------- Jobs ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .search-input { flex: 1; min-width: 200px; max-width: 380px; }
.job-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.job-card { display: flex; gap: 14px; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); text-decoration: none !important; color: var(--text); transition: transform var(--t) var(--ease), border-color var(--t), box-shadow var(--t); min-width: 0; }
.job-card:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.job-thumb { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; background: var(--surface-3); flex: none; }
.job-card .jc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.job-card .jc-code { font-family: var(--mono); font-size: 12px; color: var(--accent-2); font-weight: 600; }
.job-card .jc-meta { font-size: 12px; color: var(--text-3); }
.status-badge { text-transform: capitalize; }
.empty { text-align: center; padding: 56px 20px; color: var(--text-2); }
.empty .empty-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; background: var(--surface-2); display: grid; place-items: center; color: var(--text-3); border: 1px solid var(--border); }
.empty .empty-icon svg { width: 26px; height: 26px; }
.empty h3 { font-size: 16px; color: var(--text); margin-bottom: 4px; }

.job-detail-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, .6fr); gap: 20px; align-items: start; }
.job-detail-grid > div { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.job-hero { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.job-hero img { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; background: var(--surface-3); }
.job-hero > .stack-sm { min-width: 0; overflow-wrap: anywhere; }
.job-hero h1 { font-size: 20px; font-family: var(--mono); font-weight: 650; letter-spacing: -.01em; }
.progress-block { display: flex; flex-direction: column; gap: 12px; }
.progress-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.progress-top .pct { font-size: 28px; font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kv-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.console { font-family: var(--mono); font-size: 12px; line-height: 1.6; background: #070a10; color: #c3cad8; border-radius: 12px; padding: 12px 14px; height: 280px; overflow-y: auto; border: 1px solid var(--border); }
:root[data-theme="light"] .console { background: #0f1420; }
.console .ln { display: flex; gap: 10px; white-space: pre-wrap; word-break: break-word; }
.console .ln .t { color: #56617a; flex: none; }
.console .ln.warn .m { color: #fbbf24; }
.console .ln.error .m { color: #f87171; }
.frame-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.frame-pair figure { margin: 0; }
.frame-pair img { width: 100%; aspect-ratio: 16/10; object-fit: contain; background: var(--bg-2); border-radius: 10px; border: 1px solid var(--border); }
.frame-pair figcaption { font-size: 11.5px; color: var(--text-3); margin-top: 5px; }
.meta-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.meta-table th, .meta-table td { text-align: left; padding: 8px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.meta-table th { color: var(--text-3); font-weight: 550; width: 44%; padding-right: 12px; }
.meta-table td { font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }
.meta-table tr:last-child th, .meta-table tr:last-child td { border-bottom: 0; }
.outputs { display: flex; flex-direction: column; gap: 8px; }
.output-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--border); min-width: 0; }
.output-row .oi { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); flex: none; }
.output-row .oi svg { width: 16px; height: 16px; }
.comments { display: flex; flex-direction: column; gap: 10px; }
.comment { display: flex; gap: 10px; }
.comment .avatar { width: 28px; height: 28px; font-size: 11px; border-radius: 8px; }
.comment .cb { flex: 1; min-width: 0; background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; }
.comment .cb .ch { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--text-3); }
.comment .cb .ch strong { color: var(--text); font-weight: 600; }
.comment .cb p { font-size: 13.5px; margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.chain-flow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chain-flow .cf { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; background: var(--surface-3); font-size: 12px; font-weight: 550; }
.chain-flow .cf.active { background: var(--accent-soft); color: var(--accent-2); box-shadow: inset 0 0 0 1px rgba(96,165,250,.3); }
.chain-flow .cf.done { color: var(--ok); }
.chain-flow .sep { color: var(--text-3); font-size: 11px; }

/* ---------- Compare viewer ---------- */
.compare { display: flex; flex-direction: column; gap: 10px; }
.compare-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.compare-stage { position: relative; height: min(62vh, 620px); min-height: 300px; border-radius: 14px; overflow: hidden; background: #06080d; border: 1px solid var(--border); cursor: grab; touch-action: none; user-select: none; }
.compare-stage.panning { cursor: grabbing; }
.compare-stage.side { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--border); }
.cmp-pane { position: absolute; inset: 0; overflow: hidden; }
.compare-stage.side .cmp-pane { position: relative; background: #06080d; }
.cmp-pane img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; image-rendering: auto; pointer-events: none; will-change: transform; }
.cmp-pane.pixel img { image-rendering: pixelated; }
.cmp-after { clip-path: inset(0 0 0 var(--split, 50%)); }
.compare-stage.side .cmp-after, .compare-stage.flicker .cmp-after { clip-path: none; }
.cmp-handle { position: absolute; top: 0; bottom: 0; left: var(--split, 50%); width: 0; z-index: 3; }
.cmp-handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: rgba(255,255,255,.9); box-shadow: 0 0 0 1px rgba(0,0,0,.3); }
.cmp-handle button { position: absolute; top: 50%; left: 0; transform: translate(-50%, -50%); width: 40px; height: 40px; border-radius: 50%; border: 0; background: #fff; color: #111; display: grid; place-items: center; cursor: ew-resize; box-shadow: 0 4px 14px rgba(0,0,0,.45); }
.cmp-handle button svg { width: 18px; height: 18px; }
.cmp-label { position: absolute; top: 12px; z-index: 2; font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; padding: 4px 9px; border-radius: 7px; background: rgba(0,0,0,.6); color: #fff; pointer-events: none; }
.cmp-label.l { left: 12px; } .cmp-label.r { right: 12px; }
.cmp-zoom-ind { position: absolute; bottom: 12px; left: 12px; z-index: 2; font-family: var(--mono); font-size: 11.5px; padding: 4px 9px; border-radius: 7px; background: rgba(0,0,0,.6); color: #fff; pointer-events: none; }
.loupe { position: absolute; width: 180px; height: 180px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 8px 30px rgba(0,0,0,.6); pointer-events: none; z-index: 5; overflow: hidden; background: #000 no-repeat; display: none; }
.compare-stage.loupe-on { cursor: crosshair; }

/* ---------- Video ---------- */
.video-player { width: 100%; max-height: 460px; background: #000; border-radius: 12px; }
.timeline { position: relative; user-select: none; }
.timeline-strip { display: flex; height: 64px; border-radius: 10px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--border); position: relative; }
.timeline-strip .tf { flex: 1; min-width: 0; position: relative; border: 0; padding: 0; background: var(--surface-3); cursor: pointer; }
.timeline-strip .tf img { width: 100%; height: 100%; object-fit: cover; opacity: .8; transition: opacity var(--t); }
.timeline-strip .tf:hover img { opacity: 1; }
.timeline-strip .tf.test::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 2px var(--warn); background: rgba(251,191,36,.18); }
.timeline-strip .tf.test::before { content: "T"; position: absolute; top: 3px; left: 3px; z-index: 2; width: 15px; height: 15px; border-radius: 4px; background: var(--warn); color: #111; font-size: 10px; font-weight: 800; display: grid; place-items: center; }
.timeline-strip .tf.current img { opacity: 1; }
.tl-dim { position: absolute; top: 0; bottom: 0; background: rgba(5,8,14,.7); pointer-events: none; z-index: 1; }
.tl-cut { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--violet); z-index: 2; pointer-events: none; border-radius: 2px; }
.tl-cut::after { content: ""; position: absolute; top: -4px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--violet); }
.tl-playhead { position: absolute; top: -6px; bottom: -6px; width: 2px; background: #fff; z-index: 3; pointer-events: none; box-shadow: 0 0 0 1px rgba(0,0,0,.4); }
.tl-handle { position: absolute; top: -6px; bottom: -6px; width: 14px; margin-left: -7px; z-index: 4; cursor: ew-resize; border: 0; padding: 0; background: transparent; touch-action: none; }
.tl-handle::before { content: ""; position: absolute; left: 4px; right: 4px; top: 0; bottom: 0; border-radius: 4px; background: var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.tl-handle::after { content: ""; position: absolute; left: 6px; width: 2px; top: 35%; bottom: 35%; background: rgba(255,255,255,.8); border-radius: 2px; }
.tl-handle:focus-visible::before { box-shadow: 0 0 0 3px var(--accent-ring); }
.tl-range-sel { position: absolute; top: -2px; bottom: -2px; border: 2px solid var(--accent); border-radius: 8px; pointer-events: none; z-index: 2; }
.tl-scale { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--text-3); margin-top: 8px; }
.frame-inspector { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 16px; align-items: start; }
.frame-inspector img { width: 100%; border-radius: 10px; background: var(--bg-2); aspect-ratio: 16/9; object-fit: contain; border: 1px solid var(--border); }
.frame-ctrl { display: flex; align-items: center; gap: 8px; }
.frame-ctrl .input { text-align: center; font-family: var(--mono); }

/* ---------- Prompt lab / codes ---------- */
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.prompt-block { border: 1px solid var(--border); border-radius: 14px; background: var(--bg-2); overflow: hidden; }
.prompt-block > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; min-height: 48px; }
.prompt-block > summary::-webkit-details-marker { display: none; }
.prompt-block > summary:hover { background: var(--surface-hover); }
.prompt-block .pb-title { font-weight: 600; font-size: 13.5px; flex: 1; min-width: 0; }
.prompt-block .pb-id { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.codeblock { position: relative; margin: 0; }
.codeblock pre { margin: 0; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; padding: 14px 16px; padding-right: 50px; white-space: pre-wrap; word-break: break-word; background: #070a10; color: #cfd6e4; border-radius: 12px; border: 1px solid var(--border); max-height: 420px; overflow: auto; }
:root[data-theme="light"] .codeblock pre { background: #0f1420; }
.prompt-block .codeblock pre { border-radius: 0; border: 0; border-top: 1px solid var(--border); }
.codeblock .copy-btn { position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.1); color: #cfd6e4; }
.codeblock .copy-btn:hover { background: rgba(255,255,255,.14); }
.group-title { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; margin: 18px 0 8px; }
.group-title:first-child { margin-top: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { position: relative; background: none; border: 0; padding: 0 14px; min-height: 44px; color: var(--text-2); font-weight: 580; cursor: pointer; white-space: nowrap; font-size: 13.5px; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--text); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.tabs .badge { margin-left: 6px; }
.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 11px 14px; background: var(--bg-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--t); }
.table tbody tr:hover { background: var(--surface-hover); }
.table .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.method { display: inline-block; min-width: 56px; text-align: center; font-family: var(--mono); font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 6px; }
.method.GET { background: var(--ok-soft); color: var(--ok); }
.method.POST { background: var(--accent-soft); color: var(--accent-2); }
.method.PUT, .method.PATCH { background: var(--warn-soft); color: var(--warn); }
.method.DELETE { background: var(--err-soft); color: var(--err); }
.code-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.code-card .cc-code { font-family: var(--mono); font-weight: 650; color: var(--accent-2); font-size: 14px; }
.ref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.kv { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--text-3); }
.kv code { color: var(--text-2); font-size: 11.5px; }

/* presets */
.preset-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; transition: transform var(--t), border-color var(--t); }
.preset-card:hover { border-color: var(--border-strong); }
.star-btn { color: var(--text-3); }
.star-btn[aria-pressed="true"] { color: #fbbf24; }
.star-btn[aria-pressed="true"] svg { fill: currentColor; }

/* admin */
.approval-card { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 16px; padding: 16px; align-items: center; }
.approval-card img { width: 96px; height: 96px; object-fit: cover; border-radius: 12px; background: var(--surface-3); }
.approval-card .acts { display: flex; flex-direction: column; gap: 6px; }
.big-code { font-family: var(--mono); font-size: 22px; font-weight: 700; letter-spacing: .06em; text-align: center; padding: 18px; border-radius: 14px; background: var(--bg-2); border: 1px dashed var(--accent-ring); color: var(--text); overflow-wrap: anywhere; }
.tunnel-url { font-family: var(--mono); font-size: 13px; padding: 10px 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--border); overflow-wrap: anywhere; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }

/* ---------- Tablet ---------- */
.sidebar-toggle { display: none !important; }
@media (max-width: 1180px) {
  .studio-grid { grid-template-columns: minmax(0, 1fr); }
  .studio-right { position: static; }
  .job-detail-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1080px) and (min-width: 761px) {
  .shell { grid-template-columns: 72px minmax(0, 1fr); }
  .sidebar { padding: 16px 10px; align-items: stretch; }
  .sidebar .brand-name, .nav-item .nav-label, .nav-sep, .sidebar-recent, .nav-item .nav-count, .user-chip .meta, .sidebar-foot .credit-pill span { display: none; }
  .sidebar .brand { justify-content: center; padding: 4px 0 14px; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-item[aria-current="page"]::before { left: -10px; }
  .user-chip { justify-content: center; }
  .sidebar-foot .credit-pill { justify-content: center; padding: 0; }
  .sidebar-toggle { display: inline-flex !important; }
  .shell.sidebar-open .sidebar { position: fixed; left: 0; width: var(--sidebar-w); box-shadow: var(--shadow-lg); padding: 16px 12px; }
  .shell.sidebar-open .sidebar .brand-name, .shell.sidebar-open .nav-item .nav-label, .shell.sidebar-open .nav-sep, .shell.sidebar-open .sidebar-recent, .shell.sidebar-open .user-chip .meta, .shell.sidebar-open .sidebar-foot .credit-pill span { display: revert; }
  .shell.sidebar-open .sidebar-recent { display: flex; }
  .shell.sidebar-open .nav-item { justify-content: flex-start; padding: 0 12px; }
  .shell.sidebar-open .sidebar .brand { justify-content: flex-start; padding: 4px 8px 14px; }
  .shell.sidebar-open .user-chip { justify-content: flex-start; }
  .shell.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(0,0,0,.4); }
  .kv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.mobile-credits { display: none; }

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  body { font-size: 15px; }
  .shell { display: block; }
  .sidebar { display: none; }
  .topbar { padding: 0 14px; height: 56px; padding-top: env(safe-area-inset-top); }
  .topbar .brand { display: flex; }
  .mobile-credits { display: inline-flex; height: 36px; }
  .topbar .brand-name { font-size: 15px; white-space: nowrap; }
  .topbar .brand { min-width: 0; }
  .topbar-actions { gap: 4px; }
  .topbar-actions .help-btn { display: none; }
  .topbar-title, .palette-trigger .pt-label, .palette-trigger kbd { display: none; }
  .palette-trigger { min-width: 0; width: 44px; height: 44px; justify-content: center; padding: 0; }
  .banner { padding: 10px 14px; }
  .content { padding: 16px 14px calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom)); }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--bg-2) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--border); }
  .tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-3); font-size: 10.5px; font-weight: 600; text-decoration: none !important; background: none; border: 0; min-height: 44px; cursor: pointer; -webkit-tap-highlight-color: transparent; position: relative; }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar [aria-current="page"] { color: var(--accent-2); }
  .tabbar [aria-current="page"]::before { content: ""; position: absolute; top: 0; width: 28px; height: 2px; border-radius: 0 0 2px 2px; background: var(--accent); }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 44px; }
  .btn-icon { width: 44px; }
  .btn-icon.btn-sm { width: 44px; }
  .input, .select { min-height: 44px; font-size: 16px; }
  .textarea { font-size: 16px; }
  .seg { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
  .seg button { min-height: 44px; flex: 1 0 auto; padding: 0 10px; }
  .chip { min-height: 44px; }
  .plan-row { min-height: 44px; }
  .hero { padding: 20px 18px; border-radius: 18px; }
  .job-hero { flex-wrap: nowrap; gap: 12px; align-items: flex-start; }
  .job-hero img, .job-hero > div:first-child:empty { width: 48px; height: 48px; border-radius: 12px; flex: none; }
  .job-hero h1 { font-size: 17px; }
  .hero h1 { font-size: 24px; }
  .hero p { font-size: 14px; }
  .hero-side { align-items: flex-start; width: 100%; min-width: 0; }
  .hero .engine-pills { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; justify-content: flex-start; scrollbar-width: none; padding-bottom: 2px; }
  .hero .engine-pills::-webkit-scrollbar { display: none; }
  .hero .engine-pill { flex: none; }
  .engine-pills { justify-content: flex-start; }
  .view-head h1 { font-size: 21px; }
  .card-head, .card-body, .acc > summary { padding-left: 16px; padding-right: 16px; }
  .acc > .acc-body { padding: 4px 16px 16px; }
  .card-pad { padding: 16px; }
  .dropzone { min-height: 200px; padding: 24px 16px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cmd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .cmd-card { min-height: 84px; padding: 11px 12px; }
  .toggle-grid { grid-template-columns: minmax(0, 1fr); }
  .grid-2, .grid-3, .two-col { grid-template-columns: minmax(0, 1fr); }
  .kv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chain-step { flex-wrap: wrap; }
  .chain-step { row-gap: 2px; }
  .chain-step .info { flex-basis: calc(100% - 72px); }
  .chain-step .cost { order: 5; padding-left: 62px; }
  .chain-step .acts { order: 6; margin-left: auto; }
  .chain-step .acts .btn { width: 40px; min-height: 36px; }
  .job-list { grid-template-columns: minmax(0, 1fr); }
  .compare-stage { height: 56vh; min-height: 260px; }
  .frame-inspector { grid-template-columns: minmax(0, 1fr); }
  .approval-card { grid-template-columns: 72px minmax(0, 1fr); }
  .approval-card img { width: 72px; height: 72px; }
  .approval-card .acts { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .approval-card .acts .btn { flex: 1; }
  .toasts { left: 16px; right: 16px; width: auto; bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom)); }
  .overlay { padding: 0; align-items: flex-end; }
  .modal { max-width: none; border-radius: 22px 22px 0 0; max-height: 92dvh; animation: sheetIn 240ms var(--ease); padding-bottom: env(safe-area-inset-bottom); }
  .modal::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--border-strong); margin: 8px auto 0; }
  @keyframes sheetIn { from { transform: translateY(40px); opacity: 0; } }
  .modal-foot .btn { flex: 1; }
  .drawer-overlay { align-items: flex-end; }
  .drawer { max-width: none; height: 88dvh; border-left: 0; border-radius: 22px 22px 0 0; animation: sheetIn 240ms var(--ease); }
  .palette { margin-top: 0; align-self: flex-start; border-radius: 0 0 18px 18px; max-width: none; }
  .palette-foot, .palette-item kbd, .palette-input kbd { display: none; }
  .table th, .table td { padding: 10px 12px; }
  .meter { grid-template-columns: 80px 1fr 36px; }
  .tabs button { min-height: 44px; }
  .estimate-total .credits { font-size: 28px; }
  .studio-actions { position: sticky; bottom: calc(var(--tabbar-h) + 8px + env(safe-area-inset-bottom)); z-index: 5; }
  .shortcut-list { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
.form-error:empty { display: none; }

/* frame gallery (sample-frame jobs, CODE FRAMES) */
.frame-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.frame-tile { border: 1px solid var(--border); border-radius: 12px; background: var(--bg-2); overflow: hidden; min-width: 0; }
.frame-tile[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.frame-thumb { display: block; width: 100%; padding: 0; border: 0; background: var(--surface-3); cursor: pointer; aspect-ratio: 16 / 9; }
.frame-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.frame-thumb:disabled { cursor: default; }
.frame-cap { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 8px; min-width: 0; }
@media (max-width: 760px) { .frame-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } .frame-cap .btn { min-height: 44px; min-width: 44px; } }

/* add-on codes (multi-select) */
.addon-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.addon-grid .chip { text-align: left; }
.addon-grid .chip small { display: block; font-weight: 400; opacity: .7; font-size: 11px; }

/* Full auto */
.full-auto-card { border-color: var(--accent, var(--border)); }
.full-auto-btn { min-height: 52px; font-size: 17px; letter-spacing: .01em; }
.ultimate-card { border-color: var(--accent, var(--border)); background: linear-gradient(135deg, color-mix(in srgb, var(--accent, #4f8cff) 10%, transparent), transparent 60%), var(--surface, transparent); }
.ultimate-btn { min-height: 56px; font-size: 18px; letter-spacing: .02em; }
.card.flash { animation: card-flash 1.4s ease-out 1; }
@keyframes card-flash { 0%, 30% { box-shadow: 0 0 0 3px var(--accent, #4f8cff); } 100% { box-shadow: 0 0 0 0 transparent; } }

/* stars, rename */
.star-btn { font-size: 20px; line-height: 1; color: var(--text-3); }
.star-btn.star-on, .star-on { color: var(--warn); }
.star-btn:hover { color: var(--warn); }

/* anime autocomplete */
.anime-wrap { position: relative; }
.anime-suggest { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--r-sm); box-shadow: var(--shadow-lg); max-height: 320px; overflow-y: auto; }
.anime-opt { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.anime-opt:hover, .anime-opt[aria-selected="true"] { background: var(--accent-soft); }
.anime-opt img, .anime-noimg { width: 32px; height: 44px; object-fit: cover; border-radius: 5px; flex: none; background: var(--surface-3); display: grid; place-items: center; }
.anime-txt { display: flex; flex-direction: column; min-width: 0; }
.anime-txt strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* credit usage */
.usage-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.usage-stats > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 10px 12px; }
.usage-num { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; }
.usage-chart { width: 100%; height: 150px; display: block; }
.usage-area { fill: var(--accent-soft); stroke: none; }
.usage-line { fill: none; stroke: var(--accent-2); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.usage-dot { fill: var(--accent-2); }
@media (max-width: 520px) { .usage-num { font-size: 16px; } }
