:root {
  --shell: #241914;
  --shell-2: #241914;
  --ink: #1F1712;
  --muted: #746B61;
  --paper: #FCF8F1;
  --panel: #FCF8F1;
  --panel-2: #F4EFE7;
  --ground: #E9E2D8;
  --ground-2: #DED6CB;
  --line: rgba(45, 34, 27, .10);
  --line-2: rgba(45, 34, 27, .16);
  --accent: #6B5142;
  --danger: #8F4C41;
  --shadow: 0 18px 46px rgba(31, 23, 18, .08);
  --nav-h: 68px;
  font-family: "MiSans", "HarmonyOS Sans SC", "OPPO Sans", "Plus Jakarta Sans", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; }
body {
  overflow: hidden;
  background: var(--shell);
  color: var(--ink);
  font-size: 13px;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: var(--nav-h) minmax(0, 1fr);
  background: var(--shell);
}

.sidebar {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 36px;
  padding: 0 92px;
  border-bottom: 1px solid rgba(255, 250, 242, .10);
  background: var(--shell);
  color: var(--paper);
  z-index: 4;
}
.brand-block {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 300px;
}
.brand-block > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 250, 242, .20);
  border-radius: 999px;
  background: rgba(255, 250, 242, .07);
  color: var(--paper);
  font-size: 12px;
  font-weight: 800;
}
.brand-block strong {
  display: block;
  color: var(--paper);
  font-size: 16px;
  font-weight: 800;
}
.brand-block small {
  display: none;
  color: rgba(255, 250, 242, .54);
  font-size: 11px;
}
.side-nav {
  margin-left: auto;
  height: 100%;
  display: flex;
  align-items: stretch;
  gap: 28px;
}
.tab {
  position: relative;
  min-width: 72px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 250, 242, .60);
  font-size: 13px;
  font-weight: 700;
}
.tab::before { content: none !important; }
.tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: transparent;
}
.tab.active,
.tab:hover { color: var(--paper); }
.tab.active::after { background: var(--paper); }

.main-stage {
  position: relative;
  min-height: 0;
  height: calc(100vh - var(--nav-h));
  overflow: hidden;
  background: var(--ground);
}
.topbar { display: none; }
.workspace {
  display: none;
  height: 100%;
  min-height: 0;
}
.workspace.active { display: block; }

/* Home */
.home-panel.active { background: var(--shell); }
.home-statement {
  position: relative;
  height: 100%;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(23, 15, 11, .82) 0%, rgba(23, 15, 11, .58) 31%, rgba(23, 15, 11, .18) 58%, rgba(23, 15, 11, .04) 100%),
    url("./assets/hero-home-interior-v2.png") center center / cover no-repeat;
}
.home-statement-inner {
  position: absolute;
  top: 50%;
  left: clamp(56px, 7vw, 132px);
  width: min(760px, 52vw);
  transform: translateY(calc(-50% - 18px));
  color: var(--paper);
}
.home-statement p {
  margin: 0 0 24px;
  color: rgba(255, 250, 242, .72);
  font-family: "DM Mono", monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .18em;
}
.hero-title {
  margin: 0;
  color: var(--paper);
  font-size: clamp(84px, 6.9vw, 132px);
  line-height: 1;
  letter-spacing: 0;
  font-weight: 800;
  text-transform: uppercase;
}
.hero-title span { display: block; }
.home-statement-inner em,
.home-metrics { display: none; }
.home-statement button {
  margin-top: 34px;
  min-height: 44px;
  padding: 0 24px;
  border: 1px solid rgba(255, 250, 242, .78);
  border-radius: 999px;
  background: rgba(255, 250, 242, .92);
  color: var(--ink);
  font-weight: 800;
}

/* Tool shell */
.tool-page {
  height: 100%;
  min-height: 0;
  padding: 18px 20px 20px;
  gap: 14px;
  background:
    linear-gradient(90deg, rgba(33, 24, 19, .10) 0 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(180deg, #d1c9bd 0%, #bcb1a5 100%);
}
.tool-page.active { display: grid; }
.csv-tool { grid-template-columns: minmax(340px, 430px) minmax(560px, 1fr) minmax(340px, 420px); }
.image-tool { grid-template-columns: minmax(300px, 360px) minmax(860px, 1fr); }
.furniture-color-page { grid-template-columns: minmax(300px, 360px) minmax(640px, 1fr) minmax(300px, 360px); }
.settings-tool {
  place-items: start center;
  padding-top: clamp(56px, 8vh, 92px);
}
.tool-sidebar,
.tool-main,
.tool-assistant,
.settings-card {
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(42, 33, 27, .12);
  border-radius: 8px;
  background: rgba(246, 241, 233, .90);
  box-shadow: 0 10px 24px rgba(31, 23, 18, .08);
  overflow: hidden;
}
.tool-sidebar,
.tool-main,
.tool-assistant {
  display: grid;
  grid-template-rows: auto;
  align-content: start;
}
.tool-sidebar {
  padding: 24px 18px 18px;
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(255, 250, 242, .56), rgba(246, 241, 233, .86));
}
.tool-kicker,
.tool-head span {
  color: var(--accent);
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.tool-sidebar h2,
.settings-card h2,
.tool-head h2 {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: 0;
}
.tool-sidebar p,
.settings-card p {
  margin: 10px 0 22px;
  color: var(--muted);
  line-height: 1.55;
}
.tool-head {
  min-height: 68px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 250, 242, .34);
}
.tool-head.compact { min-height: 66px; }
.tool-head h2 { font-size: 20px; white-space: nowrap; }
.tool-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: rgba(250, 246, 239, .84);
}
.tool-assistant {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: rgba(239, 232, 221, .72);
}

label span,
.tool-upload span,
.tool-field span,
.compact-control span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
input, textarea, select {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 242, .72);
  color: var(--ink);
  outline: none;
}
input, select { height: 40px; padding: 0 12px; }
textarea { padding: 12px; line-height: 1.55; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--line-2); }
.tool-upload,
.tool-field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}
.tool-upload {
  padding: 12px;
  border: 1px dashed rgba(42, 33, 27, .22);
  border-radius: 8px;
  background: rgba(255, 250, 242, .58);
}
.tool-upload input[type="file"] {
  width: 100%;
  height: auto;
  padding: 8px;
  border: 1px solid rgba(40, 31, 25, .08);
  border-radius: 8px;
  background: rgba(255, 252, 247, .74);
  color: rgba(28, 21, 17, .62);
}
.tool-upload input[type="file"]::file-selector-button {
  min-height: 30px;
  margin-right: 10px;
  border: 1px solid rgba(40, 31, 25, .10);
  border-radius: 999px;
  background: #241914;
  color: #fffaf2;
  padding: 0 12px;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
}
.tool-field textarea { min-height: 250px; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
button,
.toolbar button,
.attach-button,
.send-button,
.model-pill {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 242, .70);
  color: var(--ink);
  padding: 0 14px;
  font-size: 11px;
  font-weight: 800;
  box-shadow: none;
}
button.primary,
.toolbar button.primary,
.send-button.primary,
.send-button {
  border-color: var(--shell-2);
  background: var(--shell-2);
  color: var(--paper);
}
button:disabled { opacity: .52; cursor: not-allowed; }

.code-editor,
.result {
  width: calc(100% - 36px);
  min-height: 0;
  margin: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 242, .72);
}
.code-editor {
  height: auto;
  font-family: "DM Mono", Consolas, monospace;
  font-size: 12px;
}
.asset-strip {
  margin: 0 18px 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 242, .54);
}
.asset-strip h3 {
  margin: 0 0 8px;
  font-size: 12px;
}
.asset-strip ul { margin: 0; padding-left: 18px; }

.command-card {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  border: 0;
  background: transparent;
}
.chat-messages {
  min-height: 0;
  overflow: auto;
  padding: 14px;
}
.attachment-list { padding: 0 14px; }
#quickPrompt {
  min-height: 120px;
  margin: 0 14px 12px;
  width: calc(100% - 28px);
}
.command-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}
.chat-tools { display: flex; gap: 8px; }
.model-menu {
  position: absolute;
  z-index: 20;
  width: 260px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.model-list { max-height: 180px; overflow: auto; }

.image-board { grid-template-rows: auto minmax(0, 1fr) auto; }
.image-toolbar-head {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  min-height: 76px;
  gap: 14px;
}
.image-actions {
  justify-content: flex-start;
  max-width: none;
}
.compact-control {
  min-height: 34px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 242, .60);
}
.compact-control input {
  height: 28px;
  min-width: 0;
}
.image-upload-status {
  display: block;
  padding: 0 20px 16px;
  color: var(--muted);
  font-size: 12px;
}
.drop-zone {
  position: relative;
  min-height: 0;
  margin: 18px;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  border: 1px dashed var(--line-2);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 250, 242, .78), rgba(255, 250, 242, .42) 42%, rgba(255, 250, 242, .28) 100%);
  overflow: auto;
}
.drop-zone::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  z-index: 4;
  display: block;
  width: var(--image-progress, 0%);
  height: 3px;
  border-radius: 999px;
  background: #6b5142;
  transition: width .22s ease;
}
.drop-zone.dragover { border-color: var(--accent); background: rgba(255, 250, 242, .76); }
.drop-empty {
  align-self: stretch;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--muted);
}
.drop-empty strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 20px;
}
.image-grid {
  width: 100%;
  min-height: 100%;
  padding: 18px;
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: max-content;
  gap: 14px;
  align-content: start;
}
.image-grid:empty { display: none; }
.image-card {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 250, 242, .74);
  overflow: hidden;
}
.image-card.checking {
  border-color: rgba(107, 81, 66, .55);
  box-shadow: 0 0 0 3px rgba(107, 81, 66, .10);
  animation: image-card-breathe 1.7s ease-in-out infinite;
}
.image-card.checking::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, rgba(255, 250, 242, .52) 46%, transparent 72%);
  transform: translateY(-105%);
  animation: image-scan 1.55s ease-in-out infinite;
}
.image-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
.image-card span {
  display: block;
  padding: 9px 10px 10px;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.image-card-status,
.image-scan-overlay {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  border-radius: 999px;
  background: rgba(33, 24, 19, .88);
  color: var(--paper);
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 800;
}
.image-card.checking .image-card-status::before {
  content: "";
  width: 6px;
  height: 6px;
  display: inline-block;
  margin-right: 6px;
  border-radius: 999px;
  background: var(--paper);
  animation: status-dot 1s ease-in-out infinite;
}
.image-scan-overlay { display: none; }
.image-tool .result-panel {
  grid-template-rows: auto auto minmax(0, 1fr);
}
.result-summary,
.issue-list {
  margin: 14px 18px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 250, 242, .58);
}
.issue-list { overflow: auto; }
.small-result { display: none; }

.image-tool .result-summary {
  min-height: 44px;
}

.image-tool .issue-list {
  min-height: 0;
}

.image-tool #imageResult { display: none; }

.furniture-color-page {
  position: relative;
  overflow: hidden;
  background: #0b0a09;
}

body[data-active-tab="furnitureColor"],
body[data-active-tab="furnitureColor"] .main-stage,
body[data-active-tab="furnitureColor"] #furnitureColorPanel {
  background: #0b0a09 !important;
}

.furniture-color-coming-soon {
  display: none;
  place-items: center;
  background:
    radial-gradient(circle at 50% 32%, rgba(70,62,54,.34), transparent 34%),
    linear-gradient(180deg, #12100f 0%, #0b0a09 100%);
}

.furniture-color-coming-soon.active {
  display: grid !important;
}

#genPanel.furniture-color-coming-soon,
body[data-active-tab="gen"] .main-stage,
body[data-active-tab="gen"] #genPanel {
  background: #000 !important;
}

.coming-soon-shell {
  width: min(560px, calc(100vw - 48px));
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
  color: #fffaf2;
}

.coming-soon-shell span {
  color: rgba(255,250,242,.44);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
}

.coming-soon-shell h2 {
  margin: 0;
  font-size: clamp(42px, 6vw, 78px);
  line-height: 1;
  letter-spacing: 0;
}

.coming-soon-shell p {
  max-width: 30em;
  margin: 0;
  color: rgba(255,250,242,.56);
  line-height: 1.7;
}

.coming-soon-shell strong {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255,250,242,.16);
  background: rgba(255,250,242,.10);
  color: #fffaf2;
  padding: 0 22px;
  font-size: 13px;
}

.furniture-page-shell {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 22px 34px 18px;
  color: #1f1f1d;
}

.furniture-page-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 34px;
  margin-bottom: 18px;
  font-size: 13px;
}

.furniture-brand {
  font-size: 15px;
  font-weight: 700;
}

.furniture-page-nav {
  display: flex;
  gap: 34px;
  justify-content: center;
}

.furniture-page-nav button,
.furniture-page-icons button {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  min-height: 0;
  color: #5b5a57;
}

.furniture-page-icons {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
}

.furniture-page-icons svg {
  width: 18px;
  height: 18px;
}

.furniture-page-body {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr) minmax(250px, 320px);
  align-items: center;
  gap: 22px;
}

.furniture-copy-rail {
  display: grid;
  gap: 14px;
  align-content: start;
  padding-left: 6px;
}

.furniture-copy-rail h1 {
  margin: 150px 0 0;
  font-size: clamp(34px, 4vw, 58px);
  line-height: .94;
  font-weight: 800;
  letter-spacing: 0;
}

.furniture-copy-rail p {
  max-width: 28ch;
  margin: 0;
  color: #66635f;
  line-height: 1.6;
}

.furniture-upload-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #1f1f1d;
  font-weight: 700;
}

.furniture-upload-cta input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.furniture-price-row {
  display: flex;
  gap: 12px;
  align-items: baseline;
}

.furniture-price-row strong {
  font-size: 34px;
  font-weight: 700;
}

.furniture-price-row del {
  color: #888;
  font-size: 14px;
}

.furniture-cta-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.furniture-cta-row button,
.furniture-actions-tight button,
.furniture-prompt-drawer button {
  border-radius: 999px;
  border: 1px solid #1f1f1d;
  background: #1f1f1d;
  color: #f8f7f4;
  min-height: 38px;
  padding: 0 16px;
  box-shadow: none;
}

.furniture-cta-row button.secondary,
.furniture-actions-tight button:last-child {
  background: transparent;
  color: #1f1f1d;
}

.furniture-prompt-drawer {
  display: grid;
  gap: 10px;
}

.furniture-prompt-drawer summary {
  cursor: pointer;
  color: #66635f;
}

