/* Crest components — every colour, radius, spacing and shadow reads a token from tokens.css. */
.cr-icon { display: inline-block; flex: none; vertical-align: middle; }

/* Interaction overlay: label-normal at the state opacity (strong / normal / light). */
.cr-int { position: relative; isolation: isolate; }
.cr-int::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: var(--label-normal); opacity: 0; pointer-events: none; transition: opacity .12s ease; z-index: 1; }
.cr-int-strong:hover::after { opacity: var(--state-strong-hover); }
.cr-int-strong:focus-visible::after { opacity: var(--state-strong-focus); }
.cr-int-strong:active::after { opacity: var(--state-strong-pressed); }
.cr-int-normal:hover::after { opacity: var(--state-normal-hover); }
.cr-int-normal:focus-visible::after { opacity: var(--state-normal-focus); }
.cr-int-normal:active::after { opacity: var(--state-normal-pressed); }
.cr-int-light:hover::after { opacity: var(--state-light-hover); }
.cr-int-light:focus-visible::after { opacity: var(--state-light-focus); }
.cr-int-light:active::after { opacity: var(--state-light-pressed); }
.cr-int:disabled::after, .is-disabled .cr-int::after { opacity: 0 !important; }
:where(.cr-btn, .cr-tbtn, .cr-ibtn, .cr-chip, .cr-tab, .cr-seg-item, .cr-cell, .cr-snackbar-action, .cr-card-save):focus-visible { outline: 2px solid var(--primary-normal); outline-offset: 2px; }

.cr-spinner { display: inline-block; border-radius: var(--radius-full); border: 2px solid currentColor; border-right-color: transparent; animation: cr-spin .8s linear infinite; }
@keyframes cr-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cr-spinner { animation-duration: 2.4s; } .cr-int::after { transition: none; } }

/* ---------- Button ---------- */
.cr-btn { display: inline-flex; align-items: center; justify-content: center; border: 0; margin: 0; cursor: pointer; white-space: nowrap; font-family: var(--font-sans); text-decoration: none; background: none; }
.cr-btn-full { display: flex; width: 100%; }
.cr-btn-large { height: 48px; padding: var(--space-12) var(--space-28); border-radius: var(--radius-12); gap: var(--space-6); }
.cr-btn-medium { height: 40px; padding: 9px var(--space-20); border-radius: var(--radius-10); gap: 5px; }
.cr-btn-small { height: 32px; padding: 7px 14px; border-radius: var(--radius-8); gap: var(--space-4); }
.cr-btn-icononly.cr-btn-large { width: 48px; padding: var(--space-12); }
.cr-btn-icononly.cr-btn-medium { width: 40px; padding: 10px; }
.cr-btn-icononly.cr-btn-small { width: 32px; padding: 7px; }
.cr-btn-solid.cr-btn-primary { background: var(--primary-normal); color: var(--static-white); }
.cr-btn-solid.cr-btn-assistive { background: var(--fill-normal); color: var(--label-neutral); }
.cr-btn-outlined { background: transparent; box-shadow: inset 0 0 0 1px var(--line-normal-neutral); }
.cr-btn-outlined.cr-btn-primary { color: var(--primary-normal); }
.cr-btn-outlined.cr-btn-assistive { color: var(--label-normal); }
.cr-btn-solid:disabled { background: var(--interaction-disable); color: var(--label-assistive); cursor: not-allowed; }
.cr-btn-outlined:disabled { color: var(--label-disable); cursor: not-allowed; }

/* ---------- TextButton ---------- */
.cr-tbtn { display: inline-flex; align-items: center; gap: var(--space-4); border: 0; margin: 0; padding: var(--space-4) 0; background: none; cursor: pointer; font-family: var(--font-sans); border-radius: var(--radius-6); }
.cr-tbtn::after { inset: 0 -7px; }
.cr-tbtn-primary { color: var(--primary-normal); }
.cr-tbtn-assistive { color: var(--label-alternative); }
.cr-tbtn:disabled { color: var(--label-disable); cursor: not-allowed; }

/* ---------- IconButton ---------- */
.cr-ibtn { display: inline-flex; align-items: center; justify-content: center; border: 0; margin: 0; padding: 0; cursor: pointer; background: none; color: var(--label-normal); border-radius: var(--radius-full); }
.cr-ibtn-normal { width: 24px; height: 24px; }
.cr-ibtn-normal::after { inset: -8px; }
.cr-ibtn-normal.cr-ibtn-small { width: 20px; height: 20px; }
.cr-ibtn-background { width: 32px; height: 32px; color: color-mix(in srgb, var(--static-black) 61%, transparent); }
.cr-ibtn-background::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: var(--static-white); opacity: var(--opacity-74); z-index: -1; box-shadow: var(--shadow-normal); }
.cr-ibtn-outlined, .cr-ibtn-solid { width: 40px; height: 40px; }
.cr-ibtn-outlined.cr-ibtn-small, .cr-ibtn-solid.cr-ibtn-small { width: 32px; height: 32px; }
.cr-ibtn-outlined { box-shadow: inset 0 0 0 1px var(--line-normal-neutral); }
.cr-ibtn-solid { background: var(--primary-normal); color: var(--static-white); }
.cr-ibtn:disabled { color: var(--label-disable); cursor: not-allowed; }
.cr-ibtn-solid:disabled { background: var(--interaction-disable); color: var(--label-assistive); }

