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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #08080c;
  color: #e2e8f0;
  overflow: hidden;
}

/* === Graph canvas === */
#graph-container {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, #0c0c14 0%, #08080c 70%);
}

/* === Toolbar === */
#toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  background: rgba(8, 8, 12, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  z-index: 100;
}

#title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.7);
}

#ext-links {
  position: fixed;
  top: 56px;
  left: 18px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#ext-links a {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}
#ext-links a:hover {
  color: rgba(255, 255, 255, 0.7);
}

#search {
  width: 220px;
  flex-shrink: 0;
  padding: 5px 10px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: #e2e8f0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s;
}
#search:focus { border-color: rgba(255, 255, 255, 0.2); }
#search::placeholder { color: rgba(255, 255, 255, 0.2); }

#search-results {
  position: fixed;
  top: 48px;
  left: 252px;
  width: 260px;
  max-height: 300px;
  overflow-y: auto;
  background: rgba(12, 12, 18, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0 0 6px 6px;
  display: none;
  z-index: 110;
}
#search-results.visible { display: block; }

.search-item {
  padding: 7px 10px;
  cursor: pointer;
  font-size: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: background 0.15s;
}
.search-item:hover { background: rgba(255, 255, 255, 0.04); }
.search-item .addr {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.25);
}

#category-dropdown {
  position: relative;
}
#category-toggle {
  padding: 5px 10px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: #e2e8f0;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
#category-toggle .arrow {
  font-size: 10px;
  margin-left: 4px;
  opacity: 0.4;
}
#category-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  min-width: 200px;
  max-height: 320px;
  overflow-y: auto;
  background: rgba(12, 12, 18, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  z-index: 120;
}
#category-menu.open { display: block; }
.cat-item {
  padding: 7px 12px;
  font-size: 12px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  transition: background 0.12s;
}
.cat-item:hover { background: rgba(255, 255, 255, 0.05); }
.cat-item.active { color: #e2e8f0; background: rgba(255, 255, 255, 0.06); }
.cat-date {
  display: block;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.25);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 1px;
}

#period-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
  white-space: nowrap;
}

#stats-bar {
  margin-left: auto;
  display: flex;
  gap: 18px;
  font-size: 12px;
  white-space: nowrap;
}
.stat-item { display: flex; gap: 5px; align-items: center; }
.stat-label { color: rgba(255, 255, 255, 0.3); font-size: 11px; }
.stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  font-size: 12px;
}

/* === Sidebar === */
#sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 360px;
  height: 100vh;
  background: rgba(8, 8, 12, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid rgba(255, 255, 255, 0.04);
  z-index: 200;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  padding: 18px;
}
#sidebar.open { transform: translateX(0); }

#sidebar-close {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 22px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.3);
  transition: color 0.2s;
  line-height: 1;
}
#sidebar-close:hover { color: #e2e8f0; }

.sidebar-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 3px;
  padding-right: 28px;
}
.sidebar-addr {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.25);
  margin-bottom: 10px;
  word-break: break-all;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
  margin-right: 4px;
}
.badge-sniper { background: rgba(34, 197, 94, 0.12); color: #22c55e; }
.badge-victim { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
.badge-both { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }

.sidebar-stats {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}
.sidebar-stat-label { color: rgba(255, 255, 255, 0.3); font-size: 10px; font-family: 'Inter', sans-serif; text-transform: uppercase; letter-spacing: 0.05em; }
.sidebar-stat-value { font-weight: 500; }
.pnl-positive { color: #22c55e; }
.pnl-negative { color: #ef4444; }

.sidebar-links {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}
.sidebar-links a {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  text-decoration: none;
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  transition: all 0.2s;
}
.sidebar-links a:hover {
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.15);
}

.sidebar-section {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.25);
  margin: 16px 0 6px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.market-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 12px;
}
.market-row .q {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 8px;
  color: rgba(255, 255, 255, 0.5);
}
a.market-link {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.15s;
}
a.market-link:hover {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: underline;
}
.market-row .v {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  white-space: nowrap;
}

.counterparty-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 3px;
  font-size: 12px;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.15s;
}
.counterparty-row:hover { background: rgba(255, 255, 255, 0.04); }
.counterparty-row .name { color: rgba(255, 255, 255, 0.6); display: flex; align-items: center; gap: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; margin-right: 8px; }
.counterparty-row .flow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
}

.cp-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* === Tooltip === */
#tooltip {
  position: fixed;
  pointer-events: none;
  z-index: 300;
  padding: 8px 12px;
  background: rgba(12, 12, 18, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  font-size: 12px;
  max-width: 280px;
  display: none;
}
#tooltip.visible { display: block; }

.tooltip-name { font-weight: 600; margin-bottom: 2px; }
.tooltip-role { font-size: 10px; margin-bottom: 4px; }
.tooltip-stats {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.6);
}

