/* ==========================================================================
   TGSDORK Minimalist Dark Bento System (Sky Blue, White & Hot Pink)
   Faithful to the Calm, Borderless Matte Proportions of the Reference
   ========================================================================== */

:root {
  --bg-canvas: #06070a;
  --bg-shell: #0b0d12;
  --bg-rail: #101218;
  --surface: #151820;
  --surface-subtle: #1c202b;
  --surface-input: #11131a;

  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);

  --ink: #f8fafc;
  --ink-secondary: #949db0;
  --ink-muted: #626b7f;

  --sky-vivid: #38bdf8;
  --sky-deep: #0ea5e9;
  --sky-soft: rgba(56, 189, 248, 0.14);
  --sky-ink: #7dd3fc;

  --pink-vivid: #ff2e93;
  --pink-cta: #e11d74;
  --pink-cta-hover: #ff2e93;
  --pink-soft: rgba(255, 46, 147, 0.14);
  --pink-ink: #ff7ab8;

  --warning: #fbbf24;

  --radius-bento: 22px;
  --radius-md: 12px;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Newsreader', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --text: var(--ink);
  --text-secondary: var(--ink-secondary);
  --text-muted: var(--ink-muted);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

html, body {
  min-height: 100%;
  background: var(--bg-canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  z-index: 200;
  background: #ffffff;
  color: #090a0e;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  left: 16px;
}

:focus-visible {
  outline: 2px solid var(--sky-vivid);
  outline-offset: 2px;
}

/* Minimal White Brand Orb for TGSDORK Logo */
.brand-orb {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-orb img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.brand-orb.sm {
  width: 32px;
  height: 32px;
}

.brand-orb.sm img {
  width: 18px;
  height: 18px;
}

/* Minimal Pill Buttons */
.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  min-height: 38px;
  border-radius: 999px;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease, background-color 0.15s ease;
}

.btn-pill.sm {
  padding: 7px 14px;
  min-height: 34px;
  font-size: 12.5px;
}

.btn-white {
  background: #ffffff;
  color: #090a0e;
}

.btn-white:hover {
  background: #e2e8f0;
}

.btn-hot-pink {
  background: var(--pink-cta);
  color: #ffffff;
}

.btn-hot-pink:hover {
  background: var(--pink-cta-hover);
}

/* ==========================================================================
   MINIMAL MATTE BENTO CARDS & CIRCULAR ARROW ORBS (Reference Proportions)
   ========================================================================== */

.bento-card {
  position: relative;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.035);
  border-radius: var(--radius-bento);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 156px;
}

/* Signature Single Pure White Featured Card (Exact "Total revenue" Reference) */
.bento-card.card-white {
  background: #ffffff;
  border: none;
  color: #090a0e;
}

.bento-card.card-white .card-label {
  color: #525b6e;
}

.bento-card.card-white .card-stat strong {
  color: #090a0e;
}

.bento-card.card-white .card-foot {
  color: #7c8599;
}

.bento-card.card-white .mini-pill.sky {
  background: #e0f2fe;
  color: #0284c7;
}

.card-label {
  font-size: 13px;
  font-weight: 500;
  color: #8893a7;
  padding-right: 44px;
}

.card-stat {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: auto;
  margin-bottom: 6px;
}

.card-stat strong {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
}

.card-foot {
  font-size: 12px;
  color: #626b7f;
}

/* Restrained Tiny Trend Pills */
.mini-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.mini-pill.sky {
  background: var(--sky-soft);
  color: var(--sky-ink);
}

.mini-pill.pink {
  background: var(--pink-soft);
  color: var(--pink-ink);
}

/* ==========================================================================
   WEB STUDIO SHELL & QUIET MINIMAL SIDEBAR RAIL
   ========================================================================== */

.studio-outer-frame {
  max-width: 1440px;
  margin: 0 auto;
  padding: 12px;
  min-height: 100vh;
}

.app-shell {
  display: grid;
  grid-template-columns: 214px minmax(0, 1fr);
  gap: 16px;
  min-height: calc(100vh - 24px);
  align-items: start;
  background: var(--bg-shell);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 14px;
  transition: grid-template-columns 0.2s ease;
}

.app-shell.rail-collapsed {
  grid-template-columns: 68px minmax(0, 1fr);
}

.sidebar {
  background: var(--bg-rail);
  border-radius: 20px;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 18px;
  position: static;
  overflow: hidden;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 2px 6px 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #ffffff;
  min-width: 0;
}

