:root {
  --bg: oklch(99% 0.002 240);
  --surface: oklch(100% 0 0);
  --surface-soft: oklch(97% 0.008 240);
  --fg: oklch(18% 0.012 250);
  --muted: oklch(54% 0.012 250);
  --border: oklch(92% 0.005 250);
  --accent: oklch(58% 0.18 255);
  --domain: oklch(70% 0.15 194);
  --warm: oklch(72% 0.15 42);
  --success: oklch(58% 0.14 155);
  --warning: oklch(70% 0.15 75);
  --danger: oklch(58% 0.18 25);
  --ink-deep: oklch(22% 0.022 250);
  --font-display: "Avenir Next", "Segoe UI", "PingFang SC", system-ui, sans-serif;
  --font-body: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  --font-mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", ui-monospace, monospace;
  --sidebar-width: 272px;
  --topbar-height: 76px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-soft: 0 16px 50px oklch(24% 0.03 250 / 0.08);
  --shadow-float: 0 24px 70px oklch(24% 0.03 250 / 0.14);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--fg);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body, button, input, textarea, select { font-family: var(--font-body); }
button, input, textarea, select { font-size: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
textarea { resize: vertical; }
::selection { color: var(--surface); background: var(--accent); }
[hidden] { display: none !important; }

.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;
}
.icon { width: 18px; height: 18px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }

.brand-lockup { display: inline-flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  overflow: hidden;
  color: var(--surface);
  background: var(--ink-deep);
  border-radius: 11px;
  box-shadow: 0 6px 16px oklch(22% 0.02 250 / 0.16);
}
.brand-mark::after { content: ""; position: absolute; inset: 7px; border: 1px solid oklch(100% 0 0 / 0.35); border-radius: 7px; transform: rotate(12deg); }
.brand-mark svg { position: relative; z-index: 1; width: 19px; height: 19px; }
.brand-copy { display: grid; gap: 1px; min-width: 0; }
.brand-copy strong { font: 650 14px/1.2 var(--font-display); letter-spacing: -0.012em; white-space: nowrap; }
.brand-copy small { color: var(--muted); font-size: 11px; line-height: 1.2; white-space: nowrap; }

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  line-height: 1.4;
}
.eyebrow strong { color: var(--fg); font-weight: 600; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.section-heading h2, .section-heading h3 { margin: 6px 0 0; font: 650 24px/1.15 var(--font-display); letter-spacing: -0.02em; }
.section-heading a { color: var(--muted); font-size: 13px; font-weight: 550; }
.section-heading a:hover { color: var(--fg); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(1px); }
.button:focus-visible, .icon-button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, .side-nav-link:focus-visible { outline: 3px solid oklch(58% 0.18 255 / 0.22); outline-offset: 2px; }
.button-primary { color: var(--surface); background: var(--accent); box-shadow: 0 12px 24px oklch(58% 0.18 255 / 0.22); }
.button-primary:hover { background: oklch(52% 0.18 255); box-shadow: 0 16px 28px oklch(58% 0.18 255 / 0.28); }
.button-secondary { color: var(--fg); background: var(--surface); border-color: var(--border); }
.button-secondary:hover { border-color: oklch(58% 0.18 255 / 0.35); background: var(--surface-soft); }
.button-ghost { color: var(--surface); background: oklch(100% 0 0 / 0.08); border-color: oklch(100% 0 0 / 0.18); }
.button-ghost:hover { background: oklch(100% 0 0 / 0.14); }
.button-block { width: 100%; }
.button[disabled] { cursor: wait; opacity: 0.68; transform: none; }
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 11px;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}
.icon-button:hover { color: var(--fg); background: var(--surface-soft); border-color: var(--border); }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; color: var(--muted); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 999px; font-size: 12px; }
.chip-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--domain); }

/* Shared application shell */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); transition: grid-template-columns 180ms ease; }
.app-shell.is-collapsed { grid-template-columns: 84px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; z-index: 20; display: flex; flex-direction: column; width: 100%; height: 100vh; padding: 18px 14px 16px; color: oklch(92% 0.008 250); background: var(--ink-deep); overflow: hidden; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px 22px; }
.sidebar .brand-lockup { color: oklch(96% 0.008 250); min-width: 0; }
.sidebar .brand-copy strong { color: inherit; }
.sidebar .brand-copy small { color: oklch(72% 0.015 250); }
.sidebar .brand-mark { background: oklch(100% 0 0 / 0.12); box-shadow: none; }
.sidebar .brand-mark::after { border-color: oklch(100% 0 0 / 0.25); }
.sidebar .icon-button { color: oklch(72% 0.015 250); }
.sidebar .icon-button:hover { color: oklch(100% 0 0); background: oklch(100% 0 0 / 0.08); border-color: oklch(100% 0 0 / 0.08); }
.sidebar-label { display: block; padding: 0 10px 8px; color: oklch(64% 0.018 250); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; }
.sidebar-section + .sidebar-section { margin-top: 22px; padding-top: 20px; border-top: 1px solid oklch(100% 0 0 / 0.09); }
.side-nav { display: grid; gap: 3px; }
.side-nav-link { display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 0 10px; color: oklch(78% 0.012 250); border-radius: 11px; font-size: 13px; font-weight: 550; white-space: nowrap; transition: color 160ms ease, background 160ms ease, transform 160ms ease; }
.side-nav-link .icon { color: oklch(62% 0.018 250); }
.side-nav-link:hover { color: oklch(100% 0 0); background: oklch(100% 0 0 / 0.07); transform: translateX(1px); }
.side-nav-link[aria-current="page"] { color: oklch(100% 0 0); background: oklch(64% 0.12 245 / 0.34); }
.side-nav-link[aria-current="page"] .icon { color: oklch(78% 0.15 230); }
.sidebar-footer { margin-top: auto; display: grid; gap: 11px; padding: 16px 10px 0; color: oklch(72% 0.014 250); border-top: 1px solid oklch(100% 0 0 / 0.09); font-size: 12px; }
.usage-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.usage-line strong { color: oklch(92% 0.008 250); font-weight: 600; }
.usage-bar { height: 4px; overflow: hidden; background: oklch(100% 0 0 / 0.1); border-radius: 999px; }
.usage-bar span { display: block; width: 42%; height: 100%; background: var(--domain); border-radius: inherit; }
.sidebar-collapsed .sidebar-label, .sidebar-collapsed .sidebar-footer, .app-shell.is-collapsed .brand-copy { display: none; }
.app-shell.is-collapsed .sidebar-head { justify-content: center; }
.app-shell.is-collapsed .side-nav-link { justify-content: center; padding: 0; }
.app-shell.is-collapsed .side-nav-link span { display: none; }
.app-shell.is-collapsed .sidebar-section + .sidebar-section { margin-top: 16px; padding-top: 16px; }
.content-frame { min-width: 0; min-height: 100vh; background: var(--bg); }
.topbar { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: 20px; height: var(--topbar-height); padding: 0 clamp(20px, 3vw, 48px); background: oklch(99% 0.002 240 / 0.88); border-bottom: 1px solid var(--border); backdrop-filter: blur(16px); }
.mobile-brand { display: none; }
.breadcrumb { display: flex; align-items: center; gap: 9px; min-width: 0; color: var(--muted); font-size: 13px; }
.breadcrumb strong { color: var(--fg); font-weight: 650; }
.breadcrumb .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--domain); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar .button { min-height: 38px; padding-inline: 13px; font-size: 13px; }
.user-menu { position: relative; }
.user-button { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 4px 8px 4px 5px; color: var(--fg); background: transparent; border-radius: 12px; }
.user-button:hover { background: var(--surface-soft); }
.user-avatar { display: grid; place-items: center; width: 32px; height: 32px; color: var(--surface); background: var(--accent); border-radius: 10px; font-size: 12px; font-weight: 700; }
.user-meta { display: grid; gap: 1px; text-align: left; }
.user-meta strong { font-size: 13px; line-height: 1.2; }
.user-meta small { color: var(--muted); font-size: 10px; }
.user-button .icon { width: 14px; height: 14px; color: var(--muted); }
.user-popover { position: absolute; top: calc(100% + 10px); right: 0; z-index: 40; width: 220px; padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-float); }
.user-popover-head { padding: 10px 11px 12px; border-bottom: 1px solid var(--border); }
.user-popover-head strong { display: block; font-size: 13px; }
.user-popover-head small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.user-popover a, .user-popover button { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 38px; padding: 0 10px; color: var(--muted); background: transparent; border-radius: 9px; font-size: 13px; text-align: left; }
.user-popover a:hover, .user-popover button:hover { color: var(--fg); background: var(--surface-soft); }