.furniture-prompt-drawer textarea {
  min-height: 100px;
}

.furniture-visual-rail {
  display: grid;
  align-items: center;
  min-height: 0;
}

.furniture-compare {
  width: 100%;
  border: 0;
  background: transparent;
}

.furniture-compare-stage {
  position: relative;
  width: 100%;
  min-height: 640px;
}

.furniture-compare-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.furniture-compare-overlay {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.furniture-compare-divider {
  position: absolute;
  top: 9%;
  bottom: 9%;
  width: 1px;
  background: rgba(255,255,255,.95);
  box-shadow: 0 0 0 1px rgba(31,31,29,.10);
  pointer-events: none;
}

#furnitureCompareRange {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  width: calc(100% - 44px);
  margin: 0 22px;
  accent-color: #1f1f1d;
}

.furniture-background-rail {
  display: grid;
  align-content: center;
  gap: 12px;
  justify-items: start;
}

.furniture-rail-head {
  display: grid;
  gap: 8px;
}

.furniture-rail-head span {
  font-size: 11px;
  color: #66635f;
  letter-spacing: .08em;
}

.furniture-rail-head h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.05;
}

.background-preset-stack {
  display: grid;
  gap: 10px;
}

.background-button {
  display: grid;
  gap: 4px;
  justify-items: start;
  border-radius: 18px;
  border: 1px solid rgba(31,31,29,.12);
  background: #fff;
  color: #1f1f1d;
  padding: 12px 14px;
}

.background-button small {
  color: #77746f;
}

.furniture-background-meta {
  display: grid;
  gap: 10px;
}

.furniture-background-meta label {
  display: grid;
  gap: 6px;
}

.furniture-color-bar {
  display: grid;
  gap: 10px;
  justify-items: center;
  padding-top: 16px;
}

.furniture-color-labels,
.furniture-color-pills {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.furniture-color-labels span,
.furniture-color-bar small {
  color: #a19b94;
  font-size: 12px;
}

.furniture-color-pills {
  min-height: 0;
}

.swatch-button,
.background-button {
  min-width: 0;
}

.swatch-button {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid rgba(31,31,29,.10);
  background: #fff;
  padding: 6px 10px 6px 6px;
}

.swatch-button span {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.06);
}

.swatch-button strong,
.swatch-button small {
  font-size: 12px;
}

.furniture-color-page .tool-upload,
.furniture-color-page .tool-field,
.furniture-color-page .tool-head,
.furniture-color-page .furniture-result-card {
  display: none;
}

.empty-result {
  min-height: 180px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}
.issue-card {
  margin-bottom: 14px;
  border: 1px solid rgba(42, 33, 27, .13);
  border-radius: 8px;
  background: rgba(255, 250, 242, .68);
  overflow: hidden;
}
.issue-card.failed {
  border-color: rgba(143, 76, 65, .30);
  background: rgba(255, 248, 240, .78);
}
.issue-title,
.issue-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(235, 226, 214, .60);
}
.issue-title strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.issue-title span {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(33, 24, 19, .88);
  color: var(--paper);
  font-size: 10px;
  font-weight: 800;
}
.issue-card-body {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
}
.issue-thumb {
  width: 100%;
  padding: 0;
  display: block;
  border-radius: 8px;
  overflow: hidden;
  text-align: left;
}
.issue-thumb img {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
}
.issue-thumb small {
  display: block;
  padding: 8px 10px;
  color: var(--muted);
}
.issue-detail,
.issue-items {
  min-width: 0;
  display: grid;
  gap: 10px;
  align-content: start;
}
.issue-block span {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.issue-block pre {
  margin: 0;
  white-space: pre-wrap;
  color: var(--ink);
  font: inherit;
  line-height: 1.55;
}
.issue-item {
  padding: 10px 12px;
  border: 1px solid rgba(42, 33, 27, .12);
  border-radius: 8px;
  background: rgba(255, 250, 242, .56);
}
.issue-item div {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.issue-item em {
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(107, 81, 66, .12);
  color: var(--accent);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}
.issue-item p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}
.issue-item small {
  display: block;
  margin-top: 6px;
  color: rgba(28, 21, 17, .52);
}

@keyframes image-scan {
  0% { transform: translateY(-110%); opacity: 0; }
  18% { opacity: 1; }
  100% { transform: translateY(110%); opacity: 0; }
}
@keyframes image-card-breathe {
  0%, 100% { box-shadow: 0 0 0 3px rgba(107, 81, 66, .08); }
  50% { box-shadow: 0 0 0 5px rgba(107, 81, 66, .16); }
}
@keyframes status-dot {
  0%, 100% { opacity: .42; transform: scale(.8); }
  50% { opacity: 1; transform: scale(1); }
}

.settings-card {
  width: min(860px, 100%);
  padding: 28px;
}

@media (max-width: 1200px) {
  .furniture-page-body {
    grid-template-columns: 1fr;
  }
  .furniture-copy-rail h1 {
    margin-top: 24px;
  }
  .furniture-compare-stage {
    min-height: 480px;
  }
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0 18px;
}
.settings-grid label {
  display: grid;
  gap: 8px;
}

.visual-forge-host.active { display: block; background: var(--shell); }
.visual-forge-frame {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: var(--shell);
}

.status {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: 420px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.status[hidden] { display: none; }

.image-viewer {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  z-index: 80;
  background: rgba(20, 14, 10, .72);
}
.image-viewer[aria-hidden="false"] { display: grid; }
.image-viewer button {
  position: absolute;
  top: 18px;
  right: 18px;
}
.image-viewer figure { margin: 0; max-width: 88vw; max-height: 88vh; }
.image-viewer img { max-width: 100%; max-height: 82vh; object-fit: contain; }
.image-viewer figcaption { color: var(--paper); margin-top: 10px; text-align: center; }

/* Tool UI v2: webpage-like workspace, home stays untouched */
body:not([data-active-tab="home"]) .main-stage {
  background: #e9e3da;
}

.tool-page {
  padding: 24px 28px 28px;
  gap: 16px;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 250, 242, .62), transparent 34%),
    linear-gradient(180deg, #eee9e1 0%, #ded6cb 100%);
}

.csv-tool {
  grid-template-columns: minmax(300px, 360px) minmax(680px, 1fr) minmax(320px, 380px);
}

.image-tool {
  grid-template-columns: minmax(270px, 330px) minmax(940px, 1fr);
}

.tool-sidebar,
.tool-main,
.tool-assistant,
.settings-card {
  border: 1px solid rgba(40, 31, 25, .10);
  border-radius: 8px;
  background: rgba(252, 248, 241, .78);
  box-shadow: 0 18px 42px rgba(31, 23, 18, .075);
  backdrop-filter: blur(10px);
}

.tool-sidebar {
  padding: 28px 20px 20px;
  background: rgba(252, 248, 241, .68);
}

.tool-main {
  background: rgba(255, 252, 247, .62);
}

.tool-assistant,
.image-tool .result-panel {
  background: rgba(250, 246, 239, .86);
}

.tool-head {
  min-height: 78px;
  align-items: center;
  padding: 20px 22px 16px;
  border-bottom: 1px solid rgba(40, 31, 25, .09);
  background: rgba(255, 252, 247, .54);
}

.tool-head.compact {
  min-height: 76px;
}

.tool-head span,
.tool-kicker {
  color: rgba(107, 81, 66, .78);
  letter-spacing: .16em;
}

.tool-sidebar h2,
.settings-card h2,
.tool-head h2 {
  color: #17100c;
}

.tool-sidebar p,
.settings-card p {
  color: rgba(28, 21, 17, .58);
}

input,
textarea,
select,
.tool-upload,
.asset-strip,
.result-summary,
.issue-list {
  border-color: rgba(40, 31, 25, .10);
  background: rgba(255, 252, 247, .72);
}

button,
.toolbar button,
.attach-button,
.send-button,
.model-pill {
  border-color: rgba(40, 31, 25, .10);
  background: rgba(255, 252, 247, .76);
}

button.primary,
.toolbar button.primary,
.send-button.primary,
.send-button {
  border-color: #241914;
  background: #241914;
  color: #fffaf2;
}

.code-editor,
.result {
  margin: 16px;
  width: calc(100% - 32px);
  border-color: rgba(40, 31, 25, .10);
  background: rgba(255, 252, 247, .76);
}

.asset-strip {
  margin: 0 16px 16px;
}

.image-toolbar-head {
  align-items: flex-start;
}

.image-actions {
  max-width: 660px;
}

.drop-zone {
  margin: 16px;
  border: 1px solid rgba(40, 31, 25, .12);
  background: rgba(255, 252, 247, .50);
}

.image-grid {
  padding: 16px;
  gap: 12px;
}

.image-card {
  border-color: rgba(40, 31, 25, .10);
  background: rgba(255, 252, 247, .82);
  box-shadow: 0 8px 20px rgba(31, 23, 18, .06);
}

.image-card img {
  aspect-ratio: 1 / .76;
}

.image-upload-status {
  padding: 0 18px 18px;
}

.image-tool .result-panel {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.image-tool .result-summary {
  margin: 16px 18px 0;
  min-height: 46px;
}

.image-tool .issue-list {
  margin: 14px 18px 18px;
  padding: 16px;
  border-radius: 8px;
  background: rgba(255, 252, 247, .64);
}

.issue-card {
  border-color: rgba(40, 31, 25, .10);
  background: rgba(255, 252, 247, .76);
  box-shadow: 0 8px 20px rgba(31, 23, 18, .045);
}

.issue-title,
.issue-actions {
  background: rgba(235, 226, 214, .48);
}

.command-footer {
  border-top-color: rgba(40, 31, 25, .09);
}

.settings-tool {
  background:
    radial-gradient(circle at 50% -10%, rgba(255, 250, 242, .70), transparent 36%),
    linear-gradient(180deg, #eee9e1, #ded6cb);
}

.settings-card {
  width: min(980px, 100%);
  padding: 34px;
}

/* Tool UI v3: less admin panel, more product workspace */
body:not([data-active-tab="home"]) .main-stage {
  background: #e7e0d7;
}

.tool-page {
  padding: 22px 28px 28px;
  gap: 18px;
  background:
    radial-gradient(circle at 16% 0%, rgba(255, 250, 242, .72), transparent 30%),
    linear-gradient(180deg, #eee9e1 0%, #ded6cb 100%);
}

.tool-sidebar,
.tool-main,
.tool-assistant,
.settings-card {
  border-color: rgba(40, 31, 25, .08);
  background: rgba(255, 252, 247, .70);
  box-shadow: 0 18px 46px rgba(31, 23, 18, .06);
}

.tool-head {
  background: transparent;
  border-bottom-color: rgba(40, 31, 25, .075);
}

.tool-sidebar {
  background: rgba(255, 252, 247, .58);
}

.tool-main {
  background: rgba(255, 252, 247, .58);
}

.tool-assistant {
  background: rgba(255, 252, 247, .68);
}

.tool-upload,
.tool-field textarea,
.code-editor,
.result,
.asset-strip,
.drop-zone,
.result-summary,
.issue-list,
.settings-grid input,
.settings-grid select {
  border-color: rgba(40, 31, 25, .085);
  background: rgba(255, 252, 247, .64);
}

.tool-upload {
  border-style: solid;
}

.toolbar button,
button,
.attach-button,
.send-button,
.model-pill {
  min-height: 36px;
}

.toolbar button:not(.primary),
button:not(.primary),
.attach-button,
.model-pill {
  background: rgba(255, 252, 247, .74);
}

button.primary,
.toolbar button.primary,
.send-button.primary,
.send-button {
  background: #241914;
  border-color: #241914;
}

#clearImages,
#clearChat,
#clearBtn,
.btn.danger {
  color: #8f4c41;
}

.image-toolbar-head {
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
}

.image-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.image-title-row #checkImage {
  flex: 0 0 auto;
  min-width: 76px;
}

.image-check-primary {
  min-height: 34px;
  padding: 0 18px;
}

.image-actions {
  gap: 7px;
}

.image-toolstrip {
  padding-top: 4px;
}

.image-toolstrip button,
.image-toolstrip .compact-control {
  min-height: 32px;
  border-radius: 999px;
  font-size: 11px;
}

.image-toolstrip #clearImages {
  border-color: rgba(143, 76, 65, .18);
  background: transparent;
  color: #8f4c41;
}

.image-toolstrip #testImageApi {
  min-width: 54px;
}

.image-concurrency-control {
  grid-template-columns: auto 42px;
  padding: 0 8px 0 11px;
  gap: 6px;
  background: rgba(255, 252, 247, .52);
}

.image-concurrency-control span {
  font-size: 10px;
  letter-spacing: .04em;
}

.image-concurrency-control input {
  width: 42px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: center;
  font-weight: 800;
}

.compact-control {
  background: rgba(255, 252, 247, .56);
}

.drop-empty strong {
  font-size: 18px;
}

.image-card,
.issue-card {
  border-radius: 8px;
}

.settings-tool {
  place-items: start center;
  padding-top: clamp(46px, 7vh, 76px);
}

.sidebar .tab,
.sidebar .tab:not(.primary) {
  min-height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 250, 242, .60);
  box-shadow: none;
}

.sidebar .tab.active,
.sidebar .tab:hover {
  color: var(--paper);
}

.sidebar .tab.active::after {
  background: var(--paper);
}

@media (max-width: 1280px) {
  body { overflow: auto; }
  .app-shell { min-height: 100vh; }
  .sidebar { padding: 0 24px; gap: 18px; }
  .brand-block { min-width: 220px; }
  .side-nav { gap: 12px; }
  .tool-page.active,
  .csv-tool,
  .image-tool {
    height: auto;
    min-height: calc(100vh - var(--nav-h));
    grid-template-columns: 1fr;
    overflow: auto;
  }
  .tool-sidebar,
  .tool-main,
  .tool-assistant { min-height: 420px; }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .sidebar {
    height: auto;
    min-height: var(--nav-h);
    flex-wrap: wrap;
    padding: 14px 18px;
  }
  .main-stage { height: calc(100vh - 96px); }
  .side-nav { width: 100%; overflow-x: auto; }
  .tab { min-width: max-content; height: 40px; }
  .home-statement-inner {
    left: 24px;
    width: calc(100% - 48px);
    transform: translateY(-50%);
  }
  .hero-title { font-size: clamp(54px, 17vw, 92px); }
}

