/* Resumeboard — reset, primitives, shared components
 * Everything here is app chrome. Nothing here styles the resume document;
 * that lives in templates.css so a design change can never leak into print.
 */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--rb-font-sans);
  font-size: var(--rb-text-base);
  line-height: 1.5;
  color: var(--rb-text);
  background: var(--rb-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
  margin: 0;
}
button { background: none; border: none; padding: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; }

a { color: var(--rb-text-accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

table { border-collapse: collapse; border-spacing: 0; }
hr { border: 0; border-top: 1px solid var(--rb-border); margin: var(--rb-space-4) 0; }

[hidden] { display: none !important; }

/* ---------- Focus ---------- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--rb-accent-500);
  outline-offset: 2px;
  border-radius: var(--rb-radius-xs);
}
.rb-focus-ring:focus-visible { box-shadow: var(--rb-focus-ring); outline: none; }

/* ---------- Screen-reader only ---------- */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  top: 0; left: 50%;
  transform: translate(-50%, -120%);
  z-index: var(--rb-z-toast);
  padding: var(--rb-space-2) var(--rb-space-4);
  background: var(--rb-accent-600);
  color: #fff;
  border-radius: 0 0 var(--rb-radius-md) var(--rb-radius-md);
  font-weight: 600;
  text-decoration: none;
  transition: transform var(--rb-dur-base) var(--rb-ease-out);
}
.skip-link:focus { transform: translate(-50%, 0); }

/* ---------- Layout primitives ---------- */
.rb-row { display: flex; align-items: center; gap: var(--rb-space-2); }
.rb-row-tight { display: flex; align-items: center; gap: var(--rb-space-1); }
.rb-col { display: flex; flex-direction: column; }
.rb-spacer { flex: 1 1 auto; min-width: 0; }
.rb-wrap { flex-wrap: wrap; }
.rb-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rb-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rb-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* `clip` rather than `auto` on the cross axis: the hover tooltips are
 * absolutely-positioned children that stick out past their buttons, and under
 * `auto` they would widen the box and give every scroll region a horizontal
 * scrollbar. Clipping keeps the tooltip visible where there is room and stops
 * it ever forcing a scroll. */
.rb-scroll {
  overflow-y: auto;
  overflow-x: clip;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.rb-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.rb-scroll::-webkit-scrollbar-track { background: transparent; }
.rb-scroll::-webkit-scrollbar-thumb {
  background: var(--rb-border-strong);
  border-radius: var(--rb-radius-full);
  border: 3px solid transparent;
  background-clip: content-box;
}
.rb-scroll::-webkit-scrollbar-thumb:hover { background-color: var(--rb-text-faint); background-clip: content-box; }

/* ---------- Buttons ---------- */
.rb-btn {
  --_bg: transparent;
  --_fg: var(--rb-text);
  --_bd: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--rb-space-2);
  height: 32px;
  padding: 0 var(--rb-space-3);
  border-radius: var(--rb-radius-sm);
  border: 1px solid var(--_bd);
  background: var(--_bg);
  color: var(--_fg);
  font-size: var(--rb-text-base);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
  transition: background var(--rb-dur-fast) var(--rb-ease-out),
              border-color var(--rb-dur-fast) var(--rb-ease-out),
              color var(--rb-dur-fast) var(--rb-ease-out),
              box-shadow var(--rb-dur-fast) var(--rb-ease-out),
              transform var(--rb-dur-fast) var(--rb-ease-out);
}
.rb-btn:active:not(:disabled) { transform: translateY(0.5px) scale(0.995); }
.rb-btn:disabled { opacity: 0.45; }
.rb-btn .rb-i { flex: none; }

.rb-btn--primary {
  --_bg: var(--rb-accent-600);
  --_fg: #fff;
  --_bd: var(--rb-accent-600);
  box-shadow: var(--rb-shadow-xs);
}
.rb-btn--primary:hover:not(:disabled) { --_bg: var(--rb-accent-700); --_bd: var(--rb-accent-700); }
.rb-btn--primary:active:not(:disabled) { --_bg: var(--rb-accent-800); }

.rb-btn--secondary { --_bg: var(--rb-bg-elevated); --_bd: var(--rb-border-strong); box-shadow: var(--rb-shadow-xs); }
.rb-btn--secondary:hover:not(:disabled) { --_bg: var(--rb-bg-hover); }

.rb-btn--ghost { --_fg: var(--rb-text-secondary); }
.rb-btn--ghost:hover:not(:disabled) { --_bg: var(--rb-bg-hover); --_fg: var(--rb-text); }
.rb-btn--ghost[aria-pressed="true"], .rb-btn--ghost.is-active { --_bg: var(--rb-accent-50); --_fg: var(--rb-accent-700); }
html[data-theme="dark"] .rb-btn--ghost[aria-pressed="true"],
html[data-theme="dark"] .rb-btn--ghost.is-active { --_bg: var(--rb-accent-900); --_fg: var(--rb-accent-200); }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .rb-btn--ghost[aria-pressed="true"],
  html:not([data-theme="light"]) .rb-btn--ghost.is-active { --_bg: var(--rb-accent-900); --_fg: var(--rb-accent-200); }
}