/* Launcher */
.launcher-page { background: var(--surface-soft); }
.launcher-nav { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 76px; padding: 0 clamp(22px, 5vw, 88px); background: oklch(100% 0 0 / 0.78); border-bottom: 1px solid var(--border); backdrop-filter: blur(14px); }
.launcher-nav .brand-mark { background: var(--accent); }
.launcher-nav .brand-mark::after { border-color: oklch(100% 0 0 / 0.32); }
.meta-chip { display: inline-flex; align-items: center; min-height: 30px; padding: 0 11px; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; font-size: 12px; }
.launcher-main { width: min(1180px, calc(100% - 44px)); margin: 0 auto; padding: 64px 0 80px; }
.launcher-hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(330px, 0.95fr); gap: 56px; align-items: center; padding: 28px 0 76px; }
.launcher-hero h1 { max-width: 700px; margin: 14px 0 18px; font: 650 clamp(42px, 6vw, 76px)/1.06 var(--font-display); letter-spacing: -0.045em; text-wrap: pretty; }
.launcher-hero h1 span { color: var(--accent); }
.launcher-hero p { max-width: 600px; margin: 0; color: var(--muted); font-size: 17px; line-height: 1.75; }
.launcher-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.launcher-visual { position: relative; min-height: 380px; overflow: hidden; padding: 24px; background: var(--ink-deep); border-radius: 30px; box-shadow: var(--shadow-float); }
.launcher-visual::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 82% 15%, oklch(70% 0.15 194 / 0.25), transparent 34%), linear-gradient(138deg, oklch(100% 0 0 / 0.04), transparent 56%); }
.visual-window { position: relative; z-index: 1; height: 330px; padding: 15px; background: oklch(100% 0 0 / 0.09); border: 1px solid oklch(100% 0 0 / 0.15); border-radius: 20px; transform: rotate(-3deg); }
.visual-window-top { display: flex; gap: 5px; padding-bottom: 14px; }
.visual-window-top span { width: 7px; height: 7px; border-radius: 50%; background: oklch(100% 0 0 / 0.36); }
.visual-window-body { display: grid; grid-template-columns: 78px 1fr; gap: 12px; height: calc(100% - 28px); }
.visual-window-side { display: grid; align-content: start; gap: 8px; padding: 10px 8px; background: oklch(100% 0 0 / 0.07); border-radius: 12px; }
.visual-window-side i { display: block; width: 100%; height: 7px; background: oklch(100% 0 0 / 0.22); border-radius: 99px; }
.visual-window-side i:nth-child(2) { width: 76%; }
.visual-window-side i:nth-child(3) { width: 88%; }
.visual-window-main { display: grid; grid-template-columns: 1.1fr .9fr; gap: 10px; }
.visual-tile { position: relative; overflow: hidden; min-height: 100%; background: linear-gradient(150deg, oklch(70% 0.15 194 / 0.8), oklch(56% 0.18 255 / 0.85)); border-radius: 14px; }
.visual-tile::after { content: ""; position: absolute; right: -20%; bottom: -26%; width: 70%; aspect-ratio: 1; background: oklch(100% 0 0 / 0.16); border-radius: 50%; }
.visual-stack { display: grid; gap: 10px; }
.visual-stack i { display: block; min-height: 80px; background: oklch(100% 0 0 / 0.14); border-radius: 14px; }
.visual-tag { position: absolute; right: 18px; bottom: 16px; z-index: 2; display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; color: oklch(96% 0.008 250); background: oklch(0% 0 0 / 0.26); border: 1px solid oklch(100% 0 0 / 0.16); border-radius: 999px; font: 11px/1 var(--font-mono); }
.visual-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--domain); box-shadow: 0 0 0 4px oklch(70% 0.15 194 / 0.18); }
.prototype-index { padding-top: 8px; }
.prototype-index .section-heading { margin-bottom: 20px; }
.prototype-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.prototype-card { display: flex; flex-direction: column; min-height: 250px; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 6px 24px oklch(24% 0.03 250 / 0.03); transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease; }
.prototype-card:hover { transform: translateY(-4px); border-color: oklch(58% 0.18 255 / 0.35); box-shadow: var(--shadow-soft); }
.prototype-card .card-index { color: var(--muted); font: 11px/1 var(--font-mono); }
.prototype-card h2 { margin: 42px 0 8px; font: 650 22px/1.15 var(--font-display); letter-spacing: -0.02em; }
.prototype-card p { max-width: 32ch; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.prototype-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 28px; color: var(--muted); font-size: 12px; }
.prototype-card-footer strong { color: var(--fg); font-weight: 600; }

