* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  display: flex;
  height: 100vh;
  overflow: hidden;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #1a1a2e;
  color: #d8dce2;
}

/* --- Sidebar --- */

#sidebar {
  width: 340px;
  min-width: 340px;
  background: #111827;
  border-right: 2px solid #1e2d4a;
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: #2a3452 transparent;
}

#sidebar::-webkit-scrollbar {
  width: 6px;
}

#sidebar::-webkit-scrollbar-thumb {
  background: #2a3452;
  border-radius: 3px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0 14px;
  border-bottom: 1px solid #1e2d4a;
  justify-content: center;
}

.sidebar-header__label {
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #e94560;
  background: rgba(233, 69, 96, 0.12);
  border: 1px solid rgba(233, 69, 96, 0.3);
  padding: 3px 8px;
  line-height: 1;
}

#sidebar h1 {
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #e2e6ec;
  letter-spacing: 0.02em;
}

#sidebar h2 {
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7a8a9e;
  margin-bottom: 8px;
  font-weight: 600;
}

/* --- Sections --- */

section {
  background: #151d30;
  border: 1px solid #1e2d4a;
  border-radius: 0;
  padding: 12px;
}

/* --- Buttons --- */

.btn-group {
  display: flex;
  gap: 4px;
}

.mode-btn {
  flex: 1;
  padding: 11px 8px;
  border: 2px solid #2a3452;
  background: #1a2238;
  color: #8898aa;
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  border-radius: 0;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.mode-btn:hover {
  background: #1e2a44;
  border-color: #3a4a6a;
  color: #6b7a8d;
}

.mode-btn:focus-visible {
  outline: 2px solid #5a8dee;
  outline-offset: 1px;
}

.mode-btn:active {
  transform: scale(0.97);
}

#btn-keep.active {
  border-color: #4caf50;
  background: #162214;
  color: #6fdf70;
  box-shadow: inset 0 0 20px rgba(76, 175, 80, 0.08);
}

#btn-keep.active:hover {
  background: #1a2c18;
}

#btn-purge.active {
  border-color: #e94560;
  background: #241218;
  color: #ff6b7a;
  box-shadow: inset 0 0 20px rgba(233, 69, 96, 0.08);
}

#btn-purge.active:hover {
  background: #2e1820;
}

.hint {
  font-size: 0.7rem;
  color: #6b7a8d;
  margin-top: 10px;
  line-height: 1.6;
  letter-spacing: 0.01em;
}
.hint--warn {
  color: #e9a545;
}

button {
  padding: 7px 12px;
  border: 1px solid #1e2d4a;
  background: #1a2238;
  color: #a0aab8;
  cursor: pointer;
  border-radius: 0;
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: all 0.12s ease-out;
}

button:hover {
  background: #1e2a44;
  border-color: #2a3a5a;
  color: #a0aab8;
}

button:focus-visible {
  outline: 2px solid #5a8dee;
  outline-offset: 1px;
}

button:active {
  transform: scale(0.97);
  background: #141c30;
}

button.full-width {
  width: 100%;
  margin-top: 8px;
}

button.accent {
  background: #c83450;
  border-color: #c83450;
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  padding: 10px 12px;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

button.accent:hover {
  background: #e03e5c;
  border-color: #e03e5c;
  box-shadow: 0 0 20px rgba(233, 69, 96, 0.15);
}

button.accent:active {
  background: #a82c44;
  box-shadow: none;
}

.btn-download {
  display: block;
  margin-top: 6px;
  padding: 7px 12px;
  border: 1px solid #1e2d4a;
  background: #1a2238;
  color: #a0aab8;
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  transition: all 0.12s ease-out;
}

.btn-download:hover {
  background: #1e2a44;
  border-color: #2a3a5a;
  color: #a0aab8;
}

.btn-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-row button {
  flex: 1;
}

.preset-row button {
  flex: 0 1 auto;
}

/* --- Form controls --- */

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  cursor: pointer;
  font-size: 0.82rem;
  color: #a0aab8;
  transition: color 0.12s;
}

.checkbox-label:hover {
  color: #d0d8e2;
}

.checkbox-label input {
  accent-color: #e94560;
  cursor: pointer;
}

select,
input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  background: #0c1018;
  border: 1px solid #1e2d4a;
  color: #c8d0da;
  border-radius: 0;
  font-family: 'Consolas', 'SF Mono', 'Fira Code', monospace;
  font-size: 0.8rem;
  margin-bottom: 8px;
  transition: border-color 0.15s;
}

