:root {
  --bg: #f4efe8;
  --bg-soft: #fbf8f3;
  --surface: rgba(255, 252, 247, 0.9);
  --surface-strong: rgba(255, 254, 251, 0.96);
  --line: rgba(92, 71, 45, 0.14);
  --text: #1f2a2e;
  --muted: #6e716d;
  --accent: #245c63;
  --accent-strong: #173d42;
  --accent-soft: rgba(36, 92, 99, 0.1);
  --good: #2f7a53;
  --bad: #b54c47;
  --warm: #c88f3d;
  --glow-accent: rgba(36, 92, 99, 0.16);
  --shadow: 0 24px 60px rgba(59, 44, 29, 0.12);
  --shadow-soft: 0 14px 30px rgba(59, 44, 29, 0.08);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --font-ui: "Aptos", "Segoe UI Variable", "Trebuchet MS", sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  min-height: 100dvh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(200, 143, 61, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(36, 92, 99, 0.12), transparent 26%),
    linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
  font-family: var(--font-ui);
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(31, 42, 46, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 42, 46, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.78), transparent 85%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.4), transparent 18%),
    radial-gradient(circle at 82% 16%, rgba(200, 143, 61, 0.1), transparent 14%),
    radial-gradient(circle at 55% 82%, rgba(36, 92, 99, 0.08), transparent 16%);
  opacity: 0.9;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  appearance: none;
  border: 0;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease,
    background 180ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.is-hidden {
  display: none !important;
}

.app-shell {
  position: relative;
  width: calc(100vw - 12px);
  max-width: 100vw;
  height: calc(100dvh - 12px);
  min-height: calc(100dvh - 12px);
  margin: 6px auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1.2fr) auto;
  gap: 8px;
  align-items: stretch;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: calc(var(--radius-xl) + 2px);
  background: linear-gradient(135deg, rgba(255, 253, 249, 0.96), rgba(248, 243, 235, 0.92));
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  animation: rise-in 360ms ease;
  overflow: hidden;
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent);
}

.topbar::after {
  content: "";
  position: absolute;
  inset: 10px auto auto -12%;
  width: 34%;
  height: 90px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: rotate(-10deg);
  pointer-events: none;
}

.toolbar-cluster {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.toolbar-cluster-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toolbar-cluster-body,
.topbar-left,
.topbar-center,
.topbar-right,
.drawer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar-cluster-metrics {
  justify-self: end;
}

.batch-pick-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.batch-count-input {
  width: 58px;
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent-strong);
  background: rgba(255, 255, 255, 0.72);
  font-weight: 800;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.batch-count-input:focus {
  outline: 2px solid var(--accent-soft);
  border-color: rgba(36, 92, 99, 0.42);
}

.topbar-left,
.topbar-center,
.topbar-right {
  min-width: 0;
}

.topbar-center {
  justify-content: flex-end;
}

.topbar-right {
  justify-content: flex-start;
}

.topbar-left {
  justify-content: flex-start;
}

.toolbar-select,
.drawer-field input,
.drawer-field select,
.chat-form textarea {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
}

.toolbar-select {
  min-width: 220px;
  max-width: min(420px, 34vw);
  flex: 1 1 240px;
  padding: 10px 12px;
}

.primary-button,
.ghost-button {
  padding: 10px 13px;
  border-radius: 12px;
  font-weight: 700;
  position: relative;
  overflow: hidden;
  font-size: 13px;
}

.primary-button {
  color: #f8fffe;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 14px 28px rgba(36, 92, 99, 0.24);
}

.ghost-button {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(36, 92, 99, 0.12);
}

.gpt-action-button {
  color: #8a5d12;
  background: linear-gradient(135deg, rgba(255, 243, 223, 0.98), rgba(255, 249, 238, 0.96));
  border-color: rgba(200, 143, 61, 0.24);
  box-shadow: 0 12px 24px rgba(200, 143, 61, 0.12);
  animation: pulse-gpt-button 2.4s ease-in-out infinite;
}

.stop-action-button {
  color: #8f3d34;
  background: linear-gradient(135deg, rgba(252, 232, 229, 0.98), rgba(255, 249, 247, 0.96));
  border-color: rgba(181, 76, 71, 0.2);
  box-shadow: 0 12px 24px rgba(181, 76, 71, 0.12);
}

.ghost-button-tight {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 11px;
}

.primary-button:hover,
.ghost-button:hover {
  box-shadow: 0 14px 28px rgba(36, 92, 99, 0.12);
}

.primary-button::after,
.ghost-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.24) 45%, transparent 70%);
  transform: translateX(-130%);
  transition: transform 320ms ease;
}

.primary-button:hover::after,
.ghost-button:hover::after {
  transform: translateX(130%);
}

.ghost-button.is-active {
  background: rgba(36, 92, 99, 0.12);
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 14%, rgba(229, 240, 236, 0.92), transparent 30%),
    radial-gradient(circle at 82% 70%, rgba(244, 214, 168, 0.55), transparent 34%),
    rgba(20, 31, 35, 0.68);
  backdrop-filter: blur(16px);
}

.auth-gate-card {
  width: min(440px, calc(100vw - 32px));
  padding: 28px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  background:
    linear-gradient(150deg, rgba(255, 253, 248, 0.98), rgba(238, 246, 242, 0.96)),
    #fffaf1;
  box-shadow: 0 34px 90px rgba(12, 25, 31, 0.38);
  animation: modal-rise 0.28s ease-out;
}

.auth-gate-kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.auth-gate-card h1 {
  margin: 8px 0 10px;
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 1.04;
  color: var(--accent-strong);
}

.auth-gate-card p {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.5;
}

.auth-gate-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-gate-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(36, 92, 99, 0.18);
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  font: inherit;
  letter-spacing: 0.04em;
  outline: none;
}

.auth-gate-input:focus {
  border-color: rgba(36, 92, 99, 0.44);
  box-shadow: 0 0 0 4px rgba(36, 92, 99, 0.1);
}

.auth-gate-error {
  min-height: 20px;
  margin: 10px 0 14px;
  color: var(--bad);
  font-size: 13px;
  font-weight: 700;
}

.auth-gate-submit {
  width: 100%;
  justify-content: center;
}

body.is-auth-locked .app-shell {
  pointer-events: none;
  user-select: none;
}

#toggle-helper-button.is-active {
  color: #f8fffe;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 10px 18px rgba(36, 92, 99, 0.18);
}

.metric-pill {
  min-width: 78px;
  padding: 6px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(36, 92, 99, 0.1);
  text-align: center;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.metric-pill::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, rgba(36, 92, 99, 0.58), rgba(200, 143, 61, 0.36));
}

.metric-pill span,
.summary-label,
.text-label,
.chat-role,
.drawer-field span,
.drawer-upload-field > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.metric-pill strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
}

.workbook-drawer {
  margin-top: 8px;
  padding: 10px 12px 12px;
  border-radius: 20px;
  background: rgba(255, 251, 246, 0.88);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  animation: rise-in 260ms ease;
}

.workbook-drawer.is-hidden {
  display: none;
}

.drawer-row {
  display: grid;
  grid-template-columns: minmax(360px, 500px) 160px 96px max-content max-content max-content auto;
  gap: 10px;
  align-items: end;
  justify-content: start;
}

.drawer-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.drawer-field.compact {
  width: auto;
}

.drawer-field input,
.drawer-field select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
}

.drawer-upload-field {
  position: relative;
  display: grid;
  grid-template-columns: max-content minmax(140px, 1fr);
  grid-template-areas:
    "label label"
    "button name";
  gap: 8px 12px;
  min-width: 0;
  width: 100%;
  min-height: 68px;
  padding: 10px 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(28, 53, 61, 0.94), rgba(20, 33, 39, 0.92));
  color: #f5fbfa;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 12px 24px rgba(20, 33, 39, 0.18);
}