/* Unified furniture workspace palette */
body:not([data-active-tab="home"]) {
  --tool-bg: #E9E2D8;
  --tool-bg-soft: #F4EFE7;
  --tool-panel: #FCF8F1;
  --tool-panel-soft: #F7F2EA;
  --tool-ink: #1F1712;
  --tool-muted: #746B61;
  --tool-line: rgba(45, 34, 27, .10);
  --tool-line-strong: rgba(45, 34, 27, .16);
  --tool-accent: #6B5142;
  --tool-danger: #8F4C41;
  --tool-shadow: 0 18px 46px rgba(31, 23, 18, .07);
}

body:not([data-active-tab="home"]) .main-stage,
body:not([data-active-tab="home"]) .workspace.active {
  background: var(--tool-bg);
}

body:not([data-active-tab="home"]) .tool-page,
body:not([data-active-tab="home"]) .settings-tool {
  background:
    radial-gradient(circle at 18% 0%, rgba(252, 248, 241, .60), transparent 34%),
    linear-gradient(180deg, var(--tool-bg) 0%, #DED6CB 100%);
  color: var(--tool-ink);
}

body:not([data-active-tab="home"]) .tool-sidebar,
body:not([data-active-tab="home"]) .tool-main,
body:not([data-active-tab="home"]) .tool-assistant,
body:not([data-active-tab="home"]) .settings-card,
body:not([data-active-tab="home"]) .command-card,
body:not([data-active-tab="home"]) .result-panel {
  border-color: var(--tool-line);
  background: rgba(252, 248, 241, .78);
  box-shadow: var(--tool-shadow);
  color: var(--tool-ink);
}

body:not([data-active-tab="home"]) .tool-head,
body:not([data-active-tab="home"]) .issue-title,
body:not([data-active-tab="home"]) .issue-actions,
body:not([data-active-tab="home"]) .command-footer {
  border-color: var(--tool-line);
  background: rgba(244, 239, 231, .72);
}

body:not([data-active-tab="home"]) .tool-kicker,
body:not([data-active-tab="home"]) .tool-head span,
body:not([data-active-tab="home"]) .settings-grid span,
body:not([data-active-tab="home"]) .image-upload-status,
body:not([data-active-tab="home"]) .drop-empty span,
body:not([data-active-tab="home"]) .image-card small,
body:not([data-active-tab="home"]) .issue-meta,
body:not([data-active-tab="home"]) .chat-messages,
body:not([data-active-tab="home"]) .result-summary {
  color: var(--tool-muted);
}

body:not([data-active-tab="home"]) .tool-upload,
body:not([data-active-tab="home"]) .tool-field textarea,
body:not([data-active-tab="home"]) .code-editor,
body:not([data-active-tab="home"]) .result,
body:not([data-active-tab="home"]) .asset-strip,
body:not([data-active-tab="home"]) .drop-zone,
body:not([data-active-tab="home"]) .result-summary,
body:not([data-active-tab="home"]) .issue-list,
body:not([data-active-tab="home"]) .settings-grid input,
body:not([data-active-tab="home"]) .settings-grid select,
body:not([data-active-tab="home"]) .compact-control,
body:not([data-active-tab="home"]) .model-menu,
body:not([data-active-tab="home"]) .manual-model input,
body:not([data-active-tab="home"]) #quickPrompt {
  border-color: var(--tool-line);
  background: rgba(252, 248, 241, .72);
  color: var(--tool-ink);
}

body:not([data-active-tab="home"]) .drop-zone {
  background:
    radial-gradient(circle at 50% 42%, rgba(252, 248, 241, .80), rgba(247, 242, 234, .64) 46%, rgba(244, 239, 231, .52) 100%);
}

body:not([data-active-tab="home"]) .image-card,
body:not([data-active-tab="home"]) .issue-card,
body:not([data-active-tab="home"]) .asset-strip li,
body:not([data-active-tab="home"]) .attachment-item {
  border-color: var(--tool-line);
  background: rgba(252, 248, 241, .76);
  box-shadow: 0 8px 20px rgba(31, 23, 18, .045);
}

body:not([data-active-tab="home"]) button,
body:not([data-active-tab="home"]) .toolbar button:not(.primary),
body:not([data-active-tab="home"]) .attach-button,
body:not([data-active-tab="home"]) .model-pill {
  border-color: var(--tool-line);
  background: rgba(252, 248, 241, .78);
  color: var(--tool-ink);
}

body:not([data-active-tab="home"]) button.primary,
body:not([data-active-tab="home"]) .toolbar button.primary,
body:not([data-active-tab="home"]) .send-button,
body:not([data-active-tab="home"]) .send-button.primary {
  border-color: #241914;
  background: #241914;
  color: #FCF8F1;
}

body:not([data-active-tab="home"]) #clearImages,
body:not([data-active-tab="home"]) #clearChat,
body:not([data-active-tab="home"]) #clearBtn,
body:not([data-active-tab="home"]) .btn.danger {
  border-color: rgba(143, 76, 65, .18);
  color: var(--tool-danger);
}

body:not([data-active-tab="home"]) .visual-forge-host.active,
body:not([data-active-tab="home"]) .visual-forge-frame {
  background: var(--tool-bg);
}

