:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #64748b;
  --border: #d9e2ec;
  --primary: #1d4ed8;
  --primary-dark: #1e40af;
  --danger: #b91c1c;
  --danger-dark: #991b1b;
  --shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

button, input, select, textarea {
  font: inherit;
}

button {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  font-weight: 650;
}

button:hover:not(:disabled) {
  border-color: #94a3b8;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

button.primary:hover:not(:disabled) {
  background: var(--primary-dark);
}

button.danger {
  color: var(--danger);
}

button.danger:hover:not(:disabled) {
  background: var(--danger);
  color: white;
  border-color: var(--danger-dark);
}

.page-header {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem clamp(1rem, 3vw, 2rem);
  background: #0f172a;
  color: white;
  align-items: center;
}

.eyebrow {
  margin: 0 0 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #bfdbfe;
  font-size: 0.78rem;
  font-weight: 750;
}

h1, h2 {
  margin: 0;
  line-height: 1.12;
}

h1 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

h2 {
  font-size: 1rem;
}

.subtitle {
  margin: 0.35rem 0 0;
  color: #dbeafe;
  max-width: 62rem;
}

.top-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.planner-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 1rem;
  padding: 1rem;
  max-width: 1500px;
  margin: 0 auto;
}

.map-panel,
.control-panel > section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.map-panel {
  overflow: hidden;
  min-height: calc(100vh - 130px);
  display: flex;
  flex-direction: column;
}

.search-row {
  padding: 0.85rem;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  color: var(--text);
  background: white;
}

textarea { resize: vertical; }

#map {
  min-height: 640px;
  flex: 1;
}

.status-line {
  margin: 0;
  padding: 0.65rem 0.85rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: #f8fafc;
}

.control-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.control-panel > section {
  padding: 1rem;
}

.notice-box {
  border-left: 5px solid var(--primary) !important;
}

.connect-box {
  border-left: 5px solid #15803d !important;
}

.disclaimer-box {
  border-left: 5px solid #d97706 !important;
}

.control-panel p {
  margin: 0.45rem 0 0;
}

.controls-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.controls-card label {
  font-weight: 700;
  font-size: 0.92rem;
}

.muted {
  color: var(--muted);
  font-size: 0.94rem;
}

