:root {
  --bg: #F8F9FA;
  --panel: #ffffff;
  --text: #0F2B46;
  --text-secondary: #6C757D;
  --accent: #1A5276;
  --accent-hover: #2471a3;
  --teal: #17A2B8;
  --teal-light: #1fc8e3;
  --line: #DEE2E6;
  --amber: #F0A500;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.embed {
  padding-top: 0;
}

/* Header */
header {
  padding: 1rem 1.25rem;
  background: #0F2B46;
  color: #ffffff;
  border-bottom: 1px solid var(--line);
}
.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  max-width: 1600px;
  margin: 0 auto;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.user-info {
  color: #ffffff;
  font-size: 0.9rem;
  padding: 0.45rem 0.7rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.secondary-link {
  display: inline-block;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  text-decoration: none;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.9rem;
  transition: background 0.15s;
}
.secondary-link:hover {
  background: rgba(255, 255, 255, 0.2);
}
.dashboard-btn {
  background: rgba(0, 122, 255, 0.15);
  border-color: rgba(0, 122, 255, 0.3);
}
.dashboard-btn:hover {
  background: rgba(0, 122, 255, 0.25);
}
.logout-btn {
  background: rgba(255, 59, 48, 0.15);
  border-color: rgba(255, 59, 48, 0.3);
}
.logout-btn:hover {
  background: rgba(255, 59, 48, 0.25);
}

header h1 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffffff;
}
.header-brand {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: flex-start;
}
.header-logo {
  height: 45px;
  width: auto;
  display: block;
}
header p {
  margin: 0.25rem 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

/* Main layout */
main {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  grid-template-columns: 1fr;
  max-width: 1600px;
  margin: 0 auto;
}

/* Panels / cards */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.panel h2 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.mission-layout {
  grid-template-columns: 1fr;
  max-width: 1180px;
}

.mission-panel {
  max-width: 100%;
}

.mission-banner-panel {
  background: linear-gradient(135deg, #0f2b46 0%, #1a5276 55%, #177e89 100%);
  color: #ffffff;
  border: none;
}

.mission-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.mission-banner--compact h2,
.mission-banner h2 {
  color: #ffffff;
  margin: 0;
}

.mission-kicker {
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.72);
}

.mission-meta {
  margin: 0.35rem 0 0;
  color: rgba(255, 255, 255, 0.84);
}

.mission-banner-actions {
  display: flex;
  gap: 0.75rem;
}

.mission-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.mission-filter-link {
  display: inline-block;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  background: #f4f7f9;
}

.mission-filter-link--active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.mission-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mission-status-badge--active {
  background: #dff6e6;
  color: #17663a;
}

.mission-status-badge--suspended {
  background: #fff1d6;
  color: #8a5300;
}

.mission-status-badge--closed {
  background: #eceff3;
  color: #495057;
}

.mission-section-heading {
  margin-bottom: 1rem;
}

.mission-section-intro {
  margin: 0.35rem 0 0;
  color: var(--text-secondary);
}

.mission-alert {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  background: #fff4e5;
  color: #8a5300;
  border: 1px solid #f0d2a8;
}

.mission-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
}

.mission-summary-grid div {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfd;
}

.mission-assumption-card,
.mission-history-item {
  padding: 0.95rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfd;
}

.mission-history-list {
  display: grid;
  gap: 0.8rem;
}

.mission-briefing-card {
  display: grid;
  gap: 1rem;
}

.mission-briefing-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.mission-task-card {
  background: linear-gradient(180deg, #fbfcfd 0%, #f6fafc 100%);
}

.mission-task-notes {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
  color: var(--text-secondary);
}

.mission-task-notes li + li {
  margin-top: 0.35rem;
}

.mission-inline-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #eef3f6;
  color: #425466;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.mission-inline-badge--current {
  background: #dff6e6;
  color: #17663a;
}

.mission-list-item h2 {
  margin: 0;
}

.mission-list-item h2 a {
  color: var(--text);
  text-decoration: none;
}

.mission-list-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.mission-history-item h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.mission-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.mission-status-actions form {
  margin: 0;
}

.mission-history-meta,
.empty-state {
  color: var(--text-secondary);
}

@media (max-width: 720px) {
  .mission-briefing-header {
    flex-direction: column;
  }
}

/* Form grid */
.grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

/* Labels */
label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
}

.field-help {
  font-size: 0.76rem;
  line-height: 1.25;
  color: var(--text-secondary);
  font-weight: 400;
}

/* Mandatory-field marker + submit-time invalid highlighting.
   The red styling only applies once the form is flagged .was-validated (on the
   first Run Model attempt), so fields do not glow red before the user submits. */
.required-marker {
  color: #d33;
  font-weight: 700;
  margin-left: 2px;
}
.was-validated select:invalid,
.was-validated input:invalid,
.was-validated textarea:invalid {
  border-color: #d33 !important;
  outline-color: #d33;
  box-shadow: 0 0 0 1px #d33;
}
.was-validated label:has(select:invalid),
.was-validated label:has(input:invalid),
.was-validated label:has(textarea:invalid) {
  color: #d33;
}

