:root {
  color-scheme: dark;
  --bg: #121a17;
  --surface: #19231e;
  --raised: #202d26;
  --ink: #f4f8f4;
  --muted: #a9bcb0;
  --border: #35463b;
  --accent: #adf2be;
  --accent-ink: #132719;
  --danger: #ffd3c9;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { background: var(--bg); color: var(--ink); margin: 0; min-width: 0; }
.shell { width: min(100%, 39rem); margin: auto; padding: max(1rem, env(safe-area-inset-top)) 1rem max(2rem, env(safe-area-inset-bottom)); }
.brand { display: flex; align-items: center; gap: .7rem; margin: .3rem 0 1.15rem; font-size: 1.05rem; font-weight: 750; }
.mark { display: grid; width: 2.2rem; height: 2.2rem; place-items: center; background: var(--accent); color: var(--accent-ink); border-radius: .7rem; }
h1 { font-size: clamp(1.65rem, 7vw, 2.45rem); line-height: 1.14; letter-spacing: -.05em; margin: 1.4rem 0 .95rem; font-weight: 720; }
h2, h3, p { margin: 0; }
h2 { font-size: 1.18rem; letter-spacing: -.02em; }
h3 { font-size: 1.1rem; line-height: 1.3; overflow-wrap: anywhere; }
a { color: var(--accent); }
a, button, label, select { -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; }
button, .primary, .secondary { min-height: 44px; border-radius: .72rem; padding: .53rem .77rem; font-weight: 650; cursor: pointer; text-align: center; }
button:disabled { opacity: .53; cursor: default; }
.primary { color: var(--accent-ink); background: var(--accent); border: 1px solid var(--accent); }
.secondary { color: var(--ink); background: var(--raised); border: 1px solid var(--border); }
a.primary, a.secondary { display: grid; place-items: center; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3rem; background: var(--surface); border: 1px solid var(--border); border-radius: .95rem; padding: .24rem; }
.tab { border: 1px solid transparent; background: transparent; color: var(--muted); }
.tab[aria-pressed="true"] { border-color: var(--border); color: var(--ink); background: var(--raised); }
section { min-width: 0; }
.panel { display: grid; gap: .5rem; border: 1px solid var(--border); border-radius: 1rem; background: var(--surface); padding: .85rem; margin-bottom: .7rem; }
.panel .primary { margin-top: .15rem; }
.city-row, .columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .45rem; }
.city-row { grid-template-columns: minmax(0, 1fr) auto; }
label { display: block; color: var(--ink); font-size: .87rem; font-weight: 650; }
.columns label, #city-pick label { margin-bottom: .28rem; }
#claim-details { display: grid; gap: .5rem; }
input, select, textarea { min-width: 0; width: 100%; min-height: 44px; padding: .52rem .65rem; border: 1px solid var(--border); border-radius: .63rem; background: var(--bg); color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
textarea { resize: vertical; min-height: 5.25rem; }
.fine { color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.empty { padding: 1rem .8rem; border: 1px dashed var(--border); border-radius: .85rem; color: var(--muted); margin: .85rem 0; }
.results-head { display: flex; align-items: center; justify-content: space-between; gap: .7rem; margin: 1.15rem 0 .35rem; }
.results-head button { flex: 0 1 auto; }
.check { min-height: 44px; display: flex; gap: .55rem; align-items: center; color: var(--muted); font-weight: 550; }
.check input { width: 1.15rem; min-height: 0; height: 1.15rem; flex: 0 0 auto; accent-color: var(--accent); margin: 0; }
.cards { display: grid; gap: .6rem; }
.card { min-width: 0; display: grid; gap: .5rem; background: var(--surface); border: 1px solid var(--border); border-radius: .95rem; padding: .85rem; }
.card .meta { color: var(--muted); font-size: .84rem; overflow-wrap: anywhere; }
.card .links { display: flex; flex-wrap: wrap; gap: .35rem; }
.links a { display: inline-flex; align-items: center; min-height: 44px; padding: .42rem .55rem; border: 1px solid var(--border); border-radius: .55rem; text-decoration: none; font-size: .84rem; font-weight: 650; }
.card .secondary { justify-self: start; }
.card-edit { display: grid; gap: .45rem; padding-top: .5rem; border-top: 1px solid var(--border); }
.card-edit summary { min-height: 44px; display: flex; align-items: center; color: var(--accent); cursor: pointer; }
.card-edit[open] summary { margin-bottom: .35rem; }
.card-edit form { display: grid; gap: .4rem; }
.card-edit .fine { white-space: pre-line; }
#base-count { margin: .75rem 0 .4rem; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .75rem; }
.toast { position: fixed; z-index: 1; bottom: max(.75rem, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 1.5rem); padding: .6rem .85rem; color: var(--ink); background: var(--raised); border: 1px solid var(--border); border-radius: .65rem; font-size: .875rem; box-shadow: 0 8px 25px #0006; pointer-events: none; }
.toast[data-error="true"] { color: var(--danger); }
footer { color: var(--muted); font-size: .77rem; margin-top: 1.45rem; }
footer a { color: var(--muted); text-underline-offset: .16rem; }
.install > p { margin-bottom: .8rem; }

.section-head, .dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .55rem;
}
.section-head { margin: 1.4rem 0 .95rem; }
.section-head h1 { margin: 0; }
.card-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.card .source { color: var(--muted); font-size: .78rem; }
dialog {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: .95rem;
  width: min(calc(100% - 1.25rem), 30rem);
  max-height: calc(100dvh - 1.4rem);
  overflow: auto;
  padding: 1rem;
}
dialog::backdrop { background: #0b130fbb; }
.dialog-form { display: grid; gap: .65rem; margin-top: .85rem; }
.dialog-form label input, .dialog-form label select, .dialog-form label textarea { margin-top: .3rem; }
.dialog-form .columns label { margin: 0; }
#message-text { min-height: 8rem; }