/* ---------- Chip ---------- */
.cr-chip { display: inline-flex; align-items: center; gap: 3px; border: 0; margin: 0; cursor: pointer; font-family: var(--font-sans); color: var(--label-alternative); background: none; white-space: nowrap; }
.cr-chip-label { padding: 0 var(--space-2); }
.cr-chip-large { height: 40px; padding: 9px var(--space-12); border-radius: var(--radius-10); }
.cr-chip-medium { height: 36px; padding: 7px 11px; border-radius: var(--radius-10); }
.cr-chip-small { height: 32px; padding: var(--space-6) var(--space-8); border-radius: var(--radius-8); gap: var(--space-2); }
.cr-chip-xsmall { height: 24px; padding: var(--space-4) 7px; border-radius: var(--radius-6); gap: var(--space-2); }
.cr-chip-xsmall .cr-chip-label { padding: 0 1px; }
.cr-chip-solid { background: var(--fill-alternative); }
.cr-chip-solid.is-active { background: var(--label-strong); color: var(--inverse-label); }
.cr-chip-outlined { box-shadow: inset 0 0 0 1px var(--line-normal-neutral); }
.cr-chip-outlined.is-active { color: var(--primary-normal); background: color-mix(in srgb, var(--primary-normal) 5%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary-normal) 43%, transparent); }
.cr-chip:disabled { color: var(--label-disable); cursor: not-allowed; }
.cr-chip-solid:disabled.is-active { background: var(--interaction-disable); color: var(--label-assistive); }

/* ---------- ContentBadge ---------- */
.cr-badge { position: relative; isolation: isolate; display: inline-flex; align-items: center; gap: var(--space-4); white-space: nowrap; font-family: var(--font-sans); }
.cr-badge-xsmall { height: 20px; padding: 0 var(--space-6); border-radius: var(--radius-6); gap: var(--space-2); }
.cr-badge-small { height: 24px; padding: 0 var(--space-6); border-radius: var(--radius-6); gap: 3px; }
.cr-badge-medium { height: 28px; padding: 0 var(--space-8); border-radius: var(--radius-8); }
.cr-badge-neutral { color: var(--label-alternative); }
.cr-badge-neutral.cr-badge-solid { background: var(--fill-normal); }
.cr-badge-neutral.cr-badge-outlined { box-shadow: inset 0 0 0 1px var(--line-normal-neutral); }
.cr-badge-accent { color: var(--cr-accent); }
.cr-badge-accent.cr-badge-solid { background: color-mix(in srgb, var(--cr-accent) 8%, transparent); }
.cr-badge-accent.cr-badge-outlined { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cr-accent) 43%, transparent); }

/* ---------- Checkbox / Radio ---------- */
.cr-check { display: inline-flex; align-items: center; gap: var(--space-8); cursor: pointer; color: var(--label-normal); font-family: var(--font-sans); }
.cr-check.is-disabled { cursor: not-allowed; }
.cr-check.is-disabled .cr-check-control { opacity: var(--opacity-43); }
.cr-check.is-disabled .cr-check-label { color: var(--label-disable); }
.cr-check-control { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; flex: none; border-radius: var(--radius-full); }
.cr-check-control::after { inset: -4px; }
.cr-check-small .cr-check-control { width: 20px; height: 20px; }
.cr-check-control input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: inherit; z-index: 2; }
.cr-check-box { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: var(--radius-5); box-shadow: inset 0 0 0 1.5px var(--line-normal); color: var(--static-white); }
.cr-check-small .cr-check-box { width: 16px; height: 16px; }
.cr-check-box.is-checked, .cr-check-box.is-indeterminate { background: var(--primary-normal); box-shadow: inset 0 0 0 1.5px var(--primary-normal); }
.cr-check-control:has(input:focus-visible) { outline: 2px solid var(--primary-normal); outline-offset: 0; }
.cr-radio-box { width: 20px; height: 20px; border-radius: var(--radius-full); box-shadow: inset 0 0 0 1.5px var(--line-normal); display: inline-flex; align-items: center; justify-content: center; }
.cr-check-small .cr-radio-box { width: 16px; height: 16px; }
.cr-radio input:checked + .cr-radio-box { background: var(--primary-normal); box-shadow: inset 0 0 0 1.5px var(--primary-normal); }
.cr-radio input:checked + .cr-radio-box::after { content: ''; width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--static-white); }
.cr-check-small .cr-radio input:checked + .cr-radio-box::after, .cr-radio.cr-check-small input:checked + .cr-radio-box::after { width: 6px; height: 6px; }

