/* ============================================
   INSPHERA — Editorial design system
   ============================================ */

:root {
  /* Surfaces */
  --bg: #F4F1E8;
  --bg-deep: #EDE8D8;
  --surface: #FBF9F2;
  --surface-raised: #FFFEFA;

  /* Ink */
  --ink: #1F2418;
  --ink-soft: #3A3F30;
  --muted: #8B8775;
  --muted-soft: #B5B0A0;

  /* Brand */
  --forest: #2D3A2E;
  --forest-deep: #1B2A1E;
  --sage: #6B8A6E;
  --sage-deep: #3D5642;
  --sage-soft: #A8BFA8;
  --sage-wash: #E2EAD9;

  --gold: #B8985A;
  --gold-deep: #8A6E3A;
  --gold-soft: #D4BD89;
  --gold-wash: #EFE5C8;

  /* Hairlines */
  --rule: #E5DFCB;
  --rule-strong: #C9C0A4;
  --rule-soft: #EFEADB;

  /* Semantic */
  --success: #6B8A6E;
  --warning: #B8985A;
  --danger: #A4493D;
  --info: #4A6B7C;

  /* Type */
  --serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --sans: 'Geist', 'Söhne', 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  /* Spacing scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;

  /* Radius (subtle — editorial) */
  --r-1: 2px;
  --r-2: 4px;
  --r-3: 6px;
}

/* ============================================
   THEME VARIANTS — driven by data attributes on <html>
   ============================================ */

html[data-atmosphere="library"] {
  --bg: #E8E5D6;
  --bg-deep: #DDD9C5;
  --surface: #F2EFDF;
  --surface-raised: #F8F5E5;
  --ink: #14180E;
  --ink-soft: #2D3225;
  --rule: #CFC9B0;
  --rule-strong: #B5AE94;
  --rule-soft: #DCD7BF;
}
html[data-atmosphere="linen"] {
  --bg: #FAF8F1;
  --bg-deep: #F2EFE3;
  --surface: #FEFCF6;
  --surface-raised: #FFFFFF;
  --ink: #2A2E22;
  --ink-soft: #4A4E3E;
  --rule: #ECE6D2;
  --rule-strong: #D5CDB0;
  --rule-soft: #F4EFDC;
}

html[data-accent="verdigris"] {
  --gold: #4F8276;
  --gold-deep: #2E5249;
  --gold-soft: #A6C0B7;
  --gold-wash: #DDE9E3;
}
html[data-accent="burgundy"] {
  --gold: #8E3A4A;
  --gold-deep: #5E2230;
  --gold-soft: #C49AA4;
  --gold-wash: #ECDCDF;
}

html[data-voice="modernist"] {
  --serif: 'Geist', 'Söhne', 'Inter', system-ui, sans-serif;
}
html[data-voice="modernist"] .h1,
html[data-voice="modernist"] .h2,
html[data-voice="modernist"] .h3,
html[data-voice="modernist"] .display,
html[data-voice="modernist"] .lead,
html[data-voice="modernist"] .body-serif {
  font-family: 'Geist', system-ui, sans-serif;
  letter-spacing: -0.01em;
  font-weight: 500;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01', 'cv11';
}

a { color: inherit; text-decoration: none; }

/* ============================================
   TYPOGRAPHY
   ============================================ */

.serif { font-family: var(--serif); }
.sans  { font-family: var(--sans); }
.mono  { font-family: var(--mono); }

.display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 56px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--forest);
}

.h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 40px;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--forest);
  margin: 0;
}

.h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--forest);
  margin: 0;
}

.h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.25;
  color: var(--forest);
  margin: 0;
}

.h4 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  color: var(--ink);
  margin: 0;
}

.italic-display {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
}

.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.lead {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 22px;
  line-height: 1.45;
  color: var(--ink-soft);
}

.body {
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-soft);
}

.body-serif {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
}

.meta {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.meta-mono {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* ============================================
   METADATA HIERARCHY
   ============================================ */

.qfact {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
}
.qfact-num {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums oldstyle-nums;
  line-height: 1;
}
.qfact-lbl {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.005em;
}
.qfact-sm .qfact-num { font-size: 13px; }
.qfact-sm .qfact-lbl { font-size: 11px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0.005em;
  line-height: 1.4;
  white-space: nowrap;
}
.chip::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}
.chip-gold::before  { background: var(--gold); }
.chip-sage::before  { background: var(--sage); }
.chip-forest::before { background: var(--forest); }
.chip-warn::before  { background: var(--gold-deep); }
.chip-quiet { background: transparent; border-color: var(--rule-soft); color: var(--muted); }
.chip-quiet::before { display: none; }

.proc {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.proc-stamp {
  color: var(--gold-deep);
  font-weight: 500;
}

.dot-sep {
  display: inline-block;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--rule-strong);
  margin: 0 4px;
  vertical-align: middle;
}

/* ============================================
   LAYOUT / CHROME
   ============================================ */

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(244, 241, 232, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
}

.topbar-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
}

