:root {
  --text: #1d1d1f;
  --text-strong: #000000;
  --muted: rgba(0, 0, 0, 0.48);
  --surface: #ffffff;
  --surface-soft: #f5f5f7;
  --surface-hover: #fafafc;
  --blue: #0066cc;
  --orange: #f59e0b;
  --frame: #000000;
  --shadow-2: rgba(0, 0, 0, 0.12) 0 1px 2px,
    rgba(0, 0, 0, 0.08) 0 8px 24px;
  --shadow-soft: rgba(0, 0, 0, 0.08) 0 1px 12px;
  --radius: 8px;
  --radius-lg: 16px;
  --max-width: 1440px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 128px;
}

body {
  margin: 0;
  background: var(--surface-soft);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.47;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

.top-nav,
.toolbar-wrap {
  position: sticky;
  z-index: 20;
  background: rgba(245, 245, 247, 0.84);
  backdrop-filter: saturate(180%) blur(20px);
}

.top-nav {
  top: 0;
  box-shadow: var(--shadow-2);
}

.nav-inner,
.toolbar,
.app-shell {
  width: min(var(--max-width), calc(100vw - 48px));
  margin: 0 auto;
}

.nav-inner {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 210px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--text);
  color: #fff;
  font-size: 18px;
}

.brand-name,
h1,
h2,
h3 {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 600;
  letter-spacing: 0;
}

.brand-name {
  display: block;
  font-size: 16px;
  line-height: 1;
}

.brand-caption {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.nav-links {
  display: flex;
  gap: 20px;
  color: var(--text-strong);
  font-size: 14px;
  font-weight: 400;
}

.auth-cluster {
  min-width: 280px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  position: relative;
}

.toolbar-wrap {
  top: 56px;
  box-shadow: var(--shadow-soft);
}

.toolbar {
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.date-controls,
.viewer-actions,
.section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.viewer-actions {
  gap: 6px;
}

.viewer-title {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.viewer-actions .button {
  min-height: 34px;
  padding: 0 12px;
}

.toolbar-action {
  margin-left: auto;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar-actions .button {
  white-space: nowrap;
}

.date-pill {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 9999px;
  box-shadow: var(--shadow-2);
  background: rgba(255, 255, 255, 0.88);
}

.date-pill span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.date-pill input {
  width: 140px;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-weight: 500;
}

.button,
.icon-button,
.segmented button,
.text-button {
  border: 0;
  background: #fff;
  color: var(--text);
}

.button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: var(--radius);
  font-weight: 400;
  box-shadow: var(--shadow-2);
}

.button-primary {
  background: #1d1d1f;
  color: #fff;
  box-shadow: var(--shadow-2);
}

.button-ghost {
  background: #fff;
}

.button:hover,
.icon-button:hover,
.segmented button:hover {
  opacity: 0.76;
}

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

.button:focus-visible,
.icon-button:focus-visible,
.segmented button:focus-visible,
.text-button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid #0071e3;
  outline-offset: 2px;
}

.pill {
  border-radius: 9999px;
}

.full-width {
  width: 100%;
}

.icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 9999px;
  box-shadow: var(--shadow-2);
  font-size: 16px;
  font-weight: 500;
}

.status-chip {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 9999px;
  background: var(--surface-hover);
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
}

.status-chip.available {
  color: #116329;
  background: #ecfdf3;
}

.status-chip.missing {
  color: #7c2d12;
  background: #fff7ed;
}

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 9999px;
  background: var(--surface-soft);
  box-shadow: var(--shadow-2);
  margin-left: auto;
}

.segmented.small {
  margin-left: 0;
}

.segmented button {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
}

.segmented button.active {
  background: var(--text);
  color: #fff;
}

.app-shell {
  padding: 18px 0 64px;
}

.observation-header,
.section-heading,
.panel-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.observation-header {
  margin-bottom: 14px;
}

h1 {
  margin: 0;
  font-size: clamp(32px, 3.4vw, 42px);
  line-height: 1.08;
}

h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.14;
}

h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.19;
}

p {
  margin: 0;
}

.observation-header p,
.section-heading p,
.panel-heading p,
.media-title span,
.all-bands-summary,
.header-meta {
  color: var(--muted);
  font-weight: 400;
}

.header-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-size: 13px;
}

.workbench {
  display: block;
}

.viewer-panel,
.event-rail,
.media-panel,
.flare-section,
.plot-panel {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
}

.viewer-panel {
  padding: 16px;
}

.event-rail {
  padding: 18px;
  margin-top: 20px;
}

.panel-heading {
  margin-bottom: 12px;
  gap: 16px;
}

.panel-heading.compact {
  align-items: flex-start;
}

.focus-panel,
.all-bands-panel {
  display: grid;
  gap: 10px;
}