/* ---------- Switch ---------- */
.cr-switch { position: relative; display: inline-flex; align-items: center; gap: var(--space-8); cursor: pointer; }
.cr-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; margin: 0; }
.cr-switch-track { display: inline-flex; align-items: center; width: 52px; height: 32px; padding: var(--space-4); border-radius: var(--radius-full); background: var(--fill-strong); transition: background .15s ease; box-sizing: border-box; }
.cr-switch-thumb { width: 24px; height: 24px; border-radius: var(--radius-full); background: var(--static-white); box-shadow: var(--shadow-knob); transition: transform .15s ease; position: relative; z-index: 2; }
.cr-switch-small .cr-switch-track { width: 39px; height: 24px; padding: 3px; }
.cr-switch-small .cr-switch-thumb { width: 18px; height: 18px; }
.cr-switch input:checked + .cr-switch-track { background: var(--primary-normal); }
.cr-switch input:checked + .cr-switch-track .cr-switch-thumb { transform: translateX(20px); }
.cr-switch-small input:checked + .cr-switch-track .cr-switch-thumb { transform: translateX(15px); }
.cr-switch input:focus-visible + .cr-switch-track { outline: 2px solid var(--primary-normal); outline-offset: 2px; }
.cr-switch.is-disabled { cursor: not-allowed; }
.cr-switch.is-disabled .cr-switch-track { opacity: var(--opacity-43); }

/* ---------- TextField / Select ---------- */
.cr-field { display: flex; flex-direction: column; gap: var(--space-8); font-family: var(--font-sans); min-width: 0; }
.cr-field-heading { color: var(--label-neutral); display: inline-flex; gap: var(--space-4); }
.cr-field-required { color: var(--status-negative); }
.cr-field-message { margin: 0; color: var(--label-alternative); }
.cr-field-negative .cr-field-message { color: var(--status-negative); }
.cr-field-positive .cr-field-message { color: var(--status-positive); }
.cr-input-box { position: relative; display: flex; align-items: center; gap: var(--space-8); min-height: 48px; padding: var(--space-12); border-radius: var(--radius-12); background: var(--background-normal); box-shadow: inset 0 0 0 1px var(--line-normal-neutral), var(--shadow-xsmall); box-sizing: border-box; transition: box-shadow .12s ease; }
.cr-input-box.is-multiline { align-items: flex-start; }
.cr-input-box:focus-within { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--primary-normal) 43%, transparent), var(--shadow-xsmall); }
.cr-field-negative .cr-input-box { box-shadow: inset 0 0 0 1px var(--status-negative), var(--shadow-xsmall); }
.cr-field-negative .cr-input-box:focus-within { box-shadow: inset 0 0 0 2px var(--status-negative), var(--shadow-xsmall); }
.cr-input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--label-normal); padding: 0 var(--space-4); margin: 0; font-family: var(--font-sans); resize: vertical; }
.cr-input::placeholder { color: var(--label-assistive); }
.cr-input-lead { color: var(--label-alternative); }
.cr-input-status { color: var(--status-negative); }
.cr-field-positive .cr-input-status { color: var(--status-positive); }
.cr-field.is-disabled .cr-input-box { background: var(--interaction-disable); box-shadow: inset 0 0 0 1px var(--line-normal-neutral); }
.cr-field.is-disabled .cr-input { color: var(--label-disable); cursor: not-allowed; }
.cr-select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: var(--space-24); }
.cr-select.is-placeholder { color: var(--label-assistive); }
.cr-select-chevron { position: absolute; right: var(--space-16); pointer-events: none; color: var(--label-alternative); }

/* ---------- Tabs ---------- */
.cr-tabs { display: flex; gap: var(--space-24); box-shadow: inset 0 -1px 0 var(--line-normal-alternative); font-family: var(--font-sans); overflow-x: auto; scrollbar-width: none; }
.cr-tabs-padded { padding: 0 var(--space-20); }
.cr-tab { flex: none; display: inline-flex; align-items: center; justify-content: center; border: 0; margin: 0; padding: 0; background: none; cursor: pointer; color: var(--label-assistive); white-space: nowrap; font-family: var(--font-sans); }
.cr-tab::after { inset: 4px -12px; border-radius: var(--radius-8); }
.cr-tabs-large .cr-tab { height: 56px; }
.cr-tabs-medium .cr-tab { height: 48px; }
.cr-tabs-small .cr-tab { height: 40px; }
.cr-tab.is-active { color: var(--label-strong); box-shadow: inset 0 -2px 0 var(--label-strong); }
.cr-tab:disabled { color: var(--label-disable); cursor: not-allowed; }
.cr-tabs-fill { gap: 0; }
.cr-tabs-fill .cr-tab { flex: 1; }

