/* ============================================
   Kyndryl Cloud Uplift — Globe Explorer
   Dark theme inspired by datacenters.microsoft.com
   ============================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary:    #010409;
  --bg-sidebar:    rgba(6, 10, 22, 0.94);
  --bg-card:       rgba(18, 26, 46, 0.55);
  --bg-card-hover: rgba(0, 120, 212, 0.18);
  --accent:        #0078d4;
  --accent-light:  #00a4ef;
  --accent-glow:   rgba(0, 164, 239, 0.35);
  --text-primary:  #ffffff;
  --text-secondary:#a3b1c6;
  --text-muted:    #8a99b0;
  --border:        rgba(255, 255, 255, 0.08);
  --sidebar-width: 380px;
  --header-height: 56px;
  --font-family:   'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --transition:    0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 2px;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
  color: var(--accent-light);
  font-size: 12.5px;
  cursor: pointer;
}

.link-btn:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

/* ---------- Header ---------- */
#header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: linear-gradient(180deg, rgba(1, 4, 9, 0.97) 0%, rgba(1, 4, 9, 0.7) 100%);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo {
  display: block;
  height: 22px;
  width: auto;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.header-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.header-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  background: rgba(0, 120, 212, 0.22);
  border: 1px solid rgba(0, 164, 239, 0.35);
}

.header-btn-primary:hover {
  background: rgba(0, 120, 212, 0.4);
}

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

.print-only {
  display: none;
}

/* ---------- Sidebar ---------- */
#sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  z-index: 90;
  transition: transform var(--transition);
}

.sidebar-header {
  padding: 24px 24px 16px;
  flex-shrink: 0;
}

.sidebar-title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

/* Search */
.search-box {
  position: relative;
}

.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-family);
  outline: none;
  transition: var(--transition);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-box input::-webkit-search-cancel-button {
  filter: invert(0.7);
  cursor: pointer;
}

.search-box input:focus {
  border-color: var(--accent);
  background: rgba(0, 120, 212, 0.08);
  box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.15);
}

/* Capability filters */
.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.filter-group-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 6px 4px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.filter-count {
  min-width: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 10px;
  line-height: 16px;
  text-align: center;
}

.filter-chip[aria-pressed="true"] .filter-count {
  background: rgba(255, 255, 255, 0.18);
  color: var(--text-primary);
}

.filter-chip:hover {
  color: var(--text-primary);
  border-color: rgba(0, 120, 212, 0.4);
}

.filter-chip[aria-pressed="true"] {
  background: rgba(0, 120, 212, 0.25);
  border-color: var(--accent-light);
  color: var(--text-primary);
}

.filter-chip[aria-pressed="true"]::before {
  content: '✓ ';
}

/* Stats bar */
.stats-bar {
  display: flex;
  gap: 4px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.stat {
  flex: 1;
  text-align: center;
  padding: 10px 4px;
  border-radius: 8px;
  background: var(--bg-card);
}

.stat-value {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-light);
  line-height: 1.2;
}

.stat-label {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

/* Region list */
.sidebar-content {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}

.sidebar-content::-webkit-scrollbar {
  width: 5px;
}

.sidebar-content::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 4px;
}

#region-list {
  padding: 0 16px 24px;
}

.result-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  padding: 12px 24px 0;
}

.result-count .link-btn {
  font-size: 11px;
}

.empty-state {
  padding: 24px 8px;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.sidebar-footer {
  flex-shrink: 0;
  padding: 10px 24px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
}

.sidebar-footer a {
  color: var(--accent-light);
}

.verified::before,
.verified-dot {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: #4ade80;
  vertical-align: 1px;
}

.verified-stale::before,
.verified-stale .verified-dot {
  background: #fbbf24;
}

.stale-note {
  display: block;
  margin-top: 4px;
  color: #fbbf24;
}

.geography-group {
  margin-bottom: 8px;
}

.region-cards {
  list-style: none;
}

.geography-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 12px 8px 6px;
  user-select: none;
}

