:root {
  --bg-top: #0b1220;
  --bg-mid: #121b31;
  --bg-bottom: #1e335c;
  --panel: rgba(241, 245, 249, 0.95);
  --panel-strong: rgba(255, 255, 255, 0.98);
  --panel-border: rgba(148, 163, 184, 0.28);
  --panel-shadow: 0 24px 80px rgba(15, 23, 42, 0.22);
  --text: #0f172a;
  --muted: #475569;
  --accent: #f3b64d;
  --accent-strong: #c7771f;
  --line: rgba(148, 163, 184, 0.2);
  --hero-text: #f8fbff;
  --hero-muted: rgba(226, 232, 240, 0.88);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(243, 182, 77, 0.2), transparent 28%),
    radial-gradient(circle at 80% 18%, rgba(96, 165, 250, 0.16), transparent 24%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 48%, var(--bg-bottom) 100%);
  font-family:
    "Segoe UI",
    "Trebuchet MS",
    sans-serif;
  padding: 22px;
}

.page-shell {
  width: min(100%, 1680px);
  margin: 0 auto;
}

.hero {
  position: relative;
  margin-bottom: 24px;
  padding: 32px 34px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(30, 51, 92, 0.88)),
    radial-gradient(circle at 12% 14%, rgba(243, 182, 77, 0.16), transparent 30%);
  box-shadow: var(--panel-shadow);
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 84% 18%, rgba(243, 182, 77, 0.14), transparent 18%),
    radial-gradient(circle at 20% 110%, rgba(125, 211, 252, 0.16), transparent 24%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  gap: 28px;
  align-items: center;
}

.hero-copy-block {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hero-visual {
  position: relative;
  min-height: 250px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 215, 137, 0.14), transparent 16%),
    radial-gradient(circle at 50% 50%, rgba(148, 163, 184, 0.14), transparent 44%),
    linear-gradient(180deg, rgba(10, 14, 23, 0.64), rgba(15, 23, 42, 0.42));
  box-shadow:
    inset 0 0 32px rgba(148, 163, 184, 0.14),
    0 14px 36px rgba(0, 0, 0, 0.18);
}

.hero-orbit {
  position: absolute;
  border: 1px solid rgba(226, 232, 240, 0.14);
  border-radius: 999px;
}

.hero-orbit-large {
  inset: 26px;
}

.hero-orbit-small {
  inset: 56px;
}

.hero-eclipse-disc {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 142px;
  height: 142px;
  transform: translate(-50%, -50%);
}

.hero-eclipse-core,
.hero-eclipse-glow {
  position: absolute;
  border-radius: 999px;
}