/* ---------- SegmentedControl ---------- */
.cr-seg { display: flex; font-family: var(--font-sans); }
.cr-seg-item { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-4); border: 0; margin: 0; background: none; cursor: pointer; color: var(--label-alternative); white-space: nowrap; font-family: var(--font-sans); }
.cr-seg-solid { background: var(--fill-normal); }
.cr-seg-solid.cr-seg-large { height: 48px; padding: 3px; border-radius: var(--radius-12); }
.cr-seg-solid.cr-seg-medium { height: 40px; padding: var(--space-2); border-radius: var(--radius-10); }
.cr-seg-solid.cr-seg-small { height: 32px; padding: var(--space-2); border-radius: var(--radius-8); }
.cr-seg-solid .cr-seg-item { border-radius: var(--radius-10); }
.cr-seg-solid.cr-seg-small .cr-seg-item { border-radius: var(--radius-6); }
.cr-seg-solid .cr-seg-item.is-active { background: var(--background-elevated); color: var(--label-normal); box-shadow: var(--shadow-knob); }
.cr-seg-outlined { gap: 0; }
.cr-seg-outlined .cr-seg-item { box-shadow: inset 0 0 0 1px var(--line-normal); }
.cr-seg-outlined.cr-seg-large .cr-seg-item { height: 48px; }
.cr-seg-outlined.cr-seg-medium .cr-seg-item { height: 40px; }
.cr-seg-outlined.cr-seg-small .cr-seg-item { height: 32px; }
.cr-seg-outlined .cr-seg-item:first-child { border-radius: var(--radius-12) 0 0 var(--radius-12); }
.cr-seg-outlined .cr-seg-item:last-child { border-radius: 0 var(--radius-12) var(--radius-12) 0; }
.cr-seg-outlined .cr-seg-item + .cr-seg-item { margin-left: -1px; }
.cr-seg-outlined .cr-seg-item.is-active { color: var(--primary-normal); z-index: 1; background: color-mix(in srgb, var(--primary-normal) 5%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary-normal) 43%, transparent); }
.cr-seg-item:disabled { color: var(--label-disable); cursor: not-allowed; }

/* ---------- Tooltip ---------- */
.cr-tip-anchor { position: relative; display: inline-flex; }
.cr-tip { position: absolute; z-index: 20; white-space: nowrap; color: var(--inverse-label); background: var(--inverse-background); border-radius: var(--radius-8); box-shadow: var(--shadow-emphasize); font-family: var(--font-sans); pointer-events: none; }
.cr-tip-medium { padding: var(--space-8) var(--space-12); }
.cr-tip-small { padding: var(--space-4) var(--space-8); border-radius: var(--radius-6); }
.cr-tip::before { content: ''; position: absolute; width: 10px; height: 10px; background: var(--inverse-background); transform: rotate(45deg); border-radius: var(--radius-3) 0 0 0; }
.cr-tip-bottom { top: calc(100% + var(--space-8)); left: 50%; transform: translateX(-50%); }
.cr-tip-bottom::before { top: -4px; left: calc(50% - 5px); }
.cr-tip-top { bottom: calc(100% + var(--space-8)); left: 50%; transform: translateX(-50%); }
.cr-tip-top::before { bottom: -4px; left: calc(50% - 5px); }
.cr-tip-left { right: calc(100% + var(--space-8)); top: 50%; transform: translateY(-50%); }
.cr-tip-left::before { right: -4px; top: calc(50% - 5px); }
.cr-tip-right { left: calc(100% + var(--space-8)); top: 50%; transform: translateY(-50%); }
.cr-tip-right::before { left: -4px; top: calc(50% - 5px); }

/* ---------- Toast / Snackbar ---------- */
.cr-toast { position: relative; isolation: isolate; display: flex; align-items: center; gap: var(--space-8); min-height: 54px; padding: 11px var(--space-16); border-radius: var(--radius-12); color: var(--static-white); font-family: var(--font-sans); box-sizing: border-box; overflow: hidden; -webkit-backdrop-filter: blur(32px); backdrop-filter: blur(32px); }
.cr-toast::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--cool-neutral-15); opacity: var(--opacity-88); }
[data-theme="dark"] .cr-toast::before { background: var(--cool-neutral-30); }
.cr-toast-msg { flex: 1; padding: 5px var(--space-2); }
.cr-toast-icon { position: relative; display: inline-flex; flex: none; }
.cr-toast-icon::before { content: ''; position: absolute; inset: 5.5px; border-radius: var(--radius-full); background: var(--static-white); }
.cr-toast-icon .cr-icon { position: relative; }
.cr-toast-normal .cr-toast-icon { color: var(--static-white); }
.cr-toast-normal .cr-toast-icon::before { display: none; }
.cr-toast-positive .cr-toast-icon { color: var(--green-60); }
.cr-toast-cautionary .cr-toast-icon { color: var(--orange-60); }
.cr-toast-negative .cr-toast-icon { color: var(--red-60); }
.cr-snackbar { gap: var(--space-12); }
.cr-snackbar-action { flex: none; border: 0; background: none; color: var(--blue-70); padding: var(--space-4) var(--space-2); cursor: pointer; font-family: var(--font-sans); border-radius: var(--radius-6); }
.cr-snackbar-action::after { background: var(--static-white); }