select:hover,
input[type="text"]:hover {
  border-color: #2a3a5a;
}

select:focus,
input[type="text"]:focus {
  outline: none;
  border-color: #e94560;
}

input[type="text"]::placeholder {
  color: #4a5a6e;
}

label:not(.checkbox-label) {
  display: block;
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: 0.68rem;
  color: #7a8a9e;
  margin-bottom: 3px;
  margin-top: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* --- Legend --- */

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 4px 0;
  color: #8898aa;
  text-transform: uppercase;
}

.swatch {
  width: 16px;
  height: 16px;
  border-radius: 0;
  flex-shrink: 0;
}

.swatch.keep {
  background: rgba(76, 175, 80, 0.45);
  border: 2px solid rgba(76, 175, 80, 0.7);
}

.swatch.purge {
  background: rgba(233, 69, 96, 0.45);
  border: 2px solid rgba(233, 69, 96, 0.7);
}

.swatch.populated {
  background: rgba(255, 193, 7, 0.4);
  border: 2px solid rgba(255, 193, 7, 0.6);
}

.swatch.safehouse {
  background: rgba(100, 180, 255, 0.4);
  border: 2px solid rgba(100, 180, 255, 0.7);
}

.swatch.nonpvp {
  background: rgba(180, 120, 255, 0.35);
  border: 2px solid rgba(180, 120, 255, 0.55);
}

.swatch.designation {
  background: rgba(255, 160, 50, 0.35);
  border: 2px solid rgba(255, 160, 50, 0.5);
}

.swatch.stash-spawned {
  background: rgba(200, 220, 50, 0.5);
  border: 2px solid rgba(200, 220, 50, 1.0);
}

.swatch.stash-pending {
  background: rgba(255, 180, 50, 0.4);
  border: 2px solid rgba(255, 180, 50, 0.9);
}

.swatch.stash-available {
  background: rgba(200, 220, 50, 0.15);
  border: 2px solid rgba(200, 220, 50, 0.4);
}

/* --- World Data summary --- */

.world-data-counts {
  font-family: 'Consolas', 'SF Mono', 'Fira Code', monospace;
  font-size: 0.72rem;
  color: #6b7a8d;
  margin-top: 8px;
  line-height: 1.5;
}

.world-data-group {
  margin-top: 10px;
}

.world-data-label {
  display: block;
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #7a8a9e;
  margin-bottom: 4px;
}

.world-data-entry {
  font-size: 0.74rem;
  color: #8898aa;
  padding: 2px 0;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 6px;
}

.faction-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

/* --- Footer elements --- */

#status-bar {
  margin-top: auto;
  padding: 10px 0 2px;
  font-family: 'Consolas', 'SF Mono', 'Fira Code', monospace;
  font-size: 0.7rem;
  color: #5a6a7a;
  text-align: center;
  min-height: 1.8em;
}

.attribution {
  font-size: 0.65rem;
  color: #4a5a6a;
  text-align: center;
  padding-bottom: 2px;
  letter-spacing: 0.02em;
}

.attribution a {
  color: #3e4e5e;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.12s;
}

.attribution a:hover {
  color: #e94560;
  border-bottom-color: #e94560;
}

/* --- Map area --- */

#map-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #0e1118;
  cursor: crosshair;
}

#canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#selection-bar {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: rgba(12, 16, 24, 0.9);
  border: 1px solid #1e2d4a;
  border-left: 3px solid #e94560;
  padding: 6px 14px;
  font-family: 'Consolas', 'SF Mono', 'Fira Code', monospace;
  font-size: 0.78rem;
  color: #6b7a8d;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: opacity 0.2s ease-out;
  white-space: nowrap;
}

#selection-bar[hidden] {
  display: none;
}

#selection-bar button {
  padding: 4px 10px;
  font-size: 0.7rem;
  border: 1px solid #2a3452;
  background: #1a2238;
  color: #a0aab8;
}

#selection-bar button:hover {
  background: #1e2a44;
  border-color: #3a4a6a;
}

/* --- Map legend overlay --- */

#map-legend {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(12, 16, 24, 0.9);
  border: 1px solid #1e2d4a;
  border-left: 3px solid #e94560;
  padding: 10px 14px;
  z-index: 10;
  pointer-events: auto;
  transition: opacity 0.2s ease-out;
  display: grid;
  grid-template-columns: auto auto;
  column-gap: 16px;
}

