/* ── Reset & base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: #0d0d1a;
    color: #d4c9a8;
    min-height: 100vh;
}

/* ── Home-specific styles ─────────────────────────────────── */
.home-content { max-width: 1200px; margin: 0 auto; padding: 2rem; }

/* ── Header ─────────────────────────────────────────────────── */
header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-bottom: 2px solid #c9aa71;
    padding: 2rem;
    text-align: center;
}
.site-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}
.ankh { font-size: 2rem; color: #c9aa71; }
header h1 { font-size: 2rem; color: #c9aa71; letter-spacing: 0.1em; }
.subtitle { color: #8a9bb5; margin-top: 0.5rem; font-style: italic; }

/* ── Layout ─────────────────────────────────────────────────── */
main { display: flex; min-height: calc(100vh - 120px); }

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
    width: 260px;
    min-width: 260px;
    background: #111122;
    border-right: 1px solid #2a2a4a;
    padding: 1.5rem 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.sidebar h2 {
    color: #c9aa71;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #2a2a4a;
}
.sidebar a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: #8a9bb5;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s;
}
.sidebar a:hover {
    background: #1e1e3a;
    color: #c9aa71;
}
.sidebar .provider-label {
    font-size: 0.7rem;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 1rem;
    margin-bottom: 0.25rem;
    padding-left: 0.75rem;
}
.sidebar .active-link {
    display: block;
    padding: 0.5rem 0.75rem;
    color: #c9aa71;
    text-decoration: underline;
    border-radius: 4px;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s;
}

/* ── Content ────────────────────────────────────────────────── */
.content-area { flex: 1; padding: 2rem; overflow-x: hidden; }

/* ── Analysis Section ───────────────────────────────────────────── */
.analysis-section {
  background: linear-gradient(135deg, #111122 0%, #0f1628 100%);
  border: 1px solid #c9aa71;
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 3rem;
}
.analysis-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #2a2a4a;
}
.analysis-header-icon { font-size: 1.5rem; }
.analysis-header h2   { color: #c9aa71; font-size: 1.3rem; letter-spacing: 0.05em; }
.analysis-subheading  {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #8a9bb5;
  margin-bottom: 0.4rem;
}
.analysis-chart-subtitle {
  font-size: 0.75rem;
  color: #4a5568;
  margin-bottom: 1rem;
  font-style: italic;
}

/* ── Headline stat cards ────────────────────────────────────────── */
.analysis-stats-row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #2a2a4a;
}
.summary-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #0d0d1a;
  border: 1px solid #2a2a4a;
  border-radius: 10px;
  padding: 1rem 1.5rem;
  min-width: 130px;
  flex: 1;
  gap: 0.25rem;
}
.summary-stat-symbol { font-size: 1.6rem; line-height: 1; }
.summary-stat-value  { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.summary-stat-label  {
  font-size: 0.72rem;
  color: #4a5568;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: center;
}

/* ── Two-column chart grid ──────────────────────────────────────── */
.analysis-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #2a2a4a;
}
@media (max-width: 900px) {
  .analysis-charts-grid { grid-template-columns: 1fr; }
}

/* ── Bar charts (shared) ────────────────────────────────────────── */
.analysis-bars      { display: flex; flex-direction: column; gap: 0.55rem; }
.analysis-bar-row   { display: flex; align-items: center; gap: 0.75rem; }
.analysis-virtue-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 130px;
  font-size: 0.85rem;
  color: #d4c9a8;
  white-space: nowrap;
}
.analysis-bar-bg {
  flex: 1;
  background: #0d0d1a;
  border-radius: 4px;
  height: 20px;
  overflow: hidden;
  border: 1px solid #1a1a2e;
}
.analysis-bar-fill {
  height: 100%;
  border-radius: 4px;
  opacity: 0.85;
  transition: width 0.6s ease;
}
.analysis-bar-count {
  font-size: 0.85rem;
  font-weight: 700;
  width: 80px;
  text-align: right;
  white-space: nowrap;
}
.analysis-bar-share {
  font-size: 0.72rem;
  color: #4a5568;
  font-weight: 400;
}

