/* Explore New York Hospitals (SPARCS public data). Uses the site tokens from styles.css. */
.nys-wrap { padding: 8px 0 90px; }
.nys-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; }
.nys-chip { border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 0.78rem; color: var(--paper-dim); background: rgba(255,255,255,0.03); }
.nys-chip b { color: var(--accent-bright); font-weight: 600; }

.nys-filters { display: grid; grid-template-columns: 2fr repeat(4, 1fr); gap: 14px; align-items: end; margin: 6px 0 10px; }
.nys-compare .nys-filters { grid-template-columns: repeat(3, 1fr) auto; }
.nys-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.nys-field span { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.nys-field input, .nys-field select { width: 100%; background: rgba(255,255,255,0.05); color: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; font: inherit; font-size: 0.95rem; }
.nys-field select option { color: #111; }
.nys-field input:focus, .nys-field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.nys-field-btn { align-self: end; }
.nys-note { color: var(--muted); font-size: 0.86rem; line-height: 1.55; margin: 8px 0 14px; }
.nys-lead { color: var(--paper-dim); line-height: 1.65; margin: 0 0 16px; max-width: 78ch; }

.nys-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 26px; align-items: start; }
.nys-mapcol { position: relative; }
.nys-map { position: relative; border: 1px solid var(--line); border-radius: 16px; background: rgba(0,0,0,0.14); padding: 8px; }
.nys-map svg { width: 100%; height: auto; display: block; }
.nys-county { fill: rgba(255,235,210,0.06); stroke: rgba(255,235,210,0.22); stroke-width: 0.6; }
.nys-county:hover { fill: rgba(201,162,75,0.12); }
.nys-pin { fill: var(--accent); fill-opacity: 0.78; stroke: var(--ink-950); stroke-width: 0.8; cursor: pointer; transition: fill-opacity .15s, r .15s; }
.nys-pin:hover, .nys-pin:focus { fill: var(--accent-bright); fill-opacity: 1; outline: none; stroke: var(--paper); }
.nys-pin.is-dim { fill-opacity: 0.12; pointer-events: none; }
.nys-tip { position: absolute; transform: translate(-50%, -100%); background: var(--ink-950); border: 1px solid var(--accent); border-radius: 10px; padding: 10px 12px; width: 220px; font-size: 0.8rem; line-height: 1.45; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .12s; z-index: 5; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.nys-tip.is-on { opacity: 1; visibility: visible; }
.nys-tip strong { display: block; color: var(--paper); margin-bottom: 2px; } .nys-tip span { display: block; color: var(--paper-dim); }
.nys-legend { color: var(--muted); font-size: 0.8rem; margin-top: 8px; display: flex; align-items: center; gap: 8px; }
.nys-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); display: inline-block; }
.nys-count { color: var(--muted); font-size: 0.82rem; margin: 0 0 8px; }
.nys-list { list-style: none; margin: 0; padding: 0; max-height: 620px; overflow-y: auto; border: 1px solid var(--line); border-radius: 14px; }
.nys-item { display: grid; width: 100%; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--line); color: var(--paper); padding: 12px 14px; cursor: pointer; font: inherit; gap: 2px; }
.nys-item:hover, .nys-item:focus { background: rgba(201,162,75,0.09); outline: none; }
.nys-item strong { font-weight: 600; } .nys-item span { color: var(--paper-dim); font-size: 0.84rem; } .nys-item em { color: var(--muted); font-size: 0.78rem; font-style: normal; }
.nys-empty { padding: 18px; color: var(--muted); }

.nys-back { display: inline-block; color: var(--accent-bright); text-decoration: none; font-size: 0.9rem; margin-bottom: 14px; }
.nys-headmain { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.nys-profile h2, .nys-compare h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); line-height: 1.15; margin: 4px 0 6px; }
.nys-sub { color: var(--paper-dim); margin: 0 0 12px; }
.nys-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 0.88rem; color: var(--paper-dim); max-width: 78ch; }
.nys-facts b { color: var(--muted); font-weight: 600; margin-right: 6px; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }
.nys-badge { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 0.74rem; font-weight: 600; margin-right: 6px; }
.nys-badge.ok { background: rgba(127,174,140,0.18); color: var(--change-up); border: 1px solid rgba(127,174,140,0.4); }
.nys-yearpick { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.nys-yearpick button { background: transparent; border: 0; color: var(--paper-dim); padding: 9px 18px; cursor: pointer; font: inherit; font-weight: 600; }
.nys-yearpick button.is-on { background: var(--accent); color: var(--ink-950); }

.nys-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 26px 0 18px; }
.nys-tile { text-align: left; background: rgba(255,255,255,0.035); border: 1px solid var(--line); border-radius: 14px; padding: 16px 16px 14px; color: var(--paper); cursor: pointer; font: inherit; display: grid; gap: 4px; transition: border-color .15s, transform .15s, background .15s; }
.nys-tile:hover, .nys-tile:focus { border-color: var(--accent); background: rgba(201,162,75,0.07); transform: translateY(-2px); outline: none; }
.nys-tl { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.nys-tile strong { font-family: var(--sans); font-variant-numeric: lining-nums tabular-nums; font-size: 1.9rem; line-height: 1.1; color: var(--paper); font-weight: 600; letter-spacing: -0.01em; }
.nys-td .up, .nys-td .down, .nys-td .flat, .up, .down { font-size: 0.82rem; font-weight: 600; }
.nys-td .up, .nys-td .down, td.up, td.down { color: var(--accent-bright); } /* direction only: a rise or fall is not good or bad by itself */ .nys-flat, .flat { color: var(--muted); font-size: 0.82rem; }
.nys-tr { font-size: 0.78rem; color: var(--paper-dim); } .nys-tn { font-size: 0.72rem; color: var(--accent); margin-top: 4px; }
.nys-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 24px; }

