/* ════════════════════════════════════════
   TOKENS
   ════════════════════════════════════════ */
:root {
  --bg: #0a0a0a;
  --bg-2: #111111;
  --bg-panel: #161616;
  --bg-hover: #1e1e1e;

  --orange: #ff6600;
  --orange-dim: #cc5200;
  --orange-glow: #ff660033;

  --yellow: #ffcc00;
  --cyan: #00ccff;
  --green: #00cc66;
  --red: #ff3333;

  --text: #e8e8e8;
  --text-dim: #aaaaaa;
  --gray: #888888;
  --gray-dim: #444444;

  --border: #2a2a2a;

  --mono: "Share Tech Mono", monospace;
  --jp: "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--jp);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

button {
  cursor: pointer;
}

/* ════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════ */

footer {
  position: relative;
  bottom: 0;
  left: 0;
  right: 0;
  border-top: 1px solid var(--orange);
  background: var(--bg-2);
  padding: 8px 20px;
  z-index: 100;
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--gray);
  font-family: var(--font-jp);
}

.footer-sep {
  color: var(--gray-dim);
}

.footer-source a {
  color: var(--gray);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-source a:hover {
  color: var(--orange-bright);
}

/* ════════════════════════════════════════
   TITLE BAR
   ════════════════════════════════════════ */
#topbar {
  height: 56px;
  flex-shrink: 0;
  background: var(--bg-2);
  border-bottom: 2px solid var(--orange);
  padding: 0 0 0 16px;
  display: flex;
  align-items: stretch;
}

.topbar-titles {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding-right: 20px;
}

.topbar-titles .title-org-name {
  font-family: var(--jp);
  font-size: 11px;
  color: var(--gray);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.topbar-titles .title-app-name {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--orange);
  letter-spacing: 2px;
  text-shadow: 0 0 10px #ff660044;
  white-space: nowrap;
}

/* tab group sits flush against the bottom border */
#tab-bar {
  margin-left: auto;
  display: flex;
  align-items: flex-end;
  height: 100%;
  gap: 4px;
}

.tab-btn {
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  color: var(--gray);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  padding: 5px 18px;
  display: flex;
  align-items: center;
  gap: 7px;
  position: relative;
  bottom: -2px; /* overlap the 2px bottom border */
  transition:
    color 0.15s,
    border-color 0.15s,
    background 0.15s;
}

.tab-btn:hover {
  color: var(--text);
  border-color: var(--gray-dim);
}

.tab-btn.active {
  background: var(--bg);
  border-color: var(--orange);
  color: var(--orange);
}

.tab-led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gray-dim);
  flex-shrink: 0;
  transition:
    background 0.2s,
    box-shadow 0.2s;
}

.tab-btn.active .tab-led {
  background: var(--orange);
  box-shadow:
    0 0 4px var(--orange),
    0 0 10px #ff660066;
}

.topbar-year {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--yellow);
  border-left: 1px solid var(--border);
  padding: 0 16px;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
}

/* ════════════════════════════════════════
   SEARCH BAR
   ════════════════════════════════════════ */
#backbar {
  height: 40px;
  flex-shrink: 0;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  padding: 0 8px;
  display: flex;
  align-items: center;
}
.back-btn {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--orange);
  background: transparent;
  border: 1px solid var(--orange-dim);
  padding: 4px 14px;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.back-btn:hover {
  border-color: var(--orange);
  box-shadow: 0 0 8px var(--orange-glow);
}

.copy-url-btn {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--gray);
  background: transparent;
  border: 1px solid transparent;
  padding: 4px 10px;
  cursor: pointer;
  border-radius: 3px;
  transition:
    color 0.15s,
    border-color 0.15s;
  margin-left: 8px;
}
.copy-url-btn:hover {
  color: var(--text);
  border-color: var(--gray);
}
.copy-url-btn--copied {
  color: var(--orange);
  border-color: var(--orange);
}

