@import url("https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600&family=Inter+Tight:wght@400;500;600&family=JetBrains+Mono:wght@400;500&family=Newsreader:ital,wght@1,400&display=swap");

/* ====================================================================
   ELAN palette — light (ported from tap-dashboard/globals.css)
   ==================================================================== */
:root {
  --bg: #ffffff;
  --bg-warm: #f4f3f6;
  --ink: #34303d;
  --ink-soft: #4a4654;
  --paper: #fbfafd;
  --rule: #34303d;
  --line: rgba(52, 48, 61, 0.12);
  --line-strong: rgba(52, 48, 61, 0.22);
  --brand: #00a4e9;
  --brand-soft: #8dd6f5;
  --brand-deep: #0080b8;
  --burgundy: #7a1d28;
  --yellow: #b8861f;
  --muted-foreground: #807c89;

  --font-sans: "Inter Tight", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-display: "Archivo", "Inter Tight", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-serif: "Newsreader", Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-warm);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  margin: 0;
}

/* ====================================================================
   App shell — sidebar + main card
   ==================================================================== */
.shell {
  display: flex;
  gap: 12px;
  padding: 12px;
  height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  width: 56px;
  background: var(--bg);
  border: 1px solid var(--line);
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.brand-tile {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: -0.01em;
}
.brand-tile::after {
  content: "";
  position: absolute;
  top: -1px;
  right: -1px;
  width: 6px;
  height: 6px;
  background: var(--brand);
}

.sidebar nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 0;
}
.nav-tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--muted-foreground);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.nav-tile:hover { background: var(--paper); color: var(--ink); }
.nav-tile.active {
  background: var(--ink);
  color: var(--bg);
}
.nav-tile.active::after {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  right: -1px;
  width: 2px;
  background: var(--brand);
}
.nav-tile svg { width: 16px; height: 16px; }

.sidebar-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.live-dot {
  width: 6px; height: 6px;
  background: var(--brand);
  border-radius: 999px;
  box-shadow: 0 0 0 3px rgba(0, 164, 233, 0.18);
  animation: elan-pulse 2s ease-in-out infinite;
}
@keyframes elan-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(0, 164, 233, 0.18); }
  50%      { box-shadow: 0 0 0 6px rgba(0, 164, 233, 0); }
}
.version {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(128, 124, 137, 0.7);
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--line);
}

/* Utility bar */
.utility-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 36px;
  padding: 0 32px;
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-foreground);
}
.utility-left, .utility-right {
  display: flex;
  align-items: center;
  gap: 20px;
}
.utility-bar .ink { color: var(--ink); display: inline-flex; align-items: center; gap: 8px; }
.utility-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
}
.utility-pill .dot {
  width: 4px; height: 4px;
  background: var(--brand);
  border-radius: 999px;
}

/* Main scroll area */
.content {
  flex: 1;
  overflow: auto;
  padding: 32px;
}
.content-inner {
  margin: 0 auto;
  max-width: 1320px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* ====================================================================
   Page header
   ==================================================================== */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--brand);
  border-radius: 999px;
}
.eyebrow.muted { color: var(--muted-foreground); }
.eyebrow.muted::before { background: var(--ink); opacity: 0.35; }

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}
.page-header h1 {
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 0.98;
  font-size: clamp(32px, 4vw, 48px);
  margin: 12px 0 12px;
}
.page-header .lede {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.55;
  max-width: 60ch;
  margin: 0;
}
.page-header .actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--ink);
}
.status-pill .dot {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--muted-foreground);
}
.status-pill.idle .dot { background: var(--muted-foreground); }
.status-pill.connecting .dot { background: var(--yellow); animation: elan-pulse 1.4s ease-in-out infinite; box-shadow: 0 0 0 3px rgba(184,134,31,0.18); }
.status-pill.live .dot { background: var(--brand); animation: elan-pulse 2s ease-in-out infinite; }
.status-pill.error { color: var(--burgundy); border-color: var(--burgundy); }
.status-pill.error .dot { background: var(--burgundy); }

/* ====================================================================
   Hairline grid (stats / config row)
   ==================================================================== */
.hairline-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
@media (max-width: 980px) { .hairline-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .hairline-grid { grid-template-columns: 1fr; } }

.cell {
  background: var(--bg);
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cell label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.elan-num {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
  font-size: clamp(28px, 3vw, 40px);
  color: var(--ink);
}
.elan-num .unit {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.45em;
  color: var(--brand);
  margin-left: 4px;
  letter-spacing: 0;
}

/* Inputs */
input[type="password"], input[type="text"], select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
}
input[type="password"]:focus, input[type="text"]:focus, select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 164, 233, 0.18);
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' fill='none' stroke='%2334303d' stroke-width='1.5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  cursor: pointer;
  border-radius: 0;
  transition: opacity .15s;
}
.btn:hover:not(:disabled) { opacity: 0.88; }
.btn.secondary {
  background: var(--bg);
  color: var(--ink);
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.key-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.key-row input { flex: 1; font-family: var(--font-mono); font-size: 12px; }
.key-help {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin-top: 4px;
}
.key-help.saved { color: var(--brand-deep); }

/* ====================================================================
   Transcript panels (two-up hairline grid)
   ==================================================================== */
.panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
@media (max-width: 820px) { .panels { grid-template-columns: 1fr; } }

.panel {
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 360px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
}
.panel-head .label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.panel-head .model {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  padding: 2px 8px;
}

.transcript {
  flex: 1;
  padding: 24px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-y: auto;
  max-height: 56vh;
  font-feature-settings: "ss01";
}
.transcript:empty::before {
  content: "Waiting for audio…";
  color: var(--muted-foreground);
  font-style: italic;
  font-family: var(--font-serif);
  font-size: 15px;
}

audio { display: none; }
