/* RemarkRoom UI — component styles. Every colour, space, radius and shadow is a token from tokens.css.
   Rule kept from the old dashboard's contrast defect: no rule sets a background without also setting a color. */

.rr-root, .rr-shell, .rr-card, .rr-dialog, .rr-field, .rr-btn, .rr-table, .rr-thread, .rr-comment, .rr-banner, .rr-toast, .rr-empty, .rr-tabs, .rr-sidenav, .rr-stats, .rr-pagehead {
  font-family: var(--font-sans); -webkit-font-smoothing: antialiased; box-sizing: border-box;
}
.rr-root *, .rr-shell *, .rr-dialog * { box-sizing: border-box; }
.rr-icon { flex: none; display: inline-block; vertical-align: middle; }

:where(.rr-btn, .rr-chip, .rr-tab, .rr-sidenav__item, .rr-thread, .rr-menu__item, .rr-switch__track, .rr-shot, .rr-stat--link, .rr-shell__company, .rr-toast__action, .rr-toast__close, a, input, select, textarea):focus-visible {
  outline: 2px solid var(--border-focus); outline-offset: 2px;
}

/* ---------- Button ---------- */
.rr-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: var(--size-control-md); padding: 0 var(--space-3); border-radius: var(--radius-md);
  font: 500 13px/18px var(--font-sans); letter-spacing: 0; white-space: nowrap; cursor: pointer;
  border: 1px solid transparent; transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.rr-btn--sm { height: var(--size-control-sm); padding: 0 var(--space-2); font-size: 12px; gap: var(--space-1); }
.rr-btn--lg { height: var(--size-control-lg); padding: 0 var(--space-4); font-size: 14px; }
.rr-btn--full { width: 100%; }
.rr-btn--primary { background: var(--accent); color: var(--on-accent); }
.rr-btn--primary:hover:not(:disabled) { background: var(--accent-hover); color: var(--on-accent); }
.rr-btn--primary:active:not(:disabled) { background: var(--accent-pressed); color: var(--on-accent); }
.rr-btn--secondary { background: var(--bg-surface); color: var(--text-primary); border-color: var(--border-strong); }
.rr-btn--secondary:hover:not(:disabled) { background: var(--bg-hover); color: var(--text-primary); }
.rr-btn--ghost { background: transparent; color: var(--text-secondary); }
.rr-btn--ghost:hover:not(:disabled) { background: var(--bg-hover); color: var(--text-primary); }
.rr-btn--danger { background: var(--danger); color: var(--text-inverse); }
.rr-btn--danger:hover:not(:disabled) { background: var(--danger-hover); color: var(--text-inverse); }
.rr-btn--danger-ghost { background: transparent; color: var(--danger-text); }
.rr-btn--danger-ghost:hover:not(:disabled) { background: var(--danger-subtle); color: var(--danger-text); }
.rr-btn:disabled { cursor: not-allowed; background: var(--bg-sunken); color: var(--text-disabled); border-color: var(--border-subtle); }
.rr-btn--ghost:disabled { background: transparent; color: var(--text-disabled); border-color: transparent; }
.rr-btn.is-loading:disabled { cursor: progress; }
.rr-iconbtn { width: var(--size-control-md); padding: 0; }
.rr-iconbtn.rr-btn--sm { width: var(--size-control-sm); }
.rr-spinner { width: 14px; height: 14px; border-radius: var(--radius-full); border: 2px solid currentColor; border-right-color: transparent; animation: rr-spin .7s linear infinite; }
@keyframes rr-spin { to { transform: rotate(360deg); } }

/* ---------- Fields ---------- */
.rr-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rr-field__top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); }
.rr-field__label { font: 500 13px/18px var(--font-sans); color: var(--text-primary); padding: 0; }
.rr-field__optional { font-weight: 400; color: var(--text-tertiary); }
.rr-field__hint { margin: 0; font: 400 12px/16px var(--font-sans); color: var(--text-secondary); }
.rr-field__error { margin: 0; display: flex; gap: var(--space-1); align-items: flex-start; font: 400 12px/16px var(--font-sans); color: var(--danger-text); }
.rr-field__error .rr-icon { margin-top: 1px; }
.rr-field__count { font: 400 12px/16px var(--font-sans); color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.rr-field__count.is-over { color: var(--danger-text); }

.rr-input {
  position: relative; display: flex; align-items: center; gap: var(--space-2);
  height: var(--size-control-md); padding: 0 var(--space-3); border-radius: var(--radius-md);
  background: var(--bg-surface); color: var(--text-primary); border: 1px solid var(--border-strong);
}
.rr-input--sm { height: var(--size-control-sm); padding: 0 var(--space-2); }
.rr-input--lg { height: var(--size-control-lg); }
.rr-input:hover { border-color: var(--text-tertiary); }
.rr-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.rr-input input, .rr-input select {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; padding: 0; background: transparent; color: inherit;
  font: 400 14px/20px var(--font-sans);
}
.rr-input input::placeholder, .rr-textarea::placeholder { color: var(--text-tertiary); opacity: 1; }
.rr-input--mono input { font-family: var(--font-mono); font-size: 13px; }
.rr-input__icon { color: var(--text-tertiary); }
.rr-field.has-error .rr-input, .rr-field.has-error .rr-textarea { border-color: var(--danger); }
.rr-field.has-error .rr-input:focus-within { box-shadow: 0 0 0 1px var(--danger); }
.rr-input.is-disabled { background: var(--bg-sunken); color: var(--text-disabled); border-color: var(--border-default); }
.rr-input.is-readonly { background: var(--bg-sunken); color: var(--text-secondary); border-color: var(--border-default); }
.rr-input :focus-visible { outline: none; }
.rr-select select { appearance: none; -webkit-appearance: none; padding-right: 20px; cursor: pointer; }
.rr-select__chevron { position: absolute; right: var(--space-3); color: var(--text-secondary); pointer-events: none; }
.rr-textarea {
  width: 100%; min-height: 80px; resize: vertical; padding: var(--space-2) var(--space-3); border-radius: var(--radius-md);
  background: var(--bg-surface); color: var(--text-primary); border: 1px solid var(--border-strong);
  font: 400 14px/20px var(--font-sans);
}
.rr-textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

/* ---------- Checkbox, radio, switch ---------- */
.rr-check, .rr-radio { display: inline-flex; align-items: flex-start; gap: var(--space-2); cursor: pointer; position: relative; font-family: var(--font-sans); }
.rr-check__input, .rr-radio__input { position: absolute; opacity: 0; width: 16px; height: 16px; margin: 0; cursor: pointer; }
.rr-check__box {
  flex: none; width: 16px; height: 16px; margin-top: 2px; border-radius: var(--radius-sm);
  background: var(--bg-surface); color: transparent; border: 1px solid var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center;
}
.rr-check__box .rr-icon { stroke-width: 3; }
.rr-check__input:checked + .rr-check__box { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.rr-check__input:focus-visible + .rr-check__box, .rr-radio__input:focus-visible + .rr-radio__dot { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.rr-check__text { display: flex; flex-direction: column; gap: 2px; }
.rr-check__label { font: 400 14px/20px var(--font-sans); color: var(--text-primary); }
.rr-check__desc { font: 400 12px/16px var(--font-sans); color: var(--text-secondary); }
.rr-check.is-disabled, .rr-radio.is-disabled { cursor: not-allowed; }
.rr-check.is-disabled .rr-check__label, .rr-radio.is-disabled .rr-check__label { color: var(--text-disabled); }
.rr-radios { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.rr-radios legend { margin-bottom: var(--space-2); }
.rr-radios__list { display: flex; flex-direction: column; gap: var(--space-3); }
.rr-radios__list.is-row { flex-direction: row; gap: var(--space-6); }
.rr-radio__dot { flex: none; width: 16px; height: 16px; margin-top: 2px; border-radius: var(--radius-full); background: var(--bg-surface); color: var(--text-primary); border: 1px solid var(--border-strong); position: relative; }
.rr-radio__input:checked + .rr-radio__dot { border: 5px solid var(--accent); }
.rr-switch { display: inline-flex; align-items: flex-start; gap: var(--space-3); }
.rr-switch__track { flex: none; width: 32px; height: 18px; margin-top: 1px; padding: 0; border-radius: var(--radius-full); border: 1px solid var(--border-strong); background: var(--bg-sunken); color: var(--text-primary); cursor: pointer; position: relative; }
.rr-switch__thumb { position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: var(--radius-full); background: var(--text-tertiary); transition: transform .14s ease; }
.rr-switch__track.is-on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.rr-switch__track.is-on .rr-switch__thumb { transform: translateX(14px); background: var(--bg-surface); }
.rr-switch.is-disabled { opacity: .55; }

/* ---------- Badge, status, severity, monogram, kbd ---------- */
.rr-badge {
  display: inline-flex; align-items: center; gap: var(--space-1); height: 20px; padding: 0 var(--space-2);
  border-radius: var(--radius-full); font: 500 12px/16px var(--font-sans); white-space: nowrap; border: 1px solid transparent;
}
.rr-badge__dot { width: 6px; height: 6px; border-radius: var(--radius-full); background: currentColor; }
.rr-badge--subtle.rr-badge--neutral { background: var(--bg-sunken); color: var(--text-secondary); }
.rr-badge--subtle.rr-badge--accent { background: var(--accent-subtle); color: var(--accent-text); }
.rr-badge--subtle.rr-badge--success { background: var(--success-subtle); color: var(--success-text); }
.rr-badge--subtle.rr-badge--warning { background: var(--warning-subtle); color: var(--warning-text); }
.rr-badge--subtle.rr-badge--danger { background: var(--danger-subtle); color: var(--danger-text); }
.rr-badge--outline { background: var(--bg-surface); color: var(--text-secondary); border-color: var(--border-default); }
.rr-badge--outline.rr-badge--accent { color: var(--accent-text); }
.rr-badge--outline.rr-badge--success { color: var(--success-text); }
.rr-badge--outline.rr-badge--warning { color: var(--warning-text); }
.rr-badge--outline.rr-badge--danger { color: var(--danger-text); }

.rr-status { display: inline-flex; align-items: center; height: 20px; padding: 0 var(--space-2); border-radius: var(--radius-full); font: 500 12px/16px var(--font-sans); white-space: nowrap; }
.rr-status--blue { background: var(--status-blue-fill); color: var(--status-blue-text); }
.rr-status--amber { background: var(--status-amber-fill); color: var(--status-amber-text); }
.rr-status--purple { background: var(--status-purple-fill); color: var(--status-purple-text); }
.rr-status--green { background: var(--status-green-fill); color: var(--status-green-text); }
.rr-status--grey { background: var(--status-grey-fill); color: var(--status-grey-text); }
.rr-status--red { background: var(--status-red-fill); color: var(--status-red-text); }
.rr-status--teal { background: var(--status-teal-fill); color: var(--status-teal-text); }
.rr-status--pink { background: var(--status-pink-fill); color: var(--status-pink-text); }

.rr-sev { display: inline-flex; align-items: center; gap: 6px; font: 500 12px/16px var(--font-sans); color: var(--text-secondary); white-space: nowrap; }
.rr-sev__bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 10px; }
.rr-sev__bars i { display: block; width: 3px; border-radius: 1px; background: var(--border-default); }
.rr-sev__bars i:nth-child(1) { height: 4px; } .rr-sev__bars i:nth-child(2) { height: 6px; } .rr-sev__bars i:nth-child(3) { height: 8px; } .rr-sev__bars i:nth-child(4) { height: 10px; }
.rr-sev__bars i.on { background: currentColor; }
.rr-sev--danger { color: var(--danger-text); }
.rr-sev--warning { color: var(--warning-text); }
.rr-sev--neutral { color: var(--text-secondary); }
.rr-sev--unset { color: var(--text-tertiary); font-weight: 400; }

.rr-mono {
  flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-full);
  background: var(--bg-sunken); color: var(--text-secondary); border: 1px solid var(--border-subtle);
  font: 600 10px/1 var(--font-sans); letter-spacing: .02em; user-select: none;
}
.rr-mono--sm { width: 20px; height: 20px; font-size: 9px; }
.rr-mono--md { width: 28px; height: 28px; font-size: 11px; }
.rr-mono--lg { width: 36px; height: 36px; font-size: 13px; }
.rr-mono--team { background: var(--accent-subtle); color: var(--accent-text); border-color: transparent; }
.rr-kbd { display: inline-flex; align-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--radius-sm); background: var(--bg-surface); color: var(--text-secondary); border: 1px solid var(--border-default); border-bottom-width: 2px; font: 500 11px/1 var(--font-mono); }

/* ---------- Card, page header ---------- */
.rr-card { background: var(--bg-surface); color: var(--text-primary); border: 1px solid var(--border-default); border-radius: var(--radius-lg); min-width: 0; }
.rr-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); padding: var(--space-4) var(--space-4) 0; }
.rr-card__title { margin: 0; font: 600 15px/22px var(--font-sans); color: var(--text-primary); }
.rr-card__desc { margin: 2px 0 0; font: 400 13px/18px var(--font-sans); color: var(--text-secondary); }
.rr-card__actions { display: flex; gap: var(--space-2); flex: none; }
.rr-card__body { padding: var(--space-4); }
.rr-card--pad-lg .rr-card__head { padding: var(--space-6) var(--space-6) 0; }
.rr-card--pad-lg .rr-card__body { padding: var(--space-6); }
.rr-card--pad-none .rr-card__body { padding: 0; }
.rr-card--pad-none .rr-card__head { padding-bottom: var(--space-4); }
.rr-card__foot { display: flex; justify-content: flex-end; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border-subtle); background: var(--bg-sunken); color: var(--text-secondary); border-radius: 0 0 var(--radius-lg) var(--radius-lg); font: 400 12px/16px var(--font-sans); align-items: center; }

