/* AI Learning Lab design system.
   Source: ui-ux-pro-max data — product "AI/Chatbot Platform" palette, style "AI-Native UI" + "Bento Box Grid",
   font pairing "Tech Startup" (Space Grotesk / DM Sans). Dark theme follows "Dark Mode (OLED)" + "Developer Tool / IDE". */
:root {
  --primary: #7C3AED; --on-primary: #FFFFFF; --secondary: #A78BFA; --accent: #0891B2; --on-accent: #000000;
  --bg: #FAF5FF; --fg: #1E1B4B; --card: #FFFFFF; --muted: #ECEEF9; --muted-fg: #475569; --border: #DDD6FE;
  --destructive: #DC2626; --ok: #15803D; --warn: #B45309;
  --surface-2: #F4F0FE; --glass: rgba(255,255,255,.72); --ring: #7C3AED;
  --grad: linear-gradient(135deg, #7C3AED 0%, #0891B2 100%);
  --shadow-sm: 0 1px 2px rgba(30,27,75,.06);
  --shadow: 0 1px 2px rgba(30,27,75,.05), 0 8px 28px rgba(76,29,149,.08);
  --shadow-lg: 0 24px 60px rgba(76,29,149,.18);
  --r-sm: 10px; --r: 16px; --r-lg: 22px;
  --font-head: "Space Grotesk", "Noto Sans SC", system-ui, sans-serif;
  --font-body: "DM Sans", "Noto Sans SC", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --dur-1: 150ms; --dur-2: 220ms; --dur-3: 360ms; --ease: cubic-bezier(.2,.8,.2,1);
  --side-w: 288px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary: #A78BFA; --on-primary: #12091F; --secondary: #7C3AED; --accent: #22D3EE; --on-accent: #001318;
    --bg: #0A0A0F; --fg: #F4F2FF; --card: #13131C; --muted: #1C1C28; --muted-fg: #A3A3BD; --border: #2A2A3C;
    --destructive: #F87171; --ok: #4ADE80; --warn: #FBBF24; --surface-2: #181824; --glass: rgba(19,19,28,.72); --ring: #A78BFA;
    --grad: linear-gradient(135deg, #8B5CF6 0%, #06B6D4 100%);
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 28px rgba(0,0,0,.35); --shadow-lg: 0 24px 60px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --primary: #A78BFA; --on-primary: #12091F; --secondary: #7C3AED; --accent: #22D3EE; --on-accent: #001318;
  --bg: #0A0A0F; --fg: #F4F2FF; --card: #13131C; --muted: #1C1C28; --muted-fg: #A3A3BD; --border: #2A2A3C;
  --destructive: #F87171; --ok: #4ADE80; --warn: #FBBF24; --surface-2: #181824; --glass: rgba(19,19,28,.72); --ring: #A78BFA;
  --grad: linear-gradient(135deg, #8B5CF6 0%, #06B6D4 100%);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 28px rgba(0,0,0,.35); --shadow-lg: 0 24px 60px rgba(0,0,0,.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 16px/1.55 var(--font-body); -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: -20% -10% auto auto; width: 60vw; height: 60vw; background: radial-gradient(circle, color-mix(in srgb, var(--primary) 14%, transparent), transparent 62%); pointer-events: none; z-index: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, h4 { font-family: var(--font-head); letter-spacing: -.02em; margin: 0; }
h1 { font-size: clamp(28px, 3.6vw, 42px); line-height: 1.1; }
h2 { font-size: 22px; line-height: 1.25; }
h3 { font-size: 17px; line-height: 1.3; }
p { margin: 0 0 10px; }
code, pre, .mono, kbd { font-family: var(--font-mono); font-size: .86em; }
kbd { border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; background: var(--card); font-size: 12px; }
.muted { color: var(--muted-fg); }
.small { font-size: 13.5px; }
.tiny { font-size: 12.5px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- shell ---------- */
.shell { position: relative; z-index: 1; display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 18px 14px; display: flex; flex-direction: column; gap: 10px;
  background: var(--glass); backdrop-filter: blur(16px); border-right: 1px solid var(--border); }
.brand { display: flex; gap: 12px; align-items: center; color: var(--fg); padding: 6px 8px 10px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--grad); color: #fff; font: 700 15px var(--font-head); box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 40%, transparent); }
.brand b { font-family: var(--font-head); display: block; }
.brand small { color: var(--muted-fg); font-size: 12px; }
.search-trigger { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; justify-content: flex-start; color: var(--muted-fg); font-weight: 500; }
.search-trigger kbd { margin-left: auto; }
nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted-fg); margin: 14px 12px 4px; font-weight: 700; }
nav a { display: flex; gap: 11px; align-items: center; color: var(--fg); padding: 9px 12px; min-height: 44px; border-radius: 12px; font-weight: 500; font-size: 14.5px; transition: background var(--dur-1) var(--ease); }
nav a i { font-size: 19px; color: var(--muted-fg); flex: none; }
nav a span { display: flex; flex-direction: column; line-height: 1.25; }
nav a em { font-style: normal; font-size: 11.5px; color: var(--muted-fg); font-weight: 400; }
nav a:hover { background: var(--muted); text-decoration: none; }
nav a.active { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); }
nav a.active i { color: var(--primary); }
.side-foot { margin-top: auto; display: flex; gap: 8px; padding-top: 12px; }
.topbar { display: none; }
main { padding: 32px clamp(16px, 3.6vw, 48px) 96px; max-width: 1320px; width: 100%; min-width: 0; outline: none; }
.split > *, .studio > *, .grid > *, .bento > * { min-width: 0; }

/* ---------- primitives ---------- */
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; font: 600 14px var(--font-body); border: 1px solid var(--border); background: var(--card); color: var(--fg); padding: 8px 14px; border-radius: 12px; cursor: pointer; transition: border-color var(--dur-1), background var(--dur-1), transform var(--dur-1), box-shadow var(--dur-1); white-space: nowrap; }
button:hover, .btn:hover { border-color: var(--primary); text-decoration: none; }
button:active, .btn:active { transform: scale(.98); }
button:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary, button.primary { background: var(--primary); color: var(--on-primary); border-color: transparent; box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 30%, transparent); }
.btn-primary:hover, button.primary:hover { filter: brightness(1.08); border-color: transparent; }
.btn-grad { background: var(--grad); color: #fff; border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--muted); border-color: transparent; }
.btn-sm { min-height: 32px; padding: 4px 10px; font-size: 13px; border-radius: 10px; }
.icon-btn { width: 40px; padding: 0; }
input, select, textarea { font: inherit; font-size: 15px; color: var(--fg); background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 9px 12px; width: 100%; min-height: 42px; transition: border-color var(--dur-1), box-shadow var(--dur-1); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
input[type=color] { padding: 3px; min-height: 40px; cursor: pointer; }
input[type=range] { padding: 0; min-height: 28px; accent-color: var(--primary); border: 0; background: transparent; }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: var(--primary); }
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
label { font-size: 13px; font-weight: 600; display: block; margin-bottom: 5px; }
.field { margin-bottom: 12px; }
.help { font-size: 12.5px; color: var(--muted-fg); margin-top: 4px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; font-size: 14px; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow-sm); }
.card.lift { transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2), border-color var(--dur-2); }
.card.lift:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-title h3 { display: flex; gap: 8px; align-items: center; }
.glass { background: var(--glass); backdrop-filter: blur(14px); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.auto { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.auto-sm { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.split { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 18px; align-items: start; }
.sticky { position: sticky; top: 20px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.mt { margin-top: 28px; }
.mb { margin-bottom: 14px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 34px 0 14px; flex-wrap: wrap; }
.page-head { margin-bottom: 22px; }
.page-head .eyebrow { display: inline-flex; gap: 8px; align-items: center; font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); margin-bottom: 8px; }
.page-head p { color: var(--muted-fg); max-width: 820px; margin-top: 8px; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--muted); color: var(--muted-fg); white-space: nowrap; line-height: 1.5; }
a.pill:hover { text-decoration: none; color: var(--primary); }
.pill.p1 { background: color-mix(in srgb, var(--destructive) 13%, transparent); color: var(--destructive); }
.pill.p2 { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.pill.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.pill.bad { background: color-mix(in srgb, var(--destructive) 13%, transparent); color: var(--destructive); }
.pill.brand { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.slug { font-family: var(--font-mono); font-size: 12px; color: var(--muted-fg); word-break: break-all; }

.tabs { display: flex; gap: 4px; padding: 4px; background: var(--muted); border-radius: 14px; overflow-x: auto; margin-bottom: 18px; scrollbar-width: none; }
.tabs button { border: 0; background: transparent; min-height: 38px; color: var(--muted-fg); border-radius: 10px; }
.tabs button.on { background: var(--card); color: var(--fg); box-shadow: var(--shadow-sm); }
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--muted); border-radius: 12px; }
.seg button { border: 0; background: transparent; min-height: 32px; padding: 4px 10px; font-size: 13px; border-radius: 9px; color: var(--muted-fg); }
.seg button.on { background: var(--card); color: var(--fg); box-shadow: var(--shadow-sm); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 34px; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.chip.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }

.progress { height: 8px; border-radius: 99px; background: var(--muted); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--grad); border-radius: inherit; transition: width var(--dur-3) var(--ease); }
.stat-num { font: 700 32px/1 var(--font-head); letter-spacing: -.03em; }
.stat-label { color: var(--muted-fg); font-size: 13px; margin-top: 6px; }

.list { display: flex; flex-direction: column; }
.list-item { padding: 12px 10px; border-bottom: 1px solid var(--border); cursor: pointer; border-radius: 10px; transition: background var(--dur-1); }
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: var(--surface-2); }
.list-item p { margin: 3px 0 0; color: var(--muted-fg); font-size: 13.5px; }

