:root { --bg: #f5f3ee; --ink: #1f2a24; --dim: #6b746e; --green: #2f4a3a; --accent: #c8752b; --red: #b8322a; --line: #d9d4c8; --card: #fff; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font: 15px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
.hidden { display: none !important; }
.dim { color: var(--dim); font-size: 13px; }
button { font: inherit; cursor: pointer; border: 1px solid var(--green); background: var(--green); color: #fff; border-radius: 6px; padding: 8px 12px; }
button.ghost { background: #fff; color: var(--green); }
button.danger { background: var(--red); border-color: var(--red); }
input, select, textarea { font: inherit; width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
label { display: block; font-size: 12px; color: var(--dim); margin: 10px 0 3px; text-transform: uppercase; letter-spacing: .04em; }
#login { position: fixed; inset: 0; display: grid; place-items: center; background: linear-gradient(160deg, #2f4a3a, #6d8a6f); }
#login .card { background: #fff; padding: 24px; border-radius: 12px; width: min(92vw, 380px); }
#login h1 { margin: 0 0 8px; font-size: 22px; color: var(--green); }
#login button { width: 100%; margin-top: 10px; }
#app { position: fixed; inset: 0; display: grid; grid-template-rows: auto 1fr; }
header { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--green); color: #fff; flex-wrap: wrap; }
header .dim { color: #cfe0d4; }
header select { width: auto; padding: 4px 6px; }
header .sp { flex: 1; }
.chk { display: inline-flex; align-items: center; gap: 4px; color: #fff; font-size: 13px; text-transform: none; margin: 0; letter-spacing: 0; }
.chk input { width: auto; }
#map { position: relative; }
#tabs { position: fixed; left: 12px; top: 64px; display: flex; gap: 6px; z-index: 5; flex-wrap: wrap; }
#tabs button { background: #fff; color: var(--green); padding: 6px 10px; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
#tabs button.on { background: var(--green); color: #fff; }
#tabs em { font-style: normal; background: var(--accent); color: #fff; border-radius: 9px; padding: 0 6px; font-size: 12px; margin-left: 4px; }
#panel { position: fixed; left: 12px; top: 104px; bottom: 12px; width: min(380px, calc(100vw - 24px)); overflow: auto; background: var(--card);
  border-radius: 10px; box-shadow: 0 2px 12px rgba(0,0,0,.18); padding: 12px; z-index: 4; }
#panel h2 { font-size: 16px; margin: 2px 0 8px; color: var(--green); }
.item { border-top: 1px solid var(--line); padding: 8px 2px; cursor: pointer; }
.item:hover { background: #f7f5ef; }
.item .t { font-weight: 600; }
.pill { display: inline-block; border-radius: 10px; padding: 0 7px; font-size: 12px; border: 1px solid var(--line); margin-right: 4px; }
.s-ny { background: #fde8d7; border-color: #f0b98b; } .s-bedömd { background: #fff3c4; } .s-planerad { background: #dfeafd; }
.s-åtgärdad, .s-utförd, .s-genomförd { background: #dcf2df; } .s-avvisad, .s-struken, .s-avslagen { background: #eee; color: #888; }
.sev3 { color: var(--red); font-weight: 700; }
#fab { position: fixed; right: 18px; bottom: 28px; width: 58px; height: 58px; border-radius: 50%; font-size: 28px; z-index: 6; background: var(--accent);
  border-color: var(--accent); box-shadow: 0 3px 10px rgba(0,0,0,.3); }
#modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; z-index: 20; }
#modal .box { background: #fff; border-radius: 12px; padding: 16px; width: min(94vw, 460px); max-height: 92vh; overflow: auto; position: relative; }
#modal-x { position: absolute; right: 8px; top: 8px; background: none; color: var(--dim); border: none; font-size: 18px; }
.row { display: flex; gap: 8px; } .row > * { flex: 1; }
.photos img { max-width: 100%; border-radius: 6px; margin-top: 6px; }
.ev { font-size: 13px; border-left: 3px solid var(--line); padding: 2px 8px; margin: 4px 0; }
.votes button { padding: 4px 10px; } .votes .mine { background: var(--accent); border-color: var(--accent); }
@media (max-width: 700px) {
  #panel { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 45vh; border-radius: 12px 12px 0 0; }
  header { flex-wrap: nowrap; gap: 6px; padding: 6px 8px; }
  header #road-len, header #who { display: none; }
  header b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #tabs { top: auto; left: 8px; }
  #fab { bottom: calc(45vh + 14px); }
}
