/* CHMI_OLM — TAF evaluation report web (generated pages) */

:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --accent: #0369a1;
  --excellent: #15803d;
  --good: #65a30d;
  --fair: #d97706;
  --poor: #dc2626;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }

/* Header */
.site-header {
  background: linear-gradient(90deg, #0c4a6e, #0369a1);
  color: #fff;
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.2);
}
.header-row { display: flex; align-items: center; justify-content: space-between; padding: 0.7rem 1.25rem; }
.breadcrumb { font-size: 0.95rem; }
.breadcrumb a { color: #bae6fd; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .current { color: #fff; font-weight: 600; }
.log-link {
  color: #e0f2fe;
  font-size: 0.85rem;
  text-decoration: none;
  border: 1px solid rgb(255 255 255 / 0.4);
  border-radius: 6px;
  padding: 0.25rem 0.7rem;
}
.log-link:hover { background: rgb(255 255 255 / 0.12); }

/* Content */
main { padding: 1.5rem 1.25rem 3rem; }
h1 { font-size: 1.5rem; margin: 0.5rem 0 0.75rem; }
h2 { font-size: 1.15rem; margin: 2rem 0 0.6rem; border-bottom: 2px solid var(--border); padding-bottom: 0.3rem; }
h3 { font-size: 1rem; margin: 1.2rem 0 0.4rem; }
.subtitle { color: var(--muted); margin-top: 0; }
.notice { color: var(--muted); font-style: italic; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.9rem; margin: 1.2rem 0; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
}
.card-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.card-value { font-size: 1.6rem; font-weight: 700; margin: 0.2rem 0; }
.card-value.small { font-size: 1.05rem; }
.card-note { font-size: 0.8rem; color: var(--muted); }

/* Badges */
.badge {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  color: #fff;
  white-space: nowrap;
}
.badge.big { font-size: 1.25rem; padding: 0.2rem 0.8rem; }
.badge.excellent { background: var(--excellent); }
.badge.good { background: var(--good); }
.badge.fair { background: var(--fair); }
.badge.poor { background: var(--poor); }
a:has(> .badge) { text-decoration: none; }
a:hover > .badge { filter: brightness(0.9); }

/* Tables */
table.data {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.9rem;
  margin: 0.6rem 0 1rem;
}
table.data.narrow { width: auto; min-width: 50%; }
table.data th, table.data td { padding: 0.45rem 0.7rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data thead th { background: #f8fafc; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
table.data tbody tr:hover { background: #f8fafc; }
table.data th.row-label { font-weight: 600; white-space: nowrap; background: #f8fafc; }
td.nowrap, .nowrap { white-space: nowrap; }
td.msg { font-family: Consolas, "Courier New", monospace; font-size: 0.8rem; color: #334155; }
td.note { font-size: 0.8rem; color: var(--muted); }
tr.insignificant { opacity: 0.55; }

/* Index pivot matrix (month x locality) */
table.matrix {
  border-collapse: collapse;
  width: 100%;
  margin: 0.6rem 0 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.9rem;
}
table.matrix th, table.matrix td { border: 1px solid var(--border); padding: 0.45rem 0.7rem; vertical-align: top; }
table.matrix thead th,
table.matrix th.rowhead {
  background: #f8fafc;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  text-align: left;
}
table.matrix th.rowhead { white-space: nowrap; }
table.matrix td.cell, table.matrix td.total-cell { text-align: left; }
table.matrix .empty { color: #9aa4af; }
table.matrix tbody tr:hover td { background: #f8fafc; }
table.matrix .cell-top { display: flex; align-items: center; justify-content: flex-start; gap: 0.5rem; white-space: nowrap; }
table.matrix .cell-sub { margin-top: 0.25rem; font-size: 0.78rem; color: var(--muted); white-space: nowrap; text-align: left; }
table.matrix .cell-sub a { color: inherit; text-decoration: underline; }
table.matrix tr.totals td, table.matrix tr.totals th.rowhead, table.matrix td.total-cell { background: #eef2f7; }
table.matrix tbody tr:hover td.total-cell, table.matrix tr.totals:hover td { background: #e5eaf1; }
table.matrix td.total-cell .cell-top, table.matrix tr.totals .cell-top { justify-content: flex-start; white-space: nowrap; }

/* Monthly heatmap (forecast hour x parameter) */
table.heatmap {
  border-collapse: collapse;
  margin: 0.6rem 0 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
table.heatmap th, table.heatmap td {
  border: 1px solid var(--border);
  padding: 0.28rem 0.3rem;
  text-align: center;
  font-size: 0.78rem;
  min-width: 2rem;
}
table.heatmap thead th { background: #f8fafc; color: var(--muted); font-weight: 600; }
table.heatmap th.rowhead {
  text-align: left;
  padding: 0.28rem 0.6rem;
  background: #f8fafc;
  color: #334155;
  font-weight: 600;
  white-space: nowrap;
}
table.heatmap tr.total td, table.heatmap tr.total th.rowhead { font-weight: 700; }
table.heatmap td.rowtotal { font-weight: 700; white-space: nowrap; padding: 0.28rem 0.5rem; }
table.heatmap .heat-count { font-weight: 400; font-size: 0.68rem; opacity: 0.85; }
td.heat-excellent { background: var(--excellent); color: #fff; }
td.heat-good      { background: var(--good); color: #fff; }
td.heat-fair      { background: var(--fair); color: #fff; }
td.heat-poor      { background: var(--poor); color: #fff; }
td.heat-empty     { background: #f8fafc; color: #cbd5e1; }

/* Monthly daily-score calendar */
table.calendar {
  border-collapse: collapse;
  margin: 0.6rem 0 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
}
table.calendar th, table.calendar td {
  border: 1px solid var(--border);
  padding: 0.15rem 0.3rem;
  text-align: center;
  font-size: 0.78rem;
  min-width: 3.6rem;
}
table.calendar thead th { background: #f8fafc; color: var(--muted); font-weight: 600; }
table.calendar td { height: 2.5rem; vertical-align: top; }
table.calendar td a { display: block; color: inherit; text-decoration: none; }
table.calendar .cal-day { font-size: 0.68rem; color: inherit; opacity: 0.75; text-align: left; }
table.calendar .cal-pct { font-weight: 700; font-size: 0.85rem; }
table.calendar td.heat-empty .cal-pct { font-weight: 400; }
table.calendar td.outside { background: var(--surface); border-color: #f5f7fa; }

/* Message block */
pre.message {
  background: #0f172a;
  color: #e2e8f0;
  padding: 0.9rem 1.1rem;
  border-radius: 8px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-word;
}
pre.message.sticky {
  position: sticky;
  top: 0.4rem;
  z-index: 40;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.35);
}

/* Figures */
figure { margin: 0.8rem 0 1.2rem; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 0.6rem; }
figure img { max-width: 100%; height: auto; display: block; margin: 0 auto; }
figcaption { text-align: center; font-size: 0.8rem; color: var(--muted); margin-top: 0.3rem; }

/* Details / protocol */
details { margin: 0.5rem 0; }
details summary { cursor: pointer; color: var(--accent); font-weight: 600; }
details.box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.9rem;
  margin: 0.5rem 0;
}
details.box > summary { color: var(--text); font-weight: 600; }
details.box figure { border: none; margin: 0.4rem 0 0.2rem; padding: 0; }
details.protocol {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.9rem;
  margin: 0.4rem 0;
}
details.protocol summary { display: flex; gap: 0.8rem; align-items: center; color: var(--text); font-weight: 500; flex-wrap: wrap; }
.msg.inline { font-family: Consolas, "Courier New", monospace; font-size: 0.78rem; color: var(--muted); }

/* Findings */
ul.findings { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 0.6rem 0.6rem 0.6rem 1.8rem; font-size: 0.88rem; }
ul.findings li { margin: 0.15rem 0; }
.findings-flag {
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Footer */
.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 0.8rem; padding: 0.8rem 0; background: var(--surface); }