.out { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px; white-space: pre-wrap; font-family: var(--font-mono); font-size: 12.8px; line-height: 1.6; max-height: 560px; overflow: auto; }
.note { font-size: 14px; padding: 12px 16px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.note.warn { background: color-mix(in srgb, var(--warn) 10%, transparent); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.empty { text-align: center; padding: 34px 16px; color: var(--muted-fg); }
.empty i { font-size: 34px; display: block; margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted-fg); }
.kv dd { margin: 0; }
details { border-bottom: 1px solid var(--border); padding: 8px 0; }
details summary { cursor: pointer; font-weight: 600; list-style-position: outside; }
.mark-hit { background: color-mix(in srgb, var(--warn) 30%, transparent); border-radius: 4px; padding: 0 2px; cursor: help; }
.mark-hit.zh { background: color-mix(in srgb, var(--accent) 25%, transparent); }
.frame { width: 100%; height: 640px; border: 1px solid var(--border); border-radius: var(--r); background: #fff; display: block; }
.swatch-row { display: flex; flex-wrap: wrap; gap: 8px; }
.sw { width: 96px; font-size: 11.5px; }
.sw i { display: block; height: 54px; border-radius: 12px; border: 1px solid var(--border); margin-bottom: 4px; }
.sw b { display: block; font-weight: 600; }

/* ---------- bento ---------- */
.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; grid-auto-rows: minmax(120px, auto); }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-6 { grid-column: span 6; }
.row-2 { grid-row: span 2; }
.hero-card { background: var(--grad); color: #fff; border: 0; position: relative; overflow: hidden; }
.hero-card::after { content: ""; position: absolute; right: -80px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.12); }
.hero-card .muted, .hero-card p { color: rgba(255,255,255,.86); }
.ring { --p: 0; width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(#fff calc(var(--p) * 1%), rgba(255,255,255,.22) 0); }
.ring > div { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; background: rgba(20,10,50,.35); font: 700 26px var(--font-head); }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 13px); gap: 3px; overflow-x: auto; }
.heat i { width: 13px; height: 13px; border-radius: 3px; background: var(--muted); }
.heat i[data-l="1"] { background: color-mix(in srgb, var(--primary) 30%, var(--muted)); }
.heat i[data-l="2"] { background: color-mix(in srgb, var(--primary) 60%, var(--muted)); }
.heat i[data-l="3"] { background: var(--primary); }
.lab-tile { display: flex; flex-direction: column; gap: 8px; color: var(--fg); }
.lab-tile:hover { text-decoration: none; }
.lab-tile .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); }
.lab-tile p { color: var(--muted-fg); font-size: 13.5px; margin: 0; }