.brand-name {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.rail-toggle-btn {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--surface-subtle);
  border: none;
  color: var(--ink-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.rail-toggle-btn:hover {
  color: #ffffff;
}

.app-shell:not(.rail-collapsed) .rail-toggle-btn svg {
  transform: rotate(180deg);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-btn {
  width: 100%;
  background: transparent;
  border: none;
  border-radius: 14px;
  color: var(--ink-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 12px;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-btn svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.nav-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
}

/* Signature Reference Active Pill: Pure Crisp White */
.nav-btn.active {
  background: #ffffff;
  color: #090a0e;
  font-weight: 600;
}
.nav-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
}

.nav-btn.active .nav-count {
  color: var(--pink-cta);
  font-weight: 700;
}

.sidebar-footer {
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.rail-exit-btn {
  width: 100%;
  border: none;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink-muted);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.rail-exit-btn:hover {
  color: #ffffff;
  background: rgba(244, 63, 94, 0.14);
}

.status-dot {
  margin-left: auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sky-vivid);
}

.status-dot.offline {
  background: var(--pink-vivid);
}

/* Slim Collapsed Rail */
.app-shell.rail-collapsed .brand-text,
.app-shell.rail-collapsed .nav-label,
.app-shell.rail-collapsed .nav-count,
.app-shell.rail-collapsed .status-dot {
  display: none;
}

.app-shell.rail-collapsed .brand-row {
  flex-direction: column;
  gap: 8px;
}

.app-shell.rail-collapsed .nav-btn,
.app-shell.rail-collapsed .rail-exit-btn {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

/* ==========================================================================
   MAIN STAGE & QUIET TOPBAR
   ========================================================================== */

.main-stage {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 6px 10px 10px 4px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  border: none;
  color: var(--ink-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
}

.icon-btn:hover {
  background: var(--surface-subtle);
  color: #ffffff;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 10px 3px 4px;
  border-radius: 999px;
  background: var(--surface);
}

.user-avatar-orb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--sky-vivid);
  color: #07131e;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.user-chip-email {
  font-size: 12px;
  color: var(--ink-secondary);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* Minimal Greeting Row & Actions */
.stage-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.stage-titles h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.stage-titles p {
  font-size: 13px;
  color: var(--ink-muted);
  margin-top: 2px;
}


/* Global Floating Live Progress Pill */
.global-progress-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: #ffffff;
  font-size: 12.5px;
  margin-bottom: 16px;
}

.live-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sky-vivid);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.35);
  flex-shrink: 0;
}

.progress-status-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--sky-ink);
  font-weight: 500;
}

.progress-link-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.progress-link-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   BENTO OVERVIEW DASHBOARD GRID
   ========================================================================== */

.ov-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.ov-stats-grid .bento-card {
  min-height: 126px;
  padding: 18px 20px;
}

.ov-live-jobs-panel {
  background: var(--surface);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
}

.ov-live-jobs-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ov-live-job-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.18s ease;
}

.ov-live-job-item:hover {
  border-color: rgba(56, 189, 248, 0.35);
}

.ov-live-job-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.ov-live-job-texts {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 4px;
  flex: 1;
}

.ov-live-job-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ov-live-job-detail {
  font-size: 12px;
  color: var(--sky-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ov-quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.ov-quick-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  font-family: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, background-color 0.18s ease;
}

.ov-quick-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-subtle);
  transform: translateY(-1px);
}

.ov-quick-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ov-quick-icon.sky {
  background: var(--sky-soft);
  color: var(--sky-ink);
}

.ov-quick-icon.pink {
  background: var(--pink-soft);
  color: var(--pink-ink);
}

.ov-quick-text {
  min-width: 0;
}

.ov-quick-text strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: #ffffff;
}