.rr-pagehead { display: flex; flex-direction: column; gap: var(--space-2); }
.rr-crumbs { display: flex; align-items: center; gap: var(--space-1); font: 400 13px/18px var(--font-sans); color: var(--text-tertiary); }
.rr-crumbs a { color: var(--text-secondary); text-decoration: none; }
.rr-crumbs a:hover { color: var(--text-primary); text-decoration: underline; }
.rr-crumbs span[aria-current] { color: var(--text-secondary); }
.rr-pagehead__row { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-6); flex-wrap: wrap; }
.rr-pagehead__title { margin: 0; font: 600 22px/28px var(--font-sans); letter-spacing: -0.01em; color: var(--text-primary); }
.rr-pagehead__desc { margin: var(--space-1) 0 0; font: 400 14px/20px var(--font-sans); color: var(--text-secondary); max-width: 640px; }
.rr-pagehead__meta { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-2); flex-wrap: wrap; }
.rr-pagehead__actions { display: flex; gap: var(--space-2); }

/* ---------- Tabs, chips ---------- */
.rr-tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--border-default); overflow-x: auto; scrollbar-width: none; }
.rr-tab {
  display: inline-flex; align-items: center; gap: var(--space-2); height: 36px; padding: 0 var(--space-3); margin-bottom: -1px;
  border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--text-secondary);
  font: 500 13px/18px var(--font-sans); cursor: pointer; white-space: nowrap; border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.rr-tab:hover { color: var(--text-primary); background: var(--bg-hover); }
.rr-tab.is-active { color: var(--text-primary); border-bottom-color: var(--accent); background: transparent; }
.rr-tab--mono span:first-of-type { font-family: var(--font-mono); font-weight: 400; }
.rr-tab__count { min-width: 18px; padding: 0 6px; border-radius: var(--radius-full); background: var(--bg-sunken); color: var(--text-secondary); font: 500 11px/18px var(--font-sans); text-align: center; font-variant-numeric: tabular-nums; }
.rr-tab.is-active .rr-tab__count { background: var(--accent-subtle); color: var(--accent-text); }

.rr-chip {
  display: inline-flex; align-items: center; gap: 6px; height: var(--size-control-sm); padding: 0 var(--space-3);
  border-radius: var(--radius-full); border: 1px solid var(--border-strong); background: var(--bg-surface); color: var(--text-secondary);
  font: 500 12px/16px var(--font-sans); cursor: pointer; white-space: nowrap;
}
.rr-chip:hover { background: var(--bg-hover); color: var(--text-primary); }
.rr-chip.is-selected { background: var(--bg-selected); color: var(--accent-text); border-color: var(--accent); }
.rr-chip__count { color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.rr-chip.is-selected .rr-chip__count { color: var(--accent-text); }

/* ---------- Side nav, shell ---------- */
.rr-sidenav { display: flex; flex-direction: column; gap: var(--space-4); }
.rr-sidenav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.rr-sidenav__heading { padding: 0 var(--space-2) var(--space-1); font: 600 11px/16px var(--font-sans); letter-spacing: .06em; text-transform: uppercase; color: var(--text-tertiary); }
.rr-sidenav__item {
  display: flex; align-items: center; gap: var(--space-2); height: 32px; padding: 0 var(--space-2); border-radius: var(--radius-md);
  color: var(--text-secondary); text-decoration: none; font: 500 13px/18px var(--font-sans);
}
.rr-sidenav__item:hover { background: var(--bg-hover); color: var(--text-primary); }
.rr-sidenav__item.is-active { background: var(--bg-selected); color: var(--text-primary); }
.rr-sidenav__item.is-active .rr-icon { color: var(--accent); }
.rr-sidenav__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rr-sidenav__count { font: 500 12px/16px var(--font-sans); color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.rr-sidenav__dot { width: 6px; height: 6px; border-radius: var(--radius-full); background: var(--warning-mark); }

.rr-shell { display: grid; grid-template-columns: var(--size-sidebar) minmax(0, 1fr); min-height: 100vh; background: var(--bg-canvas); color: var(--text-primary); }
.rr-shell__side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-4) var(--space-3); border-right: 1px solid var(--border-default); background: var(--bg-canvas); color: var(--text-primary); overflow-y: auto; }
.rr-shell__brand { padding: var(--space-1) var(--space-2); }
.rr-wordmark { display: inline-flex; align-items: center; line-height: 0; white-space: nowrap; }
.rr-wordmark > svg { display: block; flex: none; }
.rr-wordmark__remark { fill: var(--brand-orange); }
.rr-wordmark__room { fill: var(--brand-plum); }
.rr-wordmark--on-dark { background: #ffffff; padding: 6px 10px; border-radius: var(--radius-md); }
.rr-logomark { flex: none; display: inline-block; }
.rr-logomark__browser { fill: var(--brand-orange); }
.rr-logomark__page { fill: #ffffff; }
.rr-logomark__bubble { fill: var(--brand-plum); }
.rr-logomark__top { fill: var(--brand-peach); }
.rr-logomark__tile { fill: #ffffff; }
.rr-shell__company {
  display: flex; align-items: center; gap: var(--space-2); width: 100%; padding: 6px var(--space-2); border-radius: var(--radius-md);
  border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-primary); cursor: pointer; text-align: left;
}
.rr-shell__company:hover { border-color: var(--border-strong); }
.rr-shell__company > .rr-icon { color: var(--text-tertiary); }
.rr-shell__company-icon { width: 24px; height: 24px; flex: none; border-radius: var(--radius-sm); background: var(--bg-sunken); color: var(--text-secondary); display: inline-flex; align-items: center; justify-content: center; }
.rr-shell__company-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rr-shell__company-name { font: 500 13px/18px var(--font-sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rr-shell__company-plan { font: 400 12px/16px var(--font-sans); color: var(--text-tertiary); }
.rr-shell__side .rr-sidenav { flex: 1; }
.rr-shell__foot { display: flex; flex-direction: column; gap: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--border-default); }
.rr-shell__user { display: flex; align-items: center; gap: var(--space-2); padding: 0 var(--space-1); }
.rr-shell__user-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rr-shell__user-name { font: 500 13px/18px var(--font-sans); color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rr-shell__user-role { font: 400 12px/16px var(--font-sans); color: var(--text-tertiary); }
.rr-poweredby { margin: 0; padding: 0 var(--space-1); font: 400 12px/16px var(--font-sans); color: var(--text-secondary); }
.rr-poweredby--center { text-align: center; }
.rr-poweredby__name { font-weight: 600; color: var(--text-primary); letter-spacing: -0.005em; }
.rr-shell__main { min-width: 0; display: flex; flex-direction: column; }
.rr-shell__top { position: sticky; top: 0; z-index: 2; height: var(--size-topbar); display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-6); border-bottom: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-primary); }
.rr-shell__content { flex: 1; min-width: 0; padding: var(--space-8) var(--space-6) var(--space-10); display: flex; flex-direction: column; gap: var(--space-6); }
.rr-shell--contained { min-height: 100%; height: 100%; }
.rr-shell--contained .rr-shell__side { height: 100%; }
.rr-shell--contained .rr-shell__main { overflow-y: auto; }
@media (max-width: 760px) {
  .rr-shell { grid-template-columns: 1fr; }
  .rr-shell__side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border-default); }
  .rr-shell__content { padding: var(--space-6) var(--space-4); }
}