#map-legend[hidden] {
  display: none !important;
}

.map-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: 0.72rem;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #8898aa;
  text-transform: uppercase;
  padding: 2px 0;
}

.map-legend-item:hover {
  color: #c0c8d2;
}

.map-legend-item.off {
  opacity: 0.35;
}

.map-legend-item.off .swatch {
  background: rgba(60, 70, 90, 0.3);
  border-color: rgba(60, 70, 90, 0.5);
}

.map-legend-item .swatch {
  width: 14px;
  height: 14px;
}

#coords-display {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(12, 16, 24, 0.9);
  padding: 6px 12px;
  border-radius: 0;
  border: 1px solid #1e2d4a;
  border-left: 3px solid #e94560;
  font-size: 0.78rem;
  font-family: 'Consolas', 'SF Mono', 'Fira Code', monospace;
  color: #6b7a8d;
  display: none;
  pointer-events: none;
}

/* --- About page --- */

.page-body {
  display: block;
  height: auto;
  overflow: auto;
  background: #111827;
}

/* Entry animation */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
  opacity: 0;
  animation: fadeSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--delay, 0) * 80ms + 200ms);
}

/* Layout */
.page-content {
  max-width: 740px;
  margin: 0 auto;
  padding: 32px 24px 80px;
  line-height: 1.7;
}

/* Navigation */
.page-nav a {
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: #4a5a6e;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: color 0.15s;
}

.page-nav a:hover {
  color: #e94560;
}

.page-nav--bottom {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid #1e2d4a;
}

/* Header */
.page-header {
  margin: 48px 0 56px;
}

.page-header__label {
  display: inline-block;
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #e94560;
  background: rgba(233, 69, 96, 0.1);
  border: 1px solid rgba(233, 69, 96, 0.25);
  padding: 4px 12px;
  margin-bottom: 16px;
}

