/* ============================================================================
   WebPros Design System — UI KIT EXTENSIONS
   Class-based primitives for the full component set (overlays, navigation
   chrome, data-display, disclosure, date/time). Consumes the token layer and
   ships in the styles.css closure so the React components and consumer markup
   render identically. Flat by default; depth only on genuinely floating layers.
   ========================================================================== */

/* ============================================================================
   OVERLAY SCRIM (Dialog / Sheet / mobile rail)
   ========================================================================== */
.wp-scrim {
  position: fixed; inset: 0; z-index: var(--z-overlay);
  background: var(--overlay);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  animation: wp-fade-in var(--dur-3) var(--ease-out);
}
@keyframes wp-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes wp-fade-out { from { opacity: 1; } to { opacity: 0; } }

/* ============================================================================
   DIALOG  (centered modal)
   ========================================================================== */
.dialog {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: var(--z-modal);
  width: min(calc(100vw - 32px), 480px);
  background: var(--surface); color: var(--surface-foreground);
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  animation: wp-dialog-in var(--dur-3) var(--ease-out);
  max-height: calc(100dvh - 48px); display: flex; flex-direction: column;
}
@keyframes wp-dialog-in {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 8px)) scale(0.98); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.dialog-header { padding: var(--space-5) var(--space-6) 0; display: flex; align-items: flex-start; gap: var(--space-4); }
.dialog-headchip { width: 36px; height: 36px; flex: none; border-radius: var(--radius-md); display: grid; place-content: center; background: var(--primary-subtle); color: var(--primary-subtle-foreground); }
.dialog-headchip.is-destructive { background: var(--destructive-subtle); color: var(--destructive-subtle-foreground); }
.dialog-headchip .icon { width: 18px; height: 18px; }
.dialog-title { font-size: var(--text-lg); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-snug); }
.dialog-desc { font-size: var(--text-sm); color: var(--muted-foreground); margin-top: 3px; line-height: var(--leading-snug); }
.dialog-body { padding: var(--space-5) var(--space-6); overflow-y: auto; font-size: var(--text-base); color: var(--foreground); }
.dialog-body:first-child { padding-top: var(--space-6); }
.dialog-footer { padding: var(--space-4) var(--space-6) var(--space-6); display: flex; align-items: center; justify-content: flex-end; gap: var(--space-3); flex-wrap: wrap; }
.dialog-close { position: absolute; top: 14px; right: 14px; }

/* ============================================================================
   SHEET  (side drawer — the WebPros "drawer")
   ========================================================================== */
.sheet {
  position: fixed; z-index: var(--z-modal);
  background: var(--surface); color: var(--surface-foreground);
  box-shadow: var(--shadow-xl); display: flex; flex-direction: column;
}
.sheet-right, .sheet-left { top: 0; bottom: 0; width: min(calc(100vw - 32px), 460px); border-left: 1px solid var(--border); }
.sheet-right { right: 0; border-left: 1px solid var(--border); animation: wp-sheet-r var(--dur-4) var(--ease-out); }
.sheet-left  { left: 0;  border-right: 1px solid var(--border); border-left: 0; animation: wp-sheet-l var(--dur-4) var(--ease-out); }
.sheet-top, .sheet-bottom { left: 0; right: 0; max-height: 90dvh; }
.sheet-top    { top: 0; border-bottom: 1px solid var(--border); animation: wp-sheet-t var(--dur-4) var(--ease-out); }
.sheet-bottom { bottom: 0; border-top: 1px solid var(--border); animation: wp-sheet-b var(--dur-4) var(--ease-out); }
@keyframes wp-sheet-r { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes wp-sheet-l { from { transform: translateX(-100%); } to { transform: translateX(0); } }
@keyframes wp-sheet-t { from { transform: translateY(-100%); } to { transform: translateY(0); } }
@keyframes wp-sheet-b { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-header { padding: var(--space-5) var(--space-6); border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); }
.sheet-title { font-size: var(--text-lg); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-snug); }
.sheet-desc { font-size: var(--text-sm); color: var(--muted-foreground); margin-top: 3px; line-height: var(--leading-snug); }
.sheet-body { padding: var(--space-6); overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: var(--space-5); }
.sheet-footer { padding: var(--space-4) var(--space-6); border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: flex-end; gap: var(--space-3); }