/* Login */
.auth-page { background: var(--ink-deep); }
.auth-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(460px, 0.82fr); min-height: 100vh; }
.auth-visual { position: relative; display: flex; flex-direction: column; min-height: 100vh; padding: clamp(28px, 5vw, 70px); color: oklch(96% 0.008 250); overflow: hidden; }
.auth-visual::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 15% 18%, oklch(70% 0.15 194 / 0.2), transparent 30%), radial-gradient(circle at 82% 75%, oklch(58% 0.18 255 / 0.22), transparent 34%); pointer-events: none; }
.auth-visual > * { position: relative; z-index: 1; }
.auth-visual .brand-mark { background: oklch(100% 0 0 / 0.11); }
.auth-visual .brand-copy strong { color: oklch(96% 0.008 250); }
.auth-visual .brand-copy small { color: oklch(72% 0.015 250); }
.auth-copy { margin: auto 0; max-width: 640px; padding: 64px 0 42px; }
.auth-copy .eyebrow { color: oklch(74% 0.02 250); }
.auth-copy h1 { margin: 16px 0 22px; font: 650 clamp(42px, 6vw, 82px)/1.04 var(--font-display); letter-spacing: -0.05em; text-wrap: pretty; }
.auth-copy h1 em { color: oklch(78% 0.16 194); font-style: normal; }
.auth-copy .auth-tagline { max-width: 28ch; margin: 0; color: oklch(76% 0.014 250); font-size: 16px; line-height: 1.75; }
.auth-artboard { position: relative; height: 240px; margin-top: 12px; padding: 18px; background: oklch(100% 0 0 / 0.07); border: 1px solid oklch(100% 0 0 / 0.13); border-radius: 24px; overflow: hidden; }
.auth-artboard::before { content: ""; position: absolute; inset: 0; background: linear-gradient(125deg, transparent 12%, oklch(70% 0.15 194 / 0.15) 45%, transparent 75%); transform: translateX(-26%); }
.artboard-top { display: flex; justify-content: space-between; align-items: center; position: relative; z-index: 1; color: oklch(78% 0.014 250); font: 10px/1 var(--font-mono); letter-spacing: 0.08em; }
.artboard-dots { display: flex; gap: 5px; }
.artboard-dots i { width: 6px; height: 6px; border-radius: 50%; background: oklch(100% 0 0 / 0.35); }
.artboard-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.2fr .8fr; gap: 12px; height: 172px; margin-top: 16px; }
.artboard-main { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 7px; overflow: hidden; background: linear-gradient(145deg, oklch(70% 0.15 194 / 0.85), oklch(56% 0.18 255 / 0.75)); border-radius: 16px; }
.artboard-main::before { content: ""; position: absolute; left: 15%; bottom: -32%; width: 46%; aspect-ratio: 1; background: oklch(100% 0 0 / 0.2); border-radius: 50%; }
.artboard-main::after { content: ""; position: absolute; right: 10%; top: 18%; width: 32%; height: 46%; border: 1px solid oklch(100% 0 0 / 0.34); border-radius: 50% 50% 44% 44%; transform: rotate(24deg); }
.ai-core { position: relative; z-index: 1; display: grid; place-items: center; width: 58px; height: 58px; color: oklch(98% 0.008 250); border: 1px solid oklch(100% 0 0 / 0.46); border-radius: 50%; font: 650 18px/1 var(--font-display); letter-spacing: -0.04em; background: oklch(100% 0 0 / 0.13); box-shadow: 0 0 0 10px oklch(100% 0 0 / 0.05); }
.ai-core-caption { position: relative; z-index: 1; color: oklch(92% 0.008 250); font: 10px/1 var(--font-mono); letter-spacing: 0.05em; }
.artboard-side { display: grid; grid-template-rows: 1fr 1fr; gap: 12px; }
.artboard-side i { display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; padding: 13px; color: oklch(94% 0.008 250); background: oklch(100% 0 0 / 0.12); border-radius: 16px; font-style: normal; }
.artboard-side strong { font: 600 13px/1.2 var(--font-display); }
.artboard-side small { color: oklch(74% 0.014 250); font-size: 10px; }
.artboard-caption { position: absolute; right: 18px; bottom: 16px; z-index: 2; color: oklch(88% 0.012 250); font-size: 11px; }
.auth-footer { color: oklch(62% 0.014 250); font-size: 12px; }
.auth-panel { display: grid; grid-template-rows: auto 1fr; min-height: 100vh; padding: 30px clamp(28px, 6vw, 100px); background: var(--surface); }
.auth-panel-top { display: flex; justify-content: flex-end; gap: 18px; color: var(--muted); font-size: 12px; }
.auth-panel-top a { color: var(--fg); font-weight: 600; }
.auth-panel-top a:hover { color: var(--accent); }
.auth-form-wrap { align-self: center; width: min(100%, 420px); margin: 0 auto; padding: 44px 0; }
.auth-form-wrap h2 { margin: 0 0 30px; font: 650 36px/1.1 var(--font-display); letter-spacing: -0.035em; }
.auth-intro { margin: 0 0 30px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.auth-form { display: grid; gap: 18px; }
.field { display: grid; gap: 8px; }
.field-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--fg); font-size: 13px; font-weight: 600; }
.field-label .inline-action { padding: 0; color: var(--muted); background: transparent; font-size: 12px; font-weight: 500; }
.field-label .inline-action:hover { color: var(--fg); }
.field input, .field textarea, .field select { width: 100%; min-height: 48px; padding: 0 14px; color: var(--fg); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease; }
.field textarea { min-height: 120px; padding-block: 13px; line-height: 1.65; }
.field input::placeholder, .field textarea::placeholder { color: oklch(70% 0.01 250); }
.field input:hover, .field textarea:hover, .field select:hover { border-color: oklch(60% 0.02 250); }
.field input:focus, .field textarea:focus, .field select:focus { border-color: oklch(58% 0.18 255 / 0.6); box-shadow: 0 0 0 4px oklch(58% 0.18 255 / 0.1); outline: none; }
.input-with-action { position: relative; }
.input-with-action input { padding-right: 48px; }
.input-with-action button { position: absolute; top: 50%; right: 10px; display: grid; place-items: center; width: 30px; height: 30px; color: var(--muted); background: transparent; border-radius: 8px; transform: translateY(-50%); }
.input-with-action button:hover { color: var(--fg); background: var(--surface-soft); }
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 12px; }
.check-control { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check-control input { width: 16px; height: 16px; accent-color: var(--accent); }
.form-row a { color: var(--muted); }
.form-row a:hover { color: var(--fg); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: var(--border); }
.legal-copy { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; text-align: center; }
.legal-copy a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.auth-note { display: flex; gap: 10px; margin-top: 26px; padding: 13px 14px; color: var(--muted); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 12px; font-size: 12px; line-height: 1.55; }
.auth-note .icon { color: var(--domain); margin-top: 1px; }

/* Home */
.home-content, .tool-page { width: min(1500px, calc(100% - 56px)); margin: 0 auto; padding: 42px 0 72px; }
.home-hero { position: relative; display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr); gap: 34px; min-height: 390px; padding: clamp(28px, 4vw, 54px); color: oklch(96% 0.008 250); background: var(--ink-deep); border-radius: 26px; overflow: hidden; box-shadow: var(--shadow-soft); }
.home-hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 88% 12%, oklch(70% 0.15 194 / 0.24), transparent 32%), radial-gradient(circle at 42% 100%, oklch(58% 0.18 255 / 0.19), transparent 38%); pointer-events: none; }
.home-hero > * { position: relative; z-index: 1; }
.home-hero-copy { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.home-hero .eyebrow { color: oklch(74% 0.02 250); }
.home-hero h1 { max-width: 560px; margin: 16px 0 18px; font: 650 clamp(38px, 5vw, 70px)/1.04 var(--font-display); letter-spacing: -0.05em; text-wrap: pretty; }
.home-hero h1 span { color: oklch(78% 0.16 194); }
.home-hero p { max-width: 48ch; margin: 0; color: oklch(76% 0.014 250); font-size: 15px; line-height: 1.75; }
.home-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.home-status { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 26px; color: oklch(72% 0.014 250); font-size: 12px; }
.home-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--domain); box-shadow: 0 0 0 5px oklch(70% 0.15 194 / 0.13); }
.hero-visual { position: relative; min-height: 300px; align-self: center; }
.hero-board { position: absolute; inset: 12px 5px 12px 30px; padding: 18px; background: oklch(100% 0 0 / 0.08); border: 1px solid oklch(100% 0 0 / 0.15); border-radius: 20px; transform: rotate(3.4deg); }
.hero-board-top { display: flex; justify-content: space-between; color: oklch(76% 0.014 250); font: 10px/1 var(--font-mono); }
.hero-board-top span:last-child { color: oklch(78% 0.16 194); }
.hero-board-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 10px; height: 245px; margin-top: 16px; }
.hero-art { position: relative; overflow: hidden; background: linear-gradient(148deg, oklch(70% 0.15 194 / 0.82), oklch(56% 0.18 255 / 0.9)); border-radius: 15px; }
.hero-art::before { content: ""; position: absolute; left: 10%; bottom: -24%; width: 68%; aspect-ratio: 1; background: oklch(100% 0 0 / 0.14); border-radius: 50%; }
.hero-art::after { content: ""; position: absolute; right: 18%; top: 22%; width: 28%; height: 44%; border: 1px solid oklch(100% 0 0 / 0.32); border-radius: 50% 50% 44% 44%; transform: rotate(20deg); }
.hero-side { display: grid; gap: 10px; }
.hero-side-card { position: relative; overflow: hidden; min-height: 0; padding: 13px; background: oklch(100% 0 0 / 0.1); border-radius: 15px; }
.hero-side-card::after { content: ""; position: absolute; right: -18%; bottom: -32%; width: 65%; aspect-ratio: 1; background: oklch(70% 0.15 194 / 0.22); border-radius: 50%; }
.hero-side-card strong { position: relative; z-index: 1; display: block; color: oklch(92% 0.008 250); font-size: 12px; }
.hero-side-card small { position: relative; z-index: 1; display: block; margin-top: 5px; color: oklch(72% 0.014 250); font-size: 10px; }
.hero-float { position: absolute; right: -2px; bottom: 12px; display: inline-flex; align-items: center; gap: 8px; padding: 10px 12px; color: var(--fg); background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-float); font-size: 12px; font-weight: 600; transform: rotate(-2deg); }
.hero-float .icon { color: var(--domain); }
.home-section { margin-top: 54px; }
.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.quick-card { display: flex; flex-direction: column; min-height: 168px; padding: 17px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease; }
.quick-card:hover { transform: translateY(-3px); border-color: oklch(58% 0.18 255 / 0.28); box-shadow: var(--shadow-soft); }
.quick-icon { display: grid; place-items: center; width: 34px; height: 34px; color: var(--domain); background: oklch(70% 0.15 194 / 0.12); border-radius: 10px; }
.quick-card:nth-child(2) .quick-icon { color: var(--warm); background: oklch(72% 0.15 42 / 0.12); }
.quick-card:nth-child(3) .quick-icon { color: var(--accent); background: oklch(58% 0.18 255 / 0.11); }
.quick-card:nth-child(4) .quick-icon { color: var(--success); background: oklch(58% 0.14 155 / 0.11); }
.quick-card h3 { margin: 18px 0 6px; font: 600 16px/1.2 var(--font-display); letter-spacing: -0.015em; }
.quick-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.quick-card .quick-arrow { display: flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 18px; color: var(--muted); font-size: 12px; }
.quick-card:hover .quick-arrow { color: var(--fg); }
.recent-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr); gap: 16px; }
.recent-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.recent-card { overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.recent-preview { position: relative; height: 152px; overflow: hidden; background: var(--surface-soft); }
.recent-preview::before, .recent-preview::after { content: ""; position: absolute; border-radius: 50%; }
.recent-preview::before { width: 150px; height: 150px; left: -30px; top: 42px; background: oklch(70% 0.15 194 / 0.48); }
.recent-preview::after { width: 170px; height: 170px; right: -34px; top: -72px; background: oklch(58% 0.18 255 / 0.5); }
.recent-preview.warm::before { background: oklch(72% 0.15 42 / 0.58); }
.recent-preview.warm::after { background: oklch(58% 0.18 255 / 0.36); }
.recent-preview.dark { background: oklch(26% 0.03 250); }
.recent-preview.dark::before { left: 23%; top: 28px; width: 110px; height: 110px; background: oklch(70% 0.15 194 / 0.56); }
.recent-preview.dark::after { right: 18%; top: 18px; width: 90px; height: 90px; background: oklch(100% 0 0 / 0.15); }
.preview-label { position: absolute; left: 13px; bottom: 12px; z-index: 1; padding: 5px 7px; color: oklch(96% 0.008 250); background: oklch(22% 0.022 250 / 0.35); border: 1px solid oklch(100% 0 0 / 0.16); border-radius: 7px; font: 10px/1 var(--font-mono); }
.recent-body { padding: 14px 15px 16px; }
.recent-body h3 { margin: 0; font: 600 14px/1.3 var(--font-display); }
.recent-body p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.prompt-draft { padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.prompt-draft-head { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.prompt-draft h3 { margin: 5px 0 0; font: 600 17px/1.2 var(--font-display); }
.prompt-draft .icon-button { margin-top: -4px; }
.draft-copy { margin: 22px 0 24px; color: var(--muted); font-size: 13px; line-height: 1.75; }
.draft-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
.draft-footer .mono { color: var(--fg); font-size: 10px; }

/* Tool shell */
.tool-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.tool-heading h1 { margin: 7px 0 0; font: 650 34px/1.1 var(--font-display); letter-spacing: -0.035em; }
.tool-heading p { max-width: 52ch; margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.tool-heading-actions { display: flex; gap: 8px; }
.tool-heading-actions .button { min-height: 38px; padding-inline: 12px; font-size: 12px; }
.mode-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.mode-tab { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 12px; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 999px; font-size: 12px; font-weight: 550; }
.mode-tab:hover { color: var(--fg); background: var(--surface); border-color: var(--border); }
.mode-tab[aria-current="page"] { color: var(--fg); background: var(--surface); border-color: var(--border); box-shadow: 0 4px 14px oklch(24% 0.03 250 / 0.05); }
.mode-tab .icon { width: 15px; height: 15px; }
.workbench-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(350px, .88fr); gap: 16px; align-items: start; }
.tool-stage, .composer-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; }
.tool-stage { min-height: 640px; padding: 18px; }
.stage-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 2px 4px 17px; border-bottom: 1px solid var(--border); }
.stage-status { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.stage-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px oklch(58% 0.14 155 / 0.12); }
.stage-toolbar .button { min-height: 34px; padding-inline: 11px; font-size: 12px; }
.result-card { position: relative; display: grid; grid-template-columns: minmax(260px, .8fr) minmax(0, 1fr); gap: 22px; margin-top: 18px; padding: 16px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 16px; }
.result-image { position: relative; min-height: 310px; overflow: hidden; background: linear-gradient(148deg, oklch(73% 0.14 194), oklch(57% 0.18 255)); border-radius: 13px; }
.result-image::before { content: ""; position: absolute; left: 8%; bottom: -22%; width: 74%; aspect-ratio: 1; background: oklch(100% 0 0 / 0.2); border-radius: 50%; }
.result-image::after { content: ""; position: absolute; left: 44%; top: 22%; width: 20%; height: 46%; background: oklch(22% 0.022 250 / 0.55); border-radius: 46% 46% 37% 37%; transform: rotate(12deg); box-shadow: 24px 35px 0 -10px oklch(22% 0.022 250 / 0.55); }
.result-image .image-stamp { position: absolute; top: 13px; left: 13px; z-index: 1; padding: 6px 8px; color: oklch(96% 0.008 250); background: oklch(22% 0.022 250 / 0.28); border: 1px solid oklch(100% 0 0 / 0.16); border-radius: 7px; font: 10px/1 var(--font-mono); }
.result-meta { display: flex; flex-direction: column; min-width: 0; padding: 4px 4px 2px 0; }
.result-meta h2 { margin: 7px 0 10px; font: 600 19px/1.25 var(--font-display); letter-spacing: -0.02em; }
.result-meta p { max-width: 42ch; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.75; }
.result-meta-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 24px; color: var(--muted); font-size: 11px; }
.result-actions { display: flex; gap: 7px; }
.result-actions .icon-button { width: 34px; height: 34px; background: var(--surface); border-color: var(--border); }
.history-section { margin-top: 22px; }
.history-section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
.history-section-head h2 { margin: 0; font: 600 16px/1.2 var(--font-display); }
.history-section-head span { color: var(--muted); font-size: 11px; }
.history-list { display: grid; gap: 8px; }
.history-item { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 11px; align-items: center; padding: 9px 10px; border: 1px solid transparent; border-radius: 11px; }
.history-item:hover { background: var(--surface-soft); border-color: var(--border); }
.history-thumb { width: 48px; height: 48px; overflow: hidden; background: linear-gradient(145deg, oklch(70% 0.15 194 / 0.7), oklch(58% 0.18 255 / 0.8)); border-radius: 9px; }
.history-thumb.warm { background: linear-gradient(145deg, oklch(72% 0.15 42 / 0.72), oklch(58% 0.18 255 / 0.72)); }
.history-copy { min-width: 0; }
.history-copy strong { display: block; overflow: hidden; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.history-copy small { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.history-time { color: var(--muted); font: 10px/1 var(--font-mono); }
.composer-panel { position: sticky; top: calc(var(--topbar-height) + 20px); padding: 20px; }
.composer-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.composer-head h2 { margin: 6px 0 0; font: 600 20px/1.2 var(--font-display); letter-spacing: -0.02em; }
.composer-head .chip { color: var(--success); background: oklch(58% 0.14 155 / 0.08); border-color: oklch(58% 0.14 155 / 0.16); }
.composer-form { display: grid; gap: 16px; }
.prompt-field { position: relative; }
.prompt-field textarea { min-height: 180px; padding: 14px 15px 38px; }
.prompt-counter { position: absolute; right: 13px; bottom: 11px; color: var(--muted); font: 10px/1 var(--font-mono); }
.assistant-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.assistant-row span { color: var(--muted); font-size: 12px; }
.assistant-row button { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 10px; color: var(--fg); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 9px; font-size: 12px; font-weight: 550; }
.assistant-row button:hover { border-color: oklch(58% 0.18 255 / 0.32); }
.control-grid { display: grid; grid-template-columns: 1.3fr .8fr .8fr; gap: 8px; }
.control-field { display: grid; gap: 6px; }
.control-field span { color: var(--muted); font: 10px/1.3 var(--font-mono); }
.control-field select { min-height: 40px; padding: 0 10px; color: var(--fg); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; font-size: 11px; }
.composer-submit { width: 100%; }
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; }
.composer-foot .mono { color: var(--fg); font-size: 10px; }

/* Visual asset task pages */
.cutout-layout, .metadata-layout { display: grid; grid-template-columns: minmax(0, 1.06fr) minmax(360px, .94fr); gap: 16px; align-items: start; }
.asset-panel { min-width: 0; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: 0 10px 30px oklch(24% 0.03 250 / 0.035); }
.asset-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.asset-panel-head h2 { margin: 6px 0 7px; font: 600 20px/1.2 var(--font-display); letter-spacing: -0.02em; }
.asset-panel-head p:not(.eyebrow) { max-width: 42ch; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.asset-status { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; min-height: 28px; padding: 0 9px; color: var(--muted); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 999px; font: 10px/1 var(--font-mono); white-space: nowrap; }
.asset-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.asset-status.status-processing { color: var(--accent); background: oklch(58% 0.18 255 / 0.07); border-color: oklch(58% 0.18 255 / 0.16); }
.asset-status.status-processing::before { background: var(--accent); }
.asset-status.status-success { color: var(--success); background: oklch(58% 0.14 155 / 0.08); border-color: oklch(58% 0.14 155 / 0.16); }
.asset-status.status-success::before { background: var(--success); }
.asset-status.status-warning { color: var(--warning); background: oklch(70% 0.15 75 / 0.1); border-color: oklch(70% 0.15 75 / 0.2); }
.asset-status.status-warning::before { background: var(--warning); }
.dropzone { position: relative; display: grid; justify-items: center; min-height: 218px; margin-top: 18px; padding: 24px; text-align: center; background: var(--surface-soft); border: 1px dashed oklch(54% 0.012 250 / 0.32); border-radius: 16px; transition: border-color 160ms ease, background 160ms ease, transform 160ms ease; }
.dropzone:hover, .dropzone.is-dragover { background: oklch(58% 0.18 255 / 0.045); border-color: oklch(58% 0.18 255 / 0.58); }
.dropzone.is-dragover { transform: translateY(-2px); }
.drop-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 12px; color: var(--accent); background: oklch(58% 0.18 255 / 0.1); border: 1px solid oklch(58% 0.18 255 / 0.16); border-radius: 14px; }
.dropzone h3 { margin: 0; font: 600 17px/1.2 var(--font-display); letter-spacing: -0.015em; }
.dropzone p { margin: 7px 0 14px; color: var(--muted); font-size: 12px; }
.dropzone .button { min-height: 36px; font-size: 12px; }
.drop-hint { margin-top: 12px; color: var(--muted); font: 10px/1 var(--font-mono); letter-spacing: .04em; }
.asset-list-section { margin-top: 22px; }
.asset-list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.asset-list-head h2 { margin: 0; font: 600 14px/1.2 var(--font-display); }
.asset-list-head span { color: var(--muted); font: 10px/1 var(--font-mono); }
.asset-file-list { display: grid; gap: 7px; }
.empty-file-state { display: grid; place-items: center; min-height: 74px; color: var(--muted); background: var(--surface-soft); border: 1px dashed var(--border); border-radius: 12px; font-size: 12px; }
.asset-file-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-width: 0; padding: 8px; border: 1px solid transparent; border-radius: 11px; }
.asset-file-row:hover { background: var(--surface-soft); border-color: var(--border); }
.file-thumb { width: 38px; height: 38px; overflow: hidden; background: linear-gradient(145deg, oklch(70% 0.15 194 / .72), oklch(58% 0.18 255 / .8)); border-radius: 9px; }
.file-thumb-1 { background: linear-gradient(145deg, oklch(72% 0.15 42 / .7), oklch(58% 0.18 255 / .8)); }
.file-thumb-2 { background: linear-gradient(145deg, oklch(66% 0.1 155 / .7), oklch(58% 0.18 255 / .76)); }
.file-info { min-width: 0; }
.file-info strong, .file-info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-info strong { font-size: 12px; font-weight: 600; }
.file-info small { margin-top: 3px; color: var(--muted); font: 10px/1.2 var(--font-mono); }
.file-state { color: var(--muted); font-size: 10px; white-space: nowrap; }
.asset-file-row[data-state="processing"] .file-state { color: var(--accent); }
.asset-file-row[data-state="done"] .file-state { color: var(--success); }
.asset-file-row[data-state="warning"] .file-state { color: var(--warning); }
.asset-panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; padding-top: 14px; color: var(--muted); border-top: 1px solid var(--border); font-size: 11px; }
.asset-panel-foot .button { min-height: 32px; padding-inline: 10px; font-size: 11px; }
.cutout-preview-shell { margin-top: 18px; padding: 10px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 16px; }
.cutout-preview { display: grid; place-items: center; min-height: 364px; overflow: hidden; background-color: oklch(97% 0.008 240); background-image: linear-gradient(45deg, oklch(92% 0.005 250) 25%, transparent 25%), linear-gradient(-45deg, oklch(92% 0.005 250) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, oklch(92% 0.005 250) 75%), linear-gradient(-45deg, transparent 75%, oklch(92% 0.005 250) 75%); background-position: 0 0, 0 11px, 11px -11px, -11px 0; background-size: 22px 22px; border-radius: 11px; }
.cutout-preview img { display: block; max-width: 92%; max-height: 340px; object-fit: contain; filter: drop-shadow(0 16px 24px oklch(24% 0.03 250 / .16)); }
.cutout-placeholder { display: grid; justify-items: center; color: var(--muted); text-align: center; }
.cutout-placeholder .drop-icon { margin-bottom: 12px; color: var(--muted); background: oklch(54% 0.012 250 / .08); border-color: oklch(54% 0.012 250 / .12); }
.cutout-placeholder strong { color: var(--fg); font-size: 13px; font-weight: 600; }
.cutout-placeholder small { margin-top: 5px; font-size: 11px; }
.preview-caption { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; color: var(--muted); font-size: 11px; }
.preview-caption .mono { color: var(--fg); font: 10px/1 var(--font-mono); }
.asset-action-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); gap: 8px; margin-top: 18px; }
.asset-action-row .button { width: 100%; }
.process-note, .metadata-trust-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 16px; padding: 11px 12px; color: var(--muted); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 11px; font-size: 11px; line-height: 1.55; }
.process-note .icon, .metadata-trust-note .icon { flex: 0 0 auto; margin-top: 1px; color: var(--domain); }
.task-history-panel, .metadata-log-panel { margin-top: 16px; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; }
.task-history-panel .history-section-head, .metadata-log-panel .history-section-head { margin-bottom: 14px; }
.task-history-panel .history-section-head h2, .metadata-log-panel .history-section-head h2 { margin-top: 5px; font-size: 18px; }
.task-history-panel .button, .metadata-log-panel .button { min-height: 32px; padding-inline: 10px; font-size: 11px; }
.task-history-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.task-history-item, .metadata-log-item { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-width: 0; padding: 9px; background: var(--surface-soft); border: 1px solid transparent; border-radius: 12px; }
.task-history-item:hover, .metadata-log-item:hover { border-color: var(--border); }
.task-history-item strong, .metadata-log-item strong { display: block; overflow: hidden; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.task-history-item small, .metadata-log-item small { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.cutout-thumb, .metadata-thumb { width: 42px; height: 42px; background: linear-gradient(145deg, oklch(70% 0.15 194 / .65), oklch(58% 0.18 255 / .82)); border-radius: 9px; }
.cutout-thumb.light, .metadata-thumb.light { background: linear-gradient(145deg, oklch(92% 0.01 95), oklch(70% 0.15 194 / .68)); }
.cutout-thumb.warm { background: linear-gradient(145deg, oklch(72% 0.15 42 / .72), oklch(58% 0.18 255 / .78)); }
.task-state { color: var(--muted); font: 10px/1 var(--font-mono); white-space: nowrap; }
.task-state-success { color: var(--success); }
.task-state-progress { color: var(--accent); }
.task-state-warning { color: var(--warning); }
.metadata-form { display: grid; gap: 14px; padding-top: 18px; }
.metadata-form .control-field { gap: 7px; }
.metadata-form .control-field > span { color: var(--muted); font: 10px/1.3 var(--font-mono); }
.metadata-form .control-field select { min-height: 44px; font-size: 12px; }
.metadata-form .field { gap: 7px; }
.metadata-form .field input { min-height: 44px; }
.metadata-apply-all { padding: 2px 0; color: var(--muted); font-size: 12px; }
.metadata-confirm { padding: 10px 11px; color: var(--fg); background: oklch(70% 0.15 75 / .07); border: 1px solid oklch(70% 0.15 75 / .16); border-radius: 10px; font-size: 11px; line-height: 1.5; }
.metadata-summary { padding: 13px 14px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 12px; }
.metadata-summary-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.metadata-summary-head strong { font-size: 12px; }
.metadata-summary-head span { color: var(--muted); font-size: 10px; text-align: right; }
.metadata-summary-grid { display: grid; grid-template-columns: 1fr auto; gap: 7px 14px; padding-top: 10px; color: var(--muted); font-size: 11px; }
.metadata-summary-grid strong { color: var(--fg); font-weight: 550; }
.metadata-submit { width: 100%; }
.metadata-progress { padding-top: 2px; }
.progress-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
.progress-line span:last-child { color: var(--fg); font: 10px/1 var(--font-mono); }
.progress-track { height: 5px; margin-top: 8px; overflow: hidden; background: var(--surface-soft); border-radius: 999px; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--accent); border-radius: inherit; transition: width 220ms ease; }
.metadata-result { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 11px 12px; background: oklch(58% 0.14 155 / .07); border: 1px solid oklch(58% 0.14 155 / .16); border-radius: 12px; }
.result-check { display: grid; place-items: center; width: 28px; height: 28px; color: var(--success); background: oklch(58% 0.14 155 / .12); border-radius: 50%; }
.metadata-result strong, .metadata-result small { display: block; }
.metadata-result strong { font-size: 11px; font-weight: 600; }
.metadata-result small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.metadata-result .button { min-height: 30px; padding-inline: 9px; font-size: 10px; }
.metadata-log-list { display: grid; gap: 8px; }

/* Toasts */
.toast-layer { position: fixed; right: 24px; bottom: 24px; z-index: 100; display: grid; gap: 9px; width: min(340px, calc(100vw - 48px)); pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 13px 14px; color: var(--fg); background: var(--surface); border: 1px solid var(--border); border-radius: 13px; box-shadow: var(--shadow-float); font-size: 12px; animation: toast-in 220ms ease both; pointer-events: auto; }
.toast .icon { color: var(--domain); margin-top: 1px; }
.toast.success .icon { color: var(--success); }
.toast.warning .icon { color: var(--warning); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1120px) {
  .home-hero { grid-template-columns: minmax(0, .92fr) minmax(360px, 1.08fr); }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .recent-layout { grid-template-columns: 1fr; }
  .prompt-draft { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; }
  .prompt-draft-head { display: block; }
  .prompt-draft .icon-button { display: none; }
  .draft-copy { margin: 0; }
  .draft-footer { display: grid; justify-items: end; }
  .workbench-grid { grid-template-columns: 1fr; }
  .composer-panel { position: static; }
}
@media (max-width: 900px) {
  .app-shell, .app-shell.is-collapsed { grid-template-columns: 84px minmax(0, 1fr); }
  .sidebar-label, .sidebar-footer, .app-shell .brand-copy, .side-nav-link span { display: none; }
  .sidebar-head { justify-content: center; }
  .side-nav-link { justify-content: center; padding: 0; }
  .sidebar-section + .sidebar-section { margin-top: 16px; padding-top: 16px; }
  .home-content, .tool-page { width: min(100% - 38px, 760px); padding-top: 32px; }
  .home-hero { grid-template-columns: 1fr; }
  .hero-visual { min-height: 280px; }
  .home-hero-copy { min-height: 300px; }
  .prototype-grid { grid-template-columns: 1fr; }
  .launcher-hero { grid-template-columns: 1fr; gap: 34px; }
  .launcher-visual { min-height: 330px; }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-visual { min-height: 640px; }
  .auth-panel { min-height: auto; padding-block: 32px; }
  .auth-form-wrap { padding-block: 42px; }
}
@media (max-width: 640px) {
  .launcher-nav { min-height: 66px; padding-inline: 18px; }
  .launcher-nav .meta-chip { display: none; }
  .launcher-main { width: min(100% - 32px, 520px); padding-top: 38px; }
  .launcher-hero { padding: 12px 0 52px; }
  .launcher-hero h1 { font-size: clamp(40px, 14vw, 62px); }
  .launcher-hero p { font-size: 15px; }
  .launcher-visual { min-height: 270px; padding: 16px; border-radius: 22px; }
  .visual-window { height: 236px; }
  .visual-window-body { height: calc(100% - 22px); grid-template-columns: 54px 1fr; }
  .visual-window-main { gap: 7px; }
  .visual-stack { gap: 7px; }
  .visual-stack i { min-height: 56px; }
  .topbar { height: 64px; padding-inline: 16px; }
  .topbar .breadcrumb { display: none; }
  .mobile-brand { display: inline-flex; }
  .mobile-brand .brand-mark { width: 30px; height: 30px; flex-basis: 30px; border-radius: 9px; background: var(--ink-deep); box-shadow: none; }
  .mobile-brand .brand-mark svg { width: 16px; height: 16px; }
  .mobile-brand .brand-copy strong { font-size: 12px; }
  .mobile-brand .brand-copy small { display: none; }
  .topbar-actions .button { display: none; }
  .user-meta { display: none; }
  .user-button { padding-right: 0; }
  .home-content, .tool-page { width: calc(100% - 28px); padding-top: 24px; }
  .home-hero { min-height: 0; padding: 26px 22px 24px; border-radius: 20px; }
  .home-hero-copy { min-height: 0; }
  .home-hero h1 { font-size: clamp(38px, 13vw, 58px); }
  .home-hero p { font-size: 13px; }
  .home-status { padding-top: 24px; }
  .hero-visual { min-height: 224px; }
  .hero-board { inset: 8px 0 8px 12px; padding: 12px; }
  .hero-board-grid { height: 178px; margin-top: 11px; }
  .hero-float { right: 4px; bottom: 0; font-size: 10px; }
  .section-heading { align-items: start; flex-direction: column; gap: 8px; }
  .section-heading h2 { font-size: 22px; }
  .quick-grid, .recent-grid { grid-template-columns: 1fr; }
  .quick-card { min-height: 144px; }
  .prompt-draft { display: block; }
  .prompt-draft .icon-button { display: inline-grid; }
  .draft-copy { margin: 20px 0; }
  .draft-footer { display: flex; }
  .tool-heading { align-items: start; flex-direction: column; margin-bottom: 20px; }
  .tool-heading h1 { font-size: 30px; }
  .tool-heading-actions { width: 100%; }
  .tool-heading-actions .button { flex: 1; }
  .mode-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 3px; }
  .mode-tab { flex: 0 0 auto; }
  .tool-stage { min-height: 0; padding: 12px; border-radius: 16px; }
  .result-card { grid-template-columns: 1fr; gap: 14px; padding: 12px; }
  .result-image { min-height: 260px; }
  .result-meta { padding: 2px 2px 3px; }
  .result-meta-footer { margin-top: 18px; }
  .composer-panel { padding: 16px; border-radius: 16px; }
  .control-grid { grid-template-columns: 1fr; }
  .auth-visual { min-height: 560px; padding: 26px 22px 24px; }
  .auth-copy { padding: 50px 0 25px; }
  .auth-copy h1 { font-size: clamp(42px, 14vw, 62px); }
  .auth-artboard { height: 190px; }
  .artboard-grid { height: 126px; }
  .auth-panel { padding: 22px; }
  .auth-form-wrap { padding-block: 34px; }
  .auth-form-wrap h2 { font-size: 31px; }
  .toast-layer { right: 14px; bottom: 14px; width: calc(100vw - 28px); }
}

