/* ============================================================
   DAPS.Web — reusable component kit (WO3).
   Faithful CSS translation of design-system/components/**.jsx into
   semantic classes emitted by the DAPS.Web Tag Helpers.
   RULE: design tokens ONLY — every colour/font/radius/shadow comes from
   var(--…). Structural dimensions (heights, gaps, icon sizes) may use px
   where no token exists, matching the source JSX pixel values.
   ============================================================ */

/* ============================================================
   Button — core/Button.jsx
   ============================================================ */
.ds-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  border: none;
  border-radius: var(--radius-button);
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: filter var(--dur-base) var(--ease-standard),
              background var(--dur-base) var(--ease-standard),
              box-shadow var(--dur-base) var(--ease-standard);
}
.ds-btn i { width: 16px; height: 16px; flex-shrink: 0; }

/* sizes */
.ds-btn--sm  { height: 36px; padding: 0 14px; font-size: var(--fs-body-sm); }
.ds-btn--md  { height: 44px; padding: 0 18px; font-size: var(--fs-body); }
.ds-btn--cta { height: 48px; padding: 0 24px; font-size: 15px; }

.ds-btn--full { width: 100%; }

/* variants */
.ds-btn--cta         { background: var(--accent-hero); color: var(--accent-hero-text); box-shadow: var(--shadow-cta); }
.ds-btn--primary     { background: var(--accent-primary); color: var(--on-accent-primary); }
.ds-btn--secondary   { background: transparent; color: var(--accent-primary); border: 1.5px solid var(--accent-primary); }
.ds-btn--tertiary    { background: transparent; color: var(--accent-primary); }
.ds-btn--destructive { background: var(--error-surface); color: var(--error); }

.ds-btn--cta:hover:not([disabled]),
.ds-btn--primary:hover:not([disabled]) { filter: brightness(0.9); }
.ds-btn--secondary:hover:not([disabled]),
.ds-btn--tertiary:hover:not([disabled]) { background: color-mix(in srgb, var(--accent-primary) 12%, transparent); }

.ds-btn:disabled,
.ds-btn[disabled] {
  background: var(--locked);
  color: var(--text-muted);
  border: none;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.9;
  filter: none;
}

/* ============================================================
   IconButton — core/IconButton.jsx
   ============================================================ */
.ds-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max(var(--ib-size, 40px), 44px);
  height: max(var(--ib-size, 40px), 44px);
  border: none;
  border-radius: var(--radius-button);
  cursor: pointer;
  transition: background var(--dur-base) var(--ease-standard);
}
.ds-icon-btn i { width: calc(var(--ib-size, 40px) * 0.5); height: calc(var(--ib-size, 40px) * 0.5); }

.ds-icon-btn--ghost   { background: transparent; color: var(--text-primary); }
.ds-icon-btn--ghost:hover { background: var(--bg-tertiary); }
.ds-icon-btn--filled  { background: var(--bg-tertiary); color: var(--text-primary); }
.ds-icon-btn--primary { background: var(--accent-primary); color: var(--on-accent-primary); }
.ds-icon-btn--overlay { background: var(--overlay-control-bg); color: var(--brand-white); }
.ds-icon-btn:disabled { opacity: 0.4; cursor: default; }
.ds-icon-btn:disabled:hover { background: transparent; }

/* ============================================================
   StatusPill — core/StatusPill.jsx
   ============================================================ */
.ds-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: var(--fw-semibold);
  line-height: 1.6;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.ds-status-pill__dot { width: 6px; height: 6px; border-radius: var(--radius-full); background: currentColor; }

.ds-status-pill--success { color: var(--success); background: var(--success-surface); }
.ds-status-pill--warning { color: var(--warning); background: var(--warning-surface); }
.ds-status-pill--error   { color: var(--error);   background: var(--error-surface); }
.ds-status-pill--info    { color: var(--info);     background: var(--info-surface); }
.ds-status-pill--live    { color: var(--live);     background: var(--live-surface); }
.ds-status-pill--neutral { color: var(--text-muted); background: color-mix(in srgb, var(--text-muted) 16%, transparent); }

/* ============================================================
   Badge — core/Badge.jsx
   ============================================================ */
.ds-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: var(--fw-semibold);
  line-height: 1.5;
  white-space: nowrap;
}
/* solid */
.ds-badge--teal    { color: var(--on-accent-primary);   background: var(--accent-primary); }
.ds-badge--magenta { color: var(--on-accent-secondary); background: var(--accent-secondary); }
.ds-badge--navy    { color: var(--brand-white);         background: var(--brand-navy); }
.ds-badge--neutral { color: var(--text-inverse);        background: var(--text-muted); }
/* soft */
.ds-badge--soft.ds-badge--teal    { color: var(--accent-primary);   background: var(--info-surface); }
.ds-badge--soft.ds-badge--magenta { color: var(--accent-secondary); background: color-mix(in srgb, var(--accent-secondary) 16%, transparent); }
.ds-badge--soft.ds-badge--navy    { color: var(--text-primary);     background: var(--bg-tertiary); }
.ds-badge--soft.ds-badge--neutral { color: var(--text-muted);       background: color-mix(in srgb, var(--text-muted) 16%, transparent); }

/* ============================================================
   Tag — core/Tag.jsx
   ============================================================ */
.ds-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-tab);
  font-family: var(--font-body);
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  background: var(--bg-tertiary);
  white-space: nowrap;
}
.ds-tag--active { color: var(--on-accent-primary); background: var(--accent-primary); border: none; }
.ds-tag--interactive { cursor: pointer; }
.ds-tag__remove {
  display: inline-flex;
  align-items: center;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  opacity: 0.7;
}
.ds-tag__remove:hover { opacity: 1; }
.ds-tag__remove i { width: 13px; height: 13px; }

/* ============================================================
   Avatar — core/Avatar.jsx
   ============================================================ */