/* ============================================================================
   POPOVER / HOVER CARD  (floating surface)
   ========================================================================== */
.popover {
  background: var(--popover, var(--surface)); color: var(--surface-foreground);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: var(--space-4);
  animation: wp-pop-in var(--dur-2) var(--ease-out);
}
@keyframes wp-pop-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.popover-anchor { position: relative; display: inline-flex; }
.popover-float { position: absolute; z-index: var(--z-popover); }

/* ============================================================================
   TOOLTIP (React-driven)
   ========================================================================== */
.wp-tooltip {
  position: absolute; z-index: var(--z-popover); pointer-events: none;
  background: var(--n-900); color: var(--n-50);
  font-size: var(--text-xs); font-weight: var(--weight-medium);
  white-space: nowrap; padding: 5px 9px; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md); animation: wp-fade-in var(--dur-1) var(--ease-out);
}
[data-theme="dark"] .wp-tooltip { background: var(--n-200); color: var(--n-900); }

/* ============================================================================
   MENU ITEM EXTENSIONS (Dropdown / Context menu)
   ========================================================================== */
.menu-item.is-destructive { color: var(--destructive); }
.menu-item.is-destructive:hover { background: var(--destructive-subtle); }
.menu-item.is-destructive .icon { color: var(--destructive); }
.menu-item.is-active { background: var(--muted); box-shadow: inset 0 0 0 1px oklch(0.585 0.186 292 / 0.4); }
.menu-item.is-inset { padding-left: 30px; }
.menu-item[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
.menu-item .menu-shortcut { margin-left: auto; font-family: var(--font-mono); font-size: var(--text-2xs); color: var(--muted-foreground); letter-spacing: 0.04em; }
.menu-item .menu-check { margin-left: auto; }
.menu-item .menu-sub-arrow { margin-left: auto; color: var(--muted-foreground); }

/* ============================================================================
   COMMAND PALETTE (⌘K)
   ========================================================================== */
.cmd { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; }
.cmd-dialog { width: min(calc(100vw - 32px), 560px); padding: 0; }
.cmd-input-wrap { display: flex; align-items: center; gap: 9px; padding: 0 14px; border-bottom: 1px solid var(--border); height: 48px; }
.cmd-input-wrap .icon { color: var(--muted-foreground); }
.cmd-input { flex: 1; border: 0; background: transparent; outline: none; font-size: var(--text-md); color: var(--foreground); height: 100%; }
.cmd-input::placeholder { color: var(--muted-foreground); }
.cmd-list { max-height: 340px; overflow-y: auto; padding: 6px; }
.cmd-empty { padding: 28px 12px; text-align: center; font-size: var(--text-sm); color: var(--muted-foreground); }
.cmd-group-label { padding: 8px 9px 4px; font-size: var(--text-2xs); font-weight: var(--weight-semibold); letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted-foreground); }
.cmd-item { display: flex; align-items: center; gap: 10px; padding: 8px 9px; border-radius: var(--radius-sm); font-size: var(--text-base); color: var(--foreground); cursor: pointer; }
.cmd-item .icon { color: var(--muted-foreground); }
.cmd-item[aria-selected="true"] { background: var(--muted); }
.cmd-item .cmd-shortcut { margin-left: auto; font-family: var(--font-mono); font-size: var(--text-2xs); color: var(--muted-foreground); }

/* ============================================================================
   SLIDER
   ========================================================================== */
.slider { position: relative; display: flex; align-items: center; width: 100%; height: 20px; touch-action: none; user-select: none; }
.slider-track { position: relative; flex: 1; height: 5px; border-radius: var(--radius-full); background: var(--muted); border: 1px solid var(--border); }
.slider-range { position: absolute; height: 100%; border-radius: inherit; background: var(--primary); }
.slider-thumb { position: absolute; top: 50%; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--primary); box-shadow: var(--shadow-sm); transform: translate(-50%, -50%); cursor: grab; }
.slider-thumb:focus-visible { outline: none; box-shadow: var(--ring-shadow); }
.slider-thumb:active { cursor: grabbing; }
.slider[data-disabled="true"] { opacity: 0.5; pointer-events: none; }

