/* The Real USA web map (tools/webmap/site): the map viewer's look (tools/mapview/static/style.css), read only */
:root {
  --bg: #15171b;
  --panel: rgba(24, 27, 32, 0.94);
  --menu: rgba(22, 24, 29, 0.97);
  --panel-line: rgba(255, 255, 255, 0.10);
  --text: #e8e6e1;
  --muted: #a3a29c;
  --accent: #f0b54a;
  --input: #2a2e35;
  --on: #e5484d;
  --off: #4a4e57;
  --link: #8cc4ff;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text);
  font: 13px/1.4 system-ui, "Segoe UI", Roboto, Arial, sans-serif; }
#map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#map.dragging { cursor: grabbing; }
.panel { position: absolute; background: var(--panel); border: 1px solid var(--panel-line); border-radius: 8px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35); z-index: 2; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; line-height: 1.45; }
button { background: var(--input); color: var(--text); border: 1px solid var(--panel-line); border-radius: 6px;
  padding: 4px 9px; font: inherit; cursor: pointer; }
button:hover { border-color: var(--accent); }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.close { padding: 0 7px; font-size: 16px; line-height: 20px; }
a { color: var(--link); }

/* the top bar: the search field on the left, the news and menu buttons on the right */
#bar { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; align-items: flex-start; gap: 10px;
  z-index: 6; pointer-events: none; }
#bar > * { pointer-events: auto; }
#searchWrap { position: relative; flex: 0 1 520px; min-width: 0; }
#searchWrap .mag { position: absolute; left: 15px; top: 12px; width: 20px; height: 20px; fill: none;
  stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; pointer-events: none; }
#search { width: 100%; height: 44px; border-radius: 22px; border: 1px solid var(--panel-line); background: var(--menu);
  color: var(--text); font: 15px system-ui, "Segoe UI", sans-serif; padding: 0 18px 0 46px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35); }
#search::placeholder { color: var(--muted); }
#search:focus { outline: none; border-color: rgba(240, 181, 74, 0.7); }
#results { position: absolute; left: 0; right: 0; top: 50px; background: var(--menu); border: 1px solid var(--panel-line);
  border-radius: 14px; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45); padding: 6px; max-height: min(60vh, 520px);
  overflow: auto; }
#results .res { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 9px; cursor: pointer; }
#results .res.sel, #results .res:hover { background: rgba(255, 255, 255, 0.07); }
#results .ico { width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font: 700 10px system-ui, sans-serif; color: #fff; }
#results .txt { min-width: 0; }
#results .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#results .s { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#results .none { padding: 8px 10px; color: var(--muted); }
#newsBtn { margin-left: auto; position: relative; }
.round.pill { width: auto; padding: 0 18px; border-radius: 22px; color: var(--text); font: inherit; font-size: 15px;
  font-weight: 600; letter-spacing: 0.02em; }
#newsBtn.pill .dot { top: 4px; right: 4px; }
#menuWrap { position: relative; }
.round { width: 44px; height: 44px; border-radius: 50%; padding: 0; display: grid; place-items: center; flex: none;
  background: var(--menu); box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35); }
.round svg { width: 22px; height: 22px; fill: none; stroke: var(--text); stroke-width: 2.2; stroke-linecap: round;
  stroke-linejoin: round; }
.round[aria-expanded="true"] { border-color: var(--accent); }
#newsBtn .dot { position: absolute; top: 7px; right: 7px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--on); border: 2px solid var(--menu); }
#menu { position: absolute; right: 0; top: 52px; width: 300px; max-width: calc(100vw - 24px);
  max-height: calc(100vh - 80px); overflow: auto; background: var(--menu); border: 1px solid var(--panel-line);
  border-radius: 16px; box-shadow: 0 10px 32px rgba(0, 0, 0, 0.5); padding: 8px; }
#menu .mrow { display: flex; width: 100%; align-items: center; justify-content: space-between; text-align: left;
  background: none; border: 0; border-radius: 10px; padding: 10px 12px; font-size: 14px; }
#menu .mrow:hover, #menu .trow:hover { background: rgba(255, 255, 255, 0.06); }
#menu a.mrow { color: var(--link); text-decoration: none; box-sizing: border-box; }
#menu .mhead { margin: 10px 12px 4px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; }
#menu .trow { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; cursor: pointer;
  user-select: none; font-size: 14px; }