@media (max-width: 1120px) {
  .cutout-layout, .metadata-layout { grid-template-columns: 1fr; }
  .cutout-result-panel, .metadata-form-panel { min-height: 0; }
  .task-history-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .asset-panel, .task-history-panel, .metadata-log-panel { padding: 16px; border-radius: 16px; }
  .asset-panel-head { flex-direction: column; gap: 12px; }
  .asset-status { align-self: flex-start; }
  .dropzone { min-height: 204px; padding: 19px 16px; }
  .asset-panel-foot { align-items: flex-start; flex-direction: column; }
  .asset-panel-foot .button { width: 100%; }
  .cutout-preview { min-height: 280px; }
  .cutout-preview img { max-height: 260px; }
  .asset-action-row { grid-template-columns: 1fr; }
  .metadata-summary-head { align-items: flex-start; flex-direction: column; gap: 5px; }
  .metadata-summary-head span { text-align: left; }
  .metadata-result { grid-template-columns: auto minmax(0, 1fr); }
  .metadata-result .button { grid-column: 1 / -1; width: 100%; }
}

/* AI assistant pages */
.ai-tool-page { padding-bottom: 86px; }
.ai-page-body .sidebar .side-nav-link { font-size: 0; }
.ai-page-body .sidebar .side-nav-link > span { font-size: 13px; }
.ai-page-body .sidebar .side-nav-link::before { content: ""; display: block; width: 18px; height: 18px; flex: 0 0 18px; color: oklch(62% 0.018 250); border: 1px solid currentColor; border-radius: 6px; opacity: .82; }
.ai-page-body .sidebar .sidebar-section:nth-of-type(2) .side-nav-link:nth-child(1)::before { border-radius: 4px; box-shadow: inset 0 0 0 3px var(--ink-deep), inset 0 0 0 4px currentColor; }
.ai-page-body .sidebar .sidebar-section:nth-of-type(2) .side-nav-link:nth-child(2)::before { transform: rotate(45deg); border-radius: 3px; }
.ai-page-body .sidebar .sidebar-section:nth-of-type(3) .side-nav-link:nth-child(1)::before { border-radius: 50%; }
.ai-page-body .sidebar .sidebar-section:nth-of-type(3) .side-nav-link:nth-child(2)::before { border-radius: 50%; box-shadow: inset 0 0 0 4px var(--ink-deep), inset 0 0 0 5px currentColor; }
.ai-page-body .sidebar .sidebar-section:nth-of-type(3) .side-nav-link:nth-child(3)::before { transform: skew(-12deg); }
.ai-page-body .sidebar .sidebar-section:nth-of-type(3) .side-nav-link:nth-child(4)::before { border-radius: 4px; background: linear-gradient(135deg, transparent 44%, currentColor 45%, currentColor 55%, transparent 56%); }
.ai-page-body .sidebar .sidebar-section:nth-of-type(3) .side-nav-link:nth-child(5)::before, .ai-page-body .sidebar .sidebar-section:nth-of-type(3) .side-nav-link:nth-child(6)::before { border-radius: 4px 4px 8px 8px; }
.expert-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.ai-search { position: relative; display: flex; align-items: center; flex: 1 1 280px; max-width: 460px; }
.ai-search .icon { position: absolute; left: 13px; color: var(--muted); pointer-events: none; }
.ai-search input { width: 100%; min-height: 42px; padding: 0 14px 0 38px; color: var(--fg); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; outline: none; transition: border-color 160ms ease, box-shadow 160ms ease; }
.ai-search input:focus { border-color: oklch(58% 0.18 255 / 0.56); box-shadow: 0 0 0 4px oklch(58% 0.18 255 / 0.1); }
.ai-search input::placeholder { color: oklch(70% 0.01 250); }
.filter-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-pill { min-height: 34px; padding: 0 12px; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 999px; font-size: 12px; font-weight: 600; }
.filter-pill:hover { color: var(--fg); background: var(--surface); border-color: var(--border); }
.filter-pill.is-active { color: var(--fg); background: var(--surface); border-color: var(--border); box-shadow: 0 4px 14px oklch(24% 0.03 250 / 0.05); }
.expert-layout { display: grid; grid-template-columns: minmax(0, 1.22fr) minmax(330px, .78fr); gap: 16px; align-items: start; }
.expert-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 18px; }
.expert-card { display: grid; grid-template-columns: 38px minmax(0, 1fr) 32px; gap: 11px; align-items: center; min-width: 0; padding: 12px; background: var(--surface-soft); border: 1px solid transparent; border-radius: 14px; cursor: pointer; transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease; }
.expert-card:hover { transform: translateY(-2px); background: var(--surface); border-color: var(--border); box-shadow: var(--shadow-soft); }
.expert-card.is-selected { background: oklch(58% 0.18 255 / 0.06); border-color: oklch(58% 0.18 255 / 0.28); box-shadow: 0 8px 22px oklch(58% 0.18 255 / 0.08); }
.expert-card[hidden] { display: none; }
.expert-avatar { display: grid; place-items: center; width: 38px; height: 38px; color: var(--fg); background: oklch(70% 0.15 194 / 0.18); border: 1px solid oklch(70% 0.15 194 / 0.26); border-radius: 12px; font: 700 14px/1 var(--font-display); }
.expert-avatar.avatar-warm { background: oklch(72% 0.15 42 / 0.18); border-color: oklch(72% 0.15 42 / 0.28); }
.expert-avatar.avatar-indigo { background: oklch(58% 0.18 255 / 0.14); border-color: oklch(58% 0.18 255 / 0.24); }
.expert-avatar.avatar-green { background: oklch(58% 0.14 155 / 0.14); border-color: oklch(58% 0.14 155 / 0.25); }
.expert-card-copy { min-width: 0; }
.expert-card-copy > div { display: flex; align-items: center; gap: 7px; min-width: 0; }
.expert-card-copy strong { overflow: hidden; font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.expert-card-copy p { margin: 5px 0 0; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.expert-state { color: var(--success); font: 10px/1 var(--font-mono); white-space: nowrap; }
.expert-card .icon-button { width: 32px; height: 32px; }
.expert-focus-panel { position: sticky; top: calc(var(--topbar-height) + 20px); min-height: 430px; padding: 22px; color: oklch(94% 0.008 250); background: var(--ink-deep); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-float); }
.expert-focus-panel::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 82% 12%, oklch(70% 0.15 194 / 0.24), transparent 34%), radial-gradient(circle at 18% 90%, oklch(58% 0.18 255 / 0.22), transparent 42%); pointer-events: none; }
.expert-focus-panel > * { position: relative; z-index: 1; }
.expert-focus-top { display: flex; align-items: center; gap: 11px; min-height: 58px; margin-bottom: 34px; }
.expert-avatar-large { width: 58px; height: 58px; color: oklch(98% 0.008 250); background: oklch(100% 0 0 / 0.12); border-color: oklch(100% 0 0 / 0.3); border-radius: 17px; font-size: 20px; }
.expert-focus-top .chip { margin-left: auto; color: oklch(92% 0.008 250); background: oklch(100% 0 0 / 0.08); border-color: oklch(100% 0 0 / 0.14); }
.expert-focus-panel .eyebrow { color: oklch(74% 0.02 250); }
.expert-focus-panel h2 { margin: 8px 0 12px; color: oklch(98% 0.008 250); font: 650 28px/1.1 var(--font-display); letter-spacing: -0.04em; }
.expert-focus-panel > p:not(.eyebrow) { max-width: 34ch; margin: 0; color: oklch(76% 0.014 250); font-size: 13px; line-height: 1.7; }
.expert-focus-panel .button-primary { margin-top: 26px; color: var(--ink-deep); background: oklch(78% 0.16 194); box-shadow: 0 12px 26px oklch(70% 0.15 194 / 0.18); }
.expert-focus-panel .button-primary:hover { background: oklch(84% 0.14 194); }
.expert-focus-note { margin-top: 18px; padding-top: 16px; color: oklch(70% 0.014 250); border-top: 1px solid oklch(100% 0 0 / 0.12); font-size: 11px; line-height: 1.6; }
.expert-recent { display: grid; gap: 6px; margin-top: 26px; padding-top: 16px; border-top: 1px solid oklch(100% 0 0 / 0.12); }
.expert-recent-head { display: flex; justify-content: space-between; gap: 12px; color: oklch(92% 0.008 250); font-size: 12px; }
.expert-recent-head span { color: oklch(66% 0.014 250); font: 10px/1 var(--font-mono); }
.expert-recent a { display: grid; grid-template-columns: 7px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 8px 0; color: oklch(78% 0.014 250); border-bottom: 1px solid oklch(100% 0 0 / 0.08); }
.expert-recent a:last-child { border-bottom: 0; }
.expert-recent a:hover { color: oklch(98% 0.008 250); }
.recent-dot { width: 7px; height: 7px; border-radius: 50%; background: oklch(78% 0.16 194); }
.recent-dot.warm { background: oklch(78% 0.15 42); }
.expert-recent a strong, .expert-recent a small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.expert-recent a strong { font-size: 11px; font-weight: 600; }
.expert-recent a small { margin-top: 2px; color: oklch(64% 0.014 250); font-size: 10px; }
.expert-recent .history-time { color: oklch(64% 0.014 250); }