/* ============================================================================
   INPUT OTP
   ========================================================================== */
.otp { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.otp-group { display: inline-flex; }
.otp-slot { width: 44px; height: 44px; display: grid; place-content: center; font-family: var(--font-mono); font-size: var(--text-lg); color: var(--foreground); background: var(--surface); border: 1px solid var(--input); border-right-width: 0; position: relative; }
.otp-group .otp-slot:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }
.otp-group .otp-slot:last-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; border-right-width: 1px; }
.otp-slot.is-active { border-color: var(--ring); box-shadow: var(--ring-shadow); z-index: 1; border-right-width: 1px; }
.otp-slot.is-active + .otp-slot { border-left-width: 0; }
.otp-caret { width: 1px; height: 20px; background: var(--foreground); animation: wp-blink 1s step-end infinite; }
@keyframes wp-blink { 50% { opacity: 0; } }
.otp-sep { color: var(--muted-foreground); display: grid; place-content: center; }

/* ============================================================================
   SECRET FIELD
   ========================================================================== */
.secret-box { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 6px 0 12px; background: var(--surface-2); border: 1px solid var(--input); border-radius: var(--radius-md); }
.secret-val { flex: 1; font-family: var(--font-mono); font-size: var(--text-sm); color: var(--foreground); letter-spacing: 0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================================
   COMBOBOX / MULTI-SELECT trigger + chips
   ========================================================================== */
.combo-trigger { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px; padding: 0 10px 0 12px; background: var(--surface); border: 1px solid var(--input); border-radius: var(--radius-md); font: inherit; font-size: var(--text-base); color: var(--foreground); cursor: pointer; text-align: left; }
.combo-trigger:hover { border-color: var(--border-strong); }
.combo-trigger:focus-visible { outline: none; border-color: var(--ring); box-shadow: var(--ring-shadow); }
.combo-trigger.is-placeholder { color: var(--muted-foreground); }
.combo-trigger > .combo-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-trigger > .icon { color: var(--muted-foreground); margin-left: auto; }
.combo-chips { display: flex; flex-wrap: wrap; gap: 5px; padding: 5px 8px; }
.combo-chip { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 4px 0 9px; border-radius: var(--radius-sm); background: var(--muted); border: 1px solid var(--border); font-size: var(--text-xs); }
.combo-chip button { display: grid; place-content: center; width: 16px; height: 16px; border: 0; border-radius: var(--radius-xs); background: transparent; color: var(--muted-foreground); cursor: pointer; }
.combo-chip button:hover { background: var(--subtle); color: var(--foreground); }
.combo-opt { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: var(--radius-sm); font-size: var(--text-base); cursor: pointer; }
.combo-opt[aria-selected="true"], .combo-opt:hover { background: var(--muted); }
.combo-opt .combo-check { width: 16px; color: var(--primary); }

/* ============================================================================
   TOGGLE / TOGGLE GROUP
   ========================================================================== */
.toggle { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; min-width: 36px; padding: 0 12px; font-size: var(--text-base); font-weight: var(--weight-medium); border: 1px solid transparent; border-radius: var(--radius-md); background: transparent; color: var(--foreground); cursor: pointer; transition: background var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out); }
.toggle .icon { width: 16px; height: 16px; }
.toggle[data-state="off"]:hover { background: var(--muted); }
.toggle[data-state="on"] { background: var(--primary-subtle); color: var(--primary-subtle-foreground); }
.toggle.toggle-outline { border-color: var(--border); box-shadow: var(--shadow-xs); }
.toggle:focus-visible { outline: none; box-shadow: var(--ring-shadow); border-color: var(--ring); }
.toggle:disabled { opacity: 0.5; pointer-events: none; }
.toggle-sm { height: 30px; min-width: 30px; padding: 0 9px; font-size: var(--text-sm); border-radius: var(--radius-sm); }
.toggle-lg { height: 42px; min-width: 42px; padding: 0 16px; font-size: var(--text-md); border-radius: var(--radius-lg); }
.toggle-group { display: inline-flex; }
.toggle-group.is-outline { border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-xs); }
.toggle-group.is-outline .toggle { border-radius: 0; border-color: transparent; box-shadow: none; border-left: 1px solid var(--border); }
.toggle-group.is-outline .toggle:first-child { border-left: 0; border-radius: var(--radius-md) 0 0 var(--radius-md); }
.toggle-group.is-outline .toggle:last-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; }

