:root {
  --bg: #fff; --fg: #1f2328; --muted: #656d76; --line: #d8dee4; --accent: #7092ff; --accent-dark: #4b6fe0;
  --head: #1b1f24; --ok: #1a7f37; --bad: #cf222e; --added: #dafbe1; --changed: #fff8c5; --removed: #ffebe9;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; color: var(--fg); background: var(--bg); }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: .2em 0 .4em; }
h2 { font-size: 1.1rem; margin: 1.6em 0 .5em; }
.muted, .meta { color: var(--muted); }
.meta { font-size: .9rem; }
.error { color: var(--bad); background: var(--removed); padding: .5em .8em; border-radius: 6px; }
.ok { color: var(--ok); background: var(--added); padding: .5em .8em; border-radius: 6px; }

header.top {
  height: 48px; display: flex; align-items: center; gap: 20px; padding: 0 16px;
  background: var(--head); color: #fff; position: relative; z-index: 2000;
}
header.top a { color: #e6edf3; }
header.top .brand { font-weight: 700; font-size: 1.1rem; color: #fff; letter-spacing: .2px; }
header.top nav { display: flex; gap: 16px; align-items: center; }
header.top nav.user { margin-left: auto; }
header.top .who { font-weight: 600; }
.inline { display: inline; margin: 0; }
button.link { background: none; border: 0; color: #e6edf3; font: inherit; cursor: pointer; padding: 0; }
button.link:hover { text-decoration: underline; }

.button {
  display: inline-block; padding: 7px 14px; border-radius: 6px; border: 1px solid var(--line);
  background: #f6f8fa; color: var(--fg); font: inherit; cursor: pointer;
}
.button:hover { text-decoration: none; background: #eef1f4; }
.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button.primary:hover { background: var(--accent-dark); }
header.top .button { padding: 4px 12px; background: var(--accent); border-color: var(--accent); color: #fff; }

main.narrow { max-width: 560px; margin: 32px auto; padding: 0 20px; }
main.narrow.wide { max-width: 860px; }
form.stack { display: flex; flex-direction: column; gap: 14px; }
form.stack label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
form.stack label small { font-weight: 400; color: var(--muted); }
form.stack label.check { flex-direction: row; gap: 8px; font-weight: 400; align-items: flex-start; }
input, textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; }
input:focus, textarea:focus { outline: 2px solid var(--accent); border-color: var(--accent); }

main.home, main.split { display: flex; height: calc(100% - 48px); }
main.home .map-pane { flex: 1; position: relative; }
main.home .side { width: 380px; overflow: auto; padding: 20px; border-left: 1px solid var(--line); }
main.split .detail { width: 460px; overflow: auto; padding: 20px; border-right: 1px solid var(--line); }
main.split .map-pane { flex: 1; }
.map { width: 100%; height: 100%; background: #2f90b0; }
.edit-here { position: absolute; top: 12px; left: 56px; z-index: 1000; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.crumb { font-size: .9rem; color: var(--muted); margin: 0; }

ul.changesets { list-style: none; padding: 0; margin: 0; }
ul.changesets li { padding: 10px 0; border-bottom: 1px solid var(--line); }
ul.changesets .comment { display: block; font-weight: 600; }
ul.changesets .meta { display: block; }
ul.elements { list-style: none; padding: 0; margin: 0; font-size: .92rem; }
ul.elements li { padding: 3px 0; }
.act { display: inline-block; min-width: 56px; font-size: .8rem; text-transform: uppercase; color: var(--muted); }
.act-create .act { color: var(--ok); }
.act-delete .act { color: var(--bad); }
table.tags { border-collapse: collapse; width: 100%; font-size: .9rem; margin: 4px 0; }
table.tags th, table.tags td { border: 1px solid var(--line); padding: 4px 8px; text-align: left; vertical-align: top; word-break: break-word; }
table.tags th { width: 40%; font-weight: 600; background: #f6f8fa; }
table.tags tr.added td, table.tags tr.added th { background: var(--added); }
table.tags tr.changed td, table.tags tr.changed th { background: var(--changed); }
table.tags tr.removed td, table.tags tr.removed th { background: var(--removed); text-decoration: line-through; }
ol.versions { list-style: none; padding: 0; margin: 0; }
ol.versions li { padding: 10px 0; border-bottom: 1px solid var(--line); }
ol.versions .vhead { font-size: .9rem; margin-bottom: 4px; }
ol.versions li.deleted .vhead { color: var(--bad); }
.about { white-space: pre-wrap; }

body.page-edit { overflow: hidden; }
body.page-edit #id-container { position: absolute; top: 48px; left: 0; right: 0; bottom: 0; }

@media (max-width: 760px) {
  main.home, main.split { flex-direction: column; height: auto; }
  main.home .map-pane, main.split .map-pane { height: 55vh; }
  main.home .side, main.split .detail { width: auto; border: 0; }
  header.top nav.main a:not(#nav-edit) { display: none; }
}