.nys-block { margin: 34px 0; }
.nys-block h3, .nys-limits h3, .nys-convert h3, .nys-run h3, .nys-results h3 { font-size: 1.5rem; margin: 0 0 8px; }
.nys-signal { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 12px; padding: 18px 20px; margin: 14px 0; background: rgba(255,255,255,0.03); }
.nys-signal h4 { font-size: 1.1rem; margin: 0 0 10px; color: var(--paper); }
.nys-signal dl { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; margin: 0 0 14px; font-size: 0.93rem; }
.nys-signal dt { color: var(--accent); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; padding-top: 3px; } .nys-signal dd { margin: 0; color: var(--paper-dim); line-height: 1.55; }
.nys-src { color: var(--muted); font-size: 0.76rem; margin-top: 4px; }

.nys-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin-top: 38px; }
.nys-tabs button { background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--paper-dim); padding: 10px 14px; cursor: pointer; font: inherit; font-weight: 500; }
.nys-tabs button.is-on { color: var(--accent-bright); border-bottom-color: var(--accent); }
.nys-tabpanel { padding: 18px 0 6px; } .nys-tabpanel h4 { font-size: 1.05rem; margin: 22px 0 8px; color: var(--paper); }
.nys-tablewrap table { font-size: 0.9rem; } .nys-tablewrap small { color: var(--muted); display: block; font-size: 0.74rem; }
.nys-cmptable th { text-align: left; }
.nys-minibar { height: 5px; background: rgba(255,255,255,0.07); border-radius: 3px; margin-top: 5px; } .nys-minibar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.nys-siglist { margin: 0 0 12px 20px; line-height: 1.6; color: var(--paper-dim); }

.nys-dist { display: grid; gap: 10px; margin: 8px 0; }
.nys-distrow { display: grid; grid-template-columns: minmax(130px, 220px) 1fr; gap: 14px; align-items: center; }
.nys-distlab { font-size: 0.86rem; color: var(--paper-dim); line-height: 1.3; }
.nys-distbars { position: relative; display: grid; gap: 3px; }
.nys-bar { position: relative; height: 15px; background: rgba(255,255,255,0.045); border-radius: 4px; display: flex; align-items: center; }
.nys-bar-fill { display: block; height: 100%; border-radius: 4px; background: var(--accent); min-width: 2px; }
.nys-bar.y0 .nys-bar-fill { background: var(--nwd-slate); opacity: 0.85; }
.nys-bar b { position: absolute; right: 6px; font-size: 0.7rem; font-weight: 600; color: var(--paper); text-shadow: 0 0 3px rgba(0,0,0,.55); }
.nys-mark { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--paper); opacity: 0.8; border-radius: 1px; }
.nys-key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; color: var(--muted); font-size: 0.76rem; margin: 8px 0 14px; }
.nys-key span { width: 12px; height: 12px; border-radius: 3px; display: inline-block; } .nys-key .k0 { background: var(--nwd-slate); } .nys-key .k1 { background: var(--accent); } .nys-key .km { width: 3px; height: 14px; background: var(--paper); }

