/* Radio Coverage Planner — styles.css */
:root {
  --green-dark: #1b6b3a;
  --green-mid: #2d8a4e;
  --green-light: #c8e6c9;
  --green-bg: #e8f5e9;
  --orange: #e67e22;
  --red: #c9302c;
  --red-hover: #a82522;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --radius: 8px;
  --radius-sm: 5px;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  color: var(--gray-900);
  background: #f5f7f4;
  line-height: 1.55;
  min-height: 100vh;
}

.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;
}

/* Header */
.site-header {
  background: #fff;
  border-bottom: 2px solid var(--green-light);
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  max-width: 1100px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand-icon { flex-shrink: 0; }
.brand-name { font-weight: 700; font-size: 1.1rem; color: var(--green-dark); }
.nav-links { display: flex; gap: 16px; font-size: 0.9rem; }
.nav-links a {
  text-decoration: none; color: var(--gray-700);
  padding: 4px 8px; border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.nav-links a:hover, .nav-links a.active { background: var(--green-bg); color: var(--green-dark); }

/* App shell */
.app-shell {
  max-width: 1100px; margin: 20px auto; padding: 0 16px;
  display: grid; grid-template-columns: 1fr 340px;
  grid-template-rows: auto auto;
  gap: 16px;
  align-items: start;
}
.map-section { grid-column: 1; grid-row: 1 / 3; }
.station-panel { grid-column: 2; grid-row: 1; }
.results-actions { grid-column: 2; grid-row: 2; }

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  .map-section, .station-panel, .results-actions { grid-column: 1; }
  .station-panel { grid-row: 2; }
  .results-actions { grid-row: 3; }
}

/* Map section */
.map-toolbar {
  background: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 10px 14px;
  display: flex; flex-wrap: wrap; gap: 8px;
  align-items: center;
  border: 1px solid var(--gray-200);
  border-bottom: none;
}
.location-search {
  display: flex; align-items: center; gap: 4px;
  flex: 1; min-width: 180px;
}
.location-search input {
  flex: 1; padding: 6px 10px; border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm); font-size: 0.9rem;
}
.location-search input:focus { outline: 2px solid var(--green-mid); outline-offset: 1px; }
.location-search button {
  background: var(--green-mid); color: #fff; border: none;
  padding: 6px 10px; border-radius: var(--radius-sm);
  cursor: pointer; display: flex; align-items: center;
}
.location-search button:hover { background: var(--green-dark); }
.quick-cities { display: flex; flex-wrap: wrap; gap: 4px; }
.quick-cities button {
  font-size: 0.75rem; padding: 3px 8px;
  background: var(--gray-100); border: 1px solid var(--gray-300);
  border-radius: 12px; cursor: pointer;
  white-space: nowrap; color: var(--gray-700);
  transition: all 0.12s;
}
.quick-cities button:hover { background: var(--green-light); border-color: var(--green-mid); color: var(--green-dark); }

.map-container {
  background: #d4e2d4;
  border: 1px solid var(--gray-200);
  position: relative;
  min-height: 400px;
}
#coverage-svg { width: 100%; height: auto; display: block; cursor: crosshair; }
.map-overlay-info {
  position: absolute; bottom: 10px; left: 12px;
  background: rgba(255,255,255,0.92);
  padding: 6px 10px; border-radius: var(--radius-sm);
  font-size: 0.8rem; box-shadow: var(--shadow-sm);
  display: flex; gap: 8px;
}
.pin-location-label { font-weight: 600; color: var(--gray-900); }
.pin-coords { color: var(--gray-500); }

.map-controls {
  background: #fff;
  padding: 10px 14px;
  display: flex; flex-wrap: wrap; gap: 16px;
  border: 1px solid var(--gray-200);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
}
.control-group { display: flex; flex-direction: column; gap: 4px; }
.control-group label { font-size: 0.8rem; font-weight: 600; color: var(--gray-700); }
.control-group select, .control-group input[type="range"] {
  font-size: 0.85rem; padding: 4px 8px; border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
}
.terrain-ticks {
  display: flex; justify-content: space-between;
  font-size: 0.7rem; color: var(--gray-500);
  max-width: 260px;
}

/* Station panel & results-actions */
.station-panel, .results-actions {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.station-panel h2, .results-actions h3 {
  font-size: 1rem; color: var(--green-dark);
  margin-bottom: 8px;
}
.panel-header { display: flex; justify-content: space-between; align-items: center; }
.btn-sm {
  font-size: 0.75rem; padding: 3px 10px;
  background: var(--gray-100); border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm); cursor: pointer;
  color: var(--gray-700);
}
.btn-sm:hover { background: var(--gray-200); }

.station-presets { margin-bottom: 14px; }
#station-preset-select {
  width: 100%; padding: 6px 8px; font-size: 0.85rem;
  border: 1px solid var(--gray-300); border-radius: var(--radius-sm);
}
.preset-details {
  display: flex; gap: 10px; margin-top: 6px;
  font-size: 0.8rem; color: var(--gray-700);
}
.preset-callsign { font-weight: 700; }

.custom-station h3 { font-size: 0.9rem; margin-bottom: 6px; color: var(--gray-700); }
.form-row { margin-bottom: 8px; display: flex; flex-direction: column; gap: 2px; }
.form-row label { font-size: 0.75rem; font-weight: 600; color: var(--gray-500); }
.form-row input, .form-row select {
  padding: 5px 8px; font-size: 0.85rem;
  border: 1px solid var(--gray-300); border-radius: var(--radius-sm);
}
.form-row input:focus, .form-row select:focus {
  outline: 2px solid var(--green-mid); outline-offset: 1px;
}
.form-row-2col { flex-direction: row; gap: 8px; }
.form-row-2col > div { flex: 1; display: flex; flex-direction: column; gap: 2px; }