/* ---------- Stats ---------- */
.rr-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin: 0; border: 1px solid var(--border-default); border-radius: var(--radius-lg); background: var(--bg-surface); color: var(--text-primary); overflow: hidden; }
.rr-stat { display: flex; flex-direction: column; gap: 2px; padding: var(--space-3) var(--space-4); border-left: 1px solid var(--border-subtle); text-decoration: none; color: inherit; }
.rr-stat:first-child { border-left: 0; }
.rr-stat--link:hover { background: var(--bg-hover); color: var(--text-primary); }
.rr-stat__label { font: 500 12px/16px var(--font-sans); color: var(--text-secondary); }
.rr-stat__value { margin: 0; font: 600 24px/30px var(--font-sans); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.rr-stat__value.is-danger { color: var(--danger-text); }
.rr-stat__value.is-warning { color: var(--warning-text); }

/* ---------- Banner, toast, empty, skeleton ---------- */
.rr-banner { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); border: 1px solid transparent; font: 400 13px/18px var(--font-sans); }
.rr-banner__icon { margin-top: 1px; }
.rr-banner__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rr-banner__text strong { font-weight: 600; }
.rr-banner__action { flex: none; display: flex; gap: var(--space-2); align-self: center; }
.rr-banner--info { background: var(--accent-subtle); color: var(--text-primary); border-color: var(--bg-selected); }
.rr-banner--info .rr-banner__icon { color: var(--accent-text); }
.rr-banner--success { background: var(--success-subtle); color: var(--success-text); }
.rr-banner--warning { background: var(--warning-subtle); color: var(--warning-text); }
.rr-banner--danger { background: var(--danger-subtle); color: var(--danger-text); }

.rr-toast { display: inline-flex; align-items: center; gap: var(--space-3); min-height: 40px; padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4); border-radius: var(--radius-lg); background: var(--bg-inverse); color: var(--text-inverse); box-shadow: var(--shadow-popover); font: 400 13px/18px var(--font-sans); max-width: 420px; }
.rr-toast__msg { flex: 1; }
.rr-toast__icon { color: var(--text-inverse); }
.rr-toast__action { border: 0; background: transparent; color: var(--text-inverse); font: 600 13px/18px var(--font-sans); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 4px 8px; border-radius: var(--radius-md); }
.rr-toast__close { border: 0; background: transparent; color: var(--text-inverse); cursor: pointer; display: inline-flex; padding: 6px; border-radius: var(--radius-md); }
.rr-toast__action:focus-visible, .rr-toast__close:focus-visible { outline-color: var(--text-inverse); }

.rr-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-2); padding: var(--space-12) var(--space-6); color: var(--text-secondary); font-family: var(--font-sans); }
.rr-empty--compact { padding: var(--space-8) var(--space-4); }
.rr-empty__icon { width: 40px; height: 40px; border-radius: var(--radius-lg); background: var(--bg-sunken); color: var(--text-secondary); display: inline-flex; align-items: center; justify-content: center; margin-bottom: var(--space-2); }
.rr-empty__title { margin: 0; font: 600 15px/22px var(--font-sans); color: var(--text-primary); }
.rr-empty__body { font: 400 13px/18px var(--font-sans); color: var(--text-secondary); max-width: 420px; display: flex; flex-direction: column; gap: var(--space-3); }
.rr-empty__actions { display: flex; gap: var(--space-2); margin-top: var(--space-2); }

.rr-skel { display: inline-block; border-radius: var(--radius-sm); background: var(--bg-hover); }
.rr-skel-rows { display: flex; flex-direction: column; }
.rr-skel-row { display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-4); border-bottom: 1px solid var(--border-subtle); }

/* ---------- Dialog, menu ---------- */
.rr-scrim { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: var(--space-6); background: var(--bg-scrim); color: var(--text-primary); }
.rr-dialog-stage { display: flex; justify-content: center; padding: var(--space-4); }
.rr-dialog { width: 100%; max-width: 480px; max-height: calc(100vh - 48px); display: flex; flex-direction: column; background: var(--bg-surface); color: var(--text-primary); border-radius: var(--radius-xl); box-shadow: var(--shadow-dialog); outline: none; font-family: var(--font-sans); }
.rr-dialog--sm { max-width: 400px; } .rr-dialog--lg { max-width: 640px; }
.rr-dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); padding: var(--space-5) var(--space-5) 0; }
.rr-dialog__title { margin: 0; font: 600 17px/24px var(--font-sans); letter-spacing: -0.005em; color: var(--text-primary); }
.rr-dialog__desc { margin: var(--space-1) 0 0; font: 400 14px/20px var(--font-sans); color: var(--text-secondary); }
.rr-dialog__body { padding: var(--space-4) var(--space-5); overflow-y: auto; display: flex; flex-direction: column; gap: var(--space-4); }
.rr-dialog__foot { display: flex; justify-content: flex-end; gap: var(--space-2); padding: var(--space-3) var(--space-5) var(--space-5); }

.rr-menu { position: relative; display: inline-flex; }
.rr-menu__list { position: absolute; top: calc(100% + 4px); z-index: 40; min-width: 200px; padding: var(--space-1); border-radius: var(--radius-lg); border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-primary); box-shadow: var(--shadow-popover); display: flex; flex-direction: column; }
.rr-menu__list--end { right: 0; } .rr-menu__list--start { left: 0; }
.rr-menu__item { display: flex; align-items: center; gap: var(--space-2); height: 32px; padding: 0 var(--space-2); border: 0; border-radius: var(--radius-md); background: transparent; color: var(--text-primary); font: 400 13px/18px var(--font-sans); text-align: left; cursor: pointer; white-space: nowrap; }
.rr-menu__item .rr-icon { color: var(--text-secondary); }
.rr-menu__item:hover:not(:disabled) { background: var(--bg-hover); color: var(--text-primary); }
.rr-menu__item.is-danger, .rr-menu__item.is-danger .rr-icon { color: var(--danger-text); }
.rr-menu__item.is-danger:hover { background: var(--danger-subtle); color: var(--danger-text); }
.rr-menu__item:disabled { color: var(--text-disabled); cursor: not-allowed; }
.rr-menu__hint { margin-left: auto; padding-left: var(--space-4); color: var(--text-tertiary); font-size: 12px; }
.rr-menu__sep { height: 1px; margin: var(--space-1) 0; background: var(--border-subtle); }

/* ---------- Data table, copy field ---------- */
.rr-table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--border-default); border-radius: var(--radius-lg); background: var(--bg-surface); color: var(--text-primary); }
.rr-table { width: 100%; border-collapse: collapse; font: 400 13px/18px var(--font-sans); color: var(--text-primary); }
.rr-table th { height: 36px; padding: 0 var(--space-3); background: var(--bg-sunken); color: var(--text-secondary); font: 500 12px/16px var(--font-sans); border-bottom: 1px solid var(--border-default); white-space: nowrap; }
.rr-table td { height: var(--size-row); padding: 0 var(--space-3); border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
.rr-table--dense td { height: 36px; }
.rr-table tbody tr:last-child td { border-bottom: 0; }
.rr-table th:first-child, .rr-table td:first-child { padding-left: var(--space-4); }
.rr-table th:last-child, .rr-table td:last-child { padding-right: var(--space-4); }
.rr-table tr.is-clickable { cursor: pointer; }
.rr-table tbody tr.is-clickable:hover td { background: var(--bg-hover); color: var(--text-primary); }
.rr-table tr.is-selected td { background: var(--bg-selected); color: var(--text-primary); }
.rr-table td.is-mono { font-family: var(--font-mono); font-size: 12.5px; }
.rr-table__empty { text-align: center; color: var(--text-secondary); height: 96px !important; }
.rr-table .rr-cell-sub { display: block; font-size: 12px; line-height: 16px; color: var(--text-tertiary); }

.rr-copy { display: flex; align-items: center; gap: var(--space-2); min-height: var(--size-control-md); padding: 3px 3px 3px var(--space-3); border-radius: var(--radius-md); background: var(--bg-sunken); color: var(--text-primary); border: 1px solid var(--border-default); }
.rr-copy__value { flex: 1; min-width: 0; font: 400 12.5px/18px var(--font-mono); color: var(--text-primary); white-space: nowrap; overflow-x: auto; scrollbar-width: thin; }
.rr-copy.is-multiline { align-items: flex-start; padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3); }
.rr-copy.is-multiline .rr-copy__value { white-space: pre-wrap; word-break: break-all; }