.product-controls {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.product-control {
  display: grid;
  gap: 8px;
}

.product-control:first-child {
  min-width: 0;
  flex: 1 1 auto;
}

.band-selector {
  display: grid;
  gap: 8px;
}

.control-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.band-rail,
.tag-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.band-rail button,
.tag-rail button {
  min-width: 72px;
  min-height: 34px;
  border: 0;
  border-radius: 9999px;
  background: #fff;
  color: var(--text);
  font-weight: 500;
  box-shadow: var(--shadow-2);
}

.tag-rail button {
  min-width: auto;
  padding: 0 12px;
}

.band-rail button.active,
.tag-rail button.active {
  background: var(--text);
  color: #fff;
}

.focus-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
  align-items: start;
}

.image-frame {
  position: relative;
  overflow: hidden;
  background: var(--frame);
  border-radius: 12px;
}

.large-frame {
  aspect-ratio: auto;
  height: clamp(360px, 52vh, 560px);
  min-height: 0;
  cursor: zoom-in;
  touch-action: none;
  user-select: none;
}

.large-frame.zoomed {
  cursor: grab;
}

.large-frame.panning {
  cursor: grabbing;
}

.spec-frame {
  aspect-ratio: 16 / 10;
}

.image-frame img,
.layer-stage img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.layer-stage {
  position: absolute;
  inset: 0;
  transform-origin: center center;
  will-change: transform;
  pointer-events: none;
}

.layer-stage img {
  position: absolute;
  inset: 0;
  transition: opacity 120ms ease;
  user-select: none;
  -webkit-user-drag: none;
}

.frame-message {
  position: absolute;
  inset: auto 16px 16px 16px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(17, 17, 17, 0.76);
  color: #fff;
  font-weight: 500;
}

.zoom-controls {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
}

.zoom-controls button {
  min-height: 24px;
  border: 0;
  border-radius: 9999px;
  padding: 0 8px;
  background: var(--text);
  color: #fff;
  font-size: 12px;
}

.layer-panel {
  padding: 14px;
  border-radius: 12px;
  background: var(--surface-soft);
  box-shadow: inset rgba(34, 42, 53, 0.08) 0 0 0 1px;
}

.layer-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-weight: 500;
}

.text-button {
  padding: 0;
  color: var(--blue);
  background: transparent;
  font-size: 12px;
  font-weight: 500;
}

.layer-list {
  display: grid;
  gap: 10px;
}

.layer-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.layer-row.active {
  color: var(--text);
}

.layer-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--text);
}

.layer-row input[type="range"] {
  grid-column: 2 / 4;
  width: 100%;
  accent-color: var(--text);
}

.layer-row .layer-percent {
  min-width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.all-bands-summary {
  display: block;
  font-size: 13px;
}

.all-bands-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 60px) / 6);
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 2px 10px;
  scroll-snap-type: x proximity;
}

.band-tile {
  padding: 10px;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-2);
  scroll-snap-align: start;
}

.band-tile.openable {
  cursor: zoom-in;
}

.band-tile.openable:hover {
  box-shadow: rgba(0, 0, 0, 0.16) 0 2px 4px,
    rgba(0, 0, 0, 0.10) 0 10px 28px;
}

.band-tile:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.band-tile .image-frame {
  aspect-ratio: 1 / 1;
  border-radius: 8px;
}

.tile-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 500;
}

.tile-status {
  color: var(--muted);
  font-weight: 400;
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 16px;
}

.summary-stats div {
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-soft);
}

.summary-stats dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.summary-stats dd {
  margin: 6px 0 0;
  font-size: 18px;
  font-weight: 500;
}

.summary-events,
.flare-events {
  display: grid;
  gap: 8px;
}

.event-rail .summary-events {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.summary-event,
.flare-event {
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-2);
}