.drawer-upload-field > span {
  color: rgba(229, 240, 237, 0.78);
}

.drawer-upload-field > span:first-of-type {
  grid-area: label;
}

.drawer-upload-field input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.drawer-upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  grid-area: button;
  justify-self: start;
  align-self: center;
  width: fit-content;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f8fffe;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.drawer-upload-button-label {
  display: inline-block;
  transform: translateY(10px);
}

.drawer-upload-field:hover {
  animation: pulse-upload-field 1.6s ease-in-out infinite;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 14px 28px rgba(20, 33, 39, 0.22),
    0 0 0 4px rgba(173, 198, 203, 0.12);
}

.drawer-upload-field:hover .drawer-upload-button {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.12));
  box-shadow: 0 10px 18px rgba(8, 12, 14, 0.18);
}

.drawer-upload-name {
  grid-area: name;
  align-self: center;
  color: #f8fffe;
  font-size: 12.5px;
  line-height: 1.35;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

#sheet-select {
  min-width: 0;
}

.drawer-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(36, 92, 99, 0.08);
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.drawer-checkbox-wide {
  min-width: 0;
}

.drawer-checkbox input {
  accent-color: var(--accent);
}

.drawer-checkbox span {
  font-size: 12px;
  letter-spacing: normal;
  text-transform: none;
}

#run-workbook-button {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 12px;
  align-self: end;
  white-space: nowrap;
}

.topbar-delete-root-button {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  font-size: 22px;
  line-height: 1;
  color: var(--bad);
}

.toolbar-helper {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 4px;
}

#toolbar-helper-rates {
  display: contents;
}

.toolbar-helper.is-hidden {
  display: none;
}

.toolbar-helper-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(36, 92, 99, 0.08);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  box-shadow: var(--shadow-soft);
}

.toolbar-helper-chip strong {
  color: var(--accent-strong);
  font-size: 11px;
}

.toolbar-helper-chip.is-currency {
  background: linear-gradient(135deg, rgba(234, 244, 242, 0.95), rgba(255, 255, 255, 0.86));
}

.toolbar-helper-chip.is-currency-note {
  max-width: 420px;
}

.toolbar-helper-action {
  justify-self: start;
}

.drawer-status {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(36, 92, 99, 0.07);
  color: var(--accent-strong);
  font-size: 11.5px;
}

.workbook-overlay {
  position: fixed;
  inset: 0;
  z-index: 24;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 24, 28, 0.28);
  backdrop-filter: blur(10px);
}

.workbook-overlay.is-hidden {
  display: none;
}

.workbook-overlay-card {
  display: grid;
  gap: 14px;
  min-width: min(560px, calc(100vw - 32px));
  max-width: min(560px, calc(100vw - 32px));
  padding: 24px 26px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 252, 247, 0.98), rgba(247, 242, 235, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.54);
  box-shadow: 0 30px 80px rgba(20, 33, 39, 0.24);
  justify-items: center;
  text-align: center;
}

.workbook-overlay-spinner {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 4px solid rgba(36, 92, 99, 0.14);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

.workbook-overlay-copy {
  display: grid;
  gap: 6px;
}

.workbook-overlay-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-strong);
}

.workbook-overlay-text {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.workbook-overlay-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.workbook-overlay-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(36, 92, 99, 0.08);
  color: rgba(110, 113, 109, 0.72);
  font-size: 12px;
  font-weight: 700;
}

.workbook-overlay-option::before {
  content: "○";
  font-size: 13px;
}

.workbook-overlay-option.is-active {
  color: var(--accent-strong);
  background: rgba(229, 240, 236, 0.92);
  border-color: rgba(36, 92, 99, 0.16);
}

.workbook-overlay-option.is-active::before {
  content: "✓";
}

.workbook-rules-modal {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(24, 31, 33, 0.4);
  backdrop-filter: blur(10px);
}

.workbook-rules-modal.is-hidden {
  display: none;
}

.workbook-rules-card {
  width: min(980px, calc(100vw - 32px));
  max-height: min(86vh, 920px);
  overflow: auto;
  padding: 24px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top left, rgba(229, 240, 236, 0.92), transparent 34%),
    linear-gradient(180deg, rgba(255, 253, 248, 0.99), rgba(246, 240, 232, 0.97));
  border: 1px solid rgba(255, 255, 255, 0.56);
  box-shadow: 0 34px 80px rgba(20, 33, 39, 0.28);
  animation: modal-rise 0.28s ease-out;
}

.workbook-rules-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.workbook-rules-head h2 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1.08;
  color: var(--accent-strong);
}

.workbook-rules-kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workbook-rules-summary {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(36, 92, 99, 0.12);
  background: rgba(255, 255, 255, 0.74);
  color: var(--accent-strong);
  line-height: 1.45;
}

.workbook-rules-summary.is-error {
  border-color: rgba(181, 76, 71, 0.18);
  background: rgba(252, 232, 229, 0.92);
  color: var(--bad);
}

.workbook-rules-summary.is-ok {
  border-color: rgba(69, 111, 84, 0.18);
  background: rgba(233, 244, 236, 0.92);
  color: #2f6945;
}

.workbook-rules-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
  margin-top: 18px;
}

.workbook-rules-panel {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(36, 92, 99, 0.1);
}

.workbook-rules-panel-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.workbook-rules-list {
  display: grid;
  gap: 12px;
  margin: 14px 0 0;
  padding: 0 0 0 18px;
  line-height: 1.55;
}

.workbook-rules-errors {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.workbook-rules-error {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(181, 76, 71, 0.18);
  background: rgba(252, 232, 229, 0.9);
  color: var(--bad);
  line-height: 1.45;
}

.workbook-rules-ok {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(69, 111, 84, 0.18);
  background: rgba(233, 244, 236, 0.9);
  color: #2f6945;
  line-height: 1.45;
}

.workbook-rules-meta {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.workbook-rules-meta strong {
  color: var(--accent-strong);
}

.workbook-rules-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

@keyframes modal-rise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.its-settings-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(26, 31, 33, 0.42);
  backdrop-filter: blur(8px);
}

.its-settings-modal.is-hidden {
  display: none;
}

.its-settings-card {
  width: min(1120px, calc(100vw - 32px));
  max-height: min(86vh, 960px);
  overflow: auto;
  padding: 24px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.98), rgba(248, 243, 235, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow);
}

.its-settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.its-settings-head h2 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1.1;
}

.its-settings-kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-module-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.settings-module-tab {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(36, 92, 99, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.settings-module-tab:hover {
  transform: translateY(-1px);
}

.settings-module-tab.is-active {
  color: var(--accent-strong);
  background: rgba(234, 245, 242, 0.96);
  border-color: rgba(36, 92, 99, 0.22);
}

.settings-module-pane.is-hidden {
  display: none;
}

.settings-module-summary {
  margin-bottom: 12px;
}

.its-status-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.its-status-item {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(36, 92, 99, 0.1);
}

.its-status-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.its-status-item strong {
  font-size: 14px;
  line-height: 1.35;
  word-break: break-word;
}

.its-status-item-wide {
  grid-column: span 2;
}

.its-status-note,
.its-startup-error {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(36, 92, 99, 0.08);
  line-height: 1.45;
}

.its-startup-error {
  color: var(--bad);
  border-color: rgba(181, 76, 71, 0.18);
  background: rgba(252, 232, 229, 0.9);
}

.its-startup-error.is-hidden {
  display: none;
}

.its-runtime-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(36, 92, 99, 0.12);
}

.its-runtime-toggle-title {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
}

.its-runtime-toggle p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.its-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.its-settings-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(420px, 1.25fr);
  gap: 16px;
  margin-top: 18px;
}

.its-settings-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(36, 92, 99, 0.1);
}

.its-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.its-panel-head h3 {
  margin: 0;
  font-size: 18px;
}