.region-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  background: none;
  transition: var(--transition);
  border: 1px solid transparent;
  animation: fade-in-up 0.4s ease both;
  animation-delay: calc(var(--i, 0) * 20ms);
}

.region-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(0, 120, 212, 0.25);
}

.region-card.active {
  background: rgba(0, 120, 212, 0.22);
  border-color: var(--accent);
}

.region-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 0 8px var(--accent-glow);
}

.region-card.active .region-dot,
.region-card:hover .region-dot {
  box-shadow: 0 0 14px var(--accent-glow), 0 0 4px var(--accent);
}

.region-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 164, 239, 0.3);
}

.region-info {
  min-width: 0;
}

.region-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.region-location {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 1px;
}

.region-badge {
  margin-left: auto;
  flex-shrink: 0;
  background: rgba(0, 120, 212, 0.15);
  color: var(--accent-light);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 10px;
  letter-spacing: 0.02em;
}

/* ---------- Globe Container ---------- */
#globe-container {
  position: fixed;
  top: var(--header-height);
  left: var(--sidebar-width);
  right: 0;
  bottom: 0;
  overflow: hidden;
}

#globe-container canvas {
  display: block;
  touch-action: none;
}

.globe-error {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 360px;
  text-align: center;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.globe-error strong {
  display: block;
  color: var(--text-primary);
  font-size: 15px;
  margin-bottom: 6px;
}

/* ---------- Tooltip ---------- */
.tooltip {
  position: fixed;
  display: none;
  pointer-events: none;
  background: rgba(10, 14, 30, 0.94);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 164, 239, 0.3);
  border-radius: 10px;
  padding: 12px 16px;
  z-index: 200;
  min-width: 180px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 120, 212, 0.15);
}

.tooltip-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.tooltip-location {
  font-size: 12px;
  color: var(--text-secondary);
}

.tooltip-meta {
  font-size: 11px;
  color: var(--accent-light);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

/* ---------- Detail Panel ---------- */
.detail-panel {
  position: fixed;
  top: var(--header-height);
  right: 0;
  bottom: 0;
  width: 400px;
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border);
  z-index: 95;
  transform: translateX(0);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* visibility keeps off-screen content out of the tab order */
.detail-panel.hidden {
  transform: translateX(110%);
  visibility: hidden;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s 0.35s;
}

.detail-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  /* Not "all": an inherited visibility transition would keep it unfocusable as the panel opens */
  transition: background-color 0.25s, color 0.25s;
  z-index: 1;
}

.detail-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.detail-header {
  padding: 32px 28px 24px;
  border-bottom: 1px solid var(--border);
}

.detail-region-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 120, 212, 0.15);
  color: var(--accent-light);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 12px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.detail-region-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-light);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(0, 120, 212, 0.35);
  background: rgba(0, 120, 212, 0.1);
  color: var(--accent-light);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.action-btn:hover {
  background: rgba(0, 120, 212, 0.22);
  color: var(--text-primary);
}

.copy-link.copied span {
  display: none;
}

.copy-link.copied::after {
  content: 'Link copied';
  color: #4ade80;
}

/* At-a-glance capability chips */
.cap-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
}

.cap-chip {
  display: inline-block;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.cap-chip-power {
  background: rgba(0, 120, 212, 0.14);
  border-color: rgba(0, 120, 212, 0.3);
  color: var(--accent-light);
}

.cap-chip-ibmi {
  background: rgba(126, 87, 194, 0.16);
  border-color: rgba(126, 87, 194, 0.35);
  color: #b79be8;
}

.detail-title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.detail-location {
  font-size: 14px;
  color: var(--text-secondary);
}

.detail-body {
  padding: 24px 28px;
}

.detail-section {
  margin-bottom: 28px;
}

.detail-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.detail-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.detail-info-item {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 14px;
}

.detail-info-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.detail-info-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Deployment list */
.deployment-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.deployment-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}

