/* LUMINA Studio — editorial creative system */
:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171613;
  --bg-side: #1d1b17;
  --surface: #211f1b;
  --surface-2: #292620;
  --surface-3: #343028;
  --veil: rgba(23, 22, 19, 0.92);
  --line: rgba(238, 231, 218, 0.11);
  --line-strong: rgba(238, 231, 218, 0.23);
  --text: #eee7da;
  --muted: #aaa296;
  --quiet: #756e64;
  --accent: #b65f3f;
  --accent-hover: #c96b48;
  --accent-text: #fff8ef;
  --danger: #d06b58;
  --ok: #7d9a78;
  --warn: #c5a25d;
  --shadow: 0 24px 70px rgba(8, 7, 5, 0.42);
  --shadow-soft: 0 12px 36px rgba(8, 7, 5, 0.24);
  --sans: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  --serif: "Songti SC", STSong, "Noto Serif CJK SC", "Source Han Serif SC", Georgia, serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --snap: cubic-bezier(.2, 1, .28, 1);
  --sidebar: 244px;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #eee8dc;
  --bg-side: #e5ddcf;
  --surface: #f7f2e9;
  --surface-2: #e9e1d4;
  --surface-3: #dcd1c1;
  --veil: rgba(247, 242, 233, 0.93);
  --line: rgba(34, 30, 24, 0.12);
  --line-strong: rgba(34, 30, 24, 0.25);
  --text: #221f1a;
  --muted: #6e675d;
  --quiet: #9b9184;
  --accent: #a84f32;
  --accent-hover: #913e27;
  --accent-text: #fff9ef;
  --danger: #ad493b;
  --ok: #537454;
  --warn: #8c692e;
  --shadow: 0 28px 70px rgba(61, 47, 31, 0.17);
  --shadow-soft: 0 12px 36px rgba(61, 47, 31, 0.11);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { height: 100%; scroll-behavior: smooth; }
body { min-height: 100%; }
[hidden] { display: none !important; }

body {
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .25s ease, color .25s ease;
}

button, input, textarea { font: inherit; }
button { border: 0; background: transparent; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
img, video { max-width: 100%; }
::selection { color: var(--accent-text); background: var(--accent); }
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 0; }
::-webkit-scrollbar-track { background: transparent; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 10px;
  z-index: 1000;
  padding: 10px 14px;
  color: var(--accent-text);
  background: var(--accent);
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 10px; }

.eyebrow {
  display: block;
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .16em;
  line-height: 1.3;
  text-transform: uppercase;
}

#app { display: flex; width: 100%; height: 100dvh; }

/* Authentication */
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(390px, .8fr);
  min-height: 100dvh;
  background: var(--bg);
}

.auth-story {
  position: relative;
  display: flex;
  min-width: 0;
  padding: clamp(28px, 4vw, 64px);
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  background: var(--text);
  color: var(--bg);
}
.auth-story::after {
  content: "";
  position: absolute;
  right: -12vw;
  bottom: -16vw;
  width: min(46vw, 660px);
  aspect-ratio: 1;
  border: clamp(40px, 6vw, 92px) solid currentColor;
  border-radius: 50%;
  opacity: .055;
  pointer-events: none;
}
.auth-wordmark {
  position: relative;
  z-index: 1;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .42em;
}
.auth-statement { position: relative; z-index: 1; max-width: 730px; }
.auth-statement .eyebrow { margin-bottom: 24px; color: currentColor; opacity: .46; }
.auth-statement h1 {
  font-family: var(--serif);
  font-size: clamp(48px, 6.2vw, 104px);
  font-weight: 400;
  letter-spacing: -.055em;
  line-height: .96;
  text-wrap: balance;
}
.auth-statement h1 em,
.hero-title em { color: var(--accent); font-weight: 400; }
.auth-statement p {
  max-width: 34rem;
  margin-top: 34px;
  font-size: clamp(14px, 1.2vw, 17px);
  line-height: 1.8;
  opacity: .63;
}
.auth-index {
  position: relative;
  z-index: 1;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .42;
}

.auth-panel {
  display: flex;
  padding: clamp(28px, 5vw, 80px);
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.auth-card { width: min(100%, 420px); animation: rise-in .65s var(--snap) both; }
.auth-brand { display: flex; gap: 14px; align-items: center; margin-bottom: clamp(52px, 8vh, 86px); }
.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-family: var(--serif);
  font-size: 18px;
}
.auth-brand-name { font-size: 12px; font-weight: 700; letter-spacing: .34em; }
.auth-brand-sub { margin-top: 3px; color: var(--quiet); font-size: 10px; letter-spacing: .08em; }
.auth-heading .eyebrow { margin-bottom: 12px; }
.auth-heading h2 {
  margin-bottom: 28px;
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 400;
  letter-spacing: -.035em;
}
.auth-tabs { display: flex; gap: 26px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.auth-tab {
  position: relative;
  padding: 0 0 11px;
  color: var(--quiet);
  font-size: 12px;
  letter-spacing: .1em;
}
.auth-tab::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s var(--ease);
}
.auth-tab:hover, .auth-tab.active { color: var(--text); }
.auth-tab.active::after { transform: scaleX(1); }
.auth-form { display: grid; grid-template-columns: 1fr; }
.field-label { margin: 0 0 7px; color: var(--muted); font-size: 11px; letter-spacing: .04em; }
.auth-input {
  width: 100%;
  height: 50px;
  margin-bottom: 18px;
  padding: 0 2px;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  transition: border-color .2s ease;
}
.auth-input:focus { border-color: var(--accent); }
.auth-input::placeholder { color: var(--quiet); }
.auth-error {
  margin: 2px 0 14px;
  padding: 10px 12px;
  border-left: 2px solid var(--danger);
  background: rgba(208, 107, 88, .08);
  color: var(--danger);
  font-size: 12px;
}
.auth-submit {
  height: 50px;
  margin-top: 10px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .26em;
  transition: background-color .2s ease, transform .2s var(--ease);
}
.auth-submit:hover { background: var(--accent-hover); transform: translateY(-2px); }
.auth-submit:active { transform: translateY(0) scale(.99); }
.auth-submit:disabled { opacity: .42; transform: none; }
.auth-note { margin-top: 18px; color: var(--quiet); font-size: 11px; line-height: 1.7; text-align: center; }

/* Navigation */
.sidebar {
  position: relative;
  z-index: 40;
  display: flex;
  width: var(--sidebar);
  flex: 0 0 auto;
  padding: 24px 16px 18px;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: var(--bg-side);
  white-space: nowrap;
  transition: width .35s var(--ease), padding .35s var(--ease), box-shadow .3s ease;
}
.sidebar .brand { display: flex; min-height: 42px; padding: 0 5px; gap: 11px; align-items: center; }
.brand-text { display: flex; min-width: 0; flex-direction: column; }
.brand-name { font-size: 12px; font-weight: 700; letter-spacing: .29em; }
.brand-sub { margin-top: 2px; color: var(--quiet); font-family: var(--mono); font-size: 8px; letter-spacing: .12em; text-transform: uppercase; }
.rail-toggle {
  position: absolute;
  top: 4px;
  right: 0;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--quiet);
  transition: color .2s ease, background-color .2s ease;
}
.rail-toggle:hover { color: var(--text); background: var(--surface-2); }
.rail-toggle svg { width: 12px; transition: transform .3s var(--ease); }
.nav-label {
  margin: 42px 12px 10px;
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 12.5px;
  text-align: left;
  transition: color .2s ease, background-color .2s ease, transform .2s var(--ease);
}
.nav-item svg { width: 16px; height: 16px; flex: 0 0 auto; }
.nav-item::before {
  content: "";
  position: absolute;
  top: 11px;
  bottom: 11px;
  left: 0;
  width: 2px;
  background: var(--accent);
  opacity: 0;
  transform: scaleY(.3);
  transition: opacity .2s ease, transform .2s var(--ease);
}
.nav-item:hover { color: var(--text); background: var(--surface); transform: translateX(2px); }
.nav-item.active { color: var(--text); background: var(--surface); }
.nav-item.active::before { opacity: 1; transform: scaleY(1); }
.side-spacer { flex: 1; }
.side-bottom { display: flex; flex-direction: column; gap: 10px; }
.user-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 28px;
  gap: 9px;
  padding: 10px 8px;
  align-items: center;
  border-top: 1px solid var(--line);
}
.user-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  background: var(--text);
  color: var(--bg);
  font-family: var(--serif);
  font-size: 14px;
  text-transform: uppercase;
}
.user-info { min-width: 0; }
.user-email { overflow: hidden; color: var(--text); font-size: 11px; text-overflow: ellipsis; }
.user-balance { margin-top: 2px; color: var(--quiet); font-family: var(--mono); font-size: 9px; font-variant-numeric: tabular-nums; }
.logout-btn { display: grid; width: 28px; height: 28px; place-items: center; color: var(--quiet); transition: color .2s ease, background-color .2s ease; }
.logout-btn:hover { color: var(--danger); background: var(--surface-2); }
.logout-btn svg { width: 14px; }

.sidebar.rail { width: 68px; padding-right: 12px; padding-left: 12px; }
.sidebar.rail .brand-text,
.sidebar.rail .nav-label,
.sidebar.rail .nav-item span,
.sidebar.rail .user-info,
.sidebar.rail .logout-btn { opacity: 0; pointer-events: none; }
.sidebar.rail .nav-item { padding-right: 13px; padding-left: 13px; }