.rb-btn--danger { --_fg: var(--rb-red-500); }
.rb-btn--danger:hover:not(:disabled) { --_bg: var(--rb-red-50); --_fg: var(--rb-red-700); }
/* One red cannot serve both surfaces: red-500 is 4.8:1 on the light background
 * and 3.6:1 on the dark one, and the light hover foreground is 1.8:1 on the
 * dark hover tint. Each theme takes the red from the far end of the same ramp,
 * which is why red-200 and red-700 are both already in the token set. */
html[data-theme="dark"] .rb-btn--danger { --_fg: var(--rb-red-200); }
html[data-theme="dark"] .rb-btn--danger:hover:not(:disabled) { --_bg: rgba(217,45,32,.14); --_fg: var(--rb-red-200); }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .rb-btn--danger { --_fg: var(--rb-red-200); }
  html:not([data-theme="light"]) .rb-btn--danger:hover:not(:disabled) { --_bg: rgba(217,45,32,.14); --_fg: var(--rb-red-200); }
}

.rb-btn--sm { height: 26px; padding: 0 var(--rb-space-2); font-size: var(--rb-text-xs); }
.rb-btn--lg { height: 40px; padding: 0 var(--rb-space-5); font-size: var(--rb-text-md); border-radius: var(--rb-radius-md); }
.rb-btn--icon { width: 32px; padding: 0; }
.rb-btn--icon.rb-btn--sm { width: 26px; }
.rb-btn--block { width: 100%; }

.rb-btn-group { display: inline-flex; }
.rb-btn-group > .rb-btn { border-radius: 0; margin-left: -1px; }
.rb-btn-group > .rb-btn:first-child { border-radius: var(--rb-radius-sm) 0 0 var(--rb-radius-sm); margin-left: 0; }
.rb-btn-group > .rb-btn:last-child { border-radius: 0 var(--rb-radius-sm) var(--rb-radius-sm) 0; }

/* ---------- Form controls ---------- */
.rb-field { display: flex; flex-direction: column; gap: var(--rb-space-1); min-width: 0; }
.rb-label {
  font-size: var(--rb-text-xs);
  font-weight: 600;
  color: var(--rb-text-secondary);
  letter-spacing: 0.01em;
  display: flex; align-items: center; gap: var(--rb-space-1);
}
.rb-hint { font-size: var(--rb-text-xs); color: var(--rb-text-muted); }
.rb-error-text { font-size: var(--rb-text-xs); color: var(--rb-red-500); display: flex; align-items: center; gap: var(--rb-space-1); }