/* ---------- Alert ---------- */
.cr-dimmer { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 0 var(--space-20); background: var(--material-dimmer); }
.cr-dimmer.is-inline { position: relative; inset: auto; min-height: 100%; padding: var(--space-24) var(--space-20); }
.cr-alert { width: 100%; max-width: 335px; border-radius: var(--radius-12); background: var(--background-elevated); box-shadow: var(--shadow-heavy); font-family: var(--font-sans); overflow: hidden; }
.cr-alert-info { display: flex; flex-direction: column; gap: var(--space-6); padding: var(--space-20); }
.cr-alert-title { margin: 0; color: var(--label-normal); }
.cr-alert-desc { margin: 0; color: var(--label-alternative); }
.cr-alert-actions { display: flex; justify-content: flex-end; gap: var(--space-24); padding: 0 var(--space-20) var(--space-12); }
.cr-alert-action-normal { color: var(--primary-normal); }
.cr-alert-action-assistive { color: var(--label-alternative); }
.cr-alert-action-negative { color: var(--status-negative); }

/* ---------- Avatar ---------- */
.cr-avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; overflow: hidden; background: var(--fill-normal); color: var(--label-assistive); box-shadow: inset 0 0 0 1px var(--line-normal-alternative); font-family: var(--font-sans); }
.cr-avatar img { width: 100%; height: 100%; object-fit: cover; }
.cr-avatar-person { border-radius: var(--radius-full); }
.cr-avatar-xsmall:not(.cr-avatar-person) { border-radius: var(--radius-6); }
.cr-avatar-small:not(.cr-avatar-person) { border-radius: var(--radius-8); }
.cr-avatar-medium:not(.cr-avatar-person) { border-radius: var(--radius-10); }
.cr-avatar-large:not(.cr-avatar-person) { border-radius: var(--radius-12); }
.cr-avatar-xlarge:not(.cr-avatar-person) { border-radius: 14px; }
.cr-avatar-initials { font-weight: 600; color: var(--label-alternative); }

/* ---------- Card ---------- */
.cr-card { display: flex; flex-direction: column; gap: var(--space-8); width: 240px; font-family: var(--font-sans); }
.cr-card-thumb { position: relative; aspect-ratio: 3 / 2; border-radius: var(--radius-12); overflow: hidden; background: var(--fill-normal); }
.cr-card-thumb::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--line-normal-alternative); pointer-events: none; }
.cr-card-thumb img, .cr-card-thumb-ph { width: 100%; height: 100%; object-fit: cover; display: block; }
.cr-card-overlay { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: var(--space-4); padding: 14px; color: var(--static-white); background: linear-gradient(to top, rgba(0,0,0,.35), rgba(0,0,0,0)); }
.cr-card-overlay-caption { flex: 1; text-shadow: var(--shadow-normal); }
.cr-card-save { border: 0; background: none; padding: 0; color: var(--static-white); cursor: pointer; display: inline-flex; border-radius: var(--radius-6); }
.cr-card-body { display: flex; flex-direction: column; gap: var(--space-4); padding: 0 var(--space-6); }
.cr-card-title { margin: 0; color: var(--label-normal); }
.cr-card-caption { margin: 0; color: var(--label-alternative); }

/* ---------- ListCell ---------- */
.cr-cell { display: flex; align-items: center; gap: var(--space-8); width: 100%; min-height: 48px; padding: var(--space-12) 0; border: 0; margin: 0; background: none; text-align: left; color: var(--label-normal); font-family: var(--font-sans); box-sizing: border-box; }
button.cr-cell { cursor: pointer; }
.cr-cell::after { inset: 0 calc(var(--space-12) * -1); border-radius: var(--radius-12); }
.cr-cell-lead { color: var(--label-normal); }
.cr-cell-content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.cr-cell-caption { color: var(--label-alternative); }
.cr-cell-trail { color: var(--label-assistive); }
.cr-cell-check { color: var(--primary-normal); }
.cr-cell.is-selected .cr-cell-label { color: var(--primary-normal); }
.cr-cell.is-disabled, .cr-cell:disabled { color: var(--label-disable); cursor: not-allowed; }
.cr-cell.is-disabled .cr-cell-caption, .cr-cell.is-disabled .cr-cell-lead { color: var(--label-disable); }