.its-field {
  display: grid;
  gap: 6px;
}

.its-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.its-field input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
}

.its-step-row {
  display: grid;
  gap: 10px;
}

.its-step-row.is-hidden {
  display: none;
}

.its-diagnostic-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(244, 250, 249, 0.78);
  border: 1px solid rgba(36, 92, 99, 0.12);
}

.its-diagnostic-title,
.its-diagnostic-subtitle {
  font-weight: 700;
}

.its-diagnostic-body {
  line-height: 1.5;
}

.settings-prewrap {
  white-space: pre-wrap;
  word-break: break-word;
}

.its-diagnostic-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.its-diagnostic-pre {
  min-height: 120px;
  margin: 0;
  padding: 12px;
  border-radius: 14px;
  background: rgba(31, 42, 46, 0.94);
  color: #eff7f5;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
  font-size: 12px;
  line-height: 1.45;
}

.carousel-strip {
  margin-top: 4px;
  flex: 0 0 auto;
  min-height: 0;
}

.row-carousel {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scroll-behavior: smooth;
}

.row-carousel::-webkit-scrollbar {
  height: 8px;
}

.row-carousel::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(36, 92, 99, 0.18);
}

.carousel-chip {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 96px;
  max-width: 124px;
  padding: 7px 8px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 18px rgba(65, 51, 30, 0.07);
  text-align: left;
  overflow: hidden;
  animation: chip-in 320ms ease both;
}

.carousel-chip::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(36, 92, 99, 0.46), rgba(200, 143, 61, 0.42));
  opacity: 0.28;
}

.carousel-chip::after {
  display: none;
}

.chip-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.chip-row {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  line-height: 1;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.chip-title {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 10.5px;
  line-height: 1.15;
  font-weight: 650;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.chip-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  padding: 2px 5px;
  border-radius: 999px;
  background: rgba(36, 92, 99, 0.08);
  color: var(--muted);
  font-size: 9px;
  line-height: 1;
  white-space: nowrap;
}

.chip-mark.is-queued,
.chip-mark.is-running,
.chip-mark.is-cancelling {
  color: #8a5d12;
  background: linear-gradient(135deg, rgba(255, 243, 223, 0.98), rgba(255, 249, 238, 0.96));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.45),
    0 0 0 4px rgba(200, 143, 61, 0.06);
}

.chip-mark.is-completed {
  color: var(--good);
  background: linear-gradient(135deg, rgba(226, 244, 232, 0.96), rgba(246, 252, 248, 0.94));
}

.chip-mark.is-error {
  color: var(--bad);
  background: linear-gradient(135deg, rgba(249, 231, 229, 0.96), rgba(255, 255, 255, 0.94));
}

.chip-mark.is-cancelled {
  color: #8f3d34;
  background: linear-gradient(135deg, rgba(252, 232, 229, 0.98), rgba(255, 249, 247, 0.96));
}

.chip-mark-spinner,
.status-spinner {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: 2px solid rgba(138, 93, 18, 0.2);
  border-top-color: currentColor;
  animation: spin 0.9s linear infinite;
}

.carousel-chip.is-current {
  border-color: rgba(23, 61, 66, 0.85);
  background: linear-gradient(135deg, rgba(36, 92, 99, 0.82), rgba(23, 61, 66, 0.88));
  box-shadow:
    0 14px 26px rgba(23, 61, 66, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.carousel-chip.is-current .chip-row,
.carousel-chip.is-current .chip-title {
  color: rgba(255, 255, 255, 0.95);
}

.carousel-chip.is-current .chip-mark {
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.carousel-chip.is-saved {
  border-color: rgba(47, 122, 83, 0.26);
  background: linear-gradient(135deg, rgba(224, 244, 231, 0.96), rgba(255, 255, 255, 0.94));
}

.carousel-chip.is-skipped {
  border-color: rgba(181, 76, 71, 0.26);
  background: linear-gradient(135deg, rgba(249, 231, 229, 0.96), rgba(255, 255, 255, 0.94));
}

.carousel-chip.is-running,
.carousel-chip.is-prefetched {
  border-color: rgba(200, 143, 61, 0.24);
}

.carousel-chip.is-running {
  background: linear-gradient(135deg, rgba(255, 244, 224, 0.96), rgba(255, 255, 255, 0.94));
}

.carousel-chip.is-prefetched {
  background: linear-gradient(135deg, rgba(224, 244, 231, 0.96), rgba(255, 255, 255, 0.94));
}

.carousel-chip.is-error {
  border-color: rgba(181, 76, 71, 0.26);
  background: linear-gradient(135deg, rgba(249, 231, 229, 0.96), rgba(255, 255, 255, 0.94));
}

.view-switcher {
  display: flex;
  gap: 8px;
  margin: 0;
  flex-wrap: wrap;
}

.topbar-view-switcher {
  margin-left: 2px;
}

.batch-status-banner {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid rgba(36, 92, 99, 0.12);
  background: rgba(255, 252, 247, 0.88);
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
  box-shadow: var(--shadow-soft);
}

.batch-status-banner.is-hidden {
  display: none;
}

.batch-status-banner[data-state="queued"],
.batch-status-banner[data-state="running"],
.batch-status-banner[data-state="cancelling"] {
  border-color: rgba(200, 143, 61, 0.26);
  background: linear-gradient(135deg, rgba(255, 244, 224, 0.96), rgba(255, 255, 255, 0.94));
  color: #8a5d12;
  animation: pulse-soft 1.8s ease-in-out infinite;
}

.batch-status-banner[data-state="completed"] {
  border-color: rgba(47, 122, 83, 0.24);
  background: linear-gradient(135deg, rgba(224, 244, 231, 0.96), rgba(255, 255, 255, 0.94));
}

.batch-status-banner[data-state="failed"] {
  border-color: rgba(181, 76, 71, 0.24);
  background: linear-gradient(135deg, rgba(249, 231, 229, 0.96), rgba(255, 255, 255, 0.94));
}

.batch-status-banner[data-state="cancelled"] {
  border-color: rgba(181, 76, 71, 0.2);
  background: linear-gradient(135deg, rgba(252, 232, 229, 0.98), rgba(255, 255, 255, 0.94));
  color: #8f3d34;
}

.view-tab {
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(36, 92, 99, 0.1);
  color: var(--accent);
  font-weight: 700;
  font-size: 12px;
}

.view-tab.is-active {
  color: #f8fffe;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 10px 18px rgba(36, 92, 99, 0.18);
}

.workspace-grid,
.table-view {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  align-self: stretch;
}

.workspace-grid {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(320px, 0.96fr) minmax(340px, 1.22fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 8px;
  margin-top: 6px;
  height: 0;
  align-items: stretch;
  overflow: hidden;
}

.workspace-grid.is-processing > .column {
  filter: blur(7px);
  transform: scale(0.992);
  opacity: 0.44;
  pointer-events: none;
  user-select: none;
  transition:
    filter 260ms ease,
    transform 260ms ease,
    opacity 260ms ease;
}

.case-progress-overlay {
  position: absolute;
  inset: 0;
  z-index: 16;
  display: grid;
  place-items: center;
  padding: 20px;
  pointer-events: none;
}

.case-progress-overlay.is-hidden {
  display: none;
}

.case-progress-card {
  width: min(560px, calc(100vw - 48px));
  display: grid;
  gap: 14px;
  padding: 22px 24px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(247, 250, 248, 0.88)),
    radial-gradient(circle at top left, rgba(194, 223, 215, 0.32), transparent 52%);
  box-shadow:
    0 24px 70px rgba(33, 67, 73, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
  pointer-events: auto;
}

.case-progress-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(36, 92, 99, 0.72);
}

.case-progress-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 144px;
  gap: 16px;
  align-items: center;
}

.case-progress-title {
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1.08;
  color: var(--accent-strong);
}

.case-progress-subtitle {
  margin-top: 8px;
  color: rgba(36, 92, 99, 0.72);
  font-size: 14px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@property --case-progress-value {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 0%;
}

.case-progress-ring {
  --case-progress-value: 0%;
  width: 144px;
  height: 144px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background:
    conic-gradient(
      from -90deg,
      var(--accent-strong) 0,
      var(--accent) var(--case-progress-value),
      rgba(36, 92, 99, 0.12) var(--case-progress-value),
      rgba(36, 92, 99, 0.12) 100%
    ),
    radial-gradient(circle at center, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.14));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.58),
    0 18px 42px rgba(36, 92, 99, 0.18);
  transition: --case-progress-value 0.9s ease;
}

.case-progress-ring-core {
  width: 104px;
  height: 104px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(248, 252, 251, 0.94);
  box-shadow:
    inset 0 0 0 1px rgba(36, 92, 99, 0.08),
    0 10px 28px rgba(36, 92, 99, 0.1);
  text-align: center;
  overflow: hidden;
}

.case-progress-ring-value {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 1;
  color: var(--accent-strong);
}

.case-progress-ring-value span {
  font-size: 18px;
  line-height: 1;
  opacity: 0.9;
}

.case-progress-stage-line {
  min-height: 22px;
  color: rgba(36, 92, 99, 0.9);
  font-size: 15px;
  font-weight: 600;
}

.case-progress-stage-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.case-progress-stage {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(36, 92, 99, 0.08);
  background: rgba(255, 255, 255, 0.64);
  color: rgba(36, 92, 99, 0.72);
  transition:
    transform 220ms ease,
    background 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease;
}

.case-progress-stage-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(36, 92, 99, 0.08);
}