.slider-row,
.button-row,
.mini-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.slider-row output {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.button-row button,
.mini-actions button {
  flex: 1;
}

.camera-list {
  margin: 0.5rem 0 0;
  padding-left: 1.35rem;
}

.camera-list li {
  margin: 0.45rem 0;
}

.camera-list button {
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.65rem;
  font-weight: 600;
}

.camera-list button.selected {
  outline: 2px solid var(--primary);
}

.connect-box a {
  display: inline-block;
  margin-top: 0.65rem;
  color: var(--primary);
  font-weight: 800;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 980px) {
  .page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .planner-shell {
    grid-template-columns: 1fr;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  #map {
    min-height: 520px;
  }
}

@media print {
  body { background: white; }
  .top-actions, .search-row, .connect-box a { display: none !important; }
  .planner-shell { grid-template-columns: 1fr; padding: 0; }
  .control-panel { page-break-before: always; }
  .map-panel, .control-panel > section { box-shadow: none; border: 1px solid #aaa; }
  #map { height: 620px; min-height: 620px; }
}


/* Camera database controls added in v0.2 */
.camera-db-controls {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f8fafc;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.compact-label {
  font-size: 0.86rem !important;
  margin-bottom: -0.2rem;
}

.filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem !important;
  color: var(--muted);
  font-weight: 650 !important;
}

.checkbox-line input {
  width: auto;
}

.camera-model-meta,
.camera-model-info {
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  font-size: 0.84rem;
  line-height: 1.35;
}

.camera-model-meta {
  color: var(--muted);
  background: #eef2ff;
}

.camera-model-info {
  color: #334155;
  background: #ecfeff;
  border: 1px solid #bae6fd;
}

@media (max-width: 980px) {
  .filter-grid {
    grid-template-columns: 1fr;
  }
}

/* v0.3 clarity/help improvements */
.helper-links,
.secondary-helper-link {
  margin-top: 0.7rem !important;
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.9rem;
}

.helper-links a,
.secondary-helper-link a,
.tiny-link {
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.helper-links a:hover,
.secondary-helper-link a:hover,
.tiny-link:hover {
  text-decoration: underline;
}

.help-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.35rem;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  background: #dbeafe;
  color: #1e3a8a;
  font-size: 0.75rem;
  font-weight: 900;
  cursor: help;
  vertical-align: middle;
}

.help-tip:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.camera-db-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.camera-db-heading .compact-label {
  margin-bottom: 0 !important;
}

.tiny-link {
  font-size: 0.78rem;
  white-space: nowrap;
}

select option:disabled {
  color: #64748b;
  font-weight: 700;
}

.guide-body {
  background: var(--bg);
}

.guide-header {
  background: #0f172a;
  color: white;
  padding: 1.5rem clamp(1rem, 4vw, 2.5rem);
}

.guide-header-inner,
.guide-main {
  max-width: 1120px;
  margin: 0 auto;
}

.guide-nav {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.guide-nav a,
.guide-button {
  display: inline-block;
  border: 1px solid rgba(255,255,255,0.35);
  color: white;
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.92rem;
}

.guide-nav a:hover,
.guide-button:hover {
  background: rgba(255,255,255,0.12);
}

.guide-main {
  padding: 1rem;
}

.guide-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: clamp(1rem, 3vw, 1.45rem);
  margin-bottom: 1rem;
}

.guide-card h2 {
  font-size: 1.25rem;
  margin-bottom: 0.55rem;
}

.guide-card h3 {
  margin: 1rem 0 0.35rem;
  font-size: 1rem;
}

.guide-card p,
.guide-card li {
  line-height: 1.55;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.guide-tile {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem;
}

.guide-tile strong {
  display: block;
  margin-bottom: 0.3rem;
}

.priority-chart {
  display: grid;
  gap: 0.55rem;
  margin: 0.8rem 0;
}

.priority-row {
  display: grid;
  grid-template-columns: 150px 1fr 48px;
  gap: 0.65rem;
  align-items: center;
  font-size: 0.95rem;
}

.priority-bar {
  height: 0.8rem;
  border-radius: 999px;
  background: #dbeafe;
  overflow: hidden;
}

.priority-bar span {
  display: block;
  height: 100%;
  background: #1d4ed8;
  border-radius: inherit;
}

.note-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 5px solid #d97706;
  border-radius: 14px;
  padding: 0.85rem;
}

.privacy-box {
  background: #ecfeff;
  border: 1px solid #bae6fd;
  border-left: 5px solid #0891b2;
  border-radius: 14px;
  padding: 0.85rem;
}

.source-list a {
  color: var(--primary);
  font-weight: 700;
}

@media (max-width: 820px) {
  .guide-grid {
    grid-template-columns: 1fr;
  }
  .priority-row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}


/* v0.3.4 layout compression for camera planner */
.page-header {
  padding: 0.85rem clamp(1rem, 2.2vw, 1.6rem);
  gap: 1rem;
}

.page-header h1 {
  font-size: clamp(1.8rem, 4vw, 3.1rem);
  margin-bottom: 0.25rem;
}

.page-header .subtitle {
  margin-top: 0.25rem;
  max-width: 72rem;
  line-height: 1.35;
}

.page-header .eyebrow {
  margin-bottom: 0.15rem;
}

.top-actions button {
  padding: 0.55rem 0.8rem;
}

.planner-shell {
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 0.75rem;
  padding: 0.75rem;
}

.map-panel {
  min-height: auto;
}

.search-row {
  padding: 0.65rem;
  gap: 0.45rem;
}

#map {
  height: min(58vh, 640px);
  min-height: 470px;
  flex: none;
}

.status-line {
  padding: 0.5rem 0.7rem;
  font-size: 0.9rem;
}

.control-panel {
  gap: 0.65rem;
}

.control-panel > section {
  padding: 0.75rem;
  border-radius: 14px;
}

.controls-card {
  gap: 0.45rem;
}

.controls-card h2 {
  margin-bottom: 0.05rem;
}

.controls-card label {
  font-size: 0.86rem;
}

.muted {
  font-size: 0.85rem;
  line-height: 1.35;
}

input, select, textarea {
  border-radius: 9px;
  padding: 0.5rem 0.6rem;
}

.slider-row {
  margin-top: 0.15rem;
}

.slider-row output {
  font-size: 0.88rem;
}

input[type="range"] {
  padding: 0;
  height: 1.1rem;
}

.mini-actions,
.button-row {
  gap: 0.4rem;
}

.mini-actions button,
.button-row button {
  padding: 0.48rem 0.55rem;
  border-radius: 9px;
}

.camera-db-controls {
  padding: 0.55rem;
  gap: 0.4rem;
  border-radius: 12px;
}

.camera-db-heading {
  gap: 0.35rem;
}

.compact-label {
  font-size: 0.8rem !important;
}

.tiny-link {
  font-size: 0.72rem;
}

.filter-grid {
  gap: 0.35rem;
}

.checkbox-line {
  font-size: 0.78rem !important;
  line-height: 1.25;
  gap: 0.4rem;
}

.camera-model-meta,
.camera-model-info {
  padding: 0.42rem 0.5rem;
  font-size: 0.76rem;
  line-height: 1.25;
}

.camera-list {
  margin-top: 0.35rem;
  padding-left: 1.1rem;
}

.camera-list li {
  margin: 0.3rem 0;
}

.camera-list button {
  padding: 0.45rem 0.55rem;
  font-size: 0.86rem;
}

.help-tip {
  width: 0.95rem;
  height: 0.95rem;
  font-size: 0.68rem;
  margin-left: 0.25rem;
}

.planner-info-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  padding: 0.6rem;
  border-top: 1px solid var(--border);
  background: #f8fafc;
}