/* ---------- Triage: buckets, thread rows, comments ---------- */
.rr-bucket { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: var(--space-2); height: 32px; padding: 0 var(--space-4); background: var(--bg-sunken); color: var(--text-secondary); border-bottom: 1px solid var(--border-subtle); font: 600 11px/16px var(--font-sans); letter-spacing: .06em; text-transform: uppercase; }
.rr-bucket__mark { width: 8px; height: 8px; border-radius: 2px; background: var(--border-strong); }
.rr-bucket--danger { color: var(--danger-text); } .rr-bucket--danger .rr-bucket__mark { background: var(--danger); }
.rr-bucket--warning { color: var(--warning-text); } .rr-bucket--warning .rr-bucket__mark { background: var(--warning-mark); }
.rr-bucket__count { color: var(--text-tertiary); }

.rr-thread {
  display: flex; align-items: center; gap: var(--space-3); height: var(--size-row); padding: 0 var(--space-4);
  border-bottom: 1px solid var(--border-subtle); background: var(--bg-surface); color: var(--text-primary); cursor: pointer; font-family: var(--font-sans);
}
.rr-thread:hover { background: var(--bg-hover); color: var(--text-primary); }
.rr-thread.is-selected { background: var(--bg-selected); color: var(--text-primary); box-shadow: inset 2px 0 0 var(--accent); }
.rr-thread:focus-visible { outline-offset: -2px; }
.rr-thread__check { display: inline-flex; }
.rr-thread__dot { flex: none; width: 8px; height: 8px; border-radius: var(--radius-full); }
.rr-thread__dot.is-unanswered { background: var(--accent); }
.rr-thread__dot.is-answered { border: 1.5px solid var(--border-strong); }
.rr-thread__status { flex: none; }
.rr-thread__body { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: var(--space-2); }
.rr-thread__preview { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 400 13px/18px var(--font-sans); color: var(--text-primary); }
.rr-thread__page { flex: none; max-width: 30%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 400 12px/16px var(--font-mono); color: var(--text-tertiary); }
.rr-thread__age { flex: none; width: 32px; text-align: right; font: 500 12px/16px var(--font-sans); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.rr-thread__replies { flex: none; width: 36px; display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; font: 400 12px/16px var(--font-sans); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.rr-thread__replies.is-zero { color: var(--text-tertiary); }

.rr-comment { display: flex; flex-direction: column; gap: 6px; font-family: var(--font-sans); color: var(--text-primary); }
.rr-comment--team { margin-left: var(--space-4); padding: var(--space-3); border-radius: var(--radius-lg); background: var(--accent-subtle); color: var(--text-primary); border: 1px solid var(--bg-selected); }
.rr-comment__meta { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; font: 400 12px/16px var(--font-sans); color: var(--text-tertiary); }
.rr-comment__author { font: 600 13px/18px var(--font-sans); color: var(--text-primary); }
.rr-comment__at { color: var(--text-secondary); }
.rr-comment--team .rr-comment__at { color: var(--text-secondary); }
.rr-comment__actions { margin-left: auto; display: inline-flex; gap: 2px; }
.rr-comment__body { font: 400 14px/20px var(--font-sans); color: var(--text-primary); white-space: pre-wrap; overflow-wrap: anywhere; }
.rr-comment__body .rr-mention { color: var(--accent-text); font-weight: 500; }
.rr-teampill { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: var(--radius-sm); background: var(--accent); color: var(--on-accent); font: 600 10px/1 var(--font-sans); letter-spacing: .06em; }
.rr-unverified { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: var(--radius-full); border: 1px solid var(--border-strong); background: var(--bg-surface); color: var(--text-secondary); font: 500 11px/1 var(--font-sans); cursor: help; }
.rr-shot { position: relative; align-self: flex-start; display: inline-flex; padding: 0; border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-sunken); color: var(--text-secondary); overflow: hidden; cursor: pointer; }
.rr-shot img { display: block; width: 120px; height: 80px; object-fit: cover; object-position: top; }
.rr-shot__label { position: absolute; left: 4px; bottom: 4px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border-radius: var(--radius-sm); background: var(--bg-inverse); color: var(--text-inverse); font: 500 11px/14px var(--font-sans); }
.rr-shot__none { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 var(--space-3); font: 400 12px/16px var(--font-sans); color: var(--text-secondary); }

/* ---------- Stat hint ---------- */
.rr-stat__hint { margin: 0; font: 400 12px/16px var(--font-sans); color: var(--text-secondary); }

/* ---------- Pagination ---------- */
.rr-pager { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; min-height: 48px; padding: var(--space-2) var(--space-4); font: 400 13px/18px var(--font-sans); color: var(--text-secondary); background: var(--bg-surface); border-top: 1px solid var(--border-subtle); }
.rr-pager__summary { flex: 1 1 auto; font-variant-numeric: tabular-nums; }
.rr-pager__summary b { font-weight: 500; color: var(--text-primary); }
.rr-pager__size { display: inline-flex; align-items: center; gap: var(--space-2); font-size: 12px; }
.rr-pager__size .rr-input { width: 72px; }
.rr-pager__size select { font-size: 13px; }
.rr-pager__nav { display: inline-flex; align-items: center; gap: 2px; }
.rr-pager__page { min-width: 28px; height: 28px; padding: 0 6px; border: 1px solid transparent; border-radius: var(--radius-md); background: transparent; color: var(--text-secondary); font: 500 13px/1 var(--font-sans); font-variant-numeric: tabular-nums; cursor: pointer; }
.rr-pager__page:hover { background: var(--bg-hover); color: var(--text-primary); }
.rr-pager__page.is-current { background: var(--bg-selected); color: var(--accent-text); border-color: var(--accent); }
.rr-pager__page:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.rr-pager__gap { min-width: 20px; text-align: center; color: var(--text-tertiary); }
.rr-table-wrap > .rr-pager { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.rr-table-wrap > .rr-table tbody tr:last-child td { border-bottom: 0; }

/* ---------- Status picker ---------- */
.rr-statussel { position: relative; display: inline-flex; }
.rr-statussel__btn { display: inline-flex; align-items: center; gap: 6px; height: var(--size-control-sm); padding: 0 6px 0 4px; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--bg-surface); color: var(--text-secondary); cursor: pointer; }
.rr-statussel__btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.rr-statussel__btn:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.rr-statussel__list { min-width: 240px; }
.rr-statussel__group { padding: 8px 8px 4px; font: 600 11px/16px var(--font-sans); letter-spacing: .06em; text-transform: uppercase; color: var(--text-tertiary); }
.rr-statussel__check { margin-left: auto; color: var(--accent); }

/* ---------- Due chip ---------- */
.rr-due { flex: none; display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 6px; border-radius: var(--radius-sm); font: 500 12px/16px var(--font-sans); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rr-due--neutral, .rr-due--done { background: transparent; color: var(--text-secondary); }
.rr-due--done { text-decoration: line-through; color: var(--text-tertiary); }
.rr-due--warning { background: var(--warning-subtle); color: var(--warning-text); }
.rr-due--danger { background: var(--danger-subtle); color: var(--danger-text); }
.rr-due--none { background: transparent; color: var(--text-tertiary); font-weight: 400; }

/* ---------- Timeline (Gantt) ---------- */
.rr-tl { position: relative; border: 1px solid var(--border-default); border-radius: var(--radius-lg); background: var(--bg-surface); color: var(--text-primary); font-family: var(--font-sans); overflow: hidden; }
.rr-tl__head { position: sticky; top: 0; z-index: 2; display: flex; background: var(--bg-sunken); color: var(--text-secondary); border-bottom: 1px solid var(--border-default); }
.rr-tl__corner { display: flex; flex-direction: row !important; align-items: flex-end; justify-content: flex-start !important; padding: 0 var(--space-4) 8px !important; font: 500 12px/16px var(--font-sans); color: var(--text-secondary); }
.rr-tl__scale { position: relative; flex: 1; min-width: 0; }
.rr-tl__months { display: flex; height: 24px; border-bottom: 1px solid var(--border-subtle); }
.rr-tl__months span { padding: 4px 8px; font: 600 12px/16px var(--font-sans); color: var(--text-primary); border-left: 1px solid var(--border-default); white-space: nowrap; overflow: hidden; }
.rr-tl__months span:first-child { border-left: 0; }
.rr-tl__daynums { display: flex; height: 24px; }
.rr-tl__daynums span { flex: 1; min-width: 0; text-align: center; font: 500 11px/24px var(--font-sans); color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.rr-tl__daynums span.is-weekend { background: var(--bg-hover); }
.rr-tl__daynums span.is-today { color: var(--accent-text); font-weight: 600; }
.rr-tl__todaytag { position: absolute; top: 2px; transform: translateX(-50%); padding: 1px 6px; border-radius: var(--radius-full); background: var(--accent); color: var(--on-accent); font: 600 10px/14px var(--font-sans); white-space: nowrap; }
.rr-tl__group { display: flex; align-items: center; gap: var(--space-2); height: 32px; padding: 0 var(--space-4); background: var(--bg-sunken); color: var(--text-secondary); border-bottom: 1px solid var(--border-subtle); font: 600 11px/16px var(--font-sans); letter-spacing: .06em; text-transform: uppercase; }
.rr-tl__row { display: flex; height: var(--size-row); border-bottom: 1px solid var(--border-subtle); background: var(--bg-surface); color: var(--text-primary); cursor: default; }
.rr-tl__row:last-child { border-bottom: 0; }
.rr-tl__row:hover { background: var(--bg-hover); color: var(--text-primary); }
.rr-tl__row.is-selected { background: var(--bg-selected); color: var(--text-primary); box-shadow: inset 2px 0 0 var(--accent); }
.rr-tl__label { flex: none; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; padding: 0 var(--space-4); border-right: 1px solid var(--border-default); box-sizing: border-box; }
.rr-tl__title { font: 400 13px/18px var(--font-sans); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rr-tl__meta { display: flex; align-items: center; gap: 6px; height: 20px; }
.rr-tl__meta .rr-due { height: 18px; padding: 0 4px; }
.rr-tl__unassigned { font: 400 12px/16px var(--font-sans); color: var(--text-tertiary); }
.rr-tl__track { position: relative; flex: 1; min-width: 0; }
.rr-tl__days { position: absolute; inset: 0; display: flex; pointer-events: none; }
.rr-tl__day { flex: 1; }
.rr-tl__day.is-weekend { background: var(--bg-hover); opacity: .55; }
.rr-tl__day.is-monday { box-shadow: inset 1px 0 0 var(--border-subtle); }
.rr-tl__bar { position: absolute; top: 10px; height: 24px; display: flex; align-items: center; box-sizing: border-box; padding: 0 8px; border-radius: var(--radius-md); border: 1px solid currentColor; overflow: hidden; font: 500 12px/16px var(--font-sans); white-space: nowrap; }
.rr-tl__barlabel { overflow: hidden; text-overflow: ellipsis; }
.rr-tl__bar.is-done { opacity: .7; }
.rr-tl__milestone { position: absolute; top: 15px; width: 14px; height: 14px; margin-left: -7px; transform: rotate(45deg); border-radius: 2px; border: 1.5px solid currentColor; box-sizing: border-box; }
.rr-tl__bar--blue { background: var(--status-blue-fill); color: var(--status-blue-text); }
.rr-tl__bar--amber { background: var(--status-amber-fill); color: var(--status-amber-text); }
.rr-tl__bar--purple { background: var(--status-purple-fill); color: var(--status-purple-text); }
.rr-tl__bar--green { background: var(--status-green-fill); color: var(--status-green-text); }
.rr-tl__bar--grey { background: var(--status-grey-fill); color: var(--status-grey-text); }
.rr-tl__bar--red { background: var(--status-red-fill); color: var(--status-red-text); }
.rr-tl__bar--teal { background: var(--status-teal-fill); color: var(--status-teal-text); }
.rr-tl__bar--pink { background: var(--status-pink-fill); color: var(--status-pink-text); }
.rr-tl__overdue { position: absolute; top: 10px; height: 24px; display: flex; align-items: center; padding: 0 6px; box-sizing: border-box; border: 1px dashed var(--danger); border-left: 0; border-radius: 0 var(--radius-md) var(--radius-md) 0; background: repeating-linear-gradient(135deg, var(--danger-subtle) 0 6px, var(--bg-surface) 6px 9px); color: var(--danger-text); font: 600 11px/14px var(--font-sans); white-space: nowrap; overflow: hidden; }
.rr-tl__overdue span { background: var(--danger-subtle); padding: 0 2px; border-radius: 2px; }
.rr-tl__today { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--accent); z-index: 0; }
.rr-tl__bar, .rr-tl__milestone, .rr-tl__overdue { z-index: 1; }

/* ---------- Charts ---------- */
.rr-barlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-family: var(--font-sans); }
.rr-barlist__row { display: grid; grid-template-columns: minmax(96px, 36%) 1fr 40px; align-items: center; gap: var(--space-3); min-height: 24px; }
.rr-barlist__label { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font: 400 13px/18px var(--font-sans); color: var(--text-primary); }
.rr-barlist__label span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rr-barlist__swatch { flex: none; width: 10px; height: 10px; border-radius: 3px; padding: 0 !important; }
.rr-barlist__track { position: relative; height: 10px; }
.rr-barlist__bar { position: absolute; left: 0; top: 0; bottom: 0; min-width: 4px; border-radius: 0 4px 4px 0; }
.rr-barlist__value { text-align: right; font: 500 13px/18px var(--font-sans); color: var(--text-secondary); font-variant-numeric: tabular-nums; }

.rr-weekly { margin: 0; display: flex; flex-direction: column; gap: var(--space-3); font-family: var(--font-sans); color: var(--text-primary); }
.rr-weekly__legend { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; font: 400 12px/16px var(--font-sans); color: var(--text-secondary); }
.rr-weekly__legend > span:not(.rr-weekly__readout) { display: inline-flex; align-items: center; gap: 6px; }
.rr-weekly__legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.rr-weekly__readout { margin-left: auto; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.rr-weekly__plot { position: relative; padding-left: 28px; padding-bottom: 20px; box-sizing: content-box; }
.rr-weekly__grid { position: absolute; inset: 0 0 20px 28px; display: flex; flex-direction: column; justify-content: space-between; }
.rr-weekly__grid span { position: relative; height: 0; border-top: 1px solid var(--border-subtle); }
.rr-weekly__grid span:last-child { border-top-color: var(--border-default); }
.rr-weekly__grid em { position: absolute; right: calc(100% + 6px); top: -8px; font: 400 11px/16px var(--font-sans); font-style: normal; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.rr-weekly__cols { position: relative; height: 100%; display: flex; gap: 6px; }
.rr-weekly__col { flex: 1; min-width: 0; position: relative; display: flex; flex-direction: column; outline: none; }
.rr-weekly__col.is-hover::before, .rr-weekly__col:focus-visible::before { content: ""; position: absolute; inset: -4px -3px 0; background: var(--bg-hover); border-radius: var(--radius-sm); }
.rr-weekly__bars { position: relative; flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.rr-weekly__bar { width: 40%; max-width: 14px; min-height: 0; border-radius: 4px 4px 0 0; }
.rr-weekly__x { position: absolute; left: 50%; bottom: -20px; transform: translateX(-50%); font: 400 11px/16px var(--font-sans); color: var(--text-tertiary); white-space: nowrap; }
.rr-weekly__table summary { cursor: pointer; font: 500 12px/16px var(--font-sans); color: var(--accent-text); width: max-content; }
.rr-weekly__table .rr-table { margin-top: var(--space-2); border: 1px solid var(--border-default); border-radius: var(--radius-lg); }

/* ---------- Unread ---------- */
.rr-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rr-thread.is-unread .rr-thread__preview { font-weight: 600; }
.rr-thread__new { flex: none; align-self: center; height: 18px; padding: 0 6px; border-radius: var(--radius-sm); background: var(--accent-subtle); color: var(--accent-text); font: 600 11px/18px var(--font-sans); letter-spacing: .02em; }

/* ---------- Segmented control ---------- */
.rr-seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: var(--radius-md); background: var(--bg-sunken); color: var(--text-secondary); border: 1px solid var(--border-default); }
.rr-seg__opt { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border: 0; border-radius: 4px; background: transparent; color: var(--text-secondary); font: 500 12px/16px var(--font-sans); cursor: pointer; }
.rr-seg__opt:hover { color: var(--text-primary); }
.rr-seg__opt.is-on { background: var(--bg-surface); color: var(--text-primary); box-shadow: 0 1px 2px rgba(20, 23, 29, 0.08), 0 0 0 1px var(--border-default); }
.rr-seg__opt:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 1px; }

/* ---------- Usage meter ---------- */
.rr-meter { display: flex; flex-direction: column; gap: 6px; font-family: var(--font-sans); }
.rr-meter__top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.rr-meter__label { font: 500 13px/18px var(--font-sans); color: var(--text-primary); }
.rr-meter__value { font: 400 13px/18px var(--font-sans); color: var(--text-secondary); font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 6px; }
.rr-meter__value b { font-weight: 600; color: var(--text-primary); }
.rr-meter__full { height: 18px; padding: 0 6px; border-radius: var(--radius-sm); background: var(--danger-subtle); color: var(--danger-text); font: 600 11px/18px var(--font-sans); }
.rr-meter__track { height: 8px; border-radius: var(--radius-full); background: var(--bg-hover); overflow: hidden; }
.rr-meter__fill { display: block; height: 100%; border-radius: var(--radius-full); background: var(--accent); }
.rr-meter--near .rr-meter__fill { background: var(--warning-mark); }
.rr-meter--full .rr-meter__fill { background: var(--danger); }

/* ---------- Tri-state check ---------- */
.rr-tri { display: flex; align-items: center; gap: var(--space-2); width: 100%; min-height: 32px; padding: 4px 8px; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--text-primary); text-align: left; cursor: pointer; font-family: var(--font-sans); }
.rr-tri:hover { background: var(--bg-hover); color: var(--text-primary); }
.rr-tri:focus-visible { outline: 2px solid var(--border-focus); outline-offset: -2px; }
.rr-tri .rr-check__box { margin-top: 0; }
.rr-tri .rr-check__box.is-on, .rr-tri .rr-check__box.is-mixed { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.rr-tri .rr-check__box.is-mixed i { display: block; width: 8px; height: 2px; border-radius: 1px; background: var(--on-accent); }
.rr-tri__label { flex: 1; min-width: 0; font: 400 13px/18px var(--font-sans); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rr-tri__label.is-mono { font-family: var(--font-mono); font-size: 12.5px; }
.rr-tri__sub { flex: none; font: 400 12px/16px var(--font-sans); color: var(--text-tertiary); }

/* ---------- Project & domain picker ---------- */
.rr-pdp { position: relative; }
.rr-pdp__trigger { display: flex; align-items: center; gap: var(--space-2); width: 100%; min-height: var(--size-control-md); padding: 3px 10px 3px 4px; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--bg-surface); color: var(--text-secondary); cursor: pointer; text-align: left; font-family: var(--font-sans); }
.rr-pdp__trigger:hover { border-color: var(--text-tertiary); }
.rr-pdp__trigger.is-open { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.rr-pdp__placeholder { flex: 1; padding-left: 8px; font: 400 14px/20px var(--font-sans); color: var(--text-tertiary); }
.rr-pdp__chips { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; }
.rr-pdp__chip { display: inline-flex; align-items: center; gap: 2px; height: 24px; padding: 0 8px; border-radius: var(--radius-sm); background: var(--bg-selected); color: var(--text-primary); font: 400 12px/16px var(--font-sans); white-space: nowrap; }
.rr-pdp__chip b { font-weight: 600; }
.rr-pdp__panel { position: absolute; top: 100%; left: 0; right: 0; margin-top: 4px; z-index: 40; display: flex; flex-direction: column; max-height: 360px; border: 1px solid var(--border-default); border-radius: var(--radius-lg); background: var(--bg-surface); color: var(--text-primary); box-shadow: var(--shadow-popover); }
.rr-pdp__search { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border-subtle); color: var(--text-tertiary); }
.rr-pdp__search input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--text-primary); font: 400 13px/18px var(--font-sans); }
.rr-pdp__search input::placeholder { color: var(--text-tertiary); }
.rr-pdp__list { flex: 1; overflow-y: auto; padding: 4px; }
.rr-pdp__prow { display: flex; align-items: center; gap: 2px; }
.rr-pdp__prow .rr-tri__label { font-weight: 500; }
.rr-pdp__expand { flex: none; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--text-secondary); cursor: pointer; }
.rr-pdp__expand:hover { background: var(--bg-hover); color: var(--text-primary); }
.rr-pdp__expand .rr-icon { transition: transform .12s ease; transform: rotate(-90deg); }
.rr-pdp__expand.is-open .rr-icon { transform: rotate(0deg); }
.rr-pdp__expand:focus-visible { outline: 2px solid var(--border-focus); outline-offset: -2px; }
.rr-pdp__domains { margin: 0 0 4px 24px; padding-left: 8px; border-left: 1px solid var(--border-subtle); }
.rr-pdp__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--border-subtle); font: 400 12px/16px var(--font-sans); color: var(--text-secondary); }