.ds-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--av-size, 40px);
  height: var(--av-size, 40px);
  border-radius: var(--radius-full);
  flex-shrink: 0;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: calc(var(--av-size, 40px) * 0.4);
  overflow: hidden;
}
.ds-avatar--live { border: 2px solid var(--live); box-shadow: 0 0 0 2px var(--bg-primary) inset; }
.ds-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   BrandIcon — core/BrandIcon.jsx
   ============================================================ */
.ds-brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  color: var(--brand-white);
}
.ds-brand-icon--hero    { width: 44px; height: 44px; }
.ds-brand-icon--hero i    { width: 22px; height: 22px; }
.ds-brand-icon--section { width: 32px; height: 32px; }
.ds-brand-icon--section i { width: 16px; height: 16px; }
.ds-brand-icon--action  { width: 32px; height: 32px; }
.ds-brand-icon--action i  { width: 16px; height: 16px; }
.ds-brand-icon--inline  { width: 24px; height: 24px; }
.ds-brand-icon--inline i  { width: 13px; height: 13px; }

.ds-brand-icon--teal    { background: var(--accent-primary); }
.ds-brand-icon--magenta { background: var(--accent-secondary); }
.ds-brand-icon--navy    { background: var(--brand-navy); }
.ds-brand-icon--success { background: var(--success); }
.ds-brand-icon--warning { background: var(--warning); }
.ds-brand-icon--error   { background: var(--error); }

/* ============================================================
   LogoPill — core/LogoPill.jsx
   ============================================================ */
.ds-logo-pill {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-full);
  background: var(--accent-hero);
  color: var(--accent-hero-text);
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  letter-spacing: 1.5px;
  width: max-content;
  text-decoration: none;
}
.ds-logo-pill__mark { display: inline-flex; align-items: center; }
.ds-logo-pill--sm { height: 28px; padding: 0 12px; font-size: var(--fs-body-sm); gap: 7px; }
.ds-logo-pill--sm .ds-logo-pill__mark i { width: 16px; height: 16px; }
.ds-logo-pill--md { height: 36px; padding: 0 16px; font-size: var(--fs-h3); gap: var(--space-2); }
.ds-logo-pill--md .ds-logo-pill__mark i { width: 20px; height: 20px; }
.ds-logo-pill--lg { height: 52px; padding: 0 24px; font-size: 24px; gap: var(--space-3); }
.ds-logo-pill--lg .ds-logo-pill__mark i { width: 30px; height: 30px; }

/* ============================================================
   Card — core/Card.jsx
   ============================================================ */
.ds-card {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--card-radius);
  padding: var(--ds-card-pad, var(--card-padding));
  color: var(--text-primary);
}
.ds-card--rail { border-left: 4px solid var(--rail-color); }
.ds-card--interactive {
  cursor: pointer;
  transition: background var(--dur-base) var(--ease-standard),
              box-shadow var(--dur-base) var(--ease-standard);
}
.ds-card--interactive:hover { background: var(--card-bg-hover); box-shadow: var(--shadow-card-hover); }

/* ============================================================
   Field system: Input / Textarea / Select — forms/*.jsx
   ============================================================ */
.ds-field { display: flex; flex-direction: column; gap: 6px; }
.ds-field__label {
  font-family: var(--font-body);
  font-size: var(--fs-label);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
}
.ds-field__hint  { font-size: var(--fs-caption); color: var(--text-muted); }
.ds-field__error { font-size: var(--fs-caption); color: var(--error); }

/* Input */
.ds-input {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px 12px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-input);
  transition: border-color var(--dur-base) var(--ease-standard),
              box-shadow var(--dur-base) var(--ease-standard);
}
.ds-input:focus-within {
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--focus-ring) 35%, transparent);
}
.ds-input--error { border-color: var(--error); }
.ds-input--error:focus-within { border-color: var(--error); box-shadow: none; }
.ds-input > i { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
.ds-input input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--text-primary);
}
.ds-input input::placeholder { color: var(--text-muted); }

/* Textarea */
.ds-textarea {
  resize: vertical;
  padding: 10px 12px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-input);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--dur-base) var(--ease-standard),
              box-shadow var(--dur-base) var(--ease-standard);
}
.ds-textarea::placeholder { color: var(--text-muted); }
.ds-textarea:focus {
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--focus-ring) 35%, transparent);
}
.ds-textarea--error { border-color: var(--error); }
.ds-textarea--error:focus { border-color: var(--error); box-shadow: none; }

/* Select */
.ds-select__wrap { position: relative; }
.ds-select__control {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  padding: 10px 36px 10px 12px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-input);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
  transition: border-color var(--dur-base) var(--ease-standard),
              box-shadow var(--dur-base) var(--ease-standard);
}
.ds-select__control:focus {
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--focus-ring) 35%, transparent);
}
.ds-select__control option { background: var(--bg-secondary); }
.ds-select__chevron {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

/* ============================================================
   Checkbox / Radio / Switch — forms/*.jsx (native input, styled)
   ============================================================ */
.ds-checkbox, .ds-radio, .ds-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.ds-checkbox--disabled, .ds-radio--disabled, .ds-switch--disabled { cursor: not-allowed; opacity: 0.5; }

.ds-choice-input { /* visually hidden but focusable native control */
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  margin: 0;
  opacity: 0;
  cursor: inherit;
}

.ds-control-label {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--text-primary);
}

/* Checkbox box */
.ds-checkbox__box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  flex-shrink: 0;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--on-accent-primary);
  transition: background var(--dur-fast) var(--ease-standard);
}
.ds-checkbox__box i { width: 14px; height: 14px; opacity: 0; }
.ds-choice-input:checked + .ds-checkbox__box { background: var(--accent-primary); border-color: transparent; }
.ds-choice-input:checked + .ds-checkbox__box i { opacity: 1; }
.ds-choice-input:focus-visible + .ds-checkbox__box {
  outline: var(--focus-outline);
  outline-offset: var(--focus-offset);
}