/* === View switching === */
body[data-view="pack"] #graph-container { display: none; }
body[data-view="pack"] #arcs-container { display: none; }
body[data-view="pack"] #period-label { visibility: hidden; }
body[data-view="network"] #pack-container { display: none; }
body[data-view="network"] #arcs-container { display: none; }
body[data-view="network"] #breadcrumb { visibility: hidden; }
body[data-view="arcs"] #graph-container { display: none; }
body[data-view="arcs"] #pack-container { display: none; }
body[data-view="arcs"] #breadcrumb { visibility: hidden; }
body[data-view="arcs"] #period-label { visibility: hidden; }

/* === Galaxy container === */
#galaxy-container {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  background: #08080c;
  z-index: 1;
}

#reshape-btn {
  padding: 4px 10px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 4px;
  background: rgba(139, 92, 246, 0.1);
  color: rgba(200, 170, 255, 0.8);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  flex-shrink: 0;
}
#reshape-btn:hover {
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(139, 92, 246, 0.5);
  color: #d4bbff;
}
body[data-view="galaxy"] #reshape-btn { display: inline-block !important; }

body[data-view="galaxy"] #graph-container { display: none; }
body[data-view="galaxy"] #pack-container { display: none; }
body[data-view="galaxy"] #arcs-container { display: none; }
body[data-view="galaxy"] #breadcrumb { visibility: hidden; }
body[data-view="galaxy"] #period-label { visibility: hidden; }

body[data-view="pack"] #galaxy-container { display: none; }
body[data-view="network"] #galaxy-container { display: none; }
body[data-view="arcs"] #galaxy-container { display: none; }

/* === Arcs container === */
#arcs-container {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, #0c0c14 0%, #08080c 70%);
}
#arcs-container canvas {
  width: 100%;
  height: 100%;
}

/* === Pack container === */
#pack-container {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, #0c0c14 0%, #08080c 70%);
}
#pack-container svg {
  width: 100%;
  height: 100%;
}

/* === View toggle === */
#view-toggle {
  display: flex;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}
#view-toggle button {
  padding: 4px 10px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
#view-toggle button:not(:last-child) {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}
#view-toggle button.active {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.8);
}
#view-toggle button:hover:not(.active) {
  color: rgba(255, 255, 255, 0.55);
}

/* === Breadcrumb === */
#breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.3);
  white-space: nowrap;
  overflow: hidden;
  width: 200px;
  min-width: 200px;
  flex-shrink: 0;
}
.crumb {
  cursor: pointer;
  color: rgba(255, 255, 255, 0.4);
  transition: color 0.15s;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crumb:hover { color: rgba(255, 255, 255, 0.8); }
.crumb-sep { color: rgba(255, 255, 255, 0.15); font-size: 10px; }
.crumb-current {
  color: rgba(255, 255, 255, 0.6);
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* === Circle pack labels === */
.label-category {
  fill: rgba(255, 255, 255, 0.95);
  font-size: 14px;
  font-weight: 600;
  pointer-events: none;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.85);
  stroke-width: 4px;
  stroke-linejoin: round;
}
.label-market {
  fill: rgba(255, 255, 255, 0.45);
  font-size: 11px;
  font-weight: 500;
  pointer-events: none;
}
.label-wallet {
  fill: rgba(255, 255, 255, 0.5);
  font-size: 10px;
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
  pointer-events: none;
}

/* === Info panel (bottom-right) === */
#info-panel {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 50;
  background: rgba(12, 12, 16, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.6;
  backdrop-filter: blur(8px);
  pointer-events: none;
}
#info-panel .info-label {
  color: rgba(255, 255, 255, 0.3);
  margin-right: 4px;
}
#info-panel .info-value {
  color: rgba(255, 255, 255, 0.7);
}
#info-panel .info-row {
  white-space: nowrap;
}

/* === Mute button (galaxy audio) === */
#mute-btn {
  position: fixed;
  bottom: 16px;
  left: 56px;
  z-index: 60;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(12, 12, 16, 0.7);
  color: rgba(255, 255, 255, 0.5);
  font-size: 16px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.2s;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
}
#mute-btn:hover {
  background: rgba(30, 30, 40, 0.9);
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.25);
}
body[data-view="galaxy"] #mute-btn {
  display: flex;
}

/* === About button & modal === */
#about-btn {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 60;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(12, 12, 16, 0.7);
  color: rgba(255, 255, 255, 0.5);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
#about-btn:hover {
  background: rgba(30, 30, 40, 0.9);
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.25);
}
#about-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}
#about-overlay.visible {
  display: flex;
  opacity: 1;
}
#about-modal {
  position: relative;
  background: rgba(18, 18, 24, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 28px 32px;
  max-width: 520px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  line-height: 1.7;
}
#about-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 22px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
#about-close:hover {
  color: rgba(255, 255, 255, 0.8);
}
#about-modal h3 {
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 14px 0;
}
#about-modal h4 {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 600;
  margin: 16px 0 6px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
#about-modal p {
  margin: 0 0 10px 0;
}
#about-modal .about-legend {
  display: flex;
  gap: 16px;
  margin: 8px 0 12px;
  flex-wrap: wrap;
}
#about-modal .about-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
#about-modal .about-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
#about-modal .about-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 16px 0;
}

/* === Cross-market wallet highlight === */
@keyframes wallet-pulse {
  0%, 100% { stroke-opacity: 1; }
  50% { stroke-opacity: 0.3; }
}
.wallet-highlight {
  animation: wallet-pulse 1s ease-in-out infinite;
  stroke-width: 2.5px !important;
}

/* === Onboarding === */
#onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  transition: opacity 0.4s ease;
}
#onboarding-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* Blur everything behind */
body.onboarding #graph-container,
body.onboarding #pack-container,
body.onboarding #galaxy-container,
body.onboarding #toolbar {
  filter: blur(6px);
  pointer-events: none;
  transition: filter 0.4s ease;
}

/* Spotlight cutout — elevated above blur */
#onboard-spotlight {
  position: fixed;
  z-index: 510;
  border-radius: 6px;
  box-shadow: 0 0 0 9999px rgba(4, 4, 8, 0.75);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

/* Tip card */
#onboard-tip {
  position: fixed;
  z-index: 520;
  width: 260px;
  padding: 16px 18px;
  background: rgba(14, 14, 22, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

#onboard-tip::after {
  content: '';
  position: absolute;
  top: -6px;
  left: var(--arrow-left, 28px);
  width: 12px;
  height: 12px;
  background: rgba(14, 14, 22, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  transform: rotate(45deg);
  transition: left 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

#onboard-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

#onboard-body {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 14px;
}

#onboard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#onboard-dots {
  display: flex;
  gap: 6px;
}
.onboard-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  transition: background 0.2s;
}
.onboard-dot.active {
  background: rgba(255, 255, 255, 0.6);
}

#onboard-next {
  padding: 6px 16px;
  border: none;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
#onboard-next:hover {
  background: rgba(255, 255, 255, 0.18);
}

#onboard-skip {
  position: fixed;
  z-index: 520;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: color 0.2s;
  font-family: 'Inter', sans-serif;
}
#onboard-skip:hover { color: rgba(255, 255, 255, 0.5); }

/* === Mobile === */
@media (max-width: 768px) {
  /* Toolbar: wrap into rows */
  #toolbar {
    height: auto;
    flex-wrap: wrap;
    padding: 8px 12px;
    gap: 8px;
  }

  #title {
    font-size: 11px;
    order: 1;
  }

  /* View toggle: same row as title */
  #view-toggle {
    order: 2;
    margin-left: auto;
  }
  #view-toggle button {
    padding: 6px 12px;
    font-size: 12px;
    min-height: 32px;
  }

  /* Search: full width row */
  #search {
    order: 3;
    width: 100%;
    flex-shrink: 1;
    padding: 8px 12px;
    font-size: 14px;
  }

  /* Category dropdown: fill remaining space */
  #category-dropdown {
    order: 4;
    flex: 1;
  }
  #category-toggle {
    padding: 8px 12px;
    font-size: 13px;
  }
  #category-menu {
    min-width: 180px;
  }
  .cat-item {
    padding: 10px 12px;
    font-size: 13px;
  }

  /* Hide non-essential toolbar items */
  #breadcrumb,
  #period-label {
    display: none !important;
  }

  /* Stats: single row */
  #stats-bar {
    order: 5;
    width: 100%;
    margin-left: 0;
    gap: 10px;
    font-size: 10px;
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  .stat-label { font-size: 10px; }
  .stat-value { font-size: 11px; }

  /* Reshape button */
  #reshape-btn {
    order: 6;
    padding: 8px 14px;
    font-size: 13px;
  }

  /* Search results: full width under search */
  #search-results {
    left: 12px;
    right: 12px;
    width: auto;
    top: auto;
  }

  /* Sidebar: full width */
  #sidebar {
    width: 100%;
  }
  #sidebar-close {
    font-size: 28px;
    top: 12px;
    right: 16px;
    padding: 8px;
  }

  /* Info panel: hide on mobile */
  #info-panel {
    display: none;
  }

  /* External links: hide on mobile */
  #ext-links {
    display: none;
  }

  /* About button: larger touch target */
  #about-btn {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }

  /* About modal: tighter padding */
  #about-modal {
    padding: 20px 18px;
    width: 94%;
    max-height: 85vh;
  }

  /* Onboarding tip: constrain width */
  #onboard-tip {
    width: 240px;
    max-width: calc(100vw - 24px);
  }
}