/* ============================================================================
   SEPARATOR
   ========================================================================== */
.separator { background: var(--border); border: 0; flex: none; }
.separator-h { height: 1px; width: 100%; }
.separator-v { width: 1px; align-self: stretch; min-height: 1em; }

/* ============================================================================
   PAGINATION
   ========================================================================== */
.pager { display: flex; align-items: center; gap: 4px; }
.pager-btn { display: inline-grid; place-content: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent; color: var(--foreground); font-size: var(--text-sm); font-weight: var(--weight-medium); cursor: pointer; font-variant-numeric: tabular-nums; transition: background var(--dur-2) var(--ease-out); }
.pager-btn:hover { background: var(--muted); }
.pager-btn[aria-current="page"] { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow-xs); }
.pager-btn:disabled { opacity: 0.45; pointer-events: none; }
.pager-ellipsis { display: inline-grid; place-content: center; min-width: 30px; height: 30px; color: var(--muted-foreground); }

/* ============================================================================
   STEPPER
   ========================================================================== */
.stepper { display: flex; gap: 0; list-style: none; margin: 0; padding: 0; }
.stepper-v { flex-direction: column; }
.step { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.stepper-v .step { align-items: flex-start; flex: none; }
.step-indicator { width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-content: center; font-size: var(--text-sm); font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; border: 1.5px solid var(--border-strong); color: var(--muted-foreground); background: var(--surface); }
.step[data-status="complete"] .step-indicator { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.step[data-status="current"] .step-indicator { border-color: var(--primary); color: var(--primary); box-shadow: var(--ring-shadow); }
.step-indicator .icon { width: 15px; height: 15px; }
.step-text { display: flex; flex-direction: column; min-width: 0; }
.step-label { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--foreground); overflow-wrap: break-word; }
.step[data-status="upcoming"] .step-label { color: var(--muted-foreground); }
.step-description { font-size: var(--text-xs); color: var(--muted-foreground); margin-top: 1px; }
.step-connector { flex: 1; height: 1.5px; background: var(--border-strong); margin: 0 8px; min-width: 16px; }
.step[data-status="complete"] .step-connector { background: var(--primary); }
.stepper-v .step-connector { width: 1.5px; height: auto; min-height: 22px; flex: none; margin: 4px 0 4px 12.25px; align-self: stretch; }

/* ============================================================================
   TIMELINE
   ========================================================================== */
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline-item { display: flex; gap: 12px; }
.timeline-rail { display: flex; flex-direction: column; align-items: center; flex: none; }
.timeline-dot { width: 11px; height: 11px; border-radius: 50%; margin-top: 4px; background: var(--muted-foreground); flex: none; }
.timeline-icon { width: 26px; height: 26px; border-radius: 50%; display: grid; place-content: center; flex: none; background: var(--muted); color: var(--muted-foreground); }
.timeline-icon .icon { width: 14px; height: 14px; }
.timeline-dot.tone-success, .timeline-icon.tone-success { background: var(--success-subtle); color: var(--success-subtle-foreground); }
.timeline-dot.tone-success { background: var(--success); }
.timeline-dot.tone-warning { background: var(--warning); }
.timeline-icon.tone-warning { background: var(--warning-subtle); color: var(--warning-subtle-foreground); }
.timeline-dot.tone-destructive { background: var(--destructive); }
.timeline-icon.tone-destructive { background: var(--destructive-subtle); color: var(--destructive-subtle-foreground); }
.timeline-dot.tone-info { background: var(--info); }
.timeline-icon.tone-info { background: var(--info-subtle); color: var(--info-subtle-foreground); }
.timeline-dot.tone-primary { background: var(--primary); }
.timeline-icon.tone-primary { background: var(--primary-subtle); color: var(--primary-subtle-foreground); }
.timeline-connector { width: 1px; flex: 1; background: var(--border); margin: 4px 0; min-height: 14px; }
.timeline-content { padding-bottom: 18px; min-width: 0; }
.timeline-item:last-child .timeline-content { padding-bottom: 0; }
.timeline-title { font-size: var(--text-base); font-weight: var(--weight-medium); color: var(--foreground); overflow-wrap: break-word; }
.timeline-description { font-size: var(--text-sm); color: var(--muted-foreground); margin-top: 2px; line-height: var(--leading-snug); }
.timeline-time { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--muted-foreground); font-variant-numeric: tabular-nums; word-break: break-all; }