.case-progress-stage-label {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.case-progress-stage.tone-done,
.case-progress-stage.tone-warn {
  color: rgba(26, 99, 78, 0.96);
  border-color: rgba(44, 130, 104, 0.18);
  background: rgba(232, 247, 240, 0.94);
}

.case-progress-stage.tone-active {
  color: rgba(28, 74, 86, 0.98);
  border-color: rgba(36, 92, 99, 0.22);
  background: rgba(228, 240, 242, 0.98);
  box-shadow: 0 10px 24px rgba(36, 92, 99, 0.12);
  transform: translateY(-1px);
}

.case-progress-stage.tone-active .case-progress-stage-dot {
  animation: case-progress-pulse 1.6s ease-in-out infinite;
}

.case-progress-stage.tone-error {
  color: rgba(164, 57, 67, 0.94);
  border-color: rgba(196, 74, 86, 0.2);
  background: rgba(253, 237, 239, 0.98);
}

.case-progress-note {
  font-size: 13px;
  line-height: 1.45;
  color: rgba(36, 92, 99, 0.66);
}

@keyframes case-progress-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 4px rgba(36, 92, 99, 0.08);
  }
  50% {
    transform: scale(1.18);
    box-shadow: 0 0 0 7px rgba(36, 92, 99, 0.12);
  }
}

.workspace-grid.is-chat-focus {
  gap: 10px;
  grid-template-columns: minmax(360px, 1.14fr) minmax(320px, 1fr);
}

.workspace-grid.is-chat-focus .media-column {
  display: none;
}

.workspace-grid.is-chat-focus .chat-column {
  flex: 1.18 1 0;
}

.workspace-grid.is-chat-focus .summary-column {
  flex: 1 1 0;
}

.workspace-grid.is-hidden,
.table-view.is-hidden {
  display: none;
}

.column {
  display: grid;
  gap: 8px;
  min-height: 0;
  min-width: 0;
  height: 100%;
  max-height: 100%;
  align-content: stretch;
}

.media-column {
  grid-template-rows: minmax(0, 0.62fr) minmax(0, 0.38fr);
}

.chat-column {
  grid-template-rows: minmax(0, 1fr);
}

.summary-column {
  grid-template-rows: minmax(0, 1fr);
}

.panel {
  position: relative;
  padding: 10px;
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  animation: rise-in 420ms ease;
  min-height: 0;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.7), transparent 72%);
}

.panel:hover {
  box-shadow:
    0 28px 70px rgba(59, 44, 29, 0.14),
    0 0 0 1px rgba(255, 255, 255, 0.35);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
  min-width: 0;
}

.chat-head-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.panel-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
}

.output-head-group {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.output-status-line {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.35;
}

.output-status-label {
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
}

.output-status-value {
  color: var(--accent-strong);
  font-weight: 600;
}

.output-status-sep {
  color: rgba(110, 113, 109, 0.55);
}

.small-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(36, 92, 99, 0.08);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.small-badge[data-state="running"] {
  background: rgba(200, 143, 61, 0.16);
  color: #7f5b1c;
  animation: pulse-soft 1.8s ease-in-out infinite;
}

.small-badge[data-state="queued"] {
  background: rgba(200, 143, 61, 0.16);
  color: #7f5b1c;
  animation: pulse-soft 1.8s ease-in-out infinite;
}

.small-badge[data-state="cancelling"] {
  background: rgba(200, 143, 61, 0.16);
  color: #7f5b1c;
  animation: pulse-soft 1.8s ease-in-out infinite;
}

.small-badge[data-state="error"] {
  background: rgba(181, 76, 71, 0.14);
  color: var(--bad);
}

.small-badge[data-state="running"]::before,
.small-badge[data-state="queued"]::before,
.small-badge[data-state="cancelling"]::before {
  content: "";
  width: 9px;
  height: 9px;
  margin-right: 6px;
  border-radius: 999px;
  border: 2px solid rgba(138, 93, 18, 0.2);
  border-top-color: currentColor;
  animation: spin 0.9s linear infinite;
}

.small-badge[data-state="completed"] {
  background: rgba(47, 122, 83, 0.14);
  color: var(--good);
}

.small-badge[data-state="cancelled"] {
  background: rgba(181, 76, 71, 0.14);
  color: #8f3d34;
}

.image-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 8px;
  height: 100%;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding-right: 2px;
  align-content: stretch;
}

.image-grid[data-layout="single"] {
  grid-template-columns: 1fr;
}

.image-grid[data-layout="double"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.image-grid[data-layout="grid"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.image-grid[data-layout="dense"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.image-tile {
  position: relative;
  overflow: hidden;
  min-height: 120px;
  height: 100%;
  aspect-ratio: auto;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(245, 247, 245, 0.98), rgba(229, 236, 233, 0.98));
  border: 1px solid rgba(36, 92, 99, 0.1);
  box-shadow: var(--shadow-soft);
  isolation: isolate;
}

.image-grid[data-layout="single"] .image-tile {
  min-height: min(320px, 42vh);
}

.image-grid[data-layout="double"] .image-tile {
  min-height: min(220px, 28vh);
}

.image-grid[data-layout="dense"] .image-tile {
  min-height: 110px;
}

.image-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), transparent 35%),
    radial-gradient(circle at top right, rgba(36, 92, 99, 0.08), transparent 26%);
  pointer-events: none;
}

.image-tile::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(16, 24, 26, 0.58), rgba(80, 94, 97, 0.78));
  z-index: 0;
}

.image-tile-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(36, 92, 99, 0.1);
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 700;
}

.image-tile img {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  bottom: 28px;
  width: calc(100% - 16px);
  height: calc(100% - 36px);
  display: block;
  object-fit: contain;
  transition: transform 220ms ease;
  z-index: 1;
}

.image-tile:hover img {
  transform: scale(1.04);
}

.image-tile span {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  padding: 4px 6px;
  border-radius: 10px;
  background: rgba(16, 24, 26, 0.58);
  color: #f8faf9;
  font-size: 9px;
  text-align: left;
  backdrop-filter: blur(8px);
  z-index: 1;
}

.analysis-panel {
  display: grid;
  grid-template-rows: auto 1fr;
}