/* ---------- Divider / Skeleton ---------- */
.cr-divider { border: 0; margin: 0; flex: none; }
.cr-divider-h { height: 1px; width: 100%; background: var(--line-normal); }
.cr-divider-thick { height: 12px; width: 100%; background: var(--line-normal-alternative); }
.cr-divider-v { width: 1px; align-self: stretch; min-height: 16px; background: var(--line-normal); }
.cr-skeleton { display: block; background: var(--fill-normal); animation: cr-pulse 1.4s ease-in-out infinite; }
.cr-skeleton-text { border-radius: var(--radius-3); }
.cr-skeleton-rect { border-radius: var(--radius-12); }
.cr-skeleton-circle { border-radius: var(--radius-full); }
@keyframes cr-pulse { 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .cr-skeleton { animation: none; } }

/* ---------- Menu ---------- */
.cr-menu { display: flex; flex-direction: column; width: 320px; max-width: 100%; box-sizing: border-box; border-radius: var(--radius-16); background: var(--background-elevated); box-shadow: inset 0 0 0 1px var(--line-solid-neutral), var(--shadow-small); font-family: var(--font-sans); overflow: hidden; }
.cr-menu-list { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-8) var(--space-20); max-height: 400px; overflow-y: auto; }
.cr-menu-item { display: flex; align-items: flex-start; gap: var(--space-8); width: 100%; border: 0; margin: 0; background: none; text-align: left; cursor: pointer; color: var(--label-normal); font-family: var(--font-sans); box-sizing: border-box; }
.cr-menu-item::after { inset: 0 calc(var(--space-12) * -1); border-radius: var(--radius-12); }
.cr-menu-8 .cr-menu-item { padding: var(--space-8) 0; min-height: 40px; }
.cr-menu-12 .cr-menu-item { padding: var(--space-12) 0; min-height: 48px; }
.cr-menu-item > .cr-check-box, .cr-menu-item > .cr-radio-box { margin: 3px; flex: none; }
.cr-menu-item > .cr-radio-box { margin: 2px; }
.cr-radio-box.is-on { background: var(--primary-normal); box-shadow: inset 0 0 0 1.5px var(--primary-normal); }
.cr-radio-box.is-on::after { content: ''; width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--static-white); }
.cr-menu-item.is-active[role="menuitem"] .cr-menu-label { color: var(--primary-normal); }
.cr-menu-item:disabled { color: var(--label-disable); cursor: not-allowed; }
.cr-menu-item:disabled .cr-cell-caption { color: var(--label-disable); }
.cr-menu-item:focus-visible { outline: 2px solid var(--primary-normal); outline-offset: 2px; border-radius: var(--radius-8); }
.cr-menu-footer { display: flex; align-items: center; justify-content: space-between; gap: var(--space-24); padding: var(--space-12); box-shadow: inset 0 1px 0 var(--line-solid-alternative); }

/* ---------- Popover ---------- */
.cr-popover { position: absolute; z-index: 30; width: 240px; box-sizing: border-box; border-radius: var(--radius-12); background: var(--background-elevated); box-shadow: inset 0 0 0 1px var(--line-normal-alternative), var(--shadow-spread-small); font-family: var(--font-sans); text-align: left; }
.cr-popover.is-inline { position: relative; }
.cr-popover-bottom:not(.is-inline) { top: calc(100% + var(--space-8)); left: 0; }
.cr-popover-top:not(.is-inline) { bottom: calc(100% + var(--space-8)); left: 0; }
.cr-popover-right:not(.is-inline) { left: calc(100% + var(--space-8)); top: 0; }
.cr-popover-left:not(.is-inline) { right: calc(100% + var(--space-8)); top: 0; }
.cr-popover-body { display: flex; flex-direction: column; gap: var(--space-6); padding: var(--space-12) 14px; }
.cr-popover-head { display: flex; align-items: flex-start; gap: var(--space-4); }
.cr-popover-title { flex: 1; color: var(--label-normal); }
.cr-popover-close { margin-top: 1px; color: var(--label-alternative); }
.cr-popover-close .cr-icon { width: 16px; height: 16px; }
.cr-popover-text { color: var(--label-neutral); }
.cr-popover-foot { display: flex; gap: var(--space-16); padding: var(--space-4) 14px var(--space-12); margin-top: calc(var(--space-12) * -1); padding-top: var(--space-4); }

/* ---------- ActionArea ---------- */
.cr-actions { display: flex; flex-direction: column; gap: var(--space-16); padding: var(--space-20); background: var(--background-elevated); font-family: var(--font-sans); box-sizing: border-box; }
.cr-actions-extra { color: var(--label-alternative); }
.cr-actions-row { display: flex; gap: var(--space-12); }
.cr-actions-strong .cr-actions-row { flex-direction: column-reverse; gap: var(--space-8); }
.cr-actions-strong .cr-btn, .cr-actions-neutral .cr-btn, .cr-actions-cancel .cr-btn { flex: 1; width: 100%; }
.cr-actions-strong .cr-btn { flex: none; }
.cr-actions-compact .cr-actions-row { justify-content: flex-end; }