/* ---------- People picker ---------- */
.rr-pp { position: relative; }
.rr-pp__box { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-height: var(--size-control-md); padding: 3px 4px; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--bg-surface); color: var(--text-primary); cursor: text; }
.rr-pp__box.is-open { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.rr-pp__chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 4px 0 3px; border-radius: var(--radius-full); background: var(--bg-sunken); color: var(--text-primary); border: 1px solid var(--border-default); font: 500 12px/16px var(--font-sans); }
.rr-pp__chip.is-new { padding-left: 8px; background: var(--bg-surface); border-style: dashed; border-color: var(--border-strong); }
.rr-pp__newtag { height: 16px; padding: 0 5px; border-radius: var(--radius-sm); background: var(--accent-subtle); color: var(--accent-text); font: 600 10px/16px var(--font-sans); }
.rr-pp__x { display: inline-flex; padding: 3px; border: 0; border-radius: var(--radius-full); background: transparent; color: var(--text-secondary); cursor: pointer; }
.rr-pp__x:hover { background: var(--bg-hover); color: var(--text-primary); }
.rr-pp__x:focus-visible { outline: 2px solid var(--border-focus); }
.rr-pp__input { flex: 1; min-width: 180px; height: 26px; padding: 0 6px; border: 0; outline: 0; background: transparent; color: var(--text-primary); font: 400 14px/20px var(--font-sans); }
.rr-pp__input::placeholder { color: var(--text-tertiary); }
.rr-pp__panel { position: absolute; top: 100%; left: 0; right: 0; margin-top: 4px; z-index: 41; padding: 4px; border: 1px solid var(--border-default); border-radius: var(--radius-lg); background: var(--bg-surface); color: var(--text-primary); box-shadow: var(--shadow-popover); display: flex; flex-direction: column; }
.rr-pp__opt { height: auto !important; min-height: 40px; padding: 4px 8px !important; }
.rr-pp__who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rr-pp__who small { font: 400 12px/16px var(--font-sans); color: var(--text-tertiary); }
.rr-pp__plus { width: 20px; height: 20px; border-radius: var(--radius-full); background: var(--accent-subtle); color: var(--accent-text); display: inline-flex; align-items: center; justify-content: center; }
.rr-pp__plus .rr-icon { color: var(--accent-text) !important; }
.rr-pp__empty { margin: 0; padding: 8px; font: 400 12px/16px var(--font-sans); color: var(--text-secondary); }

