/* Hazard Mapper: the work order and choices beside the county map table, inside the practice shell's stage. */
.hm { position: absolute; inset: 0; display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 12px; padding: 8px 12px; color: var(--tlg-text, #172c38); }
.hm-panel { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; padding: 2px; }

/* the work order */
.hm-ticket { padding: 8px 12px 10px; border-radius: var(--tlg-radius-lg, 14px); border: 2px dashed #c79a6a; background: #fbf5ea; color: #2b1d10; }
.hm-ticket-k { margin: 0 0 6px; font-size: 16px; font-weight: 800; text-transform: uppercase; letter-spacing: var(--tlg-tracking-caps, .08em); color: #7a3b12; }
.hm-layers { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.hm-layers-k { font-size: 16px; font-weight: 700; margin-right: 2px; }
.hm-layer { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px 3px 4px; border-radius: 999px; background: #fffdf6; border: 2px solid currentColor; font-size: 17px; font-weight: 800; }
.hm-layer-i { display: inline-grid; width: 30px; height: 30px; }
.hm-layer-i svg { width: 30px; height: 30px; }
.hm-layer--flood { color: #174a80; } .hm-layer--fault { color: #7d1616; } .hm-layer--volcano { color: #6e2e0b; } .hm-layer--wildfire { color: #6b4500; }
.hm-rule { margin: 8px 0 0; font-size: 16px; font-weight: 600; line-height: 1.35; }
.hm-rule.is-formula { font-size: 18px; font-weight: 800; padding: 6px 10px; border-radius: 10px; background: #fff; border: 1.5px solid #e2c9a6; }
html[data-theme="dark"] .hm-ticket { background: #2c2116; color: #f6e9d6; border-color: #9a6b3e; }
html[data-theme="dark"] .hm-ticket-k { color: #ffbf8a; }
html[data-theme="dark"] .hm-layer { background: #1d1914; }
html[data-theme="dark"] .hm-layer--flood { color: #9cc8f5; } html[data-theme="dark"] .hm-layer--fault { color: #ff9c9c; }
html[data-theme="dark"] .hm-layer--volcano { color: #f5b38a; } html[data-theme="dark"] .hm-layer--wildfire { color: #ffd27a; }
html[data-theme="dark"] .hm-rule.is-formula { background: #1d1914; border-color: #6b4a2b; }

/* AP map readings */
.hm-read { border-collapse: collapse; font-size: 17px; width: 100%; font-variant-numeric: tabular-nums; }
.hm-read caption { text-align: left; font-size: 16px; font-weight: 800; padding-bottom: 4px; }
.hm-read th, .hm-read td { border: 1.5px solid var(--tlg-border, #c9b98f); padding: 4px 8px; text-align: center; }
.hm-read thead th, .hm-read tr:first-child th { background: var(--tlg-surface-2, rgba(0, 0, 0, .04)); }

/* choices */
.hm-field { border: 0; margin: 0; padding: 0; min-width: 0; }
.hm-field legend { padding: 0; margin: 0 0 6px; font-size: 16px; font-weight: 800; }
.hm-sites { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hm-sites.is-two { grid-template-columns: repeat(2, 1fr); }
.hm-site, .hm-action { position: relative; font: inherit; cursor: pointer; color: var(--tlg-text, #172c38); background: var(--tlg-surface, #fff); border: 2px solid var(--tlg-border, #a5b6c1);
  border-radius: 12px; box-shadow: 0 2px 0 rgba(0, 0, 0, .1); touch-action: manipulation; }
.hm-site { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 6px; min-height: 78px; }
.hm-site-i svg { width: 44px; height: 44px; display: block; }
.hm-site-l { font-size: 17px; font-weight: 800; }
.hm-actions { display: grid; gap: 8px; }
.hm-action { display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 10px; padding: 6px 26px 6px 10px; min-height: 52px; text-align: left; }
.hm-action-i svg { width: 40px; height: 40px; display: block; }
.hm-action-l { font-size: 17px; font-weight: 700; line-height: 1.25; }
.hm-site:hover:not(:disabled), .hm-action:hover:not(:disabled) { border-color: #7a3b12; }
.hm-site[aria-pressed="true"], .hm-action[aria-pressed="true"] { border-color: #7a3b12; border-width: 3px; background: #fdf0e0; box-shadow: 0 0 0 3px rgba(122, 59, 18, .25); }
.hm-site[aria-pressed="true"] .hm-site-l::before, .hm-action[aria-pressed="true"] .hm-action-l::before { content: '● '; color: #7a3b12; }
html[data-theme="dark"] .hm-site[aria-pressed="true"], html[data-theme="dark"] .hm-action[aria-pressed="true"] { background: #3a2716; border-color: #ffbf8a; }
html[data-theme="dark"] .hm-site[aria-pressed="true"] .hm-site-l::before, html[data-theme="dark"] .hm-action[aria-pressed="true"] .hm-action-l::before { color: #ffbf8a; }
.hm-site:disabled, .hm-action:disabled { cursor: default; opacity: 1; }
.hm-site.is-ok, .hm-action.is-ok { border-color: #2e8b57; border-width: 3px; }
.hm-site.is-bad, .hm-action.is-bad { border-color: #b42318; border-style: dashed; border-width: 3px; }
.hm-mark { position: absolute; top: 2px; right: 6px; font-size: 18px; font-weight: 900; }
.hm-site.is-ok .hm-mark, .hm-action.is-ok .hm-mark { color: #1d6b40; }
.hm-site.is-bad .hm-mark, .hm-action.is-bad .hm-mark { color: #b42318; }
html[data-theme="dark"] .hm-site.is-ok .hm-mark, html[data-theme="dark"] .hm-action.is-ok .hm-mark { color: #8fe0ad; }
html[data-theme="dark"] .hm-site.is-bad .hm-mark, html[data-theme="dark"] .hm-action.is-bad .hm-mark { color: #ffb4a8; }
.hm-msg { margin: 0; min-height: 0; font-size: 16px; font-weight: 700; color: #8a3b12; }
.hm-msg:empty { display: none; }
html[data-theme="dark"] .hm-msg { color: #ffbf8a; }
.hm-about { font-size: 16px; line-height: 1.45; }
.hm-about summary { cursor: pointer; font-weight: 700; }
.hm-about p { margin: 6px 0 0; }

/* the map table */
.hm-view { position: relative; min-width: 0; min-height: 0; display: flex; align-items: flex-start; justify-content: center; }
.hm-scene { position: relative; width: 100%; aspect-ratio: 720 / 620; border-radius: var(--tlg-radius-lg, 14px); overflow: hidden; border: var(--tlg-border-width, 1px) solid var(--tlg-border, #a5b6c1); user-select: none; -webkit-user-select: none; }
.hm-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hm-table { fill: url(#hm-g-table); }
html[data-theme="dark"] .hm-table { fill: url(#hm-g-table-d); }
.hm-rail { fill: #3b2a1c; }
.hm-tray { fill: #2e2116; fill-opacity: .55; }
.hm-contour { stroke: #8f7f52; stroke-width: 1.2; stroke-opacity: .45; }
.hm-road { fill: none; stroke: #f6f1e4; stroke-width: 7; stroke-linecap: round; filter: drop-shadow(0 0 1px #8b7a58); }
.hm-river-bank { fill: none; stroke: #a7c7a0; stroke-width: 34; stroke-linecap: round; stroke-linejoin: round; }
.hm-river { fill: none; stroke: #3d84c8; stroke-width: 18; stroke-linecap: round; stroke-linejoin: round; }
.hm-river-hi { fill: none; stroke: #8fc4ee; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 18 26; }
.hm-fault { fill: none; stroke: #8e1b1b; stroke-width: 5; stroke-linejoin: round; stroke-linecap: round; }
.hm-fault-tick { stroke: #8e1b1b; stroke-width: 3; }
.hm-valley { fill: none; stroke: #8a5a3a; stroke-width: 6; stroke-linecap: round; stroke-dasharray: 2 9; }
.hm-pin { cursor: pointer; }
.hm.is-locked .hm-pin, .hm.is-locked .hm-trade { cursor: default; }
.hm-trade { cursor: pointer; }
.hm-pin-bg { fill: #fffdf6; stroke: #3b2a1c; stroke-width: 3; }
.hm-pin:hover .hm-pin-bg { stroke: #7a3b12; stroke-width: 4; }
.hm.is-locked .hm-pin:hover .hm-pin-bg { stroke: #3b2a1c; stroke-width: 3; }
.hm-pin-tag { fill: #3b2a1c; stroke: #fffdf6; stroke-width: 2.5; }
.hm-pin.is-chosen .hm-pin-tag { fill: #c2410c; }
.hm-pin-pick { stroke: #c2410c; stroke-width: 6; stroke-dasharray: 10 6; }
.hm-card { fill: #fbf6e8; stroke: #c9b98f; stroke-width: 2; }
.hm-card.is-chosen { stroke: #c2410c; stroke-width: 5; stroke-dasharray: 12 6; }
.hm-note { fill: #fff8df; stroke: #c9a24a; stroke-width: 2; }
.hm-sky { fill: url(#hm-g-sky); }
html[data-theme="dark"] .hm-card, html[data-theme="dark"] .hm-note { fill: #2a2219; stroke: #7a6a44; }
html[data-theme="dark"] .hm-sky { fill: url(#hm-g-sky-d); }

.hm-t { font-family: var(--tlg-font-body, system-ui, sans-serif); fill: #1d2b2f; }
.hm-t-rail { font-size: 19px; font-weight: 800; fill: #f6e7c8; letter-spacing: .03em; }
.hm-t-zk { font-size: 18px; font-weight: 900; letter-spacing: .04em; }
.hm-t-zv { font-size: 17px; font-weight: 800; fill: #1d2b2f; }
.hm-t-pin { font-size: 20px; font-weight: 900; fill: #ffffff; pointer-events: none; }
.hm-t-big { font-size: 26px; }
.hm-t-chip { font-size: 18px; font-weight: 800; fill: #1d2b2f; }
.hm-chip rect { fill: #fffdf6; stroke: #3b2a1c; stroke-width: 2; }
.hm-chip.is-ok rect { fill: #e6f6ea; stroke: #1d6b40; stroke-width: 3; }
.hm-chip.is-ok .hm-t-chip { fill: #14532d; }
.hm-chip.is-bad rect { fill: #fdecea; stroke: #b42318; stroke-width: 3; stroke-dasharray: 6 4; }
.hm-chip.is-bad .hm-t-chip { fill: #8a1a10; }
.hm-t-tray { font-size: 18px; font-weight: 700; fill: #fff6e6; }
.hm-t-fine { font-size: 17px; font-weight: 600; fill: #f1e2c6; font-style: italic; }
.hm-t-head { font-size: 19px; font-weight: 800; fill: #f6e7c8; }
.hm-t-mini { font-size: 17px; font-weight: 800; fill: #1d2b2f; }
.hm-t-tag { font-size: 19px; font-weight: 800; fill: #1d2b2f; paint-order: stroke; stroke: #fffdf6; stroke-width: 4px; }
.hm-t-ledk { font-size: 19px; font-weight: 800; fill: #4a2a10; }
.hm-t-led { font-size: 18px; font-weight: 600; fill: #2b2418; }
.hm-t-ledv { font-size: 19px; font-weight: 800; fill: #2b2418; font-variant-numeric: tabular-nums; }
.hm-t-ledv.is-ok { fill: #14532d; } .hm-t-ledv.is-bad { fill: #b42318; }
html[data-theme="dark"] .hm-t-ledk { fill: #ffcf9a; }
html[data-theme="dark"] .hm-t-led, html[data-theme="dark"] .hm-t-ledv { fill: #f6ecd2; }
html[data-theme="dark"] .hm-t-ledv.is-ok { fill: #8fe0ad; } html[data-theme="dark"] .hm-t-ledv.is-bad { fill: #ffb4a8; }

/* reveal badge (over the rail) */
.hm-badge { position: absolute; left: 2%; right: 2%; top: 1%; padding: 7px 12px; border-radius: 10px; font-size: 17px; font-weight: 700; line-height: 1.3; pointer-events: none;
  background: rgba(255, 255, 255, .97); color: #10202c; border: 3px solid #7a3b12; box-shadow: 0 3px 8px rgba(0, 0, 0, .25); animation: hm-pop .25s ease-out; }
.hm-badge.is-ok { border-color: #1d6b40; }
.hm-badge.is-bad { border-color: #b42318; }
@keyframes hm-pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }

/* briefing + start */
.hm-example-svg { display: block; width: 100%; height: auto; max-height: 460px; }
.hm-start-svg { display: block; width: 100%; height: 100%; }

@media (prefers-reduced-motion: reduce) { .hm-badge { animation: none; } }
@media (max-width: 1100px) { .hm { grid-template-columns: 300px minmax(0, 1fr); } }
@media (max-width: 900px) {
  .hm { position: static; grid-template-columns: 1fr; }
  .hm-panel { overflow: visible; }
  .hm-view { display: block; order: -1; }
  .hm-scene { width: 100% !important; }
}
.hm-t-n { font-size: 17px; font-weight: 900; fill: #fffdf6; paint-order: stroke; stroke: #5b4a32; stroke-width: 3px; dominant-baseline: middle; }
.hm-t-good { fill: #14532d; }
.hm-t-warn { fill: #9a3412; }
.hm-t-sign { font-size: 18px; font-weight: 900; fill: #ffffff; }
