/* ──────────────────────────────────────────────────────────────────────────
   Ekho — integrated light/dark theme
   Variant A · Hall of Echoes (default :root)
   Variant B · Inner Sanctum   ([data-theme="sanctum"])
   ────────────────────────────────────────────────────────────────────────── */

:root {
  /* ─── Hall of Echoes tokens (daylight amphitheater) ───────────────── */
  --substrate:        oklch(0.935 0.018 80);
  --substrate-deep:   oklch(0.885 0.025 75);
  --substrate-deeper: oklch(0.840 0.030 73);
  --surface:          oklch(0.960 0.012 78);
  --surface-lit:      oklch(0.985 0.010 82);
  --rule:             oklch(0.720 0.030 68);
  --rule-soft:        oklch(0.810 0.025 72);

  --bronze:           oklch(0.50 0.090 62);
  --bronze-deep:      oklch(0.38 0.080 58);
  --bronze-lit:       oklch(0.62 0.135 72);
  --bronze-dim:       oklch(0.65 0.050 65);
  --electrum:         oklch(0.78 0.140 88);
  --ink:              oklch(0.30 0.025 60);
  --ink-strong:       oklch(0.38 0.060 60);
  --ink-soft:         oklch(0.52 0.040 62);
  --ink-faint:        oklch(0.62 0.030 65);
  --ink-recess:       oklch(0.72 0.025 70);

  /* speaker tints (warm-bronze family — no rainbow) */
  --tint-warm-red:    oklch(0.55 0.135 50);
  --tint-cool-red:    oklch(0.52 0.090 25);
  --tint-amber:       oklch(0.54 0.120 40);
  --tint-bronze:      oklch(0.58 0.100 65);
  --tint-pink:        oklch(0.50 0.080 30);
  --tint-gold:        oklch(0.56 0.095 55);
  --tint-ember:       oklch(0.50 0.110 45);
  --tint-sienna:      oklch(0.54 0.075 38);

  --error:            oklch(0.48 0.115 33);

  /* themed effect tokens (replace inline literals so dark mode can override) */
  --ring-hi:          oklch(1 0 0 / 0.55);
  --ring-hi-strong:   oklch(1 0 0 / 0.7);
  --ring-hi-soft:     oklch(1 0 0 / 0.30);
  --ring-hi-faint:    oklch(1 0 0 / 0.10);
  --shadow-soft:      oklch(0.30 0.040 60 / 0.18);
  --shadow-deep:      oklch(0.30 0.040 60 / 0.30);
  --glow-rim:         oklch(0.62 0.115 65 / 0.30);
  --glow-rim-soft:    oklch(0.62 0.115 65 / 0.18);
  --glow-rim-bright:  oklch(0.62 0.115 65 / 0.50);
  --surface-glass:    oklch(0.92 0.020 78 / 0.7);
  --surface-glass-soft: oklch(0.96 0.018 78 / 0.7);
  --surface-glass-quiet: oklch(0.92 0.022 78 / 0.5);
  --substrate-tint:   oklch(0.98 0.020 82 / 0.7);
  --noise-opacity:    0.55;
  --noise-blend:      multiply;

  /* SVG attribute tokens (4 hoisted from inline svg attrs) */
  --rings-opacity:    0.55;
  --spokes-opacity:   0.40;
  --bell-body-fill:   oklch(0.78 0.140 88 / 0.40);
  --bell-glow-stroke: oklch(0.62 0.130 75);

  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --dur:  300ms;

  color-scheme: light;
}

[data-theme="sanctum"] {
  /* ─── Inner Sanctum tokens (twilight oracular) ────────────────────── */
  --substrate:        oklch(0.165 0.012 60);
  --substrate-deep:   oklch(0.122 0.010 55);
  --substrate-deeper: oklch(0.092 0.008 50);
  --surface:          oklch(0.218 0.018 64);
  --surface-lit:      oklch(0.255 0.022 68);
  --rule:             oklch(0.305 0.022 60);
  --rule-soft:        oklch(0.245 0.018 60);

  --bronze:           oklch(0.62 0.115 65);
  --bronze-deep:      oklch(0.46 0.085 60);
  --bronze-lit:       oklch(0.78 0.155 75);
  --bronze-dim:       oklch(0.38 0.060 60);
  --electrum:         oklch(0.88 0.135 92);
  --ink:              oklch(0.82 0.020 70);
  --ink-strong:       oklch(0.86 0.025 70);
  --ink-soft:         oklch(0.62 0.040 70);
  --ink-faint:        oklch(0.45 0.028 65);
  --ink-recess:       oklch(0.34 0.020 60);

  --tint-warm-red:    oklch(0.66 0.135 55);
  --tint-cool-red:    oklch(0.62 0.085 28);
  --tint-amber:       oklch(0.60 0.115 42);
  --tint-bronze:      oklch(0.66 0.100 65);
  --tint-pink:        oklch(0.62 0.080 30);
  --tint-gold:        oklch(0.66 0.095 55);
  --tint-ember:       oklch(0.62 0.110 45);
  --tint-sienna:      oklch(0.66 0.075 38);

  --error:            oklch(0.52 0.105 35);

  --ring-hi:          oklch(0.40 0.035 70 / 0.18);
  --ring-hi-strong:   oklch(0.30 0.025 60 / 0.25);
  --ring-hi-soft:     oklch(0.30 0.025 60 / 0.20);
  --ring-hi-faint:    oklch(0.30 0.025 60 / 0.10);
  --shadow-soft:      oklch(0.04 0 0 / 0.35);
  --shadow-deep:      oklch(0.04 0 0 / 0.55);
  --glow-rim:         oklch(0.62 0.115 65 / 0.30);
  --glow-rim-soft:    oklch(0.62 0.115 65 / 0.18);
  --glow-rim-bright:  oklch(0.62 0.115 65 / 0.50);
  --surface-glass:    oklch(0.18 0.012 60 / 0.55);
  --surface-glass-soft: oklch(0.18 0.012 60 / 0.50);
  --surface-glass-quiet: oklch(0.13 0.010 55 / 0.45);
  --substrate-tint:   oklch(0.20 0.015 60 / 0.6);
  --noise-opacity:    0.80;
  --noise-blend:      overlay;

  --rings-opacity:    0.85;
  --spokes-opacity:   0.55;
  --bell-body-fill:   oklch(0.88 0.135 92 / 0.18);
  --bell-glow-stroke: oklch(0.88 0.135 92);

  color-scheme: dark;
}

/* ─── Base ────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; }
body {
  font-family: "Source Serif 4", serif;
  font-weight: 400;
  color: var(--bronze);
  background:
    radial-gradient(ellipse 1400px 900px at 50% -120px, var(--substrate-tint), transparent 60%),
    var(--substrate-deep);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }

/* ─── App grid ────────────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  height: 100%;
  position: relative;
}

/* Stone-grain noise overlay on substrate */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: var(--noise-opacity);
  mix-blend-mode: var(--noise-blend);
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='400' height='400'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.55  0 0 0 0 0.42  0 0 0 0 0.28  0 0 0 0.10 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
[data-theme="sanctum"] body::before {
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='600' height='600'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.012' numOctaves='3' stitchTiles='stitch' seed='4'/><feColorMatrix values='0 0 0 0 0.10  0 0 0 0 0.08  0 0 0 0 0.06  0 0 0 0.50 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='400' height='400'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.55  0 0 0 0 0.42  0 0 0 0 0.28  0 0 0 0.20 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 600px 600px, 400px 400px;
}

/* ─── Sidebar ─────────────────────────────────────────────────────── */
.sidebar {
  background: linear-gradient(180deg,
    oklch(0.890 0.026 76) 0%,
    oklch(0.860 0.030 73) 100%);
  border-right: 1px solid var(--rule-soft);
  box-shadow:
    inset -1px 0 0 var(--ring-hi-soft),
    4px 0 18px var(--shadow-soft);
  padding: 24px 0 22px;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.sidebar-header {
  padding: 0 22px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-header .logo-icon {
  width: 22px;
  height: 22px;
  color: var(--bronze);
  opacity: 0.88;
  flex-shrink: 0;
}
.app-name {
  font-family: "Cinzel", serif;
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: 0.34em;
  color: var(--bronze);
  text-shadow:
    0 1px 0 var(--ring-hi-strong),
    0 -1px 0 var(--shadow-soft);
}
.app-greek {
  font-family: "Cinzel", serif;
  font-weight: 400;
  font-size: 11.5px;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
}

/* theme toggle */
.theme-toggle {
  margin-left: auto;
  width: 26px;
  height: 26px;
  border: 1px solid var(--rule-soft);
  background: transparent;
  color: var(--ink-faint);
  border-radius: 2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all var(--dur) var(--ease);
}
.theme-toggle:hover {
  color: var(--bronze);
  border-color: var(--bronze-dim);
  box-shadow: 0 0 6px var(--glow-rim-soft);
}
.theme-toggle svg { width: 13px; height: 13px; }

.section-label {
  font-family: "Cinzel", serif;
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--ink-soft);
  text-transform: uppercase;
  padding: 16px 22px 12px;
  position: relative;
}
.section-label::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 22px;
  right: 22px;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    oklch(0.55 0.025 65 / 0.35) 20%,
    oklch(0.55 0.025 65 / 0.35) 80%,
    transparent);
}