#menu .trow span { flex: 1; }
#menu kbd { font: 700 11px Consolas, monospace; color: var(--muted); border: 1px solid var(--panel-line); border-radius: 5px;
  padding: 1px 6px; background: rgba(255, 255, 255, 0.04); }
/* the pill switches: red when on, grey when off */
.switch { appearance: none; -webkit-appearance: none; margin: 0; flex: none; width: 40px; height: 22px; border-radius: 11px;
  background: var(--off); position: relative; cursor: pointer; transition: background 0.15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: left 0.15s; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }
.switch:checked { background: var(--on); }
.switch:checked::after { left: 21px; }

#zoom { top: 68px; left: 12px; display: flex; flex-direction: column; padding: 4px; gap: 4px; }
#zoom button { width: 34px; height: 34px; font-size: 20px; line-height: 1; padding: 0; }

.side .head { font-weight: 700; font-size: 14px; margin-bottom: 6px; display: flex; justify-content: space-between;
  align-items: center; gap: 8px; }
.side { right: 12px; top: 68px; width: 340px; max-height: calc(100% - 136px); overflow: auto; padding: 10px 12px; z-index: 4; }
#inspect { left: 12px; right: auto; top: 154px; width: 280px; }
#legend { left: 12px; right: auto; top: auto; bottom: 52px; width: 340px; max-height: calc(50% - 40px); }
#legendBody .grp, #aboutBody .grp { margin: 8px 0 3px; color: var(--muted); font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.05em; }
#legendBody .item { display: flex; gap: 7px; align-items: center; margin: 1px 0; }
#legendBody .sw { width: 14px; height: 14px; border-radius: 3px; flex: none; border: 1px solid rgba(0, 0, 0, 0.4); }
#legendBody .nat { display: flex; flex-wrap: wrap; gap: 2px; }
#legendBody .nat .sw { width: 12px; height: 12px; }
#legendBody .note { color: var(--muted); font-size: 12px; margin: 4px 0; }
#aboutBody p { margin: 0 0 8px; }
#credits { white-space: pre-wrap; word-break: break-word; font: 11.5px/1.45 system-ui, "Segoe UI", sans-serif;
  color: var(--muted); margin: 0; }

/* the news: newest first, the pinned ones on top */
#news { width: 380px; }
#newsBody .item { border-top: 1px solid var(--panel-line); padding: 10px 0 4px; }
#newsBody .item:first-child { border-top: 0; padding-top: 2px; }
#newsBody h3 { margin: 0 0 2px; font-size: 15px; line-height: 1.3; }
#newsBody .item.new h3::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--on); margin: 0 7px 2px 0; vertical-align: middle; }
#newsBody .date { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
#newsBody p { margin: 0 0 8px; overflow-wrap: anywhere; }

#toast { left: 50%; bottom: 48px; transform: translateX(-50%); padding: 7px 14px; z-index: 7; max-width: calc(100% - 24px); }
#status { left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 12px 18px; z-index: 7; font-size: 14px;
  max-width: calc(100% - 32px); text-align: center; }
#readout { left: 50%; bottom: 10px; transform: translateX(-50%); padding: 5px 12px; font: 13px Consolas, monospace;
  white-space: nowrap; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; }
#readout #info { color: var(--muted); margin-left: 10px; }
#attrib { position: absolute; right: 0; bottom: 0; z-index: 3; padding: 2px 8px; font-size: 11px; color: var(--muted);
  background: rgba(21, 23, 27, 0.78); border-top-left-radius: 6px; }
#attrib .short { display: none; }
.link { background: none; border: 0; padding: 0; color: var(--link); text-decoration: underline; font: inherit; cursor: pointer; }

@media (max-width: 720px) {
  #bar { top: 8px; left: 8px; right: 8px; gap: 8px; }
  #searchWrap { flex: 1 1 auto; }
  #search { font-size: 15px; padding-right: 10px; }
  #newsBtn { margin-left: 0; }
  #menu { width: calc(100vw - 16px); right: 0; }
  .side, #inspect, #legend, #news { left: 8px; right: 8px; width: auto; top: 62px; bottom: auto; max-height: calc(100% - 150px); }
  #inspect { top: auto; bottom: 64px; }
  #zoom { top: 62px; left: 8px; }
  #readout { bottom: 26px; font-size: 12px; }
  #attrib { left: 0; right: 0; border-radius: 0; text-align: center; }
  #attrib .full { display: none; }
  #attrib .short { display: inline; }
}