/* repo cards */
.repo-card { display: flex; flex-direction: column; gap: 10px; color: var(--fg); }
.repo-card:hover { text-decoration: none; }
.repo-card p { margin: 0; color: var(--muted-fg); font-size: 14px; }
.repo-head { display: flex; gap: 12px; align-items: center; }
.avatar { width: 40px; height: 40px; border-radius: 11px; flex: none; display: grid; place-items: center; font: 700 15px var(--font-head); color: #fff; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.steps button { font-size: 13px; min-height: 40px; padding: 4px; }
.steps button.on { background: var(--primary); color: var(--on-primary); border-color: transparent; }

/* file browser */
.tree { font-family: var(--font-mono); font-size: 13px; max-height: 620px; overflow: auto; }
.tree button { display: flex; width: 100%; justify-content: flex-start; border: 0; border-radius: 8px; min-height: 32px; font: 13px var(--font-mono); background: transparent; padding: 4px 8px; }
.tree button:hover { background: var(--muted); }
.tree button.on { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); }
.crumbs { display: flex; gap: 4px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 13px; margin-bottom: 8px; }
.code-view pre { margin: 0; max-height: 620px; overflow: auto; border-radius: 12px; font-size: 12.8px; }
.code-view pre code.hljs { padding: 16px; border-radius: 12px; }