/* Archive ID compound input */
.archive-id-compound {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  transition: border-color 0.15s, box-shadow 0.15s;
  overflow: hidden;
}
.archive-id-compound:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.15);
}
.archive-id-prefix {
  padding: 0.45rem 0 0.45rem 0.55rem;
  color: var(--text-secondary);
  font-family: monospace;
  font-size: 0.92em;
  white-space: nowrap;
  user-select: none;
  background: var(--bg-secondary, #f5f5f5);
  border-right: 1px solid var(--line);
  padding-right: 0.4rem;
}
.archive-id-suffix {
  flex: 1;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-family: monospace;
  font-size: 0.92em;
  padding: 0.45rem 0.55rem;
  min-width: 0;
}
.archive-id-suffix:focus {
  outline: none;
  border: none !important;
  box-shadow: none !important;
}

/* Inputs, selects, buttons */
input, select {
  font: inherit;
  font-weight: 400;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.15);
}

button {
  font: inherit;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  transition: background 0.15s;
}

/* Mission Setup — SARSAT import actions (Defect 2: make buttons obvious).
   These buttons live outside the <form>, so they miss the primary styling. */
.sarsat-btn-primary {
  background: var(--accent);
  color: #ffffff;
}
.sarsat-btn-primary:hover { background: var(--accent-hover); }
.sarsat-btn-secondary {
  background: #e2e8f0;
  color: #1a3550;
  border: 1px solid #c4d0dd;
}
.sarsat-btn-secondary:hover { background: #cbd6e2; }
.sarsat-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.sarsat-file-input {
  display: block;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1.5px dashed var(--accent);
  border-radius: 8px;
  background: #f5f8fc;
  cursor: pointer;
}

/* Primary button (form submit) */
form button[type="submit"],
form button:not([type]) {
  margin-top: 0.8rem;
  background: var(--accent);
  color: #ffffff;
}
form button[type="submit"]:hover,
form button:not([type]):hover {
  background: var(--accent-hover);
}

/* Secondary / action buttons */
.history-controls button {
  background: var(--accent);
  color: #ffffff;
  padding: 0.4rem 0.75rem;
  font-size: 0.84rem;
}
.history-controls button:hover {
  background: var(--accent-hover);
}

/* Map */
#map {
  width: 100%;
  min-height: 420px;
  border-radius: 10px;
  border: 1px solid var(--line);
}

/* Pre / code */
pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.7rem;
  font-size: 0.84rem;
}

/* Responsive grid */
@media (min-width: 1100px) {
  main {
    grid-template-columns: 380px 1fr;
  }
  .full-width-panel {
    grid-column: 1 / -1;
  }
  .panel:last-child {
    grid-column: 1 / -1;
  }
  .mission-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mission-layout .mission-banner-panel,
  .mission-layout .mission-panel:first-of-type {
    grid-column: 1 / -1;
  }
}

/* Tables */
.table-wrap {
  overflow: auto;
  max-height: 320px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

#position-table,
#environment-table,
#history-table,
#search-track-waypoints-table,
.legend-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

#position-table th, #position-table td,
#environment-table th, #environment-table td,
#history-table th, #history-table td,
#search-track-waypoints-table th, #search-track-waypoints-table td,
.legend-table th, .legend-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

#environment-table th, #environment-table td {
  white-space: nowrap;
}

#position-table th,
#environment-table th,
#history-table th,
#search-track-waypoints-table th,
.legend-table th {
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 1;
  font-weight: 600;
  color: var(--text);
}

/* History controls */
.history-controls {
  margin-bottom: 0.5rem;
}

/* Environment panel */
.env-panel {
  margin: 0.5rem 0 0.8rem;
}
.env-meta {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.86rem;
}

/* Map output blocks */
.map-output-block {
  margin-top: 0.9rem;
}
.map-output-block h3 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.search-card-panel {
  margin-top: 0.3rem;
}

.search-card {
  padding: 1rem 1.1rem;
  border: 1px solid rgba(15, 43, 70, 0.12);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.97));
  box-shadow: 0 20px 36px rgba(15, 23, 42, 0.06);
}

.search-card--issued {
  border-color: rgba(42, 157, 143, 0.26);
  background: linear-gradient(135deg, rgba(244, 255, 250, 0.98), rgba(255, 255, 255, 0.97));
}

.search-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.search-card__eyebrow {
  margin: 0 0 0.2rem;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7a8aa0;
}

.search-card__subtitle {
  margin: 0 0 0.95rem;
  color: #5b6b7d;
  line-height: 1.5;
}

.search-card__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  align-items: stretch;
}

.search-card__section {
  min-height: 100%;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.search-card__section--primary {
  position: relative;
  overflow: hidden;
}

.search-card__section--primary::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 16px 0 0 16px;
  background: linear-gradient(180deg, rgba(23, 162, 184, 0.55), rgba(53, 80, 112, 0.3));
}