/* ---------- Calendar month ---------- */
.rr-cal { border: 1px solid var(--border-default); border-radius: var(--radius-lg); background: var(--bg-surface); color: var(--text-primary); overflow: hidden; font-family: var(--font-sans); }
.rr-cal__dows { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--bg-sunken); color: var(--text-secondary); border-bottom: 1px solid var(--border-default); }
.rr-cal__dows span { padding: 8px 10px; font: 500 12px/16px var(--font-sans); }
.rr-cal__week { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--border-subtle); }
.rr-cal__week:last-child { border-bottom: 0; }
.rr-cal__day { position: relative; padding: 6px 8px; border-left: 1px solid var(--border-subtle); }
.rr-cal__day:first-child { border-left: 0; }
.rr-cal__day.is-weekend { background: var(--bg-canvas); }
.rr-cal__day.is-out .rr-cal__num { color: var(--text-disabled); }
.rr-cal__num { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 4px; border-radius: var(--radius-full); font: 500 12px/16px var(--font-sans); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.rr-cal__day.is-today .rr-cal__num { background: var(--accent); color: var(--on-accent); }
.rr-cal__more { position: absolute; left: 8px; bottom: 4px; font: 500 11px/16px var(--font-sans); color: var(--accent-text); }
.rr-cal__bar { position: absolute; height: 22px; display: flex; align-items: center; gap: 4px; padding: 0 8px; box-sizing: border-box; border: 1px solid currentColor; border-radius: var(--radius-md); font: 500 12px/16px var(--font-sans); text-align: left; overflow: hidden; white-space: nowrap; cursor: pointer; z-index: 1; }
.rr-cal__bar span { overflow: hidden; text-overflow: ellipsis; }
.rr-cal__bar.cont-left { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left-style: dashed; }
.rr-cal__bar.cont-right { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right-style: dashed; }
.rr-cal__bar.is-overdue { box-shadow: inset 0 -2px 0 var(--danger); }
.rr-cal__bar.is-due-only { border-style: dotted; }
.rr-cal__bar:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 1px; }

/* ================================================================ Widget */
.rr-pin { position: relative; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 2px solid var(--bg-surface); border-radius: 50% 50% 50% 0; background: var(--status-blue-text); color: var(--text-inverse); box-shadow: var(--shadow-floating); cursor: pointer; font: 600 12px/1 var(--font-sans); font-variant-numeric: tabular-nums; transition: transform .12s ease; }
.rr-pin__n { line-height: 1; }
.rr-pin--blue { background: var(--status-blue-text); } .rr-pin--amber { background: var(--status-amber-text); } .rr-pin--purple { background: var(--status-purple-text); }
.rr-pin--green { background: var(--status-green-text); } .rr-pin--grey { background: var(--status-grey-text); } .rr-pin--red { background: var(--status-red-text); }
.rr-pin--teal { background: var(--status-teal-text); } .rr-pin--pink { background: var(--status-pink-text); }
.rr-pin--active { transform: scale(1.15); box-shadow: 0 0 0 3px var(--accent), var(--shadow-floating); }
.rr-pin--resolved { background: var(--bg-surface); color: var(--success-text); border-color: var(--success-mark); }
.rr-pin--orphaned { background: var(--bg-surface); color: var(--text-secondary); border: 2px dashed var(--border-strong); }
.rr-pin:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }

.rr-wtb { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 8px; font-family: var(--font-sans); }
.rr-wtb__launch { position: relative; width: 56px; height: 56px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-floating); cursor: pointer; }
.rr-wtb__launch:hover { background: var(--accent-hover); color: var(--on-accent); }
.rr-wtb__launch:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 3px; }
.rr-wtb__badge { position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; border: 2px solid var(--bg-surface); background: var(--danger); color: var(--text-inverse); font: 600 11px/16px var(--font-sans); box-sizing: border-box; }
.rr-wtb__pill { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; border-radius: 28px; background: var(--bg-surface); color: var(--text-secondary); box-shadow: var(--shadow-floating); }
.rr-wtb__slot { position: relative; display: inline-flex; }
.rr-wtb__btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: transparent; color: var(--text-secondary); cursor: pointer; }
.rr-wtb__btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.rr-wtb__btn.is-on { background: var(--bg-selected); color: var(--accent-text); }
.rr-wtb__btn.is-primary { background: var(--accent); color: var(--on-accent); }
.rr-wtb__btn.is-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.rr-wtb__btn:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.rr-wtb__sep { width: 24px; height: 1px; margin: 2px 0; background: var(--border-default); }
.rr-wtb__tip { position: absolute; right: calc(100% + 10px); top: 50%; transform: translateY(-50%); padding: 6px 10px; border-radius: var(--radius-md); background: var(--bg-inverse); color: var(--text-inverse); font: 500 12px/16px var(--font-sans); white-space: nowrap; box-shadow: var(--shadow-popover); }
.rr-wtb__hint { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--radius-full); background: var(--bg-inverse); color: var(--text-inverse); font: 500 12px/16px var(--font-sans); box-shadow: var(--shadow-popover); }
.rr-wtb__hint .rr-kbd { background: transparent; color: var(--text-inverse); border-color: rgba(255,255,255,.45); }
@media (hover: none) { .rr-wtb__hint, .rr-wtb__tip { display: none; } }
/* Movable: the toolbar snaps to the left or right edge at any height (Widget.md "Moving the widget"). */
.rr-wtb--left { align-items: flex-start; }
.rr-wtb--left .rr-wtb__tip { right: auto; left: calc(100% + 10px); }
.rr-wtb__grip { width: 44px; height: 20px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 10px; background: transparent; color: var(--text-tertiary); cursor: grab; }
.rr-wtb__grip:hover { background: var(--bg-hover); color: var(--text-primary); }
.rr-wtb__grip:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.rr-wtb.is-lifted .rr-wtb__launch, .rr-wtb.is-lifted .rr-wtb__pill { transform: scale(1.06); box-shadow: var(--shadow-floating), 0 14px 32px rgba(0, 0, 0, 0.22); cursor: grabbing; }
.rr-wtb.is-lifted .rr-wtb__grip { color: var(--text-primary); cursor: grabbing; }
.rr-wtb__launch, .rr-wtb__pill { transition: transform 120ms ease, box-shadow 120ms ease; }
@media (prefers-reduced-motion: reduce) { .rr-wtb__launch, .rr-wtb__pill { transition: none; } }