.rb-input, .rb-select, .rb-textarea {
  width: 100%;
  min-height: 32px;
  padding: 5px var(--rb-space-2);
  border: 1px solid var(--rb-border-strong);
  border-radius: var(--rb-radius-sm);
  background: var(--rb-bg-elevated);
  color: var(--rb-text);
  font-size: var(--rb-text-base);
  transition: border-color var(--rb-dur-fast) var(--rb-ease-out), box-shadow var(--rb-dur-fast) var(--rb-ease-out);
}
.rb-input::placeholder, .rb-textarea::placeholder { color: var(--rb-text-faint); }
.rb-input:hover, .rb-select:hover, .rb-textarea:hover { border-color: var(--rb-text-faint); }
.rb-input:focus, .rb-select:focus, .rb-textarea:focus {
  border-color: var(--rb-accent-500);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--rb-accent-500) 18%, transparent);
  outline: none;
}
.rb-input[aria-invalid="true"], .rb-textarea[aria-invalid="true"] { border-color: var(--rb-red-500); }
.rb-textarea { min-height: 72px; resize: vertical; line-height: 1.5; }
.rb-input--sm, .rb-select--sm { min-height: 28px; height: 28px; font-size: var(--rb-text-sm); }

.rb-select {
  appearance: none;
  padding-right: var(--rb-space-6);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%23697386' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--rb-space-2) center;
  cursor: pointer;
}

.rb-checkbox, .rb-radio {
  display: inline-flex; align-items: flex-start; gap: var(--rb-space-2);
  cursor: pointer; font-size: var(--rb-text-base); line-height: 1.4;
}
.rb-checkbox input, .rb-radio input {
  flex: none;
  width: 16px; height: 16px;
  margin: 1px 0 0;
  accent-color: var(--rb-accent-600);
  cursor: pointer;
}

.rb-input-group { position: relative; display: flex; align-items: center; }
.rb-input-group .rb-input { padding-left: var(--rb-space-7); }
.rb-input-icon {
  position: absolute; left: var(--rb-space-2);
  color: var(--rb-text-faint); pointer-events: none;
  display: flex;
}
.rb-input-clear {
  position: absolute; right: var(--rb-space-1);
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--rb-radius-xs);
  color: var(--rb-text-faint);
}
.rb-input-clear:hover { background: var(--rb-bg-hover); color: var(--rb-text); }

/* Range slider */
.rb-range { -webkit-appearance: none; appearance: none; width: 100%; height: 20px; background: transparent; cursor: pointer; }
.rb-range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--rb-bg-active); }
.rb-range::-moz-range-track { height: 4px; border-radius: 2px; background: var(--rb-bg-active); }
.rb-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; margin-top: -5px;
  border-radius: 50%; background: var(--rb-bg-elevated);
  border: 1px solid var(--rb-border-strong);
  box-shadow: var(--rb-shadow-sm);
  transition: transform var(--rb-dur-fast) var(--rb-ease-out);
}
.rb-range::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--rb-bg-elevated); border: 1px solid var(--rb-border-strong); box-shadow: var(--rb-shadow-sm);
}
.rb-range:hover::-webkit-slider-thumb { border-color: var(--rb-accent-500); }
.rb-range:focus-visible::-webkit-slider-thumb { box-shadow: var(--rb-focus-ring); }
.rb-range:disabled { opacity: 0.5; cursor: not-allowed; }