.deployment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.deployment-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.deployment-api {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-family: 'Cascadia Code', 'Fira Code', monospace;
  color: var(--accent-light);
  background: rgba(0, 120, 212, 0.1);
  border: 1px solid rgba(0, 120, 212, 0.25);
  padding: 3px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.copy-api:hover {
  background: rgba(0, 120, 212, 0.2);
}

.copy-api.copied {
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.4);
  background: rgba(74, 222, 128, 0.12);
}

.copy-api.copied svg { display: none; }

.copy-api.copied::after {
  content: 'Copied';
  font-family: var(--font-family);
  font-weight: 600;
}

.copy-val {
  background: none;
  border: none;
  padding: 0;
  font-family: 'Cascadia Code', 'Fira Code', monospace;
  font-size: 11px;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  word-break: break-all;
}

.copy-val:hover {
  color: var(--accent-light);
  text-decoration: underline dotted;
}

.copy-val.copied {
  color: #4ade80;
}

/* Hardware rows */
.hw-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hw-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hw-platform {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 62px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(0, 120, 212, 0.14);
  text-align: center;
}

.hw-platform-x86 {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.hw-os {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.os-tag {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 6px;
}

.os-tag-ibmi {
  color: #c4adf0;
  border-color: rgba(126, 87, 194, 0.35);
}

.os-tag-model {
  font-family: 'Cascadia Code', 'Fira Code', monospace;
  color: var(--text-muted);
  border-style: dashed;
}

.hw-empty {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* Collapsible VM limits / network sections */
.spec-details {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.spec-details summary {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.spec-details summary::-webkit-details-marker { display: none; }

.spec-details summary::before {
  content: '▸';
  transition: transform var(--transition);
}

.spec-details[open] summary::before {
  transform: rotate(90deg);
}

.spec-details summary span {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
}

.spec-details summary:hover {
  color: var(--text-primary);
}

.spec-details[open] > :not(summary):first-of-type {
  margin-top: 10px;
}

.spec-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.spec-table-wrap::-webkit-scrollbar { height: 6px; }
.spec-table-wrap::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
}

.spec-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 11px;
  white-space: nowrap;
}

.spec-table th,
.spec-table td {
  padding: 6px 10px;
  text-align: right;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.spec-grp {
  text-align: center;
  font-weight: 700;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid var(--border);
}

.spec-grp.grp-power {
  color: var(--accent-light);
  background: rgba(0, 120, 212, 0.12);
}

.spec-os {
  font-weight: 600;
  color: var(--accent-light);
  background: rgba(0, 120, 212, 0.06);
  border-bottom: 1px solid var(--border);
}

.spec-os.spec-os-ibmi {
  color: #c4adf0;
}

.spec-model {
  display: block;
  font-weight: 500;
  font-size: 10px;
  color: var(--text-muted);
  font-family: 'Cascadia Code', 'Fira Code', monospace;
}

.spec-rowlabel {
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-sidebar);
  position: sticky;
  left: 0;
  z-index: 1;
}

.spec-corner {
  background: var(--bg-sidebar);
  position: sticky;
  left: 0;
  z-index: 2;
}

.spec-table tbody td {
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.spec-table tbody tr:hover td,
.spec-table tbody tr:hover .spec-rowlabel {
  background: rgba(0, 120, 212, 0.08);
}

/* Network endpoints */
.net-group-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 12px 0 6px;
}

.net-list {
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.net-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.net-row:last-child {
  border-bottom: none;
}

.net-type {
  font-size: 11px;
  color: var(--text-secondary);
}

.net-values {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 12px;
}

.net-ip,
.net-port {
  font-family: 'Cascadia Code', 'Fira Code', monospace;
  font-size: 11px;
  color: var(--text-muted);
}

.net-note {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.net-note a {
  color: var(--accent-light);
}

/* Source links */
.detail-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-links a {
  font-size: 12.5px;
  color: var(--accent-light);
  text-decoration: none;
  transition: var(--transition);
}

.detail-links a:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.detail-synced {
  font-size: 11.5px;
  color: var(--text-muted);
}

.verified-line {
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.verified-stale {
  color: #fbbf24;
}

.section-note {
  margin-top: 8px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-muted);
}

.section-note a {
  color: var(--accent-light);
}

.summary-table {
  white-space: normal;
}

.summary-table th,
.summary-table td {
  padding: 6px 8px;
}

.summary-table th[scope="col"] {
  min-width: 64px;
}

/* Official connectivity tools */
.tool-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.tool-link {
  display: block;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--accent-light);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}

.tool-link:hover {
  border-color: rgba(0, 164, 239, 0.45);
  background: var(--bg-card-hover);
}

.tool-desc {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
}

/* ---------- Compare dialog ---------- */
.compare-dialog {
  width: min(1040px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  margin: auto;
  padding: 0;
  border: 1px solid rgba(0, 164, 239, 0.25);
  border-radius: 14px;
  background: #060b18;
  color: var(--text-primary);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.compare-dialog[open] {
  display: flex;
  flex-direction: column;
  animation: fade-in-up 0.25s ease both;
}

.compare-dialog::backdrop {
  background: rgba(1, 4, 9, 0.72);
  backdrop-filter: blur(3px);
}

.compare-inner {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}

.compare-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 24px 28px 12px;
}

.compare-eyebrow {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-light);
}

.compare-title {
  margin-top: 4px;
  font-size: 24px;
  letter-spacing: -0.02em;
}

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

.compare-close {
  position: static;
}

.compare-pickers {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 0 28px 16px;
  border-bottom: 1px solid var(--border);
}

.compare-picker {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.compare-picker select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
}

.compare-picker select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.25);
}

.compare-picker option,
.compare-picker optgroup {
  background: #0b1222;
  color: var(--text-primary);
}

.swap-btn {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 18px;
  cursor: pointer;
  transition: var(--transition);
}

.swap-btn:hover {
  background: rgba(0, 120, 212, 0.22);
}

.compare-body {
  padding: 20px 28px 28px;
}

.compare-regions {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.compare-region {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  font-size: 12px;
  color: var(--text-secondary);
}

.compare-region strong {
  font-size: 17px;
  color: var(--text-primary);
}

.compare-role {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-light);
}

.compare-region-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.compare-distance {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 120px;
  padding: 8px;
  font-weight: 700;
  font-size: 15px;
  text-align: center;
}

.compare-distance::before {
  content: '';
  width: 100%;
  height: 1px;
  margin-bottom: 6px;
  background: linear-gradient(90deg, transparent, var(--accent-light), transparent);
}

.compare-distance small {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.dr-summary {
  margin-top: 16px;
}

.dr-callout {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.8;
}

.dr-callout .cap-chip {
  margin: 0 2px;
}

.dr-callout-ok {
  border: 1px solid rgba(74, 222, 128, 0.35);
  background: rgba(74, 222, 128, 0.08);
}

.dr-callout-ok strong {
  color: #4ade80;
}

.dr-callout-warn {
  border: 1px solid rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.08);
}

.dr-callout-warn strong {
  color: #fbbf24;
}

.dr-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.dr-facts > div {
  padding: 12px;
  border-radius: 10px;
  background: var(--bg-card);
}

.dr-facts dt {
  margin-bottom: 8px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.dr-facts dd {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.compare-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 20px 0 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.toggle input {
  accent-color: var(--accent);
}

.legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-left: 3px solid #fbbf24;
  background: rgba(251, 191, 36, 0.12);
}

.compare-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.compare-table th,
.compare-table td {
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.compare-table thead th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-light);
  background: rgba(0, 120, 212, 0.1);
}

.compare-table tbody th[scope="row"] {
  width: 30%;
  font-weight: 600;
  color: var(--text-secondary);
}

.compare-table td {
  width: 35%;
  font-variant-numeric: tabular-nums;
}

.compare-section th {
  padding-top: 14px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.025);
}

.compare-table tr.differs th[scope="row"] {
  box-shadow: inset 3px 0 #fbbf24;
}

.compare-table tr.differs td {
  background: rgba(251, 191, 36, 0.07);
}

.compare-connectivity {
  margin-top: 24px;
}

.compare-tools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.compare-tools {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  font-size: 12.5px;
}

.compare-tools a {
  color: var(--accent-light);
}

/* ---------- Directional DR limits & deployment fit ---------- */
.legends {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 14px;
}

.legend-swatch-lower {
  border-left-color: #f87171;
  background: rgba(248, 113, 113, 0.14);
}

.compare-table tr.dr-lower th[scope="row"] {
  box-shadow: inset 3px 0 #f87171;
}

.compare-table tr.dr-lower td {
  background: rgba(248, 113, 113, 0.08);
}

.dir-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.dir-lower {
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.14);
}