.rr-wpanel { box-sizing: border-box; max-width: calc(100vw - 32px); display: flex; flex-direction: column; border-radius: var(--radius-xl); background: var(--bg-surface); color: var(--text-primary); box-shadow: var(--shadow-floating), var(--shadow-dialog); font-family: var(--font-sans); overflow: hidden; }
.rr-wpanel__drag { display: flex; justify-content: center; padding: 6px 0 2px; cursor: grab; }
.rr-wpanel__drag i { width: 32px; height: 4px; border-radius: 2px; background: var(--border-default); }
.rr-wpanel__head { display: flex; align-items: flex-start; gap: var(--space-2); padding: 12px 12px 0 16px; }
.rr-wpanel__titles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rr-wpanel__title { margin: 0; font: 600 15px/22px var(--font-sans); color: var(--text-primary); }
.rr-wpanel__meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font: 400 12px/16px var(--font-sans); color: var(--text-secondary); }
.rr-wpanel__body { padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.rr-wpanel__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--border-subtle); background: var(--bg-sunken); color: var(--text-secondary); }
.rr-wpanel *, .rr-textarea, .rr-input, .rr-copy { box-sizing: border-box; }

/* ---------- Widget colour themes (scoped: wrap the widget root in .rr-wtheme--<name>) ---------- */
.rr-wtheme--graphite, .rr-wtheme--teal, .rr-wtheme--violet, .rr-wtheme--magenta, .rr-wtheme--cobalt { display: contents; }
.rr-wtheme--graphite { --accent: var(--widget-graphite); --accent-hover: var(--widget-graphite-hover); --accent-pressed: var(--widget-graphite-hover); --accent-text: var(--widget-graphite-text); --accent-subtle: var(--widget-graphite-subtle); --bg-selected: var(--widget-graphite-subtle); --border-focus: var(--widget-graphite); --text-link: var(--widget-graphite-text); }
.rr-wtheme--teal { --accent: var(--widget-teal); --accent-hover: var(--widget-teal-hover); --accent-pressed: var(--widget-teal-hover); --accent-text: var(--widget-teal-text); --accent-subtle: var(--widget-teal-subtle); --bg-selected: var(--widget-teal-subtle); --border-focus: var(--widget-teal); --text-link: var(--widget-teal-text); }
.rr-wtheme--violet { --accent: var(--widget-violet); --accent-hover: var(--widget-violet-hover); --accent-pressed: var(--widget-violet-hover); --accent-text: var(--widget-violet-text); --accent-subtle: var(--widget-violet-subtle); --bg-selected: var(--widget-violet-subtle); --border-focus: var(--widget-violet); --text-link: var(--widget-violet-text); }
.rr-wtheme--magenta { --accent: var(--widget-magenta); --accent-hover: var(--widget-magenta-hover); --accent-pressed: var(--widget-magenta-hover); --accent-text: var(--widget-magenta-text); --accent-subtle: var(--widget-magenta-subtle); --bg-selected: var(--widget-magenta-subtle); --border-focus: var(--widget-magenta); --text-link: var(--widget-magenta-text); }
.rr-wtheme--cobalt { --accent: var(--widget-cobalt); --accent-hover: var(--widget-cobalt-hover); --accent-pressed: var(--widget-cobalt-hover); --accent-text: var(--widget-cobalt-text); --accent-subtle: var(--widget-cobalt-subtle); --bg-selected: var(--widget-cobalt-subtle); --border-focus: var(--widget-cobalt); --text-link: var(--widget-cobalt-text); }