.vision-layout { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 16px; align-items: start; }
.ai-upload-zone { display: grid; justify-items: center; min-height: 222px; margin-top: 18px; padding: 24px 18px; text-align: center; background: var(--surface-soft); border: 1px dashed oklch(54% 0.012 250 / 0.32); border-radius: 16px; cursor: pointer; transition: border-color 160ms ease, background 160ms ease, transform 160ms ease; }
.ai-upload-zone:hover, .ai-upload-zone.is-dragover { background: oklch(58% 0.18 255 / 0.045); border-color: oklch(58% 0.18 255 / 0.58); }
.ai-upload-zone.is-dragover { transform: translateY(-2px); }
.ai-upload-zone h3 { margin: 0; font: 600 17px/1.2 var(--font-display); letter-spacing: -0.015em; }
.ai-upload-zone p { margin: 7px 0 14px; color: var(--muted); font-size: 12px; }
.ai-upload-zone .button { min-height: 36px; font-size: 12px; }
.vision-source-preview { display: grid; place-items: center; min-height: 230px; margin-top: 14px; overflow: hidden; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 14px; }
.vision-source-preview.has-image { padding: 10px; background-color: oklch(97% 0.008 240); background-image: linear-gradient(45deg, oklch(92% 0.005 250) 25%, transparent 25%), linear-gradient(-45deg, oklch(92% 0.005 250) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, oklch(92% 0.005 250) 75%), linear-gradient(-45deg, transparent 75%, oklch(92% 0.005 250) 75%); background-position: 0 0, 0 10px, 10px -10px, -10px 0; background-size: 20px 20px; }
.vision-source-preview img { display: block; width: 100%; height: 100%; max-height: 280px; object-fit: contain; border-radius: 9px; filter: drop-shadow(0 12px 20px oklch(24% 0.03 250 / .12)); }
.ai-empty-preview, .analysis-placeholder { display: grid; justify-items: center; color: var(--muted); text-align: center; }
.ai-empty-preview .drop-icon, .analysis-placeholder .drop-icon { margin-bottom: 10px; color: var(--muted); background: oklch(54% 0.012 250 / .08); border-color: oklch(54% 0.012 250 / .12); }
.ai-empty-preview strong, .analysis-placeholder strong { color: var(--fg); font-size: 13px; font-weight: 600; }
.ai-empty-preview small, .analysis-placeholder small { margin-top: 5px; font-size: 11px; }
.vision-result-panel { min-height: 536px; }
.vision-tabs { display: flex; gap: 5px; margin-top: 18px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.vision-tab { min-height: 32px; padding: 0 11px; color: var(--muted); background: transparent; border-radius: 8px; font-size: 12px; font-weight: 600; }
.vision-tab:hover { color: var(--fg); background: var(--surface-soft); }
.vision-tab.is-active { color: var(--fg); background: var(--surface-soft); }
.vision-analysis-content { min-height: 264px; padding: 22px 4px 12px; }
.analysis-placeholder { min-height: 224px; }
.analysis-grid-mark { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 14px; color: var(--accent); background: oklch(58% 0.18 255 / .1); border: 1px solid oklch(58% 0.18 255 / .16); border-radius: 15px; font: 300 28px/1 var(--font-body); }
.analysis-result { display: grid; gap: 14px; }
.analysis-result-head { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.analysis-result h3 { margin: 0; font: 600 17px/1.25 var(--font-display); }
.analysis-result p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.75; }
.analysis-list { display: grid; gap: 8px; }
.analysis-line { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; padding: 11px 12px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 11px; }
.analysis-line strong { color: var(--muted); font: 10px/1.4 var(--font-mono); }
.analysis-line span { color: var(--fg); font-size: 12px; line-height: 1.55; }
.vision-result-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); }
.vision-result-actions .button { flex: 1; }