.dir-higher {
  color: #86efac;
  background: rgba(74, 222, 128, 0.12);
}

.dr-summary .dr-callout + .dr-callout {
  margin-top: 8px;
}

.dr-list {
  margin: 4px 0 0 18px;
  line-height: 1.6;
}

.dr-list strong {
  color: var(--text-primary);
}

.deployment-fit {
  margin-top: 24px;
}

.fit-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.4fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: 8px;
  background: var(--bg-card);
  font-size: 12.5px;
  line-height: 1.7;
}

.fit-ok { border-left-color: #4ade80; }
.fit-gap { border-left-color: #fbbf24; }

.fit-row code,
.finder-card code {
  font-size: 11px;
  color: var(--text-muted);
}

.fit-arrow {
  color: var(--text-muted);
}

/* ---------- Workload finder ---------- */
.finder-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 28px 16px;
  border-bottom: 1px solid var(--border);
}

.finder-hint {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.finder-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.finder-fields [hidden] {
  display: none;
}

.compare-picker input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
}

.compare-picker input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.25);
}

.compare-picker select:disabled {
  opacity: 0.5;
}

.finder-reset {
  align-self: flex-start;
}

.finder-summary {
  padding: 12px 14px;
  border: 1px solid rgba(0, 164, 239, 0.3);
  border-radius: 10px;
  background: rgba(0, 120, 212, 0.08);
  font-size: 13px;
  line-height: 1.6;
}