.btn-primary {
  width: 100%; padding: 8px; font-size: 0.85rem;
  background: var(--green-mid); color: #fff;
  border: none; border-radius: var(--radius-sm);
  cursor: pointer; font-weight: 600;
  margin-top: 4px;
}
.btn-primary:hover { background: var(--green-dark); }

.alt-stations { margin-top: 14px; border-top: 1px solid var(--gray-200); padding-top: 10px; }
.alt-stations h3 { font-size: 0.85rem; margin-bottom: 6px; }
#alt-stations-list { list-style: none; padding: 0; }
.alt-item {
  display: flex; gap: 8px; align-items: center;
  padding: 5px 8px; background: var(--gray-50);
  border-radius: var(--radius-sm); margin-bottom: 4px;
  font-size: 0.82rem;
}
.alt-callsign { font-weight: 700; }
.alt-band { color: var(--gray-500); }
.alt-signal { margin-left: auto; font-weight: 600; }
.alt-signal:has-text("Strong") { color: var(--green-dark); }
.alt-signal:has-text("Moderate") { color: var(--orange); }

/* Signal meter */
.signal-meter { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.signal-label {
  font-weight: 700; font-size: 0.9rem; min-width: 60px;
}
.meter-bar {
  flex: 1; height: 10px; background: var(--gray-200);
  border-radius: 5px; overflow: hidden;
}
.meter-fill {
  height: 100%; border-radius: 5px; transition: width 0.3s, background 0.3s;
}
.meter-fill.strong { background: var(--green-mid); }
.meter-fill.moderate { background: var(--orange); }
.meter-fill.weak { background: var(--red); }
.signal-detail { font-size: 0.8rem; color: var(--gray-700); line-height: 1.4; }

/* Action buttons */
.action-buttons { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.btn-action {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 12px; font-size: 0.8rem;
  background: var(--gray-100); border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm); cursor: pointer;
  color: var(--gray-700); transition: background 0.12s;
}
.btn-action:hover { background: var(--gray-200); }

/* Supporting content */
.supporting-content {
  max-width: 1100px; margin: 30px auto 0; padding: 0 16px 40px;
}
.support-inner h2 {
  font-size: 1.3rem; color: var(--green-dark);
  margin-bottom: 12px;
}
.support-inner p {
  margin-bottom: 14px; color: var(--gray-700);
  font-size: 0.95rem; max-width: 72ch;
}
.scenario-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px; margin: 20px 0;
}
.scenario-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.scenario-card h3 {
  font-size: 0.95rem; color: var(--green-dark);
  margin-bottom: 6px;
}
.scenario-card p { font-size: 0.85rem; color: var(--gray-700); margin-bottom: 0; }

.assumptions-block {
  background: #fffbe6;
  border: 1px solid #f0d060;
  border-radius: var(--radius);
  padding: 16px;
  margin: 20px 0;
}
.assumptions-block h3 { font-size: 0.95rem; color: #8a6d14; margin-bottom: 8px; }
.assumptions-block ul { padding-left: 18px; font-size: 0.85rem; color: var(--gray-700); }
.assumptions-block li { margin-bottom: 6px; }

.power-class-reference { margin: 20px 0; }
.power-class-reference h3 { font-size: 1rem; color: var(--green-dark); margin-bottom: 8px; }
.ref-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.85rem; background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.ref-table th {
  background: var(--green-bg); color: var(--green-dark);
  padding: 8px 10px; text-align: left;
  font-weight: 600;
}
.ref-table td {
  padding: 7px 10px; border-top: 1px solid var(--gray-200);
  color: var(--gray-700);
}

.common-mistakes { margin: 20px 0; }
.common-mistakes h3 { font-size: 1rem; color: var(--green-dark); margin-bottom: 8px; }
.common-mistakes ol { padding-left: 20px; font-size: 0.88rem; color: var(--gray-700); }
.common-mistakes li { margin-bottom: 6px; }

.last-updated {
  font-size: 0.8rem; color: var(--gray-500);
  margin-top: 24px; border-top: 1px solid var(--gray-200);
  padding-top: 12px;
}

/* Footer */
.site-footer {
  background: #fff;
  border-top: 2px solid var(--green-light);
  padding: 20px 16px;
  margin-top: 30px;
}
.footer-inner {
  max-width: 1100px; margin: 0 auto;
  font-size: 0.82rem; color: var(--gray-500);
  text-align: center;
}
.footer-inner a { color: var(--green-mid); text-decoration: none; }
.footer-inner a:hover { text-decoration: underline; }
.footer-links { margin-top: 6px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--gray-900); color: #fff;
  padding: 10px 20px; border-radius: 20px;
  font-size: 0.85rem; z-index: 100;
  box-shadow: var(--shadow-md);
  opacity: 0; transition: opacity 0.25s;
}
.toast.show { opacity: 1; }

@media print {
  .site-header, .site-footer, .map-toolbar, .action-buttons,
  .station-panel .custom-station, .alt-stations, .supporting-content,
  .toast, #copy-toast { display: none !important; }
  .app-shell { display: block; max-width: none; padding: 0; }
  .map-container { border: 1px solid #000; }
  .results-actions { border: none; box-shadow: none; page-break-inside: avoid; }
  .station-panel { border: none; box-shadow: none; page-break-inside: avoid; }
  body { background: #fff; }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