/* Section count — italic word form beside section heading */
.section-count {
  font-family: "Source Serif 4", serif;
  font-style: italic;
  font-weight: 300;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--ink-recess);
  text-transform: none;
}
.section-count--queue {
  color: var(--bronze-dim);
  margin-left: 4px;
}

.sidebar-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.sidebar-footer {
  font-family: "Source Serif 4", serif;
  font-style: italic;
  font-weight: 300;
  font-size: 11px;
  color: var(--ink-recess);
  padding: 12px 22px 4px;
  margin: 0;
  text-align: left;
  line-height: 1.5;
}

.history-empty {
  font-family: "Source Serif 4", serif;
  font-style: italic;
  font-weight: 300;
  font-size: 12.5px;
  color: var(--ink-recess);
  padding: 18px 22px;
  text-align: left;
}

.history-item {
  position: relative;
  padding: 11px 22px 12px 26px;
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.history-item + .history-item::before {
  content: "";
  position: absolute;
  left: 22px; right: 22px; top: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent, oklch(0.55 0.025 65 / 0.30) 40%, oklch(0.55 0.025 65 / 0.30) 60%, transparent);
}
.history-item:hover {
  background: oklch(0.97 0.025 80 / 0.5);
}
.history-item.active {
  background: linear-gradient(90deg,
    oklch(0.98 0.025 80 / 0.85) 0%,
    oklch(0.95 0.020 78 / 0.40) 70%,
    transparent 100%);
}
.history-item.active::after {
  content: "";
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg,
    transparent 0%,
    var(--bronze-lit) 18%,
    var(--bronze) 50%,
    var(--bronze-lit) 82%,
    transparent 100%);
  box-shadow: 0 0 10px var(--bronze-lit);
}
.history-item .hi-row1 {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.hi-name {
  font-family: "Source Serif 4", serif;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ink-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0 0 3px;
  text-shadow: 0 1px 0 oklch(1 0 0 / 0.6);
  flex: 1;
  min-width: 0;
}
.hi-sub {
  font-family: "Source Serif 4", serif;
  font-size: 10.5px;
  color: var(--ink-recess);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0 0 4px;
  font-feature-settings: "onum";
}
.hi-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.lang-badge,
.hi-date,
.hi-words,
.hi-dur {
  font-family: "Source Serif 4", serif;
  font-style: italic;
  font-weight: 300;
  font-size: 10.5px;
  color: var(--ink-recess);
  font-feature-settings: "onum", "tnum";
}
.lang-badge {
  font-family: "Cinzel", serif;
  font-style: normal;
  font-weight: 500;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid var(--rule-soft);
  border-radius: 1.5px;
  padding: 1px 5px 1.5px;
  color: var(--ink-faint);
}
.hi-filed {
  font-size: 12px;
  opacity: 0.7;
  line-height: 1;
}

/* ─── Status pills ────────────────────────────────────────────────── */
.hi-pill {
  font-family: "Cinzel", serif;
  font-weight: 600;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 2px 7px 2.5px;
  border-radius: 1.5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1;
}
.hi-pill--queued {
  color: var(--bronze-deep);
  background: oklch(0.46 0.085 60 / 0.10);
  border: 1px solid oklch(0.46 0.085 60 / 0.35);
}
.hi-pill--running {
  color: oklch(0.38 0.080 58);
  background: oklch(0.62 0.115 65 / 0.18);
  border: 1px solid var(--bronze);
  box-shadow: inset 0 1px 0 var(--ring-hi), 0 1px 3px var(--shadow-soft);
  animation: pulse 2.4s var(--ease) infinite;
}
.hi-pill--cancelled {
  color: var(--ink-faint);
  background: transparent;
  border: 1px solid oklch(0.65 0.025 65);
  font-style: italic;
  letter-spacing: 0.08em;
  font-weight: 400;
}
.hi-pill--error {
  color: oklch(0.45 0.110 33);
  background: oklch(0.85 0.080 38 / 0.30);
  border: 1px solid oklch(0.48 0.115 33 / 0.55);
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

/* Untitled history rows — italic-muted primary text */
.history-item.no-title .hi-name {
  font-style: italic;
  color: var(--ink-soft);
  font-weight: 400;
}

/* Cancel button in sidebar row */
.hi-cancel {
  margin-left: auto;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-faint);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur) var(--ease);
  padding: 0;
  font-family: inherit;
}
.hi-cancel:hover {
  color: var(--bronze);
  border-color: var(--bronze);
  box-shadow: 0 2px 6px var(--glow-rim);
}

/* ─── Main + views ────────────────────────────────────────────────── */
.main {
  padding: 40px 56px 60px;
  position: relative;
  z-index: 1;
  height: 100%;
  overflow: hidden;
}
.view {
  display: flex;
  flex-direction: column;
}
.view.scroll {
  overflow-y: auto;
  max-height: 100%;
}

/* ─── UPLOAD view ─────────────────────────────────────────────────── */
#uploadView {
  align-items: center;
  padding-top: 24px;
  min-height: 660px;
}
.upload-eyebrow {
  font-family: "Cinzel", serif;
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--ink-recess);
  text-transform: uppercase;
  margin: 0 0 6px;
}
.upload-prompt {
  font-family: "Source Serif 4", serif;
  font-style: italic;
  font-weight: 300;
  font-size: 18px;
  color: var(--ink-soft);
  margin: 0 0 36px;
  text-align: center;
  max-width: 50ch;
  line-height: 1.4;
}

.upload-zone {
  width: 620px;
  max-width: 100%;
  height: 300px;
  position: relative;
  background: oklch(0.97 0.020 80 / 0.55);
  border: 1px solid var(--rule);
  box-shadow:
    inset 0 0 0 1px oklch(0.65 0.035 70 / 0.30),
    inset 0 2px 4px var(--shadow-soft),
    inset 0 -1px 0 var(--ring-hi-strong),
    0 18px 36px var(--shadow-soft);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  transition: all 240ms var(--ease);
}
.upload-zone input[type="file"] { display: none; }

