:root {
  --bg:        #f0f0f2;
  --surface:   #ffffff;
  --border:    #e2e2e6;
  --border-2:  #c8c8d0;

  --text:      #09090b;
  --muted:     #52525b;
  --subtle:    #a1a1aa;

  --blue:      #1d4ed8;
  --blue-bg:   #dbeafe;
  --blue-text: #1e3a8a;

  --green:     #15803d;
  --green-bg:  #dcfce7;
  --amber:     #92400e;
  --amber-bg:  #fef3c7;
  --red:       #b91c1c;
  --red-bg:    #fee2e2;

  /* Sidebar — dark for strong contrast */
  --sb-bg:     #18181b;
  --sb-border: #27272a;
  --sb-text:   #a1a1aa;
  --sb-active: #3f3f46;
  --sb-hover:  #27272a;

  --sidebar-w: 240px;
  --sans:      'Plus Jakarta Sans', sans-serif;
  --mono:      'JetBrains Mono', monospace;
  --radius:    10px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ── */
.layout { display: flex; min-height: 100vh; }
.mobile-header { display: none; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sb-bg);
  border-right: 1px solid var(--sb-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-top {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--sb-border);
}
.logo {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -.3px;
}
.logo-vi {
  color: #60a5fa;
}
.logo-sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--sb-text);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-top: 3px;
}

.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }

.session-group { margin-bottom: 24px; }
.session-label {
  font-size: 10px;
  font-weight: 600;
  color: #52525b;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 0 8px;
  margin-bottom: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .1s;
  margin-bottom: 1px;
}
.nav-item:hover { background: var(--sb-hover); }
.nav-item.active { background: var(--sb-active); }
.nav-item.active .nav-name { color: #ffffff; font-weight: 600; }

.nav-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--sb-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.nav-item:hover .nav-name { color: #e4e4e7; }

.nav-score {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: #52525b;
  margin-left: 8px;
  flex-shrink: 0;
}
.nav-score.high { color: #4ade80; }
.nav-score.mid  { color: #fbbf24; }
.nav-score.low  { color: #f87171; }

.sidebar-bottom {
  padding: 14px 20px;
  border-top: 1px solid var(--sb-border);
}
.gen-date {
  font-family: var(--mono);
  font-size: 10px;
  color: #52525b;
}

/* ── Main ── */
.main {
  flex: 1;
  padding: 40px 48px 80px;
  overflow-y: auto;
  max-width: 900px;
}

.welcome-state {
  height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--subtle);
  font-size: 15px;
  font-weight: 500;
}

/* ── Company view ── */
.company-view { animation: fadeIn .2s ease both; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Header */
.co-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
}
.co-header.eliminated {
  position: relative;
  padding: 28px;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.co-header.eliminated::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    rgba(220, 38, 38, 0.18) 0,
    rgba(220, 38, 38, 0.18) 20px,
    transparent 20px,
    transparent 40px
  );
  pointer-events: none;
}
.co-header.eliminated > * { position: relative; z-index: 1; }

.co-name {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -.6px;
  line-height: 1.1;
  color: var(--text);
}
.co-presenter {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 6px;
}

.co-score-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.co-score {
  font-family: var(--mono);
  font-size: 48px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: -.02em;
}
.co-score .denom {
  font-size: 18px;
  color: var(--subtle);
}
.co-score.high { color: var(--green); }
.co-score.mid  { color: var(--amber); }
.co-score.low  { color: var(--red); }

.rating-pill {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 4px 12px;
  border-radius: 20px;
}
.rating-pill.strong-consider { background: var(--green-bg); color: var(--green); }
.rating-pill.consider         { background: var(--blue-bg);  color: var(--blue-text); }
.rating-pill.pass             { background: var(--amber-bg); color: var(--amber); }
.rating-pill.strong-pass      { background: var(--red-bg);   color: var(--red); }

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 16px;
}
.card-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--subtle);
  margin-bottom: 12px;
}

/* Summary */
.summary-card {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 60%, #3b82f6 100%);
  border-color: transparent;
}
.summary-card .card-label {
  color: rgba(255,255,255,.6);
}
.summary-text {
  font-size: 16px;
  line-height: 1.75;
  color: #ffffff;
  font-weight: 400;
}