/* ── Per-model table ────────────────────────────────────────────── */
.analysis-model-table-wrap { margin-top: 0.5rem; }
.analysis-model-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin-top: 0.75rem;
}
.analysis-model-table thead tr {
  background: #0d0d1a;
  border-bottom: 2px solid #2a2a4a;
}
.analysis-model-table th {
  padding: 0.65rem 1rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #4a5568;
  white-space: nowrap;
}
.analysis-model-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #1a1a2e;
  vertical-align: middle;
}
.analysis-model-table a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: #8a9bb5;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s;
}
.analysis-model-table a:hover {
    background: #1e1e3a;
    color: #c9aa71;
}

.analysis-model-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.model-cell   { color: #d4c9a8; font-family: monospace; font-size: 0.82rem; }
.center-cell  { text-align: center; color: #8a9bb5; }
.duration-cell { color: #4a5568; font-size: 0.82rem; }
.virtue-cell  { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }

/* ── Table chips ────────────────────────────────────────────────── */
.table-virtue-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.consistency-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid currentColor;
}
.no-virtue-chip, .na-chip {
  color: #4a5568;
  font-size: 0.78rem;
  font-style: italic;
}

/* ── Model Section ──────────────────────────────────────────── */
.model-section {
    margin-bottom: 4rem;
    border: 1px solid #2a2a4a;
    border-radius: 12px;
    overflow: hidden;
}
.model-header {
    background: linear-gradient(90deg, #1a1a2e, #0f3460);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #2a2a4a;
    display: flex;
    justify-content: center;
    gap: 1rem;
    font-size: 1.2rem;
    text-align: center;
}
.model-header h2 { color: #c9aa71; font-size: 1.4rem; }
.model-header h3 { color: #8a9bb5; font-size: 1.4rem; padding-right: 2em; }
.provider-badge {
    background: #0f3460;
    color: #8a9bb5;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    border: 1px solid #2a2a4a;
}

/* ── Virtue Badge ───────────────────────────────────────────── */
.virtue-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid currentColor;
}

/* ── Run Tabs ───────────────────────────────────────────────── */
.run-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 2rem 0;
    background: #111122;
    border-bottom: 1px solid #2a2a4a;
    flex-wrap: wrap;
}
.run-tab {
    padding: 0.5rem 1.25rem;
    background: transparent;
    border: 1px solid #2a2a4a;
    border-bottom: none;
    color: #8a9bb5;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    font-size: 0.875rem;
    transition: all 0.2s;
}
.run-tab.active { background: #1a1a2e; color: #c9aa71; border-color: #c9aa71; }
.run-tab:hover  { color: #c9aa71; }

/* ── Run Panel ──────────────────────────────────────────────── */
.run-panel { display: none; padding: 2rem; background: #0d0d1a; }
.run-panel.active { display: block; }

/* ── Virtue Path ────────────────────────────────────────────── */
.virtue-path {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.virtue-path-label {
    color: #4a5568;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.path-arrow { color: #4a5568; font-size: 1.2rem; }

/* ── Determined Virtue ──────────────────────────────────────── */
.determined-virtue {
    background: linear-gradient(135deg, #1a1a2e, #0f3460);
    border-radius: 10px;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border: 1px solid #c9aa71;
}
.determined-virtue .virtue-icon { font-size: 3rem; }
.determined-virtue h3 {
    color: #c9aa71;
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}
.determined-virtue .virtue-name { font-size: 1.8rem; font-weight: 700; }
.determined-virtue .virtue-desc {
    color: #8a9bb5;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ── Virtue Tally ───────────────────────────────────────────── */
.tally-section { margin-bottom: 2rem; }
.tally-section h3 {
    color: #8a9bb5;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}
.tally-bar-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.tally-virtue-name { width: 120px; font-size: 0.85rem; color: #d4c9a8; }
.tally-bar-bg {
    flex: 1;
    background: #1a1a2e;
    border-radius: 4px;
    height: 18px;
    overflow: hidden;
}
.tally-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    padding-left: 6px;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.7);
}
.tally-count { font-size: 0.8rem; color: #8a9bb5; width: 24px; text-align: right; }

/* ── Tier Sections ──────────────────────────────────────────── */
.tier-section { margin-bottom: 2rem; }
.tier-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #2a2a4a;
}
.tier-badge {
    background: #1a1a2e;
    border: 1px solid #c9aa71;
    color: #c9aa71;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.tier-header h3 { color: #8a9bb5; font-size: 0.9rem; }

/* ── Question Cards ─────────────────────────────────────────── */
.question-card {
    background: #111122;
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s;
}
.question-card:hover { border-color: #4a5568; }
.question-text {
    color: #d4c9a8;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.5;
    font-style: italic;
}
.choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.choice {
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid #2a2a4a;
    font-size: 0.85rem;
    line-height: 1.4;
    position: relative;
}
.choice.chosen {
    border-color: currentColor;
    background: rgba(255,255,255,0.04);
}
.choice-label {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}
.choice-text { color: #8a9bb5; }
.chosen .choice-text { color: #d4c9a8; }
.chosen-marker {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 0.9rem;
}

/* ── Card Footer ────────────────────────────────────────────── */
.card-footer {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

/* ── Duration Chip ──────────────────────────────────────────── */
.duration-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #0a0a15;
    border: 1px solid #2a2a4a;
    color: #4a5568;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    width: fit-content;
}

/* ── Reason Box ─────────────────────────────────────────────── */
.reason-box {
    background: #0a0a15;
    border-left: 3px solid #2a2a4a;
    padding: 0.75rem 1rem;
    border-radius: 0 4px 4px 0;
    font-size: 0.82rem;
    color: #8a9bb5;
    line-height: 1.6;
}
.reason-box summary {
    cursor: pointer;
    color: #4a5568;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
    user-select: none;
}
.reason-box summary:hover { color: #8a9bb5; }

/* ── No Data ────────────────────────────────────────────────── */
.no-data {
    color: #4a5568;
    font-style: italic;
    font-size: 0.875rem;
    padding: 1rem;
    text-align: center;
    border: 1px dashed #2a2a4a;
    border-radius: 6px;
}

/* ── Psychiatric Evaluation ───────────────────────────────── */
.psych-text {
    padding-left: 2em;
    padding-right: 2em;
    color: #8a9bb5;
    padding: 1rem;
    border: 1px dashed #2a2a4a;
    border-radius: 6px;
    line-height: 1.2;
}

.psych-text a {
    color: #BBF;
    text-decoration: underline;
}
.psych-text a:hover {
    color: #EEF;
}
.psych-text h1 {
    margin-bottom: 1rem;
}
.psych-text h2 {
    margin-bottom: 1rem;
}
.psych-text p {
    margin-bottom: 1.5rem;
}

.psych-text ul,ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.psych-text hr {
    display: none;
}

/* ── Home Page Text ───────────────────────────────── */
.home-text {
    padding-left: 2em;
    padding-right: 2em;
    color: #8a9bb5;
    padding: 1rem;
    border: 1px dashed #2a2a4a;
    border-radius: 6px;
    font-size: 1.1em;
    line-height: 1.2;
}

.home-text table {
  width: 100%;
  border-collapse: collapse; /* Ensures borders don't double up between cells */
  margin-bottom: 16px;
}
.home-text table th,
.home-text table td {
  border: 1px solid #8a9bb5;   /* 1px border, change #ccc to your preferred color */
  padding: 8px 12px;        /* 8px top/bottom, 12px left/right (looks better than equal padding) */
  /* If you want exactly 8px on all sides, change to: padding: 8px; */
}

.home-text a {
    color: #BBF;
    text-decoration: underline;
}
.home-text a:hover {
    color: #EEF;
}
.home-text h1 {
    margin-bottom: 1rem;
}
.home-text h2 {
    margin-bottom: 1rem;
}
.home-text h3 {
    margin-bottom: 0.75rem;
}
.home-text p {
    text-indent: 2em;
    margin-bottom: 1rem;
}

.home-text .no-indent {
    text-indent: 0 !important;
}

.home-text ul,ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.home-text hr {
  border: none;              
  height: 1px;               
  background-color: #2a2a4a;
  margin: 12px;
}

/* ── Model directory table ────────────────────────────────── */
.directory-section {
    background: linear-gradient(135deg, #111122 0%, #0f1628 100%);
    border: 1px solid #c9aa71;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 3rem;
}
.directory-section h2 {
    color: #c9aa71;
    font-size: 1.3rem;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #2a2a4a;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.directory-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.directory-table thead tr {
    background: #0d0d1a;
    border-bottom: 2px solid #2a2a4a;
}
.directory-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #4a5568;
    white-space: nowrap;
}
.directory-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #1a1a2e;
    vertical-align: middle;
}
.directory-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.directory-table a {
    color: #c9aa71;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}
.directory-table a:hover { border-bottom-color: #c9aa71; }
.provider-cell { color: #8a9bb5; font-size: 0.82rem; }
.runs-cell    { color: #8a9bb5; text-align: center; }
.virtue-cell-home {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    align-items: center;
}

/* ── Question breakdown section ───────────────────────────── */
.breakdown-section {
    background: linear-gradient(135deg, #111122 0%, #0f1628 100%);
    border: 1px solid #2a2a4a;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}
.breakdown-section h2 {
    color: #c9aa71;
    font-size: 1.3rem;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.breakdown-subtitle {
    color: #4a5568;
    font-size: 0.8rem;
    font-style: italic;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #2a2a4a;
}

.question-breakdown {
    background: #0d0d1a;
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.question-breakdown:hover { border-color: #4a5568; }
.qb-text {
    color: #d4c9a8;
    font-size: 0.92rem;
    font-style: italic;
    line-height: 1.5;
    margin-bottom: 1rem;
}
.qb-choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
@media (max-width: 700px) {
    .qb-choices { grid-template-columns: 1fr; }
}
.qb-choice {
    border: 1px solid #2a2a4a;
    border-radius: 6px;
    padding: 0.75rem;
}
.qb-choice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.qb-choice-text {
    color: #8a9bb5;
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 0.6rem;
}
.qb-bar-bg {
    width: 100%;
    background: #1a1a2e;
    border-radius: 4px;
    height: 22px;
    overflow: hidden;
    border: 1px solid #1a1a2e;
}
.qb-bar-fill {
    height: 100%;
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding-left: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255,255,255,0.85);
    transition: width 0.6s ease;
}
.qb-pct {
    font-size: 1.1rem;
    font-weight: 700;
}
.qb-sample-size {
    color: #4a5568;
    font-size: 0.72rem;
    text-align: right;
    margin-top: 0.4rem;
}

.llm-prompt {
    font-family: 'Courier New', Courier, monospace !important;
    background-color: #1e1e1e;
    color: #d4d4d4;
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    font-family: monospace;
    font-size: 16px;
    line-height: 1.5;
    white-space: pre-wrap;
    margin-top: 24px;
    margin-bottom: 24px;
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0d0d1a; }
::-webkit-scrollbar-thumb { background: #2a2a4a; border-radius: 3px; }

/* ── U4 Questions screenshot ────────────────────────────────── */
.u4-screenshot {
    display: block;
    max-height: 300px;
    width: auto;
    max-width: 100%;
    margin: 1.5rem auto 16px;
}

/* ── Developer portrait ─────────────────────────────────────── */
.dev-portrait {
    float: left;
    height: 80px;
    width: auto;
    margin: 0 1rem 0.5rem 0;
}

/* ── Generated date footer ──────────────────────────────────── */
.generated-date {
    text-align: center;
    font-style: italic;
    color: #8a9bb5;
    margin: 2rem 1rem;
}