.upload-zone .floor {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 620 300' fill='none' stroke='%23b07a3a' stroke-width='0.7'><g opacity='0.32'><path d='M310 300 m-300 0 a300 300 0 0 1 600 0'/><path d='M310 300 m-250 0 a250 250 0 0 1 500 0'/><path d='M310 300 m-200 0 a200 200 0 0 1 400 0'/><path d='M310 300 m-150 0 a150 150 0 0 1 300 0'/><path d='M310 300 m-100 0 a100 100 0 0 1 200 0'/><path d='M310 300 m-55 0 a55 55 0 0 1 110 0'/></g><g stroke-dasharray='3 7' opacity='0.22'><line x1='310' y1='300' x2='10' y2='10'/><line x1='310' y1='300' x2='610' y2='10'/><line x1='310' y1='300' x2='160' y2='5'/><line x1='310' y1='300' x2='460' y2='5'/><line x1='310' y1='300' x2='310' y2='-30'/></g></svg>");
  background-size: cover;
  background-position: bottom center;
  opacity: 0.85;
  transition: opacity 240ms var(--ease);
  pointer-events: none;
}
.upload-zone .focal {
  position: absolute;
  left: 50%; bottom: -3px;
  width: 4px; height: 4px;
  background: var(--bronze);
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 14px var(--bronze), 0 1px 3px oklch(0.30 0.040 60 / 0.40);
  transition: all 240ms var(--ease);
  pointer-events: none;
}
.upload-zone .focal::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 18px; height: 18px;
  border: 1px solid var(--bronze-deep);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.55;
}
.upload-text {
  position: relative;
  z-index: 2;
  text-align: center;
  transform: translateY(-18px);
  pointer-events: none;
  max-width: 100%;
  padding: 0 24px;
}
.upload-text h2 {
  font-family: "Cinzel", serif;
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.20em;
  color: var(--bronze);
  text-transform: uppercase;
  margin: 0 0 10px;
  text-shadow:
    0 1px 0 var(--ring-hi-strong),
    0 -1px 0 oklch(0.30 0.040 60 / 0.15);
}
.upload-text p {
  font-family: "Source Serif 4", serif;
  font-style: italic;
  font-weight: 300;
  font-size: 12.5px;
  color: var(--ink-faint);
  margin: 0;
  letter-spacing: 0.02em;
}
.upload-zone.is-over,
.upload-zone.drag-over {
  border-color: var(--bronze);
  box-shadow:
    inset 0 0 0 1px var(--bronze-deep),
    inset 0 0 24px oklch(0.62 0.115 65 / 0.12),
    0 0 0 1px var(--bronze) inset,
    0 8px 22px oklch(0.40 0.060 60 / 0.30);
}
.upload-zone.is-over .floor,
.upload-zone.drag-over .floor {
  opacity: 1;
  filter: brightness(1.3) saturate(1.2);
}
.upload-zone.is-over .focal,
.upload-zone.drag-over .focal {
  width: 8px; height: 8px;
  box-shadow: 0 0 18px var(--bronze), 0 2px 6px oklch(0.30 0.040 60 / 0.50);
}
/* File-selected state — visually unmistakable that the chamber is loaded */
.upload-zone.has-file {
  border-color: var(--bronze);
  box-shadow:
    inset 0 0 0 1px var(--bronze-deep),
    inset 0 0 32px oklch(0.62 0.115 65 / 0.10),
    inset 0 -1px 0 var(--ring-hi-strong),
    0 18px 36px var(--shadow-deep);
}
.upload-zone.has-file .floor {
  opacity: 0.55;
}
.upload-zone.has-file .focal {
  width: 7px;
  height: 7px;
  box-shadow: 0 0 20px var(--bronze-lit), 0 0 40px var(--bronze), 0 1px 3px oklch(0.30 0.040 60 / 0.40);
}
.upload-zone.has-file .focal::before {
  width: 26px;
  height: 26px;
  opacity: 0.75;
  border-color: var(--bronze);
}
.upload-zone.has-file .upload-text h2 {
  font-family: "Source Serif 4", serif;
  font-style: italic;
  font-weight: 400;
  font-size: 16px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-strong);
  text-shadow: 0 1px 0 var(--ring-hi);
}
.upload-zone.has-file .upload-text p {
  color: var(--bronze);
  font-style: normal;
  font-family: "Cinzel", serif;
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-top: 4px;
}
[data-theme="sanctum"] .upload-zone.has-file {
  border-color: var(--bronze-lit);
  box-shadow:
    inset 0 0 0 1px var(--bronze),
    inset 0 0 32px oklch(0.62 0.115 65 / 0.18),
    inset 0 -1px 0 oklch(0.06 0 0 / 0.6),
    0 0 26px oklch(0.62 0.115 65 / 0.25),
    0 22px 40px oklch(0.04 0 0 / 0.45);
}
[data-theme="sanctum"] .upload-zone.has-file .focal {
  box-shadow: 0 0 28px var(--bronze-lit), 0 0 56px var(--bronze);
}
[data-theme="sanctum"] .upload-zone.has-file .upload-text h2 {
  color: var(--bronze-lit);
  text-shadow: 0 0 16px oklch(0.62 0.115 65 / 0.20);
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 36px;
  padding: 18px 24px;
  border: 1px solid var(--rule-soft);
  border-radius: 2px;
  background: var(--surface-glass-quiet);
  box-shadow: inset 0 1px 0 var(--ring-hi), inset 0 -1px 0 oklch(0.45 0.060 60 / 0.10);
  min-width: 620px;
  max-width: 100%;
  flex-wrap: wrap;
}
.setting {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.setting label {
  font-family: "Cinzel", serif;
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.20em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.setting select,
.setting input[type="number"] {
  font-family: "Source Serif 4", serif;
  font-weight: 400;
  font-size: 13.5px;
  color: var(--bronze);
  background: transparent;
  border: 0;
  border-bottom: 1px dotted var(--rule);
  padding: 2px 6px 3px;
  cursor: pointer;
  font-feature-settings: "onum";
  outline: none;
  min-width: 60px;
}
.setting select { appearance: none; padding-right: 18px; }
.setting select:focus,
.setting input[type="number"]:focus {
  border-bottom-color: var(--bronze);
  color: var(--ink-strong);
}
.setting.hint-text span {
  font-family: "Source Serif 4", serif;
  font-style: italic;
  font-weight: 300;
  font-size: 11px;
  color: var(--ink-recess);
}
.settings-row .spacer { flex: 1; }

/* Auto-file toggle */
.setting--toggle { align-items: center; }
.toggle-label {
  font-family: "Cinzel", serif;
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  transition: color var(--dur) var(--ease);
}
.toggle-label:hover { color: var(--bronze); }
.toggle-check {
  appearance: none;
  width: 14px;
  height: 14px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: transparent;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: all var(--dur) var(--ease);
}
.toggle-check:checked {
  background: var(--bronze-deep);
  border-color: var(--bronze);
}
.toggle-check:checked::after {
  content: "";
  position: absolute;
  left: 3px; top: 0px;
  width: 5px; height: 9px;
  border: 1.5px solid var(--electrum);
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg);
}
[data-theme="sanctum"] .toggle-check:checked {
  background: oklch(0.34 0.065 60);
  border-color: var(--bronze-lit);
}

/* Primary "Transcribe" button */
.btn-primary,
#startBtn {
  font-family: "Cinzel", serif;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.20em;
  color: var(--electrum);
  text-transform: uppercase;
  padding: 11px 24px 11.5px;
  background: linear-gradient(180deg,
    oklch(0.58 0.105 64) 0%,
    oklch(0.44 0.090 60) 100%);
  border: 1px solid var(--bronze-deep);
  border-radius: 2px;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 oklch(0.85 0.140 72 / 0.55),
    inset 0 -1px 0 oklch(0.28 0.050 58 / 0.5),
    0 3px 8px var(--shadow-deep);
  transition: all var(--dur) var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-primary:hover:not(:disabled),
#startBtn:hover:not(:disabled) {
  box-shadow:
    inset 0 1px 0 oklch(0.92 0.145 78 / 0.75),
    inset 0 -1px 0 oklch(0.28 0.050 58 / 0.5),
    0 5px 14px oklch(0.40 0.075 60 / 0.40);
  transform: translateY(-1px);
}
.btn-primary:disabled,
#startBtn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.btn-primary svg, #startBtn svg { width: 14px; height: 14px; }

/* ─── PROGRESS view ───────────────────────────────────────────────── */
#progressView {
  align-items: center;
  padding-top: 30px;
  min-height: 660px;
}
.progress-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.progress-eyebrow {
  font-family: "Cinzel", serif;
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.30em;
  color: var(--bronze-dim);
  text-transform: uppercase;
  margin: 0 0 14px;
  position: relative;
  z-index: 2;
}
.progress-filename {
  font-family: "Source Serif 4", serif;
  font-weight: 600;
  font-size: 28px;
  color: var(--ink-strong);
  margin: 0 0 8px;
  text-align: center;
  font-feature-settings: "onum";
  max-width: 80%;
  word-break: break-word;
  text-shadow:
    0 1px 0 var(--ring-hi-strong),
    0 2px 10px var(--shadow-soft);
  position: relative;
  z-index: 2;
}
.progress-sub {
  font-family: "Source Serif 4", serif;
  font-style: italic;
  font-weight: 300;
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 36px;
  text-align: center;
  position: relative;
  z-index: 2;
}

.six-step {
  position: relative;
  width: 100%;
  max-width: 720px;
  height: 250px;
  margin: 8px 0 24px;
  overflow: hidden;  /* clip amphitheater rings to this box */
}
.six-step .amphitheater {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1180px;
  height: 1180px;
  transform: translate(-50%, -48%);
  pointer-events: none;
  mask-image: linear-gradient(180deg,
    rgba(0,0,0,0.95) 0%,
    rgba(0,0,0,0.80) 42%,
    rgba(0,0,0,0.30) 78%,
    rgba(0,0,0,0)    100%);
}
.six-step .amphitheater .rings {
  color: var(--bronze-deep);
  opacity: 0.62;
}
.six-step .amphitheater .spokes {
  color: var(--bronze-dim);
  opacity: 0.38;
}
.six-step .amphitheater .focal-dot {
  color: var(--bronze);
}

/* Bouncing-line baseline — PROCESS motif, sits above step nodes */
.six-step .baseline {
  position: absolute;
  left: 0; right: 0;
  bottom: 80px;
  height: 56px;
  pointer-events: none;
  overflow: visible;
}
.six-step .baseline .rest {
  stroke: var(--rule);
  opacity: 0.85;
}
.six-step .baseline .done-trace {
  stroke: var(--bronze);
  stroke-width: 1.2;
  fill: none;
  stroke-linecap: round;
  filter: drop-shadow(0 0 3px oklch(from var(--bronze) l c h / 0.45));
}
.six-step .baseline .pending-trace {
  stroke: var(--bronze-dim);
  stroke-width: 0.7;
  fill: none;
  stroke-dasharray: 2 5;
  opacity: 0.55;
}
.six-step .baseline .pulse {
  stroke: var(--bronze-lit);
  stroke-width: 1.2;
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 14 600;
  animation: pulseFlow 4.2s var(--ease) infinite;
  filter: drop-shadow(0 0 5px oklch(from var(--bronze-lit) l c h / 0.65));
}
@keyframes pulseFlow {
  0%   { stroke-dashoffset: 0;    opacity: 0; }
  8%   { opacity: 1; }
  72%  { opacity: 1; }
  100% { stroke-dashoffset: -560; opacity: 0; }
}