.analysis-content,
.summary-panel,
.source-table-wrap {
  overflow: auto;
  min-height: 0;
  min-width: 0;
  padding-right: 4px;
}

.analysis-content {
  display: block;
}

.analysis-card,
.question-box,
.summary-card,
.support-item {
  position: relative;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(36, 92, 99, 0.08);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.question-box {
  margin-top: 2px;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.question-box::before {
  display: none;
}

.analysis-card::before,
.question-box::before,
.summary-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, rgba(36, 92, 99, 0.42), rgba(200, 143, 61, 0.42));
}

.analysis-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.analysis-card-index {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(36, 92, 99, 0.14), rgba(200, 143, 61, 0.18));
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 700;
}

.analysis-input-main {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.analysis-input-secondary {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
  font-size: 12px;
}

.analysis-input-body {
  margin-top: 6px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
}

.analysis-sheet {
  display: grid;
  gap: 0;
}

.analysis-block {
  padding: 6px 2px 10px;
  border-bottom: 1px solid rgba(36, 92, 99, 0.1);
}

.analysis-block:last-child {
  border-bottom: none;
  padding-bottom: 2px;
}

.analysis-label {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
}

.analysis-label-index {
  flex: 0 0 auto;
  min-width: 18px;
  color: var(--accent-strong);
  font-weight: 800;
}

.analysis-value {
  margin-top: 6px;
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.analysis-value-main {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
}

.analysis-value-secondary {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}

.analysis-value-detailed {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(36, 92, 99, 0.08);
  box-shadow: var(--shadow-soft);
}

.analysis-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.analysis-toggle-static {
  cursor: default;
}

.analysis-toggle-title {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
}

.analysis-toggle-meta {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(36, 92, 99, 0.08);
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 700;
}

.analysis-question-list,
.question-ordered-list {
  margin: 10px 0 0;
  padding-left: 22px;
  display: grid;
  gap: 8px;
}

.analysis-question-list li,
.question-ordered-list li {
  line-height: 1.45;
}

.analysis-hint {
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.analysis-hint code {
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(36, 92, 99, 0.08);
  color: var(--accent-strong);
}

.summary-text,
.chat-bubble p,
.support-item p,
.ecofee-note,
.source-table-note {
  margin: 8px 0 0;
  line-height: 1.45;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
}

.chat-panel {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.chat-panel > .panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.chat-messages {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 0;
  min-width: 0;
  overflow: auto;
  padding-right: 2px;
}

.chat-bubble {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
  animation: bubble-in 280ms ease both;
}

.chat-bubble.is-model {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(36, 92, 99, 0.08);
}

.chat-bubble.is-user {
  justify-self: end;
  background: linear-gradient(135deg, rgba(219, 236, 233, 0.96), rgba(243, 248, 247, 0.96));
  border: 1px solid rgba(36, 92, 99, 0.1);
}

.question-strip {
  display: grid;
  gap: 6px;
}

.question-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: fit-content;
  min-width: 0;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(36, 92, 99, 0.08);
  box-shadow: var(--shadow-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.question-toggle-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.question-toggle-count,
.question-toggle-caret,
.question-inline-badge,
.question-mini-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(36, 92, 99, 0.08);
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.question-inline-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
}

.question-inline-badge {
  border: 1px solid rgba(36, 92, 99, 0.08);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow-soft);
}

.question-mini-list {
  display: grid;
  gap: 5px;
}

.question-mini-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 6px 9px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(36, 92, 99, 0.08);
  box-shadow: var(--shadow-soft);
  text-align: left;
}

.question-mini-text {
  min-width: 0;
  color: var(--text);
  font-size: 11px;
  line-height: 1.35;
}

.chat-form {
  display: grid;
  gap: 7px;
  margin-top: 6px;
}

.chat-form textarea {
  width: 100%;
  min-height: 56px;
  max-height: 88px;
  padding: 9px 11px;
  resize: none;
  font-size: 12px;
}

.output-panel {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
}

.output-metric-section {
  display: grid;
  gap: 10px;
}

.output-canvas {
  min-height: 0;
  overflow: auto;
}

.output-canvas-body {
  position: relative;
  min-height: 100%;
  padding: 4px 2px 2px;
}

.output-canvas-body:empty::before {
  content: "Здесь будет писаться итоговая информация по товару.";
  position: absolute;
  top: 14px;
  left: 16px;
  right: 16px;
  color: rgba(110, 113, 109, 0.85);
  font-size: 12px;
  line-height: 1.45;
}

.output-report {
  display: grid;
  gap: 8px;
}

.output-section {
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(36, 92, 99, 0.08);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-soft);
}

.output-source-lines {
  display: grid;
  gap: 6px;
}

.output-line,
.output-line-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: baseline;
  line-height: 1.5;
  font-size: 11.5px;
}

.output-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.output-term {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.output-body {
  margin-top: 4px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.output-body.is-secondary,
.output-body.is-muted,
.output-body.is-small {
  color: var(--muted);
}

.output-body.is-small {
  font-size: 11.5px;
  line-height: 1.48;
}

.output-links,
.output-confidence,
.output-inline-status {
  font-size: 10px;
  color: var(--muted);
}

.output-links a {
  color: var(--accent);
  text-decoration: none;
}

.output-code-button {
  padding: 0;
  color: var(--accent-strong);
  background: transparent;
  border: none;
  font-size: 13px;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: rgba(36, 92, 99, 0.25);
  text-underline-offset: 2px;
}

.output-code-button.is-main {
  font-size: 14px;
}

.output-code-placeholder {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.output-inline-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(36, 92, 99, 0.08);
}

.output-sbory-markers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.output-code-section {
  display: grid;
  gap: 8px;
}

.output-code-headline {
  gap: 6px;
  align-items: center;
}

.output-code-stickerset {
  display: grid;
  gap: 6px;
  padding: 8px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(247, 250, 249, 0.94), rgba(240, 245, 243, 0.92));
  border: 1px solid rgba(36, 92, 99, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    0 12px 22px rgba(59, 44, 29, 0.05);
}

.output-code-metric-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.output-code-metric {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 7px;
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 250, 0.96));
  border: 1px solid rgba(36, 92, 99, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 8px 18px rgba(59, 44, 29, 0.05);
}

.output-code-metric span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.output-code-metric strong {
  color: var(--accent-strong);
  font-size: 12px;
  line-height: 1.1;
}

.output-code-metric em {
  width: 100%;
  margin-top: 1px;
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  line-height: 1.2;
}

.output-code-metric.has-formula {
  padding-top: 6px;
  padding-bottom: 6px;
  border-color: rgba(36, 92, 99, 0.14);
  background: linear-gradient(135deg, rgba(228, 240, 236, 0.98), rgba(248, 252, 251, 0.98));
}

.output-code-metric.has-formula strong {
  font-size: 12px;
}

.output-metric-grid,
.eco-result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.output-metric-card,
.eco-result-grid > div {
  padding: 7px 8px 6px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(248, 251, 250, 0.96), rgba(238, 244, 242, 0.96));
  border: 1px solid rgba(36, 92, 99, 0.08);
}

.output-metric-card span,
.eco-result-grid span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.output-metric-card strong,
.eco-result-grid strong {
  display: block;
  margin-top: 3px;
  color: var(--accent-strong);
  font-size: 12px;
  line-height: 1.35;
}

.output-metric-card.has-formula strong {
  font-size: 15px;
  line-height: 1.15;
}

.metric-detail-line {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.sbory-marker {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(245, 248, 247, 0.9));
  border: 1px solid rgba(36, 92, 99, 0.12);
  color: var(--text);
  font-size: 10px;
  line-height: 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 10px 18px rgba(59, 44, 29, 0.06);
}

.sbory-marker-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 12px;
  line-height: 1;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", var(--font-ui);
}

