/* quantmodel static reports — shared layout (t137) */

:root {
  --bg: #f6f4ef;
  --bg-accent: #ebe6dc;
  --ink: #1a1a1a;
  --muted: #5c5a55;
  --line: #d4cfc3;
  --pass: #1f6b3a;
  --fail: #8b2e2e;
  --link: #1a4a6e;
  --chart-ours: #1a4a6e;
  --chart-as: #b05a1e;
  --font-sans: "IBM Plex Sans", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --max: 1080px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #fff8e8 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #e8eef4 0%, transparent 50%),
    var(--bg);
  line-height: 1.45;
  min-height: 100vh;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-thickness: 2px;
}

.site-header,
.site-main,
.site-footer {
  width: min(var(--max), calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  padding: 1.75rem 0 1rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: baseline;
  justify-content: space-between;
}

.brand {
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 1rem;
  font-size: 0.95rem;
}

.site-main {
  padding: 1.5rem 0 3rem;
}

.site-footer {
  padding: 1rem 0 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

h1 {
  font-size: clamp(1.6rem, 2.5vw, 2.1rem);
  letter-spacing: -0.03em;
  margin: 0 0 0.35rem;
}

.lede {
  color: var(--muted);
  max-width: 42rem;
  margin: 0 0 1.5rem;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--line);
  background: var(--bg-accent);
  font-size: 0.8rem;
  font-family: var(--font-mono);
}

.badge.pass {
  color: var(--pass);
  border-color: color-mix(in srgb, var(--pass) 35%, var(--line));
}

.badge.fail {
  color: var(--fail);
  border-color: color-mix(in srgb, var(--fail) 35%, var(--line));
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.catalog-controls {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.8rem;
  margin: 1rem 0;
}

.catalog-controls label {
  font-size: 0.85rem;
  font-weight: 650;
}

.catalog-controls input,
.catalog-controls select {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  font: inherit;
  padding: 0.45rem 0.6rem;
}

.catalog-controls input {
  min-width: min(18rem, 100%);
}

table.catalog {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.custom-meta-form { max-width: 56rem; display: grid; gap: .7rem; }
.custom-meta-form > *, .custom-meta-policy > * { min-width: 0; }
.custom-meta-form label { display: grid; gap: .35rem; font-weight: 650; }
.custom-meta-form small { color: var(--muted); font-weight: 400; overflow-wrap: anywhere; }
.custom-meta-form textarea, .custom-meta-form select { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; color: var(--text); font: inherit; padding: .6rem; }
.custom-meta-form input { min-height: 44px; }
.custom-meta-form select { max-width: 100%; min-height: 44px; width: 100%; }
.custom-meta-form textarea { resize: vertical; }
.custom-meta-policy { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.custom-meta-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.custom-meta-actions button { border: 1px solid var(--line); border-radius: 4px; cursor: pointer; font: inherit; min-height: 44px; padding: .55rem .9rem; }
.personal-strategy-list { display: grid; gap: .6rem; padding-left: 0; }
.personal-strategy-list li { align-items: center; border: 1px solid var(--line); border-radius: 4px; display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between; padding: .65rem; }
.personal-strategy-list .custom-meta-actions { margin-left: auto; }
.account-sync { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: .5rem; }
.account-sync input { font: inherit; min-height: 44px; width: 100%; }
#custom-meta-name { font: inherit; min-height: 44px; max-width: 100%; }
.button-label { align-items: center; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; display: inline-flex; min-height: 44px; padding: .55rem .9rem; }
.button-label input { display: none; }
.form-error { color: var(--fail); }
.tax-profile-form { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); margin: 1rem 0; }
.tax-profile-form label { display: grid; gap: .35rem; font-size: .85rem; font-weight: 650; }
.tax-profile-form small { color: var(--muted); font-weight: 400; }
.tax-profile-form input, .tax-profile-form select, .tax-profile-form textarea { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; color: var(--text); font: inherit; font-size: 1rem; padding: .45rem .6rem; }
.tax-profile-form input, .tax-profile-form select { min-height: 44px; }
.tax-profile-form textarea { resize: vertical; }
.tax-profile-form .tax-checkbox { align-content: center; grid-template-columns: auto 1fr; min-height: 44px; }
.tax-profile-form .tax-checkbox input { height: 24px; margin: 0; min-height: 24px; width: 24px; }

table.catalog th,
table.catalog td {
  padding: 0.55rem 0.7rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

table.catalog th {
  font-weight: 600;
  background: var(--bg-accent);
  position: sticky;
  top: 0;
}

table.catalog tbody tr:hover {
  background: rgba(255, 255, 255, 0.7);
}

table.catalog td.num,
table.catalog th.num {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.chart-panel {
  margin: 1.25rem 0;
  padding: 1rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
}

.chart-panel h2 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.chart-frame {
  position: relative;
  height: 280px;
}

.chart-frame.tall {
  height: 340px;
}

.note {
  color: var(--muted);
  font-size: 0.9rem;
}

.meta-row.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

.stub-callout {
  margin: 1rem 0 1.5rem;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--chart-as);
  background: rgba(255, 255, 255, 0.65);
}

.metrics-panel {
  margin: 0 0 1.25rem;
}

.metrics-panel h2 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.65rem;
}

.metric-card {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.65);
}

.metric-label {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  margin-top: 0.2rem;
  font-variant-numeric: tabular-nums;
}

.compare-wrap {
  margin-top: 1rem;
  overflow-x: auto;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.compare-table th,
.compare-table td {
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.compare-table th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.compare-table .num,
.compare-table th.num {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.compare-table .delta-pos {
  color: #1f6b3a;
}

.compare-table .delta-neg {
  color: #8b2e2e;
}

.compare-table .delta-flat {
  color: var(--muted);
}

.toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.75rem;
}

.toggle-btn {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--line);
  background: var(--bg-accent);
  color: var(--ink);
  cursor: pointer;
}

.toggle-btn:hover {
  border-color: color-mix(in srgb, var(--link) 40%, var(--line));
}

.toggle-btn.active {
  background: var(--link);
  border-color: var(--link);
  color: #fff;
}

.detail-list {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.detail-list strong {
  color: var(--ink);
  font-weight: 500;
}

@media (max-width: 640px) {
  .chart-frame {
    height: 220px;
  }

  .custom-meta-actions button {
    flex: 1 1 100%;
    width: 100%;
  }
}

.comparison-picker {
  max-width: 50rem;
  padding: 1rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
}
.comparison-picker select { display: block; margin: .45rem 0; max-width: 100%; padding: .45rem; font: inherit; }
.selected-strategies { padding-left: 1.5rem; }
.selected-strategies li { margin: .4rem 0; }
.selected-strategies button { margin-left: .5rem; }
#compare-warning:empty { display: none; }
