/* base.css — structural layout. NO colors, NO fonts except fallbacks. */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  padding: 24px 26px 50px;
  -webkit-font-smoothing: antialiased;
  font-family: "Inter", system-ui, sans-serif;
}

/* ── Outer wrapper ──────────────────────────────────────────────────────────── */
.sw-wrap {
  max-width: 1180px;
  margin: 0 auto;
}

/* ── Chrome (#sw-chrome) ───────────────────────────────────────────────────── */
#sw-chrome {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  position: relative;
  flex-wrap: nowrap;
}

/* ── Hero (#sw-hero) ───────────────────────────────────────────────────────── */
#sw-hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  grid-template-rows: auto auto;
  align-items: stretch;
  border-radius: 22px;
  overflow: hidden;
}

/* heroDiptych occupies left column row 1, verdict row spans both at row 2,
   depthAux is left col row 3, burnMeter is right col rows 1-3. */
.sw-hero-diptych {
  grid-column: 1;
  grid-row: 1;
}

.sw-hero-verdict-row {
  grid-column: 1 / -1;
  grid-row: 3;
}

.sw-depth-aux {
  grid-column: 1;
  grid-row: 2;
  padding: 0 24px 16px;
  overflow: visible;
}

.sw-aux-bar-outer {
  overflow: visible;
}

.sw-aux-viewport-frame {
  position: absolute;
  top: -4px;
  bottom: -4px;
  border: 2px solid rgba(238, 243, 246, 0.7);
  background: rgba(238, 243, 246, 0.04);
  border-radius: 4px;
  pointer-events: none;
  z-index: 2;
  box-shadow: 0 0 6px rgba(238, 243, 246, 0.3);
}

.sw-aux-bar-wrap {
  position: relative;
  height: 20px;
  border-radius: 5px;
  overflow: visible;
  border: 1px solid var(--edge, #252f37);
  font-family: "JetBrains Mono", monospace;
  font-size: 8px;
}

.sw-aux-gradient {
  position: absolute;
  top: 0; bottom: 0; left: 0; right: 0;
  border-radius: 4px;
}

.sw-aux-marker {
  position: absolute;
  top: -6px;
  bottom: -6px;
  width: 2px;
  background: #fff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
  transition: opacity 0.15s;
}

.sw-aux-marker::before {
  content: "";
  position: absolute;
  left: -4px;
  top: -4px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #fff;
}

.sw-aux-marker::after {
  content: "";
  position: absolute;
  left: -10px;
  right: -10px;
  top: -8px;
  bottom: -8px;
  cursor: pointer;
}

.sw-aux-flag {
  position: absolute;
  top: -27px;
  transform: translateX(-50%);
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  background: rgba(13, 18, 20, 0.95);
  border: 1px solid var(--amber-dim, #7a5a20);
  color: var(--amber, #ffc24d);
  border-radius: 5px;
  padding: 2px 7px;
  white-space: nowrap;
}

.sw-aux-flag b { color: #fff; }

.sw-aux-zone-label {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: "JetBrains Mono", monospace;
  font-size: 8px;
  pointer-events: none;
}

.sw-aux-label-ext-left {
  position: absolute;
  right: calc(100% + 4px);
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  font-family: "JetBrains Mono", monospace;
  font-size: 8px;
  color: var(--txt-dim, #93a1ab);
  letter-spacing: 0.02em;
}

.sw-aux-label-ext-right {
  position: absolute;
  left: calc(100% + 4px);
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  font-family: "JetBrains Mono", monospace;
  font-size: 8px;
  color: var(--coral, #ff7566);
  letter-spacing: 0.02em;
}

.sw-burn-meter {
  grid-column: 2;
  grid-row: 1 / 3;
}

/* ── Lower section (history + buckets side by side) ─────────────────────────── */
.sw-lower {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

#sw-history {
  min-width: 0;
}

#sw-history canvas {
  width: 100%;
}

#sw-buckets {
  min-width: 0;
}

/* Card container */
#sw-buckets .bucket-card {
  background: var(--card);
  border: 1px solid var(--edge);
  border-radius: 18px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  height: 360px;
}

/* ── Header: Donut + stats ─── */
#sw-buckets .bucket-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

#sw-buckets .header-donut {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  position: relative;
}

#sw-buckets .header-donut svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  transition: all 0.3s ease;
}

#sw-buckets .header-info h3 {
  font-family: "Sora", sans-serif;
  font-weight: 600;
  font-size: 14px;
  margin: 0;
  color: var(--txt);
}

#sw-buckets .header-info .subtitle {
  font-size: 10.5px;
  color: var(--mute);
  margin-top: 2px;
}

#sw-buckets .header-stats {
  margin-left: auto;
  text-align: right;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  line-height: 1.7;
}

#sw-buckets .header-stats .val-selected {
  color: var(--mint);
}

#sw-buckets .header-stats .val-discarded {
  color: var(--coral);
}

/* ── Section labels ─── */
#sw-buckets .section-label {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--txt-dim);
  margin: 10px 0 6px;
  padding-left: 2px;
}

#sw-buckets .section-label:first-of-type {
  margin-top: 0;
}

#sw-buckets .section-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  transition: transform 0.15s;
  transform: rotate(90deg);
}

#sw-buckets .section-chevron svg {
  width: 12px;
  height: 12px;
}

#sw-buckets .section-label.collapsed .section-chevron {
  transform: rotate(0deg);
}

#sw-buckets .section-summary {
  margin-left: auto;
  font-size: 9px;
  opacity: 0;
  transition: opacity 0.15s;
}

#sw-buckets .section-label.collapsed .section-summary {
  opacity: 1;
}

#sw-buckets .section-group.collapsed {
  display: none;
}

/* ── Tree rows ─── */
#sw-buckets .bucket-tree {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  line-height: 1;
}

#sw-buckets .bucket-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4.5px 4px;
  position: relative;
  border-radius: 4px;
  cursor: default;
  min-height: 24px;
}

#sw-buckets .bucket-row:hover {
  background: rgba(79, 224, 176, 0.04);
}

#sw-buckets .bucket-row.is-dir {
  cursor: pointer;
}

#sw-buckets .bucket-row.is-dir:hover {
  background: rgba(79, 224, 176, 0.06);
}

/* Indent guides */
#sw-buckets .bucket-row[data-indent="1"] { padding-left: 22px; }
#sw-buckets .bucket-row[data-indent="2"] { padding-left: 40px; }
#sw-buckets .bucket-row[data-indent="3"] { padding-left: 58px; }

#sw-buckets .bucket-row[data-indent="1"]::before,
#sw-buckets .bucket-row[data-indent="2"]::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--edge);
}

#sw-buckets .bucket-row[data-indent="2"]::after {
  content: "";
  position: absolute;
  left: 30px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--edge);
  opacity: 0.5;
}

/* Focus ring (a11y) */
#sw-buckets .bucket-row:focus-visible {
  outline: 1px solid var(--mint);
  outline-offset: -1px;
}

/* ── Checkbox ─── */
#sw-buckets .bucket-cb {
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--mute);
  border-radius: 3px;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
}

#sw-buckets .bucket-cb.checked {
  background: var(--mint);
  border-color: var(--mint);
}

#sw-buckets .bucket-cb.checked::after {
  content: "";
  position: absolute;
  top: 0.5px;
  left: 3px;
  width: 4px;
  height: 6.5px;
  border: solid #052018;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

#sw-buckets .bucket-cb.locked {
  background: var(--mute);
  border-color: var(--mute);
  cursor: default;
  opacity: 0.35;
}

/* Half-select (indeterminate) state for directories */
#sw-buckets .bucket-cb.half {
  background: linear-gradient(135deg, var(--mint) 50%, transparent 50%);
  border-color: var(--mint);
}

/* ── Expand toggle ─── */
#sw-buckets .bucket-expand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  transition: transform 0.15s;
  transform: rotate(90deg);
  color: var(--txt-dim);
}

#sw-buckets .bucket-expand svg {
  width: 12px;
  height: 12px;
}

#sw-buckets .bucket-expand.collapsed {
  transform: rotate(0deg);
}

/* ── Icon ─── */
#sw-buckets .bucket-icon {
  font-size: 10px;
  width: 14px;
  text-align: center;
  flex-shrink: 0;
}

/* ── Name wrap (flex item that shrinks; holds name + badge inline) ─── */
#sw-buckets .bucket-name-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

/* ── Name kind classes ─── */
#sw-buckets .bucket-name {
  color: var(--txt-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-bottom: 2px;
}

#sw-buckets .bucket-name.is-dir-name {
  color: var(--txt);
  font-weight: 500;
}

#sw-buckets .bucket-name.is-special {
  color: var(--amber);
}

#sw-buckets .bucket-name.is-system {
  color: var(--mute);
}

#sw-buckets .bucket-name.is-skill {
  color: var(--sky);
}

#sw-buckets .bucket-name.is-others {
  color: var(--mute);
  font-style: italic;
}

/* ── Call-count badge (iOS capsule style) ─── */
#sw-buckets .bucket-count {
  font-family: "JetBrains Mono", monospace;
  font-size: 8.5px;
  font-weight: 500;
  color: var(--amber);
  background: rgba(255, 194, 77, 0.12);
  border-radius: 100px;
  padding: 1px 5px;
  min-width: 16px;
  text-align: center;
  flex-shrink: 0;
  margin-left: 4px;
  line-height: 1.4;
}

/* ── Token count + bar ─── */
#sw-buckets .bucket-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

#sw-buckets .bucket-tokens {
  font-size: 10px;
  color: var(--txt-dim);
  white-space: nowrap;
  min-width: 32px;
  text-align: right;
}

#sw-buckets .bucket-bar-wrap {
  display: inline-block;
  width: 48px;
  height: 6px;
  border-radius: 3px;
  background: var(--edge);
  overflow: hidden;
  flex-shrink: 0;
  vertical-align: middle;
}

#sw-buckets .bucket-bar {
  display: block;
  height: 100%;
  border-radius: 3px;
  min-width: 3px;
  transition: width 0.3s ease;
}

#sw-buckets .bucket-bar.color-mint  { background: var(--mint); }
#sw-buckets .bucket-bar.color-amber { background: var(--amber); }
#sw-buckets .bucket-bar.color-coral { background: var(--coral); }
#sw-buckets .bucket-bar.color-mute  { background: var(--mute); }
#sw-buckets .bucket-bar.color-sky   { background: var(--sky); }

/* ── Churn tier: path name coloring ── */
#sw-buckets .bucket-name.churn-med  { color: var(--amber); }
#sw-buckets .bucket-name.churn-high { color: var(--coral); }
#sw-buckets .bucket-name.is-dir-name.churn-med  { color: var(--amber); opacity: 0.85; }
#sw-buckets .bucket-name.is-dir-name.churn-high { color: var(--coral); opacity: 0.85; }

/* ── Excluded rows ── */
#sw-buckets .bucket-row.is-excluded { opacity: 0.5; }
#sw-buckets .bucket-row.is-excluded .bucket-cb { border-style: dashed; }
#sw-buckets .bucket-row.is-excluded .bucket-name { font-style: italic; color: var(--mute); }

/* ── Section separator ─── */
#sw-buckets .bucket-sep {
  border: none;
  border-top: 1px dotted var(--edge);
  margin: 8px 0;
}

/* ── Dir children container ─── */
#sw-buckets .bucket-dir-children {
  /* display:none toggled by JS when collapsed */
}

/* Override indicator — wavy underline on filename */
#sw-buckets .bucket-name[data-override] {
  text-decoration: underline wavy;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  overflow: visible;
}
#sw-buckets .bucket-name[data-override="include"] {
  text-decoration-color: rgba(79, 224, 176, 0.4);
}
#sw-buckets .bucket-name[data-override="exclude"] {
  text-decoration-color: rgba(255, 117, 102, 0.4);
}

/* ── Footer ─── */
#sw-buckets .bucket-footer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dotted var(--edge);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  position: relative;
}

#sw-buckets .bucket-copy-btn {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  background: var(--mint);
  border: 1px solid var(--mint);
  border-radius: 8px;
  padding: 6px 12px;
  color: #052018;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

#sw-buckets .bucket-copy-btn:hover {
  opacity: 0.85;
}

#sw-buckets .bucket-copy-btn.copied {
  background: var(--mint-dim);
  border-color: var(--mint);
  color: var(--mint);
}

#sw-buckets .bucket-reset-btn {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--mute);
  border: 1px solid var(--edge);
  border-radius: 8px;
  padding: 6px 12px;
  background: none;
  cursor: pointer;
  transition: all 0.2s;
}

#sw-buckets .bucket-reset-btn.active {
  color: var(--txt-dim);
  border-color: var(--txt-dim);
}

#sw-buckets .bucket-apply-btn {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  background: var(--mint);
  border: 1px solid var(--mint);
  border-radius: 8px;
  padding: 6px 12px;
  color: #052018;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

#sw-buckets .bucket-apply-btn:hover:not(:disabled) {
  opacity: 0.85;
}

#sw-buckets .bucket-apply-btn:disabled {
  display: none;
}

#sw-buckets .bucket-apply-notice {
  position: absolute;
  left: 0;
  bottom: calc(100% + 4px);
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  color: var(--amber);
  white-space: nowrap;
}

/* ── Copy overlay ─── */
#sw-buckets .bucket-copy-overlay {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background: rgba(23, 30, 35, 0.96);
  border: 1px solid var(--edge);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 20px;
  z-index: 10;
}

#sw-buckets .bucket-copy-overlay textarea {
  flex: 1;
  background: var(--card2);
  border: 1px solid var(--edge);
  border-radius: 8px;
  color: var(--txt-dim);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  line-height: 1.6;
  padding: 10px 12px;
  resize: none;
  outline: none;
}

#sw-buckets .bucket-copy-overlay-dismiss {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--txt-dim);
  border: 1px solid var(--edge);
  border-radius: 8px;
  padding: 6px 12px;
  background: none;
  cursor: pointer;
  align-self: flex-end;
  transition: all 0.2s;
}

#sw-buckets .bucket-copy-overlay-dismiss:hover {
  border-color: var(--mint-dim);
  color: var(--txt);
}

/* ── Loading States ─── */

/* State 1: skeleton shimmer */
@keyframes sw-shimmer {
  0%   { background-position: -380px center; }
  100% { background-position: 380px center; }
}

#sw-buckets .skel {
  background: linear-gradient(
    90deg,
    var(--edge)                0%,
    rgba(255,255,255,0.045)   42%,
    rgba(79, 224, 176, 0.09)  50%,
    rgba(255,255,255,0.045)   58%,
    var(--edge)               100%
  );
  background-size: 380px 100%;
  animation: sw-shimmer 1.9s ease-in-out infinite;
  border-radius: 3px;
  display: inline-block;
}

/* Indeterminate donut spin */
@keyframes sw-donut-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes sw-track-breathe {
  0%, 100% { opacity: 0.20; }
  50%       { opacity: 0.40; }
}

#sw-buckets .donut-spin-arc {
  transform-origin: 18px 18px;
  animation: sw-donut-spin 1.6s linear infinite;
}

#sw-buckets .donut-track-breathe {
  animation: sw-track-breathe 2.4s ease-in-out infinite;
}

/* Skeleton row geometry */
#sw-buckets .skel-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4.5px 4px;
  min-height: 24px;
}

#sw-buckets .skel-cb      { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
#sw-buckets .skel-icon    { width: 14px; height: 9px;  border-radius: 2px; flex-shrink: 0; }
#sw-buckets .skel-expand  { width: 10px; height: 8px;  border-radius: 2px; flex-shrink: 0; }
#sw-buckets .skel-name    { height: 9px; flex: 1; }
#sw-buckets .skel-tokens  { width: 28px; height: 9px;  border-radius: 3px; flex-shrink: 0; }
#sw-buckets .skel-barwrap { width: 48px; height: 6px;  border-radius: 3px; flex-shrink: 0; }

/* Dimmed section labels during skeleton */
#sw-buckets .section-label.skel-label { opacity: 0.38; }

/* Skeleton indent connector */
#sw-buckets .skel-row.indent-1 {
  padding-left: 22px;
  position: relative;
}
#sw-buckets .skel-row.indent-1::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--edge);
}

/* State 2a: syncing sweep line */
@keyframes sw-sweep {
  0%   { left: -65%; width: 55%; }
  100% { left: 110%; width: 55%; }
}

#sw-buckets .sync-sweep-track {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 18px 18px 0 0;
  background: transparent;
  overflow: hidden;
  z-index: 2;
}

#sw-buckets .sync-sweep-track::after {
  content: "";
  position: absolute;
  top: 0;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--mint)  25%,
    var(--sky)   75%,
    transparent 100%
  );
  animation: sw-sweep 1.7s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

/* Syncing donut dim */
#sw-buckets .donut-syncing {
  opacity: 0.55;
  transition: opacity 0.4s;
}

/* Status chips (syncing + stale) */
#sw-buckets .panel-status-bar {
  margin: -6px 0 10px;
  display: flex;
  align-items: center;
}

#sw-buckets .status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.05em;
  border-radius: 100px;
  padding: 3px 9px 3px 7px;
  white-space: nowrap;
  flex-shrink: 0;
}

#sw-buckets .status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Syncing chip — sky-tinted */
#sw-buckets .status-chip.chip-syncing {
  background: rgba(108, 198, 240, 0.09);
  border: 1px solid rgba(108, 198, 240, 0.22);
  color: var(--sky);
}
#sw-buckets .status-chip.chip-syncing .status-dot {
  background: var(--sky);
}

@keyframes sw-dot-pulse {
  0%, 100% { opacity: 1;   transform: scale(1);   }
  50%       { opacity: 0.3; transform: scale(0.65); }
}

#sw-buckets .status-chip.chip-syncing .status-dot {
  animation: sw-dot-pulse 1.1s ease-in-out infinite;
}

/* Stale chip — amber-tinted */
#sw-buckets .status-chip.chip-stale {
  background: rgba(255, 194, 77, 0.07);
  border: 1px solid rgba(255, 194, 77, 0.22);
  color: var(--amber);
}
#sw-buckets .status-chip.chip-stale .status-dot {
  background: var(--amber);
}

@keyframes sw-stale-pulse {
  0%, 100% { opacity: 0.9; }
  50%       { opacity: 0.25; }
}

#sw-buckets .status-chip.chip-stale .status-dot {
  animation: sw-stale-pulse 2.2s ease-in-out infinite;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  #sw-buckets .skel { animation: none; background: var(--edge); }
  #sw-buckets .donut-spin-arc { animation: none; }
  #sw-buckets .donut-track-breathe { animation: none; }
  #sw-buckets .sync-sweep-track::after { animation: none; opacity: 0.6; left: 0; width: 100%; }
  #sw-buckets .status-chip.chip-syncing .status-dot,
  #sw-buckets .status-chip.chip-stale   .status-dot { animation: none; }
}

/* ── History hover line ─── */
.sw-history-hoverline {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px dashed var(--sky);
  pointer-events: none;
  z-index: 2;
}

.sw-history-hoverline-tag {
  font: 9px/1 "JetBrains Mono", monospace;
  color: var(--sky);
  position: absolute;
  top: 4px;
  left: 4px;
  white-space: nowrap;
  pointer-events: none;
}

/* ── Terms (#sw-terms) ─────────────────────────────────────────────────────── */
#sw-terms {
  margin-top: 16px;
}

/* ── History chart crosshair overlay (spec §6.2) ────────────────────────────── */
.sw-history-container {
  position: relative;
}

.sw-history-crosshair {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  pointer-events: none;
}

.sw-crosshair-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(238, 243, 246, 0.4);
}

.sw-crosshair-label {
  position: absolute;
  padding: 2px 6px;
  font-size: 10px;
  font-family: "JetBrains Mono", monospace;
  background: rgba(10, 26, 24, 0.85);
  border: 1px solid rgba(238, 243, 246, 0.2);
  border-radius: 3px;
  white-space: nowrap;
  color: #eef3f6;
}

/* ── Pricing preset select ─────────────────────────────────────────────────── */
.sw-pricing-preset-row {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px dotted var(--edge, #252f37);
}

.sw-pricing-preset-row label {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--mute, #5a6a75);
  margin-bottom: 5px;
}

.sw-pricing-preset-select {
  width: 100%;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--txt, #eef3f6);
  background: #0d1214;
  border: 1px solid var(--edge, #252f37);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' fill='none' stroke='%2393a1ab' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.sw-pricing-preset-select:focus {
  border-color: var(--mint-dim, #2a5f4e);
}

/* ── Theme switcher ─────────────────────────────────────────────────────────── */
.sw-theme-wrapper {
  position: relative;
}

.sw-theme-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(238, 243, 246, 0.3);
  cursor: pointer;
  padding: 0;
}

.sw-theme-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border-radius: 8px;
  background: var(--card-bg, rgba(10, 26, 24, 0.95));
  border: 1px solid rgba(238, 243, 246, 0.15);
  z-index: 100;
  min-width: 100px;
}

.sw-theme-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 4px;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.sw-theme-row:hover {
  background: rgba(238, 243, 246, 0.08);
}

.sw-theme-swatches {
  display: flex;
  gap: 3px;
}

.sw-theme-swatches span {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.sw-theme-letter {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  opacity: 0.7;
}

/* Dual-landmarks group pill in topbar */
.sw-hero-group-pill {
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: 8px;
  margin-right: 6px;
  vertical-align: middle;
}
.sw-hero-group-pill.pill-amber {
  background: rgba(255, 194, 77, 0.15);
  color: var(--amber, #ffc24d);
}
.sw-hero-group-pill.pill-mint {
  background: rgba(79, 224, 176, 0.15);
  color: var(--mint, #4fe0b0);
}

/* ── Structured path tooltip (appended to body, position: fixed) ── */
.sw-bucket-tip {
  display: none;
  position: fixed;
  z-index: 9999;
  background: var(--card, #1a2233);
  border: 1px solid var(--edge, #252f37);
  border-radius: 8px;
  padding: 8px 10px;
  min-width: 180px;
  font-size: 10px;
  font-family: "JetBrains Mono", monospace;
  color: var(--txt-dim, #93a1ab);
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.sw-bucket-tip .tooltip-row { margin-bottom: 2px; }
.sw-bucket-tip .tooltip-eff {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.sw-bucket-tip .tooltip-eff-bar {
  flex: 1;
  height: 4px;
  background: var(--edge, #252f37);
  border-radius: 2px;
  overflow: hidden;
}
.sw-bucket-tip .tooltip-eff-fill {
  display: block;
  height: 100%;
  border-radius: 2px;
}
.sw-bucket-tip .tooltip-eff-fill.color-mint  { background: var(--mint, #4fe0b0); }
.sw-bucket-tip .tooltip-eff-fill.color-amber { background: var(--amber, #ffc24d); }
.sw-bucket-tip .tooltip-eff-fill.color-coral { background: var(--coral, #ff7566); }
.sw-bucket-tip .tooltip-excluded {
  color: var(--mute, #5a6a78);
  margin-bottom: 4px;
  font-weight: 600;
}
.sw-bucket-tip .tooltip-excluded .reason {
  font-weight: 400;
  color: var(--mute, #5a6a78);
  margin-left: 6px;
}