.hero-eclipse-core {
  inset: 10px;
  background:
    radial-gradient(circle at 50% 50%, #fff6d1 0%, #f8c55d 58%, #c7771f 100%);
  box-shadow: 0 0 28px rgba(248, 197, 93, 0.7);
}

.hero-eclipse-glow {
  inset: 0;
  border: 10px solid rgba(249, 216, 147, 0.9);
  box-shadow: 0 0 0 2px rgba(249, 216, 147, 0.12);
}

.hero-eclipse-disc::after {
  content: "";
  position: absolute;
  top: 14px;
  left: 54px;
  width: 116px;
  height: 116px;
  border-radius: 999px;
  background: #0b1220;
}

.hero-visual-label {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(243, 182, 77, 0.16);
  color: #f8d58d;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.eyebrow,
.mini-label,
.fact-label {
  margin: 0;
  color: var(--hero-muted);
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 0.78rem;
  font-weight: 700;
}

.mini-label,
.fact-label {
  color: var(--muted);
}

.hero h1,
.panel-head h2,
.summary-head h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  line-height: 1.06;
}

.hero h1 {
  color: var(--hero-text);
  font-size: clamp(2.35rem, 4vw, 4.2rem);
}

.hero-copy {
  max-width: 820px;
  margin: 0;
  color: var(--hero-muted);
  font-size: 1.08rem;
  line-height: 1.72;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-point {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(226, 232, 240, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #f8fbff;
  font-size: 0.94rem;
  font-weight: 600;
}

.layout {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 22px;
  align-items: start;
}

.panel {
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--panel-shadow);
  backdrop-filter: blur(18px);
  padding: 24px;
}

.input-panel {
  grid-column: span 6;
}

.summary-panel {
  grid-column: span 6;
}

.map-panel {
  grid-column: 1 / -1;
  position: relative;
  padding: 0;
  overflow: hidden;
  background: var(--panel-strong);
}

.timeline-panel {
  grid-column: span 5;
}

.detail-panel {
  grid-column: span 7;
}

.about-panel {
  grid-column: span 4;
  align-items: flex-start;
}

.input-panel,
.summary-panel,
.timeline-panel,
.detail-panel,
.about-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.map-panel .panel-head {
  padding: 24px 24px 0;
}

.panel-head,
.summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.summary-head h2,
.panel-head h2 {
  color: var(--text);
  font-size: clamp(1.55rem, 2vw, 2.05rem);
}

.analysis-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.field-label {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.field-help-anchor {
  position: relative;
  flex: 0 0 auto;
}

.location-input,
.number-input {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 20px;
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.location-input {
  min-height: 112px;
  resize: vertical;
  padding: 16px 18px;
}

.number-input {
  min-height: 54px;
  padding: 12px 16px;
}

.field-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.button-row,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.primary-button,
.ghost-button,
.action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease;
}

.primary-button {
  color: #1a202f;
  background: linear-gradient(135deg, #f6c96d 0%, #d48b2a 100%);
  box-shadow: 0 10px 24px rgba(245, 158, 11, 0.25);
}

.ghost-button,
.action-link {
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.84);
}

.primary-button:hover,
.ghost-button:hover,
.action-link:hover {
  transform: translateY(-1px);
}

.status-box,
.map-click-toast,
.note-box,
.result-copy,
.better-spot-box,
.visibility-item,
.timeline-item,
.fact-card {
  border-radius: 20px;
}

.status-box,
.result-copy,
.note-box,
.fact-card,
.timeline-item,
.visibility-item,
.better-spot {
  border: 1px solid var(--line);
}

.status-box {
  padding: 15px 16px;
  background: rgba(255, 248, 225, 0.86);
  color: var(--muted);
}

.map-click-toast {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 12;
  width: min(calc(100% - 24px), 320px);
  padding: 14px 18px;
  border: 1px solid rgba(47, 125, 116, 0.28);
  background: rgba(15, 23, 42, 0.96);
  color: #effcf7;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.34);
  text-align: center;
  line-height: 1.5;
  transform: translate(-50%, -100%);
  animation: toast-rise 220ms ease;
  pointer-events: none;
}

.safety-alert {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(243, 182, 77, 0.42);
  background: rgba(255, 247, 232, 0.95);
  color: #9f4711;
}

.safety-alert-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(243, 200, 113, 0.28);
  font-size: 1rem;
}

.safety-alert-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.safety-alert-copy strong,
.safety-alert-copy p {
  margin: 0;
}

.safety-alert-copy p {
  line-height: 1.52;
}

.note-box {
  padding: 16px 18px;
  background: rgba(248, 250, 252, 0.84);
  color: var(--muted);
  line-height: 1.62;
}

.card-help {
  position: relative;
  z-index: 8;
}

.card-help.open {
  z-index: 32;
}

.card-help-button {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(255, 255, 255, 0.96);
  color: #1d4ed8;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.card-help-button:hover,
.card-help-button:focus-visible {
  background: #eff6ff;
  color: #1e40af;
  outline: none;
}

.card-help-popup {
  position: absolute;
  top: 40px;
  right: 0;
  width: min(420px, calc(100vw - 44px));
  max-height: min(70vh, 640px);
  overflow: auto;
  padding: 16px 16px 14px;
  border: 1px solid #dbeafe;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  color: #0f172a;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(10px);
  display: none;
  text-align: left;
}

.card-help.open .card-help-popup {
  display: block;
}

.card-help-title {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
}

.card-help-section + .card-help-section {
  margin-top: 12px;
}

.card-help-section h4 {
  margin: 0 0 8px;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #475569;
}

.card-help-section p {
  margin: 0 0 8px;
  line-height: 1.5;
  color: #334155;
}

.card-help-list {
  margin: 0;
  padding-left: 18px;
  color: #334155;
}

.card-help-list li + li {
  margin-top: 6px;
}

.result-badge {
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}

.result-badge.neutral {
  color: #475569;
  background: rgba(148, 163, 184, 0.14);
}

.result-badge.good {
  color: #175c54;
  background: rgba(47, 125, 116, 0.14);
}

.result-badge.warn {
  color: #8b5a14;
  background: rgba(168, 103, 28, 0.14);
}

.result-badge.bad {
  color: #7a2e10;
  background: rgba(143, 60, 18, 0.14);
}

.result-copy {
  padding: 17px 18px;
  background: rgba(248, 250, 252, 0.88);
  color: var(--muted);
  line-height: 1.68;
}

.action-help {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.93rem;
}

.map-help {
  margin: 0;
  padding: 0 24px 14px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.93rem;
}

.facts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.fact-card {
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.76);
}

.fact-value {
  margin: 0;
  font-size: 1rem;
  line-height: 1.48;
  font-weight: 700;
}

.map-frame {
  width: 100%;
  min-height: 640px;
}

.map-stage {
  position: relative;
}

.timeline-list,
.visibility-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 14px;
  padding: 18px 18px;
  background: rgba(255, 255, 255, 0.8);
}

.timeline-accent {
  border-radius: 999px;
  background: linear-gradient(180deg, #db7d37 0%, #8f3c12 100%);
}

.timeline-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.timeline-title,
.timeline-meta,
.timeline-note,
.visibility-title,
.visibility-summary,
.visibility-metrics,
.visibility-obstacles,
.better-spot-title,
.better-spot-copy,
.better-spot-coordinates {
  margin: 0;
}

.timeline-title,
.visibility-title,
.better-spot-title {
  font-weight: 700;
}

.timeline-meta,
.timeline-note,
.visibility-summary,
.visibility-metrics,
.visibility-obstacles,
.better-spot-copy,
.better-spot-coordinates {
  color: var(--muted);
  line-height: 1.58;
}

.visibility-item {
  padding: 18px 18px;
  background: rgba(255, 255, 255, 0.8);
  display: grid;
  grid-template-columns: 8px 1fr;
  column-gap: 14px;
  row-gap: 8px;
}

.visibility-accent {
  grid-column: 1;
  grid-row: 1 / span 4;
  border-radius: 999px;
  background: linear-gradient(180deg, #db7d37 0%, #8f3c12 100%);
}

.visibility-head {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.visibility-summary,
.visibility-metrics,
.visibility-obstacles {
  grid-column: 2;
}

.visibility-chip {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.visibility-chip.good {
  color: #175c54;
  background: rgba(47, 125, 116, 0.14);
}

.visibility-chip.warn {
  color: #8b5a14;
  background: rgba(168, 103, 28, 0.14);
}

.visibility-chip.bad {
  color: #7a2e10;
  background: rgba(143, 60, 18, 0.14);
}

.visibility-chip.neutral {
  color: #475569;
  background: rgba(148, 163, 184, 0.14);
}

.better-spot {
  padding: 18px;
  background: rgba(248, 250, 252, 0.9);
  border-radius: 20px;
}

.about-copy {
  display: grid;
  gap: 10px;
  width: 100%;
  font-size: 0.98rem;
  color: var(--text);
}

.about-line {
  line-height: 1.45;
  word-break: break-word;
}

.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.about-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 999px;
  background: #f8fbff;
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease;
}

.about-link:hover {
  background: #eef5ff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.about-contact {
  display: grid;
  gap: 4px;
  width: 100%;
  color: var(--muted);
}

.about-contact a {
  color: #1d4ed8;
  text-decoration: none;
}

.about-contact a:hover {
  text-decoration: underline;
}

.hidden {
  display: none;
}

.disabled-link {
  pointer-events: none;
  opacity: 0.55;
}

.clipboard-helper {
  position: fixed;
  top: -9999px;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.maplibregl-ctrl-group {
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
}

.maplibregl-popup-content {
  border-radius: 16px;
  font-family:
    "Segoe UI",
    "Trebuchet MS",
    sans-serif;
}

@media (max-width: 1320px) {
  .input-panel,
  .summary-panel {
    grid-column: span 6;
  }

  .map-panel,
  .timeline-panel,
  .detail-panel,
  .about-panel {
    grid-column: span 12;
  }
}

@media (max-width: 980px) {
  body {
    padding: 16px;
  }

  .hero {
    padding: 24px 22px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 220px;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .panel,
  .map-panel,
  .input-panel,
  .summary-panel,
  .timeline-panel,
  .detail-panel,
  .about-panel {
    grid-column: auto;
  }

  .map-frame {
    min-height: 460px;
  }
}

@media (max-width: 680px) {
  body {
    padding: 12px;
  }

  .hero,
  .panel {
    border-radius: 24px;
  }

  .hero h1 {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .hero-copy {
    font-size: 1rem;
    line-height: 1.62;
  }

  .hero-point {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .field-grid,
  .facts-grid {
    grid-template-columns: 1fr;
  }

  .button-row,
  .action-row {
    flex-direction: column;
  }

  .primary-button,
  .ghost-button,
  .action-link {
    width: 100%;
  }

  .summary-head,
  .panel-head,
  .visibility-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .map-panel .panel-head {
    padding: 20px 20px 0;
  }

  .map-help {
    padding: 0 20px 12px;
  }

  .map-frame {
    min-height: 380px;
  }

  .map-click-toast {
    width: min(calc(100% - 20px), 320px);
    padding: 15px 16px;
    font-size: 0.97rem;
  }

  .card-help-popup {
    right: -4px;
    width: min(360px, calc(100vw - 28px));
  }
}

@keyframes toast-rise {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-100% + 10px)) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -100%) scale(1);
  }
}