/* ---------- BottomSheet ---------- */
.cr-sheet-dimmer { align-items: flex-end; padding: var(--space-40) 0 0; }
.cr-sheet-dimmer.is-inline { padding: var(--space-40) 0 0; }
.cr-sheet { width: 100%; max-width: 480px; max-height: 100%; display: flex; flex-direction: column; border-radius: var(--radius-12) var(--radius-12) 0 0; background: var(--background-elevated); font-family: var(--font-sans); overflow: hidden; }
.cr-sheet-handle { display: flex; align-items: center; justify-content: center; height: 12px; flex: none; }
.cr-sheet-handle span { width: 40px; height: 5px; border-radius: var(--radius-full); background: var(--fill-strong); }
.cr-sheet-title { margin: 0; padding: var(--space-12) var(--space-20) 0; color: var(--label-normal); }
.cr-sheet-body { padding: var(--space-20); overflow-y: auto; color: var(--label-normal); }
.cr-sheet .cr-actions { padding-top: var(--space-4); }

/* ---------- Pagination ---------- */
.cr-page { display: inline-flex; align-items: center; gap: var(--space-4); font-family: var(--font-sans); }
.cr-page-list { display: inline-flex; align-items: center; gap: var(--space-16); padding: 0 var(--space-16); }
.cr-page-num { min-width: 20px; height: 32px; padding: var(--space-4) 0; border: 0; margin: 0; background: none; cursor: pointer; color: var(--label-alternative); font-family: var(--font-sans); border-radius: var(--radius-6); }
.cr-page-num::after { inset: 0 -7px; }
.cr-page-num.is-active { color: var(--label-normal); }
.cr-page-gap { color: var(--label-assistive); min-width: 20px; text-align: center; }
.cr-page-arrow { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 0; margin: 0; padding: 0; background: none; cursor: pointer; color: var(--label-normal); border-radius: var(--radius-full); }
.cr-page-arrow::after { inset: -4px; }
.cr-page-arrow:disabled { color: var(--label-disable); cursor: not-allowed; }
.cr-page-arrow:focus-visible, .cr-page-num:focus-visible { outline: 2px solid var(--primary-normal); outline-offset: 2px; }
.cr-page-min { gap: var(--space-12); }
.cr-page-count { color: var(--label-neutral); }
.cr-dots { display: inline-flex; align-items: center; gap: 10px; }
.cr-dot { width: 10px; height: 10px; border-radius: var(--radius-full); background: var(--label-normal); opacity: var(--opacity-16); flex: none; }
.cr-dot.is-s1 { width: 8px; height: 8px; }
.cr-dot.is-s2 { width: 6px; height: 6px; }
.cr-dot.is-active { opacity: 1; }
.cr-dots-small { gap: var(--space-6); }
.cr-dots-small .cr-dot { width: 6px; height: 6px; }
.cr-dots-small .cr-dot.is-s1 { width: 4px; height: 4px; }
.cr-dots-small .cr-dot.is-s2 { width: 2px; height: 2px; }
.cr-dots-white .cr-dot { background: var(--static-white); opacity: var(--opacity-43); }
.cr-dots-white .cr-dot.is-active { opacity: 1; }
.cr-counter { display: inline-flex; align-items: center; gap: var(--space-4); height: 34px; padding: 0 var(--space-12); border-radius: var(--radius-full); background: color-mix(in srgb, var(--cool-neutral-30) 88%, transparent); color: var(--static-white); font-family: var(--font-sans); box-sizing: border-box; }
.cr-counter-small { height: 26px; padding: 0 10px; gap: 3px; }
.cr-counter-sep { opacity: var(--opacity-52); font-weight: 400; }

/* ---------- AvatarGroup ---------- */
.cr-avgroup { display: inline-flex; align-items: center; gap: var(--space-8); font-family: var(--font-sans); }
.cr-avgroup-stack { display: inline-flex; }
.cr-avgroup-stack .cr-avatar { box-shadow: 0 0 0 1.5px var(--background-normal); }
.cr-avgroup-stack .cr-avatar + .cr-avatar { margin-left: -8px; }
.cr-avgroup-xsmall .cr-avatar + .cr-avatar { margin-left: -6px; }
.cr-avgroup-more { color: var(--label-alternative); }

/* ---------- ListCard ---------- */
.cr-lcard { display: flex; align-items: center; gap: var(--space-16); font-family: var(--font-sans); min-width: 0; }
.cr-lcard-thumb { position: relative; flex: none; width: 120px; aspect-ratio: 3 / 2; border-radius: var(--radius-12); overflow: hidden; background: var(--fill-normal); }
.cr-lcard-thumb::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--line-normal-alternative); }
.cr-lcard-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cr-lcard-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.cr-lcard-trail { flex: none; color: var(--label-alternative); }