.rr-wthemes { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rr-wthemes__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.rr-wthemes__opt { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px 8px; border: 1px solid var(--border-default); border-radius: var(--radius-lg); background: var(--bg-surface); color: var(--text-primary); cursor: pointer; font: 500 12px/16px var(--font-sans); }
.rr-wthemes__opt:hover { border-color: var(--border-strong); }
.rr-wthemes__opt.is-on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-subtle); }
.rr-wthemes__opt:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.rr-wthemes__dot { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #ffffff; }
.rr-wthemes__check { position: absolute; top: 6px; right: 6px; color: var(--accent-text); }
.rr-wthemes__sub { font-weight: 400; color: var(--text-tertiary); }

/* ================================================================ Marketing (canvas px; see the Marketing section) */
.rr-mk-wrap { position: relative; flex: none; overflow: hidden; }
.rr-mk-board { position: absolute; top: 0; left: 0; box-sizing: border-box; overflow: hidden; transform-origin: 0 0;
  display: flex; flex-direction: column; gap: 32px; font-family: var(--font-sans); -webkit-font-smoothing: antialiased;
  background: var(--mk-ground); color: var(--mk-ink); }
.rr-mk-board *, .rr-mk-board *::before, .rr-mk-board *::after { box-sizing: border-box; }
.rr-mk-board--center { align-items: center; justify-content: center; text-align: center; }
.rr-mk-board--between { justify-content: space-between; }
.rr-mk-board--end { justify-content: flex-end; }
/* Grounds: each sets its ink (display), body copy, muted copy and highlight colour together. */
.rr-mk--white  { --mk-ground: #ffffff;               --mk-ink: var(--text-primary); --mk-body: var(--text-secondary); --mk-muted: var(--text-secondary); --mk-hl: var(--brand-orange); --mk-hl2: var(--brand-plum); --mk-line: var(--border-default); }
.rr-mk--cream  { --mk-ground: var(--brand-cream);    --mk-ink: var(--text-primary); --mk-body: var(--text-secondary); --mk-muted: var(--text-secondary); --mk-hl: var(--brand-plum); --mk-hl2: var(--accent-text); --mk-line: var(--brand-peach); }
.rr-mk--peach  { --mk-ground: var(--brand-peach);    --mk-ink: var(--brand-plum);   --mk-body: var(--text-primary);   --mk-muted: var(--text-secondary); --mk-hl: var(--text-primary); --mk-hl2: var(--brand-plum); --mk-line: rgba(127, 0, 64, 0.24); }
.rr-mk--orange { --mk-ground: var(--brand-orange);   --mk-ink: #ffffff;             --mk-body: var(--text-primary);   --mk-muted: var(--text-primary);   --mk-hl: var(--brand-plum);  --mk-hl2: var(--text-primary); --mk-line: rgba(255, 255, 255, 0.5); }
.rr-mk--plum   { --mk-ground: var(--brand-plum);     --mk-ink: #ffffff;             --mk-body: #ffffff;               --mk-muted: var(--brand-peach);    --mk-hl: var(--brand-orange); --mk-hl2: var(--brand-peach); --mk-line: rgba(254, 205, 165, 0.4); }
.rr-mk--ink    { --mk-ground: var(--text-primary);   --mk-ink: #ffffff;             --mk-body: #ffffff;               --mk-muted: var(--brand-peach);    --mk-hl: var(--brand-orange); --mk-hl2: var(--brand-peach); --mk-line: rgba(255, 255, 255, 0.24); }
.rr-mk-guides { position: absolute; border: 2px dashed rgba(127, 127, 127, 0.7); pointer-events: none; }

.rr-mk-logo { display: block; flex: none; }
.rr-mk-logo-box { display: inline-flex; align-self: flex-start; line-height: 0; flex: none; }
.rr-mk-board--center .rr-mk-logo-box, .rr-mk-end .rr-mk-logo-box { align-self: center; }
.rr-mk-logo-box.is-tiled, .rr-mk--orange .rr-mk-logo-box:not(.no-tile), .rr-mk--plum .rr-mk-logo-box:not(.no-tile), .rr-mk--ink .rr-mk-logo-box:not(.no-tile) {
  background: #ffffff; padding: calc(var(--mk-logo-h) * 0.32) calc(var(--mk-logo-h) * 0.44); border-radius: calc(var(--mk-logo-h) * 0.3); }

/* Type: the mkt-* classes come from tokens (tokens.css); these add colour and rhythm. */
.rr-mk-headline { margin: 0; color: var(--mk-ink); text-wrap: balance; font-family: var(--font-sans); }
.rr-mk-hl { color: var(--mk-hl); }
/* White on Orange only from 72px (canvas): smaller headline sizes on Orange are ink. */
.rr-mk--orange .rr-mk-headline.mkt-title, .rr-mk--orange .rr-mk-end__tag { color: var(--text-primary); }
.rr-mk-hl--orange { color: var(--brand-orange); } .rr-mk-hl--plum { color: var(--brand-plum); } .rr-mk-hl--peach { color: var(--brand-peach); }
.rr-mk-hl--ink { color: var(--text-primary); } .rr-mk-hl--white { color: #ffffff; } .rr-mk-hl--alt { color: var(--mk-hl2); }
.rr-mk-hl--block { color: #ffffff; background: var(--brand-plum); padding: 0 0.14em; border-radius: 0.12em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.rr-mk-hl--block.rr-mk-hl--orange { background: var(--brand-orange); color: #ffffff; }
.rr-mk-hl--block.rr-mk-hl--ink { background: var(--text-primary); color: #ffffff; }
.rr-mk-hl--block.rr-mk-hl--white { background: #ffffff; color: var(--brand-plum); }
.rr-mk-lede { margin: 0; color: var(--mk-body); text-wrap: pretty; }
.rr-mk-eyebrow { display: inline-flex; align-self: flex-start; align-items: center; height: 56px; padding: 0 24px; border-radius: 999px; color: var(--mk-ink); border: 3px solid currentColor; }
.rr-mk-board--center .rr-mk-eyebrow, .rr-mk-board--center .rr-mk-cta { align-self: center; }
.rr-mk-eyebrow--solid { border-color: transparent; background: var(--mk-ink); color: var(--mk-ground); }
.rr-mk-cta { display: inline-flex; align-self: flex-start; align-items: center; gap: 16px; height: 96px; padding: 0 44px; border-radius: 999px; white-space: nowrap; }
.rr-mk-cta--auto { background: var(--mk-cta-bg, var(--brand-orange)); color: var(--mk-cta-fg, #ffffff); }
.rr-mk--orange { --mk-cta-bg: #ffffff; --mk-cta-fg: var(--brand-plum); }
.rr-mk--peach { --mk-cta-bg: var(--brand-plum); --mk-cta-fg: #ffffff; }
.rr-mk-cta--orange { background: var(--brand-orange); color: #ffffff; }
.rr-mk-cta--plum { background: var(--brand-plum); color: #ffffff; }
.rr-mk-cta--white { background: #ffffff; color: var(--brand-plum); }
.rr-mk-cta--ink { background: var(--text-primary); color: #ffffff; }

/* Brand shapes: faces of the box. Their own colour unless a tone is set. */
.rr-mk-shape { display: block; flex: none; }
.rr-mk-tone--own.rr-mk-shape--browser .rr-mk-shape__fill, .rr-mk-tone--own.rr-mk-shape--browser-plain .rr-mk-shape__fill { fill: var(--brand-orange); }
.rr-mk-tone--own.rr-mk-shape--bubble .rr-mk-shape__fill, .rr-mk-tone--own.rr-mk-shape--bubble-plain .rr-mk-shape__fill { fill: var(--brand-plum); }
.rr-mk-tone--own.rr-mk-shape--top .rr-mk-shape__fill { fill: var(--brand-peach); }
.rr-mk-shape__inner { fill: #ffffff; }
.rr-mk-tone--white .rr-mk-shape__fill { fill: #ffffff; } .rr-mk-tone--white .rr-mk-shape__inner { fill: var(--mk-ground); }
.rr-mk-tone--orange .rr-mk-shape__fill { fill: var(--brand-orange); }
.rr-mk-tone--plum .rr-mk-shape__fill { fill: var(--brand-plum); }
.rr-mk-tone--peach .rr-mk-shape__fill { fill: var(--brand-peach); }
.rr-mk-tone--ink .rr-mk-shape__fill { fill: var(--text-primary); }

/* Product shot */
.rr-mk-shot { margin: 0; flex: none; background: var(--bg-surface); border-radius: 28px; overflow: hidden; box-shadow: var(--shadow-showcase); }
.rr-mk-shot__bar { display: flex; align-items: center; gap: 24px; height: 64px; padding: 0 24px; background: var(--bg-sunken); border-bottom: 1px solid var(--border-default); }
.rr-mk-shot__dots { display: inline-flex; gap: 10px; } .rr-mk-shot__dots i { width: 16px; height: 16px; border-radius: 50%; background: var(--border-default); }
.rr-mk-shot__dots i:first-child { background: var(--brand-orange); } .rr-mk-shot__dots i:nth-child(2) { background: var(--brand-peach); } .rr-mk-shot__dots i:nth-child(3) { background: var(--brand-plum); }
.rr-mk-shot__url { flex: 1; max-width: 520px; height: 36px; display: flex; align-items: center; padding: 0 16px; border-radius: 999px; background: var(--bg-surface); font: 500 18px/1 var(--font-mono); color: var(--text-secondary); }
.rr-mk-shot__body { position: relative; overflow: hidden; background: var(--bg-canvas); }
.rr-mk-shot__zoom { transform-origin: 0 0; padding: 16px; }
.rr-mk-shot__img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.rr-mk-shot__pin { position: absolute; transform-origin: 0 100%; margin-top: -28px; }
.rr-mk-shot--tilt-left { transform: perspective(2400px) rotateY(14deg) rotateX(4deg); }
.rr-mk-shot--tilt-right { transform: perspective(2400px) rotateY(-14deg) rotateX(4deg); }

/* Remark bubble: echoes the logo's speech bubble (rounded, tail at a lower corner) */
.rr-mk-bubble { position: relative; flex: none; padding: 36px 40px 40px; border-radius: 40px; font-family: var(--font-sans); }
.rr-mk-bubble::after { content: ""; position: absolute; bottom: -30px; width: 56px; height: 56px; background: inherit; clip-path: polygon(0 0, 100% 0, 0 100%); }
.rr-mk-bubble--tail-left::after { left: 64px; }
.rr-mk-bubble--tail-right::after { right: 64px; clip-path: polygon(0 0, 100% 0, 100% 100%); }
.rr-mk-bubble--plum { background: var(--brand-plum); color: #ffffff; }
.rr-mk-bubble--white { background: #ffffff; color: var(--text-primary); box-shadow: var(--shadow-showcase); }
.rr-mk-bubble--cream { background: var(--brand-cream); color: var(--text-primary); }
.rr-mk-bubble--ink { background: var(--text-primary); color: #ffffff; }
.rr-mk-bubble__head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 12px; font: 700 28px/1.2 var(--font-sans); }
.rr-mk-bubble__head span { font-weight: 500; opacity: 0.82; }
.rr-mk-bubble--plum .rr-mk-bubble__head span, .rr-mk-bubble--ink .rr-mk-bubble__head span { color: var(--brand-peach); opacity: 1; }
.rr-mk-bubble__text { margin: 0; font: 600 40px/1.3 var(--font-sans); letter-spacing: -0.01em; text-wrap: pretty; }

.rr-mk-stat { display: flex; flex-direction: column; gap: 8px; }
.rr-mk-stat__value { color: var(--mk-hl); font-variant-numeric: tabular-nums; }
.rr-mk--orange .rr-mk-stat__value { color: #ffffff; }
.rr-mk-stat__label { color: var(--mk-body); max-width: 560px; }
.rr-mk-stat__source { color: var(--mk-muted); }

/* Video parts */
.rr-mk-l3 { display: inline-flex; flex-direction: column; align-items: flex-start; font-family: var(--font-sans); }
.rr-mk-l3__name { padding: 14px 28px; font: 700 48px/1.1 var(--font-sans); letter-spacing: -0.02em; border-radius: 16px 16px 16px 0; }
.rr-mk-l3__role { padding: 10px 28px; font: 500 30px/1.2 var(--font-sans); background: #ffffff; color: var(--text-primary); border-radius: 0 0 16px 16px; }
.rr-mk-l3--plum .rr-mk-l3__name { background: var(--brand-plum); color: #ffffff; }
.rr-mk-l3--orange .rr-mk-l3__name { background: var(--brand-orange); color: #ffffff; }
.rr-mk-l3--white .rr-mk-l3__name { background: #ffffff; color: var(--brand-plum); }
.rr-mk-caption { display: flex; justify-content: center; text-align: center; }
.rr-mk-caption span { display: inline; max-width: 22ch; padding: 6px 18px; font: 600 48px/1.3 var(--font-sans); letter-spacing: -0.005em; color: #ffffff; background: rgba(20, 23, 29, 0.84); border-radius: 12px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.rr-mk-caption b { color: var(--brand-peach); font-weight: 700; }
.rr-mk-caption--vertical span { font-size: 64px; line-height: 1.25; max-width: 18ch; }
.rr-mk-end { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 40px; text-align: center; margin: auto; }
.rr-mk-end__tag { margin: 0; color: var(--mk-ink); max-width: 18ch; }
.rr-mk-end__url { margin: 0; color: var(--mk-muted); font-family: var(--font-mono); }

/* Logo reveal: 1.24s total; top drops, faces slide in along the box's 30° edges, name wipes on. */
.rr-mk-rev { display: block; overflow: visible; }
.rr-mk-rev.is-playing .rr-mk-rev__top { animation: rr-mk-drop var(--duration-brand-md) var(--easing-brand) both; }
.rr-mk-rev.is-playing .rr-mk-rev__left { animation: rr-mk-in-left var(--duration-brand-md) var(--easing-brand) 120ms both; }
.rr-mk-rev.is-playing .rr-mk-rev__right { animation: rr-mk-in-right var(--duration-brand-md) var(--easing-brand) 240ms both; }
.rr-mk-rev.is-playing .rr-mk-rev__name { animation: rr-mk-wipe var(--duration-brand-lg) var(--easing-brand) 520ms both; }
@keyframes rr-mk-drop { from { transform: translateY(-36px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rr-mk-in-left { from { transform: translate(-30px, 17px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rr-mk-in-right { from { transform: translate(30px, 17px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rr-mk-wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@media (prefers-reduced-motion: reduce) { .rr-mk-rev.is-playing g { animation: none !important; } }

/* Entrances */
.rr-mk-count { font-variant-numeric: tabular-nums; }
.rr-mk-rise.is-playing { animation: rr-mk-rise var(--duration-brand-md) var(--easing-brand) var(--mk-rise-delay, 0ms) both; }
@keyframes rr-mk-rise { from { transform: translateY(var(--mk-rise-y, 24px)); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .rr-mk-rise.is-playing { animation: none; } }