/* Radio box */
.ds-radio__box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
}
.ds-radio__box .ds-radio__dot { width: 10px; height: 10px; border-radius: var(--radius-full); background: var(--accent-primary); opacity: 0; }
.ds-choice-input:checked + .ds-radio__box { border: 2px solid var(--accent-primary); }
.ds-choice-input:checked + .ds-radio__box .ds-radio__dot { opacity: 1; }
.ds-choice-input:focus-visible + .ds-radio__box {
  outline: var(--focus-outline);
  outline-offset: var(--focus-offset);
}

/* Switch track/thumb */
.ds-switch__track {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  background: var(--bg-elevated);
  transition: background var(--dur-base) var(--ease-standard);
}
.ds-switch__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  background: var(--text-muted);
  transition: left var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-standard);
}
.ds-choice-input:checked + .ds-switch__track { background: var(--accent-primary); }
.ds-choice-input:checked + .ds-switch__track .ds-switch__thumb { left: 21px; background: var(--on-accent-primary); }
.ds-choice-input:focus-visible + .ds-switch__track {
  outline: var(--focus-outline);
  outline-offset: var(--focus-offset);
}

/* ============================================================
   Modal — feedback/Modal.jsx
   ============================================================ */
.ds-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--scrim);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}
.ds-modal-overlay--embedded { position: absolute; } /* preview/embed only */
.ds-modal {
  width: var(--modal-w, 480px);
  max-width: 100%;
  max-height: 90vh;
  overflow: auto;
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-modal);
  box-shadow: var(--shadow-elevated);
}
.ds-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}
.ds-modal__title { margin: 0; font-family: var(--font-display); font-weight: var(--fw-bold); font-size: var(--fs-h2); color: var(--text-primary); }
.ds-modal__close {
  display: inline-flex;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}
.ds-modal__close i { width: 18px; height: 18px; }
.ds-modal__body { padding: 20px; font-family: var(--font-body); font-size: var(--fs-body); color: var(--text-primary); line-height: var(--lh-body); }
.ds-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
}

/* ============================================================
   Banner — feedback/Banner.jsx
   ============================================================ */
.ds-banner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 12px 16px;
  border-radius: var(--radius-input);
  border-left: 4px solid var(--info);
  background: var(--info-surface);
  font-family: var(--font-body);
}
.ds-banner > i { width: 18px; height: 18px; color: var(--info); flex-shrink: 0; }
.ds-banner__body { flex: 1; min-width: 0; }
.ds-banner__title { font-weight: var(--fw-semibold); font-size: var(--fs-body-sm); color: var(--text-primary); }
.ds-banner__text  { font-size: var(--fs-body-sm); color: var(--text-muted); }
.ds-banner__action { margin-left: var(--space-2); }

.ds-banner--info    { background: var(--info-surface);    border-left-color: var(--info); }
.ds-banner--info > i    { color: var(--info); }
.ds-banner--success { background: var(--success-surface); border-left-color: var(--success); }
.ds-banner--success > i { color: var(--success); }
.ds-banner--warning { background: var(--warning-surface); border-left-color: var(--warning); }
.ds-banner--warning > i { color: var(--warning); }
.ds-banner--error   { background: var(--error-surface);   border-left-color: var(--error); }
.ds-banner--error > i   { color: var(--error); }

/* ============================================================
   Toast — feedback/Toast.jsx
   ============================================================ */
.ds-toast {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  min-width: 240px;
  max-width: 360px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-input);
  box-shadow: var(--shadow-dropdown);
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
  color: var(--text-primary);
}
.ds-toast > i { width: 18px; height: 18px; flex-shrink: 0; }
.ds-toast__text { flex: 1; }
.ds-toast--success > i { color: var(--success); }
.ds-toast--error   > i { color: var(--error); }
.ds-toast--info    > i { color: var(--info); }
.ds-toast--neutral > i { color: var(--accent-primary); }
.ds-toast__close {
  display: inline-flex;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
}
.ds-toast__close i { width: 15px; height: 15px; }

/* ============================================================
   Tooltip — feedback/Tooltip.jsx (CSS-only reveal)
   ============================================================ */
.ds-tooltip { position: relative; display: inline-flex; }
.ds-tooltip__bubble {
  position: absolute;
  z-index: 50;
  white-space: nowrap;
  padding: 6px 10px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: var(--fs-caption);
  box-shadow: var(--shadow-dropdown);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-standard);
}
.ds-tooltip:hover .ds-tooltip__bubble,
.ds-tooltip:focus-within .ds-tooltip__bubble { opacity: 1; }
.ds-tooltip__bubble--top    { bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: var(--space-2); }
.ds-tooltip__bubble--bottom { top: 100%;    left: 50%; transform: translateX(-50%); margin-top: var(--space-2); }
.ds-tooltip__bubble--left   { right: 100%;  top: 50%;  transform: translateY(-50%); margin-right: var(--space-2); }
.ds-tooltip__bubble--right  { left: 100%;   top: 50%;  transform: translateY(-50%); margin-left: var(--space-2); }

/* ============================================================
   EmptyState — feedback/EmptyState.jsx
   ============================================================ */
.ds-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--space-3);
  padding: 48px 24px;
  font-family: var(--font-body);
}
.ds-empty__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  color: var(--accent-primary);
}
.ds-empty__icon i { width: 26px; height: 26px; }
.ds-empty__title { font-family: var(--font-display); font-weight: var(--fw-bold); font-size: var(--fs-h2); color: var(--text-primary); }
.ds-empty__desc  { font-size: var(--fs-body-sm); color: var(--text-muted); max-width: 320px; line-height: var(--lh-body); }
.ds-empty__action { margin-top: 6px; }

/* ============================================================
   Skeleton — feedback/Skeleton.jsx
   ============================================================ */
@keyframes daps-shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
.ds-skeleton {
  display: block;
  width: var(--sk-w, 100%);
  height: var(--sk-h, 16px);
  border-radius: var(--sk-r, 8px);
  background: linear-gradient(90deg, var(--bg-secondary) 0%, var(--bg-tertiary) 50%, var(--bg-secondary) 100%);
  background-size: 800px 100%;
  animation: daps-shimmer 1.4s infinite linear;
}
@media (prefers-reduced-motion: reduce) { .ds-skeleton { animation: none; } }