.steps {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.step {
  position: absolute;
  bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 110px;
  min-width: 0;
}
.step:nth-child(1) { left: 9.03%; }
.step:nth-child(2) { left: 25.42%; }
.step:nth-child(3) { left: 41.81%; }
.step:nth-child(4) { left: 58.19%; }
.step:nth-child(5) { left: 74.58%; }
.step:nth-child(6) { left: 90.97%; }

.step-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: oklch(0.90 0.022 78);
  border: 1px solid var(--rule);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 1px 2px var(--shadow-soft),
    0 2px 6px var(--shadow-soft);
  color: transparent;
  font-size: 0;
}
.step-dot::before {
  content: "";
  position: absolute;
  inset: -8px;
  border: 1px solid var(--rule-soft);
  border-radius: 50%;
  opacity: 0.6;
}
.step.done .step-dot {
  background: linear-gradient(180deg, var(--bronze) 0%, var(--bronze-deep) 100%);
  border-color: var(--bronze-deep);
  box-shadow:
    inset 0 1px 0 var(--bronze-lit),
    inset 0 -1px 0 oklch(0.25 0.050 58 / 0.5),
    0 2px 6px var(--shadow-deep);
}
.step.done .step-dot::after {
  content: "";
  width: 9px; height: 9px;
  background: oklch(0.30 0.050 60 / 0.7);
  border-radius: 50%;
  box-shadow: inset 0 1px 0 oklch(0.55 0.050 65 / 0.5);
  position: relative;
  z-index: 1;
}
.step.active .step-dot {
  background: linear-gradient(180deg, var(--bronze-lit) 0%, var(--bronze) 100%);
  border-color: var(--bronze-lit);
  box-shadow:
    inset 0 1px 0 oklch(0.88 0.110 78),
    inset 0 -1px 0 oklch(0.32 0.060 60 / 0.5),
    0 0 0 4px oklch(0.62 0.130 72 / 0.20),
    0 4px 12px oklch(0.40 0.080 60 / 0.40);
  animation: nodePulse 2.6s var(--ease) infinite;
}
@keyframes nodePulse {
  0%, 100% {
    box-shadow:
      inset 0 1px 0 oklch(0.88 0.110 78),
      inset 0 -1px 0 oklch(0.32 0.060 60 / 0.5),
      0 0 0 4px oklch(0.62 0.130 72 / 0.20),
      0 4px 12px oklch(0.40 0.080 60 / 0.40);
  }
  50% {
    box-shadow:
      inset 0 1px 0 oklch(0.88 0.110 78),
      inset 0 -1px 0 oklch(0.32 0.060 60 / 0.5),
      0 0 0 7px oklch(0.62 0.130 72 / 0.10),
      0 4px 12px oklch(0.40 0.080 60 / 0.30);
  }
}
.step:not(.done):not(.active) .step-dot {
  background: transparent;
  border-color: var(--rule-soft);
  opacity: 0.7;
}

.step-name {
  font-family: "Cinzel", serif;
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  color: var(--ink-soft);
  text-transform: uppercase;
  text-align: center;
}
.step.done .step-name, .step.active .step-name {
  color: var(--bronze);
  font-weight: 600;
}
.step.active .step-name {
  text-shadow: 0 1px 0 var(--ring-hi), 0 0 12px oklch(0.62 0.115 65 / 0.25);
}

/* Step ordinal index (italic Source Serif under the step name) */
.step-index {
  font-family: "Source Serif 4", serif;
  font-style: italic;
  font-size: 10px;
  color: var(--ink-recess);
  margin-top: -8px;
  white-space: nowrap;
}

/* Presence sigil — floats above the active step (pure geometry, no face/name) */
.sigil-presence {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 56px;
  pointer-events: none;
}
.sigil-presence .arcs {
  color: var(--bronze-dim);
  opacity: 0.7;
}
.sigil-presence .bounce {
  stroke: var(--bronze);
  stroke-width: 1.2;
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 8 200;
  animation: bounceTrace 3.6s var(--ease) infinite;
}
@keyframes bounceTrace {
  0%   { stroke-dashoffset: 180; opacity: 0; }
  10%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { stroke-dashoffset: -40; opacity: 0; }
}

.progress-track {
  width: 540px;
  max-width: 90%;
  height: 2px;
  background: oklch(0.72 0.030 68 / 0.55);
  position: relative;
  overflow: visible;
  margin: 0 auto;
  border-radius: 1px;
}
.progress-fill {
  position: absolute;
  left: 0; top: -1px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--bronze-deep) 8%,
    var(--bronze) 50%,
    var(--bronze-lit) 100%);
  transition: width 600ms var(--ease);
  box-shadow: 0 0 8px oklch(0.62 0.115 65 / 0.45);
}
.step-label-active {
  font-family: "Source Serif 4", serif;
  font-style: italic;
  font-weight: 400;
  font-size: 14px;
  color: var(--ink-soft);
  text-align: center;
  margin-top: 16px;
  font-feature-settings: "onum", "tnum";
  text-shadow: 0 1px 0 var(--ring-hi);
}

/* Progress filename extension — faint suffix split from stem */
.progress-filename .ext {
  font-size: 0.82em;
  color: var(--ink-recess);
  font-weight: 400;
  letter-spacing: 0.04em;
}

/* Progress footer: cancel + queue buttons */
.progress-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 32px;
}
.cancel-btn {
  font-family: "Cinzel", serif;
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.20em;
  color: var(--ink-recess);
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--rule-soft);
  padding: 9px 18px;
  cursor: pointer;
  border-radius: 2px;
  transition: all var(--dur) var(--ease);
}
.cancel-btn:hover {
  color: var(--error);
  border-color: var(--error);
}
.queue-more-btn {
  font-family: "Cinzel", serif;
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.20em;
  color: var(--ink-faint);
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--rule);
  padding: 9px 18px;
  cursor: pointer;
  border-radius: 2px;
  transition: all var(--dur) var(--ease);
}
.queue-more-btn:hover {
  color: var(--bronze);
  border-color: var(--bronze-dim);
}

/* ─── Inscription (smart-title H1 + bell-strike) ─────────────────── */
.inscription {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 0 0 8px;
}
.smart-title {
  font-family: "Cinzel", serif;
  font-weight: 500;
  font-size: 30px;
  letter-spacing: 0.05em;
  color: var(--bronze);
  text-transform: uppercase;
  line-height: 1.20;
  margin: 0;
  text-shadow:
    0 1px 0 var(--ring-hi),
    0 -1px 0 oklch(0.30 0.060 60 / 0.30),
    1px 0 0 oklch(0.30 0.060 60 / 0.10);
}

/* Bell-strike glyph — opacity 0 by default; .bell--ring fires the one-shot */
.bell {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  pointer-events: none;
  opacity: 0;
  margin-top: 2px;
  transform-origin: 50% 35%;
}
.bell--ring {
  animation: bellLife 5.4s var(--ease) 0.4s 1 forwards;
}
.bell .bloom {
  transform-origin: 50% 50%;
  opacity: 0;
}
.bell--ring .bloom {
  animation: bellBloom 1100ms var(--ease) 0.4s 1 forwards;
}
.bell--ring .bloom2 { animation-delay: 540ms; }
.bell .body { color: var(--bronze); }
.bell .body path { fill: var(--bell-body-fill); }
.bell .bloom-group { stroke: var(--bell-glow-stroke); }
@keyframes bellLife {
  0%   { opacity: 0; transform: scale(0.82); }
  8%   { opacity: 1; transform: scale(1.06); }
  14%  { transform: scale(1.0); }
  60%  { opacity: 1; }
  100% { opacity: 0; transform: scale(1.0); }
}
@keyframes bellBloom {
  0%   { opacity: 0; transform: scale(0.4); }
  20%  { opacity: 0.85; }
  100% { opacity: 0; transform: scale(2.4); }
}

/* Meta line: "Three voices · 1,247 words" below the inscription */
.meta-line {
  font-family: "Source Serif 4", serif;
  font-style: italic;
  font-weight: 300;
  font-size: 12.5px;
  color: var(--ink-faint);
  margin: 0 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.meta-line .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--ink-recess);
  flex-shrink: 0;
  display: inline-block;
}
.meta-line .roman {
  font-family: "Cinzel", serif;
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--bronze-dim);
  text-transform: uppercase;
}

/* Paths row: local + library location */
.paths-row {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin: -12px 0 18px;
  row-gap: 6px;
}
.path-entry {
  display: flex;
  align-items: center;
  gap: 7px;
}
.path-label {
  font-family: "Cinzel", serif;
  font-size: 8.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bronze-dim);
  flex-shrink: 0;
}
.path-val {
  font-family: ui-monospace, "SF Mono", "Fira Code", monospace;
  font-size: 10px;
  color: var(--ink-faint);
  word-break: break-all;
}
.path-copyable { cursor: pointer; transition: color 0.15s; }
.path-copyable:hover { color: var(--bronze-dim); }

/* ─── Audio player ────────────────────────────────────────────────── */
.audio-player {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 20px;
  max-width: 480px;
}
.audio-play-btn {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--bronze-dim);
  border-radius: 50%;
  color: var(--bronze-dim);
  cursor: pointer;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}
.audio-play-btn:hover {
  color: var(--bronze);
  border-color: var(--bronze);
  box-shadow: 0 0 6px var(--glow-rim);
}
.audio-track {
  flex: 1;
  height: 3px;
  background: var(--rule);
  border-radius: 2px;
  position: relative;
  cursor: pointer;
}
.audio-track:hover { background: var(--bronze-dim); opacity: 0.5; }
.audio-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: var(--bronze-dim);
  border-radius: 2px;
  transition: width 0.1s linear;
}
.audio-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 9px;
  height: 9px;
  background: var(--bronze);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.audio-track:hover .audio-thumb { opacity: 1; }