.finder-geo {
  margin-top: 18px;
}

.finder-card {
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
}

.finder-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
}

.finder-region {
  display: block;
  font-size: 15px;
}

.finder-location {
  font-size: 12px;
  color: var(--text-secondary);
}

.finder-card-actions {
  display: flex;
  gap: 6px;
}

.finder-matches {
  list-style: none;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.finder-matches li {
  display: flex;
  flex-wrap: wrap;
  column-gap: 12px;
  row-gap: 2px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12px;
  color: var(--text-secondary);
}

.finder-match-name {
  font-weight: 600;
  color: var(--text-primary);
}

.finder-match-limits {
  flex-basis: 100%;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.finder-limit-req {
  color: #4ade80;
  font-weight: 600;
}

.finder-unsuitable {
  margin-top: 20px;
}

.finder-reasons {
  margin: 0;
  padding: 10px 14px 12px 30px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.finder-reasons strong {
  color: var(--text-primary);
}

/* ---------- Deployment scenario, DR pairs, workload fit & checklist ---------- */
.finder-scenario {
  display: inline-flex;
  align-self: flex-start;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.finder-scenario legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.finder-scenario label {
  position: relative;
  cursor: pointer;
}

.finder-scenario input {
  position: absolute;
  opacity: 0;
}

.finder-scenario span {
  display: block;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.finder-scenario input:checked + span {
  background: rgba(0, 120, 212, 0.35);
  color: var(--text-primary);
}

.finder-scenario input:focus-visible + span {
  outline: 2px solid var(--accent-light);
  outline-offset: -2px;
}

.finder-pairs {
  margin-top: 18px;
}

.pair-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.pair-row {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  font-size: 13px;
}

.pair-main,
.pair-alt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
}

.pair-alt {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12px;
  color: var(--text-secondary);
}

.pair-route {
  min-width: 260px;
}

.pair-meta {
  flex: 1;
  font-size: 12px;
  color: var(--text-muted);
}

.separation-limited {
  color: #fbbf24;
  font-weight: 600;
}

.finder-all-title {
  margin-top: 24px;
}

.workload-fit {
  margin-top: 20px;
}

.workload-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
}

.workload-bar .detail-section-title {
  margin-bottom: 0;
}

.workload-desc {
  font-size: 13px;
  font-weight: 600;
}

.workload-actions {
  display: inline-flex;
  gap: 14px;
  margin-left: auto;
}

.fit-card {
  border-left-width: 3px;
}

.checklist-section {
  margin-top: 20px;
}

.checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.check {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  align-items: start;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.check strong {
  color: var(--text-primary);
}

.check-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
}

.check-ok .check-icon { background: rgba(74, 222, 128, 0.18); color: #4ade80; }
.check-warn .check-icon { background: rgba(251, 191, 36, 0.18); color: #fbbf24; }
.check-fail .check-icon { background: rgba(248, 113, 113, 0.2); color: #f87171; }
.check-todo .check-icon { border-radius: 4px; color: var(--text-muted); font-size: 14px; }

.region-note {
  margin-bottom: 10px;
}

/* ---------- First screen ---------- */
.welcome {
  position: fixed;
  top: calc(var(--header-height) + 28px);
  left: calc(var(--sidebar-width) + 32px);
  z-index: 90;
  width: min(560px, calc(100vw - var(--sidebar-width) - 64px));
  padding: 26px 28px 22px;
  border: 1px solid rgba(0, 164, 239, 0.3);
  border-radius: 16px;
  background: rgba(6, 11, 24, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  animation: fade-in-up 0.35s ease both;
}

.welcome[hidden] {
  display: none;
}

.welcome-close {
  top: 14px;
  right: 14px;
}

.welcome-eyebrow {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-light);
}

.welcome-title {
  margin: 8px 36px 10px 0;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.welcome-lead {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.welcome-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 18px;
}

.welcome-primary {
  border: none;
  font-size: 14px;
  cursor: pointer;
}

.welcome-presets {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.welcome-presets-label {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.welcome-trust {
  margin-top: 14px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.welcome-trust a {
  color: var(--accent-light);
}

.finder-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.finder-presets[hidden] {
  display: none;
}

.preset-chip {
  padding: 5px 11px;
  border: 1px solid rgba(0, 164, 239, 0.3);
  border-radius: 999px;
  background: rgba(0, 120, 212, 0.12);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.preset-chip:hover {
  background: rgba(0, 120, 212, 0.3);
}

/* ---------- Finder: modes, verdicts, estate ---------- */
.finder-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.finder-fields[hidden],
.finder-estate[hidden] {
  display: none;
}

.verdict {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  vertical-align: middle;
}

.verdict-ok {
  color: #86efac;
  background: rgba(74, 222, 128, 0.12);
}

.dep-ok { color: #4ade80; }
.dep-no { color: #f87171; }

.finder-dep-no .finder-match-name {
  color: var(--text-secondary);
}

.finder-source {
  margin-top: 6px;
}

.finder-source a {
  color: var(--accent-light);
}

.finder-estate {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.finder-estate textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  font: 12.5px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
  resize: vertical;
}

.finder-estate textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.25);
}

.finder-estate-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
}

.finder-file {
  position: relative;
}

.finder-file input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.finder-file:focus-within {
  outline: 2px solid var(--accent-light);
  outline-offset: 2px;
}

.finder-estate-note {
  flex-basis: 100%;
  font-size: 11.5px;
  color: var(--text-muted);
}

.estate-table td,
.estate-table th[scope="row"] {
  width: auto;
}

.estate-table tr.estate-all th[scope="row"] {
  box-shadow: inset 3px 0 #4ade80;
}

.estate-fit {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.estate-bar {
  display: block;
  width: 100px;
  height: 4px;
  margin: 4px 0;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.estate-bar span {
  display: block;
  height: 100%;
  background: var(--accent-light);
}

.estate-blockers {
  margin: 0;
  padding-left: 16px;
  font-size: 12px;
  color: var(--text-secondary);
}

.estate-table .action-btn {
  margin: 2px 0;
}

/* ---------- Customer engagement CTA ---------- */
.cta-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
  padding: 14px 16px;
  border: 1px solid rgba(0, 164, 239, 0.35);
  border-radius: 10px;
  background: rgba(0, 120, 212, 0.12);
  font-size: 12.5px;
  color: var(--text-secondary);
}

.cta-btn {
  align-self: flex-start;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.cta-btn:hover {
  background: #106ebe;
}

/* ---------- Footer ---------- */
#footer {
  position: fixed;
  bottom: 0;
  left: var(--sidebar-width);
  right: 0;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(0deg, rgba(4, 7, 20, 0.95) 0%, rgba(4, 7, 20, 0) 100%);
  z-index: 80;
  pointer-events: none;
}

.footer-content {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--text-muted);
}

.footer-content a {
  color: var(--text-secondary);
  pointer-events: auto;
}

.globe-error a {
  color: var(--accent-light);
}

/* ---------- Loading ---------- */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.6s ease;
}

.loading-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.spinner-ring {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(0, 120, 212, 0.15);
  border-top-color: var(--accent-light);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
}

/* ---------- Sidebar Toggle (mobile, lives in header) ---------- */
.sidebar-toggle {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-toggle:hover,
.sidebar-toggle[aria-expanded="true"] {
  background: rgba(0, 120, 212, 0.2);
}

/* ---------- Animations ---------- */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .detail-panel {
    width: 360px;
  }
}

@media (max-width: 1024px) {
  :root {
    --sidebar-width: 300px;
  }

  .detail-panel {
    width: 340px;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 100%;
  }

  #header {
    padding: 0 12px;
  }

  .header-logo {
    height: 18px;
  }

  .sidebar-toggle {
    display: flex;
  }

  #sidebar {
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform var(--transition), visibility 0s 0.25s;
  }

  #sidebar.open {
    transform: translateX(0);
    visibility: visible;
    transition: transform var(--transition), visibility 0s;
  }

  #globe-container {
    left: 0;
  }

  #footer {
    left: 0;
  }

  .detail-panel {
    width: 100%;
  }

  .header-btn-primary span {
    display: none;
  }

  .compare-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .compare-header,
  .compare-body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .compare-header {
    flex-wrap: wrap;
  }

  .compare-eyebrow {
    display: none;
  }

  .compare-title {
    font-size: 20px;
  }

  .compare-actions .action-btn {
    padding: 6px 8px;
  }

  .compare-pickers {
    flex-direction: column;
    align-items: stretch;
    padding: 0 16px 16px;
  }

  .swap-btn {
    align-self: center;
    transform: rotate(90deg);
  }

  .compare-regions,
  .dr-facts,
  .compare-tools-grid {
    grid-template-columns: 1fr;
  }

  .finder-form {
    padding: 0 16px 16px;
  }

  .finder-fields {
    grid-template-columns: 1fr 1fr;
  }

  .welcome {
    top: auto;
    left: 12px;
    right: 12px;
    bottom: 52px;
    width: auto;
    max-height: calc(100dvh - var(--header-height) - 72px);
    overflow-y: auto;
    padding: 20px 18px 16px;
  }

  .welcome-title {
    font-size: 21px;
  }

  .fit-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .fit-arrow {
    display: none;
  }

  .pair-route {
    min-width: 0;
    flex-basis: 100%;
  }

  .workload-actions {
    margin-left: 0;
  }

  .compare-distance::before {
    display: none;
  }
}

/* ---------- Print / Export PDF ---------- */
@media print {
  @page {
    margin: 14mm;
  }

  :root {
    --bg-primary: #fff;
    --bg-sidebar: #fff;
    --bg-card: #f4f6f9;
    --bg-card-hover: #f4f6f9;
    --accent-light: #005a9e;
    --text-primary: #111;
    --text-secondary: #333;
    --text-muted: #555;
    --border: #d0d7e2;
  }

  html, body {
    height: auto;
    overflow: visible;
    background: #fff;
    color: #111;
  }

  * {
    animation: none !important;
    transition: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }

  .print-only {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .print-meta {
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0078d4;
    font-size: 11px;
    color: #444;
    word-break: break-all;
  }

  .print-meta strong {
    font-size: 15px;
    color: #111;
  }

  .no-print,
  #welcome,
  .detail-close,
  .loading-overlay,
  #header,
  #sidebar,
  #globe-container,
  #tooltip,
  #footer {
    display: none !important;
  }

  .detail-panel,
  .detail-panel.hidden {
    position: static;
    width: auto;
    transform: none;
    visibility: visible;
    overflow: visible;
    border: none;
  }

  body[data-print="page"] .detail-panel.hidden,
  body[data-print="compare"] .detail-panel,
  body[data-print="finder"] .detail-panel {
    display: none;
  }

  body[data-print="page"] #sidebar {
    display: flex !important;
    position: static;
    width: auto;
    transform: none;
    visibility: visible;
    border: none;
  }

  .detail-header,
  .detail-body {
    padding: 0 0 12px;
  }

  .detail-section,
  .deployment-card,
  .compare-table tbody,
  .dr-summary,
  .compare-regions {
    break-inside: avoid;
  }

  .cap-chip,
  .os-tag,
  .hw-platform,
  .deployment-api,
  .detail-region-badge {
    background: #fff !important;
    border: 1px solid #b8c2d1 !important;
    color: #222 !important;
  }

  .spec-table-wrap,
  .compare-table-wrap {
    overflow: visible;
  }

  .spec-table,
  .compare-table {
    white-space: normal;
  }

  .spec-table th,
  .spec-table td,
  .compare-table th,
  .compare-table td {
    border-bottom: 1px solid #e1e6ee;
    background: transparent !important;
    color: #111;
  }

  .compare-table tr.differs td {
    background: #fff6db !important;
  }

  .copy-val {
    color: #111;
  }

  a {
    color: #005a9e !important;
  }

  .tool-link::after,
  .compare-tools a::after,
  .detail-links a::after {
    content: ' (' attr(href) ')';
    font-weight: 400;
    font-size: 10px;
    color: #555;
    word-break: break-all;
  }

  .compare-dialog {
    position: static;
    width: auto;
    max-width: none;
    max-height: none;
    height: auto;
    border: none;
    background: #fff;
    color: #111;
    overflow: visible;
  }

  .compare-dialog::backdrop {
    background: none;
  }

  .compare-inner {
    overflow: visible;
  }

  .compare-header {
    display: none;
  }

  .compare-body {
    padding: 0;
  }

  .compare-region,
  .dr-facts > div,
  .compare-tools {
    background: #fff;
    border: 1px solid #d0d7e2;
  }

  .compare-distance::before {
    background: #0078d4;
  }

  .dr-callout-ok { background: #ecfdf3; border-color: #86efac; }
  .dr-callout-ok strong { color: #15803d; }
  .dr-callout-warn { background: #fff7e0; border-color: #fcd34d; }
  .dr-callout-warn strong { color: #a16207; }

  .compare-table tr.dr-lower td {
    background: #fde8e8 !important;
  }

  .dir-lower { color: #b91c1c; background: none; }
  .dir-higher { color: #15803d; background: none; }

  .fit-row,
  .finder-card,
  .finder-summary {
    background: #fff;
    border-color: #d0d7e2;
    break-inside: avoid;
  }

  .finder-limit-req { color: #15803d; }

  .pair-row,
  .checklist-section,
  .workload-fit {
    break-inside: avoid;
  }

  .pair-row { background: #fff; border-color: #d0d7e2; }
  .separation-limited { color: #a16207; }
  .check-ok .check-icon { color: #15803d; }
  .check-warn .check-icon { color: #a16207; }
  .check-fail .check-icon { color: #b91c1c; }
}