.ov-quick-text span {
  display: block;
  font-size: 11.5px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ov-recent-panel {
  padding: 20px 22px;
}
/* ==========================================================================
   FORMS & INNER TOOL PANELS
   ========================================================================== */

.studio-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.studio-right-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.panel {
  background: var(--surface);
  border-radius: var(--radius-bento);
  padding: 20px 22px;
  min-width: 0;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-title {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
}

.panel-subtitle {
  margin-top: 3px;
  font-size: 13px;
  color: var(--ink-muted);
}

.form-group {
  margin-bottom: 14px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-secondary);
  margin-bottom: 6px;
}

.label-hint {
  color: var(--ink-muted);
}

input[type="text"],
input[type="email"],
input[type="search"],
select,
textarea {
  width: 100%;
  background: var(--surface-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: #ffffff;
  font-family: inherit;
  font-size: 13.5px;
  padding: 10px 13px;
  min-height: 40px;
}

select option {
  background: #151820;
  color: #ffffff;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--sky-vivid);
}

input::placeholder,
textarea::placeholder {
  color: var(--ink-muted);
}

.file-input-compact {
  width: 100%;
  font-size: 12px;
  padding: 6px 10px;
  min-height: 40px;
  border-radius: 12px;
  border: 1px dashed var(--border-strong);
  background: var(--surface-input);
  color: var(--ink-secondary);
}

.file-input-compact::file-selector-button {
  border: none;
  background: var(--surface-subtle);
  color: #ffffff;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  margin-right: 10px;
  cursor: pointer;
}

.cover-box {
  background: var(--surface-input);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 16px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-secondary);
}

.checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--pink-cta);
}

.btn-primary {
  width: 100%;
  background: var(--pink-cta);
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 11px 20px;
  min-height: 42px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn-primary:hover:not(:disabled) {
  background: var(--pink-cta-hover);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--surface-subtle);
  border: none;
  color: #ffffff;
  border-radius: 999px;
  padding: 10px 16px;
  min-height: 38px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.actions-row.nowrap {
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.actions-cell {
  white-space: nowrap;
  text-align: right;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  min-height: 32px;
  border-radius: 999px;
  background: var(--surface-subtle);
  border: none;
  color: var(--ink-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.action-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.action-btn.accent {
  background: var(--pink-cta);
  color: #ffffff;
}

.action-btn.success {
  background: var(--sky-soft);
  color: var(--sky-ink);
}

.action-btn.danger {
  background: rgba(244, 63, 94, 0.12);
  color: #fda4af;
}

/* Pipeline Steps */
.pipeline-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.step-item,
.chat-prompt-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-input);
  border: 1px solid transparent;
  width: 100%;
  text-align: left;
  font-family: inherit;
  color: inherit;
}

.chat-prompt-btn {
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.chat-prompt-btn:hover {
  border-color: var(--border-strong);
  background: var(--surface-subtle);
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-subtle);
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #ffffff;
}

.step-desc {
  display: block;
  font-size: 11.5px;
  color: var(--ink-muted);
}

.step-item.active .step-num {
  background: var(--pink-cta);
  color: #ffffff;
}

.step-item.done .step-num {
  background: var(--sky-vivid);
  color: #07131e;
}

.log-console {
  margin-top: 12px;
  background: #08090c;
  color: var(--sky-ink);
  border-radius: 12px;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  max-height: 150px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.live-draft-box {
  margin-top: 12px;
  border-radius: 14px;
  background: var(--surface-input);
  overflow: hidden;
}

.live-draft-head {
  display: flex;
  justify-content: space-between;
  padding: 9px 12px;
  background: var(--surface-subtle);
  font-size: 12px;
}

.live-draft-body {
  padding: 12px;
  max-height: 220px;
  overflow-y: auto;
  font-family: var(--font-serif);
  font-size: 13.5px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.status-callout {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--surface-input);
  color: var(--sky-ink);
  font-size: 12.5px;
}

/* Dropzone & Reports */
.dropzone {
  border: 1px dashed var(--border-strong);
  border-radius: 16px;
  background: var(--surface-input);
  padding: 26px 18px;
  text-align: center;
  cursor: pointer;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--sky-vivid);
}

.dropzone-main {
  font-size: 13.5px;
  color: #ffffff;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.dropzone-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-muted);
}

.report-wrap {
  margin-top: 18px;
  min-width: 0;
}

.score-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--surface-input);
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 12px;
}

.score-number-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.score-big {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
}

.score-status-pill {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  background: var(--sky-soft);
  color: var(--sky-ink);
  white-space: nowrap;
}

.result-banner {
  background: var(--surface-subtle);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
  overflow-wrap: anywhere;
}

.result-banner-title {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
}

.result-banner-desc {
  font-size: 12.5px;
  color: var(--ink-secondary);
  margin: 4px 0 10px;
}

.metric-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.metric-box {
  background: var(--surface-input);
  border-radius: 14px;
  padding: 12px 14px;
  min-width: 0;
  overflow: hidden;
}

.metric-box-label {
  font-size: 12px;
  color: var(--ink-muted);
}