.audio-time, .audio-duration {
  font-family: "Cinzel", serif;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--bronze-dim);
  flex-shrink: 0;
  min-width: 3ch;
}
.audio-sep {
  font-family: "Source Serif 4", serif;
  font-size: 11px;
  color: var(--ink-recess);
  flex-shrink: 0;
}
/* Speaker timestamps become click targets when audio is loaded */
.speaker-ts {
  cursor: default;
  transition: color var(--dur) var(--ease);
}
#audioPlayer:not(.hidden) ~ .transcript-body .speaker-ts,
.speaker-ts {
  cursor: pointer;
}
.speaker-ts:hover { color: var(--bronze); }

/* Sanctum overrides */
[data-theme="sanctum"] .audio-play-btn {
  border-color: oklch(0.35 0.060 65 / 0.6);
  color: var(--bronze-dim);
}
[data-theme="sanctum"] .audio-play-btn:hover {
  border-color: var(--bronze);
  color: var(--bronze);
}

/* Title rule: solid-diamond · gradient line · hollow-diamond */
.title-rule {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 28px;
  width: 100%; /* overridden by JS to match title width */
  max-width: 100%;
}
.title-rule .cap {
  width: 7px;
  height: 7px;
  border: 1px solid var(--bronze-dim);
  transform: rotate(45deg);
  flex-shrink: 0;
}
.title-rule .cap.solid { background: var(--bronze-dim); }
.title-rule .line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--bronze-dim) 12%,
    var(--rule) 50%,
    var(--bronze-dim) 88%,
    transparent 100%);
}

/* ─── TRANSCRIPT view ─────────────────────────────────────────────── */
#transcriptView {
  position: relative;
}
#transcriptView::before {
  content: "";
  position: absolute;
  top: -120px; left: 50%;
  width: 1100px; height: 460px;
  transform: translateX(-50%);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1100 460' fill='none' stroke='%23b07a3a' stroke-width='0.6' opacity='0.5'><path d='M550 460 m-540 0 a540 540 0 0 1 1080 0'/><path d='M550 460 m-460 0 a460 460 0 0 1 920 0'/><path d='M550 460 m-380 0 a380 380 0 0 1 760 0'/><path d='M550 460 m-300 0 a300 300 0 0 1 600 0'/><path d='M550 460 m-220 0 a220 220 0 0 1 440 0'/><path d='M550 460 m-140 0 a140 140 0 0 1 280 0'/></svg>");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: top center;
  opacity: 0.13;
  pointer-events: none;
  mask-image: linear-gradient(180deg, black 0%, black 35%, transparent 90%);
  z-index: 0;
}
#transcriptView > * { position: relative; z-index: 1; }

.transcript-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 10px;
}
.transcript-meta {
  font-family: "Source Serif 4", serif;
  font-style: italic;
  font-weight: 300;
  font-size: 12.5px;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  width: 100%;
}
.meta-chip {
  font-family: "Source Serif 4", serif;
  font-style: italic;
  font-weight: 300;
  font-size: 12.5px;
  color: var(--ink-faint);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.meta-chip strong {
  font-family: "Cinzel", serif;
  font-style: normal;
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--bronze);
  text-transform: uppercase;
}
.meta-chip.meta-title {
  flex: 1 1 100%;
  margin-bottom: 6px;
}
.meta-chip.meta-title strong {
  font-size: 22px;
  letter-spacing: 0.04em;
  color: var(--bronze);
  text-shadow:
    0 1px 0 var(--ring-hi),
    0 -1px 0 oklch(0.30 0.060 60 / 0.30);
  line-height: 1.2;
}

/* Breadcrumb nav inside transcript-meta */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Cinzel", serif;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  flex-wrap: wrap;
}
.breadcrumb .crumb {
  color: var(--ink-soft);
  cursor: pointer;
  transition: color var(--dur) var(--ease);
}
.breadcrumb .crumb:hover {
  color: var(--bronze);
}
.breadcrumb .crumb.current {
  color: var(--bronze-dim);
  cursor: default;
}
.breadcrumb .crumb-sep {
  font-family: "Source Serif 4", serif;
  font-size: 13px;
  color: var(--ink-recess);
  letter-spacing: 0;
}

.transcript-actions {
  display: flex;
  align-items: stretch;
  gap: 2px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--surface-glass);
  padding: 1px;
  box-shadow: 0 1px 0 var(--ring-hi-strong) inset, 0 1px 2px var(--shadow-soft);
  align-self: flex-end;
}
.transcript-actions .btn,
.btn,
.btn-ghost {
  font-family: "Cinzel", serif;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--bronze-deep);
  background: transparent;
  border: 0;
  padding: 9px 14px 9.5px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all var(--dur) var(--ease);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.transcript-actions .btn + .btn::before,
.transcript-actions .btn-ghost + .btn-ghost::before,
.transcript-actions .btn-ghost + .btn-primary::before {
  content: "";
  position: absolute;
  left: -1.5px; top: 25%; bottom: 25%;
  width: 1px;
  background: var(--rule);
}
.btn:hover:not(:disabled),
.btn-ghost:hover:not(:disabled) {
  color: var(--bronze);
  background: oklch(0.99 0.012 82 / 0.8);
}
.btn:disabled,
.btn-ghost:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Actions row "primary" button (Send to Library / New) */
.transcript-actions .btn-primary {
  font-family: "Cinzel", serif;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--electrum);
  background: linear-gradient(180deg,
    oklch(0.55 0.095 64) 0%,
    oklch(0.42 0.085 60) 100%);
  border: 0;
  padding: 9px 14px 9.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow:
    inset 0 1px 0 oklch(0.78 0.130 72 / 0.55),
    inset 0 -1px 0 oklch(0.25 0.050 58 / 0.5),
    0 2px 6px var(--shadow-deep);
  transition: all var(--dur) var(--ease);
  border-radius: 1.5px;
}
.transcript-actions .btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg,
    oklch(0.60 0.105 66) 0%,
    oklch(0.46 0.090 60) 100%);
  transform: translateY(-1px);
}

.transcript-body {
  display: grid;
  grid-template-columns: 138px minmax(0, 70ch);
  column-gap: 28px;
  row-gap: 22px;
  align-items: start;
  margin-top: 8px;
}

.speaker-block {
  display: contents;
  animation: blockFade 380ms var(--ease) both;
}
@keyframes blockFade {
  from { opacity: 0; transform: translateY(2px); }
  to   { opacity: 1; transform: none; }
}

.speaker-header {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  padding-top: 4px;
}
.speaker-label {
  --tint: var(--tint-bronze);
  font-family: "Cinzel", serif;
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 4px 10px 4.5px;
  background: oklch(from var(--tint) calc(l + 0.40) c h / 0.32);
  color: var(--tint);
  border: 1px solid oklch(from var(--tint) calc(l + 0.18) c h / 0.55);
  border-radius: 2px;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  line-height: 1;
  text-shadow: 0 1px 0 var(--ring-hi);
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.40);
  display: inline-block;
}
.speaker-label:hover {
  color: oklch(from var(--tint) calc(l - 0.08) c h);
  border-color: oklch(from var(--tint) l c h);
  box-shadow:
    inset 0 1px 0 var(--ring-hi),
    0 3px 8px oklch(from var(--tint) calc(l - 0.20) c h / 0.30);
}
.speaker-rename-input {
  font-family: "Cinzel", serif;
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 4px 10px 4.5px;
  border-radius: 2px;
  background: transparent;
  border: 1px solid var(--bronze);
  outline: none;
  color: var(--bronze);
  width: auto;
  min-width: 80px;
  max-width: 130px;
}
.speaker-ts {
  font-family: "Source Serif 4", serif;
  font-style: italic;
  font-weight: 300;
  font-size: 11px;
  color: var(--ink-recess);
  letter-spacing: 0.02em;
  font-feature-settings: "onum", "tnum";
}
.speaker-text {
  font-family: "Source Serif 4", serif;
  font-style: italic;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.72;
  color: var(--ink);
  margin: 0;
  text-wrap: pretty;
}

/* Word spans for highlight sync */
.word {
  display: inline;
  border-radius: 2px;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.word-active {
  background: oklch(0.62 0.130 75 / 0.18);
  color: var(--bronze);
  border-radius: 2px;
}
[data-theme="sanctum"] .word-active {
  background: oklch(0.62 0.115 65 / 0.22);
  color: var(--bronze);
}

/* Audio speed button */
.audio-speed-btn {
  font-family: "Cinzel", serif;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--bronze-dim);
  background: none;
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 3px 7px;
  cursor: pointer;
  flex-shrink: 0;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.audio-speed-btn:hover {
  color: var(--bronze);
  border-color: var(--bronze-dim);
}
[data-theme="sanctum"] .audio-speed-btn {
  border-color: oklch(0.25 0.015 60);
  color: oklch(0.38 0.022 62);
}

/* Closure mark at end of transcript */
.closure {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  color: var(--ink-recess);
}
.closure .line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--rule) 0%, transparent 80%);
}
.closure .mark {
  font-family: "Cinzel", serif;
  font-size: 10px;
  letter-spacing: 0.30em;
  text-transform: uppercase;
}