/* ---------- Category ---------- */
.cr-category { display: flex; gap: var(--space-6); overflow-x: auto; scrollbar-width: none; padding-top: 2px; padding-bottom: 2px; }
.cr-category .cr-chip { flex: none; }
.cr-chip-category { box-shadow: inset 0 0 0 1px var(--line-normal-neutral); }
.cr-chip-category.is-active { background: var(--label-strong); color: var(--inverse-label); box-shadow: none; }

/* ---------- SectionHeader ---------- */
.cr-sechead { display: flex; align-items: center; gap: var(--space-12); font-family: var(--font-sans); }
.cr-sechead-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--space-12); }
.cr-sechead-text { margin: 0; color: var(--label-strong); }
.cr-sechead-xsmall .cr-sechead-text { color: var(--label-alternative); }
.cr-sechead-trail { flex: none; display: flex; align-items: center; gap: var(--space-8); }

/* ---------- FilterButton ---------- */
.cr-fbtn { color: var(--label-normal); gap: var(--space-2); }
.cr-fbtn.cr-chip-large { padding: 9px 10px 9px var(--space-12); }
.cr-fbtn.cr-chip-medium { padding: 7px 9px 7px 11px; }
.cr-fbtn.cr-chip-small { padding: var(--space-6) var(--space-6) var(--space-6) var(--space-8); }
.cr-fbtn.cr-chip-xsmall { padding: var(--space-4) 5px var(--space-4) 7px; }
.cr-fbtn .cr-chip-label { display: inline-flex; gap: var(--space-4); }
.cr-fbtn-solid.is-active { background: var(--inverse-background); color: var(--inverse-label); }
.cr-fbtn:disabled { color: var(--label-disable); }

/* ---------- Circular ---------- */
.cr-circular { display: inline-flex; flex: none; }
.cr-circular svg { animation: cr-spin .9s linear infinite; }
.cr-circular-track { stroke: var(--line-solid); }
.cr-circular-arc { stroke: var(--primary-normal); }
@media (prefers-reduced-motion: reduce) { .cr-circular svg { animation-duration: 2.7s; } }

/* ---------- PushBadge ---------- */
.cr-push-anchor { position: relative; display: inline-flex; }
.cr-push { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; background: var(--primary-normal); color: var(--static-white); border-radius: var(--radius-full); font-family: var(--font-sans); }
.cr-push-dot { width: 4px; height: 4px; }
.cr-push-number, .cr-push-new { min-width: 20px; height: 20px; padding: 3px var(--space-6); }
.cr-push.is-floating { position: absolute; top: -6px; right: -8px; }
.cr-push-dot.is-floating { top: 0; right: -2px; }

/* ---------- CheckMark ---------- */
.cr-cmark { gap: var(--space-4); color: var(--label-alternative); }
.cr-cmark .cr-check-control { color: var(--label-assistive); }
.cr-cmark.is-checked .cr-check-control { color: var(--primary-normal); }
.cr-cmark.is-checked { color: var(--label-normal); }
.cr-cmark .cr-check-label { padding: 1px 0; }

/* ---------- Thumbnail ---------- */
.cr-thumb { position: relative; overflow: hidden; background: var(--fill-normal); }
.cr-thumb.has-radius { border-radius: var(--radius-12); }
.cr-thumb.has-border::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--line-normal-alternative); pointer-events: none; }
.cr-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- FramedStyle ---------- */
.cr-framed { display: block; width: 100%; box-sizing: border-box; padding: var(--space-4) var(--space-16); border: 0; margin: 0; text-align: left; border-radius: 14px; background: var(--background-normal); box-shadow: inset 0 0 0 1px var(--line-normal-neutral), var(--shadow-xsmall); font-family: var(--font-sans); color: var(--label-normal); }
button.cr-framed { cursor: pointer; }
.cr-framed.is-selected { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--primary-normal) 43%, transparent), var(--shadow-xsmall); }
.cr-framed.is-negative { box-shadow: inset 0 0 0 1px var(--status-negative), var(--shadow-xsmall); }
.cr-framed.is-negative.is-selected { box-shadow: inset 0 0 0 2px var(--status-negative), var(--shadow-xsmall); }
.cr-framed.is-disabled { background: var(--interaction-disable); color: var(--label-disable); cursor: not-allowed; }
.cr-framed:focus-visible { outline: 2px solid var(--primary-normal); outline-offset: 2px; }
.cr-framed.is-disabled .cr-cell, .cr-framed.is-disabled .cr-cell-caption { color: var(--label-disable); }
.cr-dimmer { box-sizing: border-box; }