.summary-event {
  padding: 12px;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.flare-event {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
}

.event-id {
  color: var(--blue);
  font-weight: 500;
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.peak-dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 9999px;
  background: var(--orange);
  vertical-align: middle;
}

.event-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.spectrogram-section,
.flare-section,
.plot-panel {
  margin-top: 20px;
}

.section-heading {
  margin-bottom: 12px;
}

.heading-inline {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-width: 0;
}

.heading-inline p {
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
}

.spectrogram-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.media-panel {
  padding: 14px;
}

.media-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.media-title h3 {
  min-width: 0;
}

.media-title .segmented {
  flex: 0 0 auto;
}

.spec-frame.openable {
  cursor: zoom-in;
}

.spec-frame:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.flare-section,
.plot-panel {
  padding: 24px;
}

.range-form {
  display: flex;
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px;
  border-radius: 12px;
  background: var(--surface-soft);
}

.range-form label,
.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.range-form input,
.auth-form input,
.auth-form textarea {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
  box-shadow: rgba(34, 42, 53, 0.12) 0 0 0 1px;
}

.auth-form textarea {
  resize: vertical;
}

.captcha-container {
  min-height: 65px;
}

.inline-status {
  color: var(--muted);
  font-weight: 400;
  margin-bottom: 12px;
}

.table-wrap {
  max-height: min(72vh, 760px);
  overflow: auto;
  margin-top: 16px;
  border-radius: 12px;
  box-shadow: inset rgba(34, 42, 53, 0.14) 0 0 0 1px;
  background: #fff;
}

.data-table {
  width: 100%;
  min-width: 1640px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  line-height: 1.28;
}

.data-table th,
.data-table td {
  padding: 9px 10px;
  border-right: 1px solid #e5e5ea;
  border-bottom: 1px solid #e5e5ea;
  text-align: left;
  vertical-align: middle;
  background: #fff;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f5f5f7;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table .col-entry {
  width: 68px;
  min-width: 68px;
}

.data-table .col-flare {
  width: 160px;
  min-width: 160px;
}

.data-table .col-entry,
.data-table .col-flare {
  position: sticky;
  z-index: 2;
}

.data-table .col-entry {
  left: 0;
}

.data-table .col-flare {
  left: 68px;
}

.data-table th.col-entry,
.data-table th.col-flare {
  z-index: 4;
}

.data-table .col-time {
  width: 150px;
  min-width: 150px;
}

.data-table .col-goes,
.data-table .col-number {
  width: 82px;
  min-width: 82px;
}

.data-table .col-action {
  width: 104px;
  min-width: 104px;
  text-align: center;
}

.data-table .col-comments {
  width: 180px;
  min-width: 180px;
}

.data-table tbody tr:nth-child(odd) td {
  background: #fafafa;
}

.data-table tbody tr:hover td,
.data-table tbody tr:focus-visible td {
  background: var(--surface-hover);
}

.data-table tbody tr {
  cursor: pointer;
}

.data-table tbody tr:focus-visible {
  outline: 2px solid #0071e3;
  outline-offset: -2px;
}

.flare-id-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: #ff9500;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.flare-id-link.strong {
  color: var(--blue);
}

.table-action {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border-radius: 9999px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.table-action:hover {
  color: #fff;
  background: var(--text);
}

.table-text-link {
  color: var(--blue);
  font-weight: 500;
}

.empty-cell {
  color: var(--muted);
}

.plot-container {
  min-height: 420px;
}

.user-menu {
  position: relative;
}

.user-pill {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 0;
  border-radius: 9999px;
  background: #fff;
  box-shadow: var(--shadow-2);
  color: var(--text);
  font-weight: 500;
}

.user-pill span:first-child {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 9999px;
  background: var(--text);
  color: #fff;
}

.user-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  padding: 8px;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-2);
}

.footer {
  width: min(var(--max-width), calc(100vw - 48px));
  margin: 0 auto 36px;
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.footer img {
  max-height: 48px;
  width: auto;
}

.tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  pointer-events: auto;
}

.tutorial-overlay.no-target {
  background: rgba(17, 17, 17, 0.48);
}

.tutorial-highlight {
  position: fixed;
  z-index: 121;
  border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(17, 17, 17, 0.48),
    0 0 0 4px rgba(0, 113, 227, 0.28);
  pointer-events: none;
  transition: left 140ms ease, top 140ms ease, width 140ms ease, height 140ms ease;
}

.tutorial-card {
  position: fixed;
  z-index: 122;
  width: min(360px, calc(100vw - 32px));
  padding: 18px;
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: rgba(0, 0, 0, 0.18) 0 16px 48px,
    rgba(0, 0, 0, 0.12) 0 2px 8px;
}

.tutorial-card:focus {
  outline: none;
}

.tutorial-step-count {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.tutorial-card h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.tutorial-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.tutorial-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.tutorial-actions div {
  display: flex;
  gap: 8px;
}

.tutorial-actions .button:disabled {
  opacity: 0.36;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17, 17, 17, 0.5);
}

.modal {
  position: relative;
  width: min(480px, 100%);
  padding: 24px;
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-2);
}

.modal h2 {
  margin-bottom: 8px;
}

.modal p {
  color: var(--muted);
  margin-bottom: 18px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 9999px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
}

.coverage-modal {
  position: relative;
  width: min(1500px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-2);
}

.coverage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-right: 40px;
}

.coverage-header h2 {
  margin: 0 0 6px;
}

.coverage-header p {
  margin: 0;
  color: var(--muted);
}

.coverage-controls,
.coverage-year-tools,
.coverage-legend {
  display: flex;
  align-items: center;
  gap: 8px;
}