/* ============================================================
   Tabs — navigation/Tabs.jsx
   ============================================================ */
.ds-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-subtle); }
.ds-tab {
  position: relative;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-medium);
  color: var(--text-muted);
  transition: color var(--dur-base) var(--ease-standard);
}
.ds-tab::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -1px;
  height: 3px;
  border-radius: 3px;
  background: transparent;
}
.ds-tab--active { font-weight: var(--fw-bold); color: var(--text-primary); }
.ds-tab--active::after { background: var(--accent-primary); }

/* ============================================================
   TopBar — navigation/TopBar.jsx (reusable variant of the shell chrome)
   ============================================================ */
.ds-topbar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  height: var(--topbar-h);
  padding: 0 var(--space-5);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border-subtle);
}
.ds-topbar__search {
  flex: 1;
  max-width: 460px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: 40px;
  padding: 0 14px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-full);
}
.ds-topbar__search i { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
.ds-topbar__search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--text-primary);
}
.ds-topbar__search input::placeholder { color: var(--text-muted); }
.ds-topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.ds-topbar__create {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: 40px;
  padding: 0 16px;
  border: none;
  border-radius: var(--radius-tab);
  background: var(--accent-primary);
  color: var(--on-accent-primary);
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-body-sm);
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--glow-teal);
}
.ds-topbar__create i { width: 15px; height: 15px; }

/* ============================================================
   BottomNav — navigation/BottomNav.jsx
   ============================================================ */
.ds-bottomnav {
  display: flex;
  height: var(--bottomnav-h);
  background: var(--header-bg);
  border-top: 1px solid var(--border-subtle);
}
.ds-bottomnav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 44px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: var(--fs-caption);
  font-weight: var(--fw-medium);
}
.ds-bottomnav__item i { width: 22px; height: 22px; transition: transform var(--dur-base) var(--ease-out); }
.ds-bottomnav__item--active { color: var(--accent-primary); font-weight: var(--fw-semibold); }
.ds-bottomnav__item--active i { transform: scale(1.1); }

/* ============================================================
   ============================================================
   WO4 — the six DAPS-specific components. Same rules: tokens only.
   Media-legibility scrims (player/thumbnail) use the sanctioned
   --media-*/--player-* scrim tokens; never brand gradients.
   ============================================================
   ============================================================ */

/* ============================================================
   ContentCard — daps/ContentCard.jsx
   ============================================================ */
.ds-content-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  cursor: pointer;
  /* medium tint (glyph chip + placeholder); overridden per --{type} below */
  --type-tint: var(--type-motion);
}
.ds-content-card--video   { --type-tint: var(--type-motion); }
.ds-content-card--podcast { --type-tint: var(--type-audio); }
.ds-content-card--music   { --type-tint: var(--type-audio); }
.ds-content-card--article { --type-tint: var(--type-text); }
.ds-content-card--image   { --type-tint: var(--type-image); }

.ds-content-card__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--card-radius);
  overflow: hidden;
  background: var(--bg-tertiary);
}
.ds-content-card--music .ds-content-card__thumb { aspect-ratio: 1 / 1; }
.ds-content-card__media {
  position: absolute;
  inset: 0;
  transition: transform var(--dur-slow) var(--ease-out);
}
.ds-content-card:hover .ds-content-card__media { transform: scale(1.03); }
.ds-content-card__media img { width: 100%; height: 100%; object-fit: cover; }
.ds-content-card__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--type-tint);
  opacity: 0.5;
}
.ds-content-card__placeholder i { width: 40px; height: 40px; }

.ds-content-card__type {
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-button);
  background: var(--player-scrim);
  color: var(--on-media);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: var(--fw-semibold);
}
.ds-content-card__type i { width: 12px; height: 12px; color: var(--type-tint); }

.ds-content-card__live {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-button);
  background: var(--live);
  color: var(--brand-white);
  font-size: 10px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.5px;
}
.ds-content-card__live-dot { width: 6px; height: 6px; border-radius: var(--radius-full); background: var(--brand-white); }

.ds-content-card__duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--media-chip-scrim);
  color: var(--on-media);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: var(--fw-semibold);
}

/* 09e watch-history: resume chip (bottom-left) + progress overlay (bottom edge). Opt-in — only
   rendered when the ContentCard is given resume-label / progress, so all other cards are unchanged. */
.ds-content-card__resume {
  position: absolute;
  bottom: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--media-chip-scrim);
  color: var(--on-media);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: var(--fw-semibold);
}
.ds-content-card__resume i { width: 12px; height: 12px; }

.ds-content-card__progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: var(--player-scrim);
}
.ds-content-card__progress-fill {
  height: 100%;
  background: var(--accent-primary);
}

.ds-content-card__body { display: flex; flex-direction: column; gap: 4px; }
.ds-content-card__titlerow { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.ds-content-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: 14px;
  line-height: 1.3;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ds-content-card__channel,
.ds-content-card__meta { font-family: var(--font-body); font-size: 12px; color: var(--text-muted); }

/* 08d personalized For-You reason line — subtle, tokens-only; accent-tinted glyph. */
.ds-content-card__reason {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-muted);
}
.ds-content-card__reason i { width: 12px; height: 12px; color: var(--accent-primary); flex-shrink: 0; }

/* ============================================================
   VideoPlayer — daps/VideoPlayer.jsx (chrome only)
   ============================================================ */
.ds-video-player {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  background: var(--player-bg);
  border-radius: var(--card-radius);
  overflow: hidden;
}
.ds-video-player__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.85; }
.ds-video-player__poster--empty { background: var(--bg-primary); opacity: 1; }

.ds-video-player__center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  background: var(--accent-primary);
  color: var(--on-accent-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glow-teal);
}
.ds-video-player__center i { width: 30px; height: 30px; margin-left: 3px; }
.ds-video-player.is-playing .ds-video-player__center { display: none; }