.search-card__section--track {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.55rem;
  background:
    linear-gradient(135deg, rgba(227, 244, 248, 0.82), rgba(255, 255, 255, 0.96)),
    rgba(255, 255, 255, 0.96);
  border-color: rgba(23, 162, 184, 0.18);
}

.search-card__section h4 {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #355070;
}

.search-card__meta {
  margin: 0;
  display: grid;
  gap: 0.42rem;
}

.search-card__section--track .search-card__meta {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1rem;
  row-gap: 0.55rem;
}

.search-card__meta-row {
  display: grid;
  grid-template-columns: minmax(90px, 120px) 1fr;
  gap: 0.55rem;
  align-items: start;
}

.search-card__meta-row dt {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: #7a8aa0;
}

.search-card__meta-row dd {
  margin: 0;
  color: var(--text);
  font-weight: 600;
  line-height: 1.4;
}

.search-card__footer {
  margin-top: 0.9rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.search-card__actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.7rem;
}

.search-card__button {
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: #ffffff;
  color: #355070;
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.search-card__button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
}

.search-card__button--primary {
  background: linear-gradient(135deg, rgba(23, 162, 184, 0.14), rgba(47, 183, 201, 0.24));
  border-color: rgba(23, 162, 184, 0.28);
  color: var(--teal-dark);
}

.search-card__button--outline {
  background: transparent;
  border: 1.5px solid #1A5276;
  color: #1A5276;
}

.search-card__button--outline:hover {
  background: rgba(26, 82, 118, 0.08);
}

.search-card__footer-note {
  display: block;
  color: #5b6b7d;
  font-size: 0.84rem;
  line-height: 1.45;
}

@media (max-width: 1100px) {
  .search-card__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-card__section--track {
    grid-column: 1 / -1;
  }
}

@media (max-width: 780px) {
  .search-card__grid {
    grid-template-columns: 1fr;
  }

  .search-card__section--track .search-card__meta {
    grid-template-columns: 1fr;
  }
}

/* Links */
a {
  color: var(--accent);
  transition: color 0.15s;
}
a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Time slider */
#time-slider-wrap label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
}

#time-slider {
  accent-color: var(--teal);
}

/* Persona-based UI control */
.persona-restricted {
  opacity: 0.5;
  pointer-events: none;
  position: relative;
}

.persona-restricted::after {
  content: '🔒 Restricted';
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: #f8d7da;
  color: #721c24;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 600;
}

.persona-hidden {
  display: none !important;
}

.persona-transition {
  transition: opacity 0.2s ease, max-height 0.3s ease;
}

/* Persona selector highlight */
#persona-selector {
  font-weight: 600;
  color: var(--accent);
  border: 2px solid var(--accent);
}

#persona-info-link {
  color: var(--teal);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

#persona-info-link:hover {
  color: var(--teal-light);
  text-decoration: underline;
}

/* Map layer controls (US-4.5.1, US-4.5.2) */
#map-controls {
  margin-bottom: 0.75em;
  padding: 0.85em;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 1px solid #dee2e6;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.map-control-grid {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(260px, 1fr) minmax(260px, 1fr);
  gap: 0.85rem;
  align-items: stretch;
}

.map-control-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.45rem;
  min-height: 92px;
  padding: 0.8rem 0.95rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(25, 50, 77, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.map-control-card--compact {
  justify-content: flex-start;
}

.map-control-card--ais {
  border-color: rgba(42, 157, 143, 0.2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(232, 247, 245, 0.88));
}

.map-control-title {
  display: block;
  margin-bottom: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.01em;
  line-height: 1.25;
}

.map-control-helper {
  display: block;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #6c757d;
}

.map-control-helper a {
  color: #0066cc;
}

.map-toggle {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
  align-items: start;
  cursor: pointer;
}

.map-toggle__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.map-toggle__switch {
  position: relative;
  width: 46px;
  height: 26px;
  margin-top: 0.05rem;
  border-radius: 999px;
  background: #cbd5e1;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.12);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.map-toggle__switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
  transition: transform 0.2s ease;
}

.map-toggle__input:checked + .map-toggle__switch {
  background: linear-gradient(135deg, var(--teal), #2fb7c9);
}

.map-toggle__input:checked + .map-toggle__switch::after {
  transform: translateX(20px);
}

.map-toggle__input:focus-visible + .map-toggle__switch {
  outline: none;
  box-shadow: 0 0 0 4px rgba(23, 162, 184, 0.18);
}

.map-toggle__copy {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.map-toggle__label-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.map-toggle__label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.25;
}

.map-toggle--compact-action {
  align-items: center;
}

.map-toggle--compact-action .map-toggle__switch {
  margin-top: 0;
}

.map-toggle--compact-action .map-toggle__copy {
  justify-content: center;
}

.map-toggle--compact-action .map-toggle__label-row {
  min-height: 26px;
  align-items: center;
}

.map-toggle__badge,
.map-toggle__state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.6rem;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
}

.map-toggle__badge {
  min-width: 1.9rem;
  background: rgba(23, 162, 184, 0.12);
  color: var(--teal-dark);
}

.map-toggle__state {
  background: rgba(148, 163, 184, 0.18);
  color: #475569;
}

.map-toggle__state[data-tone="success"] {
  background: rgba(22, 163, 74, 0.14);
  color: #166534;
}

.map-toggle__state[data-tone="warning"] {
  background: rgba(245, 158, 11, 0.16);
  color: #9a6700;
}

.map-toggle__hint {
  font-size: 0.78rem;
  line-height: 1.4;
  color: #667085;
}

.environment-status {
  margin: 0.75rem 0 1rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.96), rgba(241, 245, 249, 0.92));
}