/* ─── Mode tabs (Transcript / Wide Map / Deep Map) ───────────────── */
.mode-tabs {
  display: flex;
  gap: 0;
  margin: 28px 0 0;
  border-bottom: 1px solid var(--rule);
}
.mode-tab {
  font-family: "Cinzel", serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-recess);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 18px 12px;
  cursor: pointer;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
  margin-bottom: -1px;
}
.mode-tab:hover { color: var(--ink-soft); }
.mode-tab.active {
  color: var(--bronze);
  border-bottom-color: var(--bronze);
}

/* ─── Mode panel ──────────────────────────────────────────────────── */
.mode-panel { margin-top: 32px; }

.mode-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.mode-label {
  font-family: "Cinzel", serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bronze-dim);
}
.mode-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.mode-regenerate,
.mode-note-toggle {
  font-family: "Cinzel", serif;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-recess);
  background: none;
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 5px 10px;
  cursor: pointer;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.mode-regenerate:hover,
.mode-note-toggle:hover {
  color: var(--bronze-dim);
  border-color: var(--bronze-dim);
}
.mode-note-toggle.active {
  color: var(--bronze-dim);
  border-color: var(--bronze-dim);
}

/* ─── Job-level shared context ────────────────────────────────────── */
.job-context {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.job-context-toggle {
  font-family: "Cinzel", serif;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-recess);
  background: none;
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 5px 12px;
  cursor: pointer;
  align-self: flex-start;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.job-context-toggle:hover,
.job-context-toggle.active {
  color: var(--bronze-dim);
  border-color: var(--bronze-dim);
}
.job-context-toggle.has-content {
  color: var(--bronze-dim);
  border-color: var(--bronze-dim);
}
.job-context-toggle.has-content::before {
  content: "· ";
  color: var(--bronze);
}
.job-context-area { /* shown/hidden via .hidden class */ }
.job-context-input {
  width: 100%;
  max-width: 68ch;
  min-height: 60px;
  font-family: "Source Serif 4", serif;
  font-size: 14px;
  font-style: italic;
  font-weight: 300;
  color: var(--ink);
  background: var(--surface-glass);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 10px 14px;
  resize: vertical;
  outline: none;
  display: block;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.job-context-input::placeholder { color: var(--ink-recess); font-style: italic; }
.job-context-input:focus {
  border-color: var(--bronze-dim);
  box-shadow: 0 0 0 2px oklch(0.62 0.130 75 / 0.12);
}

/* ─── Mode correction note (per-mode override, kept for edge cases) ── */
.mode-note-area { margin-bottom: 20px; }
.mode-note-input {
  width: 100%;
  max-width: 68ch;
  min-height: 60px;
  font-family: "Source Serif 4", serif;
  font-size: 14px;
  font-style: italic;
  font-weight: 300;
  color: var(--ink);
  background: var(--surface-glass);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 10px 14px;
  resize: vertical;
  outline: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  display: block;
}
.mode-note-input::placeholder { color: var(--ink-recess); font-style: italic; }
.mode-note-input:focus {
  border-color: var(--bronze-dim);
  box-shadow: 0 0 0 2px oklch(0.62 0.130 75 / 0.12);
}

.mode-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 64px 0;
}
.mode-loading-label {
  font-family: "Cinzel", serif;
  font-size: 11px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--bronze-dim);
}
.mode-loading-hint {
  font-family: "Source Serif 4", serif;
  font-style: italic;
  font-size: 14px;
  color: var(--ink-faint);
}
.mode-error {
  padding: 40px 0;
  font-family: "Source Serif 4", serif;
  font-style: italic;
  font-size: 14px;
  color: var(--ink-recess);
}

/* ─── Mode body — rendered markdown ──────────────────────────────── */
.mode-body { max-width: 68ch; padding-bottom: 20px; }
.mode-closure {
  max-width: 68ch;
  padding: 36px 0 64px;
  text-align: center;
}
.mode-closure::before {
  content: "· · ·";
  font-family: "Cinzel", serif;
  font-size: 11px;
  letter-spacing: 0.45em;
  color: var(--bronze-dim);
  opacity: 0.55;
}
.mode-body h1 {
  font-family: "Cinzel", serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bronze);
  margin: 0 0 20px;
  line-height: 1.35;
}
.mode-body h2 {
  font-family: "Cinzel", serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--bronze-dim);
  margin: 36px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}
.mode-body h3 {
  font-family: "Source Serif 4", serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin: 24px 0 10px;
}
.mode-body p {
  font-family: "Source Serif 4", serif;
  font-size: 15.5px;
  line-height: 1.70;
  color: var(--ink);
  margin: 0 0 14px;
}
.mode-body ul {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}
.mode-body li {
  font-family: "Source Serif 4", serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-soft);
  padding: 4px 0 4px 22px;
  position: relative;
}
.mode-body li::before {
  content: "·";
  position: absolute;
  left: 7px;
  color: var(--bronze-dim);
  font-size: 18px;
  line-height: 1;
  top: 6px;
}
.mode-body blockquote {
  border-left: 2px solid var(--bronze-dim);
  margin: 8px 0 8px 12px;
  padding: 4px 0 4px 16px;
}
.mode-body blockquote p {
  font-family: "Source Serif 4", serif;
  font-style: italic;
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0 0 8px;
}
.mode-body blockquote p:last-child { margin-bottom: 0; }
.mode-body hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 28px 0;
}
.mode-body strong { font-weight: 600; color: var(--ink); }
.mode-body em { font-style: italic; }
.mode-body code {
  font-family: ui-monospace, "SFMono-Regular", monospace;
  font-size: 12px;
  color: var(--bronze-dim);
  background: var(--surface-glass);
  padding: 1px 5px;
  border-radius: 2px;
}

/* ─── Reduced motion ──────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .hi-pill--running { animation: none; }
  .step.active .step-dot { animation: none; }
  .speaker-block { animation: none; }
  .sigil-presence .bounce { animation: none; opacity: 0.55; }
  .six-step .baseline .pulse { animation: none; opacity: 0.4; }
  .bell, .bell--ring { animation: none !important; opacity: 0; }
  .bell .bloom, .bell--ring .bloom { animation: none !important; }
}

/* ──────────────────────────────────────────────────────────────────────────
   [data-theme="sanctum"] — rule-level overrides for inline literals that
   diverge between Hall (light) and Sanctum (dark). Everything not overridden
   here is already themed via :root tokens above.
   ────────────────────────────────────────────────────────────────────────── */

[data-theme="sanctum"] body {
  background:
    radial-gradient(ellipse 1400px 1000px at 50% -60px, oklch(0.26 0.030 68 / 0.70), transparent 55%),
    var(--substrate-deeper);
}

/* Directional light from upper-right — single-source chamber illumination */
[data-theme="sanctum"] .main {
  background:
    radial-gradient(ellipse 900px 560px at 62% -5%,
      oklch(0.30 0.028 70 / 0.28) 0%,
      oklch(0.20 0.015 65 / 0.08) 35%,
      transparent 65%);
}

[data-theme="sanctum"] .sidebar {
  background: linear-gradient(180deg,
    oklch(0.135 0.010 55 / 0.96) 0%,
    oklch(0.105 0.008 50 / 0.98) 100%);
  box-shadow:
    inset -1px 0 0 oklch(0.30 0.025 60 / 0.25),
    4px 0 24px oklch(0.05 0 0 / 0.35);
}
[data-theme="sanctum"] .app-name {
  text-shadow:
    0 1px 0 oklch(0.10 0 0 / 0.6),
    0 0 18px oklch(0.62 0.115 65 / 0.18);
}

[data-theme="sanctum"] .history-item + .history-item::before {
  background: linear-gradient(90deg,
    transparent, oklch(0.30 0.020 60 / 0.30) 40%, oklch(0.30 0.020 60 / 0.30) 60%, transparent);
}
[data-theme="sanctum"] .history-item:hover {
  background: oklch(0.22 0.018 65 / 0.32);
}
[data-theme="sanctum"] .history-item.active {
  background: linear-gradient(90deg,
    oklch(0.26 0.025 65 / 0.55) 0%,
    oklch(0.22 0.018 65 / 0.10) 70%,
    transparent 100%);
}
[data-theme="sanctum"] .hi-name {
  text-shadow: 0 1px 0 oklch(0.08 0 0 / 0.4);
}

[data-theme="sanctum"] .hi-pill--running {
  color: oklch(0.88 0.085 75);
  box-shadow: 0 0 12px oklch(0.62 0.115 65 / 0.35), inset 0 0 8px oklch(0.62 0.115 65 / 0.10);
}
[data-theme="sanctum"] .hi-pill--cancelled {
  border-color: oklch(0.30 0.018 60 / 0.6);
}
[data-theme="sanctum"] .hi-pill--error {
  color: oklch(0.72 0.105 35);
  background: oklch(0.52 0.105 35 / 0.10);
  border-color: oklch(0.52 0.105 35 / 0.45);
}
[data-theme="sanctum"] .hi-cancel:hover {
  color: var(--bronze-lit);
  box-shadow: 0 0 8px var(--bronze);
}