.sbory-marker strong {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.sbory-marker.tone-good {
  background: linear-gradient(135deg, rgba(226, 244, 232, 0.96), rgba(246, 252, 248, 0.94));
  border-color: rgba(47, 122, 83, 0.18);
  color: var(--good);
}

.sbory-marker.tone-warn {
  background: linear-gradient(135deg, rgba(255, 243, 223, 0.98), rgba(255, 249, 238, 0.96));
  border-color: rgba(200, 143, 61, 0.22);
  color: #8a5d12;
}

.sbory-marker.tone-neutral {
  background: linear-gradient(135deg, rgba(243, 247, 246, 0.96), rgba(255, 255, 255, 0.92));
  color: var(--muted);
}

.output-alternatives,
.eco-match-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.eco-year-switch {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 12px;
}

.eco-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.eco-toggle-button {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(36, 92, 99, 0.14);
  background: rgba(255, 255, 255, 0.88);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.eco-inline-hint {
  margin: 10px 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(36, 92, 99, 0.05);
  border: 1px solid rgba(36, 92, 99, 0.08);
}

.eco-inline-hint-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.eco-rate-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 700;
}

.eco-inline-hint-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.eco-year-button {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(36, 92, 99, 0.14);
  background: rgba(255, 255, 255, 0.88);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.eco-year-button.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  border-color: rgba(36, 92, 99, 0.5);
}

.output-alt-card,
.eco-match-card {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(36, 92, 99, 0.08);
}

.output-alt-head,
.eco-match-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.output-alt-metrics,
.eco-match-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.eco-match-card.is-selected {
  border-color: rgba(36, 92, 99, 0.22);
  background: linear-gradient(135deg, rgba(234, 244, 242, 0.98), rgba(255, 255, 255, 0.92));
}

.eco-match-short {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.eco-match-title {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.eco-match-eco-line {
  margin-top: 8px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.eco-subtitle {
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.eco-example-list {
  margin: 6px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.eco-example-box,
.eco-code-box,
.eco-footnote-box {
  margin-top: 6px;
  overflow: visible;
}

.eco-db-preview-box {
  margin-top: 6px;
  max-height: 240px;
  overflow: auto;
  padding-right: 4px;
}

.eco-code-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.eco-code-list span {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(36, 92, 99, 0.08);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
}

.eco-subtitle-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.eco-inline-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(36, 92, 99, 0.14);
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.eco-db-action-row {
  margin-top: 10px;
}

.eco-db-open-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid rgba(36, 92, 99, 0.16);
  background: linear-gradient(135deg, rgba(235, 244, 241, 0.98), rgba(252, 253, 252, 0.98));
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
}

.eco-match-params {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.eco-footnote-list {
  display: grid;
  gap: 6px;
}

.eco-footnote-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: start;
  color: var(--text);
  font-size: 11px;
  line-height: 1.45;
}

.eco-footnote-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(36, 92, 99, 0.08);
  color: var(--accent);
  font-weight: 700;
}

.eco-db-preview-list {
  display: grid;
  gap: 8px;
}

.eco-db-preview-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(36, 92, 99, 0.1);
  background: rgba(243, 247, 246, 0.72);
}

.eco-db-preview-main {
  min-width: 0;
}

.eco-db-preview-name {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.eco-db-preview-meta,
.eco-db-preview-footnotes {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.eco-db-preview-button {
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(36, 92, 99, 0.14);
  background: rgba(255, 255, 255, 0.9);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.eco-select-button {
  padding: 7px 9px;
  font-size: 11px;
  border-radius: 10px;
}

.eco-calc-panel {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(36, 92, 99, 0.14);
}

.eco-selection-card {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(36, 92, 99, 0.08);
  background: linear-gradient(135deg, rgba(250, 252, 251, 0.98), rgba(241, 247, 245, 0.94));
}

.eco-selection-kicker {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.eco-selection-title {
  margin-top: 6px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

.eco-selection-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.eco-calc-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.eco-field {
  display: grid;
  gap: 5px;
}

.eco-field span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.eco-field input,
.eco-field select {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(36, 92, 99, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  font-size: 12px;
}

.eco-actions {
  display: flex;
  align-items: end;
}

.eco-calc-button {
  width: 100%;
  justify-content: center;
}

.eco-result-card {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(36, 92, 99, 0.08);
  background: rgba(255, 255, 255, 0.82);
}

.eco-result-title {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.eco-result-grid-compact {
  margin-top: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stp-eco-band {
  display: grid;
  gap: 8px;
}

.stp-eco-item {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(36, 92, 99, 0.08);
  background: rgba(255, 255, 255, 0.74);
}

.stp-eco-item span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stp-eco-item strong {
  display: block;
  margin-top: 4px;
  color: var(--accent-strong);
  font-size: 13px;
  line-height: 1.4;
}

.stp-eco-item.is-total {
  background: linear-gradient(135deg, rgba(229, 240, 236, 0.96), rgba(250, 252, 251, 0.98));
  border-color: rgba(36, 92, 99, 0.14);
}

.output-support-section {
  display: grid;
  gap: 10px;
}

.output-ifcg-section {
  display: grid;
  gap: 8px;
}

.ifcg-support-toggle {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(36, 92, 99, 0.08);
  background: rgba(255, 255, 255, 0.82);
  text-align: left;
}

.ifcg-support-toggle span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ifcg-support-toggle strong {
  color: var(--accent-strong);
  font-size: 11.5px;
  line-height: 1.45;
}

.ifcg-support-toggle.tone-good {
  background: rgba(227, 243, 232, 0.96);
}

.ifcg-support-toggle.tone-warn {
  background: rgba(255, 244, 224, 0.96);
}

.ifcg-support-toggle.is-active {
  border-color: rgba(36, 92, 99, 0.22);
}

.support-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.support-preview-chip {
  display: grid;
  gap: 4px;
  align-content: start;
  min-width: 0;
  padding: 9px 10px;
  border-radius: 14px;
  border: 1px solid rgba(36, 92, 99, 0.08);
  background: rgba(255, 255, 255, 0.84);
  text-align: left;
  box-shadow: var(--shadow-soft);
}

.support-preview-chip span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.support-preview-chip strong {
  display: block;
  color: var(--accent-strong);
  font-size: 12px;
  line-height: 1.4;
}

.support-preview-chip.is-static {
  cursor: default;
  background: rgba(250, 251, 248, 0.94);
}

.support-preview-chip.is-accent {
  background: linear-gradient(135deg, rgba(229, 240, 236, 0.96), rgba(250, 252, 251, 0.98));
  border-color: rgba(36, 92, 99, 0.14);
}

.support-preview-chip.tone-good {
  background: linear-gradient(135deg, rgba(227, 243, 232, 0.96), rgba(253, 255, 254, 0.96));
}

.support-preview-chip.tone-warn {
  background: linear-gradient(135deg, rgba(255, 244, 224, 0.96), rgba(255, 252, 247, 0.96));
}

.support-preview-chip.is-active {
  border-color: rgba(36, 92, 99, 0.26);
  box-shadow:
    0 10px 22px rgba(36, 92, 99, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.support-detail-card,
.support-detail-empty {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(36, 92, 99, 0.08);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-soft);
}

.support-detail-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.support-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.support-detail-kicker {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.support-detail-headline {
  margin-top: 3px;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.45;
}

.support-detail-note,
.support-detail-subline {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.support-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.support-detail-grid > div {
  padding: 8px 9px;
  border-radius: 12px;
  background: rgba(248, 251, 250, 0.92);
  border: 1px solid rgba(36, 92, 99, 0.08);
}

.support-detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.support-detail-grid strong {
  display: block;
  margin-top: 3px;
  color: var(--accent-strong);
  font-size: 12px;
  line-height: 1.35;
}

.support-detail-section {
  margin-top: 12px;
}

.support-detail-title {
  color: var(--text);
  font-size: 11.5px;
  font-weight: 700;
}

.support-detail-list,
.support-detail-bullets {
  margin: 8px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
}

.support-detail-list code {
  padding: 1px 4px;
  border-radius: 6px;
  background: rgba(36, 92, 99, 0.08);
  color: var(--accent-strong);
}

.support-detail-links {
  margin-top: 10px;
}

.support-detail-links a {
  color: var(--accent);
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 700;
}

.ifcg-review-list {
  margin: 8px 0 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.ifcg-review-item {
  padding: 0;
}

.ifcg-review-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.ifcg-review-index {
  flex: 0 0 auto;
  min-width: 18px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.ifcg-review-link {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ifcg-review-link.is-static {
  text-decoration: none;
}

.ecofee-content {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.ecofee-note.is-secondary {
  color: var(--muted);
  font-size: 13px;
}

.ecofee-table-block {
  display: grid;
  gap: 8px;
}

.ecofee-table,
.source-table {
  width: 100%;
  border-collapse: collapse;
}

.ecofee-table th,
.ecofee-table td,
.source-table th,
.source-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(36, 92, 99, 0.08);
  vertical-align: top;
  text-align: left;
  font-size: 13px;
  line-height: 1.45;
}

.ecofee-table th,
.source-table th {
  color: var(--muted);
  font-weight: 700;
}

.source-table th,
.source-table td {
  min-width: 190px;
}

.source-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(247, 244, 238, 0.96);
}

.source-table thead th:first-child,
.source-table tbody th:first-child {
  min-width: 110px;
  max-width: 110px;
  white-space: nowrap;
  background: rgba(250, 247, 242, 0.96);
}

.source-table tbody th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
}

.source-table tbody tr:nth-child(odd) td {
  background: rgba(255, 255, 255, 0.32);
}

.source-table tbody tr:hover td,
.source-table tbody tr:hover th {
  background: rgba(36, 92, 99, 0.05);
}

.table-view {
  margin-top: 8px;
  min-height: 0;
}

.table-panel {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
}

.source-table-wrap {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 12px;
  overflow: hidden;
}

.source-table-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.source-table-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(36, 92, 99, 0.08);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.source-table-shell {
  overflow: auto;
  border-radius: 22px;
  border: 1px solid rgba(36, 92, 99, 0.08);
  background: rgba(255, 255, 255, 0.5);
}

.empty-state {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--muted);
  line-height: 1.45;
  font-size: 12px;
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 30px;
  background: rgba(8, 12, 14, 0.78);
  backdrop-filter: blur(10px);
}

.image-modal.is-hidden {
  display: none;
}

.image-modal img {
  max-width: min(92vw, 1600px);
  max-height: 88vh;
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.36);
  background: white;
}

.image-modal-close {
  position: fixed;
  top: 16px;
  right: 18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 28px;
  color: white;
  background: rgba(255, 255, 255, 0.16);
}

.eco-db-entry-modal {
  position: fixed;
  inset: 0;
  z-index: 24;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 12, 14, 0.52);
  backdrop-filter: blur(8px);
}

.eco-db-entry-modal.is-hidden {
  display: none;
}

.eco-db-entry-card {
  width: min(760px, 100%);
  max-height: min(86vh, 900px);
  overflow: auto;
  padding: 18px 18px 16px;
  border-radius: 24px;
  border: 1px solid rgba(36, 92, 99, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(245, 249, 248, 0.96));
  box-shadow: 0 28px 64px rgba(10, 32, 34, 0.22);
  animation: modal-rise 0.24s ease-out;
}

.eco-db-entry-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.eco-db-entry-head h2 {
  margin: 2px 0 0;
  color: var(--text);
  font-size: 24px;
}

.eco-db-entry-kicker,
.eco-db-modal-kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eco-db-entry-content {
  margin-top: 14px;
}

.eco-db-modal-title {
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.45;
}

.eco-db-modal-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.eco-db-modal-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 12px;
}

.eco-db-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.eco-db-modal-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.eco-db-modal-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(36, 92, 99, 0.08);
  background: rgba(255, 255, 255, 0.8);
}

.eco-db-modal-row-main {
  min-width: 0;
}

.eco-db-modal-row-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.eco-db-modal-row-meta,
.eco-db-modal-row-footnotes {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.eco-db-modal-field {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(36, 92, 99, 0.08);
}

.eco-db-modal-field span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.eco-db-modal-field strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}

.eco-footnote-box-modal {
  max-height: 180px;
}

.eco-db-modal-pre {
  margin: 6px 0 0;
  padding: 12px;
  border-radius: 14px;
  background: rgba(14, 26, 27, 0.94);
  color: rgba(236, 244, 243, 0.96);
  font-size: 12px;
  line-height: 1.55;
  overflow: auto;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes chip-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes bubble-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-soft {
  0%,
  100% {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  }
  50% {
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.6),
      0 0 0 5px rgba(200, 143, 61, 0.08);
  }
}

@keyframes pulse-gpt-button {
  0%,
  100% {
    box-shadow: 0 12px 24px rgba(200, 143, 61, 0.12);
  }
  50% {
    box-shadow:
      0 14px 28px rgba(200, 143, 61, 0.16),
      0 0 0 6px rgba(200, 143, 61, 0.06);
  }
}

@keyframes pulse-upload-field {
  0%,
  100% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.16),
      0 14px 28px rgba(20, 33, 39, 0.2),
      0 0 0 0 rgba(173, 198, 203, 0.1);
  }
  50% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.2),
      0 16px 30px rgba(20, 33, 39, 0.24),
      0 0 0 6px rgba(173, 198, 203, 0.14);
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 1180px) {
  .workspace-grid {
    display: grid;
    grid-template-columns: 1fr;
    height: auto;
  }

  .case-progress-overlay {
    position: sticky;
    top: 10px;
    inset: auto;
    z-index: 6;
    margin-bottom: 10px;
    padding: 0;
  }

  .workspace-grid.is-processing > .column {
    filter: blur(5px);
    opacity: 0.34;
  }

  .case-progress-card {
    width: 100%;
    padding: 18px;
  }

  .case-progress-head {
    grid-template-columns: 1fr;
  }

  .case-progress-ring {
    width: 128px;
    height: 128px;
    justify-self: center;
  }

  .case-progress-ring-core {
    width: 92px;
    height: 92px;
  }

  .case-progress-title {
    font-size: 24px;
  }

  .case-progress-ring-value {
    font-size: 30px;
  }

  .case-progress-ring-value span {
    font-size: 16px;
  }

  .chat-panel,
  .output-panel,
  .analysis-panel {
    height: auto;
  }

  .output-metric-grid,
  .eco-result-grid,
  .eco-calc-grid,
  .support-preview-grid,
  .support-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .eco-result-grid-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  html,
  body {
    overflow: auto;
  }

  .app-shell {
    height: auto;
    min-height: auto;
    display: block;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .toolbar-cluster-metrics {
    justify-self: stretch;
  }

  .topbar-center,
  .topbar-right {
    justify-content: flex-start;
  }

  .toolbar-select {
    min-width: 100%;
    max-width: 100%;
  }

  .drawer-row {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }

  .drawer-upload-field {
    grid-column: 1 / -1;
  }

  #run-workbook-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .drawer-checkbox,
  .drawer-field.compact {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100vw - 12px, 100%);
    margin: 8px auto 18px;
  }

  .topbar,
  .panel,
  .workbook-drawer {
    padding: 12px;
  }

  .toolbar-cluster {
    padding: 10px;
  }

  .toolbar-helper {
    padding: 0;
  }

  .drawer-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .drawer-upload-field,
  #run-workbook-button {
    grid-column: auto;
  }

  .workbook-overlay-card {
    min-width: 100%;
    max-width: 100%;
    padding: 20px 18px;
  }

  .its-settings-modal {
    padding: 12px;
  }

  .its-settings-card {
    width: min(100vw - 12px, 100%);
    max-height: calc(100vh - 24px);
    padding: 18px;
  }

  .settings-module-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .its-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .its-status-item-wide {
    grid-column: span 2;
  }

  .its-settings-layout,
  .its-diagnostic-split {
    grid-template-columns: 1fr;
  }

  .workbook-overlay-title {
    font-size: 20px;
  }

  .image-grid {
    grid-template-columns: 1fr 1fr;
    max-height: none;
  }

  .carousel-chip {
    min-width: 110px;
    max-width: 132px;
  }

  .output-metric-grid,
  .eco-result-grid,
  .eco-calc-grid,
  .support-preview-grid,
  .support-detail-grid {
    grid-template-columns: 1fr;
  }

  .eco-db-preview-item,
  .eco-db-modal-grid,
  .eco-db-modal-row {
    grid-template-columns: 1fr;
  }

  .eco-db-entry-card {
    padding: 16px;
  }

  .eco-db-entry-head {
    flex-direction: column;
  }
}

.workspace-mode-switch {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  justify-self: end;
  min-width: 148px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(36, 92, 99, 0.12);
  box-shadow: var(--shadow-soft);
}

.workspace-mode-option {
  position: relative;
  z-index: 1;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
}

.workspace-mode-option.is-active {
  color: var(--accent-strong);
}

.workspace-mode-thumb {
  position: absolute;
  inset: 3px auto 3px 3px;
  width: calc(50% - 3px);
  border-radius: 999px;
  background: rgba(229, 240, 236, 0.95);
  transition: transform 180ms ease;
  pointer-events: none;
}

.workspace-mode-option:first-child:not(.is-active) + .workspace-mode-option.is-active + .workspace-mode-thumb {
  transform: translateX(100%);
}

.workspace-mode-pane {
  min-width: 0;
  min-height: 0;
  height: 100%;
  grid-row: 2;
  align-self: stretch;
}

#agent-workspace {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  overflow: hidden;
}

#label-workspace {
  display: grid;
  align-content: start;
  gap: 12px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.label-stage-card,
.label-preview-shell,
.label-editor-shell {
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(36, 92, 99, 0.12);
  background: rgba(255, 255, 255, 0.66);
}

.label-stage-card h3,
.label-preview-head h3 {
  margin: 4px 0 6px;
  font-family: var(--font-display);
  color: var(--accent-strong);
}

.label-stage-card p,
.label-preview-empty,
.label-search-meta {
  color: var(--muted);
}

.label-stage-kicker,
.label-preview-kicker,
.workbook-download-kicker {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.label-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 10px;
}

.label-field {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.label-field-wide {
  grid-column: 1 / -1;
}

.label-field input,
.label-field textarea,
.label-form textarea {
  width: 100%;
  border: 1px solid rgba(36, 92, 99, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  outline: none;
}

.label-field input {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.label-field textarea,
.label-form textarea {
  min-height: 72px;
  padding: 10px;
  font-size: 12px;
  resize: vertical;
}

.label-editor-input {
  min-height: 120px;
  max-height: 240px;
  overflow-y: auto;
}

.label-form {
  gap: 6px;
  margin-top: 8px;
}

.label-form textarea {
  min-height: 60px;
}

.label-search-shell {
  position: relative;
}

.label-search-results {
  position: absolute;
  z-index: 12;
  inset: calc(100% + 6px) 0 auto;
  display: grid;
  gap: 6px;
  max-height: 260px;
  overflow: auto;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid rgba(36, 92, 99, 0.14);
  background: rgba(255, 253, 248, 0.98);
  box-shadow: var(--shadow-soft);
}

.label-search-item,
.label-search-state {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  text-align: left;
  background: rgba(229, 240, 236, 0.72);
  color: var(--accent-strong);
}

.label-preview-head,
.workbook-download-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.label-preview-card {
  display: grid;
  gap: 5px;
  min-height: 100px;
  margin-top: 10px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(245, 248, 246, 0.92);
  border: 1px dashed rgba(36, 92, 99, 0.18);
  line-height: 1.35;
}

.label-preview-line-strong {
  font-weight: 800;
}

.label-preview-gap {
  height: 6px;
}

.label-save-status {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(233, 244, 236, 0.9);
  color: #2f6945;
  font-size: 13px;
}

.workbook-download-modal {
  position: fixed;
  inset: 0;
  z-index: 58;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(24, 31, 33, 0.42);
  backdrop-filter: blur(10px);
}

.workbook-download-card {
  width: min(720px, calc(100vw - 32px));
  padding: 24px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 12% 8%, rgba(200, 143, 61, 0.18), transparent 30%),
    linear-gradient(180deg, rgba(255, 253, 248, 0.99), rgba(246, 240, 232, 0.97));
  border: 1px solid rgba(255, 255, 255, 0.58);
  box-shadow: 0 34px 80px rgba(20, 33, 39, 0.28);
}

.workbook-download-head h2 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  color: var(--accent-strong);
}

.workbook-download-summary {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(36, 92, 99, 0.12);
  background: rgba(255, 255, 255, 0.74);
  color: var(--accent-strong);
}

.workbook-download-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
}

.workbook-download-option {
  display: grid;
  gap: 10px;
  min-height: 160px;
  padding: 18px;
  text-align: left;
  border-radius: 24px;
  border: 1px solid rgba(36, 92, 99, 0.14);
  color: var(--accent-strong);
  background: linear-gradient(135deg, rgba(229, 240, 236, 0.94), rgba(255, 255, 255, 0.78));
}

.workbook-download-option.is-light {
  background: linear-gradient(135deg, rgba(255, 246, 231, 0.95), rgba(255, 255, 255, 0.82));
}

.workbook-download-option span {
  font-size: 16px;
  font-weight: 800;
}

.workbook-download-option strong {
  font-family: var(--font-display);
  font-size: 30px;
}

.workbook-download-option small,
.workbook-download-status {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.workbook-download-status {
  min-height: 20px;
  margin-top: 14px;
}

.manual-batch-modal {
  position: fixed;
  inset: 0;
  z-index: 59;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(24, 31, 33, 0.42);
  backdrop-filter: blur(10px);
}

.manual-batch-modal.is-hidden {
  display: none;
}

.manual-batch-card {
  width: min(640px, calc(100vw - 32px));
  padding: 24px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 12% 8%, rgba(56, 124, 120, 0.16), transparent 30%),
    linear-gradient(180deg, rgba(255, 253, 248, 0.99), rgba(246, 240, 232, 0.97));
  border: 1px solid rgba(255, 255, 255, 0.58);
  box-shadow: 0 34px 80px rgba(20, 33, 39, 0.28);
  animation: modal-rise 0.24s ease-out;
}

.manual-batch-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.manual-batch-head h2 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  color: var(--accent-strong);
}

.manual-batch-kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.manual-batch-summary,
.manual-batch-status {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(36, 92, 99, 0.12);
  background: rgba(255, 255, 255, 0.74);
  color: var(--accent-strong);
  line-height: 1.45;
}

.manual-batch-status.is-error {
  border-color: rgba(181, 76, 71, 0.18);
  background: rgba(252, 232, 229, 0.92);
  color: var(--bad);
}

.manual-batch-field {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
}

.manual-batch-field textarea {
  min-height: 96px;
  padding: 14px 16px;
  resize: vertical;
  border-radius: 18px;
  border: 1px solid rgba(36, 92, 99, 0.16);
  background: rgba(255, 255, 255, 0.88);
  color: var(--accent-strong);
  font: inherit;
}

.manual-batch-field textarea:focus {
  outline: none;
  border-color: rgba(36, 92, 99, 0.36);
  box-shadow: 0 0 0 3px rgba(56, 124, 120, 0.12);
}

.manual-batch-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}