#searchbar {
  height: 40px;
  flex-shrink: 0;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-terminal-line {
  flex: 1;
  height: 26px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--orange-dim);
  padding: 0 10px;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.search-terminal-line:focus-within {
  border-color: var(--orange);
  box-shadow: 0 0 8px var(--orange-glow);
}

.search-prompt {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--orange);
  text-shadow: 0 0 6px #ff660099;
  user-select: none;
  letter-spacing: 1px;
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  caret-color: var(--orange);
}

.search-input::placeholder {
  color: var(--gray-dim);
  font-style: italic;
}

.search-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gray);
  white-space: nowrap;
}

.search-count-num {
  color: var(--cyan);
  font-size: 13px;
}

/* ── VIEW SWITCHER ── */
.view-switcher {
  display: flex;
  align-items: center;
  gap: 1px;
  border: 1px solid var(--border);
  padding: 2px;
  flex-shrink: 0;
}

.view-btn {
  background: transparent;
  border: none;
  color: var(--gray-dim);
  padding: 4px 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    color 0.15s,
    background 0.15s;
}

.view-btn:hover {
  color: var(--gray);
  background: var(--bg-hover);
}

.view-btn.active {
  color: var(--orange);
  background: var(--bg);
}

/* ════════════════════════════════════════
   MAIN / TAB PANELS
   ════════════════════════════════════════ */
#main {
  flex: 1;
  overflow: hidden;
  overflow-y: scroll;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* ── TAB PANELS ── */
.tab-panel {
  display: none;
  flex: 1;
  margin: 8px;
  margin-top: 4px;
  margin-bottom: 0px;
  gap: 14px;
}

.tab-panel.active {
  display: block;
}

#tab-detail.active {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 6px;
}

#tab-browse.active {
  display: grid;
  padding: 0;
  align-content: start;
  align-items: start;
}

/* ════════════════════════════════════════
   ENTITY GRID
   ════════════════════════════════════════ */
#tab-browse {
  flex: 1;
}

.entity-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 6px;
  padding: 12px;
}

/* list view */
#main[data-view="list"] .entity-grid {
  grid-template-columns: 1fr;
}

/* compact view */
#main[data-view="compact"] .entity-grid {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 4px;
}

/* ── GROUP HEADER ── */
.group-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-end;
  border-left: 3px solid var(--orange);
  border-bottom: 1px solid var(--orange-dim);
  padding: 2px 0 4px 10px;
  margin-top: 4px;
  box-shadow: -2px 0 8px #ff660033;
}

.gh-name {
  font-family: var(--jp);
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 1px;
}

.gh-count {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--orange-dim);
  letter-spacing: 1px;
  flex-shrink: 0;
}

/* ── ENTITY CARD ── */
.entity-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-top: 2px solid var(--gray-dim);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition:
    border-color 0.15s,
    background 0.15s;
  content-visibility: auto;
  contain-intrinsic-block-size: 170px;
}

.entity-card:hover {
  border-color: var(--orange);
  border-top-color: var(--orange);
  background: var(--bg-hover);
}

.entity-card:hover .ec-rows {
  background: var(--bg-hover);
}

.ec-head {
  display: flex;
  align-items: baseline;
  padding: 8px;
  padding-top: 4px;
}

.ec-name {
  font-family: var(--jp);
  font-size: 20px;
  font-weight: 500;
  color: var(--text);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ec-badge {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--orange-dim);
  white-space: nowrap;
}

.ec-sub {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--gray);
  padding: 8px;
  padding-bottom: 0px;
}

.ec-rows {
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-panel);
}

.ec-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.ec-row:nth-child(2n) {
  border-right: none;
}

.ec-row:nth-last-child(-n + 2) {
  border-bottom: none;
}

.ec-label {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--gray);
  letter-spacing: 0.3px;
}

.ec-value {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--cyan);
  justify-items: end;
}

