:root {
  --charcoal: #25231f;
  --gold: #988663;
  --warm-white: #f7f4ee;
  --panel: #ffffff;
  --muted: #6b6862;
  --line: #e5dfd4;
  --danger: #a13b32;
  --sidebar-width: 260px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: Arial, Helvetica, sans-serif; color: var(--charcoal); background: var(--warm-white); }
button, input, select { font: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid rgba(152, 134, 99, .55); outline-offset: 2px; }

.app { position: relative; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); height: 100%; overflow: hidden; transition: grid-template-columns .2s ease; }
.app.auth-pending { grid-template-columns: 0 minmax(0, 1fr); }
.app.auth-pending .sidebar, .app.auth-pending .sidebar-tab { display: none; }
.app.auth-pending .map-shell { grid-column: 1 / -1; }
.app.sidebar-hidden { grid-template-columns: 0 minmax(0, 1fr); }
.sidebar { width: var(--sidebar-width); background: var(--panel); border-right: 1px solid var(--line); overflow-x: hidden; overflow-y: auto; z-index: 4; transition: transform .2s ease; }
.app.sidebar-hidden .sidebar { transform: translateX(-101%); }
.sidebar-header { position: sticky; top: 0; z-index: 3; padding: 20px; color: white; background: var(--charcoal); }
.eyebrow { margin: 0 0 5px; color: #d9cdb6; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; }
h1 { margin: 0; font-family: Georgia, 'Times New Roman', serif; font-size: 25px; font-weight: 600; white-space: nowrap; }
.count { margin-top: 7px; color: #ddd7cc; font-size: 13px; }
.controls { padding: 18px 20px 28px; }
.section { padding: 16px 0; border-bottom: 1px solid var(--line); }
.section:first-child { padding-top: 0; }
.section-title { display: flex; justify-content: space-between; align-items: center; margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.filter-shortcuts { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; color: var(--muted); font-size: 11px; font-weight: 400; letter-spacing: 0; text-transform: none; }
.filter-shortcut { padding: 0; color: #574a32; background: none; border: 0; font-size: 11px; text-decoration: underline; cursor: pointer; }
.field { width: 100%; min-height: 40px; padding: 9px 11px; color: var(--charcoal); background: white; border: 1px solid #cfc8bc; border-radius: 6px; }
.field:focus { outline: 2px solid rgba(152, 134, 99, .25); border-color: var(--gold); }
.select-grid { display: grid; gap: 9px; }
.check-list { display: grid; gap: 8px; }
.check-row { display: grid; grid-template-columns: 18px 14px 1fr auto; align-items: center; gap: 8px; min-height: 24px; font-size: 14px; cursor: pointer; }
.check-row input { margin: 0; }
.swatch { width: 11px; height: 11px; border: 1px solid rgba(0,0,0,.25); border-radius: 50%; }
.filter-count { color: var(--muted); font-size: 12px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding-top: 16px; }
.actions-bottom { margin-top: 16px; padding-top: 0; }
.button { min-height: 40px; padding: 8px 12px; border: 1px solid var(--gold); border-radius: 6px; cursor: pointer; }
.button-primary { color: white; background: var(--gold); }
.button-secondary { color: var(--charcoal); background: white; }
.data-note { margin: 14px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }

.map-shell { position: relative; min-width: 0; }
#map { width: 100%; height: 100%; }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; z-index: 2; background: rgba(247,244,238,.88); }
.overlay-card { max-width: 520px; margin: 20px; padding: 24px; background: white; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.12); }
.overlay-card h2 { margin-top: 0; }
.overlay-card p { line-height: 1.5; }
.sign-in-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 8px; padding: 10px 18px; color: white; background: var(--charcoal); border: 1px solid var(--gold); border-radius: 6px; font-weight: 700; text-decoration: none; cursor: pointer; }
.spinner { width: 36px; height: 36px; margin: 0 auto 12px; border: 4px solid #e6e0d6; border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }
.sidebar-tab { position: absolute; top: 44px; left: var(--sidebar-width); z-index: 7; width: 28px; height: 62px; padding: 0; color: white; background: var(--charcoal); border: 1px solid var(--gold); border-left: 0; border-radius: 0 8px 8px 0; box-shadow: 3px 2px 10px rgba(0,0,0,.22); font-size: 24px; line-height: 1; cursor: pointer; transition: left .2s ease, background .15s ease; }
.sidebar-tab:hover, .sidebar-tab:focus-visible { background: #3a3731; }
.app.sidebar-hidden .sidebar-tab { left: 0; }
.map-fullscreen-button { display: grid; width: 40px; height: 40px; margin: 10px; padding: 8px; place-items: center; color: #5f6368; background: white; border: 0; border-radius: 2px; box-shadow: 0 1px 4px rgba(0,0,0,.3); cursor: pointer; }
.map-fullscreen-button:hover, .map-fullscreen-button:focus-visible { color: var(--charcoal); background: #f8f8f8; }
.map-fullscreen-button svg { width: 22px; height: 22px; }
.app:fullscreen, .app:-webkit-full-screen { width: 100%; height: 100%; background: var(--warm-white); }

.info { max-width: 350px; color: var(--charcoal); line-height: 1.35; }
.info h2 { margin: 0 0 4px; font-family: Georgia, 'Times New Roman', serif; font-size: 20px; }
.info-title-link { color: inherit; text-decoration: none; }
.info-title-link:hover, .info-title-link:focus { text-decoration: underline; }
.info-subtitle { margin: 0 0 10px; color: var(--muted); font-size: 12px; }
.info-grid { display: grid; grid-template-columns: 92px 1fr; gap: 5px 9px; margin: 10px 0; font-size: 13px; }
.info-label { color: var(--muted); }
.info-value-link { color: #574a32; font-weight: 700; }
.status-badge { display: inline-block; margin: 2px 0 6px; padding: 3px 7px; color: white; background: var(--charcoal); border-radius: 999px; font-size: 11px; font-weight: 700; }
.scope-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.scope-chip { padding: 3px 7px; background: #eee9df; border-radius: 999px; font-size: 11px; }
.scope-chip.yes { color: white; background: #556b3b; }
.info-notes-block { margin: 10px 0; }
.info-notes-heading { margin: 0 0 4px; font-size: 12px; font-weight: 700; }
.info-notes-list { display: grid; gap: 6px; }
.info-notes { margin: 10px 0; padding: 8px; background: var(--warm-white); border-left: 3px solid var(--gold); font-size: 12px; }
.info-notes-block .info-notes { margin: 0; }

@media (max-width: 820px) {
  .app { --sidebar-width: clamp(198px, 57.6vw, 216px); display: block; }
  .sidebar { position: absolute; inset: 0 auto 0 0; box-shadow: 8px 0 25px rgba(0,0,0,.18); }
  .sidebar-header { padding: 14px; }
  .eyebrow { margin-bottom: 4px; font-size: 9px; letter-spacing: .1em; }
  h1 { font-size: 19px; }
  .count { margin-top: 5px; font-size: 11px; }
  .controls { padding: 14px 14px 24px; }
  #searchInput, .select-grid .field { min-height: 34px; padding: 7px 9px; font-size: 12px; }
  .actions { gap: 5px; padding-top: 12px; }
  .actions-bottom { margin-top: 14px; padding-top: 0; }
  .actions .button { min-height: 30px; padding: 4px 2px; font-size: 10px; white-space: nowrap; }
  .sidebar-tab { top: 50%; transform: translateY(-50%); }
  .map-shell { height: 100%; }
}

@media (min-width: 821px) {
  h1 { font-size: 22px; white-space: nowrap; }
  #searchInput { min-height: 36px; padding: 8px 9px; font-size: 11px; }
  .actions .button { min-height: 34px; padding: 6px 5px; font-size: 12px; white-space: nowrap; }
}