/* Strengths / Concerns */
.sc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 0;
}
.sc-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.sc-card.strengths { background: #f0fdf4; border-top: 3px solid var(--green); }
.sc-card.concerns  { background: #fff5f5; border-top: 3px solid var(--red); }
.sc-card.strengths .card-label { color: var(--green); }
.sc-card.concerns  .card-label { color: var(--red); }

.sc-list { list-style: none; }
.sc-list li {
  font-size: 14px;
  line-height: 1.65;
  padding: 7px 0 7px 18px;
  position: relative;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.sc-list li:last-child { border-bottom: none; }
.sc-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 16px;
  width: 8px;
  height: 2px;
  border-radius: 1px;
}
.sc-card.strengths .sc-list li::before { background: var(--green); }
.sc-card.concerns  .sc-list li::before { background: var(--red); }

/* Recommendation */
.rec-card {
  background: #f0f4ff;
  border: 1px solid #c7d7fc;
  border-radius: var(--radius);
  border-left: 4px solid var(--blue);
  padding: 20px 24px;
  margin-bottom: 16px;
}
.rec-text {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
  font-weight: 400;
}

/* ── Q&A ── */
.qa-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.qa-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}
.qa-card-header:hover { background: var(--bg); }
.qa-card.collapsed .qa-card-header { border-bottom: none; }
.qa-card.collapsed .qa-item { display: none; }
.qa-card-header .card-label { margin: 0; }
.qa-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--subtle);
}
.qa-collapse-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}
.collapse-chevron {
  font-size: 16px;
  color: var(--subtle);
  transition: transform .2s;
  line-height: 1;
  display: inline-block;
  transform: rotate(90deg);
}
.collapsed .collapse-chevron { transform: rotate(0deg); }

.qa-item { border-bottom: 1px solid var(--border); }
.qa-item:last-child { border-bottom: none; }

.qa-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  cursor: pointer;
  transition: background .1s;
}
.qa-row:hover { background: var(--bg); }

.qa-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.qa-dot.strong   { background: var(--green); }
.qa-dot.good     { background: var(--blue); }
.qa-dot.weak     { background: var(--amber); }
.qa-dot.red_flag { background: var(--red); }

.qa-info { flex: 1; min-width: 0; }
.qa-label-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qa-preview {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.qa-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  flex-shrink: 0;
}
.qa-badge.strong   { background: var(--green-bg); color: var(--green); }
.qa-badge.good     { background: var(--blue-bg);  color: var(--blue-text); }
.qa-badge.weak     { background: var(--amber-bg); color: var(--amber); }
.qa-badge.red_flag { background: var(--red-bg);   color: var(--red); }

.qa-chevron {
  font-size: 13px;
  color: var(--subtle);
  transition: transform .18s;
  flex-shrink: 0;
}
.qa-item.open .qa-chevron { transform: rotate(90deg); }

.qa-body {
  display: none;
  padding: 16px 24px 20px 46px;
  border-top: 1px solid var(--border);
  background: #fafafa;
}
.qa-item.open .qa-body { display: block; }

.qa-field-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--subtle);
  margin-bottom: 5px;
}
.qa-field-label + * { margin-bottom: 14px; }

.qa-q-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 14px;
}
.qa-a-text {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 14px;
}
.qa-analysis-box {
  font-size: 14px;
  line-height: 1.65;
  padding: 12px 16px;
  border-radius: 8px;
  border-left: 3px solid;
}
.qa-analysis-box.strong   { background: var(--green-bg); border-color: var(--green); color: var(--text); }
.qa-analysis-box.good     { background: var(--blue-bg);  border-color: var(--blue);  color: var(--text); }
.qa-analysis-box.weak     { background: var(--amber-bg); border-color: var(--amber); color: var(--text); }
.qa-analysis-box.red_flag { background: var(--red-bg);   border-color: var(--red);   color: var(--text); }

/* Pending */
.pending-state {
  text-align: center;
  padding: 80px 24px;
}
.pending-state h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}
.pending-state p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.8;
}

/* spacer utility */
.stack { display: flex; flex-direction: column; gap: 16px; }

