/* NT P3 Dashboard V1 — minimal, readable, static */
:root {
  --bg: #fafafa;
  --surface: #fff;
  --border: #e0e0e0;
  --text: #1a1a1a;
  --text-secondary: #666;
  --accent: #1a56db;
  --accent-light: #e8eefb;
  --badge-bg: #fef3c7;
  --badge-text: #92400e;
  --good: #065f46;
  --good-bg: #ecfdf5;
  --bad: #991b1b;
  --bad-bg: #fef2f2;
  --caveat-bg: #fffbeb;
  --caveat-border: #f59e0b;
  --tier-strong: #d1fae5;
  --tier-good: #ecfdf5;
  --tier-ok: #fffbeb;
  --tier-weak: #fef2f2;
  --zebra: #fcfcfd;
  --row-hover: #f1f5f9;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "SF Mono", "Fira Code", "Fira Mono", Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  font-size: 14px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}

.site-header .container {
  padding-top: 0;
  padding-bottom: 0;
}

.site-header h1 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
}

.site-header .subtitle {
  color: var(--text-secondary);
  font-size: 13px;
}

/* Meta bar */
.meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  padding: 12px 0;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.meta-bar dt {
  font-weight: 600;
  color: var(--text);
  display: inline;
}

.meta-bar dd {
  display: inline;
  margin-left: 4px;
}

.meta-item {
  display: flex;
  gap: 4px;
}

/* Caveat */
.caveat {
  background: var(--caveat-bg);
  border-left: 3px solid var(--caveat-border);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 20px;
  line-height: 1.4;
}

/* Controls bar */
.controls-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 13px;
}

.controls-bar label {
  color: var(--text-secondary);
  font-weight: 500;
}

.controls-bar select {
  font-family: var(--font);
  font-size: 13px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
}

/* Table */
.table-wrapper {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}

thead {
  background: #f8f9fa;
  position: sticky;
  top: 0;
}

th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 2px solid var(--border);
}

th.num, td.num {
  text-align: right;
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

tr:last-child td {
  border-bottom: none;
}

tbody tr:nth-child(even) td {
  background: var(--zebra);
}

tr:hover td {
  background: var(--row-hover);
}

/* Sortable headers */
th.sortable {
  cursor: pointer;
  user-select: none;
}

th.sortable:hover {
  color: var(--text);
  background: #f1f3f5;
}

th.sort-active {
  color: var(--accent);
  background: var(--accent-light);
}

.sort-ind {
  display: inline-block;
  min-width: 0.9em;
  font-weight: 700;
  color: var(--accent);
}

/* Medal emoji on top-3 rank cells */
td.rank-top3 { font-weight: 700; }

.rank-medal {
  display: inline-block;
  margin-right: 4px;
  font-size: 15px;
  line-height: 1;
  vertical-align: -1px;
}

/* Score-tier cell shading */
td.tier-strong { background: var(--tier-strong); }
td.tier-good   { background: var(--tier-good); }
td.tier-ok     { background: var(--tier-ok); }
td.tier-weak   { background: var(--tier-weak); }

td.model-link a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

td.model-link a:hover {
  text-decoration: underline;
}

/* Badges */
.badge {
  display: inline-block;
  background: var(--badge-bg);
  color: var(--badge-text);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  margin-right: 4px;
  white-space: nowrap;
}

.badge.badge-gold   { background: #fef3c7; color: #92400e; }
.badge.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge.badge-violet { background: #ede9fe; color: #5b21b6; }
.badge.badge-green  { background: #d1fae5; color: #065f46; }
.badge.badge-teal   { background: #ccfbf1; color: #115e59; }

/* Model detail page */
.back-link {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
}

.back-link:hover { text-decoration: underline; }

.model-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.model-badges {
  margin-bottom: 16px;
}

.auto-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 18px;
  margin-bottom: 24px;
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Sections */
.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 18px;
  margin-bottom: 20px;
}

.section h2 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.section-copy {
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.methodology-card {
  margin-bottom: 20px;
}

.definition-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 16px;
}

.definition-list.compact {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.definition-list div {
  background: #f8f9fb;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
}

.definition-list dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  font-weight: 700;
  margin-bottom: 4px;
}

.definition-list dd {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.metric-item {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  font-weight: 600;
}

.metric-value {
  font-size: 18px;
  font-weight: 600;
  font-family: var(--mono);
}

/* Skill tags */
.skill-list {
  list-style: none;
}

.skill-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 13px;
}

.skill-list li:last-child { border-bottom: none; }

.skill-tag-name {
  font-family: var(--mono);
  font-size: 12px;
}

.skill-rate {
  font-weight: 600;
  font-family: var(--mono);
}

.skill-count {
  color: var(--text-secondary);
  font-size: 12px;
}

/* Examples */
.example-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px;
  margin-bottom: 12px;
}

.example-card.good {
  border-left: 3px solid var(--good);
  background: var(--good-bg);
}

.example-card.bad {
  border-left: 3px solid var(--bad);
  background: var(--bad-bg);
}

.example-header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.example-header strong {
  color: var(--text);
}

.example-question-block {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 10px;
}

.example-stimulus {
  margin-bottom: 8px;
  color: var(--text);
}

.example-prompt {
  font-weight: 600;
  margin-bottom: 10px;
}

.muted {
  color: var(--text-secondary);
  font-weight: 400;
}

.choice-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.choice-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  margin-bottom: 8px;
}

.choice-item.selected {
  border-color: #3b82f6;
  background: #eff6ff;
}

.choice-item.correct {
  border-color: #10b981;
}

.choice-key {
  font-family: var(--mono);
  font-weight: 700;
}

.choice-text {
  line-height: 1.5;
}

.choice-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.choice-tag {
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.selected-tag {
  background: #dbeafe;
  color: #1d4ed8;
}

.correct-tag {
  background: #d1fae5;
  color: #065f46;
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.answer-pill {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.8);
}

.answer-label {
  display: block;
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  margin-bottom: 4px;
}

.model-answer {
  border-color: #bfdbfe;
}

.correct-answer {
  border-color: #a7f3d0;
}

.example-output {
  background: #f8f9fa;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 12px;
  font-family: var(--mono);
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 80px;
  overflow: hidden;
  position: relative;
}

.example-output.expanded {
  max-height: none;
}

.expand-btn {
  display: inline-block;
  margin-top: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 10px;
  font-size: 11px;
  color: var(--accent);
  cursor: pointer;
}

.expand-btn:hover {
  background: var(--accent-light);
}

/* Download bar */
.download-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  font-size: 13px;
}

.download-bar a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.download-bar a:hover { text-decoration: underline; }

/* Strengths / Weaknesses columns */
.sw-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.sw-columns h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 24px 0;
  font-size: 12px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

/* Responsive */
@media (max-width: 768px) {
  .sw-columns {
    grid-template-columns: 1fr;
  }
  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