.page-header__title {
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: clamp(2.2rem, 5vw, 3rem);
  font-weight: 700;
  color: #e2e6ec;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

.page-header__sub {
  font-size: 1rem;
  color: #5a6a7e;
  max-width: 480px;
  line-height: 1.6;
}

/* Sections */
.page-section {
  margin-bottom: 56px;
}

.page-section h2 {
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: #c8d0da;
  margin-bottom: 12px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.section-num {
  font-size: 0.72rem;
  font-weight: 600;
  color: #e94560;
  letter-spacing: 0.04em;
  opacity: 0.7;
}

.page-section h3 {
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #8898aa;
  margin-top: 28px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.page-section p {
  margin-bottom: 16px;
  color: #8898aa;
  font-size: 0.9rem;
}

.page-section p strong {
  color: #b0bcc8;
}

/* Hierarchy flow diagram */
.hierarchy-flow {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 24px 0 28px;
  overflow-x: auto;
}

.hierarchy-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 20px 28px;
  background: #151d30;
  border: 1px solid #232d48;
  min-width: 140px;
  text-align: center;
}

.hierarchy-node__size {
  font-family: 'Consolas', 'SF Mono', 'Fira Code', monospace;
  font-size: 0.75rem;
  color: #5a6a7e;
}

.hierarchy-node__name {
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #e2e6ec;
}

.hierarchy-node__desc {
  font-size: 0.72rem;
  color: #4a5a6e;
}

.hierarchy-arrow {
  display: flex;
  align-items: center;
  padding: 0 6px;
  color: #e94560;
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.hierarchy-arrow::before,
.hierarchy-arrow::after {
  content: '';
  display: block;
  width: 16px;
  height: 1px;
  background: #2a3452;
}

.hierarchy-arrow span {
  padding: 0 6px;
}

/* Version comparison */
.version-compare {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
  margin: 24px 0 28px;
  align-items: start;
}

.version-compare__col {
  padding: 24px;
  border: 1px solid #232d48;
  background: #151d30;
}

.version-compare__col--old {
  border-right: none;
}

.version-compare__col--new {
  border-left: none;
  border-color: rgba(233, 69, 96, 0.3);
  background: rgba(233, 69, 96, 0.04);
}

.version-compare__badge {
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  color: #4a5a6e;
}

.version-compare__col--new .version-compare__badge {
  color: #e94560;
}

.version-compare__col dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  align-items: baseline;
}

.version-compare__col dt {
  font-size: 0.78rem;
  color: #4a5a6e;
}

.version-compare__col dd {
  font-family: 'Consolas', 'SF Mono', 'Fira Code', monospace;
  font-size: 0.88rem;
  color: #8898aa;
  text-align: right;
}

.version-compare__col--new dd {
  color: #c8d0da;
}

.version-compare__note {
  display: block;
  margin-top: 14px;
  font-size: 0.72rem;
  color: #3e4e5e;
  font-style: italic;
}

.version-compare__vs {
  align-self: center;
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #2a3452;
  background: #111827;
  padding: 8px 0;
  z-index: 1;
}

/* Terminal-style code block */
.terminal {
  background: #0c1018;
  border: 1px solid #1e2d4a;
  border-left: 3px solid #e94560;
  padding: 16px 20px;
  margin: 16px 0 24px;
  overflow-x: auto;
}

.terminal code {
  font-family: 'Consolas', 'SF Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  color: #8898aa;
  line-height: 1.8;
}

.terminal__prompt {
  color: #e94560;
  user-select: none;
  margin-right: 8px;
}

.terminal__dim {
  color: #4a5a6e;
}

.download-btn {
  display: inline-block;
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  background: #c83450;
  border: 1px solid #c83450;
  padding: 10px 24px;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.download-btn:hover {
  background: #e03e5c;
  border-color: #e03e5c;
  box-shadow: 0 0 20px rgba(233, 69, 96, 0.15);
  color: #fff;
}

/* Calculation grid */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 16px 0 24px;
}

.calc-grid__axis {
  padding: 20px;
  background: #151d30;
  border: 1px solid #232d48;
}

.calc-grid__label {
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  color: #5a6a7e;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.calc-grid__step {
  font-family: 'Consolas', 'SF Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  color: #6b7a8d;
  padding: 3px 0;
}

.calc-grid__step strong {
  color: #c8d0da;
}

.calc-grid__range {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #1e2d4a;
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: #e94560;
  letter-spacing: 0.02em;
}

/* File table */
.file-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 0.85rem;
}

.file-table th {
  padding: 8px 14px;
  text-align: left;
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #3e4e5e;
  border-bottom: 1px solid #1e2d4a;
}

.file-table td {
  padding: 10px 14px;
  color: #8898aa;
  border-bottom: 1px solid #181e32;
}

.file-table code {
  font-family: 'Consolas', 'SF Mono', 'Fira Code', monospace;
  font-size: 0.82rem;
  color: #a0aab8;
}

/* Coordinate tags */
.coord-tag {
  display: inline-block;
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
}

.coord-tag--chunk {
  color: #5a8dee;
  background: rgba(90, 141, 238, 0.1);
  border: 1px solid rgba(90, 141, 238, 0.2);
}

.coord-tag--cell {
  color: #e94560;
  background: rgba(233, 69, 96, 0.1);
  border: 1px solid rgba(233, 69, 96, 0.2);
}

/* Inline code in page text */
.page-section p code,
.page-section li code {
  font-family: 'Consolas', 'SF Mono', 'Fira Code', monospace;
  font-size: 0.82em;
  color: #a0aab8;
  background: rgba(14, 17, 24, 0.6);
  padding: 1px 5px;
  border: 1px solid #1e2d4a;
}

/* Provenance/meta callout */
.page-callout {
  margin-top: 28px;
  padding: 16px 20px;
  background: rgba(233, 69, 96, 0.04);
  border: 1px solid rgba(233, 69, 96, 0.15);
  border-left: 3px solid rgba(233, 69, 96, 0.4);
  font-size: 0.82rem;
  color: #6b7a8d;
  line-height: 1.65;
}

.page-callout strong {
  color: #8898aa;
}

.page-callout a {
  color: #e94560;
  text-decoration: none;
  border-bottom: 1px solid rgba(233, 69, 96, 0.3);
  transition: border-color 0.15s;
}

.page-callout a:hover {
  border-bottom-color: #e94560;
}

.page-callout code {
  font-family: 'Consolas', 'SF Mono', 'Fira Code', monospace;
  font-size: 0.92em;
  color: #8898aa;
}

/* Binary format field list */
.field-list {
  list-style: none;
  margin: 16px 0 24px;
  padding: 0;
}

.field-list li {
  padding: 8px 14px;
  border-bottom: 1px solid #181e32;
  font-size: 0.85rem;
  color: #8898aa;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.field-list li:first-child {
  border-top: 1px solid #1e2d4a;
}

.field-list__num {
  font-family: 'Consolas', 'SF Mono', 'Fira Code', monospace;
  font-size: 0.72rem;
  color: #e94560;
  opacity: 0.6;
  min-width: 1.4em;
  text-align: right;
  flex-shrink: 0;
}

.field-list__name {
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-weight: 600;
  color: #c8d0da;
  min-width: 120px;
  flex-shrink: 0;
}

.field-list__desc {
  color: #6b7a8d;
  font-size: 0.82rem;
}

.field-list__desc code {
  font-family: 'Consolas', 'SF Mono', 'Fira Code', monospace;
  font-size: 0.92em;
  color: #7a8a9e;
}

/* Terminal diagram syntax highlights */
.terminal__type {
  color: #5a8dee;
}

.terminal__field {
  color: #c8d0da;
}

.terminal__comment {
  color: #4a5a6e;
}

.terminal__version {
  color: #e94560;
  opacity: 0.7;
}

/* Responsive */
@media (max-width: 600px) {
  .hierarchy-flow {
    flex-direction: column;
  }
  .hierarchy-arrow {
    transform: rotate(90deg);
  }
  .version-compare {
    grid-template-columns: 1fr;
  }
  .version-compare__col--old {
    border-right: 1px solid #232d48;
    border-bottom: none;
  }
  .version-compare__col--new {
    border-left: 1px solid rgba(233, 69, 96, 0.3);
    border-top: none;
  }
  .version-compare__vs {
    text-align: center;
    padding: 0 8px;
  }
  .calc-grid {
    grid-template-columns: 1fr;
  }
  .field-list li {
    flex-wrap: wrap;
  }
  .field-list__name {
    min-width: auto;
  }
  .field-list__desc {
    flex-basis: 100%;
    padding-left: 2.4em;
  }
}

.about-link {
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-top: 4px;
}

.about-link a {
  color: #4a5a6a;
  text-decoration: none;
  transition: color 0.15s;
}

.about-link a:hover {
  color: #e94560;
}

/* --- Help button --- */

#btn-help {
  margin-left: auto;
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: #5a6a7e;
  background: transparent;
  border: 1px solid #1e2d4a;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s;
}