/* ── Extra content blocks ── */
.extra-block {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1.5px solid;
}
.extra-block-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  cursor: pointer;
  user-select: none;
}
.extra-block-header:hover { filter: brightness(.97); }
.extra-block.collapsed .extra-block-body { display: none; }
.extra-block.collapsed .collapse-chevron { transform: rotate(-90deg); }
.extra-block-header .collapse-chevron { margin-left: auto; }
.extra-block-icon {
  font-size: 14px;
  flex-shrink: 0;
}
.extra-block-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.extra-block-body {
  padding: 20px 20px 24px;
}
.extra-block-body .card {
  background: rgba(255,255,255,.75);
}

/* Color variants — cycle by index */
.extra-block:nth-child(1) {
  border-color: #c4b5fd;
  background: #faf5ff;
}
.extra-block:nth-child(1) .extra-block-header {
  background: #ede9fe;
  border-bottom: 1px solid #c4b5fd;
}
.extra-block:nth-child(1) .extra-block-title { color: #6d28d9; }
.extra-block:nth-child(1) .extra-block-icon  { color: #7c3aed; }

.extra-block:nth-child(2) {
  border-color: #99f6e4;
  background: #f0fdfa;
}
.extra-block:nth-child(2) .extra-block-header {
  background: #ccfbf1;
  border-bottom: 1px solid #99f6e4;
}
.extra-block:nth-child(2) .extra-block-title { color: #0f766e; }
.extra-block:nth-child(2) .extra-block-icon  { color: #0d9488; }

.extra-block:nth-child(3) {
  border-color: #fed7aa;
  background: #fff7ed;
}
.extra-block:nth-child(3) .extra-block-header {
  background: #ffedd5;
  border-bottom: 1px solid #fed7aa;
}
.extra-block:nth-child(3) .extra-block-title { color: #c2410c; }
.extra-block:nth-child(3) .extra-block-icon  { color: #ea580c; }

.extra-block:nth-child(4) {
  border-color: #a5f3fc;
  background: #f0f9ff;
}
.extra-block:nth-child(4) .extra-block-header {
  background: #e0f2fe;
  border-bottom: 1px solid #a5f3fc;
}
.extra-block:nth-child(4) .extra-block-title { color: #0369a1; }
.extra-block:nth-child(4) .extra-block-icon  { color: #0284c7; }

/* ── Eliminated companies ── */
.nav-item.eliminated .nav-name {
  text-decoration: line-through;
  opacity: 0.4;
}
.nav-item.eliminated .nav-score { opacity: 0.4; }

/* ── Info button ── */
.info-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #18181b;
  color: #a1a1aa;
  border: 1px solid #3f3f46;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--mono);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.3);
  z-index: 100;
  transition: background .15s, color .15s;
}
.info-btn:hover { background: #27272a; color: #fff; }

/* ── Modal ── */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }

.modal-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 32px;
  max-width: 500px;
  width: 100%;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--subtle);
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
}
.modal-close:hover { color: var(--text); }
.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
}
.modal-intro {
  font-size: 14px;
  line-height: 1.75;
  color: var(--muted);
  margin-bottom: 18px;
}
.modal-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.modal-list li {
  font-size: 13px;
  color: var(--text);
  padding-left: 20px;
  position: relative;
  line-height: 1.5;
}
.modal-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 8px;
  height: 2px;
  background: var(--blue);
  border-radius: 1px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 2px; }

@media (max-width: 720px) {
  .layout { flex-direction: column; }
  .sidebar { display: none; }
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #18181b;
    border-bottom: 1px solid #27272a;
    position: sticky;
    top: 0;
    z-index: 10;
  }
  .mobile-logo {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
  }
  .mobile-logo .logo-vi { color: #60a5fa; }
  .main { padding: 20px 16px 60px; }
  .sc-grid { grid-template-columns: 1fr; }
  .co-name { font-size: 26px; }
  .co-score { font-size: 36px; }
  #mobile-company-select {
    width: 180px;
    padding: 6px 10px;
    background: #27272a;
    color: #e4e4e7;
    border: 1px solid #3f3f46;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
  }
}
