/* UCP Market Analysis, A3HCS. Sibling of the DRG Impact Navigator.
   Same palette, same typography, own stylesheet. */
:root {
  --ink: #14212b;
  --ink2: #4a5a66;
  --line: #dbe3e8;
  --bg: #f7f9fa;
  --card: #ffffff;
  --accent: #0e6e63;      /* A3HCS deep teal */
  --accent2: #0a4f8f;     /* navy */
  --pos: #0e6e63;
  --neg: #b3402a;
  --gain: #0f9e6e;        /* bright green, FY2027 money added */
  --carried: #1d3d52;     /* dark slate, money carried over */
  --ramp-lo: #dfeeea;     /* map ramp endpoints, teal family */
  --ramp-hi: #073a34;
  --warn-bg: #fdf6ec;
  --warn-line: #e5c890;
}
* { box-sizing: border-box; margin: 0; }
body { font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.55; }
main { max-width: 1080px; margin: 0 auto; padding: 0 24px 64px; }
section { margin-top: 56px; scroll-margin-top: 118px; }

/* Header + section nav stick together as one slim chrome block. */
.chrome { position: sticky; top: 0; z-index: 30; }
.top { display: flex; align-items: baseline; gap: 16px; padding: 12px 24px; background: var(--card); border-bottom: 2px solid var(--accent); }
.brand { font-weight: 800; color: var(--accent2); white-space: nowrap; }
.brand span { font-weight: 400; color: var(--ink2); font-size: 12px; margin-left: 6px; }
.tool-name { font-size: 12px; letter-spacing: 2px; color: var(--accent); font-weight: 700; white-space: nowrap; }
.top-hosp { margin-left: auto; font-size: 13px; color: var(--ink2); }