.ds-video-player__top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background: var(--player-scrim-top);
}
.ds-video-player__title { font-family: var(--font-display); font-weight: var(--fw-semibold); font-size: 15px; color: var(--on-media); }
.ds-video-player__channel { font-family: var(--font-body); font-size: 12px; color: var(--on-media-dim); }
.ds-video-player__live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-button);
  background: var(--live);
  color: var(--brand-white);
  font-size: 11px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.5px;
}
.ds-video-player__live-dot { width: 6px; height: 6px; border-radius: var(--radius-full); background: var(--brand-white); }

.ds-video-player__bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 12px 8px;
  background: var(--player-scrim-bottom);
}
.ds-video-player__scrubber {
  position: relative;
  height: 5px;
  border-radius: 3px;
  background: var(--player-track);
  margin: 8px 4px 4px;
  cursor: pointer;
}
.ds-video-player__buffered { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--accent-secondary); opacity: 0.55; }
.ds-video-player__played   { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--accent-primary); }
.ds-video-player__thumb {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 13px;
  height: 13px;
  border-radius: var(--radius-full);
  background: var(--accent-primary);
  box-shadow: var(--player-thumb-ring);
}
.ds-video-player__controls { display: flex; align-items: center; gap: 2px; }
.ds-vp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border: none;
  background: transparent;
  color: var(--on-media);
  cursor: pointer;
  border-radius: var(--radius-button);
}
.ds-vp-btn i { width: 20px; height: 20px; }
.ds-vp-btn--big i { width: 26px; height: 26px; }
.ds-video-player__time { font-family: var(--font-body); font-size: 12px; color: var(--on-media); margin: 0 8px; letter-spacing: 0.3px; }
.ds-video-player__spacer { flex: 1; }

/* ---- WO-B (05f): multi-track caption menu — tokens only, keyboard-accessible ---- */
.ds-vp-captions { position: relative; display: inline-flex; }
.ds-vp-captions__menu {
  position: absolute;
  /* DAPS-P2.6 (04f RTL): logical property, matching the .ds-comment__menu precedent, so the caption
     menu anchors to the trailing edge in both LTR and RTL rather than always visually "right". */
  inset-inline-end: 0;
  bottom: calc(100% + 8px);
  z-index: 5;
  min-width: 180px;
  max-width: 260px;
  padding: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-input);
  box-shadow: var(--shadow-dropdown);
}
.ds-vp-captions__item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-button);
}
.ds-vp-captions__item:hover { background: var(--bg-tertiary); }
.ds-vp-captions__item[aria-checked="true"] { color: var(--accent-primary); font-weight: var(--fw-semibold); }
.ds-vp-captions__item:focus-visible {
  outline: var(--focus-outline);
  outline-offset: var(--focus-offset);
}

/* ---- WO-B (04): real player element + states (tokens only) ---- */
/* The real <video> fills the frame; the poster attribute stands in until playback. */
.ds-video-player__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--player-bg); }

/* Keyboard focus — visible magenta ring on every interactive control + the seek slider. */
.ds-vp-btn:focus-visible,
.ds-video-player__center:focus-visible,
.ds-video-player__scrubber:focus-visible {
  outline: var(--focus-outline);
  outline-offset: var(--focus-offset);
}

/* Buffering spinner — hidden unless .is-buffering; reduced-motion safe (no spin when reduced). */
.ds-video-player__spinner { display: none; }
.ds-video-player.is-buffering .ds-video-player__spinner {
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: var(--radius-full);
  border: 3px solid color-mix(in srgb, var(--on-media) 30%, transparent);
  border-top-color: var(--accent-primary);
}
@media (prefers-reduced-motion: no-preference) {
  .ds-video-player.is-buffering .ds-video-player__spinner { animation: ds-vp-spin 0.8s linear infinite; }
}
@keyframes ds-vp-spin { to { transform: rotate(360deg); } }
/* Hide the centre play button while buffering so the spinner reads clearly. */
.ds-video-player.is-buffering .ds-video-player__center { display: none; }

/* Not-available state — graceful, tokens-only (no broken/empty player). */
.ds-video-player--unavailable .ds-video-player__unavailable {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 24px;
  background: var(--player-scrim-bottom);
}
.ds-video-player__unavailable-icon { width: 40px; height: 40px; color: var(--on-media-dim); }
.ds-video-player__unavailable-title { font-family: var(--font-display); font-weight: var(--fw-semibold); font-size: 16px; color: var(--on-media); }
.ds-video-player__unavailable-text { font-family: var(--font-body); font-size: 13px; color: var(--on-media-dim); max-width: 32ch; }

/* ============================================================
   MiniPlayer — daps/MiniPlayer.jsx
   ============================================================ */
.ds-mini-player {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background: var(--bg-elevated);
}
.ds-mini-player--fixed {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  border-top: 1px solid var(--border-subtle);
}
.ds-mini-player--inline { border: 1px solid var(--border-subtle); border-radius: var(--card-radius); }

.ds-mini-player__lead { display: flex; align-items: center; gap: 12px; min-width: 0; width: 240px; }
.ds-mini-player__art {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-button);
  background: var(--bg-tertiary);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--type-audio);
}
.ds-mini-player__art img { width: 100%; height: 100%; object-fit: cover; }
.ds-mini-player__art i { width: 20px; height: 20px; }
.ds-mini-player__title { font-family: var(--font-display); font-weight: var(--fw-semibold); font-size: 13px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-mini-player__context { font-family: var(--font-body); font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ds-mini-player__center { flex: 1; display: flex; flex-direction: column; gap: 6px; max-width: 560px; margin: 0 auto; }
.ds-mini-player__transport { display: flex; align-items: center; justify-content: center; gap: 2px; }
.ds-mp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border: none;
  border-radius: var(--radius-button);
  cursor: pointer;
  background: transparent;
  color: var(--text-primary);
}
.ds-mp-btn i { width: 20px; height: 20px; }
.ds-mp-btn--play { border-radius: var(--radius-full); background: var(--accent-primary); color: var(--on-accent-primary); }
.ds-mp-btn--play i { width: 22px; height: 22px; }

.ds-mini-player__progress { display: flex; align-items: center; gap: 8px; }
.ds-mini-player__time { font-family: var(--font-body); font-size: 11px; color: var(--text-muted); width: 40px; }
.ds-mini-player__time--left { text-align: right; }
.ds-mini-player__rail { position: relative; flex: 1; height: 4px; border-radius: 3px; background: var(--bg-tertiary); }
.ds-mini-player__fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--accent-primary); }
.ds-mini-player__knob { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 11px; height: 11px; border-radius: var(--radius-full); background: var(--accent-primary); }