.metric-box-value {
  font-size: 22px;
  font-weight: 700;
  margin: 3px 0;
  color: #ffffff;
}

.metric-box-note {
  font-size: 11.5px;
  color: var(--ink-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.markdown-body {
  background: var(--surface-input);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.6;
  max-height: 360px;
  overflow-y: auto;
  overflow-x: auto;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.markdown-body h1 {
  font-size: 15px;
  font-weight: 700;
  margin: 10px 0 6px;
  color: #ffffff;
}

.markdown-body h2 {
  font-size: 14px;
  font-weight: 600;
  margin: 10px 0 6px;
  color: #ffffff;
}

.markdown-body h3 {
  font-size: 13px;
  font-weight: 600;
  margin: 8px 0 4px;
  color: #ffffff;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol {
  margin-bottom: 8px;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 18px;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin: 8px 0;
  display: block;
  overflow-x: auto;
}

.markdown-body th,
.markdown-body td {
  border: 1px solid var(--border-strong);
  padding: 6px 8px;
  text-align: left;
}

.markdown-body code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
  word-break: break-all;
}

/* ==========================================================================
   MINIMALIST ARCHIVE ("Order list" Screen 2 Reference)
   ========================================================================== */

.workspace-caps {
  margin-bottom: 16px;
}

.archive-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  background: var(--surface);
  padding: 10px 14px;
  border-radius: 16px;
}

.archive-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-input);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 13px;
  width: min(240px, 100%);
  color: var(--ink-muted);
}

.archive-search-wrap input {
  border: none;
  background: transparent;
  padding: 2px 0;
  min-height: 24px;
  font-size: 12.5px;
}

.archive-total-count {
  font-size: 12px;
  color: var(--ink-muted);
  margin-right: 4px;
}

.archive-toolbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sort-pill-select {
  width: auto;
  min-height: 32px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--surface-input);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--ink-secondary);
}

.archive-filter-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 5px 12px;
  min-height: 30px;
  border-radius: 999px;
  background: var(--surface);
  border: none;
  color: var(--ink-muted);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}

.filter-chip:hover {
  color: #ffffff;
}

.filter-chip.active {
  background: var(--surface-subtle);
  color: #ffffff;
  font-weight: 600;
}

.filter-clear-btn {
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
}

.bento-table-wrap {
  background: var(--surface);
  border-radius: 18px;
  overflow-x: auto;
}

.bento-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.bento-table thead th {
  background: rgba(255, 255, 255, 0.025);
  color: var(--ink-muted);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 16px;
  white-space: nowrap;
}

.bento-table tbody td {
  padding: 13px 16px;
  border-top: 1px solid var(--border);
  vertical-align: middle;
  color: var(--ink-secondary);
}

.bento-table tbody td:not(.doc-title-cell):not([colspan]) {
  white-space: nowrap;
}

.doc-title-cell strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #ffffff;
}

.doc-title-cell span {
  font-size: 11.5px;
  color: var(--ink-muted);
}

.status-pill,
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  background: var(--surface-subtle);
  color: var(--ink-secondary);
}

.status-pill.done,
.tag.done {
  background: var(--sky-soft);
  color: var(--sky-ink);
}

.status-pill.running,
.tag.running {
  background: var(--pink-soft);
  color: var(--pink-ink);
}


.tag.sky {
  background: var(--sky-soft);
  color: var(--sky-ink);
}

.tag.amber {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
}

.tag.cyan {
  background: rgba(6, 182, 212, 0.16);
  color: #22d3ee;
}

