:root {
  color-scheme: dark;
  --bg: #07101d;
  --panel: rgba(17, 29, 48, 0.92);
  --panel-soft: rgba(24, 40, 65, 0.72);
  --text: #f4f7fb;
  --muted: #9baac0;
  --line: rgba(255, 255, 255, 0.09);
  --accent: #57d1a1;
  --accent-dark: #123c33;
  --warn: #f1bb62;
  --danger: #ff7a89;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 0%, rgba(53, 114, 146, 0.25), transparent 34rem),
    radial-gradient(circle at 100% 20%, rgba(55, 154, 115, 0.18), transparent 28rem),
    var(--bg);
}
button { font: inherit; }

.shell {
  width: min(100%, 920px);
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 18px max(28px, env(safe-area-inset-bottom));
}

.topbar, .section-heading, footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar { margin-bottom: 22px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.7rem, 6vw, 2.4rem); letter-spacing: -0.04em; }
h2 { margin-bottom: 6px; font-size: 1.22rem; }
.eyebrow { margin-bottom: 5px; font-size: 0.72rem; letter-spacing: 0.16em; color: var(--accent); font-weight: 800; }
.muted { margin-bottom: 6px; color: var(--muted); font-size: 0.9rem; }

.connection { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.86rem; white-space: nowrap; }
.dot { width: 10px; height: 10px; border-radius: 999px; box-shadow: 0 0 16px currentColor; }
.dot-wait { color: var(--warn); background: currentColor; }
.dot-ok { color: var(--accent); background: currentColor; }
.dot-error { color: var(--danger); background: currentColor; }

.card {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.hero { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.metric-card { display: flex; min-height: 128px; flex-direction: column; justify-content: center; }
.metric-card strong { margin: 8px 0; font-size: 1.45rem; }
.metric-card small, .metric-label { color: var(--muted); }
.metric-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }

.badge { border: 1px solid rgba(241, 187, 98, 0.35); border-radius: 999px; padding: 7px 10px; color: var(--warn); font-size: 0.75rem; white-space: nowrap; }
.actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.actions-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.button { min-height: 48px; border: 0; border-radius: 14px; padding: 12px 16px; color: var(--text); cursor: pointer; transition: transform 120ms ease, opacity 120ms ease; }
.button-compact { min-height: 38px; padding: 8px 12px; font-size: 0.82rem; }
.button:active:not(:disabled) { transform: scale(0.98); }
.button-primary { background: var(--accent); color: #062019; font-weight: 800; }
.button-secondary { border: 1px solid var(--line); background: var(--panel-soft); }
.button:disabled { cursor: not-allowed; opacity: 0.42; }
.notice { margin: 14px 0 0; padding: 12px 14px; border-radius: 14px; background: var(--accent-dark); color: #bfe9d9; font-size: 0.86rem; line-height: 1.45; }

.exports-card { margin-bottom: 14px; }
.exports-list { display: grid; gap: 10px; margin-top: 14px; }
.export-item { border: 1px solid var(--line); border-radius: 16px; padding: 13px 14px; background: var(--panel-soft); min-width: 0; }
.export-item-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.export-name { overflow-wrap: anywhere; line-height: 1.35; }
.export-meta { margin-top: 8px; color: var(--muted); font-size: 0.82rem; }
.export-detail { display: block; margin-top: 6px; color: #c5d1e2; overflow-wrap: anywhere; }
.status-pill { flex: 0 0 auto; border-radius: 999px; padding: 5px 8px; font-size: 0.68rem; white-space: nowrap; }
.status-ok { background: rgba(87, 209, 161, 0.14); color: var(--accent); }
.status-warn { background: rgba(241, 187, 98, 0.14); color: var(--warn); }
.status-neutral { background: rgba(155, 170, 192, 0.14); color: var(--muted); }

footer { padding: 18px 5px 0; color: var(--muted); font-size: 0.76rem; }

@media (max-width: 640px) {
  .hero { align-items: stretch; flex-direction: column; }
  .actions, .actions-two { grid-template-columns: 1fr; }
  .metric-card { min-height: 108px; }
  .section-heading { align-items: flex-start; }
  .export-item-header { flex-direction: column; }
}

@media (max-width: 520px) {
  html { font-size: 15px; }

  .shell {
    padding:
      max(12px, env(safe-area-inset-top))
      12px
      max(18px, env(safe-area-inset-bottom));
  }

  .topbar, .section-heading, footer { gap: 10px; }
  .topbar { margin-bottom: 12px; }
  h1 { font-size: 1.55rem; }
  h2 { margin-bottom: 4px; font-size: 1.04rem; }
  .eyebrow { margin-bottom: 3px; font-size: 0.62rem; letter-spacing: 0.13em; }
  .muted { margin-bottom: 4px; font-size: 0.79rem; line-height: 1.35; }
  .connection { gap: 6px; font-size: 0.74rem; }
  .dot { width: 8px; height: 8px; }

  .card { border-radius: 16px; padding: 13px; }
  .hero { gap: 10px; margin-bottom: 9px; }
  .hero .button { width: 100%; }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 9px;
  }
  .metric-card { min-height: 86px; padding: 11px; }
  .metric-card strong { margin: 5px 0; font-size: 1.12rem; }
  .metric-card small { font-size: 0.69rem; line-height: 1.25; }
  .metric-label { font-size: 0.65rem; letter-spacing: 0.06em; }

  .badge { padding: 5px 8px; font-size: 0.66rem; }
  .actions, .actions-two { gap: 8px; margin-top: 10px; }
  .button { min-height: 44px; border-radius: 12px; padding: 9px 12px; font-size: 0.86rem; }
  .button-compact { min-height: 36px; padding: 7px 10px; font-size: 0.74rem; }
  .notice { margin-top: 10px; padding: 9px 11px; border-radius: 12px; font-size: 0.76rem; line-height: 1.35; }

  .exports-card { margin-bottom: 9px; }
  .exports-list { gap: 7px; margin-top: 9px; }
  .export-item { border-radius: 12px; padding: 10px 11px; }
  .export-item-header { gap: 6px; }
  .export-name { font-size: 0.82rem; line-height: 1.28; }
  .export-meta { margin-top: 5px; font-size: 0.72rem; line-height: 1.3; }
  .export-detail { margin-top: 4px; font-size: 0.7rem; line-height: 1.25; }
  .status-pill { padding: 4px 7px; font-size: 0.61rem; }

  footer { padding: 12px 2px 0; font-size: 0.66rem; }
}

@media (max-width: 360px) {
  .grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 74px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
/* GPT Trainer: hide main document scrollbar; nested scroll containers stay unchanged. */
html,
body {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