/* Final typography normalization for tool controls */
body:not([data-active-tab="home"]) .tool-kicker,
body:not([data-active-tab="home"]) .tool-head span,
body:not([data-active-tab="home"]) .settings-grid span,
body:not([data-active-tab="home"]) .compact-control span,
body:not([data-active-tab="home"]) .image-upload-status {
  font-family: "Plus Jakarta Sans", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--tool-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

body:not([data-active-tab="home"]) h2,
body:not([data-active-tab="home"]) .tool-head h2 {
  color: var(--tool-ink);
  font-family: "Plus Jakarta Sans", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-weight: 800;
  letter-spacing: 0;
}

body:not([data-active-tab="home"]) button,
body:not([data-active-tab="home"]) .toolbar button,
body:not([data-active-tab="home"]) .attach-button,
body:not([data-active-tab="home"]) .send-button,
body:not([data-active-tab="home"]) .model-pill,
body:not([data-active-tab="home"]) .compact-control {
  font-family: "Plus Jakarta Sans", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

body:not([data-active-tab="home"]) .image-toolstrip button,
body:not([data-active-tab="home"]) .image-toolstrip .compact-control {
  height: 36px;
  min-height: 36px;
  padding-inline: 15px;
  color: var(--tool-ink);
}

body:not([data-active-tab="home"]) .image-toolstrip #clearImages,
body:not([data-active-tab="home"]) #clearChat,
body:not([data-active-tab="home"]) #clearBtn,
body:not([data-active-tab="home"]) .btn.danger {
  background: rgba(252, 248, 241, .64);
  color: var(--tool-danger);
}

body:not([data-active-tab="home"]) .image-concurrency-control {
  gap: 8px;
}

body:not([data-active-tab="home"]) .image-concurrency-control span {
  color: var(--tool-muted);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}

body:not([data-active-tab="home"]) .image-concurrency-control input {
  color: var(--tool-ink);
  font-size: 12px;
  font-weight: 800;
}

/* Premium tool workspace refresh */
body:not([data-active-tab="home"]) {
  --premium-bg: #E8E1D7;
  --premium-bg-2: #DDD4C8;
  --premium-paper: #FCF8F1;
  --premium-paper-soft: #F6F0E7;
  --premium-ink: #1F1712;
  --premium-muted: #756B61;
  --premium-line: rgba(45, 34, 27, .105);
  --premium-line-soft: rgba(45, 34, 27, .07);
  --premium-walnut: #241914;
  --premium-clay: #8F4C41;
  --premium-shadow: 0 22px 52px rgba(31, 23, 18, .055);
}

body:not([data-active-tab="home"]) .main-stage,
body:not([data-active-tab="home"]) .workspace.active {
  background: var(--premium-bg);
}

body:not([data-active-tab="home"]) .tool-page,
body:not([data-active-tab="home"]) .settings-tool {
  padding: 28px;
  gap: 20px;
  background:
    linear-gradient(90deg, rgba(45, 34, 27, .035) 0 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(180deg, var(--premium-bg) 0%, var(--premium-bg-2) 100%);
  color: var(--premium-ink);
}

body:not([data-active-tab="home"]) .csv-tool {
  grid-template-columns: minmax(320px, 380px) minmax(700px, 1fr) minmax(320px, 390px);
}

body:not([data-active-tab="home"]) .image-tool {
  grid-template-columns: minmax(300px, 340px) minmax(900px, 1fr);
}

body:not([data-active-tab="home"]) .tool-sidebar,
body:not([data-active-tab="home"]) .tool-main,
body:not([data-active-tab="home"]) .tool-assistant,
body:not([data-active-tab="home"]) .settings-card {
  border-radius: 8px;
  border: 1px solid var(--premium-line-soft);
  background: rgba(252, 248, 241, .74);
  box-shadow: var(--premium-shadow);
  backdrop-filter: blur(12px);
}

body:not([data-active-tab="home"]) .tool-sidebar {
  padding: 30px 20px 20px;
  border-color: transparent;
  background: rgba(252, 248, 241, .36);
  box-shadow: none;
}

body:not([data-active-tab="home"]) .image-board {
  border-color: transparent;
  background: rgba(252, 248, 241, .34);
  box-shadow: none;
}

body:not([data-active-tab="home"]) .tool-assistant,
body:not([data-active-tab="home"]) .image-tool .result-panel,
body:not([data-active-tab="home"]) .tool-main:not(.image-board) {
  background: rgba(252, 248, 241, .82);
}

body:not([data-active-tab="home"]) .tool-head,
body:not([data-active-tab="home"]) .tool-head.compact {
  min-height: 86px;
  padding: 24px 24px 18px;
  border-bottom: 1px solid var(--premium-line-soft);
  background: transparent;
}

body:not([data-active-tab="home"]) .tool-kicker,
body:not([data-active-tab="home"]) .tool-head span {
  color: var(--premium-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .15em;
}

body:not([data-active-tab="home"]) .tool-sidebar h2,
body:not([data-active-tab="home"]) .settings-card h2,
body:not([data-active-tab="home"]) .tool-head h2 {
  margin-top: 7px;
  color: var(--premium-ink);
  font-size: 25px;
  line-height: 1.05;
}

body:not([data-active-tab="home"]) .tool-sidebar p,
body:not([data-active-tab="home"]) .settings-card p {
  max-width: 30em;
  color: var(--premium-muted);
  font-size: 13px;
  line-height: 1.65;
}

body:not([data-active-tab="home"]) .tool-upload,
body:not([data-active-tab="home"]) .tool-field textarea,
body:not([data-active-tab="home"]) .code-editor,
body:not([data-active-tab="home"]) .result,
body:not([data-active-tab="home"]) .asset-strip,
body:not([data-active-tab="home"]) .drop-zone,
body:not([data-active-tab="home"]) .result-summary,
body:not([data-active-tab="home"]) .issue-list,
body:not([data-active-tab="home"]) .settings-grid input,
body:not([data-active-tab="home"]) .settings-grid select,
body:not([data-active-tab="home"]) .compact-control,
body:not([data-active-tab="home"]) #quickPrompt {
  border: 1px solid var(--premium-line);
  background: rgba(252, 248, 241, .62);
  color: var(--premium-ink);
}

body:not([data-active-tab="home"]) .tool-upload,
body:not([data-active-tab="home"]) .asset-strip,
body:not([data-active-tab="home"]) .result-summary,
body:not([data-active-tab="home"]) .issue-list {
  border-radius: 8px;
}

body:not([data-active-tab="home"]) .tool-upload {
  padding: 14px;
  background: rgba(252, 248, 241, .45);
}

body:not([data-active-tab="home"]) .drop-zone {
  border-style: solid;
  background:
    radial-gradient(circle at 50% 42%, rgba(252, 248, 241, .72), rgba(246, 240, 231, .58) 44%, rgba(232, 225, 215, .42) 100%);
}

body:not([data-active-tab="home"]) button,
body:not([data-active-tab="home"]) .toolbar button,
body:not([data-active-tab="home"]) .attach-button,
body:not([data-active-tab="home"]) .send-button,
body:not([data-active-tab="home"]) .model-pill {
  min-height: 36px;
  border: 1px solid var(--premium-line);
  background: rgba(252, 248, 241, .62);
  color: var(--premium-ink);
  font-size: 12px;
}

body:not([data-active-tab="home"]) button.primary,
body:not([data-active-tab="home"]) .toolbar button.primary,
body:not([data-active-tab="home"]) .send-button,
body:not([data-active-tab="home"]) .send-button.primary {
  border-color: var(--premium-walnut);
  background: var(--premium-walnut);
  color: var(--premium-paper);
}

body:not([data-active-tab="home"]) #clearImages,
body:not([data-active-tab="home"]) #clearChat,
body:not([data-active-tab="home"]) #clearBtn,
body:not([data-active-tab="home"]) .btn.danger {
  border-color: rgba(143, 76, 65, .16);
  background: rgba(252, 248, 241, .44);
  color: var(--premium-clay);
}

body:not([data-active-tab="home"]) .image-title-row {
  align-items: flex-start;
}

body:not([data-active-tab="home"]) .image-toolbar-head {
  gap: 18px;
}

body:not([data-active-tab="home"]) .image-toolstrip {
  gap: 8px;
  padding-top: 0;
}

body:not([data-active-tab="home"]) .image-toolstrip button,
body:not([data-active-tab="home"]) .image-toolstrip .compact-control {
  min-height: 38px;
  height: 38px;
  padding-inline: 16px;
}

body:not([data-active-tab="home"]) .image-concurrency-control {
  grid-template-columns: auto 34px;
}

body:not([data-active-tab="home"]) .image-concurrency-control input {
  width: 34px;
}

body:not([data-active-tab="home"]) .image-tool .result-panel {
  grid-template-rows: auto auto minmax(0, 1fr);
}

body:not([data-active-tab="home"]) .image-tool .result-summary {
  margin: 18px 20px 0;
  min-height: 46px;
}

body:not([data-active-tab="home"]) .image-tool .issue-list {
  margin: 14px 20px 20px;
  padding: 18px;
}

body:not([data-active-tab="home"]) .issue-card,
body:not([data-active-tab="home"]) .image-card {
  border-color: var(--premium-line-soft);
  background: rgba(252, 248, 241, .72);
  box-shadow: 0 10px 26px rgba(31, 23, 18, .045);
}

body:not([data-active-tab="home"]) .issue-title,
body:not([data-active-tab="home"]) .issue-actions,
body:not([data-active-tab="home"]) .command-footer {
  background: rgba(246, 240, 231, .70);
  border-color: var(--premium-line-soft);
}

body:not([data-active-tab="home"]) .code-editor,
body:not([data-active-tab="home"]) .result {
  margin: 18px;
  width: calc(100% - 36px);
  background: rgba(252, 248, 241, .54);
}

body:not([data-active-tab="home"]) .asset-strip {
  margin: 0 18px 18px;
  background: rgba(246, 240, 231, .58);
}

body:not([data-active-tab="home"]) .command-card {
  background: transparent;
  box-shadow: none;
}

body:not([data-active-tab="home"]) .settings-tool {
  place-items: start center;
  padding-top: clamp(68px, 10vh, 110px);
}

body:not([data-active-tab="home"]) .settings-card {
  width: min(1040px, calc(100% - 56px));
  padding: 38px;
  background: rgba(252, 248, 241, .78);
}

body:not([data-active-tab="home"]) .settings-grid {
  gap: 16px;
  margin-top: 26px;
}

body:not([data-active-tab="home"]) .visual-forge-host.active,
body:not([data-active-tab="home"]) .visual-forge-frame {
  background: var(--premium-bg);
}

/* Structural redesign: make tools feel like web workspaces, not admin cards */
body:not([data-active-tab="home"]) .image-studio {
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 18px 22px;
}

body:not([data-active-tab="home"]) .image-studio .image-command {
  display: contents;
}

body:not([data-active-tab="home"]) .image-studio .image-toolbar-head {
  grid-column: 1 / -1;
  min-height: 104px;
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  align-items: end;
  gap: 28px;
  padding: 22px 24px;
  border: 1px solid var(--premium-line-soft);
  border-radius: 8px;
  background: rgba(252, 248, 241, .76);
  box-shadow: var(--premium-shadow);
}

body:not([data-active-tab="home"]) .image-studio .image-title-row {
  align-items: flex-end;
  justify-content: space-between;
}

body:not([data-active-tab="home"]) .image-studio .image-toolstrip {
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

body:not([data-active-tab="home"]) .image-studio .drop-zone {
  grid-column: 1;
  grid-row: 2;
  min-height: 0;
  margin: 0;
  border-color: transparent;
  background:
    radial-gradient(circle at 50% 42%, rgba(252, 248, 241, .78), rgba(246, 240, 231, .64) 44%, rgba(232, 225, 215, .48) 100%);
  box-shadow: var(--premium-shadow);
}

body:not([data-active-tab="home"]) .image-studio .image-upload-status {
  grid-column: 1;
  grid-row: 3;
  padding: 0 4px;
}

body:not([data-active-tab="home"]) .image-studio .image-report {
  grid-column: 2;
  grid-row: 2 / 4;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
  border-color: var(--premium-line-soft);
  background: rgba(252, 248, 241, .84);
}

body:not([data-active-tab="home"]) .image-studio .image-report .tool-head {
  min-height: 86px;
}

body:not([data-active-tab="home"]) .image-studio .result-summary {
  margin: 18px 20px 0;
}

body:not([data-active-tab="home"]) .image-studio .issue-list {
  margin: 14px 20px 20px;
}

body:not([data-active-tab="home"]) .image-grid {
  grid-template-columns: 1fr;
  padding: 14px;
}

body:not([data-active-tab="home"]) .image-card img {
  aspect-ratio: 4 / 3;
}

body:not([data-active-tab="home"]) .csv-studio {
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) minmax(190px, 230px);
  gap: 20px;
}

body:not([data-active-tab="home"]) .csv-studio .tool-sidebar {
  grid-column: 1;
  grid-row: 1 / 3;
}

body:not([data-active-tab="home"]) .csv-studio .tool-main {
  grid-column: 2;
  grid-row: 1;
  min-height: 0;
}

body:not([data-active-tab="home"]) .csv-studio .tool-assistant {
  grid-column: 2;
  grid-row: 2;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

body:not([data-active-tab="home"]) .csv-studio .tool-assistant .tool-head {
  min-height: 0;
  border-bottom: 0;
  border-right: 1px solid var(--premium-line-soft);
  padding: 24px;
}

body:not([data-active-tab="home"]) .csv-studio .command-card {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
}

body:not([data-active-tab="home"]) .csv-studio .chat-messages,
body:not([data-active-tab="home"]) .csv-studio .attachment-list {
  display: none;
}

body:not([data-active-tab="home"]) .csv-studio #quickPrompt {
  min-height: 0;
  height: auto;
  margin: 18px 18px 12px;
  width: calc(100% - 36px);
}

body:not([data-active-tab="home"]) .csv-studio .command-footer {
  padding: 0 18px 18px;
  border-top: 0;
  background: transparent;
}

body:not([data-active-tab="home"]) .settings-studio {
  display: grid;
  place-items: center;
  padding: 48px;
}

body:not([data-active-tab="home"]) .settings-studio .settings-card {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

body:not([data-active-tab="home"]) .settings-studio .settings-grid {
  grid-column: 2;
  grid-row: 1 / span 3;
  margin: 0;
}

body:not([data-active-tab="home"]) .settings-studio .toolbar {
  grid-column: 2;
}

/* Image QA dedicated redesign */
body:not([data-active-tab="home"]) .image-qa-redesign {
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 22px;
}

body:not([data-active-tab="home"]) .image-qa-redesign .image-qa-rail {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  border: 1px solid var(--premium-line-soft);
  border-radius: 8px;
  background: rgba(252, 248, 241, .70);
  box-shadow: var(--premium-shadow);
  overflow: hidden;
}

body:not([data-active-tab="home"]) .image-qa-redesign .image-qa-title {
  padding: 24px 22px 14px;
}

body:not([data-active-tab="home"]) .image-qa-redesign .image-qa-title span {
  display: block;
  color: var(--premium-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .15em;
}

body:not([data-active-tab="home"]) .image-qa-redesign .image-qa-title h2 {
  margin: 8px 0 0;
  color: var(--premium-ink);
  font-size: 26px;
  line-height: 1.05;
}

body:not([data-active-tab="home"]) .image-qa-redesign .image-qa-title p {
  margin: 10px 0 0;
  color: var(--premium-muted);
  font-size: 13px;
  line-height: 1.6;
}

body:not([data-active-tab="home"]) .image-qa-redesign .image-toolstrip {
  display: grid;
  grid-column: auto;
  grid-row: auto;
  grid-template-columns: 1.35fr .85fr .7fr .7fr;
  gap: 6px;
  padding: 0 22px 10px;
  border-bottom: 1px solid var(--premium-line-soft);
  justify-content: stretch;
  align-content: start;
}

body:not([data-active-tab="home"]) .image-qa-redesign .image-toolstrip button,
body:not([data-active-tab="home"]) .image-qa-redesign .image-toolstrip .compact-control {
  width: 100%;
  justify-content: center;
  min-height: 30px;
  height: 30px;
  padding-inline: 8px;
  font-size: 11px;
}

body:not([data-active-tab="home"]) .image-qa-redesign #pickImage,
body:not([data-active-tab="home"]) .image-qa-redesign #reuploadImages {
  grid-column: auto;
}

body:not([data-active-tab="home"]) .image-qa-redesign .image-concurrency-control {
  grid-column: span 4;
  width: 52%;
  justify-self: start;
  grid-template-columns: auto 30px;
  margin-top: 2px;
}

body:not([data-active-tab="home"]) .image-qa-redesign .image-concurrency-control {
  grid-template-columns: auto 34px;
}

body:not([data-active-tab="home"]) .image-qa-redesign .image-queue-zone {
  grid-column: auto;
  grid-row: auto;
  min-height: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: rgba(246, 240, 231, .46);
  box-shadow: none;
  overflow: auto;
}

body:not([data-active-tab="home"]) .image-qa-redesign .drop-empty {
  min-height: 100%;
  padding: 22px;
  align-content: center;
  justify-content: center;
  text-align: center;
}

body:not([data-active-tab="home"]) .image-qa-redesign .drop-empty strong {
  margin-top: 0;
  font-size: 18px;
}

body:not([data-active-tab="home"]) .image-qa-redesign .image-grid {
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 12px;
}

body:not([data-active-tab="home"]) .image-qa-redesign .image-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  min-height: 72px;
  border-radius: 8px;
  background: rgba(252, 248, 241, .78);
}

body:not([data-active-tab="home"]) .image-qa-redesign .image-card img {
  width: 72px;
  height: 72px;
  aspect-ratio: auto;
  object-fit: cover;
}

body:not([data-active-tab="home"]) .image-qa-redesign .image-card span {
  align-self: center;
  padding: 10px 36px 10px 10px;
  white-space: normal;
  line-height: 1.35;
  font-size: 11px;
}

body:not([data-active-tab="home"]) .image-qa-redesign .image-card-status {
  top: 8px;
  right: 8px;
}

body:not([data-active-tab="home"]) .image-qa-redesign .image-qa-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 18px 16px;
  border-top: 1px solid var(--premium-line-soft);
  background: rgba(246, 240, 231, .66);
}

body:not([data-active-tab="home"]) .image-qa-redesign .image-upload-status {
  padding: 0;
}

body:not([data-active-tab="home"]) .image-qa-redesign .image-check-primary {
  min-width: 116px;
  min-height: 40px;
}

body:not([data-active-tab="home"]) .image-qa-redesign .image-report {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  border: 1px solid var(--premium-line-soft);
  border-radius: 8px;
  background: rgba(252, 248, 241, .84);
  box-shadow: var(--premium-shadow);
  overflow: hidden;
}

body:not([data-active-tab="home"]) .image-qa-redesign .image-report-head {
  min-height: 94px;
  padding: 26px 28px 20px;
  border-bottom: 1px solid var(--premium-line-soft);
}

body:not([data-active-tab="home"]) .image-qa-redesign .image-report-head h2 {
  font-size: 28px;
}

body:not([data-active-tab="home"]) .image-qa-redesign .image-report-summary {
  margin: 18px 22px 0;
  min-height: 52px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: rgba(246, 240, 231, .58);
}

body:not([data-active-tab="home"]) .image-qa-redesign .image-report-list {
  margin: 14px 22px 22px;
  padding: 14px;
  background: rgba(252, 248, 241, .48);
}

body:not([data-active-tab="home"]) .image-qa-redesign .image-report-list:empty::before {
  content: "检查结果会在这里按图片生成报告卡。";
  min-height: 100%;
  display: grid;
  place-items: center;
  color: var(--premium-muted);
  text-align: center;
}

body:not([data-active-tab="home"]) .settings-studio .tool-kicker,
body:not([data-active-tab="home"]) .settings-studio h2,
body:not([data-active-tab="home"]) .settings-studio p {
  grid-column: 1;
}

/* 20260618 full-site UI refactor: dark warm glass system */
:root {
  --ui-bg: #120f0d;
  --ui-bg-2: #1d1713;
  --ui-coffee: #6f5748;
  --ui-caramel: #b89472;
  --ui-paper: #f7efe5;
  --ui-paper-soft: rgba(247, 239, 229, .72);
  --ui-muted: rgba(247, 239, 229, .58);
  --ui-line: rgba(247, 239, 229, .12);
  --ui-line-strong: rgba(247, 239, 229, .20);
  --ui-glass: rgba(32, 25, 20, .68);
  --ui-glass-2: rgba(45, 35, 28, .60);
  --ui-glass-clear: rgba(247, 239, 229, .08);
  --ui-shadow: 0 26px 70px rgba(0, 0, 0, .32);
}

html,
body {
  background: var(--ui-bg);
  color: var(--ui-paper);
}

body {
  color-scheme: dark;
}

.app-shell {
  grid-template-rows: var(--nav-h) minmax(0, 1fr);
  background:
    radial-gradient(circle at 18% 0%, rgba(111, 87, 72, .26), transparent 34%),
    radial-gradient(circle at 82% 10%, rgba(184, 148, 114, .12), transparent 28%),
    linear-gradient(135deg, #0f0d0c 0%, #211814 48%, #130f0d 100%);
}

body[data-active-tab="home"] .app-shell {
  display: block;
  min-height: 100vh;
}

.sidebar {
  border-bottom: 1px solid var(--ui-line);
  background: rgba(18, 15, 13, .86);
  color: var(--ui-paper);
  backdrop-filter: blur(18px);
}

body[data-active-tab="home"] .sidebar {
  position: fixed;
  inset: 0 0 auto 0;
  width: 100%;
  height: 72px;
  padding: 0 28px;
  border: 0;
  background: transparent;
  z-index: 20;
}

body[data-active-tab="home"] .brand-block {
  position: fixed;
  left: 26px;
  top: 24px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(247, 239, 229, .16);
  border-radius: 999px;
  background: rgba(18, 15, 13, .32);
  backdrop-filter: blur(16px);
  cursor: pointer;
}

body[data-active-tab="home"] .brand-block > div,
body[data-active-tab="home"] .side-nav {
  display: none;
}

.brand-block {
  outline: none;
}

.brand-block > span {
  border-color: var(--ui-line-strong);
  background: rgba(247, 239, 229, .08);
}

.brand-block strong {
  color: var(--ui-paper);
}

.side-nav {
  gap: 26px;
}

.side-nav {
  display: none !important;
}

.global-pill-nav {
  position: fixed;
  left: 50%;
  top: 18px;
  z-index: 40;
  transform: translateX(-50%);
}

.global-pill-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 13px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  background: rgba(25, 22, 20, .46);
  color: rgba(255, 255, 255, .78);
  padding: 0 18px;
  font-size: 12px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 16px 42px rgba(0,0,0,.24);
  backdrop-filter: blur(18px) saturate(1.16);
  -webkit-backdrop-filter: blur(18px) saturate(1.16);
}

.global-pill-button strong {
  color: rgba(255, 255, 255, .96);
  font-weight: 900;
}

.global-pill-button i {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(184, 148, 114, .84);
}

.global-pill-nav.open .global-pill-button {
  border-color: rgba(255, 255, 255, .26);
  background: rgba(25, 22, 20, .58);
}

.global-pill-menu {
  position: absolute;
  left: 50%;
  top: 52px;
  width: 250px;
  display: grid;
  gap: 6px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 18px;
  background: rgba(20, 18, 16, .62);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 24px 64px rgba(0,0,0,.36);
  transform: translateX(-50%);
  backdrop-filter: blur(22px) saturate(1.18);
  -webkit-backdrop-filter: blur(22px) saturate(1.18);
}

.global-pill-menu[hidden] {
  display: none !important;
}

.global-pill-option {
  min-height: 48px;
  display: grid;
  gap: 3px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, .82);
  padding: 8px 11px;
  text-align: left;
}

.global-pill-option strong {
  color: rgba(255, 255, 255, .94);
  font-size: 13px;
}

.global-pill-option span {
  color: rgba(255, 255, 255, .52);
  font-size: 10px;
  line-height: 1.35;
}

.global-pill-option:hover,
.global-pill-option.active {
  border-color: rgba(255, 255, 255, .13);
  background: rgba(255, 255, 255, .08);
}

.tab {
  color: rgba(247, 239, 229, .54);
  transition: color .18s ease;
}

.tab.active,
.tab:hover {
  color: var(--ui-paper);
}

.tab.active::after {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ui-caramel), transparent);
  box-shadow: 0 0 18px rgba(184, 148, 114, .55);
}