.brand-mark {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wordmark {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--forest);
}
.wordmark em {
  font-style: italic;
  font-weight: 400;
  color: var(--sage-deep);
}

.topnav {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-left: 16px;
}

.topnav a {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  border-radius: var(--r-2);
  position: relative;
  transition: color 0.15s, background 0.15s;
  cursor: pointer;
  text-decoration: none;
}
.topnav a:hover { color: var(--forest); background: var(--bg-deep); }
.topnav a.active { color: var(--forest); }
.topnav a.active::after {
  content: '';
  position: absolute;
  left: 12px; right: 12px;
  bottom: 1px;
  height: 1.5px;
  background: var(--gold);
}

.topnav-divider {
  width: 1px;
  height: 16px;
  background: var(--rule);
  margin: 0 6px;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--surface);
  font-size: 12px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 0.15s;
  text-decoration: none;
}
.user-chip:hover { border-color: var(--rule-strong); }

.avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--sage-wash);
  color: var(--sage-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

/* ============================================
   PAGE CONTAINER
   ============================================ */

.page {
  flex: 1;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 32px 80px;
}

.page-narrow { max-width: 880px; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 28px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--rule);
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}
.crumbs a { text-decoration: none; color: var(--muted); }
.crumbs a:hover { color: var(--forest); }
.crumbs .sep { color: var(--muted-soft); }

/* ============================================
   BUTTONS
   ============================================ */

.ds-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.005em;
  border-radius: var(--r-2);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  text-decoration: none;
}

.ds-btn-primary {
  background: var(--forest);
  color: var(--surface);
  border-color: var(--forest);
}
.ds-btn-primary:hover { background: var(--forest-deep); }

.ds-btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--rule-strong);
}
.ds-btn-secondary:hover { background: var(--bg-deep); border-color: var(--ink-soft); }

.ds-btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: transparent;
}
.ds-btn-ghost:hover { background: var(--bg-deep); color: var(--forest); }

.ds-btn-gold {
  background: var(--gold-wash);
  color: var(--gold-deep);
  border-color: var(--gold-soft);
}
.ds-btn-gold:hover { background: var(--gold-soft); }

.ds-btn-danger {
  background: #F4E2DE;
  color: #7A3329;
  border-color: #E2BFB7;
}
.ds-btn-danger:hover { background: #E2BFB7; }

.ds-btn-sm { height: 30px; padding: 0 12px; font-size: 12px; }
.ds-btn-lg { height: 44px; padding: 0 20px; font-size: 14px; }

.ds-btn:disabled, .ds-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================
   CARDS / SURFACES
   ============================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-3);
}

.card-flat {
  background: transparent;
  border-bottom: 1px solid var(--rule);
}

.card-pad    { padding: 24px; }
.card-pad-lg { padding: 32px; }

/* ============================================
   FORMS
   ============================================ */

.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}

.ds-input, .ds-select, .ds-textarea {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  background: var(--surface-raised);
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-2);
  padding: 10px 12px;
  height: 40px;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
.ds-input:focus, .ds-select:focus, .ds-textarea:focus {
  outline: none;
  border-color: var(--sage-deep);
  box-shadow: 0 0 0 3px rgba(107, 138, 110, 0.12);
}
.ds-textarea { height: auto; min-height: 100px; resize: vertical; line-height: 1.55; }

