:root {
  color-scheme: dark;
  --bg: #080908;
  --sidebar: #070807;
  --panel: #111311;
  --panel-2: #171917;
  --line: #292c29;
  --line-soft: #202320;
  --text: #f3f5f3;
  --muted: #939893;
  --muted-2: #676c67;
  --green: #35f36d;
  --green-deep: #159447;
  --green-soft: rgba(53, 243, 109, 0.1);
  --danger: #ff6b6b;
  --radius-lg: 28px;
  --radius-md: 18px;
  --sidebar-width: 292px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }

body { min-width: 320px; overflow: hidden; }

button, textarea { font: inherit; }

button { color: inherit; }

button:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.hidden { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100vh; }
.app-shell.sidebar-collapsed { --sidebar-width: 78px; }

.sidebar {
  height: 100vh;
  background: var(--sidebar);
  border-right: 1px solid #121412;
  padding: 28px 18px 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 30;
}

.brand-row { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 28px; }
.sidebar-controls { display: flex; align-items: center; gap: 4px; }
.sidebar-collapse { display: inline-grid; place-items: center; border: 1px solid #242824; background: #111411; font-size: 24px; }
.sidebar-collapse:hover { border-color: #3c433d; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #d9dcd9;
  text-decoration: none;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: .09em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 9px;
  color: #071108;
  background: linear-gradient(135deg, #74ff98, #20d75a);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0;
}

.sidebar-close, .menu-button { display: none !important; }

.sidebar-collapsed .sidebar { padding-left: 10px; padding-right: 10px; }
.sidebar-collapsed .brand-row { flex-direction: column; gap: 12px; padding-left: 0; padding-right: 0; }
.sidebar-collapsed .brand { justify-content: center; }
.sidebar-collapsed .brand > span:last-child,
.sidebar-collapsed .nav-section h2,
.sidebar-collapsed .nav-item > span:not(.nav-icon),
.sidebar-collapsed .sidebar-footer > div:last-child { display: none; }
.sidebar-collapsed .nav-item { justify-content: center; padding: 0; }
.sidebar-collapsed .nav-icon { flex-basis: 24px; }
.sidebar-collapsed .sidebar-footer { justify-content: center; padding: 15px 0; }

.tool-nav { overflow-y: auto; scrollbar-width: none; padding-right: 3px; }
.tool-nav::-webkit-scrollbar { display: none; }

.nav-section { margin-bottom: 30px; }
.nav-section h2 { margin: 0 10px 12px; color: #5e625e; font-size: 13px; font-weight: 650; letter-spacing: .05em; }

.nav-item {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #8b908b;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 13px;
  cursor: pointer;
  text-align: left;
  font-size: 16px;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}

.nav-item:hover { background: #151715; color: #d8dbd8; }
.nav-item:active { transform: scale(.985); }
.nav-item.active { background: #242724; color: #fff; font-weight: 650; }
.nav-item.active .nav-icon { color: var(--green); }

.nav-icon { width: 24px; flex: 0 0 24px; text-align: center; font-size: 21px; line-height: 1; }
.nav-icon.framed { font-size: 23px; }

.nav-coming-soon-tooltip {
  position: fixed;
  z-index: 110;
  left: 0;
  top: 0;
  max-width: min(240px, calc(100vw - 24px));
  border: 1px solid #3b403b;
  border-radius: 10px;
  background: #1b1e1b;
  box-shadow: 0 10px 30px rgba(0,0,0,.38);
  padding: 9px 12px;
  color: #dce0dc;
  font-size: 12px;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(-4px);
  transition: opacity .16s ease, transform .16s ease;
}
.nav-coming-soon-tooltip.show { opacity: 1; transform: translateY(-50%) translateX(0); }

.sidebar-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  padding: 12px 14px;
  background: #0e100e;
}

.sidebar-footer strong, .sidebar-footer span { display: block; }
.sidebar-footer strong { font-size: 12px; font-weight: 650; }
.sidebar-footer span { color: var(--muted-2); font-size: 11px; margin-top: 2px; }

.gateway-dot { width: 8px; height: 8px; border-radius: 50%; background: #e9b949; box-shadow: 0 0 0 5px rgba(233,185,73,.09); }
.gateway-dot.online { background: var(--green); box-shadow: 0 0 0 5px var(--green-soft); }
.gateway-dot.offline { background: var(--danger); box-shadow: 0 0 0 5px rgba(255,107,107,.09); }

.workspace { min-width: 0; height: 100vh; padding: 0 22px 22px; display: flex; flex-direction: column; }

.topbar {
  height: 80px;
  flex: 0 0 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
}

.title-group, .topbar-actions { display: flex; align-items: center; }
.title-group { gap: 12px; }
.title-icon { font-size: 22px; color: #dfe2df; }
.title-group h1 { font-size: 19px; margin: 0; letter-spacing: -.02em; }
.topbar-actions { gap: 10px; }

.project-badge { color: var(--muted-2); font-size: 12px; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.icon-button, .quiet-button, .secondary-button, .primary-button, .model-pill, .setting-pill, .attachment-button, .submit-button {
  border: 0;
  cursor: pointer;
}

.icon-button { width: 36px; height: 36px; border-radius: 10px; background: transparent; color: var(--muted); font-size: 21px; }
.icon-button:hover { background: var(--panel-2); color: var(--text); }

.quiet-button { border: 1px solid var(--line); background: #111311; border-radius: 11px; padding: 8px 13px; color: #c7cbc7; font-size: 13px; }
.quiet-button:hover { border-color: #3b3f3b; background: #171917; }
.history-button { color: #aeb3ae; }

.creation-stage {
  position: relative;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 50% 0%, rgba(53, 243, 109, .035), transparent 34%),
    linear-gradient(180deg, #101210 0%, #0f110f 100%);
  overflow: hidden;
}

.creation-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .09;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

.creation-stage.landing-mode {
  display: grid;
  grid-template-columns: minmax(330px, .86fr) minmax(520px, 1.34fr);
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas:
    "intro cases"
    "composer cases";
  gap: 16px;
  padding: 18px;
}
.creation-stage.landing-mode.case-panel-collapsed { grid-template-columns: minmax(0, 1fr) 62px; }

.empty-state {
  position: relative;
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
}

.landing-mode .empty-state { display: contents; }

.empty-copy {
  grid-area: intro;
  position: relative;
  z-index: 2;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #282c28;
  border-radius: 22px;
  background: rgba(15, 18, 15, .78);
  padding: 34px 28px;
  text-align: center;
}

.spark-orbit {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid #2c342e;
  border-radius: 19px;
  background: linear-gradient(145deg, #1a221c, #101310);
  color: var(--green);
  font-size: 26px;
  box-shadow: 0 20px 50px rgba(0,0,0,.35), inset 0 0 25px rgba(53,243,109,.04);
  margin-bottom: 22px;
}

.eyebrow { margin: 0 0 9px; color: var(--green); font-size: 10px; font-weight: 750; letter-spacing: .18em; }
.empty-state h2 { margin: 0; font-size: clamp(25px, 3vw, 40px); letter-spacing: -.04em; line-height: 1.2; }
.empty-description { margin: 15px 0 27px; color: var(--muted); font-size: 15px; line-height: 1.7; }

.prompt-suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 830px; }
.prompt-suggestions button {
  border: 1px solid #303430;
  border-radius: 99px;
  padding: 10px 16px;
  background: rgba(24,27,24,.72);
  color: #9ca19c;
  cursor: pointer;
  font-size: 13px;
  transition: border-color .18s ease, color .18s ease, transform .18s ease;
}
.prompt-suggestions button:hover { border-color: #526056; color: #e2e5e2; transform: translateY(-1px); }

.case-showcase-panel {
  grid-area: cases;
  position: relative;
  z-index: 2;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  border: 1px solid #2b302b;
  border-radius: 22px;
  background:
    radial-gradient(circle at 80% 4%, rgba(53, 243, 109, .075), transparent 28%),
    rgba(16, 19, 16, .92);
  padding: 24px;
  scrollbar-width: thin;
  scrollbar-color: #343a34 transparent;
}
.case-showcase-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.case-showcase-heading .eyebrow { margin-bottom: 7px; }
.case-showcase-heading h3 { margin: 0; font-size: clamp(22px, 2.2vw, 32px); letter-spacing: -.045em; }
.case-showcase-actions { display: flex; align-items: center; gap: 8px; }
.case-showcase-actions > span {
  flex: 0 0 auto;
  border: 1px solid #343a34;
  border-radius: 99px;
  background: #171b17;
  padding: 7px 10px;
  color: #8e958e;
  font-size: 9px;
  letter-spacing: .08em;
}
.case-panel-toggle {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  border: 1px solid #343a34;
  border-radius: 10px;
  background: #171b17;
  color: #a7ada7;
  cursor: pointer;
  font-size: 22px;
}
.case-panel-toggle:hover { border-color: #4b554d; color: var(--green); }
.case-panel-collapsed .case-showcase-panel { overflow: hidden; padding: 14px; }
.case-panel-collapsed .case-showcase-heading { justify-content: center; }
.case-panel-collapsed .case-showcase-heading > div:first-child,
.case-panel-collapsed .case-showcase-actions > span,
.case-panel-collapsed .case-showcase-description,
.case-panel-collapsed .creative-case-gallery,
.case-panel-collapsed .case-source-link { display: none; }
.case-panel-collapsed .case-showcase-panel::after {
  content: "创作案例";
  position: absolute;
  top: 66px;
  left: 50%;
  color: #6f776f;
  font-size: 10px;
  letter-spacing: .18em;
  writing-mode: vertical-rl;
  transform: translateX(-50%);
}
.case-panel-collapsed .case-showcase-actions { display: flex; }
.case-panel-collapsed .case-panel-toggle {
  border-color: #3d5944;
  background: var(--green-soft);
  color: var(--green);
}
.case-showcase-description { margin: 12px 0 20px; color: #7f867f; font-size: 12px; line-height: 1.65; }
.creative-case-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 13px;
}
.creative-case-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #303530;
  border-radius: 18px;
  background: #151815;
  padding: 0;
  cursor: pointer;
  text-align: left;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.creative-case-card:hover { transform: translateY(-3px); border-color: #4d6855; background: #191d19; box-shadow: 0 18px 45px rgba(0,0,0,.32); }
.creative-case-media { display: grid; width: 100%; min-height: 148px; overflow: hidden; background: #090a09; }
.creative-case-media.comparison { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; }
.creative-case-frame { position: relative; min-width: 0; min-height: 148px; display: grid; place-items: center; overflow: hidden; }
.creative-case-frame img { width: 100%; height: auto; display: block; object-fit: contain; }
.creative-case-media.comparison .creative-case-frame { min-height: 220px; }
.creative-case-media.comparison .creative-case-frame img { height: 220px; max-height: none; object-fit: contain; }
.creative-case-frame i {
  position: absolute;
  top: 8px;
  left: 8px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 99px;
  background: rgba(8,9,8,.7);
  padding: 4px 7px;
  color: #f0f3f0;
  font-size: 9px;
  font-style: normal;
  backdrop-filter: blur(12px);
}
.creative-case-body { display: block; padding: 13px 14px 15px; }
.creative-case-tag { display: block; margin-bottom: 7px; color: var(--green); font-size: 9px; font-weight: 750; letter-spacing: .08em; }
.creative-case-body strong { display: block; font-size: 14px; letter-spacing: -.015em; }
.creative-case-prompt { display: -webkit-box; min-height: 38px; overflow: hidden; margin-top: 7px; color: #8f958f; font-size: 11px; line-height: 1.55; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.creative-case-action { display: block; margin-top: 11px; color: #d7dcd7; font-size: 10px; }
.case-source-link { display: inline-flex; margin-top: 18px; color: #6f776f; font-size: 10px; text-decoration: none; }
.case-source-link:hover { color: var(--green); }

.composer {
  position: relative;
  z-index: 5;
  flex: 0 0 auto;
  width: auto;
  margin: 0 24px 24px;
  min-height: 150px;
  border: 1px solid #296b3b;
  border-radius: 22px;
  background: rgba(22, 25, 22, .96);
  box-shadow: 0 20px 70px rgba(0,0,0,.48), 0 0 0 1px rgba(53,243,109,.025) inset;
  padding: 20px 20px 15px;
  container-type: inline-size;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.landing-mode .composer { grid-area: composer; width: 100%; min-height: 132px; margin: 0; padding: 16px 17px 13px; }
.landing-mode .composer textarea { min-height: 52px; font-size: 15px; }
.landing-mode .composer.has-reference { min-height: 232px; }
.composer:focus-within { border-color: #35a958; box-shadow: 0 22px 75px rgba(0,0,0,.5), 0 0 0 3px rgba(53,243,109,.045); }
.composer.busy { opacity: .72; }
.composer.has-reference { min-height: 250px; }
.composer.conversation-mode { min-height: 112px; padding-top: 14px; padding-bottom: 12px; background: rgba(18, 21, 18, .94); backdrop-filter: blur(16px); }
.composer.conversation-mode textarea { min-height: 38px; max-height: 88px; font-size: 15px; }
.composer.conversation-mode.has-reference { min-height: 226px; }

.reference-strip {
  display: block;
  border: 1px solid #303730;
  border-radius: 14px;
  background: #111411;
  padding: 9px;
  margin-bottom: 13px;
}
.reference-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: #343a34 transparent;
}
.reference-card {
  position: relative;
  flex: 0 0 66px;
  height: 66px;
  overflow: hidden;
  border: 1px solid #373d37;
  border-radius: 11px;
  background: #080908;
}
.reference-card img { width: 100%; height: 100%; display: block; object-fit: cover; }
.reference-index {
  position: absolute;
  left: 5px;
  bottom: 5px;
  padding: 3px 5px;
  border-radius: 6px;
  background: rgba(8, 9, 8, .76);
  color: #f0f3f0;
  font-size: 9px;
  backdrop-filter: blur(7px);
}
.reference-card-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 7px;
  background: rgba(8, 9, 8, .78);
  color: #d7dbd7;
  cursor: pointer;
  line-height: 18px;
}
.reference-card-remove:hover { background: #343934; color: #fff; }
.reference-strip-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.reference-strip-footer > span { color: #737973; font-size: 10px; }
.reference-add-more {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--green);
  cursor: pointer;
  padding: 4px 7px;
  font-size: 10px;
}
.reference-add-more:hover { background: var(--green-soft); }
.reference-add-more:disabled { opacity: .4; cursor: not-allowed; }

.composer textarea {
  display: block;
  width: 100%;
  max-height: 160px;
  min-height: 65px;
  resize: none;
  overflow-y: auto;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 17px;
  line-height: 1.55;
}
.composer textarea::placeholder { color: #626762; }

.composer-toolbar { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.composer-options, .composer-submit { min-width: 0; display: flex; align-items: center; gap: 8px; }
.composer-options { flex: 1 1 auto; }
.composer-submit { flex: 0 0 auto; }

.attachment-button { width: 36px; height: 36px; border-radius: 10px; color: #999f99; background: transparent; font-size: 20px; }
.attachment-button:hover { background: #242724; color: #fff; }
.attachment-button.active { color: var(--green); background: var(--green-soft); }

.model-pill, .setting-pill {
  height: 38px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #393d39;
  border-radius: 99px;
  background: #191b19;
  padding: 0 14px;
  color: #e5e8e5;
  font-size: 13px;
  white-space: nowrap;
}
.model-pill { max-width: 178px; }
.model-pill #model-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-pill:hover, .setting-pill:hover { background: #202320; border-color: #4a4f4a; }
.model-symbol { color: var(--green); }
.chevron { color: #707570; font-size: 14px; }

.shortcut { color: #5f645f; font-size: 11px; }
.submit-button {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--green);
  color: #071108;
  font-weight: 850;
  font-size: 23px;
  box-shadow: 0 8px 24px rgba(53,243,109,.18);
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.submit-button:hover { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(53,243,109,.28); }
.submit-button:disabled { cursor: not-allowed; opacity: .35; transform: none; box-shadow: none; }

@container (max-width: 590px) {
  .shortcut { display: none; }
  .composer-toolbar { gap: 8px; }
  .composer-options { gap: 5px; }
  .model-pill { max-width: 144px; padding-left: 11px; padding-right: 11px; }
  .setting-pill { padding-left: 10px; padding-right: 10px; }
  .submit-button { width: 42px; height: 42px; border-radius: 12px; }
}

@container (max-width: 430px) {
  .composer-toolbar { align-items: flex-end; }
  .composer-options { flex-wrap: wrap; }
  .model-pill { max-width: 132px; }
}

.popover {
  position: absolute;
  left: 58px;
  bottom: 62px;
  width: 270px;
  border: 1px solid #343834;
  border-radius: 17px;
  background: #171a17;
  padding: 15px;
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
}
.popover p { margin: 0 0 12px; color: #c7cbc7; font-size: 12px; font-weight: 650; }
.ratio-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.ratio-grid button, .count-options button {
  min-height: 62px;
  border: 1px solid #303430;
  border-radius: 12px;
  background: #111311;
  color: #929792;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 11px;
}
.ratio-grid button:hover, .ratio-grid button.selected, .count-options button:hover, .count-options button.selected { border-color: #2ab956; color: var(--text); background: var(--green-soft); }
.ratio-shape { display: block; border: 1.5px solid currentColor; border-radius: 2px; }
.ratio-shape.square { width: 16px; height: 16px; }
.ratio-shape.portrait { width: 13px; height: 17px; }
.ratio-shape.landscape { width: 19px; height: 14px; }
.ratio-shape.wide { width: 21px; height: 12px; }
.ratio-shape.ultra-wide { width: 23px; height: 10px; }
.ratio-shape.tall { width: 10px; height: 20px; }
.ratio-shape.ultra-tall { width: 9px; height: 23px; }
.auto-size-icon { color: currentColor; font-size: 18px; font-style: normal; letter-spacing: -.25em; padding-right: .25em; }

.generation-settings-button { min-width: 142px; justify-content: center; }
.generation-settings-popover { left: 198px; width: min(520px, calc(100vw - 44px)); padding: 18px; }
.settings-ratio-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.settings-ratio-grid button { min-height: 58px; flex-direction: row; gap: 12px; font-size: 13px; }
.settings-ratio-grid .auto-ratio-option { font-weight: 650; }
.count-heading { margin-top: 18px !important; }
.count-options { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.count-options button { min-height: 42px; font-size: 13px; }
.generation-settings-popover small { display: block; margin-top: 10px; color: #777d77; font-size: 10px; }

.run-view { position: relative; min-height: 0; flex: 1 1 auto; overflow-y: auto; padding: 32px 42px; scrollbar-width: thin; scrollbar-color: #353935 transparent; }
.conversation-flow { position: relative; width: min(1080px, 100%); margin: 0 auto; }
.conversation-flow::before {
  content: "";
  position: absolute;
  top: 30px;
  bottom: 40px;
  left: 17px;
  width: 1px;
  background: linear-gradient(180deg, #343a34, #244f30 55%, transparent);
}
.conversation-event { position: relative; padding-left: 58px; }
.conversation-event::before {
  position: absolute;
  z-index: 1;
  top: 3px;
  left: 0;
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border: 1px solid #343a34;
  border-radius: 50%;
  background: #111411;
  color: #929992;
  font-size: 15px;
  box-shadow: 0 0 0 7px #0d0f0d;
}
.user-message {
  width: 100%;
  max-width: none;
  margin: 18px 0 35px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.user-message::before { content: "↑"; }
.message-kind { display: inline-flex; align-items: center; width: fit-content; border-radius: 99px; padding: 4px 7px; font-size: 9px; font-weight: 720; letter-spacing: .04em; }
.user-kind { position: static; margin-bottom: 9px; padding: 0; color: #858c85; background: transparent; border: 0; }
.tool-kind { padding: 0; color: #858c85; background: transparent; }
.final-kind { margin-bottom: 5px; padding: 0; color: var(--green); background: transparent; }
.user-message p { max-width: 780px; margin: 0; color: #edf0ed; font-size: 15px; line-height: 1.72; white-space: pre-wrap; }
.user-reference { position: relative; width: fit-content; max-width: 100%; overflow: hidden; border-radius: 12px; margin-bottom: 11px; background: #080908; }
.user-reference-grid { display: flex; gap: 3px; max-width: 430px; overflow-x: auto; }
.user-reference-grid img { width: 112px; height: 82px; flex: 0 0 112px; display: block; object-fit: cover; }
.user-reference span { position: absolute; left: 8px; bottom: 7px; padding: 4px 7px; border-radius: 99px; background: rgba(8,9,8,.72); color: #e7ebe7; font-size: 9px; backdrop-filter: blur(8px); }

.tool-message {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0 0 38px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding-top: 2px;
}
.tool-message::before { content: "⌁"; }
.tool-message[data-status="running"]::before { border-color: #7b6b39; color: #e2d28c; animation: event-node-pulse 1.6s ease-in-out infinite; }
.tool-message[data-status="completed"]::before { border-color: #286a3b; color: var(--green); }
.tool-message[data-status="failed"]::before { border-color: #763b3b; color: #ff9e9e; }
.tool-message-icon { display: none; }
.tool-message-copy { min-width: 0; }
.tool-message-heading { display: flex; align-items: center; gap: 8px; }
.tool-message-heading strong { overflow: hidden; color: #dce1dc; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.tool-message-copy > span { display: block; margin-top: 5px; color: #707670; font-size: 10px; }
.tool-message-status { flex: 0 0 auto; border-radius: 99px; padding: 5px 8px; background: #242924; color: #aab0aa; font-size: 9px; }
.tool-message-status.started, .tool-message-status.running { color: #e2d28c; background: rgba(233, 185, 73, .09); }
.tool-message-status.completed { color: var(--green); background: var(--green-soft); }
.tool-message-status.failed { color: #ff9e9e; background: rgba(255, 107, 107, .09); }

.result-card { overflow: visible; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.result-card::before { content: "✦"; border-color: #286a3b; color: var(--green); }
.run-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 64px; margin: 0; padding: 0 0 15px; border-bottom: 1px solid #242924; background: transparent; }
.result-title-group { display: flex; align-items: center; gap: 12px; min-width: 0; }
.result-icon { display: none; }
.run-heading .eyebrow { margin-bottom: 4px; }
.run-heading h2 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.result-meta-group { display: flex; align-items: flex-end; flex-direction: column; gap: 5px; }
.result-model { display: inline-flex; align-items: center; min-height: 28px; border: 0; border-radius: 0; padding: 0; color: #dce1dc; background: transparent; font-size: 11px; font-weight: 650; }
.run-meta { color: var(--muted-2); font-size: 12px; }
.result-card-body { padding: 20px 0 0; }

.progress-panel {
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  min-height: 72px;
  display: grid;
  grid-template-columns: 48px minmax(0,1fr);
  align-items: center;
  gap: 15px;
  padding: 8px 0 17px;
  margin-bottom: 18px;
}
.progress-visual { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--green-soft); color: var(--green); }
.progress-spark { animation: pulse-spark 1.5s ease-in-out infinite; }
.progress-copy strong, .progress-copy span { display: block; }
.progress-copy strong { font-size: 14px; }
.progress-copy span { margin-top: 5px; color: var(--muted); font-size: 12px; }
.progress-track { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: #222622; }
.progress-track span { display: block; width: 8%; height: 100%; background: linear-gradient(90deg, var(--green-deep), var(--green)); transition: width .45s ease; }

@keyframes pulse-spark { 0%, 100% { transform: scale(.8) rotate(0); opacity: .55; } 50% { transform: scale(1.15) rotate(12deg); opacity: 1; } }
@keyframes event-node-pulse { 0%, 100% { box-shadow: 0 0 0 7px #0d0f0d, 0 0 0 0 rgba(226,210,140,.18); } 50% { box-shadow: 0 0 0 7px #0d0f0d, 0 0 0 7px rgba(226,210,140,0); } }

.candidate-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.candidate-grid.single { grid-template-columns: minmax(0, 780px); justify-content: center; }
.candidate-card {
  position: relative;
  min-width: 0;
  border: 1px solid #2b2f2b;
  border-radius: 18px;
  overflow: hidden;
  background: #090a09;
  cursor: zoom-in;
  aspect-ratio: var(--asset-ratio, 1 / 1);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.candidate-card:hover { transform: translateY(-2px); border-color: #555b55; }
.candidate-card.selected { border-color: var(--green); box-shadow: 0 0 0 2px rgba(53,243,109,.12); }
.candidate-card img { width: 100%; height: 100%; display: block; object-fit: contain; background: #0a0b0a; }
.candidate-card.transparent-result,
.candidate-card.transparent-result img {
  background-color: #d7dbd7;
  background-image:
    linear-gradient(45deg, #bfc4bf 25%, transparent 25%),
    linear-gradient(-45deg, #bfc4bf 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #bfc4bf 75%),
    linear-gradient(-45deg, transparent 75%, #bfc4bf 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}
.candidate-model { position: absolute; left: 12px; bottom: 12px; padding: 6px 9px; border: 1px solid rgba(255,255,255,.12); border-radius: 99px; background: rgba(8,9,8,.72); color: #edf0ed; font-size: 10px; backdrop-filter: blur(12px); }
.candidate-index { position: absolute; top: 12px; left: 12px; background: rgba(8,9,8,.72); backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,.12); border-radius: 99px; padding: 6px 9px; font-size: 10px; }
.candidate-error { height: 100%; display: grid; place-items: center; padding: 30px; color: #d98f8f; text-align: center; font-size: 12px; }

.prompt-result {
  border: 0;
  border-top: 1px solid #294530;
  border-radius: 0;
  background: transparent;
  padding: 22px 0 0;
  box-shadow: none;
}
.prompt-result-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.prompt-result-heading span, .prompt-result-heading strong { display: block; }
.prompt-result-heading span { margin-bottom: 5px; color: var(--green); font-size: 9px; font-weight: 760; letter-spacing: .16em; }
.prompt-result-heading strong { font-size: 14px; }
.prompt-result p { margin: 0; color: #e8ece8; font-size: 16px; line-height: 1.9; white-space: pre-wrap; }

.image-description {
  margin-top: 18px;
  border: 0;
  border-top: 1px solid #293029;
  border-radius: 0;
  background: transparent;
  padding: 18px 0 0;
}
.image-description > span,
.image-description > strong { display: block; }
.image-description > span { color: var(--green); font-size: 9px; font-weight: 760; letter-spacing: .15em; }
.image-description > strong { margin-top: 5px; font-size: 14px; }
.image-description p { margin: 12px 0 0; color: #cbd1cb; font-size: 13px; line-height: 1.8; white-space: pre-wrap; }

.review-bar {
  margin-top: 18px;
  border: 0;
  border-top: 1px solid #293029;
  border-radius: 0;
  background: transparent;
  padding: 16px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.review-bar strong, .review-bar span { display: block; }
.review-bar strong { font-size: 13px; }
.review-bar span { color: var(--muted); margin-top: 4px; font-size: 11px; }
.review-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.secondary-button, .primary-button { border-radius: 11px; padding: 10px 14px; font-size: 12px; font-weight: 650; }
.secondary-button { border: 1px solid #393d39; background: #101210; color: #cbd0cb; }
.secondary-button:hover { background: #202320; border-color: #505550; }
.primary-button { background: var(--green); color: #071108; }
.primary-button:hover { background: #5afb84; }
.primary-button.compact { padding: 10px 17px; }
.secondary-button:disabled, .primary-button:disabled { opacity: .4; cursor: not-allowed; }

.dialog-backdrop { position: fixed; z-index: 80; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.7); backdrop-filter: blur(8px); }
.dialog-card { width: min(520px, 100%); border: 1px solid #343934; border-radius: 22px; background: #151815; box-shadow: 0 30px 90px rgba(0,0,0,.65); padding: 23px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 23px; }
.dialog-heading h2 { margin: 0; font-size: 22px; }
.dialog-card label { display: block; color: #babfba; font-size: 12px; margin-bottom: 9px; }
.dialog-card textarea { width: 100%; resize: vertical; border: 1px solid #343934; border-radius: 14px; background: #0e100e; color: var(--text); padding: 13px; outline: 0; line-height: 1.55; }
.dialog-card textarea:focus { border-color: #32994f; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 17px; }

.image-lightbox {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(3, 4, 3, .92);
  backdrop-filter: blur(14px);
}
.image-lightbox-content { display: grid; place-items: center; max-width: 100%; max-height: 100%; margin: 0; }
.image-lightbox-content img { display: block; max-width: min(94vw, 1600px); max-height: 86vh; object-fit: contain; border-radius: 8px; box-shadow: 0 30px 100px rgba(0,0,0,.72); }
.image-lightbox-content figcaption { margin-top: 13px; color: #aab0aa; font-size: 12px; }
.image-lightbox-close { position: fixed; z-index: 1; top: 22px; right: 25px; width: 42px; height: 42px; border: 1px solid #444a44; border-radius: 50%; background: rgba(15,18,15,.76); color: #f0f3f0; font-size: 25px; line-height: 1; }
.image-lightbox-close:hover { border-color: #777e77; background: #242824; }
body.lightbox-open { overflow: hidden; }

.history-backdrop {
  position: fixed;
  z-index: 75;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  background: rgba(0, 0, 0, .62);
  backdrop-filter: blur(6px);
}
.history-panel {
  width: min(430px, 94vw);
  height: 100%;
  border-left: 1px solid #303530;
  background: #0d0f0d;
  box-shadow: -28px 0 90px rgba(0, 0, 0, .48);
  padding: 25px 20px 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: history-enter .22s ease-out;
}
.history-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 4px 3px 20px; border-bottom: 1px solid #222622; }
.history-heading .eyebrow { margin-bottom: 7px; }
.history-heading h2 { margin: 0; font-size: 22px; letter-spacing: -.03em; }
.history-heading > div > span { display: block; margin-top: 8px; color: var(--muted-2); font-size: 11px; }
.history-list { min-height: 0; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 9px; padding: 16px 2px 4px; scrollbar-width: thin; scrollbar-color: #343934 transparent; }
.history-item {
  width: 100%;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 12px;
  border: 1px solid #292e29;
  border-radius: 15px;
  background: #131613;
  padding: 9px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.history-item:hover { border-color: #3f4841; background: #181c18; transform: translateX(-2px); }
.history-preview { width: 82px; height: 68px; overflow: hidden; display: grid; place-items: center; border-radius: 11px; background: #090a09; color: var(--green); font-size: 22px; }
.history-preview img { width: 100%; height: 100%; display: block; object-fit: cover; }
.history-preview.failed { color: #ff9696; background: rgba(255, 107, 107, .07); }
.history-preview.pending { background: var(--green-soft); }
.history-item-body { min-width: 0; display: block; }
.history-item-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.history-item-meta strong { font-size: 12px; }
.history-status { flex: 0 0 auto; border-radius: 99px; background: #262b26; padding: 3px 6px; color: #969c96; font-size: 9px; font-style: normal; }
.history-status.completed, .history-status.waiting_review { color: var(--green); background: var(--green-soft); }
.history-status.failed { color: #ff9b9b; background: rgba(255, 107, 107, .09); }
.history-prompt { display: -webkit-box; overflow: hidden; margin-top: 7px; color: #b8bdb8; font-size: 11px; line-height: 1.45; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.history-item time { display: block; margin-top: 6px; color: #626862; font-size: 9px; }
.history-arrow { color: #5e655e; font-size: 23px; }
.history-empty { min-height: 190px; display: grid; place-content: center; gap: 8px; padding: 30px; color: #6f756f; text-align: center; font-size: 12px; }
.history-empty strong, .history-empty span { display: block; }
.history-empty strong { color: #cbd0cb; font-size: 14px; }
@keyframes history-enter { from { transform: translateX(24px); opacity: .7; } to { transform: translateX(0); opacity: 1; } }

.toast { position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translate(-50%, 18px); max-width: min(430px, calc(100vw - 40px)); border: 1px solid #3b403b; border-radius: 12px; background: #1b1e1b; box-shadow: 0 12px 40px rgba(0,0,0,.45); padding: 11px 15px; color: #dce0dc; font-size: 12px; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: #7a3939; color: #ffc2c2; }

@media (max-width: 980px) {
  :root { --sidebar-width: 244px; }
  .workspace { padding-left: 15px; padding-right: 15px; }
  .creation-stage.landing-mode { grid-template-columns: minmax(280px, .82fr) minmax(390px, 1.18fr); padding: 12px; gap: 12px; }
  .creative-case-gallery { grid-template-columns: 1fr; }
  .creative-case-media { min-height: 165px; }
  .run-view { padding-left: 28px; padding-right: 28px; }
  .candidate-grid { grid-template-columns: 1fr; }
  .shortcut { display: none; }
}

@media (max-width: 760px) {
  body { overflow: auto; }
  .app-shell { display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(292px, 86vw); transform: translateX(-102%); transition: transform .24s ease; box-shadow: 24px 0 80px rgba(0,0,0,.5); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-collapse { display: none !important; }
  .sidebar-collapsed .sidebar { padding: 28px 18px 20px; }
  .sidebar-collapsed .brand-row { flex-direction: row; gap: 0; padding: 0 8px 28px; }
  .sidebar-collapsed .brand > span:last-child,
  .sidebar-collapsed .nav-section h2,
  .sidebar-collapsed .nav-item > span:not(.nav-icon),
  .sidebar-collapsed .sidebar-footer > div:last-child { display: block; }
  .sidebar-collapsed .brand { justify-content: flex-start; }
  .sidebar-collapsed .nav-item { justify-content: flex-start; padding: 0 13px; }
  .sidebar-collapsed .sidebar-footer { justify-content: flex-start; padding: 12px 14px; }
  .sidebar-close, .menu-button { display: inline-grid !important; place-items: center; }
  .workspace { height: 100dvh; padding: 0 10px 10px; }
  .topbar { height: 66px; flex-basis: 66px; }
  .title-group { gap: 8px; }
  .title-group h1 { font-size: 17px; }
  .title-icon { display: none; }
  .project-badge { display: none; }
  .topbar-actions { gap: 6px; }
  .topbar-actions .quiet-button { padding: 8px 9px; font-size: 11px; }
  .creation-stage { border-radius: 21px; }
  .creation-stage.landing-mode {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "intro"
      "composer"
      "cases";
    gap: 10px;
    padding: 10px;
    overflow-y: auto;
  }
  .creation-stage.landing-mode.case-panel-collapsed {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "intro"
      "composer"
      "cases";
  }
  .empty-state { justify-content: flex-start; padding: 58px 18px 32px; overflow-y: auto; }
  .landing-mode .empty-state { display: contents; }
  .empty-copy { min-height: 320px; padding: 46px 22px 34px; }
  .empty-state h2 { font-size: 26px; }
  .empty-description { font-size: 13px; }
  .prompt-suggestions { flex-direction: column; align-items: stretch; width: 100%; }
  .prompt-suggestions button { text-align: left; }
  .case-showcase-panel { min-height: 0; overflow: visible; padding: 18px; }
  .case-panel-collapsed .case-showcase-panel { min-height: 58px; padding: 12px; }
  .case-panel-collapsed .case-showcase-panel::after { top: 20px; left: 56px; writing-mode: horizontal-tb; transform: none; }
  .case-panel-collapsed .case-showcase-heading { justify-content: flex-start; }
  .case-showcase-heading h3 { font-size: 22px; }
  .creative-case-gallery { grid-template-columns: repeat(3, minmax(220px, 1fr)); overflow-x: auto; padding-bottom: 4px; }
  .creative-case-card { min-width: 220px; }
  .creative-case-media { min-height: 145px; }
  .composer { width: auto; margin: 0 10px 10px; padding: 15px 13px 12px; min-height: 160px; }
  .landing-mode .composer { width: 100%; margin: 0; }
  .composer.has-reference { min-height: 250px; }
  .composer textarea { font-size: 15px; }
  .model-pill { max-width: 146px; padding: 0 11px; }
  .setting-pill { padding: 0 10px; }
  .composer-options { gap: 5px; }
  .attachment-button { display: none; }
  .popover { left: 8px; bottom: 59px; width: min(270px, calc(100vw - 44px)); }
  .generation-settings-popover { width: min(520px, calc(100vw - 44px)); }
  .settings-ratio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .run-view { padding: 24px 15px; }
  .conversation-event { padding-left: 47px; }
  .conversation-event::before { width: 31px; height: 31px; }
  .conversation-flow::before { left: 15px; }
  .user-message { max-width: 100%; }
  .tool-message { width: 100%; grid-template-columns: minmax(0, 1fr); }
  .tool-message-status { grid-column: 1; justify-self: start; }
  .run-heading { align-items: flex-start; }
  .result-meta-group { align-items: flex-end; }
  .result-card-body { padding: 16px 0 0; }
  .result-model { max-width: 155px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .review-bar { align-items: stretch; flex-direction: column; }
  .review-actions { justify-content: stretch; }
  .review-actions button { flex: 1; }
  .prompt-result-heading { align-items: stretch; flex-direction: column; }
  .prompt-result-heading button { align-self: flex-start; }
  .history-panel { width: 100%; padding: 18px 14px 14px; }
  .composer.conversation-mode { min-height: 118px; }
  .image-lightbox { padding: 14px; }
  .image-lightbox-content img { max-width: 96vw; max-height: 82vh; }
  .image-lightbox-close { top: 14px; right: 14px; }
}

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