.tab[data-tab="home"] {
  display: none;
}

.main-stage {
  height: calc(100vh - var(--nav-h));
  background:
    radial-gradient(circle at 20% 0%, rgba(111, 87, 72, .22), transparent 34%),
    linear-gradient(135deg, #11100f 0%, #241a15 55%, #12100f 100%);
}

body[data-active-tab="home"] .main-stage {
  height: 100vh;
}

.home-panel.active {
  background: #100d0c;
}

.home-floating-stage {
  position: relative;
  height: 100%;
  min-height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(16, 13, 12, .70), rgba(16, 13, 12, .34) 42%, rgba(16, 13, 12, .78)),
    radial-gradient(circle at 50% 46%, rgba(184, 148, 114, .18), transparent 36%),
    url("./assets/hero-home-interior-v2.png") center center / cover no-repeat;
}

.home-floating-stage::before {
  content: "";
  position: absolute;
  inset: -18px;
  background: inherit;
  filter: blur(2px) saturate(.96);
  transform: scale(1.03);
}

.home-floating-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 72%, rgba(184, 148, 114, .14), transparent 34%),
    linear-gradient(120deg, rgba(7, 7, 7, .20), rgba(7, 7, 7, .02) 42%, rgba(7, 7, 7, .36));
  pointer-events: none;
}

.home-pill {
  position: absolute;
  left: 50%;
  top: 24px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 13px;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid rgba(247, 239, 229, .18);
  border-radius: 999px;
  background: rgba(18, 15, 13, .38);
  color: rgba(247, 239, 229, .82);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
  box-shadow: 0 16px 38px rgba(0, 0, 0, .20);
}

.home-pill span {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
}

.home-pill i {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(184, 148, 114, .82);
}

.home-reset {
  position: absolute;
  right: 28px;
  top: 24px;
  z-index: 5;
  min-height: 40px;
  border: 1px solid rgba(247, 239, 229, .16);
  border-radius: 999px;
  background: rgba(18, 15, 13, .36);
  color: rgba(247, 239, 229, .78);
  padding: 0 16px;
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(18px);
}

.home-tool-cards {
  position: absolute;
  inset: 88px 5.5vw 52px;
  z-index: 3;
}

.home-tool-card {
  position: absolute;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  width: 380px;
  min-height: 250px;
  display: grid;
  align-content: space-between;
  gap: 38px;
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .018) 34%, rgba(184, 148, 114, .08)),
    rgba(12, 12, 11, .28);
  color: rgba(255, 255, 255, .96);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .18),
    inset 0 -1px 0 rgba(184, 148, 114, .10),
    0 32px 90px rgba(0, 0, 0, .36);
  backdrop-filter: blur(34px) saturate(1.26) contrast(1.06);
  -webkit-backdrop-filter: blur(34px) saturate(1.26) contrast(1.06);
  cursor: grab;
  user-select: none;
  animation: homeCardIn .58s ease var(--delay) both;
  transform: translate3d(0, 0, 0);
}

.home-tool-card::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .10), transparent 22%),
    radial-gradient(circle at 80% 110%, rgba(184, 148, 114, .20), transparent 30%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.025) 0 1px, transparent 1px 4px);
  pointer-events: none;
}

.home-tool-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, .045);
  pointer-events: none;
}

.home-tool-card.dragging {
  cursor: grabbing;
  z-index: 10;
  animation-play-state: paused;
  transform: translate3d(0, 0, 0) scale(1.015);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .22),
    0 40px 110px rgba(0, 0, 0, .48),
    0 0 0 1px rgba(255, 255, 255, .18);
}

.home-tool-card.primary {
  width: 520px;
  min-height: 330px;
  padding: 40px;
}

.home-tool-card.wide {
  width: 430px;
  min-height: 270px;
}

.home-tool-card.small {
  width: 340px;
  min-height: 230px;
}

.home-tool-card[data-tool-id="sceneAdmin"] {
  width: 250px;
  min-height: 138px;
  gap: 14px;
  padding: 18px;
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(184, 148, 114, .16), rgba(255, 255, 255, .04)),
    rgba(12, 12, 11, .34);
}

.home-tool-card[data-tool-id="sceneAdmin"] .home-card-copy h2 {
  font-size: 26px;
  line-height: 1.08;
}

.home-tool-card[data-tool-id="sceneAdmin"] .home-card-copy p {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.45;
}

.home-tool-card[data-tool-id="sceneAdmin"] .home-card-enter {
  min-height: 30px;
  padding: 0 12px;
  font-size: 11px;
}

.home-tool-card.featured {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .02) 34%, rgba(184, 148, 114, .12)),
    rgba(12, 12, 11, .30);
  border-color: rgba(255, 255, 255, .20);
}

.home-card-hit {
  position: absolute;
  inset: 0;
  z-index: 3;
  border: 0;
  border-radius: inherit;
  background: transparent;
}

.home-card-index {
  position: relative;
  z-index: 4;
  color: rgba(255, 255, 255, .66);
  font-family: "DM Mono", monospace;
  font-size: 11px;
  letter-spacing: .12em;
}

.home-card-copy {
  position: relative;
  z-index: 4;
}

.home-card-copy h2 {
  margin: 0;
  color: rgba(255, 255, 255, .96);
  font-size: 48px;
  line-height: 1.04;
  font-weight: 800;
  letter-spacing: 0;
}

.home-tool-card.primary .home-card-copy h2 {
  font-size: 68px;
}

.home-card-copy p {
  max-width: 20em;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, .72);
  font-size: 15px;
  line-height: 1.7;
}

.home-card-enter {
  position: relative;
  z-index: 4;
  justify-self: start;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .92);
  padding: 0 16px;
  font-size: 13px;
  font-weight: 900;
}

.home-card-enter::after {
  content: "→";
  font-weight: 900;
}

@keyframes homeCardIn {
  from {
    opacity: 0;
    transform: translate3d(0, 18px, 0) scale(.98);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

.home-tool-card {
  animation:
    homeCardIn .58s ease var(--delay) both,
    homeFloat 7.2s ease-in-out calc(var(--delay) + .8s) infinite;
}

.home-tool-card:nth-child(2) { animation-duration: .58s, 8.1s; }
.home-tool-card:nth-child(3) { animation-duration: .58s, 6.7s; }
.home-tool-card:nth-child(4) { animation-duration: .58s, 7.8s; }
.home-tool-card:nth-child(5) { animation-duration: .58s, 6.9s; }

.home-tool-card:hover {
  border-color: rgba(255, 255, 255, .28) !important;
  background:
    radial-gradient(circle at 22% 0%, rgba(255, 255, 255, .24), transparent 34%),
    linear-gradient(155deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .055) 42%, rgba(184, 148, 114, .14)),
    rgba(24, 24, 22, .48) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .24),
    inset 0 -1px 0 rgba(184, 148, 114, .13),
    0 40px 104px rgba(0, 0, 0, .44);
}

.home-tool-card:hover .home-card-enter {
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .30);
}

@keyframes homeFloat {
  0%, 100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -9px, 0);
  }
}

body:not([data-active-tab="home"]) .tool-page,
body:not([data-active-tab="home"]) .visual-forge-host.active,
body:not([data-active-tab="home"]) .settings-tool {
  background:
    radial-gradient(circle at 12% 0%, rgba(111, 87, 72, .22), transparent 32%),
    radial-gradient(circle at 92% 8%, rgba(184, 148, 114, .10), transparent 30%),
    linear-gradient(135deg, #11100f 0%, #241a15 58%, #12100f 100%);
}

body:not([data-active-tab="home"]) .tool-page.active {
  display: grid;
  padding: 20px 24px 24px;
  gap: 16px;
}

body:not([data-active-tab="home"]) .csv-tool {
  grid-template-columns: minmax(310px, 360px) minmax(560px, 1fr) minmax(310px, 360px);
}

body:not([data-active-tab="home"]) .image-tool {
  grid-template-columns: minmax(260px, 310px) minmax(620px, 1fr) minmax(300px, 350px);
}

body:not([data-active-tab="home"]) .image-tool .image-report {
  grid-column: 2;
}

body:not([data-active-tab="home"]) .image-tool::after {
  content: "当前图片详情\a\a上传图片后，这里用于查看缩略图、文件名和检查状态。";
  white-space: pre-line;
  display: block;
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--ui-line);
  border-radius: 18px;
  background: var(--ui-glass);
  color: rgba(247, 239, 229, .56);
  padding: 22px;
  line-height: 1.7;
  box-shadow: var(--ui-shadow);
  backdrop-filter: blur(12px);
}

body:not([data-active-tab="home"]) .tool-sidebar,
body:not([data-active-tab="home"]) .tool-main,
body:not([data-active-tab="home"]) .tool-assistant,
body:not([data-active-tab="home"]) .settings-card,
body:not([data-active-tab="home"]) .image-qa-rail,
body:not([data-active-tab="home"]) .image-report {
  border: 1px solid var(--ui-line);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(247, 239, 229, .08), rgba(247, 239, 229, .045)),
    rgba(29, 23, 19, .72);
  color: var(--ui-paper);
  box-shadow: var(--ui-shadow);
  backdrop-filter: blur(12px);
}

body:not([data-active-tab="home"]) .tool-sidebar,
body:not([data-active-tab="home"]) .image-qa-rail {
  padding: 22px;
}

body:not([data-active-tab="home"]) .tool-main,
body:not([data-active-tab="home"]) .tool-assistant,
body:not([data-active-tab="home"]) .image-report {
  overflow: hidden;
}

body:not([data-active-tab="home"]) .tool-kicker,
body:not([data-active-tab="home"]) .tool-head span,
body:not([data-active-tab="home"]) .image-qa-title span {
  color: var(--ui-caramel);
}

body:not([data-active-tab="home"]) h2,
body:not([data-active-tab="home"]) .tool-head h2,
body:not([data-active-tab="home"]) .image-qa-title h2 {
  color: var(--ui-paper);
}

body:not([data-active-tab="home"]) p,
body:not([data-active-tab="home"]) .image-qa-title p,
body:not([data-active-tab="home"]) .tool-sidebar p {
  color: var(--ui-muted);
}

body:not([data-active-tab="home"]) input,
body:not([data-active-tab="home"]) textarea,
body:not([data-active-tab="home"]) select {
  border-color: rgba(247, 239, 229, .13);
  background: rgba(247, 239, 229, .07);
  color: var(--ui-paper);
}

body:not([data-active-tab="home"]) textarea::placeholder,
body:not([data-active-tab="home"]) input::placeholder {
  color: rgba(247, 239, 229, .34);
}

body:not([data-active-tab="home"]) button,
body:not([data-active-tab="home"]) .toolbar button,
body:not([data-active-tab="home"]) .attach-button,
body:not([data-active-tab="home"]) .model-pill {
  border-color: rgba(247, 239, 229, .14);
  background: rgba(247, 239, 229, .08);
  color: rgba(247, 239, 229, .84);
}

body:not([data-active-tab="home"]) button.primary,
body:not([data-active-tab="home"]) .primary,
body:not([data-active-tab="home"]) .send-button.primary {
  border-color: rgba(184, 148, 114, .54);
  background: linear-gradient(135deg, rgba(184, 148, 114, .92), rgba(111, 87, 72, .92));
  color: #140f0d;
}

body:not([data-active-tab="home"]) .drop-zone,
body:not([data-active-tab="home"]) .tool-upload,
body:not([data-active-tab="home"]) .image-report-summary,
body:not([data-active-tab="home"]) .image-report-list,
body:not([data-active-tab="home"]) .asset-strip,
body:not([data-active-tab="home"]) .command-card {
  border-color: rgba(247, 239, 229, .11);
  background: rgba(247, 239, 229, .055);
  color: var(--ui-paper);
}

body:not([data-active-tab="home"]) .code-editor,
body:not([data-active-tab="home"]) #csvResult,
body:not([data-active-tab="home"]) #imageResult {
  background: rgba(10, 8, 7, .34);
  color: rgba(247, 239, 229, .90);
}

body:not([data-active-tab="home"]) .settings-studio {
  grid-template-columns: minmax(540px, 760px) minmax(280px, 360px);
  align-items: start;
  justify-content: center;
  padding-top: 48px;
}

body:not([data-active-tab="home"]) .settings-card {
  width: 100%;
  padding: 28px;
}

body:not([data-active-tab="home"]) .settings-studio::after {
  content: "连接状态\a\a当前连接状态会跟随保存与刷新模型更新。\a\a可用模型数量\a从模型列表刷新结果读取。\a\a最近错误\a接口失败时在状态提示中查看。";
  white-space: pre-line;
  display: block;
  border: 1px solid var(--ui-line);
  border-radius: 18px;
  background: var(--ui-glass);
  color: rgba(247, 239, 229, .56);
  padding: 26px;
  line-height: 1.7;
  box-shadow: var(--ui-shadow);
}

body:not([data-active-tab="home"]) .visual-forge-frame {
  border: 0;
  background: transparent;
}

@media (max-width: 1500px) {
  body:not([data-active-tab="home"]) .csv-tool {
    grid-template-columns: minmax(280px, 330px) minmax(520px, 1fr) minmax(280px, 330px);
  }

  body:not([data-active-tab="home"]) .image-tool {
    grid-template-columns: minmax(250px, 300px) minmax(540px, 1fr) minmax(270px, 320px);
  }
}