/* markdown */
.md { font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.md h1 { font-size: 26px; margin: 18px 0 10px; } .md h2 { font-size: 20px; margin: 22px 0 8px; } .md h3 { font-size: 16px; margin: 18px 0 6px; }
.md pre { background: var(--surface-2); border: 1px solid var(--border); padding: 12px 14px; border-radius: 12px; overflow-x: auto; }
.md :not(pre) > code { background: var(--muted); padding: 1px 6px; border-radius: 6px; }
.md table { border-collapse: collapse; display: block; overflow-x: auto; margin: 10px 0; }
.md td, .md th { border: 1px solid var(--border); padding: 6px 10px; text-align: left; vertical-align: top; }
.md img { max-width: 100%; }
.md blockquote { margin: 10px 0; padding: 4px 14px; border-left: 3px solid var(--primary); color: var(--muted-fg); }

/* drawer, palette, toast */
.drawer { position: fixed; inset: 0; background: rgba(10,6,25,.45); z-index: 60; display: flex; justify-content: flex-end; animation: fade var(--dur-2) var(--ease); }
.drawer[hidden], .palette[hidden] { display: none; }
.drawer-panel { width: min(860px, 100%); height: 100%; background: var(--card); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: slide var(--dur-3) var(--ease); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.drawer-head b { font-family: var(--font-head); font-size: 17px; }
.drawer-tools { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.drawer-body { padding: 22px; overflow-y: auto; }
.palette { position: fixed; inset: 0; z-index: 70; background: rgba(10,6,25,.45); display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px; animation: fade var(--dur-2); }
.palette-box { width: min(680px, 100%); background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.palette-box input { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; font-size: 17px; padding: 18px 20px; min-height: 60px; }
.palette-box input:focus { box-shadow: none; }
.palette-list { max-height: 56vh; overflow-y: auto; padding: 6px; }
.palette-item { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; cursor: pointer; min-height: 48px; }
.palette-item i { font-size: 19px; color: var(--muted-fg); }
.palette-item small { color: var(--muted-fg); margin-left: auto; font-size: 12px; white-space: nowrap; }
.palette-item.on { background: color-mix(in srgb, var(--primary) 13%, transparent); }
.palette-item.on i { color: var(--primary); }
.palette-group { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted-fg); padding: 10px 12px 4px; font-weight: 700; }
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--fg); color: var(--bg); padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 600; display: flex; gap: 8px; align-items: center; animation: rise var(--dur-3) var(--ease); }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: .4; } }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }

/* device preview */
.device-bar { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 10px; }
.device-wrap { background: var(--muted); border-radius: var(--r); padding: 14px; display: flex; justify-content: center; overflow: hidden; }
.device-wrap iframe { border: 0; background: #fff; border-radius: 12px; box-shadow: var(--shadow); transition: width var(--dur-3) var(--ease); height: 680px; max-width: 100%; }

/* kanban */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; }
.kcol { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 10px; min-height: 220px; }
.kcol h4 { font-size: 14px; display: flex; justify-content: space-between; margin: 4px 4px 10px; }
.kcol.drag-over { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, var(--surface-2)); }
.kcard { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; cursor: grab; font-size: 14px; box-shadow: var(--shadow-sm); }
.kcard small { display: block; color: var(--muted-fg); font-size: 12px; margin-top: 4px; }

/* video */
.studio { display: grid; grid-template-columns: minmax(280px, 420px) minmax(0, 1fr); gap: 20px; align-items: start; }
.stage-box { background: #050508; border-radius: var(--r-lg); padding: 14px; display: grid; place-items: center; }
.stage { width: 100%; position: relative; overflow: hidden; border-radius: 14px; }
.scene-strip { display: flex; gap: 4px; height: 34px; margin-top: 10px; }
.scene-strip button { min-height: 34px; padding: 0 8px; font-size: 11.5px; border-radius: 8px; overflow: hidden; text-overflow: ellipsis; justify-content: flex-start; flex-shrink: 1; min-width: 0; }
.scene-strip button.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 14%, var(--card)); }
.scene-card { border: 1px solid var(--border); border-radius: 14px; padding: 12px; margin-bottom: 10px; background: var(--card); }
.scene-card.on { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.tpl { text-align: left; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 84px; padding: 12px; white-space: normal; }
.tpl b { font-family: var(--font-head); font-size: 14.5px; }
.tpl span { font-weight: 400; color: var(--muted-fg); font-size: 12.5px; line-height: 1.4; }
.tpl i { font-size: 20px; color: var(--primary); }
.tpl.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, var(--card)); }

/* cards rendered as <button> must not inherit button layout */
button.card { display: block; width: 100%; white-space: normal; text-align: left; font-weight: 400; min-height: 0; }
button.card:active { transform: none; }

/* style gallery */
.style-card { padding: 0; overflow: hidden; cursor: pointer; text-align: left; }
.style-card .preview { width: 100%; }
.style-card .preview { height: 120px; display: grid; place-items: center; position: relative; overflow: hidden; }
.style-card .body { padding: 12px 14px; }
.font-card .sample { font-size: 28px; line-height: 1.15; margin: 6px 0; }

/* SERP preview */
.serp { font-family: Arial, sans-serif; background: #fff; color: #202124; border-radius: 12px; padding: 16px; border: 1px solid var(--border); }
.serp .u { font-size: 12px; color: #4d5156; }
.serp .t { font-size: 20px; color: #1a0dab; line-height: 1.3; margin: 2px 0; }
.serp .d { font-size: 14px; color: #4d5156; line-height: 1.58; }

/* chat bubbles in AI style */
.bubble { max-width: 85%; padding: 10px 14px; border-radius: 16px; margin: 6px 0; font-size: 14px; }
.bubble.me { margin-left: auto; background: var(--primary); color: var(--on-primary); border-bottom-right-radius: 4px; }
.bubble.ai { background: var(--muted); border-bottom-left-radius: 4px; }

.bar-chart { display: flex; align-items: flex-end; gap: 3px; height: 90px; }
.bar-chart i { flex: 1; background: var(--grad); border-radius: 4px 4px 0 0; min-height: 2px; }
.bar-chart i.long { background: var(--warn); }

@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-2, .span-3, .span-4, .span-6 { grid-column: span 2; }
  .split, .studio { grid-template-columns: 1fr; }
  .sticky { position: static; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 50; width: var(--side-w); transform: translateX(-105%); transition: transform var(--dur-3) var(--ease); background: var(--card); }
  .side.open { transform: none; box-shadow: var(--shadow-lg); }
  .topbar { display: flex; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--glass); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 40; font: 700 16px var(--font-head); }
  .topbar .grow { flex: 1; }
  .g2, .g3, .g4, .bento { grid-template-columns: 1fr; }
  .span-2, .span-3, .span-4, .span-6 { grid-column: auto; }
  main { padding: 20px 16px 80px; }
  .frame { height: 480px; }
  .kanban { grid-template-columns: repeat(4, 240px); }
  .kv { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
}