.ds-mini-player__trail { display: flex; align-items: center; gap: 2px; width: 160px; justify-content: flex-end; }
.ds-mini-player__speed { font-family: var(--font-body); font-size: 12px; font-weight: var(--fw-semibold); color: var(--accent-primary); padding: 0 6px; }

/* ---- DAPS-P2.6 (§9): the real, JS-hydrated dock — hidden by default; higher specificity than the
   .ds-mini-player{display:flex} rule above (author-origin, so specificity alone won't win over [hidden]
   without this) so an un-hydrated / dismissed dock never paints. The lead is an <a> in real mode (it
   navigates to /watch/{slug}) so its default underline/link colour are reset to match the design system,
   same as every other icon-button control here. ---- */
.ds-mini-player[hidden] { display: none; }
.ds-mini-player__lead[href] { text-decoration: none; }
.ds-mp-btn:focus-visible,
.ds-mini-player__lead:focus-visible {
  outline: var(--focus-outline);
  outline-offset: var(--focus-offset);
}

/* Shared play/pause icon swap (video + mini player) — driven by .is-playing */
.ds-media__i-pause { display: none; }
.is-playing .ds-media__i-play { display: none; }
.is-playing .ds-media__i-pause { display: inline-flex; }

/* ============================================================
   ChannelHeader — daps/ChannelHeader.jsx
   ============================================================ */
.ds-channel-header__banner {
  position: relative;
  height: 180px;
  border-radius: var(--card-radius);
  overflow: hidden;
  background: var(--bg-tertiary);
}
.ds-channel-header__banner img { width: 100%; height: 100%; object-fit: cover; }
.ds-channel-header__banner--empty { background: var(--bg-secondary); }

.ds-channel-header__bar { display: flex; align-items: flex-end; gap: 16px; padding: 0 4px; margin-top: -28px; }
.ds-channel-header__avatar {
  width: 88px;
  height: 88px;
  border-radius: var(--radius-full);
  border: 4px solid var(--bg-primary);
  background: var(--accent-hero);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-hero-text);
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: 30px;
}
.ds-channel-header__avatar img { width: 100%; height: 100%; object-fit: cover; }

.ds-channel-header__id { flex: 1; min-width: 0; padding-bottom: 6px; }
.ds-channel-header__namerow { display: flex; align-items: center; gap: 8px; }
.ds-channel-header__name { margin: 0; font-family: var(--font-display); font-weight: var(--fw-bold); font-size: 22px; color: var(--text-primary); }
.ds-channel-header__verified { width: 20px; height: 20px; color: var(--accent-primary); }
.ds-channel-header__meta { font-family: var(--font-body); font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.ds-channel-header__count { color: var(--text-primary); font-weight: var(--fw-bold); }

.ds-channel-header__sub {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border: none;
  border-radius: var(--radius-button);
  background: var(--accent-hero);
  color: var(--accent-hero-text);
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
}
.ds-channel-header__sub i { width: 16px; height: 16px; }
.ds-channel-header__sub--on { background: transparent; border: 1.5px solid var(--accent-primary); color: var(--accent-primary); }

/* ============================================================
   EngagementBar — daps/EngagementBar.jsx
   ============================================================ */
.ds-engagement-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ds-engagement-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px;
  border: none;
  border-radius: var(--radius-tab);
  cursor: pointer;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: var(--fw-semibold);
}
.ds-engagement-chip i { width: 17px; height: 17px; }
.ds-engagement-chip--active { background: color-mix(in srgb, var(--accent-primary) 18%, transparent); color: var(--accent-primary); }

/* ---- Share popover (09d, WO-B) — tokens-only elevated dialog; mirrors the caption-menu pattern.
   The trigger keeps its .ds-engagement-chip look; the popover anchors to the chip. ---- */
.ds-share { position: relative; display: inline-flex; }
.ds-share-pop {
  position: absolute;
  top: calc(100% + var(--space-2));
  left: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 240px;
  max-width: 320px;
  padding: var(--space-2);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-modal);
  box-shadow: var(--shadow-elevated);
}
.ds-share-pop[hidden] { display: none; }

.ds-share-pop__action {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  border: none;
  border-radius: var(--radius-button);
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-medium);
  text-align: left;
  cursor: pointer;
}
.ds-share-pop__action i { flex-shrink: 0; width: 18px; height: 18px; }
.ds-share-pop__action:hover { background: var(--bg-tertiary); }
.ds-share-pop__action:focus-visible {
  outline: var(--focus-outline);
  outline-offset: var(--focus-offset);
}
/* Primary "Copy link" action — accent-tinted so it reads as the default. */
.ds-share-pop__action--primary { color: var(--accent-primary); font-weight: var(--fw-semibold); }
.ds-share-pop__action--primary:hover { background: color-mix(in srgb, var(--accent-primary) 14%, transparent); }

.ds-share-pop__fallback { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-1) var(--space-3) var(--space-2); }
.ds-share-pop__fallback[hidden] { display: none; }
.ds-share-pop__fallback-label { font-family: var(--font-body); font-size: var(--fs-caption); color: var(--text-secondary); }
.ds-share-pop__fallback-input {
  width: 100%;
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-input);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
}
.ds-share-pop__fallback-input:focus-visible {
  outline: var(--focus-outline);
  outline-offset: var(--focus-offset);
}

.ds-share-pop__status {
  min-height: 20px;
  padding: 0 var(--space-3);
  font-family: var(--font-body);
  font-size: var(--fs-caption);
  color: var(--accent-primary);
}
.ds-share-pop__status:empty { display: none; }