.planner-info-strip section {
  box-shadow: none;
  padding: 0.65rem;
  border-radius: 12px;
  background: white;
  margin: 0;
}

.planner-info-strip h2 {
  font-size: 0.9rem;
}

.planner-info-strip p,
.planner-info-strip a {
  font-size: 0.82rem;
  line-height: 1.35;
}

.planner-info-strip .helper-links,
.planner-info-strip .secondary-helper-link {
  margin-top: 0.4rem !important;
  font-size: 0.78rem;
  gap: 0.35rem;
}

.planner-info-strip .connect-box a {
  margin-top: 0.35rem;
}

.planner-info-strip .notice-box,
.planner-info-strip .connect-box,
.planner-info-strip .disclaimer-box {
  border-left-width: 4px !important;
}

@media (max-width: 1180px) {
  .planner-shell {
    grid-template-columns: minmax(0, 1fr) 325px;
  }
  #map {
    min-height: 430px;
  }
}

@media (max-width: 980px) {
  .planner-shell {
    grid-template-columns: 1fr;
  }
  .planner-info-strip {
    grid-template-columns: 1fr;
  }
  #map {
    height: 56vh;
    min-height: 420px;
  }
}

@media print {
  .planner-info-strip {
    grid-template-columns: 1fr;
  }
}


/* v0.3.5 Sans Souci + 500 ft planning area note */
.area-limit-note {
  padding: 0.45rem 0.7rem;
  border-top: 1px solid var(--border);
  background: #ecfdf5;
  color: #14532d;
  font-size: 0.84rem;
  line-height: 1.35;
}

.area-limit-note strong {
  color: #064e3b;
}

@media print {
  .area-limit-note {
    border: 1px solid #aaa;
  }
}
