/* Reports: Month / Trend switch and the P&L drill panel (UX overhaul, Reports batch). Zentrum tokens only. */

/* --- Month / Trend switch ------------------------------------------------------- */
.rp-switch { display: inline-flex; padding: 3px; gap: 2px; border-radius: 99px; background: var(--amino-surface-sunk); }
.rp-switch button {
  all: unset; cursor: pointer; padding: 6px 16px; border-radius: 99px;
  font-size: 13.5px; font-weight: 600; color: var(--amino-text-muted);
}
.rp-switch button[aria-pressed="true"] { background: var(--amino-surface); color: var(--amino-text); box-shadow: var(--z-paper-shadow); }
.rp-switch button:focus-visible { outline: 2px solid var(--z-accent); outline-offset: 1px; }

/* --- Statement rows that open a drill --------------------------------------------- */
.statement tr.z-drill { cursor: pointer; }
.statement tr.z-drill td.rowlabel::after {
  content: "›"; margin-left: 6px; color: var(--amino-text-muted); opacity: 0; transition: opacity .15s ease;
}
.statement tr.z-drill:hover td.rowlabel::after,
.statement tr.z-drill:focus-visible td.rowlabel::after { opacity: 1; }
.statement tr.z-drill:focus-visible { outline: 2px solid var(--z-accent); outline-offset: -2px; }
@media (hover: none) { .statement tr.z-drill td.rowlabel::after { opacity: .6; } }

/* --- Drill panel: side panel, bottom sheet on phones -------------------------------- */
.dr-overlay {
  position: fixed; inset: 0; z-index: 60; display: flex; justify-content: flex-end;
  background: color-mix(in srgb, var(--amino-text) 28%, transparent);
  animation: dr-fade .15s ease;
}
.dr-panel {
  width: min(460px, 100%); height: 100%; display: flex; flex-direction: column; outline: none;
  background: var(--amino-surface); box-shadow: var(--z-paper-shadow);
  animation: dr-slide .2s ease;
}
@keyframes dr-fade { from { opacity: 0; } }
@keyframes dr-slide { from { transform: translateX(24px); opacity: .4; } }
.dr-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 20px 0; }
.dr-head-l { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dr-head h3 { margin: 0; font-size: 20px; }
.dr-head .eyebrow { font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--amino-text-muted); }
.dr-total {
  padding: 6px 20px 14px; border-bottom: 1px solid var(--amino-border);
  font-family: var(--amino-font-display); font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--amino-text);
}
.dr-total .neg, .dr-panel .neg { color: var(--z-bad); }
.dr-body { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 20px; overscroll-behavior: contain; }
.dr-body section { display: flex; flex-direction: column; gap: 8px; }
.dr-body .eyebrow { font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--amino-text-muted); }
.dr-parts, .dr-rows { list-style: none; margin: 0; padding: 0; }
.dr-part {
  all: unset; box-sizing: border-box; width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; column-gap: 10px; row-gap: 6px;
  align-items: center; padding: 9px 0; border-top: 1px solid var(--amino-border); font-size: 14px; color: var(--amino-text);
}
.dr-parts li:first-child .dr-part { border-top: 0; }
.dr-part.click { cursor: pointer; }
.dr-part.click:hover .dr-part-l { color: var(--z-accent); }
.dr-part.click:focus-visible { outline: 2px solid var(--z-accent); outline-offset: 2px; border-radius: 4px; }
.dr-part-l { min-width: 0; overflow-wrap: anywhere; }
.dr-part-v { font-family: var(--z-font-mono); font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.dr-chev { color: var(--amino-text-muted); }
.dr-bar { grid-column: 1 / -1; height: 5px; border-radius: 99px; background: var(--amino-surface-sunk); overflow: hidden; }
.dr-bar i { display: block; height: 100%; border-radius: 99px; background: var(--z-s1); }
.dr-eq {
  display: flex; justify-content: space-between; gap: 10px; padding-top: 9px; border-top: 1px solid var(--amino-text);
  font-weight: 700; font-size: 14px;
}
.dr-eq span:last-child { font-family: var(--z-font-mono); font-size: 13px; font-variant-numeric: tabular-nums; }
.dr-row {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: baseline;
  padding: 8px 0; border-top: 1px solid var(--amino-border); font-size: 13.5px;
}
.dr-rows li:first-child { border-top: 0; }
.dr-date { font-family: var(--z-font-mono); font-size: 12px; color: var(--amino-text-muted); }
.dr-row-t { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.dr-row-t strong { font-weight: 600; color: var(--amino-text); overflow-wrap: anywhere; }
.dr-row-t .muted { font-size: 12px; overflow-wrap: anywhere; }
.dr-row-v { font-family: var(--z-font-mono); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dr-foot { padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--amino-border); display: flex; justify-content: flex-end; }
.dr-link { all: unset; cursor: pointer; color: var(--z-accent); font-weight: 600; font-size: 13.5px; }
.dr-link:hover { text-decoration: underline; }
.dr-link:focus-visible { outline: 2px solid var(--z-accent); outline-offset: 2px; border-radius: 3px; }

@media (max-width: 640px) {
  .dr-overlay { align-items: flex-end; }
  .dr-panel {
    width: 100%; height: auto; max-height: calc(100dvh - 48px);
    border-radius: var(--amino-radius-lg) var(--amino-radius-lg) 0 0; animation-name: dr-rise;
  }
  .dr-head { padding: 16px 16px 0; }
  .dr-total { padding: 4px 16px 12px; font-size: 24px; }
  .dr-body { padding: 14px 16px; }
  .dr-foot { padding-left: 16px; padding-right: 16px; }
  .dr-foot .btn { width: 100%; justify-content: center; }
  .view-head .rp-switch { margin-top: 4px; }
}
@keyframes dr-rise { from { transform: translateY(32px); opacity: .4; } }

/* Hero figures that open the drill. */
.z-fig.z-fig-open { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; }
.z-fig.z-fig-open:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; text-decoration-color: var(--amino-border); }
.z-fig.z-fig-open:focus-visible { outline: 2px solid var(--z-accent); outline-offset: 3px; border-radius: 6px; }

/* Retained Earnings › Where It Sits: the balance sheet, folded into the card. */
.z-bs-inline { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
#dash-where > summary .z-meaning { color: inherit; }