/* compact: hide rows, show only name+sub */
#main[data-view="compact"] .ec-rows {
  display: none;
}

#main[data-view="compact"] .ec-name {
  font-size: 13px;
}

/* list: horizontal layout */
#main[data-view="list"] .entity-card {
  flex-direction: row;
  align-items: stretch;
  border-top-width: 1px;
  border-left: 2px solid var(--gray-dim);
}

#main[data-view="list"] .entity-card:hover {
  border-left-color: var(--orange);
}

#main[data-view="list"] .ec-head {
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 140px;
  padding: 8px 12px;
  border-right: 1px solid var(--border);
}

#main[data-view="list"] .ec-sub {
  padding: 0;
}

#main[data-view="list"] .ec-rows {
  flex: 1;
  flex-direction: row;
  border-top: none;
  border-left: none;
}

#main[data-view="list"] .ec-row {
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 10px;
  border-bottom: none;
  border-right: 1px solid #1a1a1a;
}

#main[data-view="list"] .ec-row:last-child {
  border-right: none;
}

/* ── DETAIL PLACEHOLDER ── */
.detail-placeholder {
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dp-name {
  font-family: var(--jp);
  font-size: 36px;
  font-weight: 700;
  color: var(--orange);
  text-shadow: 0 0 24px #ff660033;
}

.dp-sub {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--gray);
  display: flex;
  align-items: center;
  gap: 10px;
}

.dp-badge {
  font-size: 10px;
  border: 1px solid var(--gray-dim);
  padding: 1px 7px;
  color: var(--gray-dim);
}

/* ════════════════════════════════════════
   CARD-H (Compact モード)
   ════════════════════════════════════════ */
.card-h {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-top: 2px solid var(--orange-dim);
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s;
}

.card-h:hover {
  border-color: var(--orange);
  border-top-color: var(--orange);
  background: var(--bg-hover);
}

.card-h .ch-header {
  padding: 8px 12px 6px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-h .ch-header-left {
  flex: 1;
  min-width: 0;
}

.card-h .ch-pref {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--gray);
  margin-bottom: 2px;
}

.card-h .ch-name {
  font-family: var(--jp);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-h .ch-badge {
  font-family: var(--mono);
  font-size: 9px;
  border: 1px solid var(--orange-dim);
  color: var(--orange-dim);
  padding: 2px 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.card-h .ch-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.card-h .ch-value-name {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--cyan);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  opacity: 0.85;
}

.card-h .ch-amount {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 100;
  color: var(--cyan);
  letter-spacing: -1px;
  line-height: 1;
}

.card-h .ch-unit {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--gray);
  margin-top: 4px;
  letter-spacing: 1px;
}

/* ════════════════════════════════════════
   NOT FOUND
   ════════════════════════════════════════ */
.not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  padding: 40px;
}

#tab-loading.active {
  display: flex;
  align-items: center;
  justify-content: center;
}
.loading-prompt {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
}
.loading-gt {
  font-size: 16px;
  color: var(--orange);
  text-shadow: 0 0 8px var(--orange-glow);
}
.loading-msg {
  font-size: 14px;
  color: var(--gray);
  letter-spacing: 0.05em;
}
.loading-cursor {
  width: 8px;
  height: 16px;
  background: var(--orange);
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.nf-code {
  font-family: var(--mono);
  font-size: 80px;
  font-weight: 100;
  color: var(--orange);
  line-height: 1;
  text-shadow: 0 0 40px #ff660044;
  letter-spacing: -4px;
}

.nf-msg {
  font-family: var(--jp);
  font-size: 16px;
  color: var(--gray);
}

.nf-path {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gray-dim);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  padding: 4px 12px;
  letter-spacing: 1px;
}

.nf-btn {
  margin-top: 8px;
  background: transparent;
  border: 1px solid var(--orange-dim);
  color: var(--orange);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 1px;
  padding: 6px 20px;
  transition:
    background 0.15s,
    border-color 0.15s;
}