.secnav { display: flex; align-items: center; gap: 4px; padding: 6px 20px; background: var(--card); border-bottom: 1px solid var(--line); overflow-x: auto; }
.secnav button { display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink2); padding: 6px 12px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.secnav button:hover { background: #eef4f3; color: var(--ink); }
.secnav button.on { background: #e7f0ee; color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 6px 6px 0 0; }
.secnav button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
kbd { font-family: inherit; font-size: 10.5px; font-weight: 700; color: var(--ink2); background: #f0f3f5; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; line-height: 1.5; }
.secnav button.on kbd { color: var(--accent); border-color: var(--accent); background: #fff; }
.key-hint { margin-left: auto; font-size: 11.5px; color: var(--ink2); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; padding-left: 12px; }
.fixture-pill { margin-left: auto; font-size: 10px; font-weight: 800; letter-spacing: 1px; color: #7a5b12; background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 4px; padding: 2px 7px; white-space: nowrap; }
.fixture-pill:not([hidden]) + .key-hint { margin-left: 10px; }

.kicker { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: 8px; }
h1 { font-size: 34px; line-height: 1.15; max-width: 760px; }
h1 em { color: var(--accent); font-style: normal; }
h2 { font-size: 24px; margin-bottom: 8px; }
h3 { font-size: 16px; margin: 18px 0 8px; }
.lede { max-width: 680px; color: var(--ink2); margin-top: 12px; }
.nat { margin-top: 18px; font-size: 14px; color: var(--ink2); max-width: 760px; }
.nat.err { color: var(--neg); font-weight: 600; }
.meta { color: var(--ink2); font-size: 14px; }
.note { font-size: 13px; color: var(--ink2); margin-top: 8px; }

/* ------------------------------------------------------------- 01 map */
.map-wrap { position: relative; margin-top: 28px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px; }
.map-grid { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; max-width: 720px; }
.st { position: relative; aspect-ratio: 1 / 1; border: 0; border-radius: 4px; font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 2px; transition: transform .08s, box-shadow .08s; }
.st .ab { font-size: 12px; font-weight: 800; line-height: 1.1; }
.st .mv { font-size: 9.5px; line-height: 1.1; opacity: .85; font-variant-numeric: tabular-nums; }
.st:hover, .st:focus-visible { transform: scale(1.08); box-shadow: 0 2px 10px rgba(20,33,43,.28); z-index: 2; outline: none; }
.st.sel { box-shadow: 0 0 0 2.5px var(--accent2), 0 2px 10px rgba(20,33,43,.25); z-index: 2; }
.st.empty { background: #eef1f3; color: var(--ink2); cursor: default; }
.st.empty .mv { display: none; }
.st.empty:hover { transform: none; box-shadow: none; }
.map-legend { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 12px; color: var(--ink2); flex-wrap: wrap; }
.map-legend .ramp { display: inline-block; width: 140px; height: 10px; border-radius: 5px; background: linear-gradient(to right, var(--ramp-lo), var(--ramp-hi)); }
.map-legend .leg-note { flex-basis: 100%; font-size: 11.5px; }
.tooltip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; font-size: 12.5px; line-height: 1.4; border-radius: 6px; padding: 8px 10px; max-width: 260px; z-index: 20; box-shadow: 0 6px 20px rgba(20,33,43,.3); }
.tooltip b { display: block; }

.state-panel { margin-top: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px; }
.state-panel h3 { margin: 0 0 2px; font-size: 18px; }
.state-panel .shade-line { font-size: 13px; color: var(--ink2); margin: 6px 0 12px; }
.mkt-list { display: flex; flex-direction: column; gap: 6px; }
.mkt-list button { display: flex; align-items: baseline; gap: 10px; width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; font-size: 14px; padding: 10px 14px; cursor: pointer; }
.mkt-list button:hover { background: #eef4f3; border-color: var(--accent); }
.mkt-list b { flex: 1; }
.mkt-list .amt { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mkt-list .chg { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 700; }
.chg.pos { color: var(--pos); } .chg.neg { color: var(--neg); }

/* ---------------------------------------------------------- 02 market */
.picker { display: flex; gap: 32px; flex-wrap: wrap; margin-top: 24px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px; }
.search-wrap { flex: 1 1 320px; position: relative; }
label { display: block; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--ink2); margin-bottom: 6px; }
input[type=text] { width: 100%; padding: 10px 12px; font-size: 16px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-family: inherit; }
input[type=text]:focus { outline: 2px solid var(--accent); border-color: transparent; }
.results { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--line); border-radius: 0 0 8px 8px; max-height: 320px; overflow-y: auto; z-index: 10; box-shadow: 0 8px 24px rgba(20,33,43,.12); }
.results button { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; background: none; cursor: pointer; font: inherit; font-size: 14px; }
.results button:hover, .results button.sel { background: #eef4f3; }
.results .sub { color: var(--ink2); font-size: 12px; }
.results .none { padding: 10px 12px; font-size: 13px; color: var(--ink2); }

.mkt-title { font-size: 20px; margin: 26px 0 2px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-top: 16px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.tile .lab { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--ink2); font-weight: 700; }
.tile .val { font-size: 26px; font-weight: 800; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.tile .sub { font-size: 12.5px; color: var(--ink2); }
.tile .val.pos { color: var(--pos); } .tile .val.neg { color: var(--neg); }

.bar-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 20px; }
.toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.toggle button { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink2); padding: 7px 14px; cursor: pointer; }
.toggle button + button { border-left: 1px solid var(--line); }
.toggle button.on { background: var(--accent); color: #fff; }
.toggle button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.bar-legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink2); flex-wrap: wrap; }
.bar-legend span { display: inline-flex; align-items: center; gap: 5px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.sw.carried { background: var(--carried); }
.sw.gained { background: var(--gain); }
.sw.lost { background: repeating-linear-gradient(45deg, var(--neg) 0 3px, #fff 3px 5px); border: 1px solid var(--neg); }

.bars { margin-top: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px 20px; }
.hrow { padding: 13px 0; border-bottom: 1px solid var(--line); }
.hrow:last-child { border-bottom: 0; }
.hrow.hl { background: #eef4f3; margin: 0 -20px; padding-left: 20px; padding-right: 20px; border-radius: 6px; }
.hrow .rname { font-size: 14px; }
.hrow .rname b { font-size: 14.5px; }
.hrow .rsub { font-size: 12.5px; color: var(--ink2); margin-top: 1px; }
.badge { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .8px; border-radius: 4px; padding: 1px 6px; margin-left: 6px; vertical-align: 1px; }
.badge.new { color: var(--pos); border: 1px solid var(--pos); }
.badge.lost { color: var(--neg); border: 1px solid var(--neg); }
.hrow .rvals { font-size: 13px; color: var(--ink2); margin-top: 5px; font-variant-numeric: tabular-nums; }
.hrow .rvals b { color: var(--ink); }
.bar-track { position: relative; height: 16px; margin-top: 7px; background: #f0f3f5; border-radius: 3px; overflow: hidden; }
.seg { position: absolute; top: 0; bottom: 0; }
.seg.carried { background: var(--carried); }
.seg.gained { background: var(--gain); }
.seg.lost { background: repeating-linear-gradient(45deg, var(--neg) 0 4px, #fbe9e4 4px 7px); }
.drg-link { display: inline-block; margin-top: 6px; font-size: 12.5px; font-weight: 700; color: var(--accent2); text-decoration: none; }
.drg-link:hover { text-decoration: underline; }

/* ---------------------------------------------------------- 03 top 25 */
.tbl-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; margin-top: 14px; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { padding: 9px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child, th:nth-child(2), td:nth-child(2), th:nth-child(3), td:nth-child(3), th:nth-child(4), td:nth-child(4) { text-align: left; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--ink2); }
td { font-variant-numeric: tabular-nums; }
td.pos { color: var(--pos); } td.neg { color: var(--neg); }
tbody tr:hover { background: #f2f6f5; }
td button.linklike { background: none; border: 0; color: var(--accent2); cursor: pointer; font: inherit; font-size: 13.5px; padding: 0; text-decoration: underline; text-align: left; white-space: normal; }

/* ------------------------------------------------------------ 04 pool */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.pool-cols { margin-top: 10px; }
.pool-cols > div { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 20px 14px; }
.dl { display: grid; grid-template-columns: 1fr 90px; gap: 4px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; align-items: baseline; }
.dl:last-child { border-bottom: 0; }
.dl .t { font-weight: 600; }
.dl .s { grid-column: 1; color: var(--ink2); font-size: 12.5px; }
.dl .amt { grid-column: 2; grid-row: 1 / span 2; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.dl .amt.pos { color: var(--pos); } .dl .amt.neg { color: var(--neg); }

/* --------------------------------------------------------------- cta */
.cta { background: var(--accent2); color: #fff; border-radius: 12px; padding: 32px; text-align: center; }
.cta p { max-width: 560px; margin: 10px auto 18px; opacity: .92; }
.btn { display: inline-block; background: #fff; color: var(--accent2); font-weight: 800; padding: 12px 28px; border-radius: 8px; text-decoration: none; }
.btn.ghost { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.6); margin-left: 10px; }

#method p { font-size: 13px; color: var(--ink2); max-width: 820px; }
footer { text-align: center; font-size: 12px; color: var(--ink2); padding: 24px; border-top: 1px solid var(--line); }

/* -------------------------------------------------------- responsive */
@media (max-width: 800px) {
  .two-col { grid-template-columns: 1fr; }
  h1 { font-size: 27px; }
}
@media (max-width: 700px) {
  .st .mv { display: none; }
  .st .ab { font-size: 10.5px; }
  .top { padding: 10px 16px; flex-wrap: wrap; gap: 6px 12px; }
  .brand span { display: none; }
  .secnav { padding: 5px 10px; }
  .key-hint { display: none; }
  main { padding: 0 16px 56px; }
  section { scroll-margin-top: 104px; }
  .map-wrap { padding: 12px; }
  .cta .btn.ghost { margin-left: 0; margin-top: 10px; }
}
