/* The map in the iPhone app's layout, finished (map-app.js). Applies only under body.mp-app, which map-app.js sets
   for ?layout=app (remembered on the device until ?layout=classic). Builds on map-hud.css. */

/* ---- the app's palette: near-black cards, a hairline edge, orange for what is on ---- */
.mp-app { --app-card: #101512; --app-card2: #171e1a; --app-line: #2a342d; --app-ink: #f4f1ea; --app-dim: #a3ada6; --app-on: #ff7a33; --app-on-ink: #1a0d05; background: #101512; }

/* the state chip: its two letters in orange, as in the app */
.mp-app .hud-chip.app-state { padding: 0 14px; letter-spacing: .04em; }
.mp-app .hud-chip.app-state .hud-label { color: var(--app-on); font-weight: 800; }
.mp-app .hud-chip.app-state.on .hud-label { color: var(--app-on-ink); }
.mp-app .hud-chip.app-state::after { content: ""; width: 8px; height: 8px; margin-left: 2px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); opacity: .7; }

/* ---- the unit and elevation pill, under the chips ---- */
.app-pill { position: absolute; top: 64px; left: 58px; z-index: 1040; max-width: calc(100% - 140px); margin: 0; display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--app-line); background: rgba(16, 21, 18, .94); color: var(--app-ink); font: 700 14px system-ui, -apple-system, "Segoe UI", sans-serif; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
.app-pill[hidden] { display: none; }
.app-pill small { color: var(--app-on); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.app-pill:hover, .app-pill:focus-visible { background: rgba(32, 40, 35, .98); outline: none; }
/* the "where" line the map writes moves down out of the pill's way */
.mp-app .mp-where { top: 110px; }
.mp-app .leaflet-top.leaflet-left { top: 110px; }

/* ---- round buttons: four of them, in the app's dress ---- */
.mp-app .hud-round { background: rgba(16, 21, 18, .94); border-color: var(--app-line); }
.mp-app .hud-round.on { background: var(--app-on); border-color: var(--app-on); color: var(--app-on-ink); }

/* ---- the sheet: the app's dark card ---- */
.mp-app .mp-panel { background: var(--app-card2); color: var(--app-ink); border-color: var(--app-line); }
.mp-app .mp-panel h2 { color: var(--app-ink); }
.mp-app .mp-panel .fine, .mp-app .mp-panel small { color: var(--app-dim); }
.mp-app .mp-panel button:not(.mp-close):not(.on):not([aria-checked="true"]) { background: var(--app-card); color: var(--app-ink); border: 1px solid var(--app-line); }
.mp-app .mp-panel button.on, .mp-app .mp-panel button[aria-checked="true"], .mp-app .mp-panel button[aria-pressed="true"] { background: var(--app-on); border-color: var(--app-on); color: var(--app-on-ink); }
.mp-app .mp-panel input[type="text"], .mp-app .mp-panel input[type="search"], .mp-app .mp-panel input[type="number"], .mp-app .mp-panel input[type="date"], .mp-app .mp-panel input[type="time"], .mp-app .mp-panel select, .mp-app .mp-panel textarea { background: var(--app-card); color: var(--app-ink); border: 1px solid var(--app-line); border-radius: 10px; }
.mp-app .mp-panel a { color: var(--app-on); }

/* the state list: one row a state */
.app-row { display: flex !important; align-items: center; gap: 12px; width: 100%; min-height: 50px; margin: 8px 0 0; padding: 0 14px; border-radius: 12px; text-align: left; font: 700 16px system-ui, -apple-system, "Segoe UI", sans-serif; cursor: pointer; }
.app-row .app-code { width: 30px; color: var(--app-on); font-weight: 800; letter-spacing: .04em; }
.app-row.on .app-code { color: var(--app-on-ink); }
.app-row small { margin-left: auto; font-size: 12px; color: inherit !important; opacity: .8; }

/* ---- the drawing tools along the bottom: dark, orange when pressed ---- */
.mp-app .mp-tools { background: rgba(16, 21, 18, .97); border-top-color: var(--app-line); }
.mp-app .mp-tools button { background: transparent; color: var(--app-ink); border: 0; font-weight: 700; }
.mp-app .mp-tools button[aria-pressed="true"] { color: var(--app-on); }

/* ---- labelled pill pins and unit tags ---- */
.mp-app .mp-tag { padding: 3px 9px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .28); background: rgba(16, 21, 18, .9); color: #fff; font: 700 12px system-ui, -apple-system, "Segoe UI", sans-serif; box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.mp-app .mp-unit { padding: 2px 8px; border-radius: 999px; border: 1px solid var(--app-on); background: rgba(16, 21, 18, .82); color: #fff; font: 800 12px system-ui, -apple-system, "Segoe UI", sans-serif; }
.mp-app .mp-pinicon { border-color: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .55); }

/* ---- a wide screen: the panels are a sheet down the left side, the full height between the chips and the bar ---- */
@media (min-width: 760px) {
  .mp-app .mp-panel { top: 64px; bottom: 82px; left: 10px; right: auto; width: 400px; max-height: none; border-radius: 18px; overflow-y: auto; }
  .mp-app .mp-panel:not([hidden]) ~ .app-pill, .mp-app .mp-main:has(.mp-panel:not([hidden])) .app-pill { left: 424px; }
  .mp-app .mp-main:has(.mp-panel:not([hidden])) .leaflet-top.leaflet-left { left: 414px; }
  .mp-app .mp-main:has(.mp-panel:not([hidden])) .mp-where { left: 470px; }
}
@media (max-width: 560px) {
  .app-pill { top: 60px; left: 56px; font-size: 13px; min-height: 36px; padding: 0 12px; }
  .mp-app .mp-where, .mp-app .leaflet-top.leaflet-left { top: 104px; }
}

/* the hint lines in the sheet read in the app's plain type, and the sign-in chip wears a chip's dress */
.mp-app .mp-panel .fine { font: 500 .88rem/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: 0; }
.mp-app .hud-chip.hud-acct { background: rgba(16, 21, 18, .94); border: 1px solid var(--app-line); color: var(--app-ink); }