.ai-generation-layout { display: grid; grid-template-columns: minmax(0, 1.16fr) minmax(350px, .84fr); gap: 16px; align-items: start; }
.ai-output-panel { min-height: 642px; }
.ai-composer-panel { position: sticky; top: calc(var(--topbar-height) + 20px); }
.ai-composer-panel .asset-panel-head { margin-bottom: 18px; }
.ai-composer-panel .chip { color: var(--success); background: oklch(58% 0.14 155 / 0.08); border-color: oklch(58% 0.14 155 / 0.16); }
.ai-composer-form { display: grid; gap: 15px; }
.ai-inline-upload { margin-bottom: 1px; }
.ai-inline-upload label { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 9px 11px; color: var(--fg); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; transition: border-color 160ms ease, background 160ms ease; }
.ai-inline-upload label:hover { background: var(--surface); border-color: oklch(58% 0.18 255 / 0.32); }
.upload-mini-icon { display: grid; place-items: center; width: 34px; height: 34px; color: var(--accent); background: oklch(58% 0.18 255 / .1); border-radius: 10px; font-size: 20px; line-height: 1; }
.ai-inline-upload label > span:nth-child(2) { display: grid; gap: 2px; min-width: 0; flex: 1; }
.ai-inline-upload strong { font-size: 12px; font-weight: 650; }
.ai-inline-upload small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.ai-inline-upload .icon { color: var(--muted); }
.ai-composer-form .prompt-field textarea { min-height: 154px; }
.range-field { display: grid; gap: 8px; }
.range-field > span { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.range-field strong { color: var(--fg); font: 10px/1 var(--font-mono); }
.range-field input[type="range"] { width: 100%; accent-color: var(--accent); }
.video-control-grid { grid-template-columns: 1.2fr .75fr .75fr; }
.ai-generated-preview { position: relative; display: grid; place-items: center; min-height: 300px; margin-top: 18px; overflow: hidden; background: linear-gradient(145deg, oklch(70% 0.15 194 / .94), oklch(56% 0.18 255 / .94)); border-radius: 15px; }
.ai-generated-preview::before { content: ""; position: absolute; left: 6%; bottom: -24%; width: 58%; aspect-ratio: 1; background: oklch(100% 0 0 / .16); border-radius: 50%; }
.ai-generated-preview::after { content: ""; position: absolute; right: 14%; top: 18%; width: 25%; height: 48%; border: 1px solid oklch(100% 0 0 / .34); border-radius: 48% 48% 42% 42%; transform: rotate(18deg); }
.text-image-preview { background: linear-gradient(148deg, oklch(73% 0.14 194), oklch(57% 0.18 255)); }
.ai-preview-stamp { position: absolute; top: 13px; left: 13px; z-index: 2; padding: 6px 8px; color: oklch(96% 0.008 250); background: oklch(22% 0.022 250 / .28); border: 1px solid oklch(100% 0 0 / .16); border-radius: 7px; font: 10px/1 var(--font-mono); }
.ai-preview-subject { position: relative; z-index: 2; display: grid; place-items: center; width: 108px; height: 108px; color: oklch(98% 0.008 250); border: 1px solid oklch(100% 0 0 / .46); border-radius: 50%; font: 650 30px/1 var(--font-display); letter-spacing: -.05em; background: oklch(100% 0 0 / .12); box-shadow: 0 0 0 18px oklch(100% 0 0 / .05); }
.ai-preview-caption { position: absolute; right: 16px; bottom: 15px; z-index: 2; color: oklch(94% 0.008 250); font-size: 11px; }
.ai-output-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.ai-output-footer .mono { color: var(--muted); font-size: 10px; }
.ai-output-footer > div { display: flex; gap: 6px; }
.ai-output-footer .icon-button { width: 34px; height: 34px; background: var(--surface-soft); border-color: var(--border); }
.ai-history-list { margin-top: 24px; }
.ai-history-list .history-section-head { margin-bottom: 8px; }
.transform-preview { display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr); gap: 9px; align-items: center; margin-top: 18px; }
.transform-frame { position: relative; display: grid; place-items: center; min-height: 270px; overflow: hidden; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 14px; }
.transform-frame.has-image { padding: 8px; background-color: oklch(97% 0.008 240); background-image: linear-gradient(45deg, oklch(92% 0.005 250) 25%, transparent 25%), linear-gradient(-45deg, oklch(92% 0.005 250) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, oklch(92% 0.005 250) 75%), linear-gradient(-45deg, transparent 75%, oklch(92% 0.005 250) 75%); background-position: 0 0, 0 10px, 10px -10px, -10px 0; background-size: 20px 20px; }
.transform-frame img { display: block; width: 100%; height: 100%; max-height: 270px; object-fit: contain; border-radius: 9px; }
.transform-label { position: absolute; top: 10px; left: 10px; z-index: 2; padding: 4px 6px; color: var(--muted); background: oklch(100% 0 0 / .82); border: 1px solid var(--border); border-radius: 6px; font: 9px/1 var(--font-mono); }
.transform-arrow { display: grid; place-items: center; color: var(--muted); font-size: 20px; }
.transform-result-frame { background: linear-gradient(145deg, oklch(72% 0.14 42 / .54), oklch(58% 0.18 255 / .68)); }
.transform-result-frame::before { content: ""; position: absolute; width: 82px; height: 142px; background: oklch(100% 0 0 / .18); border: 1px solid oklch(100% 0 0 / .42); border-radius: 45% 45% 38% 38%; transform: rotate(18deg); }
.transform-result-frame .ai-empty-preview { position: relative; z-index: 1; color: oklch(96% 0.008 250); }
.transform-result-frame .ai-empty-preview small { color: oklch(88% 0.014 250); }
.transform-result-frame.has-result::before { box-shadow: 0 24px 22px oklch(22% 0.022 250 / .22); transform: rotate(12deg) scale(1.06); }
.ai-video-preview { position: relative; display: grid; place-items: center; min-height: 300px; margin-top: 18px; overflow: hidden; background: oklch(24% 0.03 250); border-radius: 15px; }
.ai-video-preview::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 26% 42%, oklch(70% 0.15 194 / .45), transparent 26%), linear-gradient(135deg, oklch(32% 0.04 250), oklch(20% 0.024 250)); }
.ai-video-preview::after { content: ""; position: absolute; inset: 16% 17%; border: 1px solid oklch(100% 0 0 / .18); border-radius: 12px; transform: rotate(-3deg); }
.ai-video-preview.is-ready::before { background: radial-gradient(circle at 32% 45%, oklch(70% 0.15 194 / .62), transparent 28%), linear-gradient(135deg, oklch(38% 0.05 250), oklch(20% 0.024 250)); }
.image-video-preview.has-reference::before { background-image: linear-gradient(135deg, oklch(20% 0.024 250 / .28), oklch(20% 0.024 250 / .55)), var(--ai-reference-image); background-size: cover; background-position: center; }
.ai-empty-video { position: relative; z-index: 2; display: grid; justify-items: center; color: oklch(88% 0.014 250); text-align: center; }
.ai-empty-video strong { margin-top: 10px; font-size: 13px; }
.ai-empty-video small { margin-top: 5px; color: oklch(68% 0.014 250); font-size: 11px; }
.video-play-button { position: relative; z-index: 3; display: grid; place-items: center; width: 52px; height: 52px; margin-top: 15px; padding-left: 3px; color: var(--ink-deep); background: oklch(96% 0.008 250); border-radius: 50%; box-shadow: 0 12px 28px oklch(10% 0.02 250 / .24); font-size: 17px; transition: transform 160ms ease, background 160ms ease; }
.video-play-button:hover { transform: scale(1.05); background: oklch(78% 0.16 194); }
.video-scene-label { position: absolute; left: 15px; bottom: 15px; z-index: 2; max-width: 55%; color: oklch(90% 0.014 250); font-size: 11px; }
.video-timeline { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; margin-top: 12px; color: var(--muted); font: 10px/1 var(--font-mono); }
.video-timeline > div { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; height: 18px; align-items: center; }
.video-timeline i { display: block; height: 5px; background: var(--border); border-radius: 999px; }
.video-timeline i:nth-child(1), .video-timeline i:nth-child(2) { background: var(--domain); }
.ai-video-preview.is-playing + .video-timeline i:nth-child(3), .ai-video-preview.is-playing + .video-timeline i:nth-child(4) { background: var(--accent); animation: ai-timeline-pulse 900ms ease-in-out infinite alternate; }
@keyframes ai-timeline-pulse { from { opacity: .55; transform: scaleY(.8); } to { opacity: 1; transform: scaleY(1.2); } }