.environment-status__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.environment-status__hint {
  margin-top: 0.45rem;
  font-size: 0.83rem;
  line-height: 1.45;
  color: #5b6b7d;
}

.map-secondary-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.85rem;
  margin: 0.85rem 0 0.9rem;
  align-items: stretch;
}

.map-control-card--secondary {
  padding: 0.95rem 1rem;
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.94));
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.06);
}

.map-control-card--overlay {
  min-height: 138px;
  justify-content: flex-start;
}

.map-control-card--experimental {
  border-color: rgba(251, 191, 36, 0.32);
  background: linear-gradient(135deg, rgba(255, 251, 235, 0.98), rgba(255, 247, 237, 0.95));
}

.map-control-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  min-height: 2rem;
  margin-bottom: 0.7rem;
}

.map-control-card__action {
  display: flex;
  align-items: center;
  min-height: 3rem;
  margin-top: auto;
}

.map-control-card__action--segmented {
  align-items: flex-start;
}

.map-segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0;
}

.map-segmented__option {
  position: relative;
  cursor: pointer;
}

.map-segmented__option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.map-segmented__pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: #ffffff;
  color: #355070;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.map-segmented__option:hover .map-segmented__pill {
  border-color: rgba(23, 162, 184, 0.4);
  transform: translateY(-1px);
}

.map-segmented__option input:checked + .map-segmented__pill {
  border-color: rgba(23, 162, 184, 0.28);
  background: linear-gradient(135deg, rgba(23, 162, 184, 0.14), rgba(47, 183, 201, 0.22));
  color: var(--teal-dark);
  box-shadow: 0 10px 20px rgba(23, 162, 184, 0.12);
}

.map-segmented__option input:focus-visible + .map-segmented__pill {
  outline: none;
  box-shadow: 0 0 0 4px rgba(23, 162, 184, 0.18);
}

.map-control-subsection {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.map-control-disclosure {
  margin-top: 0.2rem;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  padding-top: 0.55rem;
}

.map-control-disclosure__summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.79rem;
  font-weight: 700;
  color: #52637a;
}

.map-control-disclosure__summary::-webkit-details-marker {
  display: none;
}

.map-control-disclosure__summary::after {
  content: "Show";
  margin-left: 0.5rem;
  font-size: 0.72rem;
  color: #7b8794;
}

.map-control-disclosure[open] .map-control-disclosure__summary::after {
  content: "Hide";
}

.map-control-disclosure .map-toggle {
  margin-top: 0.55rem;
}

#basemap-selector {
  width: 100%;
  padding: 0.45rem 0.6rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  background: white;
  border: 1px solid #d0d7de;
  border-radius: 10px;
  transition: border-color 0.2s;
}

#basemap-selector:hover {
  border-color: var(--teal);
}

#basemap-selector:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.1);
}

@media (max-width: 1100px) {
  .map-control-grid {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }
}

@media (max-width: 760px) {
  .map-control-grid {
    grid-template-columns: 1fr;
  }

  .map-secondary-controls {
    grid-template-columns: 1fr;
  }
}

/* SRR Jurisdiction Panel (US-4.5.3) */
#srr-jurisdiction-panel {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#srr-jurisdiction-panel table {
  border-collapse: collapse;
  width: 100%;
}

#srr-jurisdiction-panel table td,
#srr-jurisdiction-panel table th {
  padding: 0.4em 0.5em;
}

#srr-jurisdiction-panel table tr:hover {
  background: #fff3cd;
}

/* Leaflet popup customization for SRR */
.leaflet-popup-content h4 {
  margin-top: 0;
}