#btn-help:hover {
  color: #e94560;
  border-color: #e94560;
}

/* --- Loading modal --- */

.loading-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
}

.loading-modal.visible {
  display: flex;
}

.loading-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.loading-modal__card {
  position: relative;
  background: #1a2236;
  border: 1px solid #2a3a5c;
  border-radius: 10px;
  padding: 28px 36px;
  min-width: 320px;
  max-width: 400px;
  text-align: center;
}

.loading-modal__title {
  font-family: 'Chakra Petch', monospace;
  font-size: 1.1rem;
  color: #e0e4ea;
  margin-bottom: 16px;
}

.loading-modal__bar-track {
  height: 8px;
  background: #0e1118;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.loading-modal__bar-fill {
  height: 100%;
  width: 0%;
  background: #e94560;
  border-radius: 4px;
  transition: width 0.15s ease;
}

.loading-modal__text {
  font-size: 0.82rem;
  color: #8892a4;
  font-family: monospace;
}

/* --- Walkthrough overlay --- */

.walkthrough {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.walkthrough__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  pointer-events: auto;
}

.walkthrough__spotlight {
  position: absolute;
  border-radius: 2px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.65);
  pointer-events: none;
  transition: top 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              left 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              width 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              height 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.walkthrough__card {
  position: absolute;
  background: #151d30;
  border: 1px solid #1e2d4a;
  padding: 18px 20px;
  max-width: 320px;
  pointer-events: auto;
  opacity: 1;
  transition: opacity 0.2s ease-out;
}

.walkthrough__card.fade-out {
  opacity: 0;
}

.walkthrough__step {
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #e94560;
  margin-bottom: 6px;
}

.walkthrough__title {
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #e2e6ec;
  margin-bottom: 8px;
}

.walkthrough__text {
  font-size: 0.8rem;
  color: #8898aa;
  line-height: 1.55;
  margin-bottom: 16px;
}

.walkthrough__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.walkthrough__skip {
  background: transparent;
  border: 1px solid transparent;
  color: #5a6a7e;
  font-size: 0.72rem;
  padding: 6px 12px;
}

.walkthrough__skip:hover {
  color: #8898aa;
  background: transparent;
  border-color: transparent;
}

.walkthrough__next {
  font-size: 0.72rem;
  padding: 6px 16px;
}