/* ---- Add-to-playlist popover (05e, WO-B) — tokens-only elevated dialog; mirrors the share popover.
   The trigger keeps its .ds-engagement-chip look; the popover anchors to the chip. ---- */
.ds-playlist-add { position: relative; display: inline-flex; }
.ds-playlist-pop {
  position: absolute;
  top: calc(100% + var(--space-2));
  left: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 260px;
  max-width: 340px;
  padding: var(--space-3);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-modal);
  box-shadow: var(--shadow-elevated);
}
.ds-playlist-pop[hidden] { display: none; }

.ds-playlist-pop__heading {
  font-family: var(--font-display);
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
}
.ds-playlist-pop__list { display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow-y: auto; }
.ds-playlist-pop__empty {
  margin: 0;
  padding: var(--space-2) var(--space-1);
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
  color: var(--text-secondary);
}
.ds-playlist-pop__row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-button);
  cursor: pointer;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
}
.ds-playlist-pop__row:hover { background: var(--bg-tertiary); }
.ds-playlist-pop__check {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--accent-primary);
  cursor: pointer;
}
.ds-playlist-pop__check:focus-visible {
  outline: var(--focus-outline);
  outline-offset: var(--focus-offset);
}
.ds-playlist-pop__row-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Channel-playlist marker in the picker — a small, non-colour-only label (a word, not just a tint). */
.ds-playlist-pop__row-badge {
  flex-shrink: 0;
  margin-inline-start: auto;
  padding: 0 var(--space-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: var(--fs-caption);
  line-height: 1.6;
}

.ds-playlist-pop__create { display: flex; flex-direction: column; gap: var(--space-1); border-top: 1px solid var(--border-subtle); padding-top: var(--space-2); }
.ds-playlist-pop__create-label { font-family: var(--font-body); font-size: var(--fs-caption); color: var(--text-secondary); }
.ds-playlist-pop__create-row { display: flex; align-items: center; gap: var(--space-2); }
.ds-playlist-pop__create-input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-input);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
}
.ds-playlist-pop__create-input:focus-visible {
  outline: var(--focus-outline);
  outline-offset: var(--focus-offset);
}
.ds-playlist-pop__create-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 44px;
  padding: 0 var(--space-3);
  border: none;
  border-radius: var(--radius-button);
  cursor: pointer;
  background: var(--accent-primary);
  color: var(--on-accent-primary);
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-semibold);
}
.ds-playlist-pop__create-btn i { width: 16px; height: 16px; }
.ds-playlist-pop__create-btn:focus-visible {
  outline: var(--focus-outline);
  outline-offset: var(--focus-offset);
}
.ds-playlist-pop__create-btn:disabled { opacity: 0.6; cursor: default; }

.ds-playlist-pop__status {
  min-height: 20px;
  font-family: var(--font-body);
  font-size: var(--fs-caption);
  color: var(--accent-primary);
}
.ds-playlist-pop__status:empty { display: none; }

/* ============================================================
   Comment — daps/Comment.jsx (threaded, replies slot)
   ============================================================ */
.ds-comment { display: flex; gap: 12px; }
.ds-comment__avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: 14px;
  color: var(--text-primary);
}
.ds-comment__avatar img { width: 100%; height: 100%; object-fit: cover; }
.ds-comment__main { flex: 1; min-width: 0; }
.ds-comment__head { display: flex; align-items: baseline; gap: 8px; }
.ds-comment__author { font-family: var(--font-display); font-weight: var(--fw-semibold); font-size: 13px; color: var(--text-primary); }
.ds-comment__time { font-family: var(--font-body); font-size: 12px; color: var(--text-muted); }
.ds-comment__body { font-family: var(--font-body); font-size: 14px; line-height: var(--lh-body); color: var(--text-primary); margin-top: 3px; }
.ds-comment__actions { display: flex; align-items: center; gap: 16px; margin-top: 4px; }
.ds-comment__action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: var(--fw-semibold);
}
.ds-comment__action i { width: 15px; height: 15px; }
.ds-comment__action--liked { color: var(--accent-primary); }
/* 09c: the per-comment Like submit lives in a wrapping antiforgery <form>; `display: contents` lets the
   button participate directly in the .ds-comment__actions flex row, so the control renders unchanged. */
.ds-comment__like-form { display: contents; }
.ds-comment__replies {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
  padding-left: 12px;
  border-left: 2px solid var(--border-subtle);
}

/* ---- Comment lifecycle (09a Phase 2, WO-B) — per-comment action menu, inline edit, indicators &
   placeholders. Tokens only; mirrors the share/caption elevated-surface popover. Rendered only when the
   server flags an action/indicator, so the anonymous thread stays byte-identical. ---- */

/* Indicators in the head row */
.ds-comment__edited { font-family: var(--font-body); font-size: 12px; color: var(--text-muted); }
.ds-comment__pin {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: var(--fw-semibold);
  color: var(--accent-primary);
}
.ds-comment__pin i { width: 13px; height: 13px; }
.ds-comment__badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  background: var(--warning-surface);
  color: var(--warning);
  font-family: var(--font-body);
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
}

/* Deleted / hidden body treatment */
.ds-comment__body--deleted { color: var(--text-muted); font-style: italic; }
.ds-comment--hidden .ds-comment__body { color: var(--text-muted); }

/* Kebab overflow trigger — pushed to the end of the head row */
.ds-comment__menu { position: relative; display: inline-flex; margin-inline-start: auto; }
.ds-comment__menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: var(--radius-button);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.ds-comment__menu-trigger i { width: 18px; height: 18px; }
.ds-comment__menu-trigger:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.ds-comment__menu-trigger:focus-visible {
  outline: var(--focus-outline);
  outline-offset: var(--focus-offset);
}