@media (max-width: 1120px) {
  .expert-layout, .vision-layout, .ai-generation-layout { grid-template-columns: 1fr; }
  .expert-focus-panel, .ai-composer-panel { position: static; }
  .expert-focus-panel { min-height: 0; }
  .ai-output-panel, .vision-result-panel { min-height: 0; }
}

@media (max-width: 640px) {
  .expert-toolbar { align-items: stretch; flex-direction: column; }
  .ai-search { max-width: none; }
  .filter-pills { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .filter-pill { flex: 0 0 auto; }
  .expert-card-grid { grid-template-columns: 1fr; }
  .expert-focus-panel { padding: 18px; border-radius: 16px; }
  .vision-layout, .ai-generation-layout { gap: 12px; }
  .vision-result-actions { flex-direction: column; }
  .vision-result-actions .button { width: 100%; }
  .vision-tabs { overflow-x: auto; }
  .vision-tab { flex: 0 0 auto; }
  .analysis-line { grid-template-columns: 1fr; gap: 5px; }
  .transform-preview { grid-template-columns: 1fr; }
  .transform-arrow { transform: rotate(90deg); }
  .transform-frame { min-height: 190px; }
  .ai-video-preview, .ai-generated-preview { min-height: 240px; }
  .video-scene-label { max-width: 72%; }
  .ai-output-footer { align-items: flex-start; flex-direction: column; }
  .ai-output-footer > div { align-self: flex-end; }
  .ai-composer-panel .asset-panel-head { margin-bottom: 14px; }
}

/* Generation page polish */
.ai-page-generation .tool-page { width: min(1320px, calc(100% - 56px)); }
.ai-page-generation .tool-heading { margin-bottom: 20px; }
.ai-page-generation .tool-heading h1 { font-size: 32px; }
.ai-page-generation .ai-generation-layout { grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); gap: 20px; }
.ai-page-generation .asset-panel { border-radius: 18px; box-shadow: 0 14px 40px oklch(24% 0.03 250 / 0.055); }
.ai-page-generation .ai-output-panel { min-height: 0; padding: 22px; }
.ai-page-generation .ai-output-panel .asset-panel-head { padding-bottom: 15px; }
.ai-page-generation .ai-composer-panel { padding: 22px; border-color: oklch(58% 0.18 255 / .16); background: linear-gradient(180deg, oklch(100% 0 0 / .98), oklch(97% 0.008 240 / .88)); }
.ai-page-generation .ai-composer-panel::before { content: ""; display: block; width: 42px; height: 3px; margin: -22px 0 18px; background: var(--accent); border-radius: 999px; }
.ai-page-generation .ai-composer-form .prompt-field textarea { min-height: 168px; background: linear-gradient(180deg, var(--surface), oklch(99% 0.002 240)); border-color: oklch(54% 0.012 250 / .24); }
.ai-page-generation .ai-composer-form[aria-busy="true"] { opacity: .86; }
.ai-page-generation .ai-composer-form .prompt-field:focus-within .field-label { color: var(--accent); }
.ai-page-generation .control-field:focus-within > span { color: var(--accent); }
.ai-page-generation .control-field select { min-height: 44px; font-size: 12px; }
.ai-page-generation .composer-submit { min-height: 50px; font-size: 14px; }
.ai-page-generation .composer-foot { padding-top: 1px; }
.ai-page-generation .ai-generated-preview, .ai-page-generation .ai-video-preview { min-height: 0; height: auto; aspect-ratio: 16 / 10; max-height: 390px; }
.ai-page-generation .ai-video-preview .video-play-button { position: absolute; top: 50%; left: 50%; margin: 0; transform: translate(-50%, -50%); }
.ai-page-generation .ai-video-preview .video-play-button:hover { transform: translate(-50%, -50%) scale(1.05); }
.ai-page-generation .ai-video-preview.is-playing .video-play-button { padding-left: 0; }
.ai-page-generation .transform-preview { gap: 12px; }
.ai-page-generation .transform-frame { min-height: 0; aspect-ratio: 1.08 / 1; }
.ai-page-generation .ai-output-footer { margin-top: 14px; padding-top: 14px; }
.ai-page-generation .ai-history-list { margin-top: 20px; }
.ai-page-generation .history-item { padding: 10px 8px; }
.ai-page-generation .ai-inline-upload label { min-height: 64px; border-style: dashed; }
.ai-page-generation .ai-inline-upload.is-dragover label, .ai-page-generation .ai-inline-upload:focus-within label { border-color: oklch(58% 0.18 255 / .55); background: oklch(58% 0.18 255 / .055); }
.ai-page-generation .prompt-counter.is-near-limit { color: var(--warning); }
.ai-page-generation .ai-generated-preview.has-result .ai-preview-subject { animation: ai-result-settle 600ms ease both; }
.ai-page-generation .ai-video-preview.is-ready .video-scene-label { color: oklch(96% 0.008 250); }
.ai-page-generation .ai-video-preview.is-ready::after { border-color: oklch(100% 0 0 / .28); }
@keyframes ai-result-settle { from { opacity: .3; transform: scale(.88); } to { opacity: 1; transform: scale(1); } }

@media (max-width: 1120px) {
  .ai-page-generation .tool-page { width: min(100% - 38px, 900px); }
  .ai-page-generation .ai-generation-layout { grid-template-columns: 1fr; }
  .ai-page-generation .ai-composer-panel { order: 2; }
  .ai-page-generation .ai-output-panel { order: 1; }
}

@media (max-width: 640px) {
  .ai-page-generation .tool-page { width: calc(100% - 28px); }
  .ai-page-generation .tool-heading h1 { font-size: 30px; }
  .ai-page-generation .asset-panel { padding: 17px; border-radius: 16px; }
  .ai-page-generation .ai-output-panel, .ai-page-generation .ai-composer-panel { padding: 17px; }
  .ai-page-generation .ai-composer-panel::before { margin: -17px 0 16px; }
  .ai-page-generation .ai-generated-preview, .ai-page-generation .ai-video-preview { aspect-ratio: 1 / .86; max-height: none; }
  .ai-page-generation .ai-output-footer { gap: 8px; }
  .ai-page-generation .ai-inline-upload label { min-height: 60px; }
}
