:root {
  --ink: #1f1b16;
  --paper: #f6f1e7;
  --card: #fffdf8;
  --line: #d9cfbd;
  --muted: #6d6458;
  --red: #b3261e;
  --blue: #1d3f72;
  --sign: #1f7a3a;
  --no-sign: #6d6458;
  --unsure: #a86a00;
  --no-imagery: #4a5a7a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

a { color: var(--blue); }

/* Header shared by every layout */
.site-header {
  background: var(--ink);
  color: var(--paper);
  padding: 10px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
  border-bottom: 4px solid var(--red);
}
.site-header .brand { font-size: 18px; font-weight: 700; color: var(--paper); text-decoration: none; letter-spacing: 0.02em; }
.site-header nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.site-header nav a { color: #e8dfcf; text-decoration: none; font-weight: 600; }
.site-header nav a:hover { color: white; }
.site-header .account { margin-left: auto; display: flex; gap: 12px; align-items: center; color: #cfc6b6; font-size: 14px; }
.site-header .account button {
  font: inherit; font-size: 13px; background: none; color: #e8dfcf; border: 1px solid #5a5248;
  border-radius: 4px; padding: 3px 9px; cursor: pointer;
}

main.page { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; }
main.narrow { max-width: 460px; }

h1 { font-size: 26px; margin: 0 0 6px; }
h2 { font-size: 19px; margin: 24px 0 8px; }
.muted { color: var(--muted); }
.hint { font-size: 13px; color: var(--muted); }

/* Flash messages */
.flash { padding: 9px 14px; border-radius: 6px; margin-bottom: 16px; font-weight: 600; }
.flash.notice { background: #e2f1e5; color: var(--sign); border: 1px solid #b9dcc1; }
.flash.alert { background: #f8e3e1; color: var(--red); border: 1px solid #ebbcb7; }

.errors { background: #f8e3e1; color: var(--red); border: 1px solid #ebbcb7; border-radius: 6px; padding: 8px 14px; margin-bottom: 14px; }
.errors ul { margin: 4px 0 0; padding-left: 20px; }

/* Forms */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 18px 20px; }
.field { margin-bottom: 14px; }
.field label, .field-label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], select, textarea {
  font: inherit; width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 5px; background: white;
}
textarea { min-height: 40px; resize: vertical; }
.button, button.button, input[type=submit] {
  display: inline-block; font: inherit; font-weight: 700; border: 0; border-radius: 5px; padding: 8px 14px;
  background: var(--ink); color: white; cursor: pointer; text-decoration: none;
}
.button.secondary { background: #e4dac8; color: var(--ink); }
.button.small { padding: 4px 10px; font-size: 13px; }
.inline-form { display: inline; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin: 12px 0 16px; }
.filters .field { margin: 0; min-width: 160px; }

/* Tables */
table.list { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
table.list th, table.list td { text-align: left; padding: 7px 10px; border-bottom: 1px solid #eee6d6; vertical-align: top; }
table.list th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); background: #f3ecdf; }
.pagination { display: flex; gap: 12px; align-items: center; margin-top: 12px; }

/* Verdict labels */
.chip {
  display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 2px 6px; border-radius: 3px; color: white; background: #9a9182; white-space: nowrap;
}
.chip.sign { background: var(--sign); }
.chip.no_sign { background: var(--no-sign); }
.chip.unsure { background: var(--unsure); }
.chip.no_imagery { background: var(--no-imagery); }
.chip.removed { background: var(--red); }

kbd {
  font: 11px ui-monospace, Menlo, monospace; border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 3px; padding: 0 4px; background: #fbf8f1; color: var(--muted);
}

/* Review screen */
.review-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; }
@media (max-width: 860px) { .review-layout { grid-template-columns: 1fr; } }
.review-bar-name { font-size: 26px; margin: 0; }
.review-links { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0 16px; }
.review-links a {
  font-weight: 600; text-decoration: none; border: 1px solid var(--line); background: var(--card);
  padding: 5px 11px; border-radius: 5px;
}
.review-links a.primary { background: var(--blue); color: white; border-color: var(--blue); }
fieldset { border: 1px solid var(--line); border-radius: 8px; background: var(--card); margin: 0 0 12px; padding: 10px 14px; }
legend { font-weight: 700; font-size: 13px; padding: 0 4px; }
.brand-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 12px; }
.brand-options label, .condition-options label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.condition-options { display: flex; gap: 18px; flex-wrap: wrap; }
.detail-fields { display: grid; grid-template-columns: 200px 1fr; gap: 12px; }
@media (max-width: 600px) { .detail-fields { grid-template-columns: 1fr; } }
.verdicts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.verdicts button { font: inherit; font-weight: 700; border: 0; border-radius: 5px; padding: 10px 15px; color: white; cursor: pointer; }
.verdicts button[value=sign] { background: var(--sign); }
.verdicts button[value=no_sign] { background: var(--no-sign); }
.verdicts button[value=unsure] { background: var(--unsure); }
.verdicts button[value=no_imagery] { background: var(--no-imagery); }
.verdicts button.selected { outline: 3px solid var(--ink); outline-offset: 2px; }
.verdicts kbd { background: rgba(255, 255, 255, 0.85); }
.review-nav { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.side-panel .card { margin-bottom: 14px; }
.side-panel h2 { margin-top: 0; font-size: 15px; }
.claim-warning { background: #fdf1d8; border: 1px solid #ecd39a; color: #7a5400; border-radius: 6px; padding: 8px 12px; margin-bottom: 12px; }
.other-review { border-top: 1px solid #eee6d6; padding-top: 8px; margin-top: 8px; font-size: 14px; }

/* Public map */
body.public { height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.map-layout { display: grid; grid-template-columns: 300px 1fr; min-height: 0; }
@media (max-width: 760px) { .map-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; } }
.map-panel { background: var(--card); border-right: 1px solid var(--line); padding: 14px 16px; overflow-y: auto; }
.map-panel h1 { font-size: 19px; }
.map-panel .brand-filter label { display: flex; gap: 8px; align-items: center; padding: 2px 0; cursor: pointer; }
.swatch { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0, 0, 0, 0.35); }
#map { min-height: 400px; }
.map-popup h3 { margin: 0 0 4px; font-size: 15px; }
.map-popup p { margin: 2px 0; }
.map-footer { font-size: 12px; color: var(--muted); margin-top: 16px; }
.map-panel .legend { list-style: none; padding: 0; margin: 0 0 6px; }
.map-panel .legend li { display: flex; gap: 8px; align-items: center; padding: 2px 0; }
.bar-list { list-style: none; padding: 0; margin: 0; }
.bar-list-item {
  display: block; width: 100%; text-align: left; font: inherit; background: none; border: 0;
  border-bottom: 1px solid #eee6d6; padding: 6px 0; cursor: pointer; color: var(--ink);
}
.bar-list-item:hover strong { color: var(--blue); }
.bar-list-item span { display: block; font-size: 12px; color: var(--muted); }
main.scrollable { overflow-y: auto; }