.ds-select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238B8775' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* ============================================
   BADGES / STATUS
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}
.badge .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.badge-sage    { background: var(--sage-wash); color: var(--sage-deep); border-color: rgba(107,138,110,0.25); }
.badge-gold    { background: var(--gold-wash); color: var(--gold-deep); border-color: rgba(184,152,90,0.3); }
.badge-neutral { background: var(--bg-deep); color: var(--ink-soft); border-color: var(--rule); }
.badge-danger  { background: #F4E2DE; color: #7A3329; border-color: #E2BFB7; }
.badge-info    { background: #DDE6EB; color: #2E4A58; border-color: #B6C7D0; }

.badge-pulse .dot {
  animation: ds-pulse 1.6s ease-in-out infinite;
}
@keyframes ds-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50%       { opacity: 1; transform: scale(1.1); }
}

/* ============================================
   PULL QUOTE
   ============================================ */

.pullquote {
  position: relative;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink);
  padding: 4px 0 4px 24px;
  border-left: 2px solid var(--gold);
  margin: 0;
}
.pullquote.lg {
  font-size: 26px;
  line-height: 1.4;
  padding-left: 32px;
}
.pullquote-source {
  margin-top: 12px;
  font-family: var(--sans);
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* ============================================
   SECTION MARKERS
   ============================================ */

.section-marker {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.section-marker .num {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 500;
  font-style: italic;
  color: var(--gold-deep);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}
.section-marker .lbl {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ============================================
   RULES / DIVIDERS
   ============================================ */

.ds-rule        { height: 1px; background: var(--rule); border: 0; margin: 24px 0; }
.ds-rule-thick  { height: 1px; background: var(--rule-strong); border: 0; margin: 32px 0; }
.ds-rule-double {
  border: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  height: 4px;
  background: transparent;
  margin: 32px 0;
}

/* ============================================
   TABS — editorial style
   ============================================ */

.ds-tabs {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 32px;
  list-style: none;
  padding: 0;
  margin-left: 0;
  margin-right: 0;
}

.ds-tab {
  padding: 14px 0;
  margin-right: 28px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  position: relative;
  transition: color 0.15s;
  background: none; border: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.ds-tab:hover { color: var(--ink); }
.ds-tab.active { color: var(--forest); }
.ds-tab.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  bottom: -1px;
  height: 1.5px;
  background: var(--forest);
}
.ds-tab .count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-soft);
}
.ds-tab.active .count { color: var(--gold-deep); }

/* ============================================
   FILE DROP / UPLOAD
   ============================================ */

.dropzone {
  border: 1px dashed var(--rule-strong);
  border-radius: var(--r-3);
  background: repeating-linear-gradient(
    45deg,
    var(--surface),
    var(--surface) 10px,
    var(--surface-raised) 10px,
    var(--surface-raised) 20px
  );
  padding: 56px 32px;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}
.dropzone:hover,
.dropzone.dragover {
  border-color: var(--sage-deep);
  background: var(--surface-raised);
  border-style: solid;
}
.dropzone.has-file {
  background: var(--surface-raised);
  border-style: solid;
  border-color: var(--rule);
}

/* ============================================
   PROGRESS / STAGES
   ============================================ */

.stage-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.stage-item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule-soft);
  position: relative;
}
.stage-item:last-child { border-bottom: 0; }

.stage-marker {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1px solid var(--rule-strong);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
}
.stage-item.done .stage-marker { background: var(--sage-deep); border-color: var(--sage-deep); color: var(--surface); }
.stage-item.active .stage-marker {
  background: var(--gold-wash);
  border-color: var(--gold);
  color: var(--gold-deep);
}
.stage-item.active .stage-marker::before {
  content: '';
  position: absolute;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  opacity: 0.4;
  animation: ds-ring 1.6s ease-out infinite;
  pointer-events: none;
  margin-top: -6px; margin-left: -6px;
}
@keyframes ds-ring {
  0%   { transform: scale(0.8); opacity: 0.5; }
  100% { transform: scale(1.4); opacity: 0; }
}

.stage-body { flex: 1; min-width: 0; }
.stage-title {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 2px;
}
.stage-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

/* ============================================
   ICONS (inline svg)
   ============================================ */

.ic { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.ic-sm { width: 13px; height: 13px; }
.ic-lg { width: 20px; height: 20px; }
.ic-xl { width: 32px; height: 32px; stroke-width: 1.2; }

/* ============================================
   LAYOUT UTILITIES
   ============================================ */

.ds-flex { display: flex; }
.ds-flex-col { display: flex; flex-direction: column; }
.ds-items-center { align-items: center; }
.ds-items-start  { align-items: flex-start; }
.ds-justify-between { justify-content: space-between; }
.ds-justify-end     { justify-content: flex-end; }
.ds-gap-1 { gap: 4px; }
.ds-gap-2 { gap: 8px; }
.ds-gap-3 { gap: 12px; }
.ds-gap-4 { gap: 16px; }
.ds-gap-5 { gap: 24px; }
.ds-gap-6 { gap: 32px; }
.ds-gap-7 { gap: 48px; }

.ds-grid   { display: grid; }
.ds-grid-2 { grid-template-columns: repeat(2, 1fr); }
.ds-grid-3 { grid-template-columns: repeat(3, 1fr); }

.ds-mt-1 { margin-top: 4px; } .ds-mt-2 { margin-top: 8px; } .ds-mt-3 { margin-top: 12px; }
.ds-mt-4 { margin-top: 16px; } .ds-mt-5 { margin-top: 24px; } .ds-mt-6 { margin-top: 32px; }
.ds-mb-1 { margin-bottom: 4px; } .ds-mb-2 { margin-bottom: 8px; } .ds-mb-3 { margin-bottom: 12px; }
.ds-mb-4 { margin-bottom: 16px; } .ds-mb-5 { margin-bottom: 24px; } .ds-mb-6 { margin-bottom: 32px; }

.ds-w-full { width: 100%; }

.text-muted   { color: var(--muted); }
.text-soft    { color: var(--ink-soft); }
.text-forest  { color: var(--forest); }
.text-sage    { color: var(--sage-deep); }
.text-gold    { color: var(--gold-deep); }
.text-danger  { color: var(--danger); }

/* ============================================
   AUTH LAYOUT
   ============================================ */

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
}