/* Switch */
.rb-switch { display: inline-flex; align-items: center; gap: var(--rb-space-2); cursor: pointer; }
.rb-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.rb-switch-track {
  flex: none; width: 34px; height: 20px;
  border-radius: var(--rb-radius-full);
  background: var(--rb-bg-active);
  border: 1px solid var(--rb-border-strong);
  position: relative;
  transition: background var(--rb-dur-base) var(--rb-ease-out), border-color var(--rb-dur-base) var(--rb-ease-out);
}
.rb-switch-track::after {
  content: ''; position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--rb-bg-elevated);
  box-shadow: var(--rb-shadow-sm);
  transition: transform var(--rb-dur-base) var(--rb-ease-spring);
}
.rb-switch input:checked + .rb-switch-track { background: var(--rb-accent-600); border-color: var(--rb-accent-600); }
.rb-switch input:checked + .rb-switch-track::after { transform: translateX(14px); background: #fff; }
.rb-switch input:focus-visible + .rb-switch-track { box-shadow: var(--rb-focus-ring); }

/* ---------- Badges / pills ---------- */
.rb-badge {
  display: inline-flex; align-items: center; gap: var(--rb-space-1);
  padding: 1px var(--rb-space-2);
  border-radius: var(--rb-radius-full);
  font-size: var(--rb-text-2xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--rb-bg-sunken);
  color: var(--rb-text-secondary);
  white-space: nowrap;
}
.rb-badge--pass { background: var(--rb-green-50); color: var(--rb-green-700); }
.rb-badge--warn { background: var(--rb-amber-50); color: var(--rb-amber-700); }
.rb-badge--fail { background: var(--rb-red-50); color: var(--rb-red-700); }
.rb-badge--info { background: var(--rb-blue-50); color: var(--rb-blue-700); }
.rb-badge--accent { background: var(--rb-accent-50); color: var(--rb-accent-700); }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .rb-badge--pass { background: rgba(4,120,87,.18); color: #6ee7b7; }
  html:not([data-theme="light"]) .rb-badge--warn { background: rgba(181,71,8,.20); color: #fcd34d; }
  html:not([data-theme="light"]) .rb-badge--fail { background: rgba(217,45,32,.18); color: #fca5a5; }
  html:not([data-theme="light"]) .rb-badge--info { background: rgba(2,106,162,.20); color: #7dd3fc; }
  html:not([data-theme="light"]) .rb-badge--accent { background: rgba(71,67,224,.22); color: #a5b4fc; }
}
html[data-theme="dark"] .rb-badge--pass { background: rgba(4,120,87,.18); color: #6ee7b7; }
html[data-theme="dark"] .rb-badge--warn { background: rgba(181,71,8,.20); color: #fcd34d; }
html[data-theme="dark"] .rb-badge--fail { background: rgba(217,45,32,.18); color: #fca5a5; }
html[data-theme="dark"] .rb-badge--info { background: rgba(2,106,162,.20); color: #7dd3fc; }
html[data-theme="dark"] .rb-badge--accent { background: rgba(71,67,224,.22); color: #a5b4fc; }

.rb-kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 4px;
  font-family: var(--rb-font-mono);
  font-size: var(--rb-text-2xs);
  font-weight: 600;
  color: var(--rb-text-muted);
  background: var(--rb-bg-sunken);
  border: 1px solid var(--rb-border);
  border-bottom-width: 2px;
  border-radius: var(--rb-radius-xs);
}

/* ---------- Cards & panels ---------- */
.rb-card {
  background: var(--rb-bg-elevated);
  border: 1px solid var(--rb-border);
  border-radius: var(--rb-radius-lg);
  box-shadow: var(--rb-shadow-xs);
}
.rb-panel-head {
  display: flex; align-items: center; gap: var(--rb-space-2);
  padding: var(--rb-space-3) var(--rb-space-4);
  border-bottom: 1px solid var(--rb-border-subtle);
  min-height: 44px;
}
.rb-panel-title { font-size: var(--rb-text-md); font-weight: 650; letter-spacing: -0.01em; }
.rb-panel-body { padding: var(--rb-space-4); }

.rb-divider { height: 1px; background: var(--rb-border-subtle); border: 0; margin: 0; }
.rb-divider--v { width: 1px; height: 20px; background: var(--rb-border); margin: 0 var(--rb-space-1); }

/* ---------- Tooltip ---------- */
.rb-tip { position: relative; }
.rb-tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(2px);
  padding: 4px 8px;
  background: var(--rb-gray-900);
  color: #fff;
  font-size: var(--rb-text-xs);
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  border-radius: var(--rb-radius-xs);
  box-shadow: var(--rb-shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--rb-dur-fast) var(--rb-ease-out), transform var(--rb-dur-fast) var(--rb-ease-out);
  z-index: var(--rb-z-popover);
}
.rb-tip:hover::after, .rb-tip:focus-visible::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.rb-tip--below::after { bottom: auto; top: calc(100% + 6px); }
@media (hover: none) { .rb-tip::after { display: none; } }

/* ---------- Modal ---------- */
.rb-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(12,16,23,.55);
  backdrop-filter: blur(2px);
  z-index: var(--rb-z-modal);
  display: flex; align-items: center; justify-content: center;
  padding: var(--rb-space-4);
  animation: rb-fade var(--rb-dur-base) var(--rb-ease-out);
}
.rb-modal {
  background: var(--rb-bg-elevated);
  border: 1px solid var(--rb-border);
  border-radius: var(--rb-radius-xl);
  box-shadow: var(--rb-shadow-xl);
  width: min(560px, 100%);
  max-height: min(84vh, 720px);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: rb-pop var(--rb-dur-base) var(--rb-ease-out);
}
.rb-modal--wide { width: min(880px, 100%); }
.rb-modal-head { display: flex; align-items: flex-start; gap: var(--rb-space-3); padding: var(--rb-space-5) var(--rb-space-5) var(--rb-space-3); }
.rb-modal-body { padding: 0 var(--rb-space-5) var(--rb-space-4); overflow-y: auto; flex: 1; }
.rb-modal-foot {
  display: flex; align-items: center; gap: var(--rb-space-2);
  padding: var(--rb-space-3) var(--rb-space-5);
  border-top: 1px solid var(--rb-border-subtle);
  background: var(--rb-bg-inset);
}
@keyframes rb-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rb-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Toast ---------- */
.rb-toasts {
  position: fixed;
  bottom: var(--rb-space-4);
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--rb-z-toast);
  display: flex; flex-direction: column-reverse; gap: var(--rb-space-2);
  pointer-events: none;
  width: min(440px, calc(100vw - 2rem));
}
.rb-toast {
  display: flex; align-items: flex-start; gap: var(--rb-space-2);
  padding: var(--rb-space-3) var(--rb-space-4);
  background: var(--rb-gray-900);
  color: #fff;
  border-radius: var(--rb-radius-md);
  box-shadow: var(--rb-shadow-lg);
  font-size: var(--rb-text-base);
  pointer-events: auto;
  animation: rb-toast-in var(--rb-dur-base) var(--rb-ease-out);
}
.rb-toast--success { background: var(--rb-green-700); }
.rb-toast--error { background: var(--rb-red-700); }
.rb-toast__action {
  margin-left: auto; flex: none;
  color: #fff; font-weight: 600; text-decoration: underline; font-size: var(--rb-text-sm);
}
@keyframes rb-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.rb-toast.is-leaving { animation: rb-toast-out var(--rb-dur-fast) var(--rb-ease-in-out) forwards; }
@keyframes rb-toast-out { to { opacity: 0; transform: translateY(4px); } }

/* ---------- Popover ---------- */
.rb-pop {
  position: absolute;
  z-index: var(--rb-z-popover);
  background: var(--rb-bg-elevated);
  border: 1px solid var(--rb-border);
  border-radius: var(--rb-radius-lg);
  box-shadow: var(--rb-shadow-xl);
  padding: var(--rb-space-1);
  min-width: 200px;
  max-height: 70vh;
  overflow-y: auto;
  animation: rb-pop-sm var(--rb-dur-fast) var(--rb-ease-out);
}
@keyframes rb-pop-sm { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.rb-pop__item {
  display: flex; align-items: center; gap: var(--rb-space-2);
  width: 100%;
  padding: var(--rb-space-2) var(--rb-space-2);
  border-radius: var(--rb-radius-sm);
  font-size: var(--rb-text-base);
  text-align: left;
  color: var(--rb-text);
  transition: background var(--rb-dur-fast) var(--rb-ease-out);
}
.rb-pop__item:hover, .rb-pop__item:focus-visible { background: var(--rb-bg-hover); }
.rb-pop__item[aria-checked="true"] { background: var(--rb-accent-50); color: var(--rb-accent-700); font-weight: 550; }
html[data-theme="dark"] .rb-pop__item[aria-checked="true"] { background: var(--rb-accent-900); color: var(--rb-accent-200); }
.rb-pop__sep { height: 1px; background: var(--rb-border-subtle); margin: var(--rb-space-1) 0; }
.rb-pop__label { padding: var(--rb-space-2) var(--rb-space-2) var(--rb-space-1); font-size: var(--rb-text-2xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--rb-text-faint); }

/* ---------- Segmented control ---------- */
.rb-seg {
  display: inline-flex;
  padding: 2px;
  background: var(--rb-bg-sunken);
  border-radius: var(--rb-radius-md);
  gap: 2px;
}
.rb-seg__btn {
  padding: 4px var(--rb-space-3);
  border-radius: var(--rb-radius-sm);
  font-size: var(--rb-text-sm);
  font-weight: 550;
  color: var(--rb-text-muted);
  transition: background var(--rb-dur-fast) var(--rb-ease-out), color var(--rb-dur-fast) var(--rb-ease-out);
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: var(--rb-space-1);
}
.rb-seg__btn:hover { color: var(--rb-text); }
.rb-seg__btn[aria-selected="true"] {
  background: var(--rb-bg-elevated);
  color: var(--rb-text);
  box-shadow: var(--rb-shadow-xs);
}

/* ---------- Tabs ---------- */
.rb-tabs { display: flex; gap: var(--rb-space-1); border-bottom: 1px solid var(--rb-border); }
.rb-tab {
  position: relative;
  padding: var(--rb-space-2) var(--rb-space-3);
  font-size: var(--rb-text-base);
  font-weight: 550;
  color: var(--rb-text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--rb-dur-fast) var(--rb-ease-out), border-color var(--rb-dur-fast) var(--rb-ease-out);
  display: inline-flex; align-items: center; gap: var(--rb-space-2);
  white-space: nowrap;
}
.rb-tab:hover { color: var(--rb-text); }
.rb-tab[aria-selected="true"] { color: var(--rb-accent-700); border-bottom-color: var(--rb-accent-600); }
html[data-theme="dark"] .rb-tab[aria-selected="true"] { color: var(--rb-accent-300); }
.rb-tab__count {
  font-size: var(--rb-text-2xs); font-weight: 700;
  padding: 0 5px; border-radius: var(--rb-radius-full);
  background: var(--rb-bg-sunken); color: var(--rb-text-muted);
  min-width: 16px; text-align: center;
}

/* ---------- Empty state ---------- */
.rb-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--rb-space-3);
  padding: var(--rb-space-12) var(--rb-space-6);
  text-align: center;
  color: var(--rb-text-muted);
}
.rb-empty__icon {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: var(--rb-radius-lg);
  background: var(--rb-bg-sunken);
  color: var(--rb-text-faint);
}
.rb-empty__title { font-size: var(--rb-text-lg); font-weight: 600; color: var(--rb-text); }
.rb-empty__text { font-size: var(--rb-text-base); max-width: 42ch; }

/* ---------- Progress ---------- */
.rb-progress { height: 4px; border-radius: 2px; background: var(--rb-bg-sunken); overflow: hidden; }
.rb-progress__bar { height: 100%; background: var(--rb-accent-600); border-radius: 2px; transition: width var(--rb-dur-slow) var(--rb-ease-out); }

/* ---------- Icon sizing ---------- */
.rb-i { width: 16px; height: 16px; flex: none; stroke-width: 1.75; }
.rb-i--sm { width: 14px; height: 14px; }
.rb-i--lg { width: 20px; height: 20px; }
.rb-i--xl { width: 28px; height: 28px; stroke-width: 1.5; }

/* ---------- Utility ---------- */
.rb-text-mono { font-family: var(--rb-font-mono); font-size: var(--rb-text-xs); }
.rb-numeric { font-variant-numeric: tabular-nums; }
.rb-nowrap { white-space: nowrap; }
.rb-cursor-pointer { cursor: pointer; }
[contenteditable]:focus { outline: none; }
[contenteditable]:focus-visible { outline: 2px solid var(--rb-accent-500); outline-offset: 1px; border-radius: 2px; }