/* ============================================================================
   STAT
   ========================================================================== */
.stat { position: relative; padding: var(--space-5); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.stat-label { font-size: var(--text-sm); color: var(--muted-foreground); display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: var(--text-2xl); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); font-variant-numeric: tabular-nums; margin-top: 6px; overflow-wrap: break-word; }
.stat-icon { position: absolute; top: var(--space-5); right: var(--space-5); color: var(--muted-foreground); }
.stat-delta { display: inline-flex; align-items: center; gap: 3px; font-size: var(--text-xs); font-weight: var(--weight-medium); margin-top: 6px; }
.stat-delta .icon { width: 13px; height: 13px; }
.stat-delta.up { color: var(--success); }
.stat-delta.down { color: var(--destructive); }
.stat-delta.flat { color: var(--muted-foreground); }

/* ============================================================================
   TERMINAL
   ========================================================================== */
.terminal { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface-2); }
.terminal-header { display: flex; align-items: center; gap: 8px; padding: 9px 13px; border-bottom: 1px solid var(--border); background: var(--surface); font-size: var(--text-sm); }
.terminal-host { font-family: var(--font-mono); color: var(--foreground); }
.terminal-status { color: var(--muted-foreground); }
.terminal-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.terminal-body { padding: 12px 14px; max-height: 320px; overflow-y: auto; font-family: var(--font-mono); font-size: var(--text-sm); line-height: 1.7; }
.terminal-line { white-space: pre-wrap; word-break: break-word; color: var(--foreground); }
.terminal-line.lv-ok, .terminal-line.lv-success { color: var(--success); }
.terminal-line.lv-warn, .terminal-line.lv-warning { color: var(--warning); }
.terminal-line.lv-err, .terminal-line.lv-error { color: var(--destructive); }
.terminal-line.lv-info { color: var(--info); }
.terminal-line.lv-dim, .terminal-line.lv-muted { color: var(--muted-foreground); }

/* ============================================================================
   DESCRIPTION LIST
   ========================================================================== */
.dl { margin: 0; display: flex; flex-direction: column; }
.dl-item { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.dl-item:last-child { border-bottom: 0; }
.dl-term { font-size: var(--text-sm); color: var(--muted-foreground); min-width: 0; overflow-wrap: break-word; }
.dl-details { font-size: var(--text-base); color: var(--foreground); min-width: 0; overflow-wrap: break-word; }
@media (min-width: 640px) { .dl-item { grid-template-columns: minmax(8rem, 12rem) 1fr; gap: 16px; align-items: baseline; } }

/* ============================================================================
   EMPTY STATE
   ========================================================================== */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 48px 24px; max-width: 24rem; margin: 0 auto; }
.empty-icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-content: center; background: var(--muted); color: var(--muted-foreground); margin-bottom: 4px; }
.empty-icon .icon { width: 20px; height: 20px; }
.empty-title { font-size: var(--text-lg); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-snug); }
.empty-desc { font-size: var(--text-sm); color: var(--muted-foreground); line-height: var(--leading-snug); overflow-wrap: break-word; }
.empty-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }

/* ============================================================================
   TREE
   ========================================================================== */
.tree { list-style: none; margin: 0; padding: 0; }
.tree-group { list-style: none; margin: 0; padding: 0; }
.tree-row { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px; border-radius: var(--radius-sm); cursor: pointer; font-size: var(--text-base); color: var(--foreground); user-select: none; }
.tree-row:hover { background: var(--muted); }
.tree-item[aria-selected="true"] > .tree-row { background: var(--primary-subtle); color: var(--primary-subtle-foreground); }
.tree-item[aria-disabled="true"] > .tree-row { opacity: 0.5; pointer-events: none; }
.tree-row:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--ring); }
.tree-chevron { width: 16px; height: 16px; flex: none; color: var(--muted-foreground); transition: transform var(--dur-2) var(--ease-out); }
.tree-item[aria-expanded="true"] > .tree-row > .tree-chevron { transform: rotate(90deg); }
.tree-chevron.is-leaf { visibility: hidden; }
.tree-icon { width: 16px; height: 16px; flex: none; color: var(--muted-foreground); }
.tree-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================================
   ACCORDION / COLLAPSIBLE
   ========================================================================== */