[data-theme="sanctum"] .upload-zone {
  background: oklch(0.135 0.010 55 / 0.55);
  box-shadow:
    inset 0 0 0 1px oklch(0.08 0 0 / 0.7),
    inset 0 1px 0 oklch(0.42 0.035 70 / 0.12),
    inset 0 -1px 0 oklch(0.06 0 0 / 0.6),
    0 22px 40px oklch(0.04 0 0 / 0.45);
}
[data-theme="sanctum"] .upload-zone .focal {
  box-shadow: 0 0 18px var(--bronze-lit), 0 0 36px var(--bronze);
}
[data-theme="sanctum"] .upload-text h2 {
  text-shadow:
    0 1px 0 oklch(0.08 0 0 / 0.85),
    0 0 22px oklch(0.62 0.115 65 / 0.22);
}
[data-theme="sanctum"] .upload-zone.is-over .floor,
[data-theme="sanctum"] .upload-zone.drag-over .floor {
  filter: brightness(1.6);
}
[data-theme="sanctum"] .upload-zone.is-over,
[data-theme="sanctum"] .upload-zone.drag-over {
  box-shadow:
    inset 0 0 0 1px var(--bronze),
    inset 0 0 30px oklch(0.62 0.115 65 / 0.15),
    0 0 28px oklch(0.62 0.115 65 / 0.30),
    0 22px 40px oklch(0.04 0 0 / 0.45);
}
[data-theme="sanctum"] .upload-zone.is-over .focal,
[data-theme="sanctum"] .upload-zone.drag-over .focal {
  box-shadow: 0 0 28px var(--bronze-lit), 0 0 56px var(--bronze);
}

[data-theme="sanctum"] .settings-row {
  background: oklch(0.13 0.010 55 / 0.45);
  box-shadow: none;
}

[data-theme="sanctum"] .btn-primary,
[data-theme="sanctum"] #startBtn {
  background: linear-gradient(180deg,
    oklch(0.46 0.090 60) 0%,
    oklch(0.34 0.070 58) 100%);
  border-color: var(--bronze);
  box-shadow:
    inset 0 1px 0 oklch(0.75 0.130 75 / 0.55),
    inset 0 -1px 0 oklch(0.10 0 0 / 0.6),
    0 0 22px oklch(0.62 0.115 65 / 0.25);
}
[data-theme="sanctum"] .btn-primary:hover:not(:disabled),
[data-theme="sanctum"] #startBtn:hover:not(:disabled) {
  box-shadow:
    inset 0 1px 0 oklch(0.82 0.140 80 / 0.7),
    inset 0 -1px 0 oklch(0.10 0 0 / 0.6),
    0 0 34px oklch(0.62 0.115 65 / 0.50);
}

[data-theme="sanctum"] .progress-filename {
  color: oklch(0.84 0.025 70);
}
[data-theme="sanctum"] .six-step .amphitheater .rings {
  color: var(--bronze);
  opacity: 0.70;
}
[data-theme="sanctum"] .six-step .amphitheater .spokes {
  color: var(--bronze-dim);
  opacity: 0.42;
}
[data-theme="sanctum"] .six-step .amphitheater .focal-dot {
  color: var(--bronze-lit);
}
[data-theme="sanctum"] .step-dot {
  background: var(--substrate-deep);
  box-shadow: none;
}
[data-theme="sanctum"] .step.done .step-dot {
  border-color: var(--bronze);
  box-shadow:
    inset 0 1px 0 var(--bronze-lit),
    inset 0 -1px 0 oklch(0.20 0 0 / 0.5),
    0 0 14px oklch(0.62 0.115 65 / 0.30);
}
[data-theme="sanctum"] .step.done .step-dot::after {
  background: oklch(0.10 0 0 / 0.6);
  box-shadow: inset 0 1px 0 oklch(0.30 0.020 60 / 0.5);
}
[data-theme="sanctum"] .step.active .step-dot {
  animation: nodePulseSanctum 2.6s var(--ease) infinite;
}
@keyframes nodePulseSanctum {
  0%, 100% {
    box-shadow:
      inset 0 1px 0 oklch(0.92 0.090 80),
      inset 0 -1px 0 oklch(0.30 0 0 / 0.5),
      0 0 24px var(--bronze-lit),
      0 0 48px oklch(0.62 0.115 65 / 0.50);
  }
  50% {
    box-shadow:
      inset 0 1px 0 oklch(0.92 0.090 80),
      inset 0 -1px 0 oklch(0.30 0 0 / 0.5),
      0 0 14px var(--bronze-lit),
      0 0 28px oklch(0.62 0.115 65 / 0.30);
  }
}
[data-theme="sanctum"] .step.active .step-name {
  color: var(--bronze-lit);
  text-shadow: 0 0 12px oklch(0.62 0.115 65 / 0.40);
}
[data-theme="sanctum"] .progress-fill {
  box-shadow: 0 0 8px var(--bronze-lit);
  background: linear-gradient(90deg,
    transparent 0%,
    var(--bronze-dim) 8%,
    var(--bronze) 50%,
    var(--bronze-lit) 100%);
}

[data-theme="sanctum"] #transcriptView::before {
  opacity: 0.10;
}
[data-theme="sanctum"] .transcript-actions {
  background: oklch(0.18 0.012 60 / 0.55);
  box-shadow: none;
}
[data-theme="sanctum"] .btn:hover:not(:disabled),
[data-theme="sanctum"] .btn-ghost:hover:not(:disabled) {
  color: var(--bronze-lit);
  background: oklch(0.26 0.022 65 / 0.6);
  text-shadow: 0 0 8px var(--bronze);
}
[data-theme="sanctum"] .transcript-actions .btn-primary {
  background: linear-gradient(180deg,
    oklch(0.42 0.080 60) 0%,
    oklch(0.32 0.060 58) 100%);
  box-shadow:
    inset 0 1px 0 oklch(0.65 0.110 70 / 0.55),
    inset 0 -1px 0 oklch(0.18 0 0 / 0.6),
    0 0 18px oklch(0.62 0.110 65 / 0.20);
}
[data-theme="sanctum"] .transcript-actions .btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg,
    oklch(0.48 0.090 62) 0%,
    oklch(0.36 0.070 58) 100%);
  box-shadow:
    inset 0 1px 0 oklch(0.75 0.130 75 / 0.65),
    inset 0 -1px 0 oklch(0.18 0 0 / 0.6),
    0 0 26px oklch(0.62 0.115 65 / 0.45);
}
[data-theme="sanctum"] .meta-chip.meta-title strong {
  text-shadow:
    0 1px 0 oklch(0.08 0 0 / 0.85),
    0 2px 1px oklch(0.06 0 0 / 0.50),
    0 -1px 0 oklch(0.78 0.155 75 / 0.18),
    0 0 28px oklch(0.62 0.115 65 / 0.22);
}
[data-theme="sanctum"] .speaker-label {
  background: oklch(from var(--tint) calc(l - 0.40) c h / 0.32);
  border-color: oklch(from var(--tint) calc(l - 0.18) c h / 0.45);
  text-shadow: 0 1px 0 oklch(0.08 0 0 / 0.5);
  box-shadow: inset 0 1px 0 oklch(from var(--tint) calc(l + 0.10) c h / 0.18);
}
[data-theme="sanctum"] .speaker-label:hover {
  color: oklch(from var(--tint) calc(l + 0.12) c h);
  box-shadow:
    inset 0 1px 0 oklch(from var(--tint) calc(l + 0.15) c h / 0.30),
    0 0 12px oklch(from var(--tint) l c h / 0.35);
}
[data-theme="sanctum"] .speaker-text {
  color: oklch(0.82 0.020 70);
}
[data-theme="sanctum"] .speaker-rename-input {
  border-color: var(--bronze-lit);
  color: var(--bronze-lit);
}

/* ─── Sanctum — contrast strengthening ───────────────────────────── */
[data-theme="sanctum"] .progress-filename {
  color: oklch(0.86 0.025 70);
  text-shadow:
    0 1px 0 oklch(0.08 0 0 / 0.85),
    0 0 22px oklch(0.62 0.115 65 / 0.20);
}
[data-theme="sanctum"] .progress-sub {
  color: oklch(0.55 0.030 65);
}
[data-theme="sanctum"] .step-label-active {
  color: oklch(0.58 0.035 65);
  text-shadow: 0 1px 0 oklch(0.06 0 0 / 0.6);
}
[data-theme="sanctum"] .hi-name {
  text-shadow: 0 1px 0 oklch(0.06 0 0 / 0.5);
}
[data-theme="sanctum"] .section-label {
  color: oklch(0.45 0.028 65);
}