.leaflet-popup-content table {
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Epic 4.6: LKP Waypoint Selection - Context Menu & Drag Tooltip Styles
   ═══════════════════════════════════════════════════════════════════════════ */

.lkp-context-menu {
  background: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  padding: 0;
  min-width: 220px;
  font-size: 0.9em;
  overflow: hidden;
}

.lkp-context-menu-item {
  padding: 0.65em 1em;
  cursor: pointer;
  transition: background-color 0.15s ease;
  border-bottom: 1px solid #f0f0f0;
  user-select: none;
}

.lkp-context-menu-item:last-child {
  border-bottom: none;
}

.lkp-context-menu-item:hover {
  background-color: #f0f0f0;
}

.lkp-context-menu-item:active {
  background-color: #e0e0e0;
}

/* First item is the action, style it distinctly */
.lkp-context-menu-item:first-child {
  font-weight: 600;
  color: var(--accent);
}

.lkp-context-menu-item:first-child:hover {
  background-color: rgba(26, 82, 118, 0.1);
}

/* Second item shows coordinates (informational) */
.lkp-context-menu-item:nth-child(2) {
  color: var(--text-secondary);
  font-size: 0.85em;
  cursor: default;
  font-family: monospace;
}

.lkp-context-menu-item:nth-child(2):hover {
  background-color: white;
}

/* Drag tooltip styling */
.lkp-drag-tooltip {
  background: rgba(15, 43, 70, 0.95) !important;
  border: 2px solid #FF4500 !important;
  border-radius: 6px !important;
  color: white !important;
  font-weight: 600 !important;
  font-size: 0.9em !important;
  padding: 0.5em 0.75em !important;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4) !important;
  white-space: nowrap !important;
  font-family: monospace !important;
}

.lkp-drag-tooltip::before {
  border-top-color: #FF4500 !important;
}

/* Touch device support: ensure menu items have proper touch targets */
@media (pointer: coarse) {
  .lkp-context-menu-item {
    padding: 0.85em 1em;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

.run-detail-grid {
  align-items: start;
}

.run-detail-trust-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.85rem;
}

.run-detail-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
}

.run-detail-chip--muted {
  background: rgba(255, 255, 255, 0.12);
}

.run-detail-banner {
  margin-bottom: 0;
}

.run-detail-pre {
  margin: 0;
  padding: 1rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f4f7f9;
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1.45;
}

.run-detail-summary-grid {
  margin-bottom: 0.9rem;
}

.run-detail-table-wrap {
  max-height: 360px;
}

.run-detail-diagnostics summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 0.85rem;
}

.run-detail-diagnostics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 0.85rem;
}

.run-detail-diagnostics-grid h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.run-detail-diagnostics-full {
  grid-column: 1 / -1;
}

.run-detail-export-actions {
  flex-wrap: wrap;
}

.run-detail-action-link {
  display: inline-block;
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  background: #f4f7f9;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.run-detail-action-link:hover {
  background: #e8f1f7;
  border-color: var(--accent);
  color: var(--accent);
}

.ais-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 18px;
  color: #7b8794;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.6);
  transition: transform 1s ease;
}

.ais-marker--cargo {
  color: #2e8b57;
}

.ais-marker--tanker {
  color: #d62828;
}

.ais-marker--passenger {
  color: #2563eb;
}

.ais-marker--fishing {
  color: #f97316;
}

.ais-marker--pleasure {
  color: #ec4899;
}

.ais-marker--tug-special {
  color: #22c7d6;
}

.ais-marker--high-speed {
  color: #eab308;
}

.ais-marker--sar-aircraft {
  width: 18px;
  height: 18px;
  color: #c73a36;
  font-size: 16px;
}

.ais-marker--unspecified,
.ais-marker--other {
  color: #6b7280;
}

.ais-marker--search-hit {
  filter: drop-shadow(0 0 0.4rem rgba(242, 140, 40, 0.8));
  animation: ais-search-pulse 1.5s ease-in-out infinite;
}

@keyframes ais-search-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.14);
  }
}

.ais-popup {
  min-width: 180px;
  display: grid;
  gap: 0.22rem;
  font-size: 0.85rem;
}

.ais-popup__title {
  font-weight: 700;
  color: #19324d;
}

.ais-popup__badge {
  display: inline-flex;
  width: fit-content;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #fbe4e2;
  color: #c73a36;
  font-size: 0.72rem;
  font-weight: 700;
}

.ais-popup__copy {
  margin-top: 0.4rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #19324d;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.ais-popup__copy:hover {
  background: #e2ecf6;
}

#ais-layer-hint[data-tone="warning"] {
  color: #a16207;
}

#ais-layer-hint[data-tone="success"] {
  color: #1d4d2d;
}

#ais-search-proximity-table th,
#ais-search-proximity-table td {
  white-space: nowrap;
}

/* Application version footer */
.app-footer {
  padding: 12px 20px;
  text-align: center;
  font-size: 11px;
  color: rgba(15, 43, 70, 0.5);
  border-top: 1px solid #dee2e6;
  margin-top: 20px;
}

.app-version {
  font-family: 'Monaco', 'Courier New', monospace;
  cursor: help;
}

.app-version:hover {
  color: rgba(15, 43, 70, 0.7);
}

/* ═══════════════════════════════════════════════════════════════════
   AIR ASSET ENDURANCE MODAL (AE-104, AE-601, AE-701)
   ═══════════════════════════════════════════════════════════════════ */