.accordion { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.accordion-item { border-bottom: 1px solid var(--border); }
.accordion-item:last-child { border-bottom: 0; }
.accordion-trigger { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 14px 16px; border: 0; background: transparent; font: inherit; font-size: var(--text-base); font-weight: var(--weight-medium); color: var(--foreground); text-align: left; cursor: pointer; }
.accordion-trigger:hover { color: var(--foreground); }
.accordion-trigger:focus-visible { outline: none; box-shadow: inset var(--ring-shadow); }
.accordion-chevron { width: 16px; height: 16px; flex: none; color: var(--muted-foreground); transition: transform var(--dur-2) var(--ease-out); }
.accordion-item[data-state="open"] .accordion-chevron { transform: rotate(180deg); }
.accordion-content { overflow: hidden; }
.accordion-body { padding: 0 16px 16px; font-size: var(--text-base); color: var(--muted-foreground); line-height: var(--leading-normal); }

/* ============================================================================
   SCROLL AREA
   ========================================================================== */
.scroll-area { overflow: auto; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.scroll-area::-webkit-scrollbar { width: 8px; height: 8px; }
.scroll-area::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius-full); border: 2px solid var(--surface); }
.scroll-area::-webkit-scrollbar-track { background: transparent; }

/* ============================================================================
   ASPECT RATIO
   ========================================================================== */