.auth-editorial {
  background: var(--surface);
  border-right: 1px solid var(--rule);
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.auth-form-pane {
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
}
.auth-form-body {
  flex: 1;
  display: flex;
  align-items: center;
}
.auth-form-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 20px;
  padding-top: 24px;
  border-top: 1px solid var(--rule-soft);
  margin-top: 24px;
}

.auth-form-inner {
  max-width: 380px;
  width: 100%;
  margin: 0 auto;
}

/* ============================================
   PROJECT CARD LIST (editorial)
   ============================================ */

.project-row {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 28px 0;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: background 0.1s;
}
.project-row:hover { background: var(--surface); margin: 0 -16px; padding-left: 16px; padding-right: 16px; border-radius: var(--r-2); }

/* ============================================
   TRANSCRIPT READER
   ============================================ */

.reader-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 48px;
}

.transcript-line {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  padding: 14px 12px;
  margin: 0 -12px;
  border-radius: var(--r-2);
  transition: background 0.15s;
  border-left: 2px solid transparent;
  padding-left: 14px;
}
.transcript-line.coded   { border-left-color: var(--gold-soft); }
.transcript-line.highlighted { background: var(--gold-wash); }

.code-tag {
  font-family: var(--mono);
  font-size: 10px;
  padding: 2px 8px;
  border: 1px solid var(--rule-strong);
  background: var(--surface);
  color: var(--gold-deep);
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: all 0.15s;
}
.code-tag.active {
  background: var(--gold);
  color: var(--surface);
  border-color: var(--gold);
}

/* ============================================
   FLASH MESSAGES (redesigned)
   ============================================ */

.ds-flash {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 40px 12px 16px;
  border-radius: var(--r-3);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 24px rgba(31, 36, 24, 0.12);
  z-index: 10000;
  animation: ds-slide-down 0.25s ease-out;
  max-width: 520px;
  min-width: 280px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ds-flash-notice  { background: var(--sage-wash); color: var(--sage-deep); border: 1px solid rgba(107,138,110,0.3); }
.ds-flash-alert   { background: #F4E2DE; color: #7A3329; border: 1px solid #E2BFB7; }
.ds-flash-error   { background: #F4E2DE; color: #7A3329; border: 1px solid #E2BFB7; }
.ds-flash-warning { background: var(--gold-wash); color: var(--gold-deep); border: 1px solid var(--gold-soft); }
.ds-flash-info    { background: #DDE6EB; color: #2E4A58; border: 1px solid #B6C7D0; }

.ds-flash-close {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
}
.ds-flash-close:hover { opacity: 1; background: rgba(0,0,0,0.06); }

@keyframes ds-slide-down {
  from { transform: translateX(-50%) translateY(-12px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rule-strong); border-radius: 999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--muted-soft); }

/* ============================================
   THEMES VISUALIZATION BAR CHART
   ============================================ */

.theme-bar-row {
  display: grid;
  grid-template-columns: 32px 1fr 200px 40px;
  align-items: center;
  gap: 16px;
  padding: 14px 12px;
  margin: 0 -12px;
  border-radius: var(--r-2);
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--rule-soft);
}
.theme-bar-row:hover, .theme-bar-row.selected { background: var(--gold-wash); }

/* ============================================
   PROJECT RADIO CARDS
   ============================================ */

.project-radio-card {
  padding: 16px;
  cursor: pointer;
  border: 1px solid var(--rule);
  border-radius: var(--r-3);
  background: var(--surface);
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 12px;
}
.project-radio-card:hover { border-color: var(--sage-deep); }
.project-radio-card.selected {
  border-color: var(--sage-deep);
  background: var(--sage-wash);
}
.project-radio-card input[type="radio"] {
  accent-color: var(--sage-deep);
}