.ds-asset-modal-btn {
  width: 100%;
  margin-top: 8px;
  padding: 6px 12px;
  background: #1a5276;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}
.ds-asset-modal-btn:hover { background: #154360; }

/* ── Modal overlay & container ─────────────────────────────────── */
.ds-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.ds-modal {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ds-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid #e8e8e8;
}
.ds-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #1a2a3a;
  margin: 0;
}
.ds-modal-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #666;
  line-height: 1;
  padding: 0 4px;
}
.ds-modal-close:hover { color: #c0392b; }

/* ── Tabs ──────────────────────────────────────────────────────── */
.ds-modal-tabs {
  display: flex;
  border-bottom: 2px solid #e8e8e8;
  padding: 0 24px;
}
.ds-modal-tab {
  background: none;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #666;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
}
.ds-modal-tab:hover { color: #1a5276; }
.ds-modal-tab--active {
  color: #1a5276;
  border-bottom-color: #1a5276;
}

/* ── Modal body ────────────────────────────────────────────────── */
.ds-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}
.ds-modal-panel { min-height: 200px; }
.ds-modal-placeholder {
  color: #888;
  font-style: italic;
  text-align: center;
  padding: 40px 20px;
}
.ds-modal-subtitle {
  font-size: 14px;
  font-weight: 600;
  color: #1a2a3a;
  margin: 16px 0 8px;
}

/* ── Tab 1: Metrics grid ───────────────────────────────────────── */
.ds-modal-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.ds-modal-metric {
  background: #f8fafb;
  border: 1px solid #e0e8ee;
  border-radius: 6px;
  padding: 12px;
  text-align: center;
}
.ds-modal-metric--primary {
  background: #e8f6f0;
  border-color: #27ae60;
}
.ds-modal-metric--bingo {
  background: #fdf2e9;
  border-color: #f0923e;
}
.ds-modal-metric-val {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: #1a2a3a;
}
.ds-modal-metric-lbl {
  display: block;
  font-size: 11px;
  color: #666;
  margin-top: 4px;
}

/* ── Search window bar ─────────────────────────────────────────── */
.ds-window-bar {
  height: 12px;
  background: #e8e8e8;
  border-radius: 6px;
  overflow: hidden;
  margin: 8px 0;
}
.ds-window-bar__fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.5s ease;
}
.ds-window-bar__fill--good { background: #27ae60; }
.ds-window-bar__fill--limited { background: #f39c12; }
.ds-window-bar__fill--critical { background: #c0392b; }
.ds-window-bar__fill--expired { background: #7f8c8d; }

.ds-window-status { font-size: 12px; color: #555; }
.ds-window-status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
}
.ds-window-status-badge--good { background: #27ae60; }
.ds-window-status-badge--limited { background: #f39c12; }
.ds-window-status-badge--critical { background: #c0392b; }
.ds-window-status-badge--expired { background: #7f8c8d; }

/* ── Bingo alerts list ─────────────────────────────────────────── */
.ds-alerts-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.ds-alert-item {
  padding: 8px 12px;
  border-left: 4px solid #ccc;
  margin-bottom: 6px;
  font-size: 12px;
  border-radius: 2px;
  background: #fafafa;
}
.ds-alert-item--warning { border-left-color: #1abc9c; }
.ds-alert-item--urgent { border-left-color: #f0923e; }
.ds-alert-item--critical { border-left-color: #c0392b; }
.ds-alert-item.ds-alert--fired { opacity: 0.5; text-decoration: line-through; }
.ds-alert-level { font-weight: 700; }
.ds-alert-time { color: #555; }

/* ── Gantt SVG ─────────────────────────────────────────────────── */
.ds-gantt-svg { font-family: Arial, Calibri, sans-serif; }
.ds-gantt-transit { fill: #3498db; opacity: 0.8; }
.ds-gantt-onscene { fill: #27ae60; opacity: 0.9; }
.ds-gantt-gap { fill: #c0392b; opacity: 0.15; }
.ds-gantt-label { font-size: 11px; fill: #333; }
.ds-gantt-axis-text { font-size: 10px; fill: #888; }
.ds-gantt-legend-text { font-size: 10px; fill: #555; }

/* ── Timeline ──────────────────────────────────────────────────── */
.ds-timeline-summary {
  padding: 12px;
  background: #f8fafb;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 13px;
}
.ds-timeline-gaps-title { font-size: 13px; font-weight: 600; margin: 12px 0 6px; color: #c0392b; }
.ds-gap-item { font-size: 12px; padding: 4px 8px; background: #fdf0ef; border-radius: 3px; margin-bottom: 4px; }
.ds-timeline-no-gaps { font-size: 12px; color: #27ae60; font-weight: 500; margin-top: 8px; }

/* ── Sortie planning ───────────────────────────────────────────── */
.ds-sortie-form { margin-bottom: 16px; }
.ds-sortie-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.ds-sortie-metric {
  padding: 8px 14px;
  background: #f8fafb;
  border: 1px solid #e0e8ee;
  border-radius: 4px;
  font-size: 13px;
}
.ds-sortie-gap-warn { color: #c0392b; font-weight: 600; }
.ds-sortie-gap-ok { color: #27ae60; font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════════
   BINGO TOAST NOTIFICATIONS (AE-502 — P0)
   ═══════════════════════════════════════════════════════════════════ */

.ds-bingo-toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 11000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 380px;
}
.ds-bingo-toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  pointer-events: auto;
  animation: ds-toast-in 0.3s ease;
  border-left: 5px solid;
}
.ds-bingo-toast--warning {
  background: #e8f8f5;
  border-left-color: #1abc9c;
}
.ds-bingo-toast--urgent {
  background: #fef5e7;
  border-left-color: #f0923e;
}
.ds-bingo-toast--critical {
  background: #fdedec;
  border-left-color: #c0392b;
  animation: ds-toast-in 0.3s ease, ds-toast-pulse 1s ease 0.3s 3;
}
.ds-bingo-toast--exit {
  animation: ds-toast-out 0.3s ease forwards;
}
.ds-bingo-toast__icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  flex-shrink: 0;
}
.ds-bingo-toast--warning .ds-bingo-toast__icon { background: #1abc9c; }
.ds-bingo-toast--urgent .ds-bingo-toast__icon { background: #f0923e; }
.ds-bingo-toast--critical .ds-bingo-toast__icon { background: #c0392b; }
.ds-bingo-toast__body { flex: 1; }
.ds-bingo-toast__title {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 2px;
}
.ds-bingo-toast__msg { font-size: 12px; color: #444; }
.ds-bingo-toast__close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #999;
  padding: 0 4px;
  line-height: 1;
}
.ds-bingo-toast__close:hover { color: #333; }

@keyframes ds-toast-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes ds-toast-out {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}
@keyframes ds-toast-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* ── Plan assets list (multi-asset persistence) ───────────────── */
.ds-asset-add-plan-btn {
  display: block;
  width: 100%;
  margin: 12px 0 8px;
  padding: 8px 16px;
  background: #1a5276;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.ds-asset-add-plan-btn:hover { background: #154360; }
.ds-plan-assets-list { margin-top: 12px; }
.ds-plan-assets-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #1a2a3a; }
.ds-plan-assets-empty { font-size: 12px; color: #888; font-style: italic; }
.ds-plan-asset-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: #f8fafb;
  border: 1px solid #e0e8ee;
  border-radius: 4px;
  margin-bottom: 4px;
  font-size: 12px;
}
.ds-plan-asset-name { font-weight: 600; min-width: 80px; }
.ds-plan-asset-callsign { color: #555; min-width: 60px; }
.ds-plan-asset-onscene { color: #27ae60; font-weight: 500; }
.ds-plan-asset-bingo { color: #f0923e; font-weight: 500; margin-left: auto; }
.ds-plan-asset-remove {
  background: none;
  border: none;
  color: #c0392b;
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.ds-plan-asset-remove:hover { color: #922b21; }

/* ── Search window map overlay (AE-402) ───────────────────────── */
.ds-search-window-label {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
.ds-swl-text {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  color: #27ae60;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.ds-swl-text--good { color: #27ae60; }
.ds-swl-text--limited { color: #f39c12; }
.ds-swl-text--critical { color: #c0392b; }
.ds-swl-text--expired { color: #7f8c8d; }

.ds-search-window-pulse {
  animation: ds-map-pulse 2s ease-in-out infinite;
}
@keyframes ds-map-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

/* ── Custom profile form (AE-102) ─────────────────────────────── */
.ds-custom-profile-toggle {
  margin-top: 16px;
  border: 1px solid #e0e8ee;
  border-radius: 6px;
  padding: 0;
}
.ds-custom-profile-summary {
  cursor: pointer;
  padding: 10px 14px;
  margin: 0;
  user-select: none;
  color: #1a5276;
}
.ds-custom-profile-summary:hover { color: #154360; }
.ds-custom-profile-form {
  padding: 12px 14px;
  border-top: 1px solid #e8e8e8;
}
.ds-cp-result { margin-top: 8px; font-size: 12px; }
.ds-cp-success { color: #27ae60; font-weight: 500; }
.ds-cp-error { color: #c0392b; font-weight: 500; }

/* ── Export to Search Card button ──────────────────────────────── */
.ds-modal-export-section {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e8e8e8;
  display: flex;
  align-items: center;
  gap: 12px;
}
.ds-export-card-btn {
  padding: 8px 20px;
  background: #27ae60;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.ds-export-card-btn:hover { background: #219a52; }
.ds-export-status { font-size: 12px; }
.ds-export-status--ok { color: #27ae60; font-weight: 500; }

/* ── Search Planning Mode Toggle ──────────────────────────────── */
.ds-planning-mode {
  display: flex;
  gap: 0;
  margin-bottom: 1em;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #d0d5dd;
}
.ds-mode-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border: none;
  background: #f8f9fa;
  color: #627d98;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.ds-mode-btn:hover { background: #e8edf2; }
.ds-mode-btn--active {
  background: #1a5276;
  color: #fff;
}
.ds-mode-btn--active:hover { background: #154263; }
.ds-mode-btn + .ds-mode-btn { border-left: 1px solid #d0d5dd; }

/* ── Advanced Mode Card ──────────────────────────────────────── */
.ds-advanced-card {
  background: #f0f6fb;
  border: 1px solid #b8d4e8;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 1em;
}
.ds-advanced-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.ds-advanced-card-title {
  font-size: 12px;
  font-weight: 700;
  color: #1a5276;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ds-advanced-edit-btn {
  font-size: 11px;
  font-weight: 600;
  color: #1a5276;
  background: none;
  border: 1px solid #1a5276;
  border-radius: 4px;
  padding: 3px 10px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.ds-advanced-edit-btn:hover {
  background: #1a5276;
  color: #fff;
}
.ds-advanced-summary {
  font-size: 12px;
  color: #334e68;
  line-height: 1.6;
}
.ds-advanced-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
}
.ds-advanced-summary-grid dt {
  color: #627d98;
  font-size: 11px;
}
.ds-advanced-summary-grid dd {
  margin: 0;
  font-weight: 600;
  color: #1a5276;
  font-size: 12px;
}
.ds-advanced-prompt {
  text-align: center;
  padding: 16px 8px;
  color: #627d98;
  font-size: 12px;
  line-height: 1.5;
}
.ds-advanced-prompt-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 20px;
  background: #1a5276;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.ds-advanced-prompt-btn:hover { background: #154263; }

/* ── Modal Config Sections (AE-101/103) ──────────────────────── */
.ds-modal-config-section {
  margin-bottom: 1em;
  padding-bottom: 0.75em;
  border-bottom: 1px solid #e8edf2;
}
.ds-modal-config-heading {
  font-size: 12px;
  font-weight: 700;
  color: #1a5276;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 8px;
}
.ds-modal-config-hint {
  font-weight: 400;
  color: #9fb3c8;
  text-transform: none;
  letter-spacing: 0;
}

/* ── Aircraft Specs Card (AE-101) ────────────────────────────── */
.ds-modal-specs-card {
  background: #f0f6fb;
  border: 1px solid #b8d4e8;
  border-radius: 6px;
  padding: 10px 14px;
  margin-top: 8px;
}
.ds-specs-grid {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.ds-specs-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 70px;
}
.ds-specs-val {
  font-size: 14px;
  font-weight: 700;
  color: #1a5276;
}
.ds-specs-lbl {
  font-size: 10px;
  color: #627d98;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ── Endurance constraint toggle (AE-303) ─────────────────────── */
.ds-asset-constraint-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0;
  font-size: 11px;
  color: #555;
  cursor: pointer;
}
.ds-asset-constraint-toggle input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: #1a5276;
}
.ds-asset-constraint-label { user-select: none; }

/* ── Priority Sub-Area Allocation (AE-302) ─────────────────────── */
.ds-priority-intro { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 12px; }
.ds-priority-form { display: flex; flex-direction: column; gap: 10px; }
.ds-priority-subareas { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.ds-priority-area-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; background: #f4f6f8; border-radius: 6px;
}
.ds-priority-area-row .ds-priority-name { flex: 1; min-width: 100px; }
.ds-priority-area-row .ds-priority-label { font-size: 0.75rem; white-space: nowrap; margin: 0; }
.ds-priority-area-row .ds-priority-select { width: 110px; }
.ds-priority-remove {
  background: none; border: none; color: #e74c3c; font-size: 1.2rem;
  cursor: pointer; padding: 2px 6px; border-radius: 4px;
  min-width: 28px; min-height: 28px;
}
.ds-priority-remove:hover { background: rgba(231,76,60,0.1); }
.ds-priority-actions { display: flex; gap: 8px; }
.ds-priority-add-btn { background: #6c757d !important; }
.ds-priority-add-btn:hover { background: #5a6268 !important; }
.ds-priority-result-grid { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.ds-priority-alloc-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; background: #f8f9fa; border-radius: 6px;
}
.ds-priority-alloc-name { font-weight: 600; min-width: 100px; }
.ds-priority-alloc-pri { font-size: 0.75rem; color: var(--text-secondary); min-width: 30px; }
.ds-priority-alloc-bar-bg {
  flex: 1; height: 16px; background: #e9ecef; border-radius: 8px; overflow: hidden;
}
.ds-priority-alloc-bar { height: 100%; background: #117a65; border-radius: 8px; transition: width 0.3s ease; }
.ds-priority-alloc-tracks { font-weight: 600; font-size: 0.85rem; min-width: 70px; text-align: right; }
.ds-priority-summary { font-size: 0.85rem; color: var(--text-secondary); margin-top: 6px; }

/* ── Drone Pattern (AE-801) ────────────────────────────────────── */
.ds-drone-intro { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 12px; }
.ds-drone-form { display: flex; flex-direction: column; gap: 10px; }
.ds-drone-metrics { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.ds-drone-summary { margin-bottom: 10px; }
.ds-drone-preview { display: flex; justify-content: center; margin-top: 10px; }
.ds-drone-svg { background: #fafbfc; border: 1px solid #e9ecef; border-radius: 8px; }