.aspect { position: relative; width: 100%; max-width: 100%; overflow: hidden; }
.aspect > * { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ============================================================================
   RESIZABLE
   ========================================================================== */
.resizable { display: flex; width: 100%; }
.resizable-v { flex-direction: column; }
.resizable-panel { overflow: hidden; min-width: 0; min-height: 0; }
.resizable-handle { flex: none; position: relative; background: var(--border); display: grid; place-content: center; }
.resizable:not(.resizable-v) > .resizable-handle { width: 1px; cursor: col-resize; }
.resizable-v > .resizable-handle { height: 1px; cursor: row-resize; }
.resizable-handle::before { content: ""; position: absolute; inset: -6px; }
.resizable-handle:hover, .resizable-handle:focus-visible { background: var(--border-strong); outline: none; }
.resizable-grip { width: 12px; height: 18px; border-radius: var(--radius-xs); background: var(--surface); border: 1px solid var(--border); display: grid; place-content: center; color: var(--muted-foreground); z-index: 1; }
.resizable-v > .resizable-handle .resizable-grip { width: 18px; height: 12px; }

/* ============================================================================
   SIDEBAR (app rail)
   ========================================================================== */
.sidebar { display: flex; flex-direction: column; width: var(--rail-w, 248px); flex: none; background: var(--surface); border-right: 1px solid var(--border); transition: width var(--dur-3) var(--ease-out); }
.sidebar[data-collapsed="true"] { width: 64px; }
.sidebar-header { display: flex; align-items: center; gap: 9px; height: 56px; padding: 0 14px; border-bottom: 1px solid var(--border); }
.sidebar-brand { display: flex; align-items: center; gap: 9px; min-width: 0; border: 0; background: transparent; cursor: pointer; padding: 0; color: inherit; }
.sidebar-mark { width: 26px; height: 26px; flex: none; border-radius: var(--radius-sm); background: linear-gradient(140deg, var(--wp-400), var(--wp-700)); }
.sidebar-brand-name { font-weight: var(--weight-semibold); font-size: var(--text-md); letter-spacing: var(--tracking-snug); white-space: nowrap; }
.sidebar[data-collapsed="true"] .sidebar-brand-name { display: none; }
.sidebar-collapse { margin-left: auto; }
.sidebar[data-collapsed="true"] .sidebar-collapse { display: none; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-section-label { padding: 12px 10px 4px; font-size: var(--text-2xs); font-weight: var(--weight-semibold); letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted-foreground); }
.sidebar[data-collapsed="true"] .sidebar-section-label { visibility: hidden; height: 14px; }
.sidebar-item { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: var(--radius-md); color: var(--foreground); font-size: var(--text-base); font-weight: var(--weight-medium); cursor: pointer; white-space: nowrap; }
.sidebar-item:hover { background: var(--muted); }
.sidebar-item.is-active { background: var(--primary-subtle); color: var(--primary-subtle-foreground); }
.sidebar-item .icon { flex: none; color: var(--muted-foreground); }
.sidebar-item.is-active .icon { color: var(--primary-subtle-foreground); }
.sidebar-item-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sidebar[data-collapsed="true"] .sidebar-item-label { display: none; }
.sidebar-item-badge { margin-left: auto; }
.sidebar[data-collapsed="true"] .sidebar-item-badge { display: none; }
.sidebar[data-collapsed="true"] .sidebar-item { justify-content: center; padding: 0; }
.sidebar-footer { padding: 10px; border-top: 1px solid var(--border); }

/* ============================================================================
   TOPBAR
   ========================================================================== */
.topbar { position: sticky; top: 0; z-index: var(--z-sticky); display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 16px; border-bottom: 1px solid var(--border); background: var(--topbar-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.topbar-search { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; min-width: 200px; max-width: 360px; flex: 1; border: 1px solid var(--input); border-radius: var(--radius-md); background: var(--surface); color: var(--muted-foreground); font-size: var(--text-sm); cursor: pointer; }
.topbar-search:hover { border-color: var(--border-strong); }
.topbar-search .icon { width: 15px; height: 15px; }
.topbar-search .kbd { margin-left: auto; }
.topbar-spacer { flex: 1; }
.topbar-action { position: relative; display: inline-grid; place-content: center; width: 34px; height: 34px; border-radius: var(--radius-md); border: 0; background: transparent; color: var(--foreground); cursor: pointer; }
.topbar-action:hover { background: var(--muted); }
.topbar-action-badge { position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); border: 1.5px solid var(--surface); }

/* ============================================================================
   CALENDAR / DATE PICKER
   ========================================================================== */
.calendar { width: max-content; padding: 4px; }
.calendar-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 8px; }
.calendar-caption { font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.calendar-grid { border-collapse: collapse; }
.calendar-grid th { font-size: var(--text-2xs); font-weight: var(--weight-medium); color: var(--muted-foreground); padding: 4px 0; width: 34px; }
.calendar-day { width: 34px; height: 34px; display: grid; place-content: center; border-radius: var(--radius-sm); border: 0; background: transparent; font-size: var(--text-sm); color: var(--foreground); cursor: pointer; font-variant-numeric: tabular-nums; }
.calendar-day:hover { background: var(--muted); }
.calendar-day.is-outside { color: var(--muted-foreground); opacity: 0.55; }
.calendar-day.is-today { font-weight: var(--weight-semibold); background: var(--accent); color: var(--accent-foreground); }
.calendar-day.is-selected { background: var(--primary); color: var(--primary-foreground); }
.calendar-day.is-in-range { background: var(--accent); color: var(--accent-foreground); border-radius: 0; }
.calendar-day:focus-visible { outline: none; box-shadow: var(--ring-shadow); }
.calendar-day:disabled { opacity: 0.35; pointer-events: none; }

/* ============================================================================
   TOASTER (sonner-style)
   ========================================================================== */
.toaster { position: fixed; bottom: 16px; right: 16px; z-index: var(--z-toast); display: flex; flex-direction: column; gap: 10px; width: min(calc(100vw - 32px), 380px); }
.toast { display: flex; align-items: flex-start; gap: 11px; padding: 13px 14px; background: var(--surface); color: var(--surface-foreground); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); animation: wp-toast-in var(--dur-3) var(--ease-out); }
@keyframes wp-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.toast .icon { width: 17px; height: 17px; margin-top: 1px; flex: none; }
.toast.tone-success .icon { color: var(--success); }
.toast.tone-error .icon { color: var(--destructive); }
.toast.tone-info .icon { color: var(--info); }
.toast-text { flex: 1; min-width: 0; }
.toast-title { font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.toast-desc { font-size: var(--text-sm); color: var(--muted-foreground); margin-top: 2px; line-height: var(--leading-snug); }
.toast-action { margin-left: auto; }
