/* SPY 0DTE Briefing — parchment palette inherited from PI Wealth project. */

:root {
  --bg: #f4ecd8;
  --paper: #faf5e4;
  --card: #efe6ce;
  --text: #2d2a21;
  --muted: #6b6450;
  --accent: #8b6f2d;
  --border: #c9bd9d;

  --tier-green: #4a7c3f;
  --tier-green-bg: #d4e3c5;
  --tier-yellow: #a87c1a;
  --tier-yellow-bg: #ecdda8;
  --tier-orange: #b45a1e;
  --tier-orange-bg: #eec8a4;
  --tier-red: #8b2f28;
  --tier-red-bg: #e6c2b8;
  --tier-pending: #6b6450;
  --tier-pending-bg: #d8cfb8;

  --mono: 'SF Mono','Monaco','Consolas',monospace;
}

* { box-sizing: border-box; }

body {
  font-family: 'Georgia','Iowan Old Style',serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  line-height: 1.55;
}

header {
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

header h1 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text);
}

header nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 1rem;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}

header nav a.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem;
}

section {
  margin-bottom: 2rem;
}

section h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

/* ---- Verdict card ----------------------------------------------------- */

.verdict-card {
  border: 3px solid;
  border-radius: 8px;
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
}
.verdict-card.tier-GREEN  { background: var(--tier-green-bg);  border-color: var(--tier-green);  }
.verdict-card.tier-YELLOW { background: var(--tier-yellow-bg); border-color: var(--tier-yellow); }
.verdict-card.tier-ORANGE { background: var(--tier-orange-bg); border-color: var(--tier-orange); }
.verdict-card.tier-RED    { background: var(--tier-red-bg);    border-color: var(--tier-red);    }
.verdict-card.tier-pending { background: var(--tier-pending-bg); border-color: var(--tier-pending); }

.tier-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
  background: var(--paper);
}

.primary-action {
  font-size: 1.6rem;
  margin: 0.5rem 0;
  font-weight: 600;
}

.reasoning {
  margin: 0.5rem 0;
  font-size: 1rem;
  color: var(--text);
}

.contraindications {
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ---- Timeline grid --------------------------------------------------- */

.checkpoint-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.checkpoint {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.checkpoint .time {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
}

.checkpoint .label {
  font-size: 0.95rem;
  font-weight: 600;
}

.checkpoint .status {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.checkpoint .status.pending { color: var(--muted); }
.checkpoint .status.tier-GREEN  { color: var(--tier-green);  }
.checkpoint .status.tier-YELLOW { color: var(--tier-yellow); }
.checkpoint .status.tier-ORANGE { color: var(--tier-orange); }
.checkpoint .status.tier-RED    { color: var(--tier-red);    }

/* ---- Market snapshot ------------------------------------------------- */

.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.metric {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

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

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

.data-quality {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}

/* ---- Containment ----------------------------------------------------- */

.containment-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px dotted var(--border);
}

.containment-row:last-child { border-bottom: none; }

.containment-row .label {
  color: var(--muted);
}

.containment-row .value {
  font-family: var(--mono);
  font-weight: 600;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 0.5rem;
  letter-spacing: 0.04em;
}
.badge.favorable   { background: var(--tier-green-bg);  color: var(--tier-green);  }
.badge.unfavorable { background: var(--tier-orange-bg); color: var(--tier-orange); }

.rationale {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ---- Strategy cards -------------------------------------------------- */

.strategy-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
}

.strategy-card.passes { border-left: 4px solid var(--tier-green); }
.strategy-card.blocked { border-left: 4px solid var(--tier-orange); }
.strategy-card.undeployable {
  opacity: 0.65;
  border-left-color: var(--muted);
}

.strat-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.strat-name {
  font-weight: 600;
  font-size: 1rem;
}

.strat-status {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 600;
}

.strat-stats {
  margin: 0.4rem 0;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.strat-mechanism {
  font-size: 0.9rem;
  color: var(--text);
  margin: 0.4rem 0;
}

.strat-notes {
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
  margin: 0.3rem 0 0;
}

.filter-details {
  margin-top: 0.5rem;
}

.filter-details summary {
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
}

.filter-details table {
  width: 100%;
  margin-top: 0.4rem;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.85rem;
}

.filter-details td {
  padding: 0.25rem 0.5rem;
  border-top: 1px dotted var(--border);
}

.filter-details tr.pass td { color: var(--tier-green); }
.filter-details tr.fail td { color: var(--tier-orange); }

/* ---- Checkpoint accordion ------------------------------------------ */

.checkpoint-detail {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  margin-bottom: 0.5rem;
}

.checkpoint-detail summary {
  cursor: pointer;
  font-weight: 600;
}

.checkpoint-detail.tier-GREEN  { border-left: 4px solid var(--tier-green); }
.checkpoint-detail.tier-YELLOW { border-left: 4px solid var(--tier-yellow); }
.checkpoint-detail.tier-ORANGE { border-left: 4px solid var(--tier-orange); }
.checkpoint-detail.tier-RED    { border-left: 4px solid var(--tier-red); }
.checkpoint-detail.pending    { opacity: 0.6; }

.checkpoint-detail p {
  margin: 0.4rem 0;
  font-size: 0.9rem;
}

/* ---- Date picker (history view) ---------------------------------- */

.date-picker {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.date-picker label {
  font-size: 0.95rem;
  color: var(--muted);
}

.date-picker select {
  font-family: 'Georgia', serif;
  font-size: 1rem;
  padding: 0.3rem 0.5rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  min-width: 180px;
}

/* ---- Methodology footer --------------------------------------------- */

.methodology p {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.4rem 0;
}

/* ---- Mobile responsive ---------------------------------------------- */

@media (max-width: 768px) {
  main { padding: 1rem; }
  header { padding: 0.75rem 1rem; }
  header h1 { font-size: 1.2rem; }
  .checkpoint-grid { grid-template-columns: 1fr 1fr; }
  .snapshot-grid { grid-template-columns: 1fr 1fr; }
  .verdict-card { padding: 1rem 1.25rem; }
  .primary-action { font-size: 1.3rem; }
  .strat-stats { flex-direction: column; gap: 0.25rem; }
}