@media (max-width: 1280px) {
  .sidebar {
    padding: 0 28px;
    gap: 20px;
  }

  .brand-block {
    min-width: 220px;
  }

  .side-nav {
    gap: 16px;
  }

  body:not([data-active-tab="home"]) .tool-page.active,
  body:not([data-active-tab="home"]) .settings-studio {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  body:not([data-active-tab="home"]) .image-tool::after,
  body:not([data-active-tab="home"]) .settings-studio::after {
    display: none;
  }
}

@media (max-width: 860px) {
  body[data-active-tab="home"] .brand-block,
  .home-reset,
  .home-pill {
    position: absolute;
  }

  .home-tool-cards {
    inset: 86px 18px 28px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    overflow: auto;
  }

  .home-tool-card,
  .home-tool-card.primary,
  .home-tool-card.wide,
  .home-tool-card.small {
    position: relative;
    left: auto;
    top: auto;
    width: 100%;
    min-height: 170px;
    padding: 20px;
    animation: homeCardIn .45s ease var(--delay) both;
  }

  .home-tool-card.primary {
    grid-column: 1 / -1;
  }

  .home-tool-card.primary .home-card-copy h2,
  .home-card-copy h2 {
    font-size: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-tool-card {
    animation: homeCardIn .01s ease both !important;
  }
}

@media (max-width: 620px) {
  .home-tool-cards {
    grid-template-columns: 1fr;
  }

  .home-pill {
    left: 18px;
    right: 18px;
    justify-content: center;
    transform: none;
  }
}

/* 20260618 final hard override for legacy light tool skins */
body:not([data-active-tab="home"]) .main-stage,
body:not([data-active-tab="home"]) .tool-page,
body:not([data-active-tab="home"]) .workspace.tool-page.active,
body:not([data-active-tab="home"]) .settings-tool,
body:not([data-active-tab="home"]) .visual-forge-host.active {
  background:
    radial-gradient(circle at 12% 0%, rgba(112, 87, 71, .24), transparent 34%),
    radial-gradient(circle at 94% 4%, rgba(184, 148, 114, .11), transparent 30%),
    linear-gradient(135deg, #11100f 0%, #241a15 58%, #12100f 100%) !important;
  color: var(--ui-paper) !important;
}

body:not([data-active-tab="home"]) .tool-sidebar,
body:not([data-active-tab="home"]) .tool-main,
body:not([data-active-tab="home"]) .tool-assistant,
body:not([data-active-tab="home"]) .settings-card,
body:not([data-active-tab="home"]) .image-qa-rail,
body:not([data-active-tab="home"]) .image-report,
body:not([data-active-tab="home"]) .command-card,
body:not([data-active-tab="home"]) .drop-zone,
body:not([data-active-tab="home"]) .asset-strip,
body:not([data-active-tab="home"]) .image-tool::after,
body:not([data-active-tab="home"]) .settings-studio::after {
  border: 1px solid var(--ui-line) !important;
  border-radius: 18px !important;
  background:
    linear-gradient(180deg, rgba(247, 239, 229, .085), rgba(247, 239, 229, .045)),
    rgba(29, 23, 19, .76) !important;
  color: var(--ui-paper) !important;
  box-shadow: var(--ui-shadow) !important;
  backdrop-filter: blur(12px) !important;
}

body:not([data-active-tab="home"]) .tool-main,
body:not([data-active-tab="home"]) .tool-assistant,
body:not([data-active-tab="home"]) .image-report {
  background:
    linear-gradient(180deg, rgba(247, 239, 229, .075), rgba(247, 239, 229, .035)),
    rgba(24, 19, 16, .78) !important;
}

body:not([data-active-tab="home"]) .tool-head,
body:not([data-active-tab="home"]) .image-report-head {
  border-bottom: 1px solid var(--ui-line) !important;
  background: rgba(247, 239, 229, .025) !important;
}

body:not([data-active-tab="home"]) h1,
body:not([data-active-tab="home"]) h2,
body:not([data-active-tab="home"]) h3,
body:not([data-active-tab="home"]) strong,
body:not([data-active-tab="home"]) .tool-head h2,
body:not([data-active-tab="home"]) .image-qa-title h2,
body:not([data-active-tab="home"]) .settings-card h2 {
  color: var(--ui-paper) !important;
}

body:not([data-active-tab="home"]) p,
body:not([data-active-tab="home"]) small,
body:not([data-active-tab="home"]) label span,
body:not([data-active-tab="home"]) .image-upload-status,
body:not([data-active-tab="home"]) .image-report-list:empty::before,
body:not([data-active-tab="home"]) .drop-empty span,
body:not([data-active-tab="home"]) .asset-strip,
body:not([data-active-tab="home"]) .chat-messages {
  color: rgba(247, 239, 229, .62) !important;
}

body:not([data-active-tab="home"]) .tool-kicker,
body:not([data-active-tab="home"]) .tool-head span,
body:not([data-active-tab="home"]) .image-qa-title span {
  color: var(--ui-caramel) !important;
}

body:not([data-active-tab="home"]) input,
body:not([data-active-tab="home"]) textarea,
body:not([data-active-tab="home"]) select,
body:not([data-active-tab="home"]) .result,
body:not([data-active-tab="home"]) .small-result,
body:not([data-active-tab="home"]) .code-editor,
body:not([data-active-tab="home"]) #csvResult,
body:not([data-active-tab="home"]) #imageResult,
body:not([data-active-tab="home"]) #quickPrompt,
body:not([data-active-tab="home"]) #productInfo {
  border: 1px solid rgba(247, 239, 229, .13) !important;
  background: rgba(9, 7, 6, .32) !important;
  color: rgba(247, 239, 229, .90) !important;
  box-shadow: none !important;
}

body:not([data-active-tab="home"]) input[type="file"] {
  background: transparent !important;
}

body:not([data-active-tab="home"]) textarea::placeholder,
body:not([data-active-tab="home"]) input::placeholder {
  color: rgba(247, 239, 229, .36) !important;
}

body:not([data-active-tab="home"]) .file-row,
body:not([data-active-tab="home"]) .tool-upload,
body:not([data-active-tab="home"]) .image-report-summary,
body:not([data-active-tab="home"]) .image-report-list,
body:not([data-active-tab="home"]) .image-queue-zone {
  border-color: rgba(247, 239, 229, .12) !important;
  background: rgba(247, 239, 229, .055) !important;
  color: rgba(247, 239, 229, .84) !important;
}

body:not([data-active-tab="home"]) button,
body:not([data-active-tab="home"]) .toolbar button,
body:not([data-active-tab="home"]) .attach-button,
body:not([data-active-tab="home"]) .model-pill {
  border: 1px solid rgba(247, 239, 229, .14) !important;
  background: rgba(247, 239, 229, .075) !important;
  color: rgba(247, 239, 229, .86) !important;
  box-shadow: none !important;
}

body:not([data-active-tab="home"]) button.primary,
body:not([data-active-tab="home"]) .primary,
body:not([data-active-tab="home"]) .send-button.primary,
body:not([data-active-tab="home"]) #fillCsv,
body:not([data-active-tab="home"]) #checkImage,
body:not([data-active-tab="home"]) #saveSettings {
  border-color: rgba(184, 148, 114, .56) !important;
  background: linear-gradient(135deg, rgba(184, 148, 114, .94), rgba(112, 87, 71, .92)) !important;
  color: #140f0d !important;
}

body:not([data-active-tab="home"]) .csv-studio {
  grid-template-columns: minmax(300px, 360px) minmax(560px, 1fr) minmax(340px, 420px) !important;
  grid-template-rows: minmax(0, 1fr) !important;
}

body:not([data-active-tab="home"]) .csv-studio .tool-assistant {
  grid-column: 3 !important;
  grid-row: 1 !important;
}

body:not([data-active-tab="home"]) .csv-studio .tool-main {
  grid-column: 2 !important;
  grid-row: 1 !important;
}

body:not([data-active-tab="home"]) .image-qa-redesign {
  grid-template-columns: minmax(260px, 310px) minmax(640px, 1fr) minmax(300px, 350px) !important;
}

body:not([data-active-tab="home"]) .image-qa-redesign .image-report {
  grid-column: 2 !important;
  grid-row: 1 !important;
}

body:not([data-active-tab="home"]) .image-qa-redesign .image-qa-rail {
  grid-column: 1 !important;
  grid-row: 1 !important;
}

body:not([data-active-tab="home"]) .settings-studio {
  grid-template-columns: minmax(560px, 760px) minmax(280px, 360px) !important;
  place-items: start stretch !important;
}

body:not([data-active-tab="home"]) .settings-studio .settings-grid {
  grid-template-columns: 1fr 1fr !important;
}

body:not([data-active-tab="home"]) .settings-studio::after,
body:not([data-active-tab="home"]) .image-tool::after {
  color: rgba(247, 239, 229, .62) !important;
}

body:not([data-active-tab="home"]) .image-card {
  border-color: rgba(247, 239, 229, .12) !important;
  background: rgba(247, 239, 229, .06) !important;
  color: var(--ui-paper) !important;
}

body:not([data-active-tab="home"]) .image-card img {
  background: rgba(9, 7, 6, .34) !important;
}

body:not([data-active-tab="home"]) .status {
  background: rgba(29, 23, 19, .88) !important;
  color: var(--ui-paper) !important;
}

/* 20260618 final alignment fixes */
.side-nav .tab,
body:not([data-active-tab="home"]) .side-nav .tab {
  min-width: auto !important;
  height: 100% !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: rgba(247, 239, 229, .58) !important;
}

.side-nav .tab.active,
.side-nav .tab:hover,
body:not([data-active-tab="home"]) .side-nav .tab.active,
body:not([data-active-tab="home"]) .side-nav .tab:hover {
  color: var(--ui-paper) !important;
}

.home-tool-card,
.home-tool-card.primary,
.home-tool-card.wide,
.home-tool-card.small {
  border-color: rgba(255, 255, 255, .16) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .018) 34%, rgba(184, 148, 114, .08)),
    rgba(12, 12, 11, .28) !important;
  color: rgba(255, 255, 255, .96) !important;
  backdrop-filter: blur(34px) saturate(1.26) contrast(1.06) !important;
  -webkit-backdrop-filter: blur(34px) saturate(1.26) contrast(1.06) !important;
}

.home-tool-card.featured {
  border-color: rgba(255, 255, 255, .20) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .02) 34%, rgba(184, 148, 114, .12)),
    rgba(12, 12, 11, .30) !important;
}

.home-card-copy h2,
.home-card-copy p,
.home-card-index,
.home-card-enter {
  color: rgba(255, 255, 255, .96) !important;
}

.home-card-copy p,
.home-card-index {
  opacity: .76;
}

body:not([data-active-tab="home"]) .csv-studio .tool-assistant {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  align-content: stretch !important;
  padding: 0 !important;
  overflow: hidden !important;
}

body:not([data-active-tab="home"]) .csv-studio .tool-assistant .tool-head {
  min-height: 94px !important;
  padding: 24px !important;
}

body:not([data-active-tab="home"]) .csv-studio .tool-assistant .command-card,
body:not([data-active-tab="home"]) .csv-studio .utility-chat {
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 18px !important;
  display: grid !important;
  grid-template-rows: minmax(120px, 1fr) auto auto auto !important;
  gap: 12px !important;
  border: 0 !important;
  border-top: 1px solid var(--ui-line) !important;
  border-radius: 0 !important;
  background: rgba(247, 239, 229, .035) !important;
}

body:not([data-active-tab="home"]) .csv-studio #quickPrompt {
  width: 100% !important;
  min-height: 140px !important;
}

body:not([data-active-tab="home"]) .csv-studio .command-footer {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

body:not([data-active-tab="home"]) .csv-studio .home-modelbar,
body:not([data-active-tab="home"]) .csv-studio .model-picker {
  min-width: 0 !important;
  max-width: 150px !important;
}

body:not([data-active-tab="home"]) .csv-studio .model-pill {
  max-width: 150px !important;
  overflow: hidden !important;
}

body:not([data-active-tab="home"]) .image-qa-redesign .image-qa-footer {
  border-top: 1px solid var(--ui-line) !important;
  background: transparent !important;
  padding: 14px 0 0 !important;
}

body:not([data-active-tab="home"]) .image-qa-redesign .image-check-primary {
  width: 100% !important;
}

body:not([data-active-tab="home"]) .settings-studio .settings-card {
  display: block !important;
  overflow: visible !important;
}

body:not([data-active-tab="home"]) .settings-studio .settings-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 16px !important;
  margin-top: 22px !important;
}

body:not([data-active-tab="home"]) .settings-studio .settings-grid label {
  min-width: 0 !important;
  display: grid !important;
  gap: 8px !important;
}

body:not([data-active-tab="home"]) .settings-studio .settings-grid input,
body:not([data-active-tab="home"]) .settings-studio .settings-grid select {
  width: 100% !important;
  min-width: 0 !important;
}

body:not([data-active-tab="home"]) .settings-studio .toolbar {
  margin-top: 24px !important;
}

.home-tool-card,
.home-tool-card.primary,
.home-tool-card.wide,
.home-tool-card.small {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .018) 34%, rgba(184, 148, 114, .08)),
    rgba(12, 12, 11, .28) !important;
  backdrop-filter: blur(34px) saturate(1.26) contrast(1.06) !important;
  -webkit-backdrop-filter: blur(34px) saturate(1.26) contrast(1.06) !important;
}

.home-tool-card.featured {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .02) 34%, rgba(184, 148, 114, .12)),
    rgba(12, 12, 11, .30) !important;
}

body:not([data-active-tab="home"]) .csv-studio .tool-assistant {
  grid-template-rows: auto minmax(0, 1fr) !important;
  grid-template-columns: 1fr !important;
}

body:not([data-active-tab="home"]) .csv-studio .tool-assistant .tool-head {
  grid-row: 1 !important;
  align-self: start !important;
  width: 100% !important;
}

body:not([data-active-tab="home"]) .csv-studio .tool-assistant .command-card,
body:not([data-active-tab="home"]) .csv-studio .tool-assistant .utility-chat {
  grid-row: 2 !important;
  grid-column: 1 !important;
  justify-self: stretch !important;
  align-self: stretch !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
}

/* Final home glass correction: dark frosted glass, not pale blocks */
.global-pill-button,
body[data-active-tab="home"] .global-pill-button {
  border-color: rgba(255, 255, 255, .16) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .018)),
    rgba(12, 12, 11, .58) !important;
  color: rgba(255, 255, 255, .86) !important;
  backdrop-filter: blur(22px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(22px) saturate(1.2) !important;
}

