/* The POD Index — state picker / order builder. Uses the tokens in app.css. */
.pk { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(330px, 1fr); gap: 22px; align-items: start; }
@media (max-width: 960px) { .pk { grid-template-columns: 1fr; } }

/* ---------- map side ---------- */
.pk-mapcard { background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); padding: 16px 16px 14px; position: relative; }
.pk-lens { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.pk-lens .chip { padding: 5px 12px; font-size: 13px; }
.pk-lens .pk-hint { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.pk-map { width: 100%; height: auto; display: block; touch-action: manipulation; }
.pk-map path { transition: fill .22s ease, stroke .15s ease; stroke: #fff; stroke-width: 1; }
.pk-map path.pk-ctl { cursor: pointer; }
.pk-map path.pk-ctl:hover { filter: brightness(1.08); }
.pk-map path.pk-sel { stroke: #1a1a18; stroke-width: 2.6; }
.pk-map text { font: 700 10.5px var(--font-ui); pointer-events: none; text-anchor: middle;
  dominant-baseline: central; paint-order: stroke; stroke: #fff; stroke-width: 3px;
  stroke-linejoin: round; fill: #1a1a18; letter-spacing: .02em; }
.pk-map text.pk-sel { fill: #fff; stroke: #1a1a18; }
.pk-map text.pk-off { fill: #8a8983; font-weight: 600; }

.pk-legend { display: flex; gap: 14px; flex-wrap: wrap; margin: 6px 0 12px; font-size: 12px; color: var(--muted); }
.pk-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 5px; }

.pk-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
.pk-chip { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 9px;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font-size: 13px; font-weight: 700;
  color: var(--ink); transition: border-color .12s, background .12s, color .12s; }
.pk-chip:hover { border-color: var(--gold-bd); }
.pk-chip .pk-mini { display: inline-flex; gap: 2px; align-items: flex-end; height: 16px; }
.pk-chip .pk-mini i { display: block; width: 5px; border-radius: 2px 2px 0 0; background: #2e7d4f; min-height: 2px; }
.pk-chip .pk-mini i.none { background: var(--line); height: 2px !important; }
.pk-chip.on { background: var(--dark); border-color: var(--dark); color: #fff; }
.pk-chip.on .pk-mini i { background: #9ed2ad; }
.pk-chip.on .pk-mini i.none { background: #5c5b56; }
.pk-chip.na { opacity: .45; cursor: not-allowed; }

/* hover preview */
.pk-tip { position: absolute; z-index: 20; width: 300px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 12px 14px; pointer-events: none;
  opacity: 0; transform: translateY(4px); transition: opacity .12s ease, transform .12s ease; }
.pk-tip.show { opacity: 1; transform: none; }
.pk-tip h4 { font-family: var(--font-display); font-size: 16px; margin-bottom: 6px; display: flex;
  justify-content: space-between; align-items: baseline; gap: 8px; }
.pk-tip .pk-add { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line);
  font-size: 12.5px; font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.pk-tip .pk-add b { color: var(--green); font-family: var(--font-mono); }

/* ---------- a state's contents (shared by order cards and the hover preview) ---------- */
.pk-ch { margin-top: 9px; }
.pk-ch-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; font-weight: 600; }
.pk-ch-h .pk-n { font-family: var(--font-mono); font-size: 12.5px; }
.pk-ch-h .pk-n em { font-style: normal; font-family: var(--font-ui); color: var(--muted); font-weight: 500; }
.pk-ch-h .pk-na { font-weight: 500; color: var(--muted); font-size: 12.5px; }
.pk-ch.pk-ch-na { opacity: .7; }
.pk-bar { height: 10px; border-radius: 999px; background: #e3e9da; overflow: hidden; margin: 6px 0 5px; }
.pk-bar i { display: block; height: 100%; width: var(--w); border-radius: 999px;
  background: linear-gradient(90deg, #1e5b2f, #3f8f52); }
.pk-new .pk-bar i { animation: pk-grow .55s cubic-bezier(.2,.7,.2,1) both; }
@keyframes pk-grow { from { width: 0; } }
.pk-leg { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.pk-leg b { color: var(--ink); font-family: var(--font-mono); font-weight: 600; }
.pk-leg .deep::before, .pk-leg .shallow::before { content: ""; display: inline-block; width: 8px; height: 8px;
  border-radius: 2px; margin-right: 5px; }
.pk-leg .deep::before { background: #1e5b2f; }
.pk-leg .shallow::before { background: #cfd8c4; }
.pk-leg u { text-decoration: none; font-weight: 700; color: var(--green); margin-left: 3px; }
.pk-extra { margin-top: 5px; font-size: 11.5px; color: #6d5312; background: var(--gold-lt);
  border: 1px solid var(--gold-bd); border-radius: 7px; padding: 3px 8px; display: inline-block; }
.pk-note { margin-top: 4px; font-size: 11.5px; color: var(--muted); }

/* ---------- order side ---------- */
.pk-order { position: sticky; top: 66px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column;
  max-height: calc(100vh - 84px); }
@media (max-width: 960px) { .pk-order { position: static; max-height: none; } }
.pk-order-h { padding: 14px 16px 10px; display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px solid var(--line); }
.pk-order-h h3 { font-size: 18px; }
.pk-order-h button { border: 0; background: none; color: var(--muted); font-size: 12.5px; text-decoration: underline; }
.pk-list { padding: 4px 16px 10px; overflow: auto; flex: 1; min-height: 120px; }
.pk-empty { text-align: center; padding: 26px 8px 18px; color: var(--muted); font-size: 14px; }
.pk-empty .pk-quick { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.pk-card { padding: 8px 0; border-bottom: 1px solid var(--line); }
.pk-card.open { padding: 11px 0 13px; }
.pk-card-h[data-open] { cursor: pointer; border-radius: 8px; outline-offset: 2px; }
.pk-minis { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.pk-mbar { display: inline-block; width: 30px; height: 6px; border-radius: 999px; background: #e3e9da; overflow: hidden; }
.pk-mbar i { display: block; height: 100%; background: #1e5b2f; border-radius: 999px; }
.pk-mp { font: 600 11px var(--font-mono); color: var(--ink); min-width: 29px; }
.pk-mp.none { color: var(--muted); font-weight: 400; }
.pk-card:last-child { border-bottom: 0; }
.pk-card.pk-new { animation: pk-in .24s ease both; }
@keyframes pk-in { from { opacity: 0; transform: translateY(-6px); } }
.pk-card-h { display: flex; align-items: center; gap: 9px; }
.pk-card-h .pk-badge { font: 700 11.5px var(--font-mono); background: var(--dark); color: #fff;
  border-radius: 6px; padding: 2px 6px; }
.pk-card-h h4 { font-family: var(--font-display); font-size: 16px; flex: 1; min-width: 0; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.pk-card-h .pk-asof { font-size: 11.5px; color: var(--muted); }
.pk-card-h .pk-x { border: 0; background: none; font-size: 17px; line-height: 1; color: var(--muted); padding: 2px 4px; }
.pk-card-h .pk-x:hover { color: var(--red); }
.pk-incl { font-size: 11px; font-weight: 600; color: var(--gold); }

.pk-sum { border-top: 1px solid var(--line); padding: 12px 16px 16px; background: #fbfaf7;
  border-radius: 0 0 16px 16px; }
.pk-totals { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.pk-totals b { color: var(--ink); font-family: var(--font-mono); }
.pk-line { display: flex; justify-content: space-between; font-size: 13.5px; padding: 2px 0; }
.pk-line.save { color: var(--green); font-weight: 600; }
.pk-line.total { font-size: 15px; font-weight: 700; margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line);
  align-items: baseline; }
.pk-line.total .pk-price { font-family: var(--font-display); font-size: 30px; }
.pk-line.total small { font-weight: 500; color: var(--muted); font-size: 12px; margin-left: 6px; }
.pk-nudge { margin-top: 10px; font-size: 12.5px; border-radius: 9px; padding: 8px 11px;
  background: var(--green-lt); border: 1px solid var(--green-bd); color: #1d4d33;
  display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pk-nudge button { border: 1px solid #1d4d33; background: #fff; color: #1d4d33; font-weight: 700;
  font-size: 12px; border-radius: 7px; padding: 4px 9px; white-space: nowrap; }
.pk-cta { width: 100%; margin-top: 12px; padding: 13px 18px; font-size: 15.5px; }
.pk-fine { margin-top: 9px; font-size: 12px; color: var(--muted); text-align: center; }

/* mobile sticky total */
.pk-bar-m { display: none; }
@media (max-width: 960px) {
  .pk-bar-m { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 400; gap: 12px;
    align-items: center; justify-content: space-between; padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.97); backdrop-filter: blur(8px); border-top: 1px solid var(--line);
    transform: translateY(110%); transition: transform .2s ease; }
  .pk-bar-m.show { transform: none; }
  .pk-bar-m b { font-family: var(--font-display); font-size: 21px; }
  .pk-bar-m span { font-size: 12.5px; color: var(--muted); display: block; }
}

/* all-states table */
.pk-table td.num, .pk-table th.num { text-align: right; font-family: var(--font-mono); font-size: 12.5px; }
.pk-table tbody tr.on { background: var(--green-lt); }
.pk-table .pk-tbar { display: inline-block; width: 46px; height: 6px; border-radius: 999px; background: #e3e9da;
  overflow: hidden; vertical-align: 1px; margin-right: 6px; }
.pk-table .pk-tbar i { display: block; height: 100%; background: #1e5b2f; }