/* Main workspace */
.main { position: relative; display: flex; min-width: 0; flex: 1; flex-direction: column; }
.view { display: none; min-height: 0; flex: 1; flex-direction: column; }
.view.active { display: flex; animation: view-in .42s var(--ease) both; }
.view-head {
  display: flex;
  max-width: 1540px;
  width: 100%;
  margin: 0 auto;
  padding: 48px clamp(24px, 4vw, 64px) 26px;
  flex: 0 0 auto;
  gap: 28px;
  align-items: flex-end;
  justify-content: space-between;
}
.view-head .eyebrow { margin-bottom: 10px; }
.view-title {
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 54px);
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: 1.05;
}
.view-subtitle { max-width: 32rem; margin-top: 10px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.stage {
  position: relative;
  display: flex;
  flex: 1;
  padding: 0 clamp(24px, 4vw, 64px) 96px;
  align-items: center;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
}
.stage > * { position: relative; z-index: 1; flex: 0 0 auto; }

.hero {
  display: grid;
  width: min(100%, 1180px);
  max-height: 560px;
  margin: clamp(52px, 10vh, 116px) auto 52px;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
  gap: clamp(44px, 8vw, 110px);
  align-items: end;
  overflow: hidden;
  transition: max-height .55s var(--ease), margin .55s var(--ease), opacity .35s ease;
}
.hero-copy .eyebrow { margin-bottom: 22px; }
.hero-title {
  font-family: var(--serif);
  font-size: clamp(52px, 6.1vw, 92px);
  font-weight: 400;
  letter-spacing: -.065em;
  line-height: .98;
  text-wrap: balance;
}
.hero-lede { max-width: 38rem; margin-top: 28px; color: var(--muted); font-size: 14px; line-height: 1.8; }
.hero-control { padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.hero-control-label { display: block; margin-bottom: 12px; color: var(--quiet); font-size: 11px; }
.mode-switch { position: relative; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line-strong); }
.mode-btn {
  position: relative;
  z-index: 1;
  min-height: 46px;
  padding: 0 20px;
  color: var(--muted);
  font-size: 12px;
  transition: color .24s ease;
}
.mode-btn.active { color: var(--accent-text); }
.mode-slider {
  position: absolute;
  inset: 0 50% 0 0;
  background: var(--accent);
  transition: transform .32s var(--snap);
}
.mode-switch.video .mode-slider { transform: translateX(100%); }
.hero-footnote { display: flex; margin: 18px 0 13px; gap: 9px; align-items: center; color: var(--quiet); font-size: 9px; }
.hero-footnote span { color: var(--accent); font-family: var(--mono); }
.hero-footnote i { width: 12px; height: 1px; background: var(--line-strong); }
body.workspace .hero { max-height: 0; margin: 0; opacity: 0; pointer-events: none; }

/* Composer */
.composer {
  position: relative;
  width: min(100%, 940px);
  margin-left: min(10vw, 120px);
  padding: 18px 18px 14px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: 10px 10px 0 var(--surface-2);
  transition: border-color .25s ease, box-shadow .35s var(--ease), padding .35s var(--ease), transform .35s var(--ease);
}
.composer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width .55s var(--ease);
}
.composer:focus-within { border-color: var(--line-strong); box-shadow: 14px 14px 0 var(--surface-2), var(--shadow-soft); }
.composer:focus-within::before { width: calc(100% + 2px); }
.composer-glow { display: none; }
.composer-label { display: flex; margin-bottom: 8px; align-items: center; justify-content: space-between; color: var(--quiet); font-family: var(--mono); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }
.composer-label kbd { padding: 2px 5px; border: 1px solid var(--line); color: var(--quiet); font-family: inherit; font-size: 8px; font-weight: 400; }
.prompt-input {
  width: 100%;
  min-height: 80px;
  max-height: 220px;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--serif);
  font-size: clamp(17px, 1.65vw, 21px);
  line-height: 1.6;
  transition: min-height .35s var(--ease), max-height .35s var(--ease);
}
.prompt-input::placeholder { color: var(--quiet); opacity: .72; }
.mention-panel {
  position: absolute;
  z-index: 235;
  top: 132px;
  left: 18px;
  width: min(420px, calc(100% - 36px));
  max-height: 230px;
  padding: 7px;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  animation: sheet-in .2s var(--snap) both;
}
.mention-option { display: flex; width: 100%; min-height: 46px; padding: 7px 9px; gap: 10px; align-items: center; border-radius: 10px; color: var(--muted); text-align: left; }
.mention-option:hover, .mention-option.active { background: var(--surface-2); color: var(--text); }
.mention-thumb { display: grid; width: 32px; height: 32px; flex: 0 0 auto; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.mention-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mention-copy { display: grid; min-width: 0; gap: 2px; }
.mention-copy strong { color: var(--text); font-size: 12px; font-weight: 600; }
.mention-copy small { overflow: hidden; color: var(--quiet); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.composer-bar { display: flex; margin-top: 12px; gap: 12px; align-items: flex-end; justify-content: space-between; }
.chips { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.kind-mini { display: inline-flex; height: 32px; padding: 2px; align-items: center; border: 1px solid var(--line); background: var(--bg); }
.km-btn { height: 26px; padding: 0 10px; color: var(--quiet); font-size: 11px; transition: color .2s ease, background-color .2s ease; }
.km-btn:hover { color: var(--text); }
.km-btn.active { background: var(--surface-3); color: var(--text); }
.chip {
  display: inline-flex;
  min-height: 32px;
  padding: 0 10px;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  transition: color .2s ease, border-color .2s ease, background-color .2s ease, transform .2s var(--ease);
}
.chip:hover { border-color: var(--line-strong); background: var(--surface-2); color: var(--text); transform: translateY(-1px); }
.chip:active { transform: scale(.98); }
.chip svg.chev { width: 8px; opacity: .55; }
.chip .chip-label { max-width: 168px; overflow: hidden; text-overflow: ellipsis; }
.attach-chip svg { width: 12px; }
.model-chip { color: var(--text); }
.toggle { position: relative; width: 27px; height: 14px; background: var(--surface-3); transition: background-color .2s ease; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; background: var(--muted); transition: transform .22s var(--snap), background-color .2s ease; }
.toggle.on { background: var(--ok); }
.toggle.on::after { background: #fff; transform: translateX(13px); }
.send-btn {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  background: var(--accent);
  color: var(--accent-text);
  transition: background-color .2s ease, transform .22s var(--snap);
}
.send-btn svg { width: 17px; }
.send-btn:hover { background: var(--accent-hover); transform: translateY(-2px); }
.send-btn:active { transform: scale(.96); }
.send-btn:disabled { opacity: .36; transform: none; }
.send-btn.loading { animation: pulse-opacity 1.1s ease-in-out infinite; }

.attach-tray { display: flex; margin: 0 0 14px; gap: 10px; flex-wrap: wrap; }
.att { position: relative; padding-bottom: 17px; animation: scale-in .28s var(--snap) both; }
.att-thumb { display: grid; width: 62px; height: 62px; place-items: center; overflow: hidden; border: 1px solid var(--line-strong); background: var(--surface-2); }
.att-thumb img { width: 100%; height: 100%; object-fit: cover; }
.att-thumb svg { width: 22px; color: var(--muted); }
.att-role { position: absolute; bottom: 11px; left: -3px; padding: 2px 6px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--muted); font-size: 9px; white-space: nowrap; }
.att-role.r-first { border-color: rgba(125,154,120,.52); color: var(--ok); }
.att-role.r-last { border-color: rgba(182,95,63,.55); color: var(--accent-hover); }
.att-remove { position: absolute; top: -5px; right: -5px; display: grid; width: 18px; height: 18px; place-items: center; border: 1px solid var(--line-strong); background: var(--bg); color: var(--text); font-size: 12px; }
.att-mention { position: absolute; bottom: -5px; left: 0; max-width: 76px; overflow: hidden; color: var(--accent); font-family: var(--mono); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.att-mention:hover { color: var(--text); }
.mode-chip { border-color: color-mix(in srgb, var(--accent) 24%, var(--line)); color: var(--text); }
.mode-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 55%, transparent); }

.model-panel, .pop-panel, .advanced-panel {
  position: fixed;
  z-index: 200;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--veil);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: pop-in .22s var(--snap) both;
}
.advanced-panel { position: fixed; z-index: 210; width: min(360px, calc(100vw - 24px)); padding: 7px; }
.advanced-head { display: flex; padding: 12px 12px 10px; gap: 12px; align-items: baseline; justify-content: space-between; border-bottom: 1px solid var(--line); color: var(--text); font-size: 12px; font-weight: 650; }
.advanced-head small { color: var(--quiet); font-size: 9px; font-weight: 450; }
.advanced-field { display: grid; padding: 11px 11px 4px; gap: 7px; color: var(--muted); font-size: 11px; }
.advanced-field span { display: flex; justify-content: space-between; }
.advanced-field small { color: var(--quiet); }
.advanced-field textarea, .advanced-field input { width: 100%; border: 1px solid var(--line); border-radius: 10px; outline: none; background: var(--bg); color: var(--text); font: inherit; }
.advanced-field textarea { min-height: 72px; padding: 10px; resize: vertical; line-height: 1.5; }
.advanced-field input { height: 38px; padding: 0 10px; }
.advanced-field textarea:focus, .advanced-field input:focus { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.advanced-toggle-row { display: flex; min-height: 56px; padding: 9px 11px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.advanced-toggle-row > div { display: grid; gap: 3px; }
.advanced-toggle-row strong { color: var(--text); font-size: 11px; font-weight: 600; }
.advanced-toggle-row small { color: var(--quiet); font-size: 9px; }
.mini-switch { position: relative; width: 34px; height: 19px; border-radius: 99px; background: var(--surface-3); transition: background-color .2s ease; }
.mini-switch span { position: absolute; top: 3px; left: 3px; width: 13px; height: 13px; border-radius: 50%; background: var(--muted); transition: transform .22s var(--snap), background-color .2s ease; }
.mini-switch.on { background: var(--ok); }
.mini-switch.on span { background: #fff; transform: translateX(15px); }
.reference-link-panel {
  position: fixed;
  z-index: 240;
  width: min(410px, calc(100vw - 24px));
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 97%, transparent);
  box-shadow: 0 28px 80px rgba(0,0,0,.5), inset 0 1px rgba(255,255,255,.04);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  animation: sheet-in .24s var(--snap) both;
}
.reference-link-head { display: flex; margin-bottom: 18px; align-items: flex-start; justify-content: space-between; }
.reference-link-head > div { display: grid; gap: 5px; }
.reference-link-head .eyebrow { color: var(--accent); font-size: 8px; }
.reference-link-head strong { color: var(--text); font-size: 15px; font-weight: 640; }
.reference-link-head button { width: 30px; height: 30px; border-radius: 9px; color: var(--muted); font-size: 20px; }
.reference-link-head button:hover { background: var(--surface-2); color: var(--text); }
.reference-link-panel > label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 10px; }
.reference-link-panel > input { width: 100%; height: 43px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; outline: none; background: var(--bg); color: var(--text); font-size: 12px; }
.reference-link-panel > input:focus { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: 0 0 0 3px rgba(185,241,238,.04); }
.reference-link-panel > p { margin: 8px 1px 16px; color: var(--quiet); font-size: 9px; }
.reference-link-actions { display: flex; gap: 8px; justify-content: flex-end; }
.reference-link-actions button { min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 11px; }
.reference-link-actions button:last-child { border-color: transparent; background: var(--accent); color: var(--accent-text); }
.reference-link-actions button:hover { color: var(--text); }
.reference-link-actions button:last-child:hover { background: var(--accent-hover); color: var(--accent-text); }
.model-panel { display: flex; width: 460px; max-width: calc(100vw - 24px); flex-direction: column; }
.model-panel-head { padding: 15px 17px 9px; color: var(--quiet); font-family: var(--mono); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }
.model-list { padding: 0 8px 10px; overflow-y: auto; }
.model-group { padding: 12px 10px 5px; color: var(--quiet); font-family: var(--mono); font-size: 9px; letter-spacing: .1em; }
.model-item { display: flex; width: 100%; padding: 11px 12px; align-items: center; justify-content: space-between; text-align: left; transition: background-color .18s ease, transform .18s var(--ease); }
.model-item:hover { background: var(--surface-2); transform: translateX(2px); }
.model-item.selected { background: var(--surface-2); }
.model-item-left { display: flex; min-width: 0; gap: 4px; flex-direction: column; }
.model-item-name { display: flex; gap: 7px; align-items: center; color: var(--text); font-size: 13px; }
.model-tag { padding: 1px 5px; border: 1px solid var(--line); color: var(--accent-hover); font-family: var(--mono); font-size: 8px; }
.model-item-caps { display: flex; gap: 4px; flex-wrap: wrap; }
.cap-badge { padding: 1px 5px; border: 1px solid var(--line); color: var(--quiet); font-size: 9px; }
.cap-badge.on { border-color: rgba(182,95,63,.35); color: var(--accent-hover); }
.model-check { width: 14px; flex: 0 0 auto; color: var(--accent); opacity: 0; }
.model-item.selected .model-check { opacity: 1; }
.pop-panel { min-width: 160px; max-height: 264px; padding: 6px; overflow-y: auto; }
.pop-panel.grid { display: grid; min-width: 220px; grid-template-columns: repeat(2, 1fr); }
.pop-item { display: flex; width: 100%; padding: 9px 10px; gap: 10px; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; text-align: left; white-space: nowrap; transition: color .18s ease, background-color .18s ease; }
.pop-item:hover, .pop-item.selected { background: var(--surface-2); color: var(--text); }
.pop-item .tick { width: 11px; flex: 0 0 auto; color: var(--accent); opacity: 0; }
.pop-item.selected .tick { opacity: 1; }
.pop-sub { margin-left: 6px; color: var(--quiet); font-size: 10px; }

.inspire { display: flex; width: min(100%, 940px); max-height: 88px; margin: 25px 0 16px min(10vw, 120px); gap: 7px; align-items: center; flex-wrap: wrap; overflow: hidden; transition: max-height .4s var(--ease), margin .4s var(--ease), opacity .3s ease; }
.inspire-label { margin-right: 7px; color: var(--quiet); font-family: var(--mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.inspire-chip { padding: 6px 10px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; transition: color .2s ease, border-color .2s ease, transform .2s var(--ease); }
.inspire-chip:hover { border-color: var(--accent); color: var(--text); transform: translateY(-2px); }
body.workspace .inspire { max-height: 0; margin-top: 0; margin-bottom: 0; opacity: 0; pointer-events: none; }

/* Result and library cards */
.results { width: min(100%, 1280px); margin-top: 16vh; }
body.workspace .results { margin-top: 16px; }
.result-date { display: flex; margin: 30px 0 14px; gap: 16px; align-items: center; color: var(--muted); font-family: var(--mono); font-size: 10px; letter-spacing: .12em; }
.result-date::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.result-grid, .asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: clamp(12px, 1.5vw, 22px); align-items: start; }
.card {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .25s ease, transform .3s var(--ease), box-shadow .3s ease;
  animation: rise-in .55s var(--ease) both;
}
.card.r-square { aspect-ratio: 1; }
.card.r-tall { aspect-ratio: 3 / 4; }
.card.r-wide { aspect-ratio: 16 / 9; }
.card:hover { z-index: 2; border-color: var(--line-strong); box-shadow: var(--shadow-soft); transform: translateY(-5px); }
.card-media { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .65s var(--ease), filter .4s ease; }
.card:hover .card-media { transform: scale(1.025); }
.card-overlay { position: absolute; inset: auto 0 0; display: flex; min-height: 46%; padding: 44px 14px 14px; flex-direction: column; justify-content: flex-end; background: rgba(16,14,11,.78); color: #f4eee4; opacity: 0; transform: translateY(8px); transition: opacity .28s ease, transform .28s var(--ease); }
.card:hover .card-overlay, .card:focus-within .card-overlay { opacity: 1; transform: translateY(0); }
.card-prompt { display: -webkit-box; overflow: hidden; font-family: var(--serif); font-size: 13px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.card-meta { display: flex; margin-top: 11px; align-items: center; justify-content: space-between; }
.card-model { color: rgba(244,238,228,.68); font-family: var(--mono); font-size: 8px; letter-spacing: .06em; text-transform: uppercase; }
.card-dl { padding: 4px 7px; border: 1px solid rgba(244,238,228,.26); color: #f4eee4; font-size: 9px; transition: border-color .2s ease, background-color .2s ease; }
.card-dl:hover { border-color: rgba(244,238,228,.6); background: rgba(244,238,228,.09); }
.card-generating { position: relative; display: flex; height: 100%; padding: 20px; gap: 14px; align-items: center; justify-content: center; flex-direction: column; overflow: hidden; }
.card-generating::before { content: ""; position: absolute; inset: 0; border: 1px solid transparent; background: var(--surface-2); opacity: .45; animation: pulse-opacity 2s ease-in-out infinite; }
.gen-ring { position: relative; z-index: 1; width: 32px; height: 32px; border: 1px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .9s linear infinite; }
.gen-text { position: relative; z-index: 1; min-height: 38px; color: var(--quiet); font-size: 11px; line-height: 1.7; text-align: center; }
.gen-model { color: var(--muted); }
.gen-status { display: block; }
.gen-bar { position: relative; z-index: 1; width: 62%; height: 1px; overflow: hidden; background: var(--line); }
.gen-bar i { display: block; width: 38%; height: 100%; background: var(--accent); animation: progress-slide 1.5s ease-in-out infinite; }
.card-failed { display: flex; height: 100%; padding: 22px; gap: 10px; align-items: center; justify-content: center; flex-direction: column; text-align: center; }
.fail-icon { width: 26px; color: var(--danger); }
.fail-msg { color: var(--quiet); font-size: 11px; line-height: 1.55; word-break: break-word; }
.fail-retry { margin-top: 4px; padding: 6px 10px; border-bottom: 1px solid var(--danger); color: var(--text); font-size: 10px; transition: color .2s ease, transform .2s var(--ease); }
.fail-retry:hover { color: var(--danger); transform: translateY(-1px); }
.card.is-unknown { cursor: default; border-color: rgba(197,162,93,.3); }
.card.is-unknown:hover { box-shadow: none; transform: none; }
.card-unknown { display: flex; height: 100%; padding: 24px; gap: 10px; align-items: center; justify-content: center; flex-direction: column; text-align: center; }
.unknown-icon { width: 27px; color: var(--warn); }
.unknown-title { color: var(--text); font-family: var(--serif); font-size: 15px; }
.unknown-msg { max-width: 27rem; color: var(--quiet); font-size: 10.5px; line-height: 1.65; text-wrap: pretty; }

.stage-empty, .view-empty { display: flex; color: var(--quiet); align-items: center; justify-content: center; flex-direction: column; text-align: center; }
.stage-empty { margin: auto; padding: 72px 0 20px; }
.view-empty { flex: 1; min-height: 360px; }
.stage-empty p, .view-empty p { margin-top: 18px; color: var(--muted); font-family: var(--serif); font-size: 18px; }
.stage-empty > span, .view-empty > span { margin-top: 6px; font-size: 11px; }
.empty-mark { display: grid; width: 58px; height: 58px; place-items: center; border: 1px solid var(--line-strong); color: var(--quiet); font-family: var(--mono); font-size: 9px; transform: rotate(45deg); }
.empty-mark span { transform: rotate(-45deg); }
body.workspace .stage-empty { display: none; }

/* Bottom composer dock */
.dock { position: relative; z-index: 30; display: flex; padding: 18px clamp(18px, 4vw, 48px) max(16px, env(safe-area-inset-bottom)); flex: 0 0 auto; align-items: center; flex-direction: column; background: var(--bg); border-top: 1px solid transparent; }
.dock::before { content: ""; position: absolute; top: 0; width: min(100%, 940px); height: 1px; background: var(--line); }
.dock .composer { width: min(100%, 940px); margin-left: 0; box-shadow: none; }
.dock-hint { margin-bottom: 8px; color: var(--quiet); font-family: var(--mono); font-size: 8px; letter-spacing: .1em; opacity: 0; transform: translateY(4px); transition: opacity .25s ease, transform .25s var(--ease); pointer-events: none; }
.dock.compact-mode .dock-hint { opacity: 1; transform: translateY(0); }
.dock .composer.compact { padding-top: 10px; padding-bottom: 10px; }
.dock .composer.compact .composer-label { display: none; }
.dock .composer.compact .prompt-input { min-height: 25px; max-height: 25px; font-size: 14px; }
.dock .composer.compact .composer-bar { margin-top: 3px; }
.dock .composer.compact .chips .chip:not(.model-chip):not(.attach-chip):not(.mode-chip) { display: none; }
.dock .composer.compact .attach-tray { display: none; }
.dock .composer.compact .attach-chip.has-att::after { content: attr(data-count); padding: 0 4px; background: var(--surface-3); color: var(--text); font-family: var(--mono); font-size: 8px; }

/* Assets */
#viewAssets, #viewAdmin { overflow-y: auto; padding-bottom: 72px; }
.asset-filters { display: flex; border-bottom: 1px solid var(--line); }
.af-btn { position: relative; min-width: 64px; padding: 8px 10px; color: var(--quiet); font-size: 11px; transition: color .2s ease; }
.af-btn::after { content: ""; position: absolute; right: 8px; bottom: -1px; left: 8px; height: 1px; background: var(--accent); transform: scaleX(0); transition: transform .22s var(--ease); }
.af-btn:hover, .af-btn.active { color: var(--text); }
.af-btn.active::after { transform: scaleX(1); }
.asset-grid { width: 100%; max-width: 1540px; margin: 0 auto; padding: 16px clamp(24px, 4vw, 64px) 0; }

/* Integrated tool */
#viewTools { overflow: hidden; }
.tool-wrap { position: relative; min-height: 0; flex: 1; margin: 0 clamp(24px, 4vw, 64px) 34px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.tool-frame { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.tool-offline { position: absolute; inset: 0; display: grid; padding: clamp(26px, 6vw, 78px); grid-template-columns: minmax(160px, .7fr) minmax(320px, 1.3fr); grid-template-rows: auto auto auto auto 1fr; column-gap: clamp(44px, 9vw, 130px); align-content: center; }
.tool-offline-index { grid-column: 1 / -1; margin-bottom: 54px; color: var(--quiet); font-family: var(--mono); font-size: 9px; letter-spacing: .14em; }
.tool-offline-icon { display: grid; width: min(100%, 240px); aspect-ratio: 1; grid-column: 1; grid-row: 2 / 6; place-items: center; border: 1px solid var(--line); color: var(--accent); }
.tool-offline-icon svg { width: 84px; }
.tool-offline h3 { grid-column: 2; font-family: var(--serif); font-size: clamp(32px, 4vw, 58px); font-weight: 400; letter-spacing: -.045em; line-height: 1; }
.tool-offline p { grid-column: 2; max-width: 580px; margin-top: 18px; color: var(--muted); font-size: 13px; line-height: 1.85; }
.tool-specs { display: flex; grid-column: 2; margin-top: 24px; gap: 18px; flex-wrap: wrap; color: var(--quiet); font-family: var(--mono); font-size: 9px; letter-spacing: .07em; }
.tool-specs span { padding-bottom: 5px; border-bottom: 1px solid var(--line-strong); }
.tool-actions { display: flex; grid-column: 2; margin-top: 34px; gap: 10px; }
.tool-start-btn { min-height: 44px; padding: 0 22px; background: var(--accent); color: var(--accent-text); font-size: 11px; font-weight: 650; letter-spacing: .08em; transition: background-color .2s ease, transform .2s var(--ease); }
.tool-start-btn:hover { background: var(--accent-hover); transform: translateY(-2px); }
.tool-start-btn:active { transform: scale(.98); }
.tool-start-btn.ghost { border: 1px solid var(--line-strong); background: transparent; color: var(--text); }
.tool-start-btn.ghost:hover { background: var(--surface-2); }
.tool-start-btn:disabled { opacity: .4; transform: none; }
.tool-status { grid-column: 2; min-height: 18px; margin-top: 13px; color: var(--quiet); font-size: 10px; }

/* Admin */
.admin-summary { display: flex; max-width: 660px; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.sum-chip { padding: 6px 9px; border: 1px solid var(--line); color: var(--muted); font-family: var(--mono); font-size: 9px; font-variant-numeric: tabular-nums; }
.sum-chip.warn { border-color: rgba(197,162,93,.45); color: var(--warn); }
.admin-list { display: flex; width: 100%; max-width: 1540px; margin: 0 auto; padding: 16px clamp(24px, 4vw, 64px) 60px; gap: 10px; flex-direction: column; }
.acc-card { overflow: hidden; border: 1px solid var(--line); background: var(--surface); transition: border-color .22s ease, box-shadow .22s ease; }
.acc-card:hover, .acc-card.open { border-color: var(--line-strong); }
.acc-card.open { box-shadow: var(--shadow-soft); }
.acc-head { display: flex; width: 100%; min-height: 76px; padding: 14px 18px; gap: 14px; align-items: center; text-align: left; }
.acc-avatar { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line-strong); color: var(--muted); font-family: var(--serif); font-size: 16px; }
.acc-main { display: flex; min-width: 0; flex: 1; gap: 3px; flex-direction: column; }
.acc-email { display: flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 600; }
.acc-sub { color: var(--quiet); font-family: var(--mono); font-size: 9px; }
.acc-side { display: flex; gap: 13px; align-items: center; }
.acc-balance { font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.acc-chev { width: 10px; color: var(--quiet); transition: transform .25s var(--ease); }
.acc-card.open .acc-chev { transform: rotate(180deg); }
.role-badge, .status-badge { padding: 2px 6px; border: 1px solid var(--line); font-family: var(--mono); font-size: 8px; font-weight: 400; white-space: nowrap; }
.role-badge { border-color: rgba(197,162,93,.4); color: var(--warn); }
.status-badge.approved, .status-badge.succeeded { border-color: rgba(125,154,120,.4); color: var(--ok); }
.status-badge.pending, .status-badge.pending-task { border-color: rgba(197,162,93,.4); color: var(--warn); }
.status-badge.rejected, .status-badge.failed { border-color: rgba(208,107,88,.4); color: var(--danger); }
.status-badge.running { border-color: rgba(182,95,63,.4); color: var(--accent-hover); }
.status-badge.unknown { border-color: rgba(197,162,93,.45); color: var(--warn); }
.acc-detail { padding: 20px; border-top: 1px solid var(--line); animation: detail-in .25s var(--ease) both; }
.acc-actions { display: flex; gap: 32px; align-items: flex-end; flex-wrap: wrap; }
.acc-field { display: flex; gap: 8px; align-items: center; }
.acc-field label, .acc-note { color: var(--quiet); font-size: 10px; }
.balance-input { width: 78px; height: 32px; padding: 0 8px; border: 1px solid var(--line); outline: 0; background: var(--bg); color: var(--text); font-family: var(--mono); font-size: 11px; }
.balance-input:focus { border-color: var(--accent); }
.admin-btn { padding: 7px 10px; border: 1px solid var(--line-strong); color: var(--muted); font-size: 10px; transition: color .2s ease, border-color .2s ease, background-color .2s ease; }
.admin-btn:hover { background: var(--surface-2); color: var(--text); }
.admin-btn.ok { border-color: rgba(125,154,120,.4); color: var(--ok); }
.admin-btn.no { border-color: rgba(208,107,88,.4); color: var(--danger); }
.acc-stats { display: grid; margin: 18px 0; grid-template-columns: repeat(4, minmax(100px, 1fr)); border: 1px solid var(--line); }
.stat-cell { display: flex; min-height: 72px; padding: 13px; gap: 4px; justify-content: center; flex-direction: column; border-right: 1px solid var(--line); color: var(--quiet); font-size: 9px; }
.stat-cell:last-child { border-right: 0; }
.stat-cell b { color: var(--text); font-family: var(--serif); font-size: 19px; font-weight: 400; font-variant-numeric: tabular-nums; }
.acc-gens { overflow: hidden; border: 1px solid var(--line); }
.acc-gen-row { display: grid; min-height: 42px; padding: 8px 12px; gap: 10px; grid-template-columns: 44px 1fr 130px 64px 70px 92px; align-items: center; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.acc-gen-row:last-child { border-bottom: 0; }
.acc-gen-row:nth-child(odd) { background: var(--surface-2); }
.g-kind, .g-model, .g-time { color: var(--quiet); font-size: 9px; }
.g-prompt, .g-model { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-prompt { color: var(--text); }
.g-cost { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.g-time { text-align: right; }
.g-status-stack { display: flex; gap: 5px; align-items: flex-start; flex-direction: column; }
.resolve-open { padding-bottom: 2px; border-bottom: 1px solid var(--warn); color: var(--warn); font-size: 9px; transition: color .2s ease, opacity .2s ease; }
.resolve-open:hover { color: var(--text); }
.resolve-open:disabled { opacity: .4; cursor: not-allowed; }
.admin-empty { padding: 34px; color: var(--quiet); font-size: 11px; text-align: center; }

/* Modal and preview */
.modal-mask { position: fixed; inset: 0; z-index: 300; display: grid; padding: 20px; place-items: center; background: rgba(12,10,8,.7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: fade-in .2s ease both; }
.modal { width: min(100%, 430px); border: 1px solid var(--line-strong); background: var(--surface); box-shadow: var(--shadow); animation: pop-in .32s var(--snap) both; }
.modal-head { display: flex; padding: 22px 22px 16px; align-items: flex-start; justify-content: space-between; }
.modal-head > div { display: flex; gap: 7px; flex-direction: column; }
.modal-head #settingsTitle { font-family: var(--serif); font-size: 22px; }
.modal-close { display: grid; width: 32px; height: 32px; place-items: center; color: var(--quiet); font-family: var(--serif); font-size: 24px; transition: color .2s ease, transform .2s var(--ease); }
.modal-close:hover { color: var(--text); transform: rotate(4deg); }
.modal-body { padding: 2px 22px 24px; }
.setting-label { margin-bottom: 11px; color: var(--quiet); font-size: 10px; }
.theme-options { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); }
.theme-opt { display: flex; min-height: 90px; padding: 12px 7px; gap: 8px; align-items: center; justify-content: center; flex-direction: column; border-right: 1px solid var(--line); color: var(--muted); font-size: 10px; transition: color .2s ease, background-color .2s ease; }
.theme-opt:last-child { border-right: 0; }
.theme-opt:hover, .theme-opt.active { background: var(--surface-2); color: var(--text); }
.theme-opt.active { box-shadow: inset 0 -2px var(--accent); }
.theme-swatch { width: 42px; height: 28px; border: 1px solid var(--line-strong); }
.sw-dark { background: #1d1b17; }
.sw-light { background: #eee8dc; }
.sw-auto { position: relative; overflow: hidden; background: #eee8dc; }
.sw-auto::before { content: ""; position: absolute; inset: 0 50% 0 0; background: #1d1b17; }

.resolve-modal { width: min(100%, 640px); }
.resolve-context { margin-bottom: 16px; padding: 12px 14px; border-left: 2px solid var(--warn); background: var(--surface-2); color: var(--muted); font-size: 11px; line-height: 1.65; }
.resolve-context b { display: block; overflow: hidden; margin-bottom: 2px; color: var(--text); font-family: var(--serif); font-size: 14px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.resolve-action-list { display: grid; margin-bottom: 18px; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); }
.resolve-choice { display: flex; min-height: 84px; padding: 12px; gap: 5px; justify-content: center; flex-direction: column; border-right: 1px solid var(--line); color: var(--quiet); text-align: left; transition: color .2s ease, background-color .2s ease; }
.resolve-choice:last-child { border-right: 0; }
.resolve-choice:hover, .resolve-choice.active { background: var(--surface-2); color: var(--muted); }
.resolve-choice.active { box-shadow: inset 0 -2px var(--warn); }
.resolve-choice b { color: var(--text); font-size: 11px; font-weight: 600; }
.resolve-choice span { font-size: 9px; line-height: 1.5; }
.resolve-field { display: flex; margin-top: 14px; gap: 7px; flex-direction: column; color: var(--quiet); font-size: 10px; }
.resolve-field input, .resolve-field textarea { width: 100%; padding: 10px 11px; resize: vertical; border: 1px solid var(--line); outline: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 11px; line-height: 1.55; transition: border-color .2s ease; }
.resolve-field input:focus, .resolve-field textarea:focus { border-color: var(--warn); }
.resolve-field input::placeholder, .resolve-field textarea::placeholder { color: var(--quiet); }
.resolve-confirm { margin-top: 16px; color: var(--muted); font-size: 10px; line-height: 1.65; }
.resolve-confirm.warn { color: var(--warn); }
.resolve-footer { display: flex; margin-top: 20px; gap: 9px; justify-content: flex-end; }
.resolve-footer .tool-start-btn { min-width: 112px; }

.lightbox { position: fixed; inset: 0; z-index: 400; display: flex; padding: 36px; align-items: center; justify-content: center; flex-direction: column; background: rgba(12,10,8,.94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); animation: fade-in .25s ease both; }
.lightbox-close { position: absolute; top: 20px; right: 26px; display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid rgba(244,238,228,.2); color: rgba(244,238,228,.65); font-family: var(--serif); font-size: 28px; transition: color .2s ease, border-color .2s ease, transform .2s var(--ease); }
.lightbox-close:hover { border-color: rgba(244,238,228,.55); color: #f4eee4; transform: rotate(4deg); }
.lightbox-body { display: flex; max-width: 86vw; max-height: 78vh; align-items: center; justify-content: center; }
.lightbox-body img, .lightbox-body video { max-width: 86vw; max-height: 78vh; box-shadow: 18px 18px 0 rgba(244,238,228,.06); animation: scale-in .35s var(--snap) both; }
.lightbox-meta { max-width: 68rem; margin-top: 22px; color: rgba(244,238,228,.65); font-family: var(--serif); font-size: 12px; line-height: 1.7; text-align: center; }

.toast { position: fixed; top: 20px; left: 50%; z-index: 600; max-width: calc(100vw - 32px); padding: 11px 16px; border: 1px solid var(--line-strong); border-left: 2px solid var(--accent); background: var(--veil); color: var(--text); box-shadow: var(--shadow-soft); font-size: 11px; transform: translateX(-50%); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); animation: toast-in .3s var(--snap) both; }
.toast.error { border-left-color: var(--danger); }

/* Motion */
@keyframes rise-in { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes view-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(9px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes scale-in { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }
@keyframes detail-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse-opacity { 50% { opacity: .62; } }
@keyframes progress-slide { from { transform: translateX(-110%); } to { transform: translateX(270%); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Responsive */
@media (max-width: 1080px) {
  .sidebar { width: 72px; padding-right: 13px; padding-left: 13px; }
  .sidebar .brand-text, .sidebar .nav-label, .sidebar .nav-item span, .sidebar .user-info, .sidebar .logout-btn, .sidebar .rail-toggle { display: none; }
  .sidebar .brand { padding-left: 4px; }
  .sidebar .nav { margin-top: 42px; }
  .sidebar .nav-item { padding-right: 14px; padding-left: 14px; }
  .hero { grid-template-columns: 1fr .72fr; gap: 46px; }
  .hero-footnote { display: none; }
  .composer, .inspire { margin-left: 0; }
  .tool-offline { grid-template-columns: 160px 1fr; column-gap: 44px; }
}

@media (max-width: 760px) {
  body { overflow: hidden; }
  #app { display: block; }
  .auth-screen { grid-template-columns: 1fr; overflow-y: auto; }
  .auth-story { min-height: 38vh; padding: 26px 24px 34px; }
  .auth-statement { margin-top: 60px; }
  .auth-statement h1 { font-size: clamp(42px, 13vw, 62px); }
  .auth-statement p { margin-top: 20px; }
  .auth-index { display: none; }
  .auth-panel { padding: 42px 24px max(36px, env(safe-area-inset-bottom)); align-items: flex-start; }
  .auth-brand { margin-bottom: 46px; }

  .sidebar, .sidebar.rail {
    position: fixed;
    inset: auto 0 0;
    z-index: 100;
    display: grid;
    width: 100%;
    height: calc(66px + env(safe-area-inset-bottom));
    padding: 8px 10px env(safe-area-inset-bottom);
    grid-template-columns: 1fr auto;
    border-top: 1px solid var(--line);
    border-right: 0;
    background: var(--veil);
    box-shadow: none;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }
  .sidebar:hover, .sidebar.rail:hover { width: 100%; box-shadow: none; }
  .sidebar .brand, .sidebar .nav-label, .sidebar .side-spacer, .sidebar .user-card { display: none; }
  .sidebar .nav, .sidebar:hover .nav { display: grid; margin: 0; grid-template-columns: repeat(auto-fit, minmax(52px, 1fr)); }
  .sidebar .nav-item, .sidebar:hover .nav-item, .sidebar.rail .nav-item { display: flex; min-height: 50px; padding: 5px 8px; gap: 3px; justify-content: center; flex-direction: column; font-size: 9px; text-align: center; transform: none; }
  .sidebar .nav-item span, .sidebar:hover .nav-item span, .sidebar.rail .nav-item span { display: inline; opacity: 1; }
  .nav-item::before { inset: auto 18px 1px; width: auto; height: 2px; transform: scaleX(.3); }
  .nav-item.active::before { transform: scaleX(1); }
  .side-bottom { display: block; }
  .side-bottom #settingsBtn { width: 48px; }
  .side-bottom #settingsBtn span { display: inline; }

  .main { height: calc(100dvh - 66px - env(safe-area-inset-bottom)); }
  .view-head { padding: 28px 18px 20px; align-items: flex-start; flex-direction: column; }
  .view-title { font-size: 38px; }
  .stage { padding: 0 18px 80px; }
  .hero { margin: 42px auto 32px; grid-template-columns: 1fr; gap: 32px; }
  .hero-title { font-size: clamp(46px, 13vw, 64px); }
  .hero-lede { margin-top: 20px; }
  .hero-control { width: 100%; }
  .mode-btn { padding: 0 8px; }
  .composer { padding: 15px 13px 12px; box-shadow: 6px 6px 0 var(--surface-2); }
  .composer:focus-within { box-shadow: 7px 7px 0 var(--surface-2); }
  .prompt-input { min-height: 92px; font-size: 17px; }
  .composer-bar { align-items: flex-end; }
  .chips { gap: 5px; }
  .chip { padding: 0 8px; }
  .chip .chip-label { max-width: 102px; }
  .inspire { align-items: flex-start; }
  .inspire-label { width: 100%; }
  .results { margin-top: 12vh; }
  .result-grid, .asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-overlay { opacity: 1; transform: none; }
  .asset-filters { align-self: stretch; }
  .asset-grid { padding: 6px 18px 0; }
  .dock { padding: 10px 12px 8px; }
  .dock-hint { display: none; }
  .dock .composer.compact .kind-mini { display: none; }
  .dock .composer.compact .model-chip { max-width: 140px; }

  .tool-wrap { margin: 0 18px 22px; overflow-y: auto; }
  .tool-offline { position: relative; min-height: 100%; padding: 28px 20px 36px; grid-template-columns: 1fr; grid-template-rows: auto; text-align: left; }
  .tool-offline-index, .tool-offline-icon, .tool-offline h3, .tool-offline p, .tool-specs, .tool-actions, .tool-status { grid-column: 1; grid-row: auto; }
  .tool-offline-index { margin-bottom: 26px; }
  .tool-offline-icon { width: 110px; margin-bottom: 28px; }
  .tool-offline-icon svg { width: 48px; }
  .tool-offline h3 { font-size: 36px; }
  .tool-actions { flex-direction: column; }
  .tool-start-btn { width: 100%; }
  .tool-frame { min-height: 100%; }

  .admin-summary { justify-content: flex-start; }
  .admin-list { padding: 6px 18px 48px; }
  .acc-head { align-items: flex-start; }
  .acc-side { gap: 7px; flex-direction: column; align-items: flex-end; }
  .acc-actions { gap: 14px; flex-direction: column; align-items: stretch; }
  .acc-field { flex-wrap: wrap; }
  .acc-stats { grid-template-columns: 1fr 1fr; }
  .stat-cell:nth-child(2) { border-right: 0; }
  .stat-cell:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .acc-gens { overflow-x: auto; }
  .acc-gen-row { min-width: 720px; }
  .lightbox { padding: 24px 14px; }
  .lightbox-body, .lightbox-body img, .lightbox-body video { max-width: 94vw; }
  .resolve-action-list { grid-template-columns: 1fr; }
  .resolve-choice { min-height: 64px; border-right: 0; border-bottom: 1px solid var(--line); }
  .resolve-choice:last-child { border-bottom: 0; }
  .resolve-footer { flex-direction: column-reverse; }
  .resolve-footer .tool-start-btn { width: 100%; }
}

@media (max-width: 430px) {
  .auth-panel { padding-right: 20px; padding-left: 20px; }
  .stage { padding-right: 12px; padding-left: 12px; }
  .hero { padding-right: 6px; padding-left: 6px; }
  .hero-title { font-size: 45px; }
  .result-grid, .asset-grid { grid-template-columns: 1fr; }
  .chips .chip:not(.model-chip):not(.attach-chip):not(#ratioChip) { display: none; }
  .modal-mask { padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ==========================================================================
   LUMINA SPECTRAL STUDIO
   Adaptive light/dark product system: colored media, mineral controls,
   compact editorial density, deliberate (non-ambient) motion.
   ========================================================================== */
:root,
[data-theme="dark"] {
  --studio-bg: #0b1112;
  --studio-side: #0e1516;
  --studio-panel: #121a1b;
  --studio-panel-2: #172122;
  --studio-panel-3: #1e2a2a;
  --studio-line: rgba(223, 235, 228, .10);
  --studio-line-strong: rgba(223, 235, 228, .19);
  --studio-text: #eef0e9;
  --studio-muted: #a4aaa4;
  --studio-quiet: #737d78;
  --studio-accent: #6aa69a;
  --studio-accent-strong: #8bc1b4;
  --studio-accent-soft: rgba(106, 166, 154, .15);
  --studio-focus: #8dd8e5;
  --studio-focus-soft: rgba(141, 216, 229, .13);
  --studio-ok: #85b89f;
  --studio-danger: #d98376;
  --accent-text: #071110;
  --accent-hover: #91c9bb;
  --workspace-max: 1660px;
  --workspace-gutter: clamp(22px, 2.2vw, 44px);
  --shadow: 0 34px 90px rgba(0, 0, 0, .42);
  --shadow-soft: 0 18px 50px rgba(0, 0, 0, .24);
  color-scheme: dark;
}

[data-theme="light"] {
  --studio-bg: #f3f0e8;
  --studio-side: #ece9df;
  --studio-panel: #faf8f2;
  --studio-panel-2: #e9e7df;
  --studio-panel-3: #dcded6;
  --studio-line: rgba(24, 39, 37, .11);
  --studio-line-strong: rgba(24, 39, 37, .20);
  --studio-text: #17201e;
  --studio-muted: #5f6965;
  --studio-quiet: #858e89;
  --studio-accent: #39796e;
  --studio-accent-strong: #255f56;
  --studio-accent-soft: rgba(57, 121, 110, .12);
  --studio-focus: #2b8395;
  --studio-focus-soft: rgba(43, 131, 149, .12);
  --studio-ok: #39796e;
  --studio-danger: #a7473b;
  --accent-text: #f8fbf7;
  --accent-hover: #285f56;
  --shadow: 0 30px 80px rgba(55, 52, 40, .17);
  --shadow-soft: 0 16px 44px rgba(55, 52, 40, .12);
  color-scheme: light;
}

body,
#app,
.main,
.view,
#viewCreate { background: var(--studio-bg); color: var(--studio-text); }

#app { transition: background-color .24s ease, color .24s ease; }

.sidebar,
.sidebar:hover {
  width: 190px;
  min-width: 190px;
  padding: 18px 12px 14px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--studio-side) 96%, var(--studio-accent) 4%), var(--studio-side));
  transition: width .34s cubic-bezier(.22,.8,.24,1), min-width .34s cubic-bezier(.22,.8,.24,1), background-color .2s ease;
}
.sidebar .rail-toggle {
  display: grid !important;
  position: absolute;
  right: -12px;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--studio-line-strong);
  border-radius: 50%;
  background: var(--studio-panel);
  color: var(--studio-muted);
  box-shadow: var(--shadow-soft);
}
.sidebar .rail-toggle svg { width: 13px; transition: transform .3s ease; }
.sidebar.rail,
.sidebar.rail:hover { width: 74px; min-width: 74px; }
.sidebar.rail .rail-toggle svg { transform: rotate(180deg); }
.sidebar.rail .brand { justify-content: center; }
.sidebar.rail .brand-text,
.sidebar.rail .nav-label,
.sidebar.rail .nav-item span,
.sidebar.rail .nav-new,
.sidebar.rail .user-info {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}
.sidebar.rail .nav-item,
.sidebar.rail:hover .nav-item { justify-content: center; padding: 0; gap: 0; }
.sidebar.rail .side-bottom .nav-item { justify-content: center; }
.sidebar.rail .user-card { justify-content: center; padding: 7px 0; }
.sidebar .brand-text,
.sidebar .nav-item span,
.sidebar .user-info { transition: opacity .18s ease, max-width .28s ease; }
.sidebar .brand-mark { background: linear-gradient(145deg, var(--studio-panel-3), var(--studio-panel)); }
.sidebar .nav-item.active { border-color: color-mix(in srgb, var(--studio-accent) 35%, transparent); background: var(--studio-accent-soft); }
.sidebar .nav-item.active::before { background: var(--studio-accent); box-shadow: 0 0 14px var(--studio-focus-soft); }
.sidebar .nav-item:hover { background: color-mix(in srgb, var(--studio-panel-2) 82%, transparent); }
.sidebar .account-popover { left: calc(100% + 12px); min-width: 292px; padding: 18px; border-color: var(--studio-line-strong); background: color-mix(in srgb, var(--studio-panel) 94%, transparent); backdrop-filter: blur(28px) saturate(1.2); }
.account-logout { display: flex; width: 100%; margin-top: 14px; padding: 12px 0 0; justify-content: space-between; border-top: 1px solid var(--studio-line); color: var(--studio-muted); font-size: 11px; }
.account-logout:hover { color: var(--studio-danger); }

.stage {
  padding: 0 var(--workspace-gutter) 70px;
  background:
    radial-gradient(circle at 48% -5%, var(--studio-focus-soft), transparent 28%),
    linear-gradient(180deg, color-mix(in srgb, var(--studio-bg) 94%, var(--studio-accent) 6%), var(--studio-bg) 46%);
}
.stage::after { display: none; }
.hero,
body.workspace .hero {
  width: min(100%, 1180px);
  padding: clamp(34px, 5vh, 58px) 0 16px;
  gap: 16px;
}
.hero-copy .eyebrow { display: block; margin-bottom: 11px; color: var(--studio-accent); font-size: 8px; letter-spacing: .24em; }
.hero-title { font-size: clamp(38px, 4.4vw, 66px); font-weight: 620; letter-spacing: -.07em; }
.hero-lede { max-width: 640px; margin-top: 12px; font-size: 12px; }
.mode-switch { background: color-mix(in srgb, var(--studio-panel) 86%, transparent); border-color: var(--studio-line-strong); }
.mode-slider { background: var(--studio-accent); }

.composer,
body.workspace .composer {
  width: min(100%, 1180px);
  min-height: 164px;
  padding: 18px 20px 15px;
  border-color: var(--studio-line-strong);
  border-radius: 18px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--studio-panel) 96%, var(--studio-focus) 4%), var(--studio-panel));
  box-shadow: var(--shadow-soft), inset 0 1px color-mix(in srgb, var(--studio-text) 6%, transparent);
  transition: min-height .34s cubic-bezier(.22,.8,.24,1), padding .34s cubic-bezier(.22,.8,.24,1), border-color .2s ease, box-shadow .2s ease;
}
.composer-glow { display: block; position: absolute; inset: -1px; z-index: -1; border-radius: inherit; opacity: 0; background: linear-gradient(110deg, transparent 12%, var(--studio-focus-soft), transparent 62%); pointer-events: none; }
.composer:focus-within { border-color: color-mix(in srgb, var(--studio-focus) 58%, var(--studio-line-strong)); box-shadow: 0 20px 58px color-mix(in srgb, var(--studio-focus) 10%, transparent), 0 0 0 3px var(--studio-focus-soft); }
.composer:focus-within .composer-glow { opacity: 1; }
.prompt-input::placeholder { color: var(--studio-quiet); }
.kind-mini,
.chip { background: color-mix(in srgb, var(--studio-panel-2) 74%, transparent); }
.km-btn.active { background: var(--studio-accent); color: var(--accent-text); }
.mode-chip .mode-dot { background: var(--studio-focus); box-shadow: 0 0 0 4px var(--studio-focus-soft); }
.send-btn { background: var(--studio-accent); color: var(--accent-text); box-shadow: 0 10px 28px color-mix(in srgb, var(--studio-accent) 24%, transparent); }

.inspiration-reel,
body.workspace .inspiration-reel { width: min(100%, var(--workspace-max)); margin-top: 22px; }
.reel-head { margin-top: 30px; }
.reel-grid { grid-template-columns: 1.38fr 1fr 1fr 1.18fr; grid-auto-rows: clamp(190px, 15vw, 258px); gap: 12px; }
.inspire-chip.reel-card,
.reel-card:nth-child(1),
.reel-card:nth-child(2),
.reel-card:nth-child(3),
.reel-card:nth-child(4) { height: 100%; min-height: 190px; border-radius: 15px; }
.reel-card img,
.reel-card video { width: 100%; height: 100%; object-fit: cover; filter: none; transform: scale(1.001); transition: transform .6s cubic-bezier(.2,.8,.2,1), filter .25s ease; }
.reel-card:hover img,
.reel-card:hover video { filter: none; transform: scale(1.035); }
.reel-card:focus-visible { outline: 2px solid var(--studio-focus); outline-offset: 3px; }
.reel-head .eyebrow { color: var(--studio-accent); }
.prompt-suggestion:hover { border-color: color-mix(in srgb, var(--studio-accent) 50%, var(--studio-line)); background: var(--studio-accent-soft); }

body.workspace .stage { padding-bottom: 116px; }
.results,
body.workspace .results { width: min(100%, var(--workspace-max)); margin-top: 20px; }
.generation-project { margin-bottom: 22px; }
.project-output-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.project-output-grid .card { max-width: none; }
.card-overlay { background: linear-gradient(180deg, transparent 18%, rgba(5,12,13,.9)); }
.card-config { margin-top: 5px; color: rgba(235, 241, 237, .66); font-size: 9px; }
.card-actions { display: flex; gap: 6px; }
.card-action,
.card-dl { min-height: 28px; padding: 0 10px; border: 1px solid rgba(255,255,255,.2); border-radius: 7px; background: rgba(7,14,15,.56); color: #f0f4ef; font-size: 9px; backdrop-filter: blur(12px); }
.card-action:hover,
.card-dl:hover { border-color: rgba(255,255,255,.5); background: rgba(242,247,242,.92); color: #101817; }
.asset-card-check { display: none; position: absolute; top: 12px; right: 12px; z-index: 8; width: 28px; height: 28px; place-items: center; border: 1px solid rgba(255,255,255,.32); border-radius: 8px; background: rgba(7,14,15,.58); backdrop-filter: blur(12px); cursor: pointer; }
.asset-card-check input { position: absolute; opacity: 0; }
.asset-card-check span { width: 12px; height: 12px; border: 1px solid rgba(255,255,255,.72); border-radius: 3px; }
.asset-card-check input:checked + span { border-color: var(--studio-focus); background: var(--studio-focus); box-shadow: inset 0 0 0 3px rgba(7,14,15,.72); }

body.workspace .dock {
  padding: 8px var(--workspace-gutter) max(10px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--studio-bg) 94%, transparent) 24%, var(--studio-bg));
}
body.workspace .composer.compact { width: min(100%, 1180px); min-height: 96px; }
body.workspace .composer.compact:not(.expanded) { min-height: 64px; padding: 9px 12px; }
body.workspace .composer.compact:not(.expanded) .prompt-input { height: 23px; min-height: 23px; max-height: 23px; font-size: 12px; }
body.workspace .composer.compact:not(.expanded) .attach-tray,
body.workspace .composer.compact:not(.expanded) .chip:not(.model-chip):not(.mode-chip),
body.workspace .composer.compact:not(.expanded) .kind-mini { display: none !important; }
body.workspace .composer.compact:not(.expanded) .composer-bar { margin-top: 2px; }
body.workspace .composer.compact.expanded { min-height: 142px; padding: 16px 18px 13px; border-color: color-mix(in srgb, var(--studio-focus) 42%, var(--studio-line-strong)); box-shadow: 0 24px 70px rgba(0,0,0,.28), 0 0 0 3px var(--studio-focus-soft); }
body.workspace .composer.compact.expanded .prompt-input { min-height: 60px; max-height: 112px; font-size: 16px; }
body.workspace .composer.dock-arrived { animation: dock-arrive .48s cubic-bezier(.16,.9,.25,1) both; }
@keyframes dock-arrive { from { opacity: .3; transform: translateY(22px) scale(.985); } to { opacity: 1; transform: none; } }

.view-head,
.ai-tools-hero,
.tool-wrap,
.ai-tools-toolbar,
.ai-library-layout,
.ai-task-section,
.admin-list,
.asset-toolbar,
.asset-grid,
.asset-pagination {
  width: calc(100% - (var(--workspace-gutter) * 2));
  max-width: var(--workspace-max);
  margin-right: auto;
  margin-left: auto;
}
.view-head { padding: 40px 0 22px; }
.view-title { font-size: clamp(34px, 3.4vw, 52px); }
.asset-toolbar { display: flex; min-height: 50px; padding: 10px 0; gap: 10px; align-items: center; border-bottom: 1px solid var(--studio-line); }
.asset-toolbar button,
.asset-pagination button,
.asset-pagination select { min-height: 32px; padding: 0 12px; border: 1px solid var(--studio-line); border-radius: 8px; background: var(--studio-panel); color: var(--studio-muted); font-size: 10px; }
.asset-toolbar button:not(:disabled):hover,
.asset-pagination button:not(:disabled):hover { border-color: var(--studio-accent); color: var(--studio-text); }
.asset-toolbar button:disabled,
.asset-pagination button:disabled { opacity: .36; }
.asset-select-page { display: flex; gap: 8px; align-items: center; color: var(--studio-text); font-size: 11px; }
.asset-selection-count { margin-right: auto; color: var(--studio-quiet); font-size: 10px; }
.asset-grid { padding: 16px 0 22px; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
#viewAssets .card,
#viewAssets .card.r-square,
#viewAssets .card.r-tall,
#viewAssets .card.r-wide { min-height: 0; aspect-ratio: 4 / 3; border-radius: 13px; }
#viewAssets .asset-card-check { display: grid; }
#viewAssets .card-overlay { opacity: 0; transition: opacity .2s ease; }
#viewAssets .card:hover .card-overlay,
#viewAssets .card:focus-within .card-overlay { opacity: 1; }
.asset-pagination { display: flex; padding: 12px 0 40px; gap: 10px; align-items: center; justify-content: center; color: var(--studio-muted); font-size: 10px; }
.asset-pagination label { display: flex; margin-left: 8px; gap: 7px; align-items: center; }

.tool-wrap { height: calc(100dvh - 130px); min-height: 660px; margin-top: 14px; border-radius: 14px; }
.tool-frame { width: 100%; height: 100%; }

.ai-tools-hero { padding: 40px 0 22px; grid-template-columns: minmax(0,1fr) 360px; gap: 38px; }
.ai-tools-copy h2 { font-size: clamp(38px, 4.2vw, 64px); }
.ai-tools-copy h2 span { color: var(--studio-accent); }
.ai-tools-toolbar { padding: 14px 0; }
.ai-library-layout { grid-template-columns: minmax(0,1fr) minmax(360px, 430px); }
.ai-tool-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
.ai-tool-card,
.ai-tool-card:first-child { min-height: 315px; grid-column: auto; }
.ai-tool-card:first-child .ai-tool-visual,
.ai-tool-visual { height: 160px; }
.ai-tool-card:first-child .ai-tool-card-copy strong,
.ai-tool-card-copy strong { font-size: 21px; }
.ai-tool-cover,
.ai-tool-card:hover .ai-tool-cover,
.ai-tool-card.selected .ai-tool-cover { filter: none; }
.ai-tool-card:hover { border-color: color-mix(in srgb, var(--studio-focus) 48%, var(--studio-line)); transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.ai-tool-card.selected { border-color: var(--studio-accent); box-shadow: inset 3px 0 var(--studio-accent); }
.ai-workbench { min-height: 540px; }

#viewAdmin .view-head,
#viewAdmin .admin-list { max-width: var(--workspace-max); }
.admin-list { padding: 16px 0 50px; }
.acc-card { border-radius: 13px; background: var(--studio-panel); }
.acc-head { min-height: 76px; }
.acc-detail { padding: 0 18px 18px; }
.acc-stats { grid-template-columns: repeat(4, 1fr); }
.acc-gen-row { grid-template-columns: 54px minmax(260px, 1.5fr) minmax(160px, .7fr) 80px 110px 110px; }
.g-content,
.g-model { display: flex; min-width: 0; gap: 4px; flex-direction: column; }
.g-content b { overflow: hidden; color: var(--studio-text); font-weight: 540; text-overflow: ellipsis; white-space: nowrap; }
.g-content small,
.g-model small { color: var(--studio-quiet); font-size: 8px; }

.theme-options { grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme-options .theme-opt { display: grid; min-height: 104px; padding: 12px; grid-template-columns: 44px minmax(0,1fr); gap: 11px; align-items: center; border: 1px solid var(--studio-line); border-radius: 12px; text-align: left; }
.theme-options .theme-opt.active { border-color: var(--studio-accent); background: var(--studio-accent-soft); box-shadow: 0 0 0 3px var(--studio-focus-soft); }
.theme-opt > span:last-child { display: flex; gap: 5px; flex-direction: column; }
.theme-opt b { color: var(--studio-text); font-size: 12px; }
.theme-opt small { color: var(--studio-muted); font-size: 9px; line-height: 1.45; }
.theme-swatch { width: 44px; height: 58px; border: 1px solid var(--studio-line-strong); border-radius: 9px; }
.sw-light { background: linear-gradient(145deg, #f3f0e8 55%, #39796e 56%); }
.sw-dark { background: linear-gradient(145deg, #0b1112 55%, #6aa69a 56%); }
.sw-system { background: linear-gradient(145deg, #f3f0e8 49%, #0b1112 50% 72%, #6aa69a 73%); }

[data-theme="light"] .mode-switch { background: rgba(250,248,242,.86); }
[data-theme="light"] .reel-shade { background: linear-gradient(180deg, rgba(5,10,10,.02) 32%, rgba(5,10,10,.72)); }
[data-theme="light"] body.workspace .dock { background: linear-gradient(180deg, transparent, rgba(243,240,232,.94) 28%, #f3f0e8); }
[data-theme="light"] .card-overlay { color: #f7faf6; }

@media (max-width: 1320px) {
  .reel-grid { grid-template-columns: repeat(2, minmax(0,1fr)); grid-auto-rows: 230px; }
  .asset-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .ai-tool-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .ai-library-layout { grid-template-columns: minmax(0,1fr) 370px; }
}

@media (max-width: 920px) {
  .sidebar,
  .sidebar:hover { width: 154px; min-width: 154px; }
  .sidebar.rail,
  .sidebar.rail:hover { width: 68px; min-width: 68px; }
  .asset-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .ai-tools-hero,
  .ai-library-layout { grid-template-columns: 1fr; }
  .ai-workbench { position: relative; top: auto; }
  .acc-gen-row { grid-template-columns: 46px minmax(160px,1fr) 120px 70px 90px; }
  .g-time { display: none; }
}

@media (max-width: 760px) {
  .sidebar,
  .sidebar:hover,
  .sidebar.rail,
  .sidebar.rail:hover { width: 100%; min-width: 100%; }
  .sidebar .rail-toggle { display: none !important; }
  .sidebar.rail .nav-item span { max-width: none; opacity: 1; }
  .hero-title { font-size: clamp(38px, 12vw, 54px); }
  .reel-grid { display: flex; grid-auto-rows: auto; }
  .asset-grid { grid-template-columns: 1fr; }
  .asset-toolbar { flex-wrap: wrap; }
  .asset-selection-count { flex: 1; }
  .theme-options { grid-template-columns: 1fr; }
  .theme-options .theme-opt { min-height: 82px; }
  .ai-tool-grid { grid-template-columns: 1fr; }
  .acc-gen-row { grid-template-columns: 42px minmax(0,1fr) 76px; }
  .g-model,
  .g-status-stack,
  .g-time { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  body.workspace .composer.dock-arrived,
  .ai-tool-card { animation: none !important; transform: none !important; }
}

/* ========================================================================== 
   Reference-led workspace redesign · cool cinematic system
   ========================================================================== */
:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #090b0d;
  --bg-side: #0d1013;
  --surface: #12161a;
  --surface-2: #181d22;
  --surface-3: #22292f;
  --veil: rgba(13, 16, 19, .92);
  --line: rgba(232, 243, 244, .08);
  --line-strong: rgba(232, 243, 244, .16);
  --text: #f3f7f7;
  --muted: #a2adb2;
  --quiet: #67737a;
  --accent: #b9f1ee;
  --accent-hover: #d9fffc;
  --accent-text: #071011;
  --danger: #f08b83;
  --ok: #82d3a5;
  --warn: #e5bd70;
  --shadow: 0 28px 80px rgba(0, 0, 0, .48);
  --shadow-soft: 0 16px 46px rgba(0, 0, 0, .24);
  --ease: cubic-bezier(.22, .8, .24, 1);
  --snap: cubic-bezier(.16, 1, .3, 1);
  --sidebar: 220px;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f5f4;
  --bg-side: #ecefed;
  --surface: #ffffff;
  --surface-2: #edf1ef;
  --surface-3: #dfe5e2;
  --veil: rgba(255, 255, 255, .92);
  --line: rgba(18, 31, 32, .09);
  --line-strong: rgba(18, 31, 32, .17);
  --text: #101617;
  --muted: #5f6a6d;
  --quiet: #899396;
  --accent: #176f72;
  --accent-hover: #0d595c;
  --accent-text: #f6ffff;
  --danger: #b14f49;
  --ok: #397854;
  --warn: #8a682c;
  --shadow: 0 28px 74px rgba(20, 38, 39, .15);
  --shadow-soft: 0 15px 42px rgba(20, 38, 39, .09);
}

body {
  background:
    radial-gradient(circle at 58% -20%, rgba(97, 156, 157, .10), transparent 38%),
    var(--bg);
  letter-spacing: -.006em;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { border-radius: 99px; background: var(--surface-3); }

.eyebrow {
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: .17em;
}

.sidebar {
  width: var(--sidebar);
  padding: 20px 14px 16px;
  border-right-color: var(--line);
  background: color-mix(in srgb, var(--bg-side) 96%, transparent);
}

.brand-mark,
.user-avatar,
.acc-avatar { border-radius: 11px; }

.nav-item {
  min-height: 42px;
  margin-bottom: 3px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--quiet);
  font-size: 12px;
  transition: color .2s ease, background-color .2s ease, transform .24s var(--snap);
}

.nav-item::before {
  top: 50%;
  bottom: auto;
  left: 4px;
  width: 3px;
  height: 14px;
  border-radius: 99px;
  transform: translateY(-50%) scaleY(0);
}

.nav-item:hover { background: var(--surface); transform: none; }
.nav-item.active { background: var(--surface-2); color: var(--text); }
.nav-item.active::before { transform: translateY(-50%) scaleY(1); }

.view.active { animation: workspace-fade .3s ease both; }
@keyframes workspace-fade { from { opacity: 0; } to { opacity: 1; } }

.stage {
  padding: 0 clamp(22px, 4vw, 64px) 94px;
  scrollbar-gutter: stable;
}

.stage::before {
  content: "";
  position: fixed;
  top: -22vh;
  left: 52%;
  z-index: 0;
  width: min(66vw, 960px);
  height: 58vh;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(151, 225, 222, .075), transparent 68%);
  filter: blur(24px);
  transform: translateX(-50%);
  pointer-events: none;
}

.hero {
  display: flex;
  width: min(100%, 980px);
  max-height: 470px;
  margin: clamp(70px, 12vh, 132px) auto 28px;
  gap: 24px;
  align-items: center;
  flex-direction: column;
  overflow: visible;
  text-align: center;
}

.hero-copy { max-width: 760px; }
.hero-copy .eyebrow { margin-bottom: 15px; color: var(--quiet); }
.hero-title,
.view-title,
.panel-title,
.stage-empty p,
.view-empty p,
.card-prompt,
.unknown-title,
.modal-head #settingsTitle,
.resolve-context b,
.tool-offline h3,
.stat-cell b {
  font-family: var(--sans);
}

.hero-title {
  font-size: clamp(31px, 3.5vw, 46px);
  font-weight: 610;
  letter-spacing: -.045em;
  line-height: 1.13;
}

.hero-title em { color: inherit; font-style: normal; }
.hero-lede { max-width: 36rem; margin: 15px auto 0; font-size: 13px; line-height: 1.7; }
.hero-control { width: min(100%, 310px); padding: 0; border: 0; }
.hero-control-label { display: none; }
.mode-switch {
  padding: 3px;
  border-color: var(--line);
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: inset 0 1px rgba(255,255,255,.025);
}
.mode-btn { min-height: 39px; border-radius: 10px; }
.mode-slider { inset: 3px calc(50% + 1px) 3px 3px; border-radius: 10px; }
.mode-switch.video .mode-slider { transform: translateX(calc(100% + 2px)); }
.hero-footnote { display: none; }

.composer {
  width: min(100%, 940px);
  margin-left: 0;
  padding: 19px 19px 14px;
  overflow: visible;
  border-color: var(--line-strong);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 18px 60px rgba(0,0,0,.22), inset 0 1px rgba(255,255,255,.035);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.composer::before {
  top: -1px;
  left: 9%;
  width: 0;
  height: 1px;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.composer:focus-within {
  border-color: rgba(185, 241, 238, .28);
  box-shadow: 0 22px 72px rgba(0,0,0,.28), 0 0 0 3px rgba(185,241,238,.035), inset 0 1px rgba(255,255,255,.05);
  transform: translateY(-2px);
}
.composer:focus-within::before { left: 9%; width: 82%; }
.composer-label { margin-bottom: 10px; font-family: var(--sans); font-size: 9px; }
.composer-label kbd { border: 0; }
.prompt-input { min-height: 74px; font-family: var(--sans); font-size: clamp(16px, 1.4vw, 19px); line-height: 1.55; }
.prompt-input::placeholder { opacity: .66; }
.composer-bar { gap: 10px; }
.chips { gap: 6px; }
.kind-mini { height: 34px; padding: 3px; border-color: var(--line); border-radius: 10px; background: var(--bg); }
.kind-mini { flex: 0 0 auto; }
.km-btn { height: 26px; border-radius: 7px; }
.km-btn.active { background: var(--surface-3); }
.chip {
  min-height: 34px;
  padding: 0 11px;
  border-color: var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.015);
}
.chip:hover { border-color: var(--line-strong); background: var(--surface-2); transform: none; }
.toggle { border-radius: 99px; }
.toggle::after { border-radius: 50%; }
.send-btn { width: 42px; height: 42px; border-radius: 13px; box-shadow: 0 8px 24px rgba(118,205,202,.12); }
.send-btn:hover { transform: translateY(-1px) scale(1.02); }

.inspire {
  width: min(100%, 940px);
  margin: 20px auto 14px;
  justify-content: center;
}
.inspire-label { width: 100%; margin: 0 0 2px; font-family: var(--sans); text-align: center; }
.inspire-chip {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(255,255,255,.012);
}
.inspire-chip:hover { border-color: var(--line-strong); background: var(--surface); transform: translateY(-1px); }

.model-panel,
.pop-panel {
  border-color: var(--line-strong);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 24px 70px rgba(0,0,0,.48), inset 0 1px rgba(255,255,255,.04);
  backdrop-filter: blur(28px) saturate(120%);
  -webkit-backdrop-filter: blur(28px) saturate(120%);
  animation: sheet-in .24s var(--snap) both;
}
@keyframes sheet-in { from { opacity: 0; transform: translateY(7px) scale(.985); } to { opacity: 1; transform: none; } }
.model-panel { min-width: 0; }
.model-panel-head {
  display: flex;
  padding: 18px 20px 13px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 620;
  letter-spacing: -.01em;
  text-transform: none;
  color: var(--text);
}
.model-panel-head small { color: var(--quiet); font-size: 10px; font-weight: 450; }
.model-list { display: grid; padding: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 7px; }
.model-group { grid-column: 1 / -1; padding: 12px 11px 5px; font-family: var(--sans); font-size: 9px; font-weight: 650; }
.model-item { min-width: 0; min-height: 62px; padding: 10px 11px; border-radius: 11px; }
.model-item:hover { background: var(--surface-2); transform: none; }
.model-item.selected { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.model-item-name { font-size: 12px; }
.model-tag,
.cap-badge { border-radius: 5px; }
.model-tag { border-color: rgba(185,241,238,.2); color: var(--accent); }
.cap-badge.on { border-color: rgba(185,241,238,.15); color: var(--accent); }
.pop-panel { padding: 7px; }
.pop-item { min-height: 38px; border-radius: 9px; }

.results { width: min(100%, 1280px); margin-top: 11vh; }
body.workspace .results { margin-top: 22px; }
.result-grid,
.asset-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card { border-radius: 16px; background: var(--surface); }
.card:hover { border-color: var(--line-strong); box-shadow: 0 18px 42px rgba(0,0,0,.24); transform: translateY(-3px); }
.card-overlay { background: linear-gradient(180deg, transparent, rgba(5,7,8,.92)); }
.card-prompt { font-size: 12px; }

.view-head { padding: 38px clamp(24px, 4vw, 58px) 22px; align-items: center; }
.view-title { font-size: clamp(27px, 3vw, 38px); font-weight: 620; letter-spacing: -.04em; }
.view-subtitle { margin-top: 7px; }
.asset-filters { padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.af-btn { border-radius: 8px; }
.af-btn::after { display: none; }
.af-btn.active { background: var(--surface-3); }
.asset-grid { padding-top: 10px; }

#viewTools > .view-head { display: none; }
.tool-wrap {
  margin: 14px 14px 14px;
  border-color: var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.tool-frame { background: #090b0d; }
.tool-offline-icon,
.empty-mark { border-radius: 16px; transform: none; }
.empty-mark span { transform: none; }
.tool-start-btn,
.admin-btn,
.sum-chip,
.balance-input,
.acc-card,
.modal,
.theme-options { border-radius: 12px; }

.dock {
  padding-top: 12px;
  background: linear-gradient(180deg, transparent, var(--bg) 26%);
  border: 0;
}
.dock::before { display: none; }
.dock .composer { box-shadow: 0 16px 54px rgba(0,0,0,.34), inset 0 1px rgba(255,255,255,.035); }

.auth-story { background: #0d1114; color: #f3f7f7; }
.auth-story::after { color: var(--accent); }
.auth-panel { background: var(--bg); }
.auth-statement h1,
.auth-heading h2 { font-family: var(--sans); }
.auth-statement h1 { font-weight: 600; letter-spacing: -.055em; }
.auth-statement h1 em { color: var(--accent); font-style: normal; }
.auth-submit { border-radius: 12px; }

.modal-mask { background: rgba(1,4,5,.72); }
.modal { border-color: var(--line-strong); }

@media (max-width: 1080px) {
  .composer,
  .inspire { margin-left: 0; }
}

@media (max-width: 760px) {
  .sidebar,
  .sidebar.rail {
    width: 100%;
    height: calc(66px + env(safe-area-inset-bottom));
    padding: 8px 10px env(safe-area-inset-bottom);
    grid-template-columns: minmax(0, 1fr) 52px;
    background: color-mix(in srgb, var(--bg-side) 92%, transparent);
  }
  .sidebar:hover,
  .sidebar.rail:hover { width: 100%; }
  .sidebar .nav,
  .sidebar:hover .nav {
    width: 100%;
    min-width: 0;
    grid-column: 1;
    grid-row: 1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .sidebar .side-bottom {
    width: 52px;
    grid-column: 2;
    grid-row: 1;
  }
  .side-bottom #settingsBtn { width: 52px; }
  .nav-item::before { inset: auto 18px 1px; width: auto; height: 2px; transform: scaleX(.25); }
  .nav-item.active::before { transform: scaleX(1); }
  .stage { padding: 0 14px 82px; }
  .hero { margin: 42px auto 24px; gap: 20px; }
  .hero-title { font-size: clamp(28px, 8vw, 38px); }
  .hero-lede { margin-top: 12px; font-size: 12px; }
  .hero-control { width: min(100%, 290px); }
  .composer { padding: 15px 13px 12px; border-radius: 18px; box-shadow: 0 18px 48px rgba(0,0,0,.28); }
  .composer:focus-within { box-shadow: 0 20px 54px rgba(0,0,0,.32), 0 0 0 3px rgba(185,241,238,.035); }
  .prompt-input { min-height: 78px; font-size: 16px; }
  .composer-bar { position: relative; padding-right: 49px; align-items: flex-end; }
  .chips { max-width: 100%; overflow: visible; flex-wrap: wrap; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: 0 0 auto; }
  .composer-bar > .send-btn { position: absolute; right: 0; bottom: 0; }
  .inspire { max-height: 82px; overflow: hidden; justify-content: flex-start; }
  .inspire-label { text-align: left; }
  .result-grid,
  .asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .model-panel,
  .pop-panel,
  .advanced-panel { border-radius: 20px; transform-origin: 50% 100%; animation-name: mobile-sheet-in; }
  @keyframes mobile-sheet-in { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
  .model-list { grid-template-columns: 1fr; }
  .model-item { min-height: 58px; }
  .tool-wrap { margin: 8px 8px 12px; border-radius: 16px; }
  .view-head { padding: 27px 18px 18px; }
}

@media (max-width: 430px) {
  .hero-title { font-size: 30px; }
  .result-grid,
  .asset-grid { grid-template-columns: 1fr; }
  .chips .chip:not(.model-chip):not(.attach-chip):not(#ratioChip) { display: inline-flex; }
  .model-panel-head { padding: 16px; }
}

/* ========================================================================== 
   LUMINA 2026 · obsidian studio system
   ========================================================================== */
:root,
[data-theme="dark"] {
  --bg: #07090c;
  --bg-side: #0a0d11;
  --surface: #0f1318;
  --surface-2: #151b22;
  --surface-3: #202832;
  --line: rgba(218, 239, 241, .075);
  --line-strong: rgba(218, 239, 241, .16);
  --text: #f4f8f8;
  --muted: #9ba8ad;
  --quiet: #657279;
  --accent: #8de9e3;
  --accent-hover: #b6fffa;
  --accent-2: #8997ff;
  --veil: rgba(10, 13, 17, .9);
  --sidebar: 236px;
}

[data-theme="light"] {
  --bg: #f4f6f5;
  --bg-side: #edf1ef;
  --surface: #ffffff;
  --surface-2: #e9efec;
  --surface-3: #dbe4e0;
  --line: rgba(9, 29, 31, .08);
  --line-strong: rgba(9, 29, 31, .17);
  --text: #0c1517;
  --muted: #5d6c70;
  --quiet: #899598;
  --accent: #116d70;
  --accent-hover: #0b5558;
  --accent-2: #5666d8;
}

body {
  background:
    radial-gradient(ellipse 52% 38% at 63% -8%, rgba(84, 162, 167, .11), transparent 70%),
    radial-gradient(ellipse 34% 38% at 96% 82%, rgba(89, 98, 189, .055), transparent 72%),
    var(--bg);
}

.sidebar {
  overflow: visible;
  border-right-color: rgba(218,239,241,.065);
  background: color-mix(in srgb, var(--bg-side) 97%, transparent);
  box-shadow: inset -1px 0 rgba(255,255,255,.012);
}
.brand-mark { border-color: var(--line); background: linear-gradient(145deg, var(--surface-2), transparent); }
.nav { gap: 5px; }
.nav-item { overflow: visible; }
.nav-item.active { background: linear-gradient(90deg, rgba(141,233,227,.075), rgba(255,255,255,.018)); }
.nav-item-feature { margin-top: 15px; border: 1px solid rgba(141,233,227,.09); }
.nav-item-feature::after {
  content: "";
  position: absolute;
  inset: 4px;
  z-index: -1;
  border-radius: 7px;
  background: radial-gradient(circle at 78% 30%, rgba(141,233,227,.08), transparent 45%);
}
.nav-new {
  margin-left: auto;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 8px;
  font-style: normal;
  letter-spacing: .08em;
}
.sidebar.rail .nav-new { opacity: 0; }

.user-card {
  position: relative;
  border-top-color: var(--line);
  border-radius: 13px;
  transition: background-color .22s ease, border-color .22s ease;
}
.user-card:hover,
.user-card:focus-within { background: var(--surface); }
.user-avatar {
  background: linear-gradient(145deg, var(--accent), #6c9da3);
  color: #071011;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 720;
}
.account-popover {
  position: absolute;
  bottom: -2px;
  left: calc(100% + 14px);
  z-index: 160;
  width: 296px;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  box-shadow: 0 28px 78px rgba(0,0,0,.46), inset 0 1px rgba(255,255,255,.04);
  opacity: 0;
  transform: translateX(-7px) scale(.98);
  transform-origin: 0 100%;
  transition: opacity .2s ease, transform .28s var(--snap), visibility .2s;
  visibility: hidden;
  pointer-events: none;
  backdrop-filter: blur(28px) saturate(125%);
  -webkit-backdrop-filter: blur(28px) saturate(125%);
}
.user-card:hover .account-popover,
.user-card:focus-within .account-popover {
  opacity: 1;
  transform: none;
  visibility: visible;
  pointer-events: auto;
}
.account-popover::before {
  content: "";
  position: absolute;
  right: 100%;
  bottom: 21px;
  width: 15px;
  height: 54px;
}
.account-popover-top { display: flex; gap: 12px; align-items: center; }
.account-popover-top > div { display: flex; min-width: 0; flex-direction: column; }
.account-popover-top small { color: var(--quiet); font-size: 8px; letter-spacing: .15em; text-transform: uppercase; }
.account-popover-top strong { margin-top: 3px; overflow: hidden; font-size: 12px; font-weight: 580; text-overflow: ellipsis; }
.account-orbit {
  position: relative;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 1px solid rgba(141,233,227,.26);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(141,233,227,.26), transparent 55%);
}
.account-orbit::before { content: ""; position: absolute; inset: 7px; border: 1px solid var(--accent); border-radius: 50%; animation: account-pulse 2.8s ease-in-out infinite; }
@keyframes account-pulse { 50% { opacity: .35; transform: scale(.75); } }
.account-quota { display: flex; margin-top: 17px; padding: 16px 0 14px; align-items: flex-end; justify-content: space-between; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.account-quota span { color: var(--muted); font-size: 10px; }
.account-quota b { color: var(--text); font-size: 24px; font-weight: 580; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.account-meta { display: flex; padding-top: 13px; align-items: center; justify-content: space-between; color: var(--quiet); font-size: 9px; }
.account-meta span { display: flex; gap: 6px; align-items: center; }
.account-meta i { width: 5px; height: 5px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 12px var(--ok); }
.account-meta em { font-style: normal; }

.stage { width: 100%; max-width: none; }
.hero {
  position: relative;
  display: grid;
  width: min(100%, 1100px);
  margin: clamp(72px, 12vh, 126px) auto 38px;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: clamp(48px, 7vw, 110px);
  align-items: end;
  text-align: left;
}
.hero::after {
  content: "01 / CREATE";
  position: absolute;
  top: -36px;
  right: 0;
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .14em;
}
.hero-copy { max-width: 720px; }
.hero-copy .eyebrow { margin-bottom: 18px; }
.hero-title { font-size: clamp(46px, 5.3vw, 76px); font-weight: 560; letter-spacing: -.065em; line-height: .98; text-wrap: balance; }
.hero-title span { color: color-mix(in srgb, var(--text) 66%, var(--quiet)); white-space: nowrap; }
.hero-lede { max-width: 37rem; margin: 23px 0 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.hero-control { width: 100%; padding-bottom: 5px; }
.mode-switch { height: 48px; padding: 4px; border-radius: 15px; }
.mode-btn { min-height: 38px; }
.mode-slider { inset: 4px calc(50% + 1px) 4px 4px; }
.composer { width: min(100%, 1100px); border-radius: 25px; }
.inspire { width: min(100%, 1100px); justify-content: flex-start; }
.inspire-label { width: auto; margin: 0 8px 0 0; text-align: left; }

/* AI tool library */
#viewAiTools { overflow-y: auto; padding: 0 clamp(20px, 3.7vw, 58px) 90px; scrollbar-gutter: stable; }
.ai-tools-hero {
  position: relative;
  display: grid;
  width: min(100%, 1480px);
  margin: 0 auto;
  padding: clamp(52px, 7vh, 88px) 0 42px;
  grid-template-columns: minmax(0, 1fr) minmax(420px, .74fr);
  gap: 64px;
  align-items: end;
  border-bottom: 1px solid var(--line);
}
.ai-tools-hero::before {
  content: "";
  position: absolute;
  top: -180px;
  right: 8%;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(141,233,227,.09);
  border-radius: 50%;
  box-shadow: 0 0 80px rgba(141,233,227,.025), inset 0 0 80px rgba(141,233,227,.025);
  pointer-events: none;
}
.ai-tools-copy .eyebrow { margin-bottom: 16px; }
.ai-tools-copy h2 { font-size: clamp(42px, 5vw, 72px); font-weight: 560; letter-spacing: -.062em; line-height: .99; }
.ai-tools-copy h2 span { color: var(--muted); }
.ai-tools-copy p { max-width: 610px; margin-top: 22px; color: var(--muted); font-size: 13px; line-height: 1.85; }
.ai-tools-hero-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ai-tools-hero-meta div { display: flex; min-height: 92px; padding: 16px 18px; justify-content: center; flex-direction: column; border-right: 1px solid var(--line); }
.ai-tools-hero-meta div:last-child { border-right: 0; }
.ai-tools-hero-meta b { font-size: 21px; font-weight: 540; letter-spacing: -.03em; }
.ai-tools-hero-meta span { margin-top: 5px; color: var(--quiet); font-size: 9px; }
.ai-tools-toolbar { display: flex; width: min(100%, 1480px); margin: 0 auto; padding: 24px 0; gap: 18px; align-items: center; justify-content: space-between; }
.ai-search-wrap { position: relative; width: min(320px, 100%); }
.ai-search-wrap svg { position: absolute; top: 50%; left: 14px; width: 16px; color: var(--quiet); transform: translateY(-50%); pointer-events: none; }
.ai-search-wrap input { width: 100%; height: 43px; padding: 0 14px 0 42px; border: 1px solid var(--line); border-radius: 12px; outline: 0; background: rgba(255,255,255,.012); color: var(--text); transition: border-color .2s, background-color .2s; }
.ai-search-wrap input:focus { border-color: rgba(141,233,227,.34); background: var(--surface); }
.ai-search-wrap input::placeholder { color: var(--quiet); }
.ai-tool-filters { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.012); }
.ai-tool-filters button { min-height: 33px; padding: 0 12px; border-radius: 9px; color: var(--quiet); font-size: 10px; transition: color .2s, background-color .2s; }
.ai-tool-filters button:hover { color: var(--text); }
.ai-tool-filters button.active { background: var(--surface-3); color: var(--text); }

.ai-library-layout { display: grid; width: min(100%, 1480px); margin: 0 auto; grid-template-columns: minmax(0, 1fr) minmax(350px, 410px); gap: 20px; align-items: start; }
.ai-tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ai-tool-card {
  --tone: var(--accent);
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 330px;
  padding: 19px;
  gap: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(255,255,255,.018), transparent 46%), var(--surface);
  text-align: left;
  opacity: 0;
  transform: translateY(10px);
  animation: ai-card-in .55s var(--snap) var(--delay) forwards;
  transition: border-color .25s ease, transform .3s var(--snap), box-shadow .3s ease;
}
@keyframes ai-card-in { to { opacity: 1; transform: none; } }
.ai-tool-card.tone-violet { --tone: #a99cff; }
.ai-tool-card.tone-amber { --tone: #e7c278; }
.ai-tool-card.tone-blue { --tone: #83b9ff; }
.ai-tool-card.tone-rose { --tone: #e7a3bb; }
.ai-tool-card.tone-mint { --tone: #82d3a5; }
.ai-tool-card::before { content: ""; position: absolute; top: -65%; right: -25%; width: 250px; height: 250px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--tone) 14%, transparent), transparent 70%); opacity: .58; transition: transform .5s var(--snap), opacity .3s; }
.ai-tool-card:hover,
.ai-tool-card.selected { border-color: color-mix(in srgb, var(--tone) 34%, var(--line)); transform: translateY(-4px); box-shadow: 0 26px 58px rgba(0,0,0,.24); }
.ai-tool-card:hover::before,
.ai-tool-card.selected::before { opacity: 1; transform: translate(-12px, 18px) scale(1.15); }
.ai-tool-card.selected { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 22%, transparent), 0 26px 58px rgba(0,0,0,.24); }
.ai-tool-card-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; }
.ai-tool-card-top i { color: var(--tone); font-family: var(--mono); font-size: 9px; font-style: normal; }
.ai-tool-card-top em { color: var(--quiet); font-size: 9px; font-style: normal; }
.ai-tool-visual { position: relative; display: block; width: 100%; height: 82px; margin-top: 22px; }
.ai-tool-visual > i { position: absolute; top: 50%; left: 50%; width: 58px; height: 58px; border: 1px solid color-mix(in srgb, var(--tone) 30%, transparent); border-radius: 18px; transform: translate(-50%, -50%) rotate(45deg); }
.ai-tool-visual > i:nth-child(2) { width: 42px; height: 42px; opacity: .65; transform: translate(-68%, -50%) rotate(45deg); }
.ai-tool-visual > i:nth-child(3) { width: 42px; height: 42px; opacity: .35; transform: translate(-32%, -50%) rotate(45deg); }
.ai-tool-visual b { position: absolute; top: 50%; left: 50%; z-index: 2; color: var(--tone); font-family: var(--mono); font-size: 9px; font-weight: 650; letter-spacing: .08em; transform: translate(-50%, -50%); }
.ai-tool-card-copy { position: relative; z-index: 1; display: flex; margin-top: 16px; flex-direction: column; }
.ai-tool-card-copy small { color: var(--tone); font-size: 9px; letter-spacing: .07em; }
.ai-tool-card-copy strong { margin-top: 7px; font-size: 21px; font-weight: 590; letter-spacing: -.035em; }
.ai-tool-card-copy > span { display: -webkit-box; margin-top: 8px; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.65; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.ai-tool-card-foot { position: relative; z-index: 1; display: flex; margin-top: auto; padding-top: 18px; align-items: flex-end; justify-content: space-between; }
.ai-tool-card-foot > span { display: flex; gap: 5px; flex-wrap: wrap; }
.ai-tool-card-foot i { padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; color: var(--quiet); font-size: 8px; font-style: normal; }
.ai-tool-card-foot svg { width: 19px; color: var(--tone); transition: transform .25s var(--snap); }
.ai-tool-card:hover .ai-tool-card-foot svg { transform: translateX(3px); }
.ai-tool-skeleton { min-height: 330px; opacity: .5; animation: ai-skeleton 1.4s ease-in-out infinite; }
@keyframes ai-skeleton { 50% { opacity: .22; } }
.ai-library-empty,
.ai-library-error { display: flex; min-height: 300px; padding: 30px; gap: 8px; align-items: center; justify-content: center; flex-direction: column; grid-column: 1 / -1; border: 1px dashed var(--line-strong); border-radius: 20px; color: var(--quiet); text-align: center; }
.ai-library-error b { color: var(--text); font-size: 15px; }
.ai-library-error button { margin-top: 10px; padding: 9px 13px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--text); }

.ai-workbench { position: sticky; top: 20px; min-height: 566px; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(155deg, rgba(255,255,255,.022), transparent 42%), var(--surface); box-shadow: 0 24px 62px rgba(0,0,0,.18); }
.ai-workbench-empty { display: flex; min-height: 566px; padding: 42px; align-items: flex-start; justify-content: center; flex-direction: column; }
.workbench-sigil { position: relative; display: block; width: 92px; height: 92px; margin-bottom: 38px; }
.workbench-sigil i { position: absolute; inset: 8px; border: 1px solid var(--line-strong); border-radius: 25px; transform: rotate(45deg); }
.workbench-sigil i:nth-child(2) { inset: 22px; border-color: rgba(141,233,227,.27); animation: sigil-turn 8s linear infinite; }
.workbench-sigil i:nth-child(3) { inset: 36px; border-color: var(--accent); background: rgba(141,233,227,.08); }
@keyframes sigil-turn { to { transform: rotate(405deg); } }
.ai-workbench-empty h3 { margin-top: 12px; font-size: 27px; font-weight: 570; letter-spacing: -.045em; line-height: 1.15; }
.ai-workbench-empty p { margin-top: 15px; color: var(--muted); font-size: 11px; line-height: 1.75; }
.ai-workbench-body { animation: workbench-in .36s var(--snap) both; }
@keyframes workbench-in { from { opacity: 0; transform: translateX(14px); } }
.ai-workbench-head { display: flex; padding: 24px 24px 20px; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--line); }
.ai-workbench-head .eyebrow { color: var(--accent); }
.ai-workbench-head h3 { margin-top: 8px; font-size: 23px; font-weight: 600; letter-spacing: -.035em; }
.ai-workbench-head p { margin-top: 4px; color: var(--quiet); font-size: 10px; }
.ai-workbench-close { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--quiet); font-size: 18px; transition: color .2s, background-color .2s; }
.ai-workbench-close:hover { background: var(--surface-2); color: var(--text); }
.ai-workbench-tags { display: flex; padding: 14px 24px 0; gap: 6px; flex-wrap: wrap; }
.ai-workbench-tags span { padding: 4px 7px; border-radius: 6px; background: var(--surface-2); color: var(--muted); font-size: 8px; }
.ai-workbench-form { display: flex; padding: 20px 24px 24px; gap: 16px; flex-direction: column; }
.ai-field { display: flex; gap: 7px; flex-direction: column; }
.ai-field-label { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; }
.ai-field-label i { color: var(--quiet); font-size: 8px; font-style: normal; font-weight: 400; }
.ai-field textarea,
.ai-field select,
.ai-input-unit input { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; outline: 0; background: var(--bg); color: var(--text); font-size: 11px; line-height: 1.65; resize: vertical; transition: border-color .2s, box-shadow .2s; }
.ai-field textarea:focus,
.ai-field select:focus,
.ai-input-unit input:focus { border-color: rgba(141,233,227,.38); box-shadow: 0 0 0 3px rgba(141,233,227,.045); }
.ai-input-unit { position: relative; display: block; }
.ai-input-unit i { position: absolute; top: 50%; right: 12px; color: var(--quiet); font-size: 9px; font-style: normal; transform: translateY(-50%); }
.ai-upload-control { position: relative; display: block; }
.ai-upload-input { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.ai-upload-input:disabled { cursor: wait; }
.ai-upload-zone { display: flex; min-height: 76px; padding: 13px; gap: 11px; align-items: center; border: 1px dashed var(--line-strong); border-radius: 12px; background: rgba(255,255,255,.012); cursor: pointer; transition: border-color .2s, background-color .2s, box-shadow .2s; }
.ai-upload-zone:hover { border-color: rgba(141,233,227,.42); background: rgba(141,233,227,.025); }
.ai-upload-input:focus-visible + .ai-upload-zone,
.ai-upload-field.dragging .ai-upload-zone { border-color: var(--accent); background: rgba(141,233,227,.055); box-shadow: 0 0 0 3px rgba(141,233,227,.09); }
.ai-upload-icon { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border-radius: 10px; background: var(--surface-2); color: var(--accent); }
.ai-upload-icon svg { width: 17px; }
.ai-upload-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.ai-upload-copy b { overflow: hidden; font-size: 10px; font-weight: 560; text-overflow: ellipsis; }
.ai-upload-copy small { margin-top: 3px; overflow: hidden; color: var(--quiet); font-size: 8px; text-overflow: ellipsis; }
.ai-upload-state { padding: 4px 6px; border-radius: 6px; background: var(--surface-2); color: var(--muted); font-size: 8px; }
.ai-upload-field.uploading .ai-upload-icon svg { animation: spin 1s linear infinite; }
.ai-run-note { display: flex; gap: 9px; color: var(--quiet); font-size: 8.5px; line-height: 1.6; }
.ai-run-note i { width: 6px; height: 6px; margin-top: 4px; flex: 0 0 auto; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(141,233,227,.55); }
.ai-run-btn { display: flex; min-height: 48px; padding: 0 16px; align-items: center; justify-content: space-between; border-radius: 12px; background: var(--accent); color: var(--accent-text); font-size: 11px; font-weight: 680; transition: transform .23s var(--snap), background-color .2s, box-shadow .2s; }
.ai-run-btn svg { width: 18px; }
.ai-run-btn:hover:not(:disabled) { background: var(--accent-hover); box-shadow: 0 12px 30px rgba(78,191,186,.16); transform: translateY(-2px); }
.ai-run-btn:disabled { opacity: .55; }

.ai-task-section { width: min(100%, 1480px); margin: 72px auto 0; padding-top: 30px; border-top: 1px solid var(--line); }
.ai-task-head { display: flex; align-items: flex-end; justify-content: space-between; }
.ai-task-head h3 { margin-top: 7px; font-size: 27px; font-weight: 580; letter-spacing: -.04em; }
.ai-task-head > span { color: var(--quiet); font-family: var(--mono); font-size: 9px; }
.ai-task-list { display: flex; margin-top: 20px; gap: 8px; flex-direction: column; }
.ai-task-row { display: grid; min-height: 88px; padding: 12px 16px; grid-template-columns: 48px minmax(170px, .9fr) minmax(160px, 1.3fr) minmax(130px, .7fr); gap: 16px; align-items: center; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.01); transition: border-color .2s, background-color .2s; }
.ai-task-row:hover { border-color: var(--line-strong); background: var(--surface); }
.ai-task-index { display: flex; gap: 7px; align-items: center; color: var(--quiet); font-family: var(--mono); font-size: 8px; }
.ai-task-index i { width: 18px; height: 1px; background: var(--line-strong); }
.ai-task-main { display: flex; min-width: 0; flex-direction: column; }
.ai-task-main small { color: var(--quiet); font-family: var(--mono); font-size: 7px; letter-spacing: .08em; text-transform: uppercase; }
.ai-task-main strong { margin-top: 3px; overflow: hidden; font-size: 12px; font-weight: 570; text-overflow: ellipsis; }
.ai-task-main > span { margin-top: 3px; color: var(--quiet); font-size: 8px; }
.ai-task-result { min-width: 0; }
.ai-task-result img,
.ai-task-result video { display: block; width: 84px; height: 58px; border-radius: 8px; object-fit: cover; background: var(--bg); }
.ai-task-result audio { width: min(100%, 260px); height: 34px; }
.ai-task-result a { color: var(--accent); font-size: 10px; text-decoration: none; }
.ai-task-side { display: flex; min-width: 0; gap: 5px; align-items: flex-end; flex-direction: column; text-align: right; }
.ai-status { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 9px; }
.ai-status i { width: 5px; height: 5px; border-radius: 50%; background: var(--quiet); }
.ai-status.running i,
.ai-status.queued i { background: var(--warn); box-shadow: 0 0 9px rgba(229,189,112,.6); animation: status-pulse 1.5s ease infinite; }
.ai-status.succeeded i { background: var(--ok); box-shadow: 0 0 9px rgba(130,211,165,.5); }
.ai-status.failed i { background: var(--danger); }
@keyframes status-pulse { 50% { opacity: .35; } }
.ai-task-side small { color: var(--quiet); font-size: 8px; }
.ai-task-side em { max-width: 220px; overflow: hidden; color: var(--danger); font-size: 8px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.ai-task-empty { display: grid; min-height: 120px; place-items: center; border: 1px dashed var(--line); border-radius: 14px; color: var(--quiet); font-size: 10px; }

@media (max-width: 1180px) {
  .hero { grid-template-columns: 1fr 290px; gap: 48px; }
  .ai-tools-hero { grid-template-columns: 1fr; gap: 34px; }
  .ai-tools-hero-meta { max-width: 700px; }
  .ai-library-layout { grid-template-columns: 1fr; }
  .ai-workbench { position: relative; top: auto; min-height: 0; }
  .ai-workbench-empty { min-height: 300px; }
}

@media (max-width: 760px) {
  .sidebar .nav,
  .sidebar:hover .nav { grid-template-columns: repeat(auto-fit, minmax(48px, 1fr)); }
  .nav-new { display: none; }
  .hero { margin-top: 38px; grid-template-columns: 1fr; gap: 25px; align-items: start; }
  .hero::after { display: none; }
  .hero-title { font-size: clamp(39px, 12vw, 57px); }
  .hero-control { width: min(100%, 330px); }
  .inspire-label { width: 100%; }
  #viewAiTools { padding: 0 14px 82px; }
  .ai-tools-hero { padding: 40px 4px 28px; }
  .ai-tools-copy h2 { font-size: clamp(39px, 12vw, 58px); }
  .ai-tools-hero-meta { grid-template-columns: 1fr; }
  .ai-tools-hero-meta div { min-height: 62px; border-right: 0; border-bottom: 1px solid var(--line); }
  .ai-tools-hero-meta div:last-child { border-bottom: 0; }
  .ai-tools-toolbar { align-items: stretch; flex-direction: column; }
  .ai-search-wrap { width: 100%; }
  .ai-tool-filters { overflow-x: auto; }
  .ai-tool-filters button { flex: 0 0 auto; }
  .ai-tool-grid { grid-template-columns: 1fr; }
  .ai-tool-card { min-height: 304px; }
  .ai-workbench-head,
  .ai-workbench-form { padding-right: 18px; padding-left: 18px; }
  .ai-workbench-tags { padding-right: 18px; padding-left: 18px; }
  .ai-task-row { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; }
  .ai-task-result { display: none; }
  .account-popover { display: none; }
}

@media (max-width: 430px) {
  .sidebar .nav,
  .sidebar:hover .nav { grid-template-columns: repeat(auto-fit, minmax(43px, 1fr)); }
  .sidebar .nav-item,
  .sidebar:hover .nav-item,
  .sidebar.rail .nav-item { padding-right: 3px; padding-left: 3px; font-size: 8px; }
  .ai-tools-copy h2 { font-size: 41px; }
  .ai-tools-copy p { font-size: 11px; }
  .ai-workbench { border-radius: 18px; }
  .ai-workbench-empty { padding: 30px 24px; }
  .ai-task-row { padding-right: 11px; padding-left: 11px; }
}

/* ========================================================================== 
   LUMINA 2026 · media-first cinematic studio
   ========================================================================== */
:root,
[data-theme="dark"] {
  --bg: #080a09;
  --bg-side: #0c0e0d;
  --surface: #111411;
  --surface-2: #191d19;
  --surface-3: #242a25;
  --veil: rgba(10, 12, 11, .88);
  --line: rgba(239, 239, 230, .095);
  --line-strong: rgba(239, 239, 230, .19);
  --text: #f1f0e9;
  --muted: #aaa9a1;
  --quiet: #6d716c;
  --accent: #efeee7;
  --accent-hover: #ffffff;
  --accent-text: #0b0e0c;
  --signal: #a9d5c5;
  --warm: #c69161;
  --shadow: 0 32px 90px rgba(0, 0, 0, .52);
  --shadow-soft: 0 18px 52px rgba(0, 0, 0, .28);
}

[data-theme="light"] {
  --bg: #ecece6;
  --bg-side: #e4e4dd;
  --surface: #f7f7f2;
  --surface-2: #dedfd8;
  --surface-3: #d2d5ce;
  --line: rgba(18, 22, 19, .10);
  --line-strong: rgba(18, 22, 19, .20);
  --text: #111410;
  --muted: #656962;
  --quiet: #90948c;
  --accent: #151914;
  --accent-hover: #000;
  --accent-text: #f6f6ef;
  --signal: #347b69;
  --warm: #95643e;
}

body {
  background: var(--bg);
  background-image:
    linear-gradient(rgba(255,255,255,.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.012) 1px, transparent 1px);
  background-size: 64px 64px;
}

.auth-story {
  background:
    linear-gradient(90deg, rgba(7,9,8,.12), rgba(7,9,8,.72)),
    linear-gradient(0deg, rgba(7,9,8,.56), transparent 58%),
    url("assets/lumina-hero.webp") 62% center / cover no-repeat;
  color: #f2f0e9;
}
.auth-story::after { border-color: rgba(242,240,233,.8); }
.auth-submit { border-radius: 10px; box-shadow: 0 14px 34px rgba(0,0,0,.18); }

.sidebar {
  background: rgba(10, 12, 11, .96);
  box-shadow: inset -1px 0 rgba(255,255,255,.018);
}
.brand-mark { border-color: var(--line-strong); background: var(--text); color: var(--accent-text); font-family: var(--sans); font-weight: 750; }
.nav-item { min-height: 44px; }
.nav-item.active { background: rgba(255,255,255,.065); }
.nav-item.active::before { background: var(--signal); box-shadow: 0 0 18px rgba(169,213,197,.26); }
.nav-new { border-color: rgba(169,213,197,.24); background: rgba(169,213,197,.08); color: var(--signal); }
.user-avatar { background: var(--text); color: var(--accent-text); }

.stage {
  padding: 18px clamp(20px, 3.1vw, 54px) 120px;
  align-items: center;
}
.stage::before { display: none; }

.hero {
  position: relative;
  display: grid;
  width: min(100%, 1480px);
  height: clamp(520px, 68vh, 720px);
  max-height: 720px;
  margin: 0 auto;
  padding: clamp(34px, 5.5vw, 82px);
  grid-template-columns: 1fr;
  align-items: end;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: #111511;
  box-shadow: 0 30px 90px rgba(0,0,0,.24);
  isolation: isolate;
  text-align: left;
}
.hero::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  border: 1px solid rgba(255,255,255,.05);
  border-radius: inherit;
  pointer-events: none;
}
.hero::after { display: none; }
.hero-media { position: absolute; z-index: -2; inset: 0; overflow: hidden; }
.hero-film {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: none;
}
.hero-media-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5,7,6,.84) 0%, rgba(5,7,6,.52) 38%, rgba(5,7,6,.07) 72%),
    linear-gradient(0deg, rgba(5,7,6,.78) 0%, transparent 47%, rgba(5,7,6,.13) 100%);
}
.hero-media-scrim::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 74% 28%, rgba(217,187,145,.13), transparent 25%);
  mix-blend-mode: screen;
}
.hero-frame-meta {
  position: absolute;
  top: 30px;
  left: 34px;
  display: flex;
  gap: 10px;
  align-items: center;
  color: rgba(245,244,237,.65);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .14em;
}
.hero-frame-meta i { width: 54px; height: 1px; background: rgba(245,244,237,.25); }
.hero-frame-meta b { color: rgba(245,244,237,.92); font-weight: 500; }
.hero-copy { position: relative; z-index: 3; max-width: 720px; padding-bottom: 72px; }
.hero-copy .eyebrow { margin-bottom: 18px; color: rgba(239,238,231,.62); }
.hero-title {
  color: #f4f1e9;
  font-family: var(--sans);
  font-size: clamp(58px, 6vw, 94px);
  font-weight: 520;
  letter-spacing: -.072em;
  line-height: .94;
  text-wrap: balance;
}
.hero-title span { display: block; color: rgba(244,241,233,.72); white-space: normal; }
.hero-lede { max-width: 35rem; margin: 24px 0 0; color: rgba(236,236,228,.68); font-size: 13px; line-height: 1.8; }
.hero-control {
  position: absolute;
  top: 26px;
  right: 28px;
  z-index: 4;
  width: 316px;
  padding: 0;
  border: 0;
}
.hero-control-label { display: none; }
.mode-switch {
  height: 48px;
  padding: 4px;
  overflow: hidden;
  border: 1px solid rgba(245,244,237,.18);
  border-radius: 13px;
  background: rgba(9,12,10,.44);
  box-shadow: inset 0 1px rgba(255,255,255,.055);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.mode-btn { min-height: 38px; border-radius: 9px; color: rgba(243,241,233,.58); font-weight: 570; }
.mode-btn.active { color: var(--accent-text); }
.mode-slider { inset: 4px calc(50% + 1px) 4px 4px; border-radius: 9px; background: rgba(243,241,233,.94); box-shadow: 0 8px 24px rgba(0,0,0,.16); }
.mode-switch.video .mode-slider { transform: translateX(calc(100% + 2px)); }
.hero-footnote { display: none; }
.hero-status {
  position: absolute;
  right: 34px;
  bottom: 31px;
  z-index: 3;
  display: flex;
  gap: 12px;
  align-items: center;
  color: rgba(244,241,233,.58);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .12em;
}
.hero-status span { display: flex; gap: 8px; align-items: center; }
.hero-status span::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 12px rgba(169,213,197,.8); }
.hero-status b { color: rgba(244,241,233,.9); font-weight: 500; }

.composer {
  z-index: 10;
  width: min(calc(100% - clamp(28px, 8vw, 120px)), 1320px);
  margin: -58px auto 0;
  padding: 22px 22px 17px;
  border: 1px solid rgba(238,238,230,.16);
  border-radius: 20px;
  background: rgba(15,18,16,.92);
  box-shadow: 0 28px 80px rgba(0,0,0,.38), inset 0 1px rgba(255,255,255,.045);
  backdrop-filter: blur(26px) saturate(110%);
  -webkit-backdrop-filter: blur(26px) saturate(110%);
}
.composer::before { left: 22px; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--signal), transparent); }
.composer:focus-within {
  border-color: rgba(215,229,220,.28);
  box-shadow: 0 34px 92px rgba(0,0,0,.44), 0 0 0 4px rgba(169,213,197,.035), inset 0 1px rgba(255,255,255,.07);
  transform: translateY(-3px);
}
.composer:focus-within::before { left: 22px; width: calc(100% - 44px); }
.composer-label { color: #858b84; letter-spacing: .15em; }
.composer-label kbd { color: #777d76; }
.prompt-input { min-height: 88px; color: var(--text); font-size: clamp(17px, 1.5vw, 21px); font-weight: 430; }
.prompt-input::placeholder { color: #686f69; opacity: 1; }
.kind-mini,
.chip {
  min-height: 38px;
  border-color: rgba(238,238,230,.10);
  border-radius: 9px;
  background: rgba(255,255,255,.022);
}
.kind-mini { height: 38px; padding: 3px; }
.km-btn { height: 30px; padding: 0 13px; border-radius: 7px; }
.km-btn.active { background: rgba(239,238,231,.11); color: var(--text); }
.chip { padding: 0 13px; }
.chip:hover { border-color: rgba(238,238,230,.22); background: rgba(255,255,255,.065); }
.mode-chip { border-color: rgba(169,213,197,.22); }
.mode-dot { background: var(--signal); box-shadow: 0 0 12px rgba(169,213,197,.48); }
.send-btn {
  display: inline-flex;
  width: 104px;
  height: 46px;
  padding: 0 16px;
  gap: 12px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-text);
  box-shadow: 0 12px 30px rgba(0,0,0,.22);
  font-size: 12px;
  font-weight: 690;
}
.send-btn::before { content: "生成"; }
.send-btn svg { width: 16px; }
.send-btn:hover { background: var(--accent-hover); box-shadow: 0 16px 36px rgba(0,0,0,.28); transform: translateY(-2px); }

.inspiration-reel {
  display: block;
  width: min(100%, 1480px);
  max-height: none;
  margin: clamp(62px, 8vw, 106px) auto 0;
  overflow: visible;
}
.reel-head { display: flex; margin-bottom: 24px; align-items: flex-end; justify-content: space-between; }
.reel-head .eyebrow { margin-bottom: 9px; color: var(--signal); }
.reel-head h2 { font-size: clamp(30px, 3vw, 46px); font-weight: 540; letter-spacing: -.052em; line-height: 1; }
.reel-head p { max-width: 310px; color: var(--quiet); font-size: 11px; line-height: 1.7; text-align: right; }
.reel-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: clamp(190px, 16vw, 244px);
  gap: 12px;
}
.inspire-chip.reel-card {
  position: relative;
  display: block;
  min-width: 0;
  height: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #151815;
  color: #f4f1e9;
  text-align: left;
  isolation: isolate;
  transition: border-color .25s ease, transform .42s var(--snap), box-shadow .4s ease;
}
.inspire-chip.reel-card:hover { border-color: rgba(239,239,230,.28); box-shadow: 0 24px 58px rgba(0,0,0,.28); transform: translateY(-5px); }
.reel-card:nth-child(1) { grid-column: 1 / span 7; grid-row: 1 / span 2; }
.reel-card:nth-child(2) { grid-column: 8 / span 5; grid-row: 1; }
.reel-card:nth-child(3) { grid-column: 8 / span 2; grid-row: 2; }
.reel-card:nth-child(4) { grid-column: 10 / span 3; grid-row: 2; }
.reel-card img,
.reel-card video {
  position: absolute;
  z-index: -2;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .9s var(--snap), filter .5s ease;
}
.reel-card-portrait img { object-position: 50% 47%; }
.reel-card:hover img,
.reel-card:hover video { filter: saturate(1.06) contrast(1.02); transform: scale(1.045); }
.reel-shade { position: absolute; z-index: -1; inset: 0; background: linear-gradient(180deg, rgba(4,6,5,.05) 28%, rgba(4,6,5,.82) 100%); }
.reel-index { position: absolute; top: 18px; left: 18px; color: rgba(246,244,236,.72); font-family: var(--mono); font-size: 8px; letter-spacing: .12em; }
.reel-card strong { position: absolute; right: 18px; bottom: 41px; left: 18px; font-size: clamp(17px, 1.75vw, 28px); font-weight: 530; letter-spacing: -.035em; }
.reel-card small { position: absolute; right: 18px; bottom: 19px; left: 18px; color: rgba(246,244,236,.58); font-size: 9px; }
.reel-play {
  position: absolute;
  top: 15px;
  right: 15px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(246,244,236,.2);
  border-radius: 50%;
  background: rgba(8,10,9,.28);
  color: rgba(246,244,236,.9);
  font-size: 13px;
  font-style: normal;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background-color .25s ease, color .25s ease, transform .35s var(--snap);
}
.reel-card:hover .reel-play { background: #f2f0e9; color: #0a0c0a; transform: rotate(45deg); }
.reel-card:nth-child(3) strong,
.reel-card:nth-child(4) strong { font-size: clamp(14px, 1.25vw, 20px); }

.results { width: min(100%, 1480px); margin-top: clamp(80px, 10vw, 140px); }
.result-grid,
.asset-grid { gap: 16px; }
.card { border-radius: 18px; }

body.workspace .hero {
  height: 0;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
  margin: 0;
  opacity: 0;
}
body.workspace .composer { width: min(100%, 1120px); margin-top: 22px; }
body.workspace .inspiration-reel { max-height: 0; margin: 0; opacity: 0; overflow: hidden; }
body.workspace .results { margin-top: 28px; }

@media (max-width: 1180px) {
  .hero { height: 620px; }
  .hero-title { font-size: clamp(54px, 7vw, 78px); }
  .hero-copy { padding-bottom: 82px; }
  .composer { width: calc(100% - 44px); }
  .reel-grid { grid-auto-rows: 210px; }
}

@media (max-width: 760px) {
  .stage { padding: 10px 12px 96px; }
  .hero {
    height: 590px;
    padding: 28px 24px;
    border-radius: 22px;
  }
  .hero-film { object-position: 63% center; }
  .hero-media-scrim {
    background:
      linear-gradient(0deg, rgba(5,7,6,.92) 0%, rgba(5,7,6,.62) 46%, rgba(5,7,6,.08) 76%),
      linear-gradient(90deg, rgba(5,7,6,.45), transparent 72%);
  }
  .hero-frame-meta { top: 18px; left: 20px; }
  .hero-control { top: 62px; right: 18px; left: 18px; width: auto; }
  .hero-copy { padding-bottom: 104px; }
  .hero-title { font-size: clamp(48px, 14vw, 66px); }
  .hero-lede { max-width: 92%; font-size: 12px; }
  .hero-status { right: 22px; bottom: 22px; left: 22px; justify-content: space-between; }
  .composer { width: calc(100% - 22px); margin-top: -74px; padding: 17px 15px 13px; border-radius: 17px; }
  .prompt-input { min-height: 98px; font-size: 16px; }
  .composer-bar { align-items: flex-end; }
  .send-btn { width: 50px; padding: 0; }
  .send-btn::before { display: none; }
  .inspiration-reel { margin-top: 66px; }
  .reel-head { gap: 16px; align-items: flex-start; flex-direction: column; }
  .reel-head p { max-width: 100%; text-align: left; }
  .reel-grid { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .reel-card:nth-child(n) { grid-column: 1; grid-row: auto; height: 230px; min-height: 0; }
  .reel-card:nth-child(1) { height: 320px; }
  .reel-card:nth-child(3) { height: 300px; }
  .reel-card:nth-child(3) strong,
  .reel-card:nth-child(4) strong { font-size: 20px; }
}

@media (max-width: 430px) {
  .hero { height: 560px; }
  .hero-title { font-size: 47px; }
  .hero-frame-meta i { width: 24px; }
  .hero-status b { display: none; }
  .composer { width: calc(100% - 12px); }
  .chips { gap: 5px; }
  .kind-mini,
  .chip { min-height: 36px; }
  .reel-card:nth-child(n) { border-radius: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-film { animation: none !important; transform: none !important; }
  .reel-card img,
  .reel-card video { transition: none !important; transform: none !important; }
  .reel-play { transition: none !important; }
}

.card-video-shell { position: relative; width: 100%; height: 100%; overflow: hidden; background: #101310; }
.card-video-poster { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; filter: brightness(.76) saturate(.78); transform: scale(1.02); }
.card-video-shell video { position: relative; z-index: 1; }
.card-video-shell.media-failed video { opacity: 0; pointer-events: none; }
.card-video-state { position: absolute; top: 12px; left: 12px; z-index: 2; display: inline-flex; padding: 6px 8px; gap: 6px; align-items: center; border: 1px solid rgba(245,244,237,.16); border-radius: 7px; background: rgba(7,9,8,.42); color: rgba(245,244,237,.7); font-family: var(--mono); font-size: 7px; letter-spacing: .1em; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.card-video-state i { width: 5px; height: 5px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 9px rgba(169,213,197,.62); }

.ai-tools-hero { min-height: 340px; flex: 0 0 auto; isolation: isolate; overflow: hidden; }
.ai-tools-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: 14px;
  right: 0;
  bottom: 14px;
  width: 52%;
  border-radius: 22px;
  background:
    linear-gradient(90deg, var(--bg), transparent 42%),
    linear-gradient(0deg, rgba(8,10,9,.72), transparent 70%),
    url("assets/lumina-motion.webp") center / cover no-repeat;
  filter: saturate(.7);
  opacity: .3;
}
.ai-tools-copy,
.ai-tools-hero-meta { position: relative; z-index: 1; }
.ai-tool-card { min-height: 390px; }
.ai-tool-visual {
  height: 142px;
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--bg);
}
.ai-tool-cover {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.72) contrast(1.04) brightness(.8);
  transform: scale(1.02);
  transition: filter .45s ease, transform .7s var(--snap);
}
.ai-tool-media-shade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(5,7,6,.76)); }
.ai-tool-visual b {
  top: auto;
  right: 12px;
  bottom: 11px;
  left: auto;
  padding: 5px 7px;
  border: 1px solid rgba(244,241,233,.18);
  border-radius: 6px;
  background: rgba(7,9,8,.36);
  color: rgba(244,241,233,.82);
  font-size: 7px;
  transform: none;
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}
.ai-tool-card:hover .ai-tool-cover,
.ai-tool-card.selected .ai-tool-cover { filter: saturate(.94) contrast(1.05) brightness(.9); transform: scale(1.065); }

@media (max-width: 760px) {
  .ai-tools-hero { min-height: 0; }
  .ai-tools-hero::after { top: 0; width: 100%; opacity: .18; }
  .ai-tool-card { min-height: 370px; }
}

/* ========================================================================== 
   LUMINA 2026 · calm static workspace
   ========================================================================== */
body {
  background: var(--bg);
  background-image: none;
}

.main,
.stage { background: var(--bg); }

.sidebar {
  width: 224px;
  padding: 22px 14px 16px;
  border-color: var(--line);
  background: var(--bg-side);
  color: var(--text);
  box-shadow: none;
  transition: none;
}
.nav-item { transition: color .18s ease, background-color .18s ease; }
.nav-item:hover { background: var(--surface); transform: none; }
.nav-item::before { transition: opacity .18s ease; transform: none; }
.nav-item.active::before { transform: none; }
.sidebar.rail,
.sidebar.rail:hover { width: 68px; padding-right: 12px; padding-left: 12px; box-shadow: none; }
.sidebar.rail .brand-text,
.sidebar.rail .nav-label,
.sidebar.rail .nav-item span,
.sidebar.rail .user-info,
.sidebar.rail .logout-btn { opacity: 0; pointer-events: none; }
.sidebar.rail .nav-item { padding-right: 13px; padding-left: 13px; }

.view.active,
.card,
.ai-tool-card,
.ai-workbench-body { animation: none; }
.account-orbit::before,
.workbench-sigil i:nth-child(2) { animation: none; }

.stage {
  padding: 22px clamp(22px, 3vw, 48px) 104px;
  align-items: stretch;
}

.hero {
  width: min(100%, 1280px);
  height: clamp(370px, 48dvh, 470px);
  min-height: 370px;
  max-height: 470px;
  margin: 0 auto;
  padding: clamp(36px, 4.2vw, 58px);
  align-items: end;
  border-radius: 22px;
  box-shadow: none;
}
.hero::before { border-color: rgba(255,255,255,.04); }
.hero-film {
  transform: none;
  filter: saturate(.68) contrast(.97) brightness(.88);
}
.hero-media-scrim {
  background:
    linear-gradient(90deg, rgba(6,8,7,.90) 0%, rgba(6,8,7,.68) 40%, rgba(6,8,7,.10) 72%),
    linear-gradient(0deg, rgba(6,8,7,.66) 0%, transparent 58%);
}
.hero-media-scrim::after { display: none; }
.hero-frame-meta { top: 24px; left: 28px; }
.hero-copy { max-width: 610px; padding-bottom: 8px; }
.hero-copy .eyebrow { margin-bottom: 15px; }
.hero-title {
  max-width: 610px;
  font-size: clamp(48px, 5vw, 68px);
  font-weight: 560;
  letter-spacing: -.062em;
  line-height: .98;
}
.hero-title span { display: block; }
.hero-lede { max-width: 30rem; margin-top: 18px; font-size: 13px; line-height: 1.7; }
.hero-control { top: 22px; right: 22px; width: 264px; }
.mode-switch {
  height: 44px;
  padding: 3px;
  border-radius: 11px;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.mode-btn { min-height: 36px; border-radius: 8px; }
.mode-slider { inset: 3px calc(50% + 1px) 3px 3px; border-radius: 8px; }
.hero-status { right: 28px; bottom: 25px; }

.composer {
  width: min(100%, 1280px);
  margin: 18px auto 0;
  padding: 18px 20px 16px;
  border-color: var(--line-strong);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.composer-glow { display: none; }
.composer::before { display: none; }
.composer:focus-within {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(169,213,197,.06);
  transform: none;
}
.prompt-input { min-height: 72px; font-size: clamp(16px, 1.25vw, 19px); }
.composer-bar { margin-top: 10px; }
.kind-mini,
.chip { background: var(--surface-2); }
.chip:hover { background: var(--surface-3); transform: none; }
.send-btn { height: 44px; border-radius: 9px; box-shadow: none; transition: background-color .18s ease; }
.send-btn:hover { box-shadow: none; transform: none; }

.inspiration-reel { margin: 54px auto 0; }
.reel-grid { gap: 10px; }
.inspire-chip.reel-card { border-radius: 15px; transition: border-color .2s ease, box-shadow .2s ease; }
.inspire-chip.reel-card:hover { box-shadow: 0 12px 30px rgba(0,0,0,.16); transform: none; }
.reel-card img,
.reel-card video { transform: none; transition: filter .22s ease; }
.reel-card:hover img,
.reel-card:hover video { transform: none; }
.ai-tool-cover { transform: none; transition: filter .22s ease; }
.ai-tool-card:hover .ai-tool-cover,
.ai-tool-card.selected .ai-tool-cover { transform: none; }

body.workspace .hero {
  height: clamp(370px, 48dvh, 470px);
  min-height: 370px;
  max-height: 470px;
  margin: 0 auto;
  padding: clamp(36px, 4.2vw, 58px);
  border-width: 1px;
  opacity: 1;
  pointer-events: auto;
}
body.workspace .composer { width: min(100%, 1280px); margin: 18px auto 0; }
body.workspace .inspiration-reel { max-height: none; margin: 54px auto 0; opacity: 1; overflow: visible; }
body.workspace .results { margin-top: 54px; }

[data-theme="light"] .hero {
  border-color: rgba(24,28,24,.10);
  background: #e3e2db;
}
[data-theme="light"] .hero::before { border-color: rgba(255,255,255,.28); }
[data-theme="light"] .hero-film {
  opacity: .82;
  filter: saturate(.52) contrast(.92) brightness(1.04);
}
[data-theme="light"] .hero-media-scrim {
  background:
    linear-gradient(90deg, rgba(238,238,232,.98) 0%, rgba(238,238,232,.88) 38%, rgba(238,238,232,.18) 70%),
    linear-gradient(0deg, rgba(238,238,232,.62), transparent 58%);
}
[data-theme="light"] .hero-title { color: #151813; }
[data-theme="light"] .hero-title span { color: rgba(21,24,19,.65); }
[data-theme="light"] .hero-copy .eyebrow,
[data-theme="light"] .hero-lede,
[data-theme="light"] .hero-frame-meta,
[data-theme="light"] .hero-status { color: rgba(21,24,19,.58); }
[data-theme="light"] .hero-frame-meta b,
[data-theme="light"] .hero-status b { color: rgba(21,24,19,.80); }
[data-theme="light"] .hero-frame-meta i { background: rgba(21,24,19,.20); }
[data-theme="light"] .hero-status span::before { box-shadow: none; }
[data-theme="light"] .mode-switch {
  border-color: rgba(21,24,19,.14);
  background: rgba(247,247,242,.78);
}
[data-theme="light"] .mode-btn { color: rgba(21,24,19,.48); }
[data-theme="light"] .mode-btn.active { color: #f6f6ef; }
[data-theme="light"] .mode-slider { background: #171a16; box-shadow: none; }
[data-theme="light"] .composer {
  border-color: rgba(22,26,22,.13);
  background: #f7f7f2;
  color: #111410;
}
[data-theme="light"] .composer-label,
[data-theme="light"] .composer-label kbd { color: #7a7f77; }
[data-theme="light"] .prompt-input { color: #151813; }
[data-theme="light"] .prompt-input::placeholder { color: #8b9088; }

@media (max-width: 1180px) {
  .hero,
  body.workspace .hero { height: 430px; min-height: 430px; max-height: 430px; }
  .hero-title { font-size: clamp(46px, 6.5vw, 62px); }
  .hero-copy { padding-bottom: 4px; }
  .composer { width: min(100%, 1280px); }
}

@media (max-width: 760px) {
  .sidebar,
  .sidebar:hover,
  .sidebar.rail,
  .sidebar.rail:hover {
    width: 100%;
    height: calc(66px + env(safe-area-inset-bottom));
    padding: 8px 10px env(safe-area-inset-bottom);
    grid-template-columns: minmax(0, 1fr) 52px;
    background: color-mix(in srgb, var(--bg-side) 94%, transparent);
    box-shadow: none;
  }
  .sidebar .nav,
  .sidebar:hover .nav,
  .sidebar.rail .nav,
  .sidebar.rail:hover .nav {
    display: grid;
    width: 100%;
    min-width: 0;
    margin: 0;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .sidebar .nav-item,
  .sidebar:hover .nav-item,
  .sidebar.rail .nav-item,
  .sidebar.rail:hover .nav-item {
    display: flex;
    min-width: 0;
    height: 50px;
    min-height: 50px;
    max-height: 50px;
    padding: 5px 3px;
    gap: 3px;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    overflow: hidden;
    font-size: 8px;
    text-align: center;
  }
  .nav-item-feature { margin-top: 0; border-color: transparent; }
  .nav-new { display: none; }
  .sidebar .nav-item span,
  .sidebar:hover .nav-item span,
  .sidebar.rail .nav-item span,
  .sidebar.rail:hover .nav-item span {
    display: inline;
    overflow: hidden;
    max-width: 100%;
    opacity: 1;
    pointer-events: auto;
    text-overflow: ellipsis;
  }
  .sidebar .side-bottom,
  .sidebar.rail .side-bottom {
    display: block;
    width: 52px;
    grid-column: 2;
    grid-row: 1;
  }
  .side-bottom #settingsBtn { width: 52px; }
  .stage { padding: 12px 12px 88px; }
  .hero,
  body.workspace .hero {
    height: 500px;
    min-height: 500px;
    max-height: 500px;
    padding: 24px 22px;
    border-radius: 18px;
  }
  .hero-film { object-position: 64% center; }
  .hero-control { top: 18px; right: 18px; left: 18px; width: auto; }
  .hero-frame-meta { top: 78px; left: 22px; }
  .hero-copy { padding: 0; }
  .hero-title { max-width: 340px; font-size: clamp(40px, 12vw, 52px); }
  .hero-lede { max-width: 90%; font-size: 12px; }
  .hero-status { display: none; }
  .composer,
  body.workspace .composer { width: 100%; margin: 14px auto 0; padding: 16px 14px 13px; }
  .prompt-input { min-height: 88px; font-size: 16px; }
  .inspiration-reel,
  body.workspace .inspiration-reel { margin-top: 48px; }
}

@media (max-width: 430px) {
  .hero,
  body.workspace .hero { height: 470px; min-height: 470px; max-height: 470px; }
  .hero-title { font-size: 42px; }
  .composer { width: 100%; }
}

/* ========================================================================== 
   LUMINA 2026 · editorial operations system
   Visual thesis: editorial precision + quiet production utility.
   ========================================================================== */
:root,
[data-theme="dark"] {
  --workspace-max: 1280px;
  --workspace-gutter: clamp(22px, 3vw, 42px);
  --workspace-radius: 18px;
  --bg: #0d100f;
  --bg-side: #111412;
  --surface: #171b18;
  --surface-2: #1e2420;
  --surface-3: #29312b;
  --line: rgba(240, 242, 235, .10);
  --line-strong: rgba(240, 242, 235, .19);
  --text: #f1f2ec;
  --muted: #a2a9a1;
  --quiet: #747c75;
  --accent: #dfe8df;
  --accent-hover: #ffffff;
  --accent-text: #122019;
  --signal: #70ad9d;
  --shadow: 0 22px 54px rgba(0, 0, 0, .24);
  --shadow-soft: 0 12px 28px rgba(0, 0, 0, .16);
}

[data-theme="light"] {
  --bg: #ecece6;
  --bg-side: #e2e2db;
  --surface: #f8f8f3;
  --surface-2: #e8e9e2;
  --surface-3: #d9ddd6;
  --line: rgba(19, 26, 22, .10);
  --line-strong: rgba(19, 26, 22, .19);
  --text: #151a17;
  --muted: #4f5851;
  --quiet: #596159;
  --accent: #1b2a23;
  --accent-hover: #0d1712;
  --accent-text: #f5f8f3;
  --signal: #2f7564;
  --shadow: 0 20px 50px rgba(35, 42, 36, .10);
  --shadow-soft: 0 10px 28px rgba(35, 42, 36, .075);
}

body { letter-spacing: -.01em; }
.main,
.stage { background: var(--bg); }

.sidebar,
.sidebar.rail,
.sidebar.rail:hover {
  width: 216px;
  padding: 20px 13px 15px;
  border-right: 1px solid var(--line);
  background: var(--bg-side);
}
.brand { padding: 0 6px 24px; }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; background: var(--text); color: var(--accent-text); }
.brand-name { letter-spacing: .28em; }
.nav-label { padding: 8px 12px; color: var(--quiet); font-size: 8px; }
.nav-item,
.sidebar.rail .nav-item {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 10px;
}
.nav-item:hover { border-color: var(--line); background: var(--surface-2); }
.nav-item.active { border-color: var(--line); background: var(--surface); box-shadow: 0 1px 0 rgba(255,255,255,.025); }
.nav-item.active::before { height: 12px; background: var(--signal); box-shadow: none; }
.nav-item-feature { margin-top: 9px; border-color: var(--line); background: transparent; }
.nav-new { border: 0; background: transparent; color: var(--signal); }
.sidebar.rail .brand-text,
.sidebar.rail .nav-label,
.sidebar.rail .nav-item span,
.sidebar.rail .user-info,
.sidebar.rail .logout-btn { opacity: 1; pointer-events: auto; }
.sidebar.rail .rail-toggle { display: grid; }

.view-head,
.ai-tools-hero,
.tool-wrap {
  width: calc(100% - (var(--workspace-gutter) * 2));
  max-width: var(--workspace-max);
  margin-right: auto;
  margin-left: auto;
}

.view-head {
  padding: 42px 0 22px;
  align-items: flex-end;
  border-bottom: 1px solid var(--line);
}
.view-head .eyebrow { margin-bottom: 9px; }
.view-title { font-family: var(--sans); font-size: clamp(30px, 3.2vw, 44px); font-weight: 610; letter-spacing: -.052em; }
.view-subtitle { max-width: 38rem; margin-top: 8px; font-size: 11px; }

.stage { padding: 22px var(--workspace-gutter) 96px; }
.hero,
body.workspace .hero {
  position: relative;
  display: flex;
  width: min(100%, var(--workspace-max));
  height: clamp(350px, 42dvh, 430px);
  min-height: 350px;
  max-height: 430px;
  margin: 0 auto;
  padding: 112px 48px 44px;
  gap: 0;
  align-items: flex-end;
  justify-content: flex-start;
  flex-direction: row;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--workspace-radius);
  background: var(--surface);
  box-shadow: none;
  opacity: 1;
  pointer-events: auto;
  isolation: isolate;
  text-align: left;
}
.hero::before { border-color: rgba(255,255,255,.035); }
.hero-media { z-index: 0; inset: 0 0 0 42%; }
.hero-film { filter: saturate(.58) contrast(1.01) brightness(.76); }
.hero-media-scrim {
  background:
    linear-gradient(90deg, var(--surface) 0%, color-mix(in srgb, var(--surface) 85%, transparent) 18%, transparent 58%),
    linear-gradient(0deg, rgba(4, 7, 5, .48), transparent 56%);
}
.hero-frame-meta { top: 28px; left: calc(42% + 24px); color: rgba(244,246,240,.64); }
.hero-copy { z-index: 2; max-width: 520px; padding: 0; }
.hero-copy .eyebrow { margin-bottom: 13px; color: var(--quiet); }
.hero-title {
  max-width: 520px;
  color: var(--text);
  font-size: clamp(48px, 4.6vw, 64px);
  font-weight: 590;
  letter-spacing: -.068em;
  line-height: .96;
}
.hero-title span { color: color-mix(in srgb, var(--text) 62%, var(--quiet)); }
.hero-lede { max-width: 26rem; margin-top: 18px; color: var(--muted); font-size: 12px; }
.hero-control { top: 26px; right: auto; left: 48px; width: 286px; }
.mode-switch { height: 42px; border-color: var(--line-strong); border-radius: 10px; background: var(--surface-2); }
.mode-btn { min-height: 34px; border-radius: 7px; color: var(--muted); }
.mode-btn.active { color: var(--accent-text); }
.mode-slider { border-radius: 7px; background: var(--accent); box-shadow: none; }
.hero-status { right: 24px; bottom: 20px; }

[data-theme="light"] .hero-film { opacity: .94; filter: saturate(.52) contrast(.94) brightness(.98); }
[data-theme="light"] .hero-media-scrim {
  background:
    linear-gradient(90deg, var(--surface) 0%, color-mix(in srgb, var(--surface) 88%, transparent) 23%, transparent 62%),
    linear-gradient(0deg, rgba(21, 27, 23, .16), transparent 58%);
}
[data-theme="light"] .hero-title { color: var(--text); }
[data-theme="light"] .hero-title span { color: color-mix(in srgb, var(--text) 62%, var(--quiet)); }
[data-theme="light"] .hero-copy .eyebrow,
[data-theme="light"] .hero-lede { color: var(--muted); }
[data-theme="light"] .mode-switch { border-color: var(--line); background: rgba(248,248,243,.88); }
[data-theme="light"] .mode-btn { color: var(--muted); }
[data-theme="light"] .mode-btn.active { color: var(--accent-text); }
[data-theme="light"] .mode-slider { background: var(--accent); }

.composer,
body.workspace .composer {
  width: min(100%, var(--workspace-max));
  margin: 14px auto 0;
  padding: 18px 20px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: none;
}
.composer:focus-within { border-color: color-mix(in srgb, var(--signal) 60%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 9%, transparent); }
.prompt-input { min-height: 70px; font-size: clamp(16px, 1.4vw, 19px); }
.kind-mini,
.chip { min-height: 36px; border-color: var(--line); border-radius: 8px; background: var(--surface-2); }
.chip:hover { border-color: var(--line-strong); background: var(--surface-3); }
.send-btn { width: auto; min-width: 92px; height: 42px; padding: 0 14px; border-radius: 9px; background: var(--accent); color: var(--accent-text); }

.inspiration-reel,
body.workspace .inspiration-reel,
.results,
body.workspace .results { width: min(100%, var(--workspace-max)); margin-right: auto; margin-left: auto; }
.inspiration-reel,
body.workspace .inspiration-reel { margin-top: 40px; }
.reel-grid { gap: 12px; }
.inspire-chip.reel-card { border-radius: 13px; }
.inspire-chip.reel-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-soft); }
.results,
body.workspace .results { margin-top: 46px; }

#viewAssets,
#viewAdmin { background: var(--bg); }
.asset-grid {
  display: grid;
  width: calc(100% - (var(--workspace-gutter) * 2));
  max-width: var(--workspace-max);
  margin: 0 auto;
  padding: 22px 0 72px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
#viewAssets .card,
#viewAssets .card.r-square,
#viewAssets .card.r-tall,
#viewAssets .card.r-wide { aspect-ratio: 4 / 3; }
.card { border-radius: 13px; background: var(--surface-2); animation: none; }
.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-soft); transform: none; }
.card-media-shell,
.card-video-shell { position: relative; width: 100%; height: 100%; overflow: hidden; background: var(--surface-2); }
.card-media-fallback { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; filter: saturate(.5) contrast(.96) brightness(.78); opacity: 0; }
.card-media-image { position: relative; z-index: 1; }
.card-media-shell.media-failed .card-media-fallback { opacity: 1; }
.card-media-shell.media-failed .card-media-image { opacity: 0; pointer-events: none; }
.card-image-state { position: absolute; top: 12px; left: 12px; z-index: 2; padding: 5px 7px; border: 1px solid rgba(245,246,240,.18); border-radius: 6px; background: rgba(8,12,10,.52); color: rgba(245,246,240,.76); font-family: var(--mono); font-size: 7px; letter-spacing: .09em; }
.card-overlay { min-height: 40%; padding: 48px 14px 13px; background: linear-gradient(180deg, transparent, rgba(5,8,6,.84)); opacity: 1; transform: none; }
.card-prompt { font-family: var(--sans); font-size: 11px; }
.asset-filters { padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.af-btn { min-width: 62px; padding: 7px 11px; border-radius: 6px; }
.af-btn::after { display: none; }
.af-btn.active { background: var(--surface); }

#viewTools { overflow-y: auto; }
#viewTools > .view-head { display: flex; }
.tool-wrap {
  min-height: 650px;
  margin-top: 18px;
  margin-bottom: 24px;
  flex: 1 0 650px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--workspace-radius);
  background: var(--surface);
  box-shadow: none;
}
.tool-frame { background: var(--surface); }

#viewAiTools { padding: 0 0 76px; background: var(--bg); }
.ai-tools-hero {
  min-height: 0;
  padding: 46px 0 28px;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 52px;
  border-bottom: 1px solid var(--line);
}
.ai-tools-hero::before,
.ai-tools-hero::after { display: none; }
.ai-tools-copy h2 { font-size: clamp(34px, 4vw, 52px); font-weight: 620; line-height: 1.02; }
.ai-tools-copy p { max-width: 540px; margin-top: 16px; font-size: 11px; }
.ai-tools-hero-meta { align-self: end; }
.ai-tools-hero-meta div { min-height: 74px; padding: 12px 15px; }
.ai-tools-hero-meta b { font-size: 18px; }
.ai-tools-toolbar,
.ai-library-layout,
.ai-task-section {
  width: calc(100% - (var(--workspace-gutter) * 2));
  max-width: var(--workspace-max);
}
.ai-tools-toolbar { padding: 18px 0; }
.ai-search-wrap input { height: 40px; border-radius: 9px; background: var(--surface); }
.ai-tool-filters { border-radius: 9px; background: var(--surface); }
.ai-tool-filters button { min-height: 30px; border-radius: 6px; }
.ai-library-layout { grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; }
.ai-tool-grid { gap: 12px; }
.ai-tool-card {
  min-height: 318px;
  padding: 15px;
  border-radius: 14px;
  background: var(--surface);
  opacity: 1;
  transform: none;
  animation: none;
  box-shadow: none;
}
.ai-tool-card::before { display: none; }
.ai-tool-card:hover,
.ai-tool-card.selected { border-color: color-mix(in srgb, var(--signal) 48%, var(--line)); transform: none; box-shadow: var(--shadow-soft); }
.ai-tool-card.selected { box-shadow: inset 3px 0 var(--signal); }
.ai-tool-visual { height: 126px; margin-top: 13px; border-radius: 10px; }
.ai-tool-cover { filter: saturate(.62) contrast(1.03) brightness(.83); transform: none; }
.ai-tool-card:hover .ai-tool-cover,
.ai-tool-card.selected .ai-tool-cover { filter: saturate(.76) contrast(1.03) brightness(.88); transform: none; }
.ai-tool-card-copy { margin-top: 13px; }
.ai-tool-card-copy strong { margin-top: 5px; font-size: 19px; }
.ai-tool-card-foot { padding-top: 14px; }
.ai-workbench { top: 16px; min-height: 520px; border-radius: 14px; background: var(--surface); box-shadow: none; }
.ai-workbench-empty { min-height: 520px; padding: 32px; }
.workbench-sigil { width: 68px; height: 68px; margin-bottom: 28px; }
.workbench-sigil i:nth-child(2) { animation: none; }
.ai-task-section { margin-top: 48px; }

.view.active,
.card,
.ai-tool-card,
.ai-workbench-body { animation: none; }
.reel-card img,
.reel-card video,
.ai-tool-cover { transition: filter .18s ease; }

@media (max-width: 1180px) {
  .asset-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ai-tools-hero { grid-template-columns: 1fr; gap: 24px; }
  .ai-tools-hero-meta { max-width: 620px; }
  .ai-library-layout { grid-template-columns: 1fr; }
  .ai-workbench { position: relative; top: auto; min-height: 0; }
  .ai-workbench-empty { min-height: 270px; }
}

@media (max-width: 760px) {
  :root { --workspace-gutter: 14px; }
  .sidebar,
  .sidebar:hover,
  .sidebar.rail,
  .sidebar.rail:hover { width: 100%; }
  .sidebar .brand-text,
  .sidebar .nav-label,
  .sidebar .logout-btn,
  .sidebar .user-info { display: none; }
  .sidebar .nav-item,
  .sidebar:hover .nav-item,
  .sidebar.rail .nav-item,
  .sidebar.rail:hover .nav-item { height: 44px; min-height: 44px; max-height: 44px; }
  .nav-item-feature { margin-top: 0; }
  .stage { padding: 12px var(--workspace-gutter) 86px; }
  .hero,
  body.workspace .hero {
    height: 470px;
    min-height: 470px;
    max-height: 470px;
    padding: 106px 22px 28px;
    border-radius: 14px;
  }
  .hero-media { inset: 56% 0 0; }
  .hero-media-scrim { background: linear-gradient(180deg, var(--surface), transparent 35%), linear-gradient(0deg, rgba(5,8,6,.44), transparent 68%); }
  .hero-control { top: 18px; right: 18px; left: 18px; width: auto; }
  .hero-frame-meta { top: calc(56% + 16px); left: 20px; }
  .hero-copy { align-self: flex-start; }
  .hero-title { font-size: clamp(40px, 12vw, 50px); }
  .hero-lede { font-size: 11px; }
  .composer,
  body.workspace .composer { margin-top: 10px; padding: 15px 13px 12px; border-radius: 12px; }
  .send-btn { width: 48px; min-width: 48px; padding: 0; }
  .send-btn::before { display: none; }
  .view-head { padding-top: 28px; gap: 18px; align-items: flex-start; flex-direction: column; }
  .asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .card-overlay { min-height: 48%; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; }
  .card-prompt { font-size: 10px; }
  .card-model { display: none; }
  .tool-wrap { min-height: 640px; flex-basis: 640px; border-radius: 14px; }
  #viewAiTools { padding-bottom: 84px; }
  .ai-tools-hero { padding-top: 30px; }
  .ai-tools-copy h2 { font-size: 39px; }
  .ai-tools-hero-meta { grid-template-columns: repeat(3, 1fr); }
  .ai-tools-hero-meta div { min-height: 64px; padding: 10px; border-right: 1px solid var(--line); border-bottom: 0; }
  .ai-tools-toolbar { align-items: stretch; flex-direction: column; }
  .ai-tool-filters { overflow-x: auto; }
  .ai-tool-grid { grid-template-columns: 1fr; }
  .ai-tool-card { min-height: 304px; }
}

@media (max-width: 430px) {
  .ai-tools-hero-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ai-tools-hero-meta div { min-height: 60px; border-right: 1px solid var(--line); border-bottom: 0; }
  .ai-tools-hero-meta div:last-child { border-right: 0; }
  .ai-tools-hero-meta b { font-size: 15px; }
  .ai-tools-hero-meta span { font-size: 7px; }
}

/* ========================================================================== 
   LUMINA AI TOOLKIT · clarity pass
   ========================================================================== */
.ai-library-layout {
  grid-template-columns: minmax(0, 1fr) minmax(400px, 440px);
  gap: 20px;
}
.ai-tool-grid { gap: 16px; }
.ai-tool-card {
  min-height: 410px;
  padding: 18px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 96%, var(--text) 4%);
}
.ai-tool-card:hover,
.ai-tool-card.selected {
  border-color: color-mix(in srgb, var(--signal) 62%, var(--line));
  box-shadow: 0 16px 36px rgba(16, 24, 21, .08);
}
.ai-tool-card.selected { box-shadow: inset 4px 0 var(--signal), 0 16px 36px rgba(16, 24, 21, .08); }
.ai-tool-card-top i,
.ai-tool-card-top em { font-size: 10px; letter-spacing: .08em; }
.ai-tool-visual {
  height: 174px;
  margin-top: 15px;
  overflow: hidden;
  border-radius: 13px;
  background: #111411;
}
.ai-tool-cover {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  background-image: url('assets/lumina-tool-atlas-v2.png');
  background-position: var(--atlas-position);
  background-size: 300% 200%;
  background-repeat: no-repeat;
  filter: saturate(.92) contrast(1.02) brightness(.92);
  transform: none;
  transition: filter .18s ease;
}
.ai-tool-card:hover .ai-tool-cover,
.ai-tool-card.selected .ai-tool-cover { filter: saturate(1) contrast(1.04) brightness(.98); transform: none; }
.ai-tool-media-shade { background: linear-gradient(180deg, transparent 44%, rgba(7, 9, 8, .72)); }
.ai-tool-visual b {
  right: 12px;
  bottom: 12px;
  padding: 6px 9px;
  border-color: rgba(255,255,255,.26);
  background: rgba(9, 12, 10, .64);
  color: #fff;
  font-size: 10px;
  letter-spacing: .04em;
}
.ai-tool-card-copy { margin-top: 16px; }
.ai-tool-card-copy small { font-size: 11px; letter-spacing: .035em; }
.ai-tool-card-copy strong { margin-top: 6px; font-size: 23px; line-height: 1.18; }
.ai-tool-card-copy > span {
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.62;
  -webkit-line-clamp: 2;
}
.ai-tool-card-copy > .ai-tool-requires {
  display: flex;
  margin-top: 13px;
  gap: 6px;
  align-items: center;
  overflow: visible;
  color: var(--text);
  -webkit-line-clamp: unset;
  flex-wrap: wrap;
}
.ai-tool-requires i { color: var(--quiet); font-size: 10px; font-style: normal; }
.ai-tool-requires b {
  padding: 4px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tone) 13%, transparent);
  color: color-mix(in srgb, var(--tone) 74%, var(--text));
  font-size: 10px;
  font-weight: 650;
}
.ai-tool-card-foot { padding-top: 16px; }
.ai-tool-card-foot i { padding: 5px 7px; font-size: 9px; }

.ai-workbench {
  min-height: 580px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 97%, var(--text) 3%);
  box-shadow: 0 18px 44px rgba(16, 24, 21, .07);
}
.ai-workbench-head { padding: 26px 26px 22px; }
.ai-workbench-head h3 { font-size: 26px; }
.ai-workbench-head p { margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.ai-workbench-tags { padding: 16px 26px 0; }
.ai-workbench-tags span { padding: 5px 8px; font-size: 10px; }
.ai-workbench-form { padding: 22px 26px 26px; gap: 18px; }
.ai-field { gap: 9px; }
.ai-field-label { color: var(--text); font-size: 12px; font-weight: 620; }
.ai-field-label i { font-size: 10px; }
.ai-field textarea,
.ai-field select,
.ai-input-unit input { min-height: 46px; padding: 12px 13px; border-radius: 11px; font-size: 13px; }
.ai-upload-input[hidden] { display: none; }
.ai-upload-zone {
  width: 100%;
  min-height: 88px;
  padding: 14px;
  border-radius: 13px;
  background: var(--bg);
  color: var(--text);
  text-align: left;
}
.ai-upload-zone:disabled { cursor: wait; opacity: .78; }
.ai-upload-zone:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); outline: 0; }
.ai-upload-icon { width: 42px; height: 42px; }
.ai-upload-copy b { font-size: 12px; }
.ai-upload-copy small { margin-top: 5px; font-size: 10px; white-space: normal; line-height: 1.45; }
.ai-upload-state { padding: 5px 8px; font-size: 10px; }
.ai-upload-field.ready .ai-upload-zone { border-style: solid; border-color: color-mix(in srgb, var(--signal) 42%, var(--line)); }
.ai-upload-field.has-error .ai-upload-zone { border-color: color-mix(in srgb, #c85e55 58%, var(--line)); }
.ai-upload-preview {
  display: grid;
  min-height: 70px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg);
  place-items: center;
}
.ai-upload-preview img,
.ai-upload-preview video { display: block; width: 100%; max-height: 190px; object-fit: cover; }
.ai-upload-preview audio { width: calc(100% - 20px); height: 38px; }
.ai-upload-feedback {
  display: flex;
  min-height: 24px;
  gap: 8px;
  align-items: center;
  color: var(--quiet);
  font-size: 10px;
}
.ai-upload-feedback span { min-width: 0; margin-right: auto; line-height: 1.45; }
.ai-upload-feedback button { padding: 4px 7px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font-size: 10px; }
.ai-upload-feedback button:hover { border-color: var(--line-strong); color: var(--text); }
.ai-upload-feedback.error { color: #c85e55; }
.ai-workbench-readiness {
  display: flex;
  padding: 12px 13px;
  gap: 4px;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg);
}
.ai-workbench-readiness b { font-size: 12px; }
.ai-workbench-readiness span { color: var(--muted); font-size: 10px; line-height: 1.5; }
.ai-workbench-readiness.ready { border-color: color-mix(in srgb, var(--signal) 44%, var(--line)); }
.ai-workbench-readiness.ready b { color: var(--signal); }
.ai-workbench-readiness.error { border-color: color-mix(in srgb, #c85e55 48%, var(--line)); }
.ai-workbench-readiness.error b { color: #c85e55; }
.ai-run-note { font-size: 10px; }
.ai-run-btn { min-height: 52px; padding: 0 18px; font-size: 13px; }
.ai-run-btn:hover:not(:disabled) { transform: none; }
.ai-task-row { min-height: 106px; grid-template-columns: 48px minmax(190px, .9fr) minmax(200px, 1.3fr) minmax(150px, .7fr); }
.ai-task-main small { font-size: 9px; }
.ai-task-main strong { font-size: 14px; }
.ai-task-main > span { font-size: 10px; }
.ai-task-result img,
.ai-task-result video { width: 128px; height: 78px; }
.ai-task-side { font-size: 11px; }

[data-theme="light"] .ai-tool-cover { filter: saturate(.88) contrast(1.02) brightness(.96); }
[data-theme="light"] .ai-tool-card:hover .ai-tool-cover,
[data-theme="light"] .ai-tool-card.selected .ai-tool-cover { filter: saturate(.98) contrast(1.04) brightness(1); }

@media (max-width: 1280px) {
  .ai-library-layout { grid-template-columns: minmax(0, 1fr) 390px; }
  .ai-tool-visual { height: 154px; }
}
@media (max-width: 1180px) {
  .ai-library-layout { grid-template-columns: 1fr; }
  .ai-workbench { position: relative; top: auto; }
}
@media (max-width: 760px) {
  .ai-tool-card { min-height: 390px; }
  .ai-tool-visual { height: 170px; }
  .ai-workbench-head,
  .ai-workbench-form { padding-right: 18px; padding-left: 18px; }
  .ai-workbench-tags { padding-left: 18px; }
  .ai-task-row { grid-template-columns: 1fr; gap: 10px; }
  .ai-task-index { display: none; }
  .ai-task-side { align-items: flex-start; text-align: left; }
}

/* ========================================================================== 
   LUMINA REFERENCE REBUILD
   Prompt-first studio home, project-task canvas, restrained dark system.
   ========================================================================== */
:root,
[data-theme="dark"] {
  --studio-bg: #070707;
  --studio-side: #0b0b0b;
  --studio-panel: #131313;
  --studio-panel-2: #191919;
  --studio-panel-3: #222222;
  --studio-line: rgba(255, 255, 255, .1);
  --studio-line-strong: rgba(255, 255, 255, .19);
  --studio-text: #f5f5f3;
  --studio-muted: #9b9b96;
  --studio-quiet: #666662;
  --studio-accent: #f3f4f2;
  --studio-accent-soft: rgba(255, 255, 255, .09);
  --studio-danger: #c9c9c6;
  --studio-ok: #e1e3df;
  --bg: var(--studio-bg);
  --bg-side: var(--studio-side);
  --surface: var(--studio-panel);
  --surface-2: var(--studio-panel-2);
  --surface-3: var(--studio-panel-3);
  --line: var(--studio-line);
  --line-strong: var(--studio-line-strong);
  --text: var(--studio-text);
  --muted: var(--studio-muted);
  --quiet: var(--studio-quiet);
  --accent: var(--studio-accent);
  --accent-hover: #ffffff;
  --accent-text: #050505;
  --ok: var(--studio-ok);
  --danger: var(--studio-danger);
  --shadow: 0 28px 80px rgba(0, 0, 0, .42);
  --shadow-soft: 0 18px 44px rgba(0, 0, 0, .25);
  --workspace-max: 1120px;
  --workspace-gutter: clamp(24px, 3.6vw, 60px);
  color-scheme: dark;
}

[data-theme="light"] {
  --studio-bg: #f5f5f2;
  --studio-side: #ecece8;
  --studio-panel: #ffffff;
  --studio-panel-2: #efefec;
  --studio-panel-3: #e3e3df;
  --studio-line: rgba(0, 0, 0, .1);
  --studio-line-strong: rgba(0, 0, 0, .18);
  --studio-text: #11110f;
  --studio-muted: #5d5d58;
  --studio-quiet: #85857f;
  --studio-accent: #0b0c0c;
  --studio-accent-soft: rgba(0, 0, 0, .06);
  --studio-danger: #3f4241;
  --studio-ok: #1f2221;
  --bg: var(--studio-bg);
  --bg-side: var(--studio-side);
  --surface: var(--studio-panel);
  --surface-2: var(--studio-panel-2);
  --surface-3: var(--studio-panel-3);
  --line: var(--studio-line);
  --line-strong: var(--studio-line-strong);
  --text: var(--studio-text);
  --muted: var(--studio-muted);
  --quiet: var(--studio-quiet);
  --accent: var(--studio-accent);
  --accent-hover: #000000;
  --accent-text: #fff;
  --ok: var(--studio-ok);
  --danger: var(--studio-danger);
  color-scheme: light;
}

body {
  background: var(--studio-bg);
  color: var(--studio-text);
  letter-spacing: -.006em;
}

#app { background: var(--studio-bg); }

.sidebar {
  width: 168px;
  min-width: 168px;
  padding: 20px 14px 14px;
  border-right: 1px solid var(--studio-line);
  background: var(--studio-side);
  box-shadow: none;
}
.sidebar:hover,
.sidebar.rail,
.sidebar.rail:hover { width: 168px; min-width: 168px; box-shadow: none; }
.sidebar .brand { min-height: 52px; padding: 0 5px; gap: 10px; justify-content: flex-start; }
.sidebar .brand-mark {
  width: 38px;
  height: 38px;
  border: 1px solid var(--studio-line-strong);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(255,255,255,.12), rgba(255,255,255,.015));
  color: var(--studio-text);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 720;
}
.sidebar .brand-text { display: flex !important; min-width: 0; gap: 3px; flex-direction: column; }
.sidebar .brand-name { color: var(--studio-text); font-size: 11px; letter-spacing: .24em; }
.sidebar .brand-sub { color: var(--studio-quiet); font-size: 7px; letter-spacing: .12em; }
.sidebar .nav-label { display: block !important; margin: 26px 8px 10px; color: var(--studio-quiet); font-size: 7px; letter-spacing: .2em; }
.sidebar .rail-toggle { display: none !important; }
.sidebar .nav { display: flex; margin-top: 0; gap: 6px; flex-direction: column; }
.sidebar .nav-item,
.sidebar.rail .nav-item {
  display: flex;
  width: 100%;
  min-width: 0;
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  padding: 0 12px;
  gap: 10px;
  justify-content: flex-start;
  flex-direction: row;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--studio-quiet);
  font-size: 10px;
  transform: none;
}
.sidebar .nav-item svg { width: 16px; height: 16px; }
.sidebar .nav-item span,
.sidebar.rail .nav-item span { display: block; opacity: 1; pointer-events: auto; }
.sidebar .nav-item::before { top: 11px; bottom: 11px; left: 2px; width: 2px; border-radius: 3px; background: var(--studio-accent); }
.sidebar .nav-item:hover { border-color: var(--studio-line); background: rgba(255,255,255,.025); color: var(--studio-text); transform: none; }
.sidebar .nav-item.active { border-color: var(--studio-line); background: var(--studio-panel-2); color: var(--studio-text); }
.sidebar .nav-item.active svg { color: var(--studio-accent); }
.sidebar #navAiTools { order: 4; margin-top: 0; }
.sidebar #navAdmin { order: 5; }
.sidebar .nav-new { top: 14px; right: 10px; padding: 0; background: none; color: var(--studio-muted); font-size: 7px; }
.sidebar .side-bottom { gap: 7px; }
.sidebar #settingsBtn { width: 100%; }
.sidebar .user-card {
  display: flex;
  width: 100%;
  min-height: 48px;
  padding: 8px 7px;
  gap: 8px;
  justify-content: flex-start;
  border-color: var(--studio-line);
}
.sidebar .user-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--studio-panel-3); color: var(--studio-text); font-family: var(--sans); }
.sidebar .user-info { display: block; min-width: 0; }
.sidebar .user-email { overflow: hidden; color: var(--studio-muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .user-balance { margin-top: 3px; color: var(--studio-quiet); font-size: 7px; }
.sidebar .logout-btn { display: none; }
.sidebar .account-popover { bottom: 0; left: 158px; }

.main,
.view,
#viewCreate { min-width: 0; background: var(--studio-bg); }
.view.active { animation: studio-fade .28s cubic-bezier(.2,.8,.2,1) both; }
@keyframes studio-fade { from { opacity: 0; } to { opacity: 1; } }

.stage {
  position: relative;
  display: flex;
  padding: 0 var(--workspace-gutter) 54px;
  align-items: center;
  justify-content: flex-start;
  background:
    radial-gradient(circle at 50% 9%, rgba(255, 255, 255, .075), transparent 33%),
    radial-gradient(circle, rgba(255, 255, 255, .075) .7px, transparent .8px) 50% 32px / 16px 16px,
    var(--studio-bg);
}
.stage::after {
  content: "";
  position: absolute;
  top: 34px;
  right: 0;
  left: 0;
  height: 260px;
  background: linear-gradient(180deg, transparent, var(--studio-bg));
  pointer-events: none;
}
.stage > * { z-index: 1; }
.studio-ribbon {
  display: grid;
  width: min(100%, var(--workspace-max));
  min-height: 38px;
  margin: 0 auto;
  padding: 0 16px;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: center;
  border-right: 1px solid var(--studio-line);
  border-bottom: 1px solid var(--studio-line);
  border-left: 1px solid var(--studio-line);
  border-radius: 0 0 12px 12px;
  background: linear-gradient(90deg, rgba(30,34,36,.78), rgba(15,18,20,.96), rgba(27,29,30,.78));
  color: var(--studio-muted);
  font-size: 10px;
}
.studio-ribbon span { justify-self: start; color: var(--studio-text); font-weight: 620; }
.studio-ribbon span i { margin-right: 7px; color: var(--studio-accent); font-style: normal; }
.studio-ribbon strong { color: var(--studio-muted); font-weight: 480; }
.studio-ribbon button { justify-self: end; color: var(--studio-accent); font-size: 10px; }
.studio-ribbon button b { margin-left: 5px; }

.hero,
body.workspace .hero {
  display: flex;
  width: min(100%, 920px);
  height: auto;
  min-height: 0;
  max-height: none;
  margin: 0 auto;
  padding: clamp(48px, 6.5vh, 70px) 0 18px;
  gap: 14px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
  opacity: 1;
}
.hero::before,
.hero::after { display: none; }
.hero-copy { max-width: 820px; padding: 0; }
.hero-copy .eyebrow { display: none; }
.hero-title {
  max-width: none;
  color: var(--studio-text);
  font-family: var(--sans);
  font-size: clamp(36px, 3.6vw, 48px);
  font-weight: 650;
  letter-spacing: -.065em;
  line-height: 1.02;
}
.hero-lede { max-width: 560px; margin: 10px auto 0; color: var(--studio-muted); font-size: 11px; line-height: 1.65; }
.hero-control { position: static; width: 246px; }
.hero-control-label,
.hero-footnote,
.hero-status { display: none; }
.mode-switch {
  height: 40px;
  padding: 4px;
  border: 1px solid var(--studio-line-strong);
  border-radius: 999px;
  background: rgba(13,13,13,.78);
  box-shadow: inset 0 1px rgba(255,255,255,.03);
}
.mode-btn { min-height: 30px; border-radius: 999px; color: var(--studio-muted); font-size: 11px; }
.mode-btn.active { color: var(--accent-text); }
.mode-slider { inset: 4px auto 4px 4px; width: calc(50% - 4px); border-radius: 999px; background: var(--studio-accent); box-shadow: none; }
.mode-switch.video .mode-slider { transform: translateX(100%); }

.composer,
body.workspace .composer {
  width: min(100%, 980px);
  min-height: 152px;
  margin: 0 auto;
  padding: 18px 18px 14px;
  border: 1px solid var(--studio-line-strong);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(22,22,22,.98), rgba(13,13,13,.98));
  box-shadow: 0 26px 68px rgba(0,0,0,.3), inset 0 1px rgba(255,255,255,.03);
}
.composer-glow { display: none; }
.composer:focus-within { border-color: rgba(255,255,255,.42); box-shadow: 0 26px 68px rgba(0,0,0,.3), 0 0 0 3px rgba(255,255,255,.055); }
.composer-label { color: var(--studio-quiet); font-family: var(--sans); font-size: 10px; letter-spacing: .06em; }
.composer-label kbd { border: 0; background: transparent; color: var(--studio-quiet); }
.prompt-input {
  min-height: 62px;
  max-height: 132px;
  margin-top: 7px;
  color: var(--studio-text);
  font-size: clamp(15px, 1.35vw, 19px);
  font-weight: 430;
  line-height: 1.55;
}
.prompt-input::placeholder { color: #686863; opacity: 1; }
.composer-bar { margin-top: 3px; gap: 12px; align-items: center; }
.chips { gap: 7px; }
.kind-mini,
.chip {
  min-height: 36px;
  border: 1px solid var(--studio-line);
  border-radius: 10px;
  background: rgba(255,255,255,.025);
  color: var(--studio-muted);
}
.kind-mini { padding: 3px; }
.km-btn { border-radius: 7px; color: var(--studio-quiet); }
.km-btn.active { background: var(--studio-panel-3); color: var(--studio-text); }
.chip:hover { border-color: var(--studio-line-strong); background: rgba(255,255,255,.045); color: var(--studio-text); }
.mode-chip .mode-dot { background: var(--studio-accent); box-shadow: 0 0 0 4px rgba(255,255,255,.065); }
.send-btn {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  background: var(--studio-accent);
  color: var(--accent-text);
  box-shadow: 0 10px 28px rgba(0,0,0,.26);
}
.send-btn::before { display: none; }
.send-btn:hover { background: var(--accent-hover); transform: translateY(-1px); }

.inspiration-reel,
body.workspace .inspiration-reel {
  width: min(100%, 1160px);
  max-height: none;
  margin: 18px auto 0;
  opacity: 1;
  overflow: visible;
}
.prompt-suggestions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.prompt-suggestion {
  min-height: 34px;
  padding: 0 16px;
  border: 1px solid var(--studio-line);
  border-radius: 999px;
  background: rgba(255,255,255,.018);
  color: var(--studio-muted);
  font-size: 11px;
}
.prompt-suggestion:hover { border-color: var(--studio-line-strong); background: var(--studio-panel); color: var(--studio-text); }
.reel-head { margin-top: 28px; margin-bottom: 12px; padding: 0 2px; align-items: flex-end; }
.reel-head .eyebrow { margin-bottom: 7px; color: var(--studio-accent); font-size: 8px; }
.reel-head h2 { font-family: var(--sans); font-size: 21px; font-weight: 620; letter-spacing: -.035em; }
.reel-head p { color: var(--studio-quiet); font-size: 10px; }
.reel-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 168px;
  gap: 12px;
}
.inspire-chip.reel-card,
.reel-card:nth-child(1),
.reel-card:nth-child(2),
.reel-card:nth-child(3),
.reel-card:nth-child(4) {
  width: auto;
  height: 168px;
  min-height: 168px;
  grid-row: auto;
  grid-column: auto;
  border: 1px solid var(--studio-line);
  border-radius: 14px;
  box-shadow: none;
}
.reel-card img { filter: saturate(.74) contrast(1.02) brightness(.84); transform: scale(1.001); }
.reel-card:hover img { filter: saturate(.9) contrast(1.02) brightness(.92); transform: scale(1.018); }
.reel-shade { background: linear-gradient(180deg, rgba(4,8,10,.03) 34%, rgba(4,8,10,.82)); }
.reel-index { top: 11px; left: 12px; padding: 5px 7px; border-radius: 6px; background: rgba(5,9,12,.48); color: rgba(238,247,249,.72); font-size: 7px; }
.reel-card strong { right: 14px; bottom: 29px; left: 14px; font-family: var(--sans); font-size: 15px; }
.reel-card small { right: 14px; bottom: 11px; left: 14px; color: rgba(224,235,238,.62); font-size: 8px; }
.reel-play { top: 11px; right: 11px; width: 27px; height: 27px; border-radius: 50%; background: rgba(5,9,12,.5); }
.stage-empty { display: none !important; }

body.workspace .stage { align-items: stretch; justify-content: flex-start; padding-bottom: 150px; }
body.workspace .stage::after { display: none; }
body.workspace .studio-ribbon,
body.workspace .hero,
body.workspace .inspiration-reel { display: none; }
.results,
body.workspace .results { width: min(100%, var(--workspace-max)); margin: 28px auto 0; }
.project-day { display: flex; margin-bottom: 18px; gap: 14px; align-items: center; color: var(--studio-text); }
.project-day span { font-size: 19px; font-weight: 640; letter-spacing: -.035em; }
.project-day i { height: 1px; flex: 1; background: var(--studio-line); }
.project-day em { color: var(--studio-quiet); font-size: 10px; font-style: normal; }
.generation-project {
  margin-bottom: 30px;
  padding: 16px 0 0;
  border: 0;
  border-top: 1px solid var(--studio-line);
  border-radius: 0;
  background: transparent;
}
.project-head {
  display: grid;
  min-height: 58px;
  margin-bottom: 16px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}
.project-preview-stack { position: relative; display: flex; width: 66px; height: 50px; align-items: center; }
.project-source,
.project-sigil { display: grid; position: absolute; width: 46px; height: 46px; overflow: hidden; place-items: center; border: 1px solid rgba(255,255,255,.2); border-radius: 10px; background: var(--studio-panel-3); color: var(--studio-accent); }
.project-source-1 { left: 0; z-index: 2; }
.project-source-2 { left: 20px; z-index: 1; opacity: .72; }
.project-source img,
.project-source video { width: 100%; height: 100%; object-fit: cover; }
.project-copy { min-width: 0; }
.project-copy h2 { overflow: hidden; font-size: 15px; font-weight: 570; text-overflow: ellipsis; white-space: nowrap; }
.project-copy p { margin-top: 5px; color: var(--studio-quiet); font-size: 10px; }
.project-status { display: flex; gap: 8px; align-items: center; color: var(--studio-muted); font-size: 10px; }
.project-status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 10%, transparent); }
.project-status.active { color: var(--studio-accent); }
.project-status.done { color: var(--studio-ok); }
.project-status.failed { color: var(--studio-danger); }
.project-output-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 340px)); gap: 12px; justify-content: start; }
.project-output-grid .card,
.project-output-grid .card.r-square,
.project-output-grid .card.r-tall,
.project-output-grid .card.r-wide {
  width: 100%;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--studio-line);
  border-radius: 13px;
  background: var(--studio-panel-2);
  animation: none;
}
.project-output-grid .card { aspect-ratio: 16 / 9; }
.project-output-grid .card.r-square { aspect-ratio: 1; }
.project-output-grid .card.r-tall { aspect-ratio: 3 / 4; }
.project-output-grid .card.r-wide { aspect-ratio: 16 / 9; }
.project-output-grid .card:hover { border-color: var(--studio-line-strong); transform: none; box-shadow: none; }
.project-output-grid .card-media,
.project-output-grid .card-media-shell,
.project-output-grid .card-video-shell { width: 100%; height: 100%; object-fit: cover; }
.project-output-grid .card-image-state { top: auto; bottom: 12px; left: 12px; }
.project-output-grid .card-overlay { padding: 60px 14px 13px; opacity: 0; transition: opacity .18s ease; }
.project-output-grid .card:hover .card-overlay { opacity: 1; }
.project-output-grid .card-generating { min-height: 0; background: radial-gradient(circle at 50% 35%, rgba(255,255,255,.065), transparent 34%), var(--studio-panel-2); }

body.workspace .dock {
  position: sticky;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 32;
  display: flex;
  padding: 8px var(--workspace-gutter) max(10px, env(safe-area-inset-bottom));
  border-top: 0;
  background: linear-gradient(180deg, transparent, rgba(7,7,7,.94) 30%, #070707 100%);
  backdrop-filter: blur(18px);
}
body.workspace .dock::before,
body.workspace .dock-hint { display: none; }
body.workspace .composer.compact {
  width: min(100%, 980px);
  min-height: 86px;
  margin: 0 auto;
  padding: 10px 12px 9px;
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(0,0,0,.32);
}
body.workspace .composer.compact .composer-label { display: none; }
body.workspace .composer.compact .prompt-input { height: 30px; min-height: 30px; max-height: 30px; margin: 0; font-size: 13px; }
body.workspace .composer.compact .composer-bar { margin-top: 5px; }
body.workspace .composer.compact .attach-tray { display: flex; }
body.workspace .composer.compact .chips .chip { display: inline-flex; }
body.workspace .dock .composer.compact .chips .chip:not(.model-chip):not(.attach-chip):not(.mode-chip) { display: inline-flex; }
body.workspace .composer.compact .chips { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
body.workspace .composer.compact .chips::-webkit-scrollbar { display: none; }
body.workspace .composer.compact .chips > * { flex: 0 0 auto; }
body.workspace .dock .composer.compact .kind-mini { display: flex; }
body.workspace .composer.compact .send-btn { width: 38px; min-width: 38px; height: 38px; }

.theme-options { grid-template-columns: 1fr; }
.theme-options .theme-opt { border-right: 0; }

#viewAssets { overflow-y: auto; background: var(--studio-bg); }
.view-head,
.ai-tools-hero,
.tool-wrap {
  width: calc(100% - (var(--workspace-gutter) * 2));
  max-width: var(--workspace-max);
  margin-right: auto;
  margin-left: auto;
}
.view-head { padding: 54px 0 24px; border-bottom: 1px solid var(--studio-line); }
.view-head .eyebrow { color: var(--studio-accent); }
.view-title { font-family: var(--sans); font-size: clamp(38px, 4vw, 54px); font-weight: 650; letter-spacing: -.06em; }
.view-subtitle { color: var(--studio-muted); font-size: 12px; }
.asset-filters { padding: 4px; border: 1px solid var(--studio-line); border-radius: 11px; background: var(--studio-panel); }
.af-btn { min-width: 66px; border-radius: 8px; color: var(--studio-muted); }
.af-btn.active { background: var(--studio-panel-3); color: var(--studio-text); }
.asset-grid {
  display: grid;
  width: calc(100% - (var(--workspace-gutter) * 2));
  max-width: var(--workspace-max);
  margin: 0 auto;
  padding: 20px 0 72px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
#viewAssets .card,
#viewAssets .card.r-square,
#viewAssets .card.r-tall,
#viewAssets .card.r-wide { min-height: 220px; aspect-ratio: 4 / 3; border-color: var(--studio-line); border-radius: 14px; background: var(--studio-panel); }
#viewAssets .card:nth-child(5n + 2) { aspect-ratio: 16 / 10; }
#viewAssets .card:nth-child(5n + 4) { aspect-ratio: 1 / 1; }
#viewAssets .card-image-state { background: rgba(5,9,12,.62); color: rgba(240,248,249,.78); }

#viewTools { overflow-y: auto; background: var(--studio-bg); }
.tool-wrap { margin-top: 18px; border-color: var(--studio-line); border-radius: 18px; background: var(--studio-panel); }

#viewAiTools { overflow-y: auto; padding-bottom: 72px; background: var(--studio-bg); }
.ai-tools-hero { min-height: 0; padding: 54px 0 27px; grid-template-columns: minmax(0, 1fr) 330px; gap: 50px; border-bottom: 1px solid var(--studio-line); }
.ai-tools-hero::before,
.ai-tools-hero::after { display: none; }
.ai-tools-copy .eyebrow { color: var(--studio-accent); }
.ai-tools-copy h2 { font-family: var(--sans); font-size: clamp(38px, 4.6vw, 58px); font-weight: 650; letter-spacing: -.064em; line-height: .98; }
.ai-tools-copy h2 span { color: var(--studio-muted); }
.ai-tools-copy p { max-width: 590px; margin-top: 18px; color: var(--studio-muted); font-size: 12px; }
.ai-tools-hero-meta { align-self: end; border-color: var(--studio-line); border-radius: 13px; background: var(--studio-panel); }
.ai-tools-hero-meta div { min-height: 76px; border-color: var(--studio-line); }
.ai-tools-hero-meta b { color: var(--studio-text); }
.ai-tools-toolbar,
.ai-library-layout,
.ai-task-section { width: calc(100% - (var(--workspace-gutter) * 2)); max-width: var(--workspace-max); }
.ai-tools-toolbar { padding: 18px 0; }
.ai-search-wrap input,
.ai-tool-filters { border-color: var(--studio-line); background: var(--studio-panel); }
.ai-tool-filters button.active { background: var(--studio-accent); color: var(--accent-text); }
.ai-library-layout { grid-template-columns: minmax(0, 1fr) 380px; gap: 14px; }
.ai-tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-content: start; }
.ai-tool-card {
  min-height: 342px;
  padding: 13px;
  border: 1px solid var(--studio-line);
  border-radius: 15px;
  background: var(--studio-panel);
  box-shadow: none;
  opacity: 1;
  transform: none;
  animation: none;
}
.ai-tool-card:first-child { grid-column: span 2; min-height: 400px; }
.ai-tool-card:first-child .ai-tool-visual { height: 232px; }
.ai-tool-card:first-child .ai-tool-card-copy strong { font-size: 28px; }
.ai-tool-card:hover,
.ai-tool-card.selected { border-color: rgba(255,255,255,.42); transform: none; box-shadow: none; }
.ai-tool-card.selected { box-shadow: inset 3px 0 var(--studio-accent); }
.ai-tool-visual { height: 164px; margin-top: 12px; border-radius: 11px; background: #0d0d0d; }
.ai-tool-cover { filter: grayscale(.62) saturate(.2) contrast(1.05) brightness(.8); }
.ai-tool-card:hover .ai-tool-cover,
.ai-tool-card.selected .ai-tool-cover { filter: grayscale(.42) saturate(.28) contrast(1.05) brightness(.9); transform: none; }
.ai-tool-card-copy strong { font-size: 21px; }
.ai-tool-card-copy > span { color: var(--studio-muted); font-size: 11px; }
.ai-workbench {
  top: 14px;
  min-height: 620px;
  border: 1px solid var(--studio-line);
  border-radius: 16px;
  background: var(--studio-panel);
  box-shadow: none;
}
.ai-workbench-head,
.ai-workbench-form { border-color: var(--studio-line); }
.ai-upload-zone,
.ai-field textarea,
.ai-field select,
.ai-input-unit input,
.ai-workbench-readiness { border-color: var(--studio-line); background: var(--studio-bg); }
.ai-run-btn { background: var(--studio-accent); color: var(--accent-text); }

.model-panel,
.pop-panel,
.advanced-panel,
.reference-link-panel,
.modal,
.lightbox-meta { border-color: var(--studio-line-strong); border-radius: 16px; background: var(--studio-panel); box-shadow: var(--shadow); }
.model-item:hover,
.model-item.selected,
.pop-option:hover,
.pop-option.selected { background: var(--studio-panel-3); }
.toast { border-color: var(--studio-line-strong); border-radius: 10px; background: var(--studio-panel-3); color: var(--studio-text); box-shadow: var(--shadow-soft); }

@media (max-width: 1120px) {
  .studio-ribbon { grid-template-columns: 1fr auto; }
  .studio-ribbon strong { display: none; }
  .reel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 220px; }
  .inspire-chip.reel-card,
  .reel-card:nth-child(1),
  .reel-card:nth-child(2),
  .reel-card:nth-child(3),
  .reel-card:nth-child(4) { height: 220px; min-height: 220px; }
  .project-output-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 340px)); }
  .asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-tools-hero { grid-template-columns: 1fr; gap: 24px; }
  .ai-tools-hero-meta { max-width: 560px; }
  .ai-library-layout { grid-template-columns: 1fr; }
  .ai-workbench { position: relative; top: auto; min-height: 0; }
}

@media (max-width: 760px) {
  #app { display: block; padding-bottom: 66px; }
  .sidebar,
  .sidebar:hover,
  .sidebar.rail,
  .sidebar.rail:hover {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 90;
    width: 100%;
    min-width: 100%;
    height: 66px;
    padding: 7px 10px max(7px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--studio-line);
    border-right: 0;
  }
  .sidebar .brand,
  .sidebar .nav-label,
  .sidebar .side-bottom { display: none; }
  .sidebar .nav { display: grid; width: 100%; margin: 0; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; }
  .sidebar .nav-item,
  .sidebar:hover .nav-item,
  .sidebar.rail .nav-item,
  .sidebar.rail:hover .nav-item { width: 100%; min-width: 0; height: 50px; min-height: 50px; max-height: 50px; padding: 4px 2px; }
  .main { height: calc(100dvh - 66px); }
  .stage { padding: 0 14px 44px; }
  .studio-ribbon { min-height: 34px; padding: 0 11px; }
  .studio-ribbon span { font-size: 9px; }
  .studio-ribbon button { font-size: 9px; }
  .hero,
  body.workspace .hero { padding: 62px 0 18px; gap: 18px; }
  .hero-title { font-size: clamp(38px, 11vw, 50px); }
  .hero-lede { padding: 0 14px; font-size: 11px; }
  .composer,
  body.workspace .composer { min-height: 174px; padding: 18px 14px 13px; border-radius: 16px; }
  .prompt-input { min-height: 78px; font-size: 17px; }
  .composer-bar { align-items: flex-end; }
  .chips { max-width: calc(100% - 58px); overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: 0 0 auto; }
  .prompt-suggestions { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; }
  .prompt-suggestion { flex: 0 0 auto; }
  .reel-head p { display: none; }
  .reel-grid { display: flex; margin-right: -14px; overflow-x: auto; }
  .inspire-chip.reel-card,
  .reel-card:nth-child(1),
  .reel-card:nth-child(2),
  .reel-card:nth-child(3),
  .reel-card:nth-child(4) { width: 78vw; min-width: 78vw; height: 220px; min-height: 220px; }
  .results,
  body.workspace .results { width: 100%; margin-top: 18px; }
  .generation-project { padding: 12px; border-radius: 14px; }
  .project-head { grid-template-columns: auto minmax(0,1fr); }
  .project-status { grid-column: 2; }
  .project-output-grid .card,
  .project-output-grid .card.r-square,
  .project-output-grid .card.r-tall,
  .project-output-grid .card.r-wide { min-height: 0; }
  body.workspace .dock { padding: 9px 10px max(9px, env(safe-area-inset-bottom)); }
  body.workspace .composer.compact { min-height: 96px; padding: 12px; }
  body.workspace .composer.compact .chips { max-width: calc(100% - 52px); }
  .view-head,
  .ai-tools-hero,
  .tool-wrap,
  .ai-tools-toolbar,
  .ai-library-layout,
  .ai-task-section,
  .asset-grid { width: calc(100% - 28px); }
  .view-head { padding-top: 32px; align-items: flex-start; flex-direction: column; }
  .asset-grid { grid-template-columns: 1fr; }
  .ai-tools-copy h2 { font-size: 40px; }
  .ai-tool-grid { grid-template-columns: 1fr; }
  .ai-tool-card:first-child { grid-column: auto; min-height: 360px; }
  .ai-tool-card:first-child .ai-tool-visual { height: 190px; }
}

@media (prefers-reduced-motion: reduce) {
  .view.active,
  .card,
  .ai-tool-card,
  .reel-card img,
  .composer,
  .send-btn { animation: none !important; transition: none !important; }
}