.home-tool-card,
.home-tool-card.primary,
.home-tool-card.wide,
.home-tool-card.small,
.home-tool-card.featured {
  border-color: rgba(255, 255, 255, .18) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .032), rgba(255, 255, 255, .006) 28%, rgba(184, 148, 114, .055)),
    rgba(3, 3, 3, .72) !important;
  box-shadow:
    inset 0 0 0 999px rgba(0, 0, 0, .42),
    inset 0 1px 0 rgba(255, 255, 255, .16),
    inset 0 -1px 0 rgba(184, 148, 114, .10),
    0 32px 90px rgba(0, 0, 0, .42) !important;
  backdrop-filter: blur(30px) saturate(1.18) contrast(1.04) !important;
  -webkit-backdrop-filter: blur(30px) saturate(1.18) contrast(1.04) !important;
}

.home-tool-card::before {
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .050), transparent 18%),
    radial-gradient(circle at 82% 110%, rgba(184, 148, 114, .10), transparent 28%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .010) 0 1px, transparent 1px 5px),
    rgba(0, 0, 0, .46) !important;
}

.home-tool-card:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .010) 28%, rgba(184, 148, 114, .075)),
    rgba(3, 3, 3, .66) !important;
}

/* Final nav cleanup: the centered pill is the only top navigation boundary. */
.sidebar,
body:not([data-active-tab="home"]) .sidebar,
body[data-active-tab="home"] .sidebar {
  border: 0 !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
}

.shell-folder-gate {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 7, 6, .64);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.shell-folder-gate[hidden] {
  display: none !important;
}

.shell-folder-card {
  width: min(520px, calc(100vw - 48px));
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.032)),
    rgba(45, 34, 28, .82);
  color: #fff;
  box-shadow: 0 32px 90px rgba(0,0,0,.34);
  padding: 24px;
}

.shell-folder-card h2 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 25px;
  letter-spacing: -.02em;
}

.shell-folder-card p,
.shell-folder-card small {
  color: rgba(255,255,255,.66);
  line-height: 1.7;
}

.shell-folder-card p {
  margin: 0;
  font-size: 13px;
}

.shell-folder-card button {
  min-height: 40px;
  margin-top: 18px;
  border: 0;
  border-radius: 999px;
  background: #c7a47b;
  color: #15110e;
  padding: 0 18px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.shell-folder-card small {
  display: block;
  margin-top: 12px;
  border-top: 1px solid rgba(255,255,255,.12);
  padding-top: 12px;
  font-size: 11px;
}

/* Home glass reset 20260618: remove pale blocks and old top residue. */
body[data-active-tab="home"] .topbar,
body[data-active-tab="home"] .home-reset,
body[data-active-tab="home"] .main-stage::before,
body[data-active-tab="home"] .main-stage::after,
body[data-active-tab="home"] .home-panel::before,
body[data-active-tab="home"] .home-panel::after {
  display: none !important;
  content: none !important;
}

body[data-active-tab="home"] .home-floating-stage {
  background:
    linear-gradient(90deg, rgba(7, 6, 5, .42) 0%, rgba(7, 6, 5, .22) 42%, rgba(7, 6, 5, .62) 100%),
    linear-gradient(180deg, rgba(7, 6, 5, .40) 0%, rgba(7, 6, 5, .06) 34%, rgba(7, 6, 5, .28) 100%),
    url("./assets/hero-home-interior-v2.png") center center / cover no-repeat !important;
}

body[data-active-tab="home"] .home-floating-stage::before {
  display: none !important;
  content: none !important;
}

body[data-active-tab="home"] .home-floating-stage::after {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  background:
    radial-gradient(circle at 24% 68%, rgba(255, 255, 255, .09), transparent 28%),
    radial-gradient(circle at 72% 38%, rgba(184, 148, 114, .10), transparent 32%),
    linear-gradient(180deg, rgba(0, 0, 0, .18), rgba(0, 0, 0, .04) 40%, rgba(0, 0, 0, .24)) !important;
  pointer-events: none !important;
  z-index: 0 !important;
}

body[data-active-tab="home"] .home-floating-stage::after {
  z-index: 1 !important;
}

body[data-active-tab="home"] .home-tool-cards {
  z-index: 3 !important;
}

body[data-active-tab="home"] .brand-block,
body[data-active-tab="home"] .global-pill-nav,
body[data-active-tab="home"] .home-reset {
  z-index: 95 !important;
}

body[data-active-tab="home"] .global-pill-nav {
  top: 18px !important;
  z-index: 90 !important;
}

body[data-active-tab="home"] .global-pill-button {
  min-height: 42px !important;
  border: 1px solid rgba(255, 255, 255, .18) !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.025)),
    rgba(12, 12, 11, .42) !important;
  color: rgba(255, 255, 255, .90) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.16),
    0 18px 46px rgba(0,0,0,.24) !important;
  backdrop-filter: blur(26px) saturate(1.25) !important;
  -webkit-backdrop-filter: blur(26px) saturate(1.25) !important;
}

body[data-active-tab="home"] .global-pill-menu {
  width: 300px !important;
  gap: 4px !important;
  padding: 8px !important;
  border: 1px solid rgba(255,255,255,.17) !important;
  border-radius: 20px !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.020)),
    rgba(13, 13, 12, .48) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.12),
    0 26px 70px rgba(0,0,0,.38) !important;
  backdrop-filter: blur(30px) saturate(1.25) !important;
  -webkit-backdrop-filter: blur(30px) saturate(1.25) !important;
}

body[data-active-tab="home"] .global-pill-option {
  min-height: 50px !important;
  border: 1px solid transparent !important;
  border-radius: 14px !important;
  background: rgba(255,255,255,.018) !important;
  color: rgba(255,255,255,.86) !important;
  padding: 9px 12px !important;
}

body[data-active-tab="home"] .global-pill-option strong {
  color: rgba(255,255,255,.96) !important;
}

body[data-active-tab="home"] .global-pill-option span {
  color: rgba(255,255,255,.56) !important;
}

body[data-active-tab="home"] .global-pill-option:hover,
body[data-active-tab="home"] .global-pill-option.active {
  border-color: rgba(255,255,255,.16) !important;
  background: rgba(255,255,255,.075) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08) !important;
}

body[data-active-tab="home"] .home-tool-card,
body[data-active-tab="home"] .home-tool-card.primary,
body[data-active-tab="home"] .home-tool-card.wide,
body[data-active-tab="home"] .home-tool-card.small,
body[data-active-tab="home"] .home-tool-card.featured {
  border: 1px solid rgba(255,255,255,.16) !important;
  border-radius: 28px !important;
  background:
    linear-gradient(145deg, rgba(255,255,255,.045), rgba(255,255,255,.018) 42%, rgba(255,255,255,.008)),
    rgba(13, 13, 12, .62) !important;
  color: #fff !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.13),
    inset 0 -1px 0 rgba(255,255,255,.035),
    0 34px 90px rgba(0,0,0,.44) !important;
  backdrop-filter: blur(28px) saturate(1.18) contrast(1.02) !important;
  -webkit-backdrop-filter: blur(28px) saturate(1.18) contrast(1.02) !important;
  overflow: hidden !important;
}

body[data-active-tab="home"] .home-tool-card::before {
  content: "" !important;
  position: absolute !important;
  inset: 1px !important;
  z-index: 1 !important;
  border-radius: inherit !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.070), rgba(255,255,255,0) 26%),
    radial-gradient(circle at 18% 6%, rgba(255,255,255,.075), transparent 30%),
    radial-gradient(circle at 86% 96%, rgba(184,148,114,.10), transparent 34%) !important;
  pointer-events: none !important;
}

body[data-active-tab="home"] .home-tool-card::after {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: 2 !important;
  border-radius: inherit !important;
  border: 1px solid rgba(255,255,255,.06) !important;
  background:
    linear-gradient(180deg, rgba(0,0,0,.08), rgba(0,0,0,.24)),
    rgba(0,0,0,.30) !important;
  pointer-events: none !important;
}

body[data-active-tab="home"] .home-tool-card:hover {
  border-color: rgba(255,255,255,.24) !important;
  background:
    linear-gradient(145deg, rgba(255,255,255,.065), rgba(255,255,255,.024) 42%, rgba(184,148,114,.040)),
    rgba(18, 18, 17, .66) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.16),
    0 40px 105px rgba(0,0,0,.50) !important;
}

body[data-active-tab="home"] .home-card-copy,
body[data-active-tab="home"] .home-card-index,
body[data-active-tab="home"] .home-card-enter {
  position: relative !important;
  z-index: 4 !important;
}

body[data-active-tab="home"] .home-card-copy h2 {
  color: rgba(255,255,255,.96) !important;
  text-shadow: 0 10px 28px rgba(0,0,0,.24) !important;
}

body[data-active-tab="home"] .home-card-copy p,
body[data-active-tab="home"] .home-card-index {
  color: rgba(255,255,255,.66) !important;
}

body[data-active-tab="home"] .home-card-enter {
  border-color: rgba(255,255,255,.22) !important;
  background: rgba(255,255,255,.060) !important;
  color: rgba(255,255,255,.94) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
}

/* Home final dark glass pass: closer to the supplied black frosted reference. */
body[data-active-tab="home"] .home-tool-card,
body[data-active-tab="home"] .home-tool-card.primary,
body[data-active-tab="home"] .home-tool-card.wide,
body[data-active-tab="home"] .home-tool-card.small,
body[data-active-tab="home"] .home-tool-card.featured {
  border-color: rgba(255,255,255,.15) !important;
  background:
    linear-gradient(145deg, rgba(255,255,255,.035), rgba(255,255,255,.014) 44%, rgba(184,148,114,.018)),
    rgba(8, 8, 7, .76) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.13),
    inset 0 -1px 0 rgba(255,255,255,.030),
    0 34px 92px rgba(0,0,0,.50) !important;
  backdrop-filter: blur(22px) saturate(1.08) contrast(1.05) !important;
  -webkit-backdrop-filter: blur(22px) saturate(1.08) contrast(1.05) !important;
}

body[data-active-tab="home"] .home-tool-card::before {
  background:
    linear-gradient(180deg, rgba(255,255,255,.060), rgba(255,255,255,0) 25%),
    radial-gradient(circle at 16% 7%, rgba(255,255,255,.070), transparent 28%),
    radial-gradient(circle at 88% 98%, rgba(184,148,114,.070), transparent 34%) !important;
}

body[data-active-tab="home"] .home-tool-card::after {
  background:
    linear-gradient(180deg, rgba(0,0,0,.18), rgba(0,0,0,.36)),
    rgba(0,0,0,.42) !important;
}

body[data-active-tab="home"] .home-tool-card:hover {
  border-color: rgba(255,255,255,.25) !important;
  background:
    linear-gradient(145deg, rgba(255,255,255,.050), rgba(255,255,255,.018) 44%, rgba(184,148,114,.030)),
    rgba(8, 8, 7, .70) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.16),
    0 42px 110px rgba(0,0,0,.58) !important;
}

body[data-active-tab="home"] .home-card-enter {
  border-color: rgba(255,255,255,.20) !important;
  background: rgba(255,255,255,.045) !important;
}

body[data-active-tab="home"] .home-card-hit,
body[data-active-tab="home"] .home-card-hit:hover,
body[data-active-tab="home"] .home-card-hit:focus {
  background: transparent !important;
  background-color: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
  color: transparent !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

/* Home transparent glass pass: keep the hit layer clean, but restore translucency. */
body[data-active-tab="home"] .sidebar {
  position: fixed !important;
  inset: 0 0 auto 0 !important;
  width: 100% !important;
  height: 72px !important;
  z-index: 90 !important;
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body[data-active-tab="home"] .app-shell {
  display: block !important;
  grid-template-rows: none !important;
}

body[data-active-tab="home"] .main-stage {
  height: 100vh !important;
  min-height: 100vh !important;
}

body[data-active-tab="home"] .home-tool-card,
body[data-active-tab="home"] .home-tool-card.primary,
body[data-active-tab="home"] .home-tool-card.wide,
body[data-active-tab="home"] .home-tool-card.small,
body[data-active-tab="home"] .home-tool-card.featured {
  border-color: rgba(255,255,255,.18) !important;
  background:
    linear-gradient(145deg, rgba(255,255,255,.105), rgba(255,255,255,.045) 44%, rgba(184,148,114,.030)),
    rgba(12, 12, 11, .34) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.18),
    inset 0 -1px 0 rgba(255,255,255,.040),
    0 34px 92px rgba(0,0,0,.38) !important;
  backdrop-filter: blur(30px) saturate(1.24) contrast(1.04) !important;
  -webkit-backdrop-filter: blur(30px) saturate(1.24) contrast(1.04) !important;
}

body[data-active-tab="home"] .home-tool-card::before {
  background:
    linear-gradient(180deg, rgba(255,255,255,.13), rgba(255,255,255,0) 27%),
    radial-gradient(circle at 16% 7%, rgba(255,255,255,.12), transparent 28%),
    radial-gradient(circle at 88% 98%, rgba(184,148,114,.10), transparent 34%) !important;
}

body[data-active-tab="home"] .home-tool-card::after {
  border-color: rgba(255,255,255,.06) !important;
  background:
    linear-gradient(180deg, rgba(0,0,0,.020), rgba(0,0,0,.080)),
    rgba(0,0,0,.09) !important;
}

body[data-active-tab="home"] .home-tool-card:hover {
  border-color: rgba(255,255,255,.27) !important;
  background:
    linear-gradient(145deg, rgba(255,255,255,.125), rgba(255,255,255,.052) 44%, rgba(184,148,114,.038)),
    rgba(12, 12, 11, .38) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.22),
    0 42px 110px rgba(0,0,0,.46) !important;
}

/* Home typography, reset affordance, and softer background depth. */
body[data-active-tab="home"] {
  font-family: "MiSans", "HarmonyOS Sans SC", "OPPO Sans", "Plus Jakarta Sans", "PingFang SC", "Microsoft YaHei", Arial, sans-serif !important;
}

body[data-active-tab="home"] .home-floating-stage {
  background:
    linear-gradient(90deg, rgba(7, 6, 5, .46) 0%, rgba(7, 6, 5, .22) 42%, rgba(7, 6, 5, .58) 100%),
    linear-gradient(180deg, rgba(7, 6, 5, .34) 0%, rgba(7, 6, 5, .08) 34%, rgba(7, 6, 5, .24) 100%) !important;
}

body[data-active-tab="home"] .home-floating-stage::before {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  inset: -18px !important;
  background: url("./assets/hero-home-interior-v2.png") center center / cover no-repeat !important;
  filter: blur(3.5px) saturate(.98) !important;
  transform: scale(1.025) !important;
  opacity: 1 !important;
  pointer-events: none !important;
}