.nf-btn:hover {
  background: var(--orange-glow);
  border-color: var(--orange);
}

/* ════════════════════════════════════════
   SCANLINE OVERLAY
   ════════════════════════════════════════ */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* ════════════════════════════════════════
   PIE CHART CARD (案A)
   ════════════════════════════════════════ */
.donut-layout {
  background: var(--bg-panel, #161616);
  border: 1px solid var(--border, #2a2a2a);
  border-top: 2px solid var(--orange-dim, #cc5200);
  flex: 1;
  min-width: 320px;
}

.donut-header {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border, #2a2a2a);
  background: var(--bg-secondary, #111);
  color: var(--orange, #ff6600);
  font-family: var(--font-mono, "Share Tech Mono", monospace);
  font-size: 14px;
  letter-spacing: 0.08em;
}

.donut-body {
  display: flex;
  align-items: stretch;
}

.donut-chart-col {
  flex: 0 0 280px;
  border-right: 1px solid var(--border, #2a2a2a);
}

.donut-chart-el {
  width: 100%;
  height: 100%;
  min-height: 280px;
}

.donut-list-col {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  max-height: 280px;
}

.donut-list-col::-webkit-scrollbar {
  width: 3px;
}
.donut-list-col::-webkit-scrollbar-thumb {
  background: var(--orange-dim, #cc5200);
}

.donut-list-header {
  display: grid;
  grid-template-columns: 1fr 8em 5em;
  gap: 8px;
  padding: 5px 10px;
  border-bottom: 1px solid var(--border, #2a2a2a);
  background: var(--bg-secondary, #111);
  font-family: var(--font-mono, "Share Tech Mono", monospace);
  font-size: 9px;
  color: var(--gray, #888);
  letter-spacing: 0.1em;
  position: sticky;
  top: 0;
  z-index: 1;
}

.donut-list-header span:not(:first-child) {
  text-align: right;
}

.donut-item {
  display: grid;
  grid-template-columns: 1fr 8em 5em;
  gap: 8px;
  align-items: center;
  padding: 5px 10px;
  border-bottom: 1px solid #1a1a1a;
  cursor: default;
  transition: background 0.1s;
}

.donut-item:hover,
.donut-item.active {
  background: var(--bg-hover, #1e1e1e);
}

.donut-item-name {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--gray, #888);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.donut-item-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
}

.donut-item-value {
  font-family: var(--font-mono, "Share Tech Mono", monospace);
  font-size: 11px;
  color: var(--white, #e8e8e8);
  text-align: right;
  white-space: nowrap;
}

.donut-item-pct {
  font-family: var(--font-mono, "Share Tech Mono", monospace);
  font-size: 10px;
  color: var(--gray, #888);
  text-align: right;
}

.donut-item.active .donut-item-pct {
  color: var(--yellow, #ffcc00);
}
.donut-item.active .donut-item-name {
  color: var(--white, #e8e8e8);
}

@media (max-width: 780px) {
  .donut-body {
    flex-direction: column;
  }
  .donut-chart-col {
    flex: none;
    border-right: none;
    border-bottom: 1px solid var(--border, #2a2a2a);
  }
  .donut-list-col {
    max-height: 220px;
  }
}

/* ════════════════════════════════════════
   DETAIL ROW
   ════════════════════════════════════════ */
.detail-header-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-top: 2px solid var(--orange-dim);
}
.dh-top {
  padding: 14px 20px 10px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}
.dh-name-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dh-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dh-subtitle {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gray);
}
.dh-badge {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--orange-dim);
}
.dh-title {
  font-family: var(--mono);
  font-size: 28px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.04em;
}
.dh-tag {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--orange-dim);
  padding: 2px 10px;
  flex-shrink: 0;
}
.dh-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border);
}
.dh-stat {
  padding: 10px 16px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.dh-stat:last-child {
  border-right: none;
}
.dh-stat-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--gray);
}
.dh-stat-value {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--text);
}
@media (max-width: 600px) {
  .dh-title {
    font-size: 22px;
  }
  .dh-stats {
    grid-template-columns: 1fr 1fr;
  }
  .dh-stat {
    border-bottom: 1px solid var(--border);
  }
  .dh-stat:nth-child(2n) {
    border-right: none;
  }
  .dh-stat:nth-last-child(-n + 2) {
    border-bottom: none;
  }
}

.detail-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px;
}

.detail-col {
  display: flex;
  flex-direction: column;
  align-self: flex-start;
  flex: 1 1 0px;
  gap: 6px;
}

/* ── Sunburst ────────────────────────────────────── */
.sunburst-card {
  flex: 1 1 320px;
  min-width: 280px;
  background: var(--panel-bg, #111);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.sunburst-trail {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  min-height: 26px;
  padding: 4px 10px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 9px;
}

.trail-item {
  padding: 3px 10px 3px 16px;
  color: #000;
  clip-path: polygon(
    0 0,
    calc(100% - 7px) 0,
    100% 50%,
    calc(100% - 7px) 100%,
    0 100%,
    7px 50%
  );
  margin-right: 1px;
}

.trail-item:first-child {
  clip-path: polygon(
    0 0,
    calc(100% - 7px) 0,
    100% 50%,
    calc(100% - 7px) 100%,
    0 100%
  );
  padding-left: 10px;
}

.trail-end {
  color: var(--text-muted, #555);
  padding: 3px 6px;
}

.sunburst-container {
  flex: 1;
  min-height: 300px;
}

.sunburst-card .legend-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 10px;
  border-top: 1px solid var(--border);
}

.sunburst-card .legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-muted, #666);
  cursor: pointer;
  padding: 2px 4px;
  border: 1px solid transparent;
  transition:
    border-color 0.15s,
    color 0.15s;
}

.sunburst-card .legend-item:hover {
  border-color: #444;
  color: var(--text, #e8e8e8);
}

.sunburst-card .legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Icicle ────────────────────────────────────────── */
.icicle-card {
  flex: 1 1 100%;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.icicle-trail {
  display: flex;
  align-items: center;
  gap: 0;
  min-height: 26px;
  flex-wrap: wrap;
  padding: 4px 0;
}

.icicle-container {
  width: 100%;
  overflow: hidden;
}

.icicle-container svg {
  display: block;
}

.icicle-tooltip {
  position: absolute;
  pointer-events: none;
  background: #1a1a1a;
  border: 1px solid var(--orange, #ff6600);
  padding: 6px 10px;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  color: var(--text, #e8e8e8);
  z-index: 9999;
  display: none;
  white-space: nowrap;
  line-height: 1.6;
}

/* ── PieChart ──────────────────────────────────────── */
.pie-card {
  display: flex;
  flex-direction: column;
}

.pie-header {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  color: var(--orange, #ff6600);
  letter-spacing: 0.1em;
  padding: 6px 0 8px;
}

.pie-body {
  display: flex;
  gap: 12px;
  align-items: center;
}

.pie-chart-col {
  flex: 0 0 160px;
}

.pie-chart-el {
  width: 160px;
  height: 160px;
}

.pie-list-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  max-height: 200px;
}

.pie-list-item {
  display: grid;
  grid-template-columns: 10px 1fr auto auto;
  align-items: center;
  gap: 6px;
  padding: 3px 4px;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  color: var(--text-muted, #888);
  cursor: default;
  border-radius: 2px;
  transition:
    background 0.12s,
    color 0.12s;
}

.pie-list-item.active,
.pie-list-item:hover {
  background: #181818;
  color: var(--text, #e8e8e8);
}

.pie-list-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.pie-list-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pie-list-value {
  text-align: right;
  white-space: nowrap;
}

.pie-list-pct {
  text-align: right;
  white-space: nowrap;
  color: var(--text-muted, #666);
  min-width: 44px;
}
