:root {
  --bg: #ffffff;
  --text: #1d2330;
  --muted: #5d6675;
  --line: #d9dde3;
  --accent: #0b5cad;
  --accent-text: #ffffff;
  --touch: #ff9500;
  --chip: #eef3fa;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1f26;
    --text: #e6e9ee;
    --muted: #a3acb9;
    --line: #343b46;
    --accent: #5aa2f0;
    --accent-text: #0d1117;
    --chip: #263243;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }

.mp-app { display: flex; height: 100%; }
.mp-panel { width: 360px; flex: none; overflow-y: auto; padding: 16px; border-right: 1px solid var(--line); }
#mp-map { flex: 1 1 auto; min-height: 320px; }
.mp-panel h1 { font-size: 1.3rem; margin: 0 0 2px; }
.mp-panel h2 { font-size: 1rem; margin: 18px 0 6px; }
.mp-panel header p { margin: 0 0 12px; }
.mp-muted { color: var(--muted); }
.mp-small { font-size: .82rem; margin-top: 18px; }
.mp-help { font-size: .9rem; color: var(--muted); margin: 8px 0; }

button, select, input {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px;
}
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.mp-modes { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.mp-modes button { border: 0; border-radius: 0; padding: 8px; }
.mp-modes button.active { background: var(--accent); color: var(--accent-text); }
.mp-row { display: flex; gap: 6px; margin: 8px 0; }
.mp-row input { flex: 1 1 auto; min-width: 0; }

.mp-chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.mp-chips li { display: inline-flex; align-items: center; gap: 4px; background: var(--chip); border-radius: 999px; padding: 2px 4px 2px 10px; font-size: .88rem; }
.mp-chips li button { border: 0; background: transparent; padding: 0 6px; font-size: 1rem; line-height: 1; }
.mp-chips li .mp-name { cursor: pointer; }
.mp-chips code { color: var(--muted); font-size: .85em; }
.mp-chips .mp-flag { color: var(--muted); font-size: .8em; font-style: italic; }
.mp-poly li { background: color-mix(in srgb, var(--touch) 22%, transparent); padding-right: 10px; }
details summary { cursor: pointer; margin: 10px 0 6px; }

pre#mp-output { background: var(--chip); border-radius: 8px; padding: 10px; white-space: pre-wrap; word-break: break-all; font-size: .82rem; margin: 0 0 8px; max-height: 220px; overflow: auto; }

.mp-hint { position: fixed; bottom: 22px; left: calc(360px + (100% - 360px) / 2); transform: translateX(-50%);
  background: rgba(20, 23, 28, .85); color: #fff; padding: 6px 14px; border-radius: 999px; font-size: .9rem; z-index: 1000; pointer-events: none; }
.leaflet-container.mp-drawing { cursor: crosshair; }
.mp-tip { font-size: .85rem; }

@media (max-width: 760px) {
  .mp-app { flex-direction: column-reverse; height: auto; }
  #mp-map { height: 60vh; flex: none; }
  .mp-panel { width: auto; border-right: 0; border-top: 1px solid var(--line); overflow: visible; }
  .mp-hint { left: 50%; top: calc(60vh - 50px); bottom: auto; }
}

/* setup code for the installer */
.mp-code-box pre#mp-code { background: var(--chip); border: 2px dashed var(--accent); border-radius: 8px; padding: 10px;
  white-space: pre-wrap; word-break: break-all; font-size: .85rem; margin: 0 0 8px; user-select: all; }
.mp-code-box pre#mp-code.mp-muted { border-style: solid; border-color: var(--line); user-select: auto; }
button.mp-primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; padding: 8px 14px; }
#mp-copy-code-msg { display: block; margin-top: 6px; font-size: .88rem; }
.mp-manual { margin-top: 14px; }
.mp-manual summary { font-weight: 600; }

/* shown instead of the map until it has a password */
.mp-off { max-width: 600px; margin: 10vh auto; padding: 0 16px; }
.mp-off pre { background: var(--chip); border-radius: 8px; padding: 10px; overflow-x: auto; }