/* ─── Sanctum — Phase A new elements ─────────────────────────────── */
[data-theme="sanctum"] .smart-title {
  text-shadow:
    0 1px 0 oklch(0.08 0 0 / 0.85),
    0 2px 1px oklch(0.06 0 0 / 0.50),
    0 -1px 0 oklch(0.78 0.155 75 / 0.18),
    0 0 28px oklch(0.62 0.115 65 / 0.22);
}
[data-theme="sanctum"] .step-index {
  color: oklch(0.30 0.018 62);
}
[data-theme="sanctum"] .sigil-presence .arcs {
  color: var(--bronze-lit);
  opacity: 0.4;
}
[data-theme="sanctum"] .sigil-presence .bounce {
  stroke: var(--bronze-lit);
}
[data-theme="sanctum"] .six-step .baseline .done-trace {
  filter: drop-shadow(0 0 5px oklch(from var(--bronze-lit) l c h / 0.55));
}
[data-theme="sanctum"] .six-step .baseline .pulse {
  filter: drop-shadow(0 0 8px oklch(from var(--bronze-lit) l c h / 0.80));
}
[data-theme="sanctum"] .speaker-text {
  color: oklch(0.82 0.020 70);
}

/* ─── Sanctum — Phase B new elements ─────────────────────────────── */
[data-theme="sanctum"] .section-label::after {
  background: linear-gradient(90deg,
    transparent,
    oklch(0.30 0.020 60 / 0.30) 20%,
    oklch(0.30 0.020 60 / 0.30) 80%,
    transparent);
}
[data-theme="sanctum"] .history-item.no-title .hi-name {
  color: oklch(0.52 0.030 65);
}
[data-theme="sanctum"] .progress-filename .ext {
  color: oklch(0.35 0.018 62);
}
[data-theme="sanctum"] .cancel-btn {
  border-color: oklch(0.28 0.018 60);
  color: oklch(0.38 0.020 62);
}
[data-theme="sanctum"] .cancel-btn:hover {
  color: oklch(0.72 0.105 35);
  border-color: oklch(0.52 0.105 35 / 0.75);
}
[data-theme="sanctum"] .breadcrumb .crumb {
  color: oklch(0.45 0.028 65);
}
[data-theme="sanctum"] .breadcrumb .crumb:hover {
  color: var(--bronze-lit);
}
[data-theme="sanctum"] .breadcrumb .crumb.current {
  color: oklch(0.40 0.045 60);
}
[data-theme="sanctum"] .breadcrumb .crumb-sep {
  color: oklch(0.32 0.018 60);
}

/* ─── Sanctum — Mode elements ────────────────────────────────────── */
[data-theme="sanctum"] .mode-tab:hover { color: var(--bronze-dim); }
[data-theme="sanctum"] .mode-tab.active {
  color: var(--bronze-lit);
  border-bottom-color: var(--bronze-lit);
}
[data-theme="sanctum"] .mode-regenerate,
[data-theme="sanctum"] .mode-note-toggle {
  border-color: oklch(0.25 0.015 60);
  color: oklch(0.38 0.022 62);
}
[data-theme="sanctum"] .mode-regenerate:hover,
[data-theme="sanctum"] .mode-note-toggle:hover,
[data-theme="sanctum"] .mode-note-toggle.active {
  color: var(--bronze);
  border-color: oklch(0.35 0.060 65 / 0.7);
}
[data-theme="sanctum"] .mode-note-input,
[data-theme="sanctum"] .job-context-input {
  background: oklch(0.16 0.010 60 / 0.6);
  border-color: oklch(0.25 0.015 60);
  color: var(--ink-soft);
}
[data-theme="sanctum"] .mode-note-input:focus,
[data-theme="sanctum"] .job-context-input:focus {
  border-color: oklch(0.35 0.060 65 / 0.7);
  box-shadow: 0 0 0 2px oklch(0.62 0.115 65 / 0.12);
}
[data-theme="sanctum"] .job-context-toggle {
  border-color: oklch(0.25 0.015 60);
  color: oklch(0.38 0.022 62);
}
[data-theme="sanctum"] .job-context-toggle:hover,
[data-theme="sanctum"] .job-context-toggle.active,
[data-theme="sanctum"] .job-context-toggle.has-content {
  color: var(--bronze);
  border-color: oklch(0.35 0.060 65 / 0.7);
}
[data-theme="sanctum"] .mode-body h1 {
  text-shadow: 0 0 18px oklch(0.62 0.115 65 / 0.18);
}
[data-theme="sanctum"] .mode-body h2 { color: var(--bronze); }
[data-theme="sanctum"] .mode-body strong { color: var(--ink-strong); }
[data-theme="sanctum"] .mode-body code {
  color: var(--bronze);
  background: oklch(0.20 0.015 65 / 0.45);
}
[data-theme="sanctum"] .path-label { color: oklch(0.42 0.055 68); }

/* ─── View page (GET /job/<id>/view) — shareable read-only transcript ── */

/* Let the text column fill the full view-content width (main app caps at 70ch) */
.view-content .transcript-body {
  grid-template-columns: 138px minmax(0, 1fr);
}

/* Sticky top nav */
.view-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  background: var(--surface-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule-soft);
  box-shadow:
    0 1px 0 var(--ring-hi-soft),
    0 2px 14px var(--shadow-soft);
}

.view-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--bronze);
  transition: color var(--dur) var(--ease);
}
.view-back:hover { color: var(--bronze-lit); }
.view-back .logo-icon {
  width: 18px;
  height: 18px;
  color: var(--bronze);
  opacity: 0.85;
  flex-shrink: 0;
}

.view-nav .app-name {
  font-family: "Cinzel", serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.34em;
  color: var(--bronze);
  text-shadow:
    0 1px 0 var(--ring-hi-strong),
    0 -1px 0 var(--shadow-soft);
}
.view-nav .app-greek {
  font-family: "Cinzel", serif;
  font-weight: 400;
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
}

.view-nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Main content column */
.view-content {
  max-width: 1260px;
  margin: 0 auto;
  padding: 52px 48px 120px;
}

/* Loading / error */
.view-loading,
.view-error {
  max-width: 780px;
  margin: 80px auto;
  padding: 0 24px;
  font-family: "Cinzel", serif;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: center;
}
.view-error { color: var(--error); }

/* Copy button in nav */
.view-copy-btn {
  font-family: "Cinzel", serif;
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--rule-soft);
  border-radius: 2px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.view-copy-btn:hover {
  color: var(--bronze);
  border-color: var(--bronze-dim);
}

/* Search bar */
.view-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 0;
}

.view-search-input {
  flex: 1;
  font-family: "Source Serif 4", serif;
  font-style: italic;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface-glass-quiet);
  border: 1px solid var(--rule-soft);
  border-radius: 2px;
  padding: 7px 12px;
  outline: none;
  transition: all var(--dur) var(--ease);
}
.view-search-input:focus {
  border-color: var(--bronze-dim);
  box-shadow: 0 0 0 2px oklch(0.62 0.115 65 / 0.10);
}
.view-search-input::placeholder {
  color: var(--ink-recess);
  font-style: italic;
}

.search-count {
  font-family: "Cinzel", serif;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  white-space: nowrap;
  min-width: 52px;
  text-align: center;
}

.search-nav {
  width: 28px;
  height: 28px;
  border: 1px solid var(--rule-soft);
  background: transparent;
  color: var(--ink-soft);
  border-radius: 2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  transition: all var(--dur) var(--ease);
}
.search-nav:hover {
  color: var(--bronze);
  border-color: var(--bronze-dim);
}

/* Search match highlight */
mark.search-hit {
  background: oklch(0.78 0.140 88 / 0.20);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
  outline: 1px solid oklch(0.78 0.140 88 / 0.35);
}
mark.search-hit.current {
  background: oklch(0.78 0.140 88 / 0.48);
  outline-color: var(--bronze-lit);
}

/* ─── Sanctum overrides for view page ───────────────────────────────── */
[data-theme="sanctum"] .view-nav {
  background: oklch(0.165 0.012 60 / 0.84);
  border-bottom-color: oklch(0.26 0.016 60);
}
[data-theme="sanctum"] .view-copy-btn {
  border-color: oklch(0.25 0.015 60);
  color: oklch(0.38 0.022 62);
}
[data-theme="sanctum"] .view-copy-btn:hover {
  color: var(--bronze);
  border-color: oklch(0.35 0.060 65 / 0.7);
}
[data-theme="sanctum"] .view-search-input {
  background: oklch(0.16 0.010 60 / 0.45);
  border-color: oklch(0.25 0.015 60);
  color: var(--ink);
}
[data-theme="sanctum"] .view-search-input:focus {
  border-color: oklch(0.35 0.060 65 / 0.65);
  box-shadow: 0 0 0 2px oklch(0.62 0.115 65 / 0.12);
}
[data-theme="sanctum"] mark.search-hit {
  background: oklch(0.50 0.090 65 / 0.22);
  outline-color: oklch(0.62 0.115 65 / 0.42);
}
[data-theme="sanctum"] mark.search-hit.current {
  background: oklch(0.50 0.090 65 / 0.44);
  outline-color: var(--bronze-lit);
}
[data-theme="sanctum"] .path-val   { color: oklch(0.38 0.018 62); }