body[data-active-tab="home"] .home-card-copy h2 {
  font-family: "MiSans Light", "HarmonyOS Sans SC Light", "MiSans", "HarmonyOS Sans SC", "OPPO Sans", "Plus Jakarta Sans", "PingFang SC", "Microsoft YaHei", Arial, sans-serif !important;
  font-weight: 320 !important;
  line-height: 1.08 !important;
}

body[data-active-tab="home"] .home-tool-card.primary .home-card-copy h2 {
  font-weight: 360 !important;
}

body[data-active-tab="home"] .home-tool-card.primary .home-card-copy h2 {
  font-size: 62px !important;
}

body[data-active-tab="home"] .home-tool-card:not(.primary) .home-card-copy h2 {
  font-size: 43px !important;
}

body[data-active-tab="home"] .home-card-copy p {
  margin-top: 16px !important;
  color: rgba(255,255,255,.62) !important;
  font-size: 14px !important;
  line-height: 1.72 !important;
  font-weight: 320 !important;
}

body[data-active-tab="home"] .home-card-index {
  color: rgba(255,255,255,.52) !important;
  font-size: 10.5px !important;
  font-weight: 420 !important;
}

body[data-active-tab="home"] .home-card-enter {
  min-height: 34px !important;
  padding: 0 14px !important;
  font-size: 12px !important;
  font-weight: 520 !important;
}

body[data-active-tab="home"] .home-reset {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  right: 28px !important;
  top: 20px !important;
  z-index: 95 !important;
  min-height: 36px !important;
  border: 1px solid rgba(255,255,255,.15) !important;
  border-radius: 999px !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.020)),
    rgba(12,12,11,.34) !important;
  color: rgba(255,255,255,.78) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 16px 38px rgba(0,0,0,.20) !important;
  padding: 0 14px !important;
  font-size: 11px !important;
  font-weight: 520 !important;
  backdrop-filter: blur(20px) saturate(1.18) !important;
  -webkit-backdrop-filter: blur(20px) saturate(1.18) !important;
}

body[data-active-tab="home"] .home-reset:hover {
  border-color: rgba(255,255,255,.24) !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.030)),
    rgba(12,12,11,.42) !important;
  color: rgba(255,255,255,.92) !important;
}

/* Unified pill dropdown across home and tool pages. */
.global-pill-nav,
body[data-active-tab="home"] .global-pill-nav {
  top: 18px !important;
  z-index: 110 !important;
}

.global-pill-button,
body[data-active-tab="home"] .global-pill-button {
  min-height: 42px !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  border-radius: 999px !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.095), rgba(255,255,255,.025)),
    rgba(12,12,11,.42) !important;
  color: rgba(255,255,255,.90) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.14),
    0 18px 46px rgba(0,0,0,.24) !important;
  backdrop-filter: blur(26px) saturate(1.22) !important;
  -webkit-backdrop-filter: blur(26px) saturate(1.22) !important;
}

.global-pill-button strong,
body[data-active-tab="home"] .global-pill-button strong {
  color: rgba(255,255,255,.96) !important;
  font-weight: 620 !important;
}

.global-pill-nav.open .global-pill-button,
body[data-active-tab="home"] .global-pill-nav.open .global-pill-button {
  border-color: rgba(255,255,255,.26) !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.11), rgba(255,255,255,.035)),
    rgba(12,12,11,.48) !important;
}

.global-pill-menu,
body[data-active-tab="home"] .global-pill-menu {
  width: 300px !important;
  gap: 4px !important;
  padding: 8px !important;
  border: 1px solid rgba(255,255,255,.17) !important;
  border-radius: 20px !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.020)),
    rgba(13,13,12,.50) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.12),
    0 26px 70px rgba(0,0,0,.38) !important;
  backdrop-filter: blur(30px) saturate(1.25) !important;
  -webkit-backdrop-filter: blur(30px) saturate(1.25) !important;
}

.global-pill-option,
body[data-active-tab="home"] .global-pill-option {
  min-height: 50px !important;
  display: grid !important;
  gap: 3px !important;
  border: 1px solid transparent !important;
  border-radius: 14px !important;
  background: rgba(255,255,255,.018) !important;
  color: rgba(255,255,255,.86) !important;
  padding: 9px 12px !important;
  text-align: left !important;
  box-shadow: none !important;
}

.global-pill-option strong,
body[data-active-tab="home"] .global-pill-option strong {
  color: rgba(255,255,255,.96) !important;
  font-size: 13px !important;
  font-weight: 640 !important;
}

.global-pill-option span,
body[data-active-tab="home"] .global-pill-option span {
  color: rgba(255,255,255,.56) !important;
  font-size: 10px !important;
  line-height: 1.35 !important;
  font-weight: 420 !important;
}

.global-pill-option:hover,
.global-pill-option.active,
body[data-active-tab="home"] .global-pill-option:hover,
body[data-active-tab="home"] .global-pill-option.active {
  border-color: rgba(255,255,255,.16) !important;
  background: rgba(255,255,255,.075) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08) !important;
}

/* Pill menu state clarity: normal, hover, and current should not look identical. */
.global-pill-menu .global-pill-option,
body[data-active-tab="home"] .global-pill-menu .global-pill-option {
  position: relative !important;
  border-color: transparent !important;
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  outline: 0 !important;
}

.global-pill-menu .global-pill-option:hover,
body[data-active-tab="home"] .global-pill-menu .global-pill-option:hover {
  border-color: rgba(255,255,255,.08) !important;
  background: rgba(255,255,255,.040) !important;
  box-shadow: none !important;
}

.global-pill-menu .global-pill-option.active,
body[data-active-tab="home"] .global-pill-menu .global-pill-option.active {
  border-color: rgba(255,255,255,.18) !important;
  background:
    linear-gradient(90deg, rgba(255,255,255,.105), rgba(255,255,255,.035)),
    rgba(255,255,255,.035) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10) !important;
}

.global-pill-menu .global-pill-option.active::before,
body[data-active-tab="home"] .global-pill-menu .global-pill-option.active::before {
  content: "" !important;
  position: absolute !important;
  left: 8px !important;
  top: 12px !important;
  bottom: 12px !important;
  width: 2px !important;
  border-radius: 999px !important;
  background: rgba(214, 185, 145, .92) !important;
  box-shadow: 0 0 16px rgba(214,185,145,.36) !important;
}

.global-pill-menu .global-pill-option.active strong,
body[data-active-tab="home"] .global-pill-menu .global-pill-option.active strong {
  color: rgba(255,255,255,1) !important;
}

.global-pill-menu .global-pill-option.active span,
body[data-active-tab="home"] .global-pill-menu .global-pill-option.active span {
  color: rgba(255,255,255,.66) !important;
}

/* Final workspace stacking fix: home and tool pages use separate layers. */
.main-stage {
  position: relative !important;
  height: calc(100vh - var(--nav-h)) !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

body:not([data-active-tab="home"]) .main-stage {
  margin-top: 0 !important;
  height: calc(100vh - var(--nav-h)) !important;
}

body[data-active-tab="home"] .main-stage {
  margin-top: 0 !important;
  height: 100vh !important;
}

.workspace {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  min-height: 0 !important;
  display: none !important;
  overflow: hidden !important;
}

.workspace.active {
  display: block !important;
}

body:not([data-active-tab="home"]) .workspace {
  top: var(--nav-h) !important;
  height: calc(100vh - var(--nav-h)) !important;
}

body[data-active-tab="home"] .workspace {
  top: 0 !important;
  height: 100vh !important;
}

body[data-active-tab="home"] #homePanel {
  z-index: 1 !important;
}

body[data-active-tab="home"] .home-floating-stage {
  position: relative !important;
  z-index: 1 !important;
}

body[data-active-tab="home"] .home-tool-cards {
  display: block !important;
  pointer-events: auto !important;
  z-index: 5 !important;
}

body[data-active-tab="home"] .home-tool-card {
  pointer-events: auto !important;
}

body[data-active-tab="home"] .home-tool-card:hover,
body[data-active-tab="home"] .home-tool-card:active,
body[data-active-tab="home"] .home-tool-card:focus-within {
  animation-play-state: paused !important;
}

body[data-active-tab="home"] .home-card-hit {
  position: absolute !important;
  inset: 0 !important;
  z-index: 20 !important;
  display: block !important;
  cursor: pointer !important;
  pointer-events: auto !important;
}

body[data-active-tab="home"] .home-card-copy,
body[data-active-tab="home"] .home-card-index,
body[data-active-tab="home"] .home-card-enter {
  pointer-events: none !important;
}

/* Final interaction repair: top pill and home entries must always be clickable. */
.sidebar,
body[data-active-tab="home"] .sidebar,
body:not([data-active-tab="home"]) .sidebar {
  pointer-events: none !important;
  z-index: 9000 !important;
}

.brand-block,
.global-pill-nav,
.global-pill-button,
.global-pill-menu,
.global-pill-option,
.home-reset {
  pointer-events: auto !important;
}

.global-pill-nav,
body[data-active-tab="home"] .global-pill-nav,
body:not([data-active-tab="home"]) .global-pill-nav {
  position: fixed !important;
  z-index: 10000 !important;
}

.global-pill-menu,
body[data-active-tab="home"] .global-pill-menu,
body:not([data-active-tab="home"]) .global-pill-menu {
  z-index: 10001 !important;
  pointer-events: auto !important;
}

body[data-active-tab="home"] #homePanel {
  display: block !important;
  pointer-events: none !important;
}

body[data-active-tab="home"] .home-floating-stage,
body[data-active-tab="home"] .home-tool-cards,
body[data-active-tab="home"] .home-tool-card,
body[data-active-tab="home"] .home-card-hit {
  visibility: visible !important;
  opacity: 1 !important;
}

body[data-active-tab="home"] .home-tool-cards {
  position: absolute !important;
  inset: 88px 5.5vw 52px !important;
  overflow: visible !important;
  pointer-events: auto !important;
}

body[data-active-tab="home"] .home-tool-card {
  position: absolute !important;
  left: min(calc(var(--x) * 1%), calc(100% - 340px)) !important;
  top: min(calc(var(--y) * 1%), calc(100% - 230px)) !important;
}

body[data-active-tab="home"] .home-tool-card.primary {
  left: min(calc(var(--x) * 1%), calc(100% - 520px)) !important;
  top: min(calc(var(--y) * 1%), calc(100% - 330px)) !important;
}

body[data-active-tab="home"] .home-tool-card.wide {
  left: min(calc(var(--x) * 1%), calc(100% - 430px)) !important;
  top: min(calc(var(--y) * 1%), calc(100% - 270px)) !important;
}

body[data-active-tab="home"] .home-tool-card,
body[data-active-tab="home"] .home-tool-card.primary,
body[data-active-tab="home"] .home-tool-card.wide,
body[data-active-tab="home"] .home-tool-card.medium,
body[data-active-tab="home"] .home-tool-card.small {
  display: grid !important;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 10 !important;
  color: rgba(255,255,255,.96) !important;
}

body[data-active-tab="home"] .home-tool-card:nth-child(1) { z-index: 13 !important; }
body[data-active-tab="home"] .home-tool-card:nth-child(2) { z-index: 12 !important; }
body[data-active-tab="home"] .home-tool-card:nth-child(3) { z-index: 12 !important; }
body[data-active-tab="home"] .home-tool-card:nth-child(4) { z-index: 11 !important; }
body[data-active-tab="home"] .home-tool-card:nth-child(5) { z-index: 11 !important; }

body[data-active-tab="home"] .home-tool-card[data-tool-id="sceneAdmin"] {
  width: 250px !important;
  min-height: 138px !important;
  left: min(calc(var(--x) * 1%), calc(100% - 250px)) !important;
  top: min(calc(var(--y) * 1%), calc(100% - 138px)) !important;
  padding: 18px !important;
  gap: 14px !important;
  border-radius: 20px !important;
  z-index: 12 !important;
}

body[data-active-tab="home"] .home-tool-card[data-tool-id="sceneAdmin"] .home-card-copy h2 {
  font-size: 26px !important;
}

body[data-active-tab="home"] .home-tool-card[data-tool-id="sceneAdmin"] .home-card-copy p {
  margin-top: 8px !important;
  font-size: 11px !important;
  line-height: 1.45 !important;
}

.language-toggle {
  position: fixed;
  top: 18px;
  right: 154px;
  z-index: 10020 !important;
  height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(255,255,255,.20);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.095), rgba(255,255,255,.030)),
    rgba(12,12,11,.46);
  color: rgba(255,255,255,.82);
  padding: 0 6px;
  font: 420 11px/1 "Plus Jakarta Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: .015em;
  backdrop-filter: blur(20px) saturate(1.18);
  -webkit-backdrop-filter: blur(20px) saturate(1.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 16px 38px rgba(0,0,0,.20);
}
.language-toggle:hover {
  color: rgba(255,255,255,.92);
  border-color: rgba(255,255,255,.26);
  background:
    linear-gradient(180deg, rgba(255,255,255,.11), rgba(255,255,255,.035)),
    rgba(12,12,11,.52);
}
.language-toggle span {
  min-width: 30px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: rgba(255,255,255,.58);
  transition: color .18s ease, background .18s ease, box-shadow .18s ease;
}
.language-toggle span.active {
  color: rgba(255,255,255,.92);
  background: rgba(255,255,255,.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}
.language-toggle i {
  display: none;
}

@media (max-width: 760px) {
  .language-toggle {
    right: 18px;
    top: 62px;
  }
}

.tool-page.active {
  display: grid !important;
}

.visual-forge-host.active {
  display: block !important;
}

.visual-forge-frame {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
}

/* Final language switch override: keep it visually aligned with Reset Layout in normal state. */
.language-toggle {
  height: 36px !important;
  min-width: 82px !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.025)),
    rgba(12,12,11,.48) !important;
  color: rgba(255,255,255,.82) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 16px 38px rgba(0,0,0,.20) !important;
  backdrop-filter: blur(20px) saturate(1.18) !important;
  -webkit-backdrop-filter: blur(20px) saturate(1.18) !important;
}

.language-toggle:hover {
  border-color: rgba(255,255,255,.24) !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.03)),
    rgba(12,12,11,.54) !important;
}

.language-toggle span {
  color: rgba(255,255,255,.58) !important;
  background: transparent !important;
  box-shadow: none !important;
  font-weight: 420 !important;
}

.language-toggle span.active {
  color: rgba(255,255,255,.94) !important;
  background: rgba(255,255,255,.10) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12) !important;
}