/* The role="menu" popover — elevated surface, anchored to the trigger */
.ds-comment__menu-pop {
  position: absolute;
  top: calc(100% + var(--space-1));
  inset-inline-end: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 180px;
  padding: var(--space-2);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-modal);
  box-shadow: var(--shadow-elevated);
}
.ds-comment__menu-pop[hidden] { display: none; }
.ds-comment__menu-form { margin: 0; }
.ds-comment__menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  border: none;
  border-radius: var(--radius-button);
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-medium);
  text-align: left;
  cursor: pointer;
}
.ds-comment__menu-item i { flex-shrink: 0; width: 16px; height: 16px; }
.ds-comment__menu-item:hover { background: var(--bg-tertiary); }
.ds-comment__menu-item:focus-visible {
  outline: var(--focus-outline);
  outline-offset: var(--focus-offset);
}
.ds-comment__menu-item--danger { color: var(--error); }
.ds-comment__menu-item--danger:hover { background: var(--error-surface); }

/* ---- Report dialog (13a) — tokens-only elevated dialog anchored to the kebab menu; mirrors the
   share/playlist popovers. Rendered only for an authed non-author viewer on an active comment. ---- */
.ds-comment__report {
  position: absolute;
  top: calc(100% + var(--space-1));
  inset-inline-end: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 260px;
  max-width: 340px;
  padding: var(--space-3);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-modal);
  box-shadow: var(--shadow-elevated);
}
.ds-comment__report[hidden] { display: none; }
.ds-comment__report-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
}
.ds-comment__report-form { display: flex; flex-direction: column; gap: var(--space-3); margin: 0; }
.ds-comment__report-reasons {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  border: none;
}
.ds-comment__report-legend {
  padding: 0 0 var(--space-1);
  font-family: var(--font-body);
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  color: var(--text-secondary);
}
.ds-comment__report-reason {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-button);
  cursor: pointer;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
}
.ds-comment__report-reason:hover { background: var(--bg-tertiary); }
.ds-comment__report-radio { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--accent-primary); }
.ds-comment__report-radio:focus-visible {
  outline: var(--focus-outline);
  outline-offset: var(--focus-offset);
}
.ds-comment__report-note-label {
  font-family: var(--font-body);
  font-size: var(--fs-caption);
  color: var(--text-secondary);
}
.ds-comment__report-note {
  width: 100%;
  min-height: 64px;
  padding: var(--space-2) var(--space-3);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-input);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
  resize: vertical;
}
.ds-comment__report-note:focus-visible {
  outline: var(--focus-outline);
  outline-offset: var(--focus-offset);
}
.ds-comment__report-actions { display: flex; gap: var(--space-2); justify-content: flex-end; }
.ds-comment__report-submit,
.ds-comment__report-cancel {
  min-height: 44px;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-button);
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-semibold);
  cursor: pointer;
}
.ds-comment__report-submit {
  border: none;
  background: var(--accent-primary);
  color: var(--on-accent-primary);
}
.ds-comment__report-submit:hover { background: var(--accent-primary-hover); }
.ds-comment__report-cancel {
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-primary);
}
.ds-comment__report-cancel:hover { background: var(--bg-tertiary); }
.ds-comment__report-submit:focus-visible,
.ds-comment__report-cancel:focus-visible {
  outline: var(--focus-outline);
  outline-offset: var(--focus-offset);
}

/* Inline editor — revealed in place of the body */
.ds-comment__edit { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-2); }
.ds-comment__edit[hidden] { display: none; }
.ds-comment__edit-input {
  width: 100%;
  min-height: 72px;
  padding: var(--space-2) var(--space-3);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-input);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
  line-height: var(--lh-body);
  resize: vertical;
}
.ds-comment__edit-input:focus-visible {
  outline: var(--focus-outline);
  outline-offset: var(--focus-offset);
  border-color: var(--input-border-focus);
}
.ds-comment__edit-actions { display: flex; gap: var(--space-2); }
.ds-comment__edit-save,
.ds-comment__edit-cancel {
  min-height: 44px;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-button);
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-semibold);
  cursor: pointer;
}
.ds-comment__edit-save {
  border: none;
  background: var(--accent-primary);
  color: var(--on-accent-primary);
}
.ds-comment__edit-save:hover { background: var(--accent-primary-hover); }
.ds-comment__edit-cancel {
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-primary);
}
.ds-comment__edit-cancel:hover { background: var(--bg-tertiary); }
.ds-comment__edit-save:focus-visible,
.ds-comment__edit-cancel:focus-visible {
  outline: var(--focus-outline);
  outline-offset: var(--focus-offset);
}

/* Reduced-motion: kill the thumbnail zoom (media components) */
@media (prefers-reduced-motion: reduce) {
  .ds-content-card__media { transition: none; }
  .ds-content-card:hover .ds-content-card__media { transform: none; }
}

/* ============================================================
   Shell search typeahead (07e, WO-B) — accessible combobox listbox.
   Tokens only. Hidden/empty until the user types (no layout shift, no visual
   change to the topbar search box until suggestions arrive). Mirrors the
   caption-menu (.ds-vp-captions) elevated-surface pattern.
   ============================================================ */
/* Anchor the absolutely-positioned listbox to the topbar search form.
   position: relative does not change the box's appearance. */
.topbar-search { position: relative; }

.search-suggest {
  position: absolute;
  top: calc(100% + var(--space-2));
  left: 0;
  right: 0;
  z-index: 60;
  margin: 0;
  padding: var(--space-1);
  list-style: none;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-input);
  box-shadow: var(--shadow-dropdown);
}
.search-suggest[hidden] { display: none; }

.search-suggest__option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-button);
  color: var(--text-primary);
  cursor: pointer;
}
/* Keyboard-active (aria-activedescendant) + mouse-hover share the highlight. */
.search-suggest__option.is-active,
.search-suggest__option:hover {
  background: var(--bg-tertiary);
}

.search-suggest__icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}
.search-suggest__option.is-active .search-suggest__icon { color: var(--accent-primary); }

.search-suggest__text {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  min-width: 0;
}
.search-suggest__label {
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-suggest__sublabel {
  font-family: var(--font-body);
  font-size: var(--fs-caption);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