.nys-run, .nys-results { border: 1px solid var(--accent); border-radius: 14px; padding: 20px 22px; margin: 0 0 24px; background: rgba(201,162,75,0.06); }
.nys-run ol { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.nys-run li { font-size: 0.92rem; color: var(--paper-dim); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; } .nys-run li em { color: var(--muted); font-style: normal; font-size: 0.82rem; }
.nys-check { color: var(--change-up); font-weight: 700; } .nys-spin { width: 12px; height: 12px; border: 2px solid var(--accent); border-right-color: transparent; border-radius: 50%; display: inline-block; animation: nys-spin .7s linear infinite; }
@keyframes nys-spin { to { transform: rotate(360deg); } }
.nys-results { margin-top: 16px; background: transparent; } .nys-results ol { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 10px; } .nys-results li span { display: block; color: var(--paper-dim); font-size: 0.88rem; }
.nys-link { background: none; border: 0; color: var(--accent-bright); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font: inherit; font-weight: 600; padding: 0; text-align: left; }

.nys-convert { border: 1px solid var(--accent); border-radius: 16px; padding: 30px 28px; margin: 46px 0 26px; background: linear-gradient(135deg, rgba(201,162,75,0.14), rgba(201,162,75,0.03)); }
.nys-convert p { color: var(--paper-dim); max-width: 70ch; margin: 0 0 18px; line-height: 1.65; }
.nys-limits { border-top: 1px solid var(--line); margin-top: 30px; padding-top: 26px; color: var(--paper-dim); font-size: 0.9rem; }
.nys-limits ul { margin: 10px 0 14px 20px; display: grid; gap: 6px; line-height: 1.55; } .nys-limits a { color: var(--accent-bright); }
.nys-disc { color: var(--muted); font-size: 0.8rem; line-height: 1.55; border-left: 2px solid var(--line); padding-left: 12px; margin-top: 12px; }

.nys-drawer { position: fixed; inset: 0; background: rgba(20,14,6,0.7); z-index: 200; display: flex; justify-content: flex-end; }
.nys-drawer[hidden] { display: none; }
.nys-drawer-in { position: relative; width: min(1040px, 100%); height: 100%; overflow-y: auto; overflow-x: hidden; background: var(--ink-900); border-left: 1px solid var(--accent); padding: 32px 28px 60px; }
.nys-drawer-in h3 { font-size: 1.5rem; margin: 0 40px 6px 0; }
.nys-drawer-in h4 { margin: 24px 0 8px; font-size: 1.02rem; }
.nys-x { position: absolute; top: 14px; right: 16px; background: transparent; color: var(--paper); border: 1px solid var(--line); border-radius: 8px; width: 36px; height: 36px; font-size: 1.4rem; cursor: pointer; line-height: 1; }
body.nys-lock { overflow: hidden; }
.nys-hero-note { max-width: 70ch; }

@media (max-width: 1020px) { .nys-filters { grid-template-columns: repeat(2, 1fr); } .nys-filters .nys-field-wide { grid-column: 1 / -1; } .nys-grid { grid-template-columns: 1fr; } .nys-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .nys-list { max-height: 420px; } }
@media (max-width: 640px) {
  .nys-filters, .nys-compare .nys-filters { grid-template-columns: 1fr; }
  .nys-tiles { grid-template-columns: 1fr; } .nys-tile strong { font-size: 1.7rem; }
  .nys-signal dl { grid-template-columns: 1fr; gap: 2px 0; } .nys-signal dt { padding-top: 8px; }
  .nys-distrow { grid-template-columns: 1fr; gap: 4px; }
  .nys-drawer-in { padding: 26px 16px 50px; } .nys-convert { padding: 22px 18px; }
}

.nys-signal dt.nys-warn { color: var(--change-down); } .nys-signal dd.nys-warn { color: var(--paper); background: rgba(201,115,107,0.10); border-radius: 8px; padding: 8px 10px; }

/* Tables inside the explorer stay inside their column (the article-table breakout in styles.css would push them out of the drawer) */
.nys-wrap .tp-table-wrap, .nys-drawer .tp-table-wrap { margin-left: 0; margin-right: 0; width: 100%; max-width: 100%; }
.nys-drawer .tp-table th, .nys-drawer .tp-table td, .nys-wrap .tp-table th, .nys-wrap .tp-table td { padding: 11px 12px; }
.nys-drawer .tp-table, .nys-wrap .tp-table { width: 100%; table-layout: auto; }
.nys-drawer-in .nys-dist { max-width: 100%; }
@media (max-width: 640px) { .nys-drawer .tp-table th, .nys-drawer .tp-table td, .nys-wrap .tp-table th, .nys-wrap .tp-table td { padding: 8px 8px; font-size: 0.8rem; } }

/* Phones: stack table rows into labeled cards so nothing scrolls sideways */
@media (max-width: 640px) {
  .nys-stack, .nys-stack tbody, .nys-stack tr, .nys-stack td { display: block; width: 100%; }
  .nys-stack thead { position: absolute; left: -9999px; }
  .nys-stack tr { border-top: 1px solid var(--line); padding: 10px 12px; }
  .nys-stack td { border: 0 !important; padding: 3px 0 !important; display: flex; justify-content: space-between; gap: 14px; text-align: right; }
  .nys-stack td:first-child { display: block; text-align: left; font-weight: 600; color: var(--paper); padding-bottom: 6px !important; }
  .nys-stack td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; text-align: left; flex: 0 0 46%; padding-top: 2px; }
  .nys-stack .nys-minibar { display: none; }
}

.nys-tile.is-na { cursor: default; opacity: 0.55; } .nys-tile.is-na:hover { transform: none; border-color: var(--line); background: rgba(255,255,255,0.035); }
.nys-tile.is-na strong { color: var(--muted); }
.nys-sub4 { font-size: 1.05rem; margin: 22px 0 8px; color: var(--paper); }
.nys-distlab small { color: var(--muted); font-size: 0.74rem; margin-left: 6px; }
.nys-field .nys-yearpick { align-self: start; }