.coverage-controls {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.coverage-year-tools {
  min-height: 40px;
}

.coverage-year-tools .icon-button {
  width: 34px;
  height: 34px;
}

.coverage-year-tools .icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.coverage-year-tools span {
  min-width: 52px;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.coverage-legend {
  flex-wrap: wrap;
  margin: 12px 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.coverage-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.coverage-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  box-shadow: inset rgba(0, 0, 0, 0.12) 0 0 0 1px;
}

.coverage-summary {
  margin-bottom: 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}

.coverage-status.error {
  color: #b42318;
}

.coverage-year-view {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 8px;
}

.coverage-month {
  min-width: 0;
  padding: 9px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
}

.coverage-month h3 {
  margin-bottom: 6px;
  text-align: center;
  font-size: 15px;
}

.coverage-weekdays,
.coverage-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.coverage-weekdays {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.coverage-day {
  position: relative;
  min-width: 0;
  border: 0;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

button.coverage-day:hover {
  filter: brightness(0.94);
}

button.coverage-day:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.coverage-calendar {
  width: 100%;
  height: 28px;
}

.coverage-history-view {
  overflow-x: auto;
  padding-bottom: 6px;
}

.coverage-history-map {
  --coverage-history-cell: 10px;
  --coverage-history-gap: 3px;
  width: max-content;
  min-width: 100%;
}

.coverage-history-months {
  display: grid;
  gap: var(--coverage-history-gap);
  width: max-content;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.coverage-history-months span {
  min-width: 28px;
}

.coverage-history-grid {
  display: grid;
  grid-template-rows: repeat(7, var(--coverage-history-cell));
  gap: var(--coverage-history-gap);
  width: max-content;
}

.coverage-history {
  width: var(--coverage-history-cell);
  height: var(--coverage-history-cell);
  border-radius: 3px;
}

.coverage-complete {
  background: #0f766e;
  color: #fff;
}

.coverage-partial {
  background: #d97706;
  color: #fff;
}

.coverage-none {
  background-color: #e5e7eb;
  background-image: linear-gradient(
    135deg,
    transparent 0 calc(50% - 0.7px),
    rgba(71, 85, 105, 0.58) calc(50% - 0.7px) calc(50% + 0.7px),
    transparent calc(50% + 0.7px)
  );
  color: #475569;
}

.coverage-calendar.coverage-none::after {
  content: "\00d7";
  position: absolute;
  top: 4px;
  right: 5px;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
}

.coverage-future,
.coverage-outside,
.coverage-blank {
  background: #f8fafc;
  color: #94a3b8;
  box-shadow: inset #e5e7eb 0 0 0 1px;
}

.coverage-blank {
  background: transparent;
  box-shadow: none;
}

.coverage-detail {
  min-height: 18px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.access-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.access-status.error {
  color: #b42318;
}

[hidden] {
  display: none !important;
}

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

  .coverage-year-view {
    grid-template-columns: repeat(3, minmax(210px, 1fr));
  }
}

@media (max-height: 900px) and (min-width: 981px) {
  .large-frame {
    height: clamp(340px, calc(100vh - 410px), 520px);
  }

  .band-rail button {
    min-width: 68px;
    min-height: 32px;
  }

  .layer-panel {
    max-height: clamp(340px, calc(100vh - 410px), 520px);
    overflow: auto;
    padding: 12px;
  }

  .layer-list {
    gap: 8px;
  }
}

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

  .coverage-year-view {
    grid-template-columns: repeat(2, minmax(210px, 1fr));
  }
}

@media (max-width: 768px) {
  .nav-inner,
  .toolbar,
  .app-shell,
  .footer {
    width: min(100vw - 24px, var(--max-width));
  }

  .nav-links {
    display: none;
  }

  .toolbar,
  .observation-header,
  .section-heading,
  .panel-heading,
  .product-controls,
  .flare-event,
  .range-form {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar {
    padding: 12px 0;
  }

  .segmented {
    margin-left: 0;
  }

  .toolbar-action {
    margin-left: 0;
  }

  .coverage-modal {
    padding: 18px;
  }

  .coverage-header,
  .coverage-controls {
    align-items: flex-start;
    flex-direction: column;
  }

  .coverage-header {
    padding-right: 34px;
    gap: 14px;
  }

  .coverage-controls {
    justify-content: flex-start;
  }

  .coverage-year-view {
    grid-template-columns: 1fr;
  }

  .coverage-calendar {
    min-height: 34px;
  }

  .large-frame {
    min-height: auto;
  }

  .all-bands-grid {
    grid-auto-columns: minmax(180px, 72vw);
  }

  .heading-inline {
    align-items: stretch;
    flex-direction: column;
    gap: 4px;
  }

  .heading-inline p {
    white-space: normal;
  }

  .flare-event {
    grid-template-columns: 1fr;
  }
}