.tag.pink {
  background: var(--pink-soft);
  color: var(--pink-ink);
}
.drawer-panel {
  background: var(--surface-input);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.revise-chapter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.revise-chapter-bar select {
  width: auto;
  min-width: 170px;
  max-width: 240px;
  min-height: 34px;
  padding: 5px 10px;
  font-size: 12px;
}

.revise-chapter-bar input {
  flex: 1;
  min-width: 180px;
  min-height: 34px;
  padding: 5px 12px;
  font-size: 12px;
}

.empty-state {
  background: var(--surface);
  border-radius: 18px;
  padding: 38px 20px;
  text-align: center;
  color: var(--ink-muted);
}

/* Chat */
.chat-thread {
  background: var(--surface-input);
  border-radius: 14px;
  padding: 16px;
  min-height: 280px;
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.chat-empty {
  margin: auto;
  text-align: center;
  max-width: 40ch;
  color: var(--ink-muted);
  font-size: 13px;
}

.chat-msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.chat-msg.user {
  align-self: flex-end;
  background: var(--pink-cta);
  color: #ffffff;
}

.chat-msg.assistant {
  align-self: flex-start;
  background: var(--surface-subtle);
  color: var(--ink);
}

.chat-input-bar {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.chat-input-bar textarea {
  flex: 1;
  min-height: 50px;
}

.chat-send-btn {
  width: auto;
  padding: 10px 22px;
}

/* In-App Document Reader Modal */
.reader-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(4, 5, 8, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.reader-sheet {
  width: min(900px, 100%);
  max-height: calc(100vh - 40px);
  background: #0f121a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 32px 80px -20px rgba(0, 0, 0, 0.9);
  overflow: hidden;
}

.reader-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: #141722;
}

.reader-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.reader-badge {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.16);
  color: var(--sky-ink);
  text-transform: uppercase;
}

.reader-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reader-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.reader-body-wrap {
  padding: 28px 36px;
  overflow-y: auto;
  background: #0b0d13;
}

.reader-content {
  max-width: 760px;
  margin: 0 auto;
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.8;
  color: #e2e8f0;
}

.reader-content h1,
.reader-content h2,
.reader-content h3 {
  font-family: var(--font-sans);
  color: #ffffff;
}

.reader-content h1 {
  font-size: 22px;
  text-align: center;
  margin-bottom: 16px;
}

.reader-content h2 {
  font-size: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 6px;
  margin-top: 24px;
  margin-bottom: 12px;
}

.reader-content h2.chapter-heading {
  text-align: center;
  border-bottom: none;
  padding-bottom: 0;
  margin-top: 12px;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.reader-content h2.chapter-heading .chapter-num {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--sky-ink);
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.reader-content h2.chapter-heading .chapter-title {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
}

.reader-chapter-divider {
  margin: 36px 0 24px;
}

.reader-chapter-divider hr {
  border: none;
  border-top: 1px dashed rgba(255, 255, 255, 0.14);
}

.reader-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 13.5px;
}

.reader-content th,
.reader-content td {
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 8px 10px;
  text-align: left;
}

.reader-content th {
  background: rgba(255, 255, 255, 0.06);
  text-align: center;
  font-weight: 600;
}

/* Auth & Toast */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(6, 7, 10, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  padding: 26px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.auth-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.auth-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: var(--sky-ink);
}

.auth-card h2 {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
}

.auth-card p {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-muted);
  margin-bottom: 18px;
}

.otp-code-input {
  letter-spacing: 8px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 800;
  padding: 12px 14px;
}

.otp-code-hint {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  margin-bottom: 16px;
}

.otp-hint-title {
  font-size: 13px;
  font-weight: 600;
  color: #f8fafc;
  margin-bottom: 4px;
}

.otp-hint-title strong {
  color: var(--sky-ink);
}

.otp-hint-body {
  font-size: 12px;
  line-height: 1.55;
  color: #cbd5e1;
}

.otp-hint-body code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--sky-ink);
}

.auth-step2-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(400px, calc(100vw - 40px));
}

.toast {
  background: #131824;
  color: #f8fafc;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-left: 4px solid var(--sky-ink);
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 600;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}

.toast.success {
  border-color: rgba(52, 211, 153, 0.35);
  border-left-color: #34d399;
}

.toast.error {
  background: #221119;
  border-color: rgba(244, 63, 94, 0.45);
  border-left-color: #f43f5e;
  color: #ffe4e6;
}
/* Responsive */
@media (max-width: 1080px) {
  .ov-stats-grid,
  .ov-quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .studio-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .studio-outer-frame {
    padding: 8px;
  }

  .app-shell,
  .app-shell.rail-collapsed {
    grid-template-columns: 1fr;
    border-radius: 20px;
    padding: 10px;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 10px;
  }

  .rail-toggle-btn,
  .sidebar-footer {
    display: none;
  }

  .brand-row {
    padding-bottom: 8px;
  }

  .nav {
    flex-direction: row;
    overflow-x: auto;
  }

  .nav-btn {
    width: auto;
    white-space: nowrap;
    padding: 8px 12px;
    min-height: 36px;
  }

  .ov-stats-grid,
  .ov-quick-grid,
  .form-row-2,
  .metric-pair {
    grid-template-columns: 1fr;
  }

  .twin-center-orb {
    display: none;
  }
}

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