:root {
  --bg: #07100e;
  --bg-soft: #0b1714;
  --panel: rgba(12, 27, 23, 0.88);
  --panel-solid: #0c1b17;
  --line: rgba(179, 230, 210, 0.14);
  --line-strong: rgba(179, 230, 210, 0.26);
  --text: #ecf7f2;
  --muted: #8da99e;
  --muted-strong: #b8cdc5;
  --acid: #c7f36a;
  --teal: #43d9a3;
  --active: #26cfa0;
  --cooling: #a6cc4a;
  --dormant: #d99542;
  --abandoned: #5d6764;
  --danger: #f0816a;
  --font-sans: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-floor: 10px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    linear-gradient(rgba(132, 188, 163, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(132, 188, 163, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 70% 12%, rgba(58, 160, 121, 0.12), transparent 36%),
    var(--bg);
  background-size: 38px 38px, 38px 38px, auto, auto;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
a,
select,
input[type="range"] {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  color: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(90px);
  pointer-events: none;
}

.ambient-one {
  top: -180px;
  right: 8vw;
  width: 520px;
  height: 520px;
  background: rgba(48, 183, 132, 0.1);
}

.ambient-two {
  bottom: -240px;
  left: -160px;
  width: 560px;
  height: 560px;
  background: rgba(192, 239, 100, 0.055);
}

.setup-view {
  width: min(1480px, calc(100% - 48px));
  min-height: 100vh;
  margin: 0 auto;
}

.setup-nav,
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand strong {
  color: var(--acid);
  font-weight: 700;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 29px;
  height: 29px;
  padding: 5px;
  overflow: hidden;
  border: 1px solid rgba(199, 243, 106, 0.42);
  border-radius: 7px;
  background: rgba(199, 243, 106, 0.08);
}

.brand-mark span {
  position: absolute;
  width: 9px;
  height: 7px;
  border: 1px solid var(--acid);
  background: rgba(199, 243, 106, 0.12);
}

.brand-mark span:nth-child(1) { top: 5px; left: 5px; width: 17px; }
.brand-mark span:nth-child(2) { bottom: 5px; left: 5px; }
.brand-mark span:nth-child(3) { right: 5px; bottom: 5px; width: 6px; }

.privacy-pill,
.dataset-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-strong);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 14px rgba(67, 217, 163, 0.8);
}

.hero {
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(480px, 1.1fr);
  gap: clamp(48px, 7vw, 110px);
  align-items: center;
  min-height: calc(100vh - 176px);
  padding: 66px 4vw 72px;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 650px;
}

.eyebrow,
.panel-kicker,
.tooltip-kicker {
  color: var(--teal);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 22px;
}

.eyebrow span {
  color: var(--acid);
}

.eyebrow::after {
  width: 58px;
  height: 1px;
  content: "";
  background: rgba(67, 217, 163, 0.35);
}

.hero h1 {
  margin: 0;
  font-size: clamp(54px, 6vw, 90px);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.hero h1 em {
  color: var(--acid);
  font-style: normal;
  font-weight: 500;
}

.hero-lede {
  max-width: 600px;
  margin: 29px 0 34px;
  color: var(--muted-strong);
  font-size: 17px;
  line-height: 1.65;
}

.import-card {
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(20, 41, 34, 0.85), rgba(8, 19, 16, 0.78));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
}

.import-card > label {
  display: block;
  margin-bottom: 9px;
  color: var(--muted-strong);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.input-row {
  display: flex;
  gap: 9px;
}

.input-row input {
  min-width: 0;
  flex: 1;
  height: 50px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: none;
  color: var(--text);
  background: rgba(2, 11, 9, 0.65);
  font-family: var(--font-mono);
  font-size: 12px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.input-row input:focus {
  border-color: rgba(199, 243, 106, 0.65);
  box-shadow: 0 0 0 3px rgba(199, 243, 106, 0.08);
}

.input-row input::placeholder,
.search-box input::placeholder {
  color: #60756d;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-width: 176px;
  height: 50px;
  padding: 0 18px;
  border: 1px solid var(--acid);
  border-radius: 8px;
  color: #14200e;
  background: var(--acid);
  font-size: 12px;
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button:hover {
  transform: translateY(-1px);
  background: #d5ff7c;
  box-shadow: 0 10px 30px rgba(199, 243, 106, 0.15);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.import-meta {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 11px;
  color: var(--muted);
  font-size: 10px;
}

.import-meta a {
  color: var(--acid);
  text-decoration: none;
}

.form-error {
  min-height: 0;
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 11px;
}

.form-error:empty {
  display: none;
}

.loading-state {
  margin-top: 14px;
}

.loading-track {
  height: 3px;
  overflow: hidden;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.07);
}

.loading-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--acid));
  transition: width 240ms ease;
}

.loading-copy {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--font-floor);
  text-transform: uppercase;
}

.demo-button {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin-top: 16px;
  padding: 9px 0;
  border: 0;
  color: var(--muted-strong);
  background: transparent;
  font-size: 12px;
}

.demo-button:hover {
  color: var(--text);
}

.demo-icon {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--acid);
  font-size: var(--font-floor);
}

.demo-note {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--font-floor);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-visual {
  position: relative;
  width: 100%;
  max-width: 760px;
  aspect-ratio: 1.16;
  justify-self: center;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(5, 15, 12, 0.7);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.32);
}

.hero-visual::before,
.hero-visual::after {
  position: absolute;
  width: 17px;
  height: 17px;
  content: "";
}

.hero-visual::before {
  top: -1px;
  left: -1px;
  border-top: 1px solid var(--acid);
  border-left: 1px solid var(--acid);
}

.hero-visual::after {
  right: -1px;
  bottom: -1px;
  border-right: 1px solid var(--acid);
  border-bottom: 1px solid var(--acid);
}

.scan-label {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--font-floor);
  letter-spacing: 0.12em;
}

.scan-label span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 8px var(--acid);
}

.scan-label-top { top: 14px; left: 36px; }

.preview-map {
  position: relative;
  display: grid;
  grid-template-columns: 1.4fr 0.75fr 0.95fr;
  grid-template-rows: 1.2fr 0.85fr 0.65fr;
  gap: 4px;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.preview-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
  padding: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #184b3b;
}

.preview-tile::before {
  position: absolute;
  inset: 0;
  content: "";
  opacity: 0.3;
  background: linear-gradient(130deg, rgba(255, 255, 255, 0.12), transparent 45%);
}

.preview-tile b,
.preview-tile small {
  position: relative;
  z-index: 1;
}

.preview-tile b {
  font-size: clamp(13px, 1.4vw, 22px);
  letter-spacing: -0.035em;
}

.preview-tile small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.66);
  font-family: var(--font-mono);
  font-size: var(--font-floor);
  text-transform: uppercase;
}

.tile-a { grid-row: span 2; background: #185544; }
.tile-b { grid-column: span 2; background: #2f6c45; }
.tile-c { background: #474f4d; }
.tile-d { grid-row: span 2; background: #1e7054; }
.tile-e { background: #718235; }
.tile-f { background: #8d6131; }

.scan-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 61%;
  z-index: 5;
  width: 1px;
  background: linear-gradient(transparent, var(--acid) 18%, var(--acid) 82%, transparent);
  box-shadow: 0 0 14px rgba(199, 243, 106, 0.6);
  animation: scan 4.5s ease-in-out infinite alternate;
}

@keyframes scan {
  from { transform: translateX(-220px); opacity: 0.4; }
  to { transform: translateX(130px); opacity: 0.9; }
}

.preview-tooltip {
  position: absolute;
  top: 33%;
  right: -25px;
  z-index: 8;
  width: 196px;
  padding: 15px;
  border: 1px solid rgba(199, 243, 106, 0.36);
  border-radius: 6px;
  background: rgba(5, 17, 14, 0.94);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.36);
}

.preview-tooltip > strong {
  display: block;
  margin: 5px 0 10px;
  font-size: 17px;
}

.preview-tooltip > div {
  display: flex;
  justify-content: space-between;
  padding-top: 6px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--font-floor);
}

.preview-tooltip > div b {
  color: var(--text);
  font-weight: 500;
}

.visual-caption {
  position: absolute;
  right: 36px;
  bottom: 13px;
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--font-floor);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}

.trust-strip > div {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  min-height: 97px;
  padding: 22px 26px;
  border-right: 1px solid var(--line);
}

.trust-strip > div:last-child { border-right: 0; }

.trust-number {
  color: var(--teal);
  font-family: var(--font-mono);
  font-size: var(--font-floor);
}

.trust-strip p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.trust-strip strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 11px;
}

.setup-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 4vw 30px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--font-floor);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.setup-footer a,
.map-footer a {
  color: var(--muted-strong);
  text-decoration: none;
}

.setup-footer a:hover,
.setup-footer a:focus-visible,
.map-footer a:hover,
.map-footer a:focus-visible {
  color: var(--acid);
  outline: none;
}

/* Application */
.app-view {
  display: flex;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  flex-direction: column;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 286px minmax(260px, 520px) 286px;
  gap: 28px;
  min-height: 66px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 15, 13, 0.88);
  backdrop-filter: blur(20px);
}

.header-search-wrap {
  position: relative;
  width: 100%;
  justify-self: center;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: rgba(1, 9, 7, 0.42);
}

.search-box:focus-within {
  border-color: rgba(199, 243, 106, 0.44);
}

.search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 11px;
}

.search-box kbd {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--muted);
  background: var(--bg-soft);
  font-family: var(--font-mono);
  font-size: var(--font-floor);
}

.search-results {
  position: absolute;
  top: 44px;
  right: 0;
  left: 0;
  z-index: 50;
  max-height: 340px;
  padding: 6px;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #0a1713;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.search-result {
  display: block;
  width: 100%;
  padding: 10px 11px;
  border: 0;
  border-radius: 5px;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.search-result:hover,
.search-result:focus {
  outline: none;
  background: rgba(199, 243, 106, 0.08);
}

.search-result strong {
  display: block;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result small {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--font-floor);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 13px;
}

.icon-button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted-strong);
  background: transparent;
}

.icon-button:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.app-shell {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  flex: 1;
}

.control-panel {
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(143, 166, 156, 0.62) transparent;
  scrollbar-width: thin;
  border-right: 1px solid var(--line);
  background: rgba(8, 20, 16, 0.5);
}

.control-panel::-webkit-scrollbar {
  width: 9px;
}

.control-panel::-webkit-scrollbar-track {
  background: transparent;
}

.control-panel::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(143, 166, 156, 0.62);
  background-clip: padding-box;
}

.control-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(184, 205, 196, 0.78);
  background-clip: padding-box;
}

.panel-section {
  min-width: 0;
  padding: 22px 22px 24px;
  border-bottom: 1px solid var(--line);
}

.panel-kicker {
  margin: 0 0 12px;
}

.account-score {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.account-score > span {
  font-size: 38px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.06em;
}

.account-score small {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--font-floor);
  text-transform: uppercase;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.summary-grid > div {
  min-width: 0;
  padding: 11px 8px;
}

.summary-grid > div:not(:last-child) {
  border-right: 1px solid var(--line);
}

.summary-grid strong,
.summary-grid span {
  display: block;
}

.summary-grid strong {
  color: var(--acid);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.1;
}

.summary-grid span {
  margin-top: 2px;
  color: var(--muted);
  font-size: var(--font-floor);
}

.preset-grid {
  display: grid;
  gap: 6px;
}

.preset-button {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted-strong);
  background: rgba(4, 14, 11, 0.4);
  text-align: left;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}

.preset-button:hover,
.preset-button:focus-visible {
  border-color: var(--line-strong);
  color: var(--text);
  outline: none;
}

.preset-button.is-active {
  border-color: rgba(199, 243, 106, 0.52);
  color: var(--text);
  background: rgba(199, 243, 106, 0.09);
}

.preset-button strong {
  font-size: 10px;
  font-weight: 700;
}

.preset-button span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--font-floor);
  white-space: nowrap;
}

.preset-description {
  margin: 13px 0 0;
  color: var(--muted-strong);
  font-size: var(--font-floor);
  line-height: 1.55;
}

.saved-findings-section {
  background: rgba(199, 243, 106, 0.018);
}

.saved-findings-empty {
  margin: 0;
  color: var(--muted);
  font-size: var(--font-floor);
  line-height: 1.5;
}

.saved-findings {
  display: grid;
  min-width: 0;
  max-width: 100%;
  gap: 7px;
}

.saved-finding {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(4, 14, 11, 0.46);
}

.saved-finding-heading {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.saved-finding-heading strong {
  display: block;
  min-width: 0;
  max-width: 100%;
  flex: 1 1 auto;
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-finding-remove {
  flex: 0 0 auto;
  padding: 0 2px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 16px;
  line-height: 1;
}

.saved-finding > small {
  display: block;
  max-width: 100%;
  margin: 3px 0 8px;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--font-floor);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-finding textarea {
  width: 100%;
  min-height: 48px;
  padding: 7px 8px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 5px;
  outline: none;
  color: var(--text);
  background: rgba(2, 10, 8, 0.55);
  font: inherit;
  font-size: 10px;
  line-height: 1.4;
}

.saved-finding textarea:focus { border-color: rgba(199, 243, 106, 0.48); }

.saved-finding > a {
  display: inline-block;
  margin-top: 7px;
  color: var(--acid);
  font-family: var(--font-mono);
  font-size: var(--font-floor);
  text-decoration: none;
  text-transform: uppercase;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 17px;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.section-heading small {
  color: var(--teal);
  font-family: var(--font-mono);
  font-size: var(--font-floor);
  letter-spacing: 0.1em;
}

.section-heading button {
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-family: var(--font-mono);
  font-size: var(--font-floor);
  text-transform: uppercase;
}

.section-heading button:hover { color: var(--acid); }

.panel-section details > summary.section-heading {
  margin: 0;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.panel-section details > summary.section-heading::-webkit-details-marker {
  display: none;
}

.panel-section details > summary.section-heading:focus {
  outline: none;
}

.panel-section details > summary.section-heading:focus-visible {
  border-radius: 3px;
  outline: 1px solid rgba(199, 243, 106, 0.35);
  outline-offset: 5px;
}

.panel-section details > summary.section-heading::after {
  width: 15px;
  margin-left: 8px;
  color: var(--muted);
  content: "+";
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  text-align: right;
}

.panel-section details[open] > summary.section-heading {
  margin-bottom: 17px;
}

.panel-section details[open] > summary.section-heading::after {
  content: "−";
}

.panel-section details > summary.section-heading small {
  margin-left: auto;
}

.panel-section details:not([open]) > summary.section-heading small {
  display: none;
}

.collapsible-content {
  min-width: 0;
}

.section-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--font-floor);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.section-action-row button {
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font: inherit;
  text-transform: uppercase;
}

.section-action-row button:hover:not(:disabled) { color: var(--acid); }
.section-action-row button:disabled { opacity: 0.35; }

.visibility-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  background: rgba(4, 14, 11, 0.4);
}

.visibility-toggle > span {
  min-width: 0;
}

.visibility-toggle strong,
.visibility-toggle small {
  display: block;
}

.visibility-toggle strong {
  color: var(--text);
  font-size: 10px;
}

.visibility-toggle small {
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--font-floor);
}

.visibility-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.visibility-toggle > i {
  position: relative;
  flex: 0 0 auto;
  width: 31px;
  height: 17px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  transition: border-color 150ms ease, background 150ms ease;
}

.visibility-toggle > i::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  content: "";
  background: var(--muted);
  transition: transform 150ms ease, background 150ms ease;
}

.visibility-toggle input:checked + i {
  border-color: rgba(199, 243, 106, 0.5);
  background: rgba(199, 243, 106, 0.13);
}

.visibility-toggle input:checked + i::after {
  transform: translateX(14px);
  background: var(--acid);
}

.visibility-toggle:focus-within {
  border-color: rgba(199, 243, 106, 0.48);
  outline: 1px solid rgba(199, 243, 106, 0.18);
}

.select-label {
  display: block;
  margin: 12px 0 6px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--font-floor);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

select {
  appearance: none;
  width: 100%;
  height: 37px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  color: var(--text);
  background-color: #0a1713;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23dfece5' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 10px 6px;
  font-size: 10px;
}

select:focus { border-color: rgba(199, 243, 106, 0.46); }

.thresholds-section label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  color: var(--muted-strong);
  font-size: var(--font-floor);
}

.thresholds-section label span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.thresholds-section output {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--font-floor);
}

.legend-swatch {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 2px;
}

.legend-swatch.active { background: var(--active); }
.legend-swatch.cooling { background: var(--cooling); }
.legend-swatch.dormant { background: var(--dormant); }
.legend-swatch.abandoned { background: var(--abandoned); }

input[type="range"] {
  width: 100%;
  height: 12px;
  margin: 5px 0 1px;
  appearance: none;
  background: transparent;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  background: rgba(255, 255, 255, 0.14);
}

input[type="range"]::-webkit-slider-thumb {
  width: 11px;
  height: 11px;
  margin-top: -4px;
  appearance: none;
  border: 2px solid var(--bg-soft);
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 0 1px rgba(199, 243, 106, 0.4);
}

.thresholds-section > p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: var(--font-floor);
  line-height: 1.5;
}

.account-data-controls > p {
  margin: 0 0 13px;
  color: var(--muted-strong);
  font-size: 10px;
  line-height: 1.55;
}

.clear-account-button {
  width: 100%;
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid rgba(240, 129, 106, 0.42);
  border-radius: 5px;
  color: #ffb09f;
  background: rgba(240, 129, 106, 0.07);
  font-family: var(--font-mono);
  font-size: var(--font-floor);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.clear-account-button:hover,
.clear-account-button:focus-visible {
  border-color: rgba(240, 129, 106, 0.78);
  outline: none;
  color: #ffd1c7;
  background: rgba(240, 129, 106, 0.13);
}

.map-panel {
  display: flex;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  flex-direction: column;
  padding: 25px 28px 13px;
}

.map-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
}

.breadcrumbs {
  display: flex;
  gap: 4px;
  align-items: center;
  min-height: 22px;
  margin-bottom: 5px;
  overflow: auto;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--font-floor);
  white-space: nowrap;
}

.breadcrumb-button,
.breadcrumb-current {
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
}

.breadcrumb-button:hover { color: var(--acid); }

.breadcrumb-current { color: var(--muted-strong); }

.breadcrumb-separator { color: #43554e; }

.view-headline {
  display: flex;
  align-items: baseline;
  gap: clamp(20px, 3vw, 48px);
}

.map-toolbar h1 {
  margin: 0;
  font-size: clamp(26px, 3vw, 42px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.05em;
}

.map-toolbar .view-total {
  display: flex;
  align-items: baseline;
  gap: clamp(10px, 1.4vw, 20px);
  min-height: clamp(51px, 6vw, 88px);
  font-size: inherit;
  letter-spacing: 0;
}

.view-note-count {
  display: inline-flex;
  overflow: hidden;
  font-size: clamp(46px, 6.6vw, 94px);
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  line-height: 0.94;
  letter-spacing: -0.075em;
}

.view-total > small {
  color: var(--acid);
  font-family: var(--font-mono);
  font-size: clamp(10px, 1.05vw, 14px);
  font-weight: 600;
  letter-spacing: 0.14em;
}

.account-share {
  display: flex;
  align-items: baseline;
  gap: clamp(8px, 1vw, 14px);
  padding-left: clamp(18px, 2vw, 30px);
  border-left: 1px solid var(--line-strong);
  white-space: nowrap;
}

.account-share strong {
  color: var(--text);
  font-size: clamp(30px, 3.6vw, 54px);
  font-weight: 560;
  font-variant-numeric: tabular-nums;
  line-height: 0.94;
  letter-spacing: -0.065em;
}

.account-share > span {
  color: var(--acid);
  font-family: var(--font-mono);
  font-size: clamp(10px, 0.9vw, 12px);
  font-weight: 600;
  letter-spacing: 0.11em;
}

.count-reel {
  position: relative;
  display: inline-grid;
  width: 0.58em;
  height: 0.96em;
  overflow: hidden;
  place-items: center;
}

.count-separator {
  width: 0.3em;
  color: color-mix(in srgb, var(--text) 70%, var(--muted));
}

.account-share .count-separator {
  color: inherit;
}

.count-reel.is-changing .count-old,
.count-reel.is-changing .count-new {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.count-reel.is-changing::before {
  content: "0";
  visibility: hidden;
}

.count-reel.is-changing .count-old {
  animation: count-old-out 460ms cubic-bezier(0.2, 0.75, 0.25, 1) var(--reel-delay) both;
}

.count-reel.is-changing .count-new {
  animation: count-new-in 460ms cubic-bezier(0.2, 0.75, 0.25, 1) var(--reel-delay) both;
}

@keyframes count-old-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(105%); }
}

@keyframes count-new-in {
  from { opacity: 0; transform: translateY(-105%); }
  to { opacity: 1; transform: translateY(0); }
}

.map-toolbar p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.map-actions {
  display: flex;
  gap: 7px;
  padding-bottom: 2px;
}

.secondary-button {
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted-strong);
  background: rgba(12, 27, 23, 0.58);
  font-size: var(--font-floor);
}

.secondary-button:hover:not(:disabled) {
  border-color: var(--line-strong);
  color: var(--text);
}

.secondary-button:disabled {
  cursor: default;
  opacity: 0.38;
}

.legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 51px;
}

.activity-legend {
  display: flex;
  gap: 15px;
  align-items: center;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.legend-item {
  display: flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}

.legend-item i {
  width: 11px;
  height: 5px;
  border-radius: 1px;
}

.map-hint {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
}

.branch-end-icon {
  display: inline-grid;
  width: 15px;
  height: 15px;
  margin-right: 3px;
  place-items: center;
  border: 1px solid rgba(199, 243, 106, 0.32);
  border-radius: 3px;
  color: var(--acid);
}

.treemap-wrap {
  position: relative;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(rgba(135, 182, 164, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(135, 182, 164, 0.028) 1px, transparent 1px),
    rgba(5, 14, 11, 0.62);
  background-size: 24px 24px;
}

#treemap {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.terminal-tree {
  position: absolute;
  inset: 0;
  padding: clamp(20px, 2vw, 28px) clamp(24px, 4vw, 54px) clamp(24px, 4vw, 54px);
  overflow: auto;
  scrollbar-color: rgba(143, 166, 156, 0.62) transparent;
  scrollbar-width: thin;
  background:
    radial-gradient(circle at 78% 9%, rgba(199, 243, 106, 0.045), transparent 28%),
    linear-gradient(135deg, rgba(16, 36, 30, 0.38), rgba(4, 13, 10, 0.16));
}

.terminal-tree::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

.terminal-tree::-webkit-scrollbar-track {
  background: transparent;
}

.terminal-tree::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(143, 166, 156, 0.62);
  background-clip: padding-box;
}

.terminal-tree::-webkit-scrollbar-thumb:hover {
  background: rgba(184, 205, 196, 0.78);
  background-clip: padding-box;
}

.terminal-parent {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 104px;
  padding: 19px 21px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--node-color) 54%, transparent);
  border-radius: 8px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--node-color) 16%, transparent), transparent 40%),
    rgba(8, 22, 18, 0.86);
  box-shadow: 0 17px 48px rgba(0, 0, 0, 0.18);
}

.terminal-parent::after {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 3px;
  content: "";
  background: var(--node-color);
  box-shadow: 0 0 20px color-mix(in srgb, var(--node-color) 75%, transparent);
}

.terminal-parent-icon {
  position: relative;
  width: 43px;
  height: 43px;
  border: 1px solid color-mix(in srgb, var(--node-color) 48%, transparent);
  border-radius: 7px;
  background: color-mix(in srgb, var(--node-color) 10%, transparent);
}

.terminal-parent-icon span {
  position: absolute;
  border: 1px solid var(--node-color);
  background: color-mix(in srgb, var(--node-color) 13%, transparent);
}

.terminal-parent-icon span:nth-child(1) { top: 10px; left: 9px; width: 25px; height: 8px; }
.terminal-parent-icon span:nth-child(2) { bottom: 9px; left: 9px; width: 10px; height: 8px; }
.terminal-parent-icon span:nth-child(3) { right: 9px; bottom: 9px; width: 10px; height: 8px; }

.terminal-parent-copy {
  min-width: 0;
}

.terminal-parent-copy > span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--font-floor);
  letter-spacing: 0.11em;
}

.terminal-parent-copy h2 {
  margin: 4px 0 5px;
  overflow: hidden;
  font-size: clamp(18px, 2vw, 28px);
  font-weight: 600;
  letter-spacing: -0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-parent-copy p {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--font-floor);
}

.terminal-parent-copy .terminal-parent-note {
  max-width: 720px;
  margin: 6px 0 8px;
  overflow: hidden;
  color: var(--muted-strong);
  font-family: var(--font-sans);
  font-size: 11px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-parent-copy .terminal-parent-task {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 3px 6px;
  border: 1px solid rgba(199, 243, 106, 0.42);
  border-radius: 4px;
  color: var(--acid);
  background: rgba(199, 243, 106, 0.07);
  letter-spacing: 0.06em;
}

.terminal-parent-copy .terminal-parent-task.is-complete {
  border-color: rgba(67, 217, 163, 0.35);
  color: var(--teal);
  background: rgba(67, 217, 163, 0.07);
}

.terminal-node-link {
  color: inherit;
  text-decoration: none;
}

.terminal-node-link span {
  margin-left: 3px;
  color: var(--acid);
  font-family: var(--font-mono);
  font-size: var(--font-floor);
  font-weight: 500;
}

.terminal-node-link:hover,
.terminal-node-link:focus-visible {
  color: var(--acid);
  outline: none;
}

.terminal-open-link {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  margin-top: 10px;
  padding: 5px 8px;
  border: 1px solid color-mix(in srgb, var(--node-color) 46%, var(--line));
  border-radius: 4px;
  color: var(--muted-strong);
  background: color-mix(in srgb, var(--node-color) 8%, transparent);
  font-family: var(--font-mono);
  font-size: var(--font-floor);
  font-weight: 500;
  letter-spacing: 0.03em;
  text-decoration: none;
  text-transform: uppercase;
}

.terminal-open-link span {
  color: var(--acid);
}

.terminal-open-link:hover,
.terminal-open-link:focus-visible {
  border-color: var(--node-color);
  color: var(--text);
  outline: none;
  background: color-mix(in srgb, var(--node-color) 15%, transparent);
}

.terminal-parent-link {
  margin-top: 9px;
}

.terminal-parent-activity {
  display: grid;
  grid-template-columns: auto auto;
  gap: 3px 7px;
  align-items: center;
  min-width: 112px;
  padding-right: 9px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--font-floor);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.terminal-parent-activity i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--node-color);
  box-shadow: 0 0 10px color-mix(in srgb, var(--node-color) 70%, transparent);
}

.terminal-parent-activity strong {
  grid-column: 2;
  color: var(--text);
  font-size: var(--font-floor);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.terminal-connector {
  position: relative;
  height: 32px;
  margin-left: 29px;
}

.terminal-connector::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 1px;
  content: "";
  background: linear-gradient(var(--acid), rgba(199, 243, 106, 0.18));
}

.terminal-connector span {
  position: absolute;
  bottom: -3px;
  left: -3px;
  width: 7px;
  height: 7px;
  border: 1px solid var(--acid);
  border-radius: 50%;
  background: var(--bg);
}

.terminal-children {
  position: relative;
  display: grid;
  gap: 7px;
  padding-left: 48px;
}

.terminal-children::before {
  position: absolute;
  top: 0;
  bottom: 23px;
  left: 29px;
  width: 1px;
  content: "";
  background: rgba(199, 243, 106, 0.2);
}

.terminal-leaf {
  position: relative;
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 10px 12px 10px 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--node-color) 7%, transparent), rgba(8, 21, 17, 0.72) 28%);
}

.terminal-leaf::before {
  position: absolute;
  top: 50%;
  right: 100%;
  width: 20px;
  height: 1px;
  content: "";
  background: rgba(199, 243, 106, 0.2);
}

.terminal-leaf::after {
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 0;
  width: 2px;
  content: "";
  background: var(--node-color);
  opacity: 0.72;
}

.terminal-rail-dot {
  position: absolute;
  top: 50%;
  right: calc(100% + 17px);
  width: 6px;
  height: 6px;
  transform: translateY(-50%);
  border: 1px solid var(--node-color);
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 7px color-mix(in srgb, var(--node-color) 45%, transparent);
}

.terminal-index {
  padding-top: 2px;
  color: color-mix(in srgb, var(--node-color) 80%, white);
  font-family: var(--font-mono);
  font-size: var(--font-floor);
}

.terminal-leaf-copy {
  min-width: 0;
}

.terminal-leaf-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.terminal-leaf h3 {
  margin: 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-leaf p {
  margin: 6px 0 0;
  color: var(--muted-strong);
  font-size: var(--font-floor);
  line-height: 1.5;
}

.terminal-state {
  flex: 0 0 auto;
  padding: 3px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--font-floor);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.terminal-state.is-complete {
  border-color: rgba(67, 217, 163, 0.22);
  color: var(--teal);
  background: rgba(67, 217, 163, 0.05);
}

.terminal-task-state:not(.is-complete) {
  border-color: rgba(199, 243, 106, 0.4);
  color: var(--acid);
  background: rgba(199, 243, 106, 0.055);
}

.terminal-leaf-meta {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-top: 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--font-floor);
}

.terminal-leaf-meta span {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.terminal-leaf-meta i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.terminal-leaf-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  margin: 0;
}

.terminal-leaf-actions .terminal-open-link {
  margin-top: 0;
  white-space: nowrap;
}

.terminal-save-button {
  min-height: 27px;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--muted-strong);
  background: rgba(199, 243, 106, 0.035);
  font-family: var(--font-mono);
  font-size: var(--font-floor);
  white-space: nowrap;
  text-transform: uppercase;
}

.terminal-save-button:hover,
.terminal-save-button.is-saved {
  border-color: rgba(199, 243, 106, 0.48);
  color: var(--acid);
}

/* The outline uses the same direct, solid-block language as the treemap. */
.terminal-tree {
  background:
    linear-gradient(rgba(135, 182, 164, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(135, 182, 164, 0.028) 1px, transparent 1px),
    rgba(5, 14, 11, 0.62);
  background-size: 24px 24px;
}

.terminal-parent {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  min-height: 108px;
  padding: 22px 24px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: var(--node-color);
  box-shadow: none;
}

.terminal-parent::after,
.terminal-children::before,
.terminal-leaf::before,
.terminal-leaf::after {
  display: none;
}

.terminal-parent-copy h2 {
  margin: 0 0 8px;
  font-size: clamp(24px, 3vw, 42px);
  font-weight: 650;
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.terminal-parent-copy p,
.terminal-parent-copy .terminal-parent-note {
  color: rgba(255, 255, 255, 0.8);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.45;
}

.terminal-parent-copy .terminal-parent-task,
.terminal-state {
  margin: 0 0 8px;
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
  background: rgba(0, 0, 0, 0.14);
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0;
  text-transform: none;
}

.terminal-parent-copy .terminal-parent-task.is-complete,
.terminal-state.is-complete,
.terminal-task-state:not(.is-complete) {
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
  background: rgba(0, 0, 0, 0.14);
}

.terminal-parent-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.terminal-children {
  gap: 6px;
  margin: 8px 0 0 clamp(16px, 2vw, 28px);
  padding-left: 0;
}

.terminal-branch,
.terminal-nested-children {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.terminal-nested-children {
  margin-left: 22px;
}

.terminal-leaf {
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 12px;
  min-height: 68px;
  padding: 13px 16px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: var(--node-color);
}

.terminal-disclosure,
.terminal-disclosure-spacer {
  align-self: center;
  width: 26px;
  height: 26px;
}

.terminal-disclosure {
  display: grid;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 4px;
  color: #fff;
  background: rgba(0, 0, 0, 0.14);
}

.terminal-disclosure span {
  display: block;
  width: 9px;
  height: 11px;
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  transform-origin: center;
  transition: transform 140ms ease;
}

.terminal-disclosure.is-expanded span {
  transform: rotate(90deg);
}

.terminal-disclosure:hover,
.terminal-disclosure:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.68);
  background: rgba(0, 0, 0, 0.26);
}

.terminal-leaf.is-drillable {
  cursor: pointer;
  transition: filter 140ms ease, transform 140ms ease;
}

.terminal-leaf.is-drillable:hover,
.terminal-leaf.is-drillable:focus-visible {
  transform: translateX(2px);
  outline: 2px solid rgba(255, 255, 255, 0.72);
  outline-offset: -2px;
  filter: brightness(1.08);
}

.terminal-leaf-heading {
  justify-content: flex-start;
}

.terminal-leaf h3 {
  font-size: 16px;
  font-weight: 650;
  line-height: 1.25;
}

.terminal-leaf p {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
}

.terminal-leaf-meta {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.76);
  font-family: var(--font-sans);
  font-size: 11px;
}

.terminal-leaf-actions {
  align-self: center;
}

.terminal-open-link,
.terminal-save-button {
  min-height: 31px;
  margin-top: 0;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  color: #fff;
  background: rgba(0, 0, 0, 0.14);
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.terminal-open-link {
  width: 32px;
  padding: 0;
  justify-content: center;
}

.terminal-link-icon {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.terminal-open-link:hover,
.terminal-open-link:focus-visible,
.terminal-save-button:hover,
.terminal-save-button.is-saved {
  border-color: rgba(255, 255, 255, 0.68);
  color: #fff;
  background: rgba(0, 0, 0, 0.26);
}

.tile-group {
  cursor: pointer;
  outline: none;
}

.tile-group.is-preset-match .tile-rect {
  stroke: rgba(199, 243, 106, 0.62);
  stroke-width: 2px;
}

.tile-rect {
  stroke: rgba(7, 16, 14, 0.94);
  stroke-width: 3px;
  transition: filter 150ms ease, opacity 150ms ease, stroke 150ms ease;
}

.tile-group:hover .tile-rect,
.tile-group:focus .tile-rect {
  filter: brightness(1.13) saturate(1.08);
  stroke: var(--acid);
  stroke-width: 2px;
}

.tile-group.is-highlighted .tile-rect {
  stroke: #fff;
  stroke-width: 4px;
  filter: brightness(1.2);
}

.tile-label {
  fill: rgba(255, 255, 255, 0.96);
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.03em;
  pointer-events: none;
}

.tile-note {
  fill: rgba(255, 255, 255, 0.72);
  font-family: var(--font-sans);
  font-weight: 450;
  letter-spacing: 0;
  pointer-events: none;
}

.tile-task-tag {
  fill: rgba(5, 15, 12, 0.38);
  stroke: rgba(199, 243, 106, 0.72);
  stroke-width: 1px;
  pointer-events: none;
}

.tile-task-tag.is-complete {
  fill: rgba(18, 66, 52, 0.48);
  stroke: rgba(94, 240, 188, 0.8);
}

.tile-task {
  fill: #efffbf;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.06em;
  pointer-events: none;
}

.tile-task.is-complete { fill: #8ff0cb; }

.tile-status {
  fill: rgba(255, 255, 255, 0.8);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.01em;
  pointer-events: none;
}

.tile-metric {
  font-family: var(--font-mono);
  pointer-events: none;
}

.tile-metric {
  fill: rgba(255, 255, 255, 0.96);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.tile-metric-compact {
  font-size: 10px;
}

.tile-metric-bottom {
  fill: rgba(255, 255, 255, 0.76);
  font-size: 11px;
  font-weight: 550;
}

.tile-share {
  fill: rgba(255, 255, 255, 0.98);
  font-family: var(--font-sans);
  font-weight: 760;
  letter-spacing: -0.045em;
  pointer-events: none;
}

.tile-save {
  cursor: pointer;
  opacity: 0.56;
  transition: opacity 150ms ease, transform 150ms ease;
}

.tile-group:hover .tile-save,
.tile-group:focus .tile-save,
.tile-save.is-saved {
  opacity: 1;
}

.tile-save rect {
  fill: rgba(3, 12, 9, 0.38);
  stroke: rgba(255, 255, 255, 0.38);
}

.tile-save text {
  fill: rgba(255, 255, 255, 0.9);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  pointer-events: none;
}

.tile-save:hover rect,
.tile-save.is-saved rect {
  fill: rgba(199, 243, 106, 0.16);
  stroke: var(--acid);
}

.tile-save.is-saved text { fill: var(--acid); }

.empty-map {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  color: var(--muted);
  text-align: center;
}

.empty-map > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  margin-bottom: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--acid);
  font-family: var(--font-mono);
}

.empty-map strong {
  color: var(--text);
  font-size: 13px;
}

.empty-map p {
  margin: 6px 0 0;
  font-size: var(--font-floor);
}

.map-footer {
  display: flex;
  justify-content: space-between;
  padding: 11px 2px 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--font-floor);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.tooltip {
  position: fixed;
  z-index: 100;
  width: 250px;
  padding: 14px;
  pointer-events: none;
  border: 1px solid rgba(199, 243, 106, 0.35);
  border-radius: 7px;
  background: rgba(5, 16, 13, 0.96);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(15px);
}

.tooltip h3 {
  margin: 4px 0 2px;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tooltip-path {
  margin: 0 0 10px;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--font-floor);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tooltip-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.tooltip-grid div {
  padding: 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.tooltip-grid span,
.tooltip-grid strong {
  display: block;
}

.tooltip-grid span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--font-floor);
  text-transform: uppercase;
}

.tooltip-grid strong {
  margin-top: 3px;
  color: var(--text);
  font-size: 10px;
  font-weight: 600;
}

.tooltip-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--font-floor);
  text-transform: uppercase;
}

.tooltip-footer strong {
  color: var(--acid);
  font-weight: 500;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 120;
  max-width: 340px;
  padding: 12px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--text);
  background: #10231d;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  font-size: 10px;
}

@media (max-width: 1100px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 52px;
  }

  .hero-copy { max-width: 760px; }
  .hero-visual { max-width: 780px; }

  .app-header {
    grid-template-columns: 240px minmax(220px, 1fr) auto;
  }

  .app-shell { grid-template-columns: 240px minmax(0, 1fr); }
  .panel-section { padding-right: 17px; padding-left: 17px; }
}

@media (max-width: 820px) {
  .setup-view { width: min(100% - 28px, 720px); }
  .privacy-pill { display: none; }
  .hero { padding: 48px 0 54px; }
  .hero h1 { font-size: clamp(48px, 12vw, 72px); }
  .hero-visual { padding: 25px; }
  .preview-tooltip { right: 12px; }
  .trust-strip { grid-template-columns: 1fr; }
  .trust-strip > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .setup-footer { align-items: flex-start; flex-direction: column; padding-right: 0; padding-left: 0; }

  .app-header {
    grid-template-columns: 1fr auto;
    padding: 0 16px;
  }

  .header-search-wrap {
    grid-row: 2;
    grid-column: 1 / -1;
    padding-bottom: 11px;
  }

  .app-header { padding-top: 10px; }
  .dataset-label { display: none; }
  .app-view {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .app-shell {
    display: block;
    overflow: visible;
  }

  .control-panel {
    display: grid;
    overflow: visible;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "summary controls"
      "presets presets"
      "saved saved"
      "data data";
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .account-summary { grid-area: summary; }
  .view-controls-section { grid-area: controls; }
  .presets-section { grid-area: presets; }
  .saved-findings-section { grid-area: saved; }
  .account-data-section { grid-area: data; }
  .preset-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .preset-button {
    justify-content: center;
    text-align: center;
  }
  .preset-button span { display: none; }
  .panel-section { border-right: 1px solid var(--line); }
  .thresholds-section { display: none; }
  .map-panel { min-height: 700px; padding: 20px 15px 12px; }
  .legend-row { align-items: flex-start; flex-direction: column; padding: 10px 0; }
  .map-hint { display: none; }
  .activity-legend { flex-wrap: wrap; gap: 8px 13px; }

  .terminal-tree { padding: 24px 18px 34px; }
}

@media (max-width: 560px) {
  .setup-nav { min-height: 66px; }
  .hero { gap: 42px; }
  .hero h1 { font-size: 46px; }
  .hero-lede { font-size: 14px; }
  .input-row { flex-direction: column; }
  .primary-button { width: 100%; }
  .import-meta { align-items: flex-start; flex-direction: column; gap: 5px; }
  .hero-visual { min-height: 430px; aspect-ratio: auto; }
  .preview-map { grid-template-columns: 1.3fr 0.8fr; grid-template-rows: repeat(3, 1fr); }
  .tile-b { grid-column: auto; }
  .tile-d { grid-row: auto; }
  .preview-tooltip { top: auto; right: 12px; bottom: 42px; }
  .visual-caption { display: none; }

  .app-header .brand > span:last-child { font-size: 0; }
  .app-header .brand > span:last-child strong { font-size: 12px; }
  .control-panel {
    grid-template-columns: 1fr;
    grid-template-areas:
      "presets"
      "saved"
      "controls";
  }
  .account-summary { display: none; }
  .panel-section { border-right: 0; }
  .preset-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .map-toolbar { align-items: flex-start; flex-direction: column; }
  .view-headline { align-items: flex-start; flex-direction: column; gap: 4px; }
  .account-share { padding-left: 0; border-left: 0; }
  .map-actions { width: 100%; }
  .map-actions button { flex: 1; }
  .treemap-wrap, #treemap { min-height: 480px; }
  .terminal-parent {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 15px;
  }

  .terminal-parent-actions { justify-content: flex-start; }
  .terminal-parent-copy p { line-height: 1.55; }
  .terminal-children { padding-left: 0; }
  .terminal-nested-children { margin-left: 14px; }
  .terminal-leaf { grid-template-columns: 26px minmax(0, 1fr); padding: 12px; }
  .terminal-leaf-actions {
    grid-column: 2;
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-top: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
