/* ==================================================
   SIDEBAR TWEAKS — Floating panel (bottom-right)
   ================================================== */
#sb-tweaks-panel {
  position: fixed;
  bottom: 20px; right: 20px;
  width: 300px;
  /* R374 dark-mode: surface token (was #fff) so the floating panel flips
     with the theme — its body text uses --fg-1. */
  background: var(--bg-surface);
  border: 1px solid var(--border-1);
  border-radius: 14px;
  /* C26 system-#10: raw 2-layer popover shadow → theme-aware --shadow-lg. */
  box-shadow: var(--shadow-lg);
  font-family: var(--font-sans);
  color: var(--fg-1);
  display: none;
  z-index: 9999;
  overflow: hidden;
  /* C26 system-#3: --dur-medium/--ease-emphasized don't exist (silently 0s).
     Map to the real --dur-base + --ease-standard tokens. */
  animation: sbt-pop var(--dur-base) var(--ease-standard);
}
#sb-tweaks-panel.open { display: block; }

@keyframes sbt-pop {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.sbt-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-1);
  background: var(--bg-sunken);
}
.sbt-title { font-size: var(--fs-small); font-weight: var(--fw-700); color: var(--fg-1); letter-spacing: -.005em; }
.sbt-sub   { font-size: var(--fs-xs); color: var(--fg-4); margin-top: 1px; }

.sbt-close {
  width: 26px; height: 26px;
  border: none; background: none;
  font-size: var(--fs-xl); line-height: 1; color: var(--fg-3);
  cursor: pointer; border-radius: 6px;
  font-family: inherit;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.sbt-close:hover { background: var(--border-1); color: var(--fg-1); }

.sbt-body { padding: 14px; display: flex; flex-direction: column; gap: 14px; }

.sbt-row { display: flex; flex-direction: column; gap: 7px; }
.sbt-label {
  font-size: var(--fs-xs); text-transform: uppercase; letter-spacing:var(--ls-wide);
  color: var(--fg-4); font-weight: var(--fw-700);
}

.sbt-seg {
  display: flex; gap: 3px;
  padding: 3px;
  background: var(--bg-sunken);
  border: 1px solid var(--border-1);
  border-radius: 9px;
}
.sbt-seg button {
  flex: 1;
  padding: 6px 8px;
  border: none; background: none;
  font-family: inherit; font-size: var(--fs-sm); font-weight: var(--fw-600);
  color: var(--fg-3);
  border-radius: 6px;
  cursor: pointer;
  /* C26 system-#3: --dur-fastest doesn't exist (silently 0s) → --dur-fast. */
  transition: background var(--dur-fast), color var(--dur-fast), box-shadow var(--dur-fast);
}
.sbt-seg button:hover { color: var(--fg-1); }
/* C26 system-#1 / a11y: keyboard focus ring on the segmented (radio) buttons. */
.sbt-seg button:focus-visible { outline: none; box-shadow: var(--ring-focus); }
.sbt-close:focus-visible,
.sbt-action:focus-visible { outline: none; box-shadow: var(--ring-focus); }
.sbt-seg button.active {
  /* R374 dark-mode: blue-50 tint (was #fff) keeps the fixed --dnuv-blue-dark
     label readable on the sunken track in both themes and reads as selected. */
  background: var(--dnuv-blue-50);
  color: var(--dnuv-blue-dark);
  box-shadow: 0 1px 2px rgba(10,31,94,0.10), 0 0 0 1px rgba(10,31,94,.06);
}

.sbt-row-action { margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--border-1); }
.sbt-action {
  display: inline-flex; align-items: center; gap: var(--space-2); justify-content: center;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-1);
  /* R374 dark-mode: surface token (was #fff) so the action button flips with
     its --fg-2 label. */
  background: var(--bg-surface);
  font-family: inherit; font-size: var(--fs-sm); font-weight: var(--fw-700);
  color: var(--fg-2);
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.sbt-action:hover { background: var(--bg-sunken); border-color: var(--dnuv-blue-200); color: var(--dnuv-blue-dark); }
.sbt-action-icon { font-size: var(--fs-base); line-height: 1; }
