@import url("https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;600&family=Zilla+Slab:wght@600&display=swap");

/* Camel components — every value comes from a token. Prefix: cm- */

body { margin: 0; font-family: var(--font-sans); font-size: 1.0625rem; line-height: 1.8; background: var(--surface-page); color: var(--text-base-default); }
.cm-stage { padding: var(--space-6); display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; }
.cm-stage--col { flex-direction: column; align-items: stretch; }

/* Focus — one ring for everything */
.cm-focusable:focus-visible, .cm-btn:focus-visible, .cm-field__input:focus-visible, .cm-nav a:focus-visible, .cm-nav button:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-primary); outline-offset: var(--focus-ring-offset);
}

/* Button */
.cm-btn {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: var(--control-min-height); max-width: 100%; padding: 0 var(--space-6);
  border: 0; border-radius: var(--radius-md); cursor: pointer; text-decoration: none;
  font-family: var(--font-sans); font-size: 0.875rem; line-height: 1.4; font-weight: 600;
  white-space: nowrap; text-overflow: ellipsis;
  transition: transform var(--duration-fast) var(--easing-standard), box-shadow var(--duration-fast) var(--easing-standard), background-color var(--duration-fast) var(--easing-standard);
}
.cm-btn__label { overflow: hidden; text-overflow: ellipsis; }
.cm-btn__arrow { width: var(--icon-size-sm); height: var(--icon-size-sm); flex: none; transition: transform var(--duration-fast) var(--easing-standard); }
.cm-btn::after { content: ""; position: absolute; inset: 0; transform: translateX(-110%);
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.22) 50%, transparent 70%); pointer-events: none; }
.cm-btn:hover .cm-btn__arrow { transform: translateX(3px); }
.cm-btn--primary { background: var(--surface-primary-default); color: var(--static-white); }
.cm-btn--primary:hover { background: var(--surface-primary-hover); }
.cm-btn--primary:active { background: var(--surface-primary-pressed); }
.cm-btn--secondary { background: var(--surface-secondary-default); color: var(--static-white); }
.cm-btn--secondary:active { background: var(--surface-secondary-pressed); }
.cm-btn--primary:hover, .cm-btn--secondary:hover { transform: translateY(-2px); box-shadow: var(--shadow-interaction); }
.cm-btn--primary:hover::after, .cm-btn--secondary:hover::after { transform: translateX(110%); transition: transform var(--duration-slow) var(--easing-standard); }
.cm-btn--primary:active, .cm-btn--secondary:active { transform: scale(0.98); box-shadow: var(--shadow-pressed); }
.cm-btn--quiet, .cm-btn--ghost { background: transparent; padding: 0; }
.cm-btn--quiet { color: var(--text-secondary-default); }
.cm-btn--ghost { color: var(--text-base-neutral); }
.cm-btn--quiet::after, .cm-btn--ghost::after { display: none; }
/* Button: hover colors for secondary, quiet and ghost; disabled state for all variants */
.cm-btn--secondary:hover { background: var(--surface-secondary-hover); }
.cm-btn--quiet:hover { color: var(--text-secondary-hover); }
.cm-btn--quiet:active { color: var(--text-secondary-pressed); }
.cm-btn--ghost:hover { color: var(--text-base-default); }
.cm-btn:disabled, .cm-btn:disabled:hover, .cm-btn:disabled:active, .cm-btn[aria-disabled="true"], .cm-btn[aria-disabled="true"]:hover, .cm-btn[aria-disabled="true"]:active {
  background: var(--surface-disabled); color: var(--text-base-on-disabled); cursor: not-allowed; transform: none; box-shadow: none; }
.cm-btn--quiet:disabled, .cm-btn--ghost:disabled, .cm-btn--quiet[aria-disabled="true"], .cm-btn--ghost[aria-disabled="true"],
.cm-btn--quiet:disabled:hover, .cm-btn--ghost:disabled:hover { background: transparent; }
.cm-btn:disabled::after, .cm-btn[aria-disabled="true"]::after, .cm-btn:disabled:hover .cm-btn__arrow { display: none; transform: none; }

/* Tag */
.cm-tag { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3);
  border: var(--border-width) solid var(--border-light); border-radius: var(--radius-pill); background: var(--surface-page);
  color: var(--text-base-neutral); font-size: 0.875rem; line-height: 1.4; font-weight: 600; }
.cm-dot { width: 8px; height: 8px; border-radius: var(--radius-pill); background: var(--status-live); flex: none; }
.cm-dot--live { animation: cm-pulse var(--duration-loop) var(--easing-loop) infinite; }
@keyframes cm-pulse { 0%, 100% { box-shadow: 0 0 0 0 var(--status-live); } 50% { box-shadow: 0 0 0 4px transparent; } }

/* Text field */
.cm-field { display: grid; gap: var(--space-2); min-width: 0; }
.cm-field__label { font-size: 0.875rem; line-height: 1.4; font-weight: 600; color: var(--text-base-default); }
.cm-field__input { min-height: var(--control-min-height); box-sizing: border-box; padding: 0 var(--space-4);
  border: var(--border-width) solid var(--border-strong); border-radius: var(--radius-md); background: var(--surface-component);
  color: var(--text-base-default); font: inherit; font-size: 1rem; }
.cm-field__hint { font-size: 0.875rem; line-height: 1.6; color: var(--text-base-neutral); margin: 0; }
.cm-field__input::placeholder { color: var(--text-components-placeholder); opacity: 1; }
.cm-field__input:hover { border-color: var(--border-primary-hover); }
.cm-field__input:disabled { background: var(--surface-disabled); border-color: var(--surface-disabled); color: var(--text-base-on-disabled); cursor: not-allowed; }
.cm-field__input:disabled::placeholder { color: var(--text-base-on-disabled); }
.cm-field--error .cm-field__input { border-color: var(--border-error-default); border-width: var(--stroke-2); }
/* Group of related controls (radio group, checkbox group): use <fieldset class="cm-fieldset"><legend class="cm-field__label"> */
.cm-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: var(--space-2); }
.cm-fieldset > legend { padding: 0; margin-bottom: var(--space-2); }
.cm-field--error .cm-field__hint { color: var(--text-state-error); }

/* Banner */
.cm-banner { display: flex; flex-wrap: wrap; gap: var(--space-6); align-items: center; justify-content: space-between;
  padding: var(--space-8); border: var(--border-width) solid var(--border-secondary); border-radius: var(--radius-xl); background: var(--surface-secondary-tint); }
.cm-banner__title { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.375rem, 2.4vw, 1.875rem); line-height: 1.2; }
.cm-banner__text { margin: var(--space-2) 0 0; font-size: 1rem; line-height: 1.5rem; color: var(--text-base-neutral); max-width: 52ch; }

/* Navigation */
.cm-nav { position: sticky; top: 0; display: flex; align-items: center; gap: var(--space-6); padding: 0 var(--space-6); min-height: 72px;
  background: var(--surface-header); border-bottom: var(--border-width) solid var(--border-light); backdrop-filter: blur(8px); }
.cm-nav__brand { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; color: var(--text-primary-default); text-decoration: none; margin-right: auto; white-space: nowrap; }
.cm-nav__links { display: flex; gap: var(--space-1); list-style: none; margin: 0; padding: 0; }
.cm-nav__links a, .cm-nav__menu { display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--control-min-height); padding: 0 var(--space-3);
  border-radius: var(--radius-md); color: var(--text-base-default); text-decoration: none; font-size: 0.875rem; font-weight: 600; white-space: nowrap; background: none; border: 0; font-family: inherit; cursor: pointer; }
.cm-nav__links a:hover, .cm-nav__menu:hover { color: var(--text-secondary-default); }
.cm-nav__links a[aria-current="page"] { color: var(--text-primary-default); box-shadow: inset 0 -2px 0 var(--surface-primary-default); border-radius: 0; }
.cm-nav__tools { display: flex; gap: var(--space-2); }
.cm-nav__toggle { display: none; }
@media (max-width: 767px) {
  .cm-nav { flex-wrap: wrap; align-content: center; gap: 0 var(--space-4); padding: 0 var(--space-4); min-height: 56px; }
  .cm-nav__toggle { display: inline-flex; align-items: center; min-height: var(--control-min-height); padding: 0 var(--space-4); border: var(--border-width) solid var(--border-strong);
    border-radius: var(--radius-md); background: var(--surface-component); color: var(--text-base-default); font: inherit; font-size: 0.875rem; font-weight: 600; cursor: pointer; }
  .cm-nav__toggle:focus-visible { outline: var(--focus-ring-width) solid var(--focus-primary); outline-offset: var(--focus-ring-offset); }
  .cm-nav__links { display: none; flex: 0 0 100%; flex-direction: column; gap: 0; padding-bottom: var(--space-3); }
  .cm-nav[data-open] .cm-nav__links { display: flex; }
  .cm-nav__links a { width: 100%; }
  .cm-nav__tools { display: none; }
}
.cm-iconbtn { width: var(--control-min-height); height: var(--control-min-height); display: inline-grid; place-items: center; border: var(--border-width) solid var(--border-light);
  border-radius: var(--radius-md); background: var(--surface-page); color: var(--text-base-default); font: inherit; font-size: 0.875rem; font-weight: 600; cursor: pointer;
  transition: background-color var(--duration-fast) var(--easing-standard), border-color var(--duration-fast) var(--easing-standard); }
.cm-iconbtn:hover { background: var(--surface-tint); border-color: var(--border-strong); }
.cm-iconbtn:active { background: var(--surface-wash); }
.cm-iconbtn:focus-visible { outline: var(--focus-ring-width) solid var(--focus-primary); outline-offset: var(--focus-ring-offset); }
.cm-iconbtn:disabled { background: var(--surface-disabled); border-color: var(--surface-disabled); color: var(--text-base-on-disabled); cursor: not-allowed; }

/* Project feature */
.cm-project { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--space-12); align-items: center; padding: var(--space-6); }
.cm-project__gallery { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: var(--space-3); height: 300px; }
.cm-project__frame { border-radius: var(--radius-lg); background: var(--surface-wash); border: var(--border-width) solid var(--border-light); }
.cm-project__frame:first-child { grid-row: span 2; }
.cm-project__num { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; color: var(--text-primary-default); }
.cm-project__meta { margin: 0; font-size: 0.875rem; font-weight: 600; color: var(--text-secondary-default); }
.cm-project__title { margin: var(--space-2) 0; font-family: var(--font-display); font-weight: 600; font-size: 1.875rem; line-height: 1.2; }
.cm-project__desc { margin: 0 0 var(--space-4); color: var(--text-base-neutral); }
.cm-project__tags { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-6); }

/* Participation panel */
.cm-panel { display: grid; gap: var(--space-3); padding: var(--space-6); border: var(--border-width) solid var(--border-light); border-radius: var(--radius-xl); background: var(--surface-tint); min-width: 260px; flex: 1; }
.cm-badge { display: inline-flex; align-items: center; gap: var(--space-2); width: max-content; padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill); background: var(--surface-component); border: var(--border-width) solid var(--border-light); font-size: 0.875rem; font-weight: 600; line-height: 1.4; }
.cm-badge--live { color: var(--text-secondary-default); }
.cm-badge--soon { color: var(--text-primary-default); }
.cm-badge--soon .cm-dot { background: var(--text-primary-default); }
.cm-badge--closed { color: var(--text-base-neutral); }
.cm-badge--closed .cm-dot { background: var(--border-strong); }
.cm-panel__dates { margin: 0; font-size: 0.875rem; line-height: 1.6; color: var(--text-base-neutral); }
.cm-progress { height: 8px; border-radius: var(--radius-pill); background: var(--surface-wash); overflow: hidden; }
.cm-progress__bar { height: 100%; border-radius: var(--radius-pill); background: var(--surface-secondary-default); }
.cm-panel__count { margin: 0; font-size: 0.875rem; font-weight: 600; }

/* Survey hero card */
.cm-hero-card { position: relative; width: 320px; padding: var(--space-6); border-radius: var(--radius-xl); background: var(--surface-primary-default); color: var(--static-white);
  transform: rotate(-3deg); display: grid; gap: var(--space-4); }
.cm-hero-card__top { display: flex; justify-content: space-between; align-items: center; }
.cm-hero-card__mark { display: inline-grid; place-items: center; width: var(--control-min-height); height: var(--control-min-height); border-radius: var(--radius-md);
  border: var(--border-width) solid var(--static-white); font-weight: 600; font-size: 0.875rem; }
.cm-hero-card .cm-badge { background: var(--surface-primary-pressed); border-color: transparent; color: var(--static-white); }
.cm-hero-card .cm-dot { background: var(--static-white); }
.cm-hero-card__wave { display: flex; align-items: center; gap: var(--space-1); height: 48px; }
.cm-hero-card__wave span { width: 4px; border-radius: var(--radius-pill); background: var(--static-white); opacity: 0.7; }
.cm-hero-card__quote { margin: 0; font-size: 1rem; line-height: 1.5; }
.cm-hero-card__place { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 2.25rem; line-height: 1; }

/* Dialog */
.cm-dialog { position: static; display: grid; gap: var(--space-4); max-width: 420px; margin: 0; padding: var(--space-8); border: var(--border-width) solid var(--border-light);
  border-radius: var(--radius-xl); background: var(--surface-component); color: var(--text-base-default); box-shadow: var(--shadow-large); }
.cm-dialog__title { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 1.875rem; line-height: 1.2; }
.cm-dialog__text { margin: 0; font-size: 1rem; line-height: 1.5; color: var(--text-base-neutral); }
.cm-dialog__actions { display: flex; justify-content: flex-end; gap: var(--space-4); }

/* Checkbox and radio: the native input stays in the tab order, the box is drawn beside it */
.cm-check, .cm-radio { position: relative; display: inline-flex; align-items: center; gap: var(--space-3); min-height: var(--control-min-height); cursor: pointer; }
.cm-check__input, .cm-radio__input { position: absolute; opacity: 0; width: var(--hit-target-floor); height: var(--hit-target-floor); margin: 0; cursor: pointer; }
.cm-check__box, .cm-radio__box { flex: none; display: inline-grid; place-items: center; width: var(--hit-target-floor); height: var(--hit-target-floor); box-sizing: border-box;
  border: var(--stroke-2) solid var(--border-strong); background: var(--surface-component); color: var(--static-white); transition: background-color var(--duration-fast) var(--easing-standard), border-color var(--duration-fast) var(--easing-standard); }
.cm-check__box { border-radius: var(--radius-sm); }
.cm-radio__box { border-radius: var(--radius-pill); }
.cm-check__mark { width: var(--icon-size-sm); height: var(--icon-size-sm); opacity: 0; }
.cm-check__dash { display: none; width: 0.75rem; height: var(--stroke-2); background: currentColor; border-radius: var(--radius-xs); }
.cm-radio__dot { width: 0.625rem; height: 0.625rem; border-radius: var(--radius-pill); background: var(--static-white); opacity: 0; }
.cm-check__label, .cm-radio__label { font-size: 1rem; line-height: 1.5; color: var(--text-base-default); }
.cm-check:hover .cm-check__box, .cm-radio:hover .cm-radio__box { border-color: var(--border-primary-hover); }
.cm-check__input:checked + .cm-check__box, .cm-check__input:indeterminate + .cm-check__box, .cm-radio__input:checked + .cm-radio__box { background: var(--surface-primary-default); border-color: var(--surface-primary-default); }
.cm-check__input:checked + .cm-check__box .cm-check__mark { opacity: 1; }
.cm-check__input:indeterminate + .cm-check__box .cm-check__mark { display: none; }
.cm-check__input:indeterminate + .cm-check__box .cm-check__dash { display: block; }
.cm-radio__input:checked + .cm-radio__box .cm-radio__dot { opacity: 1; }
.cm-check__input:focus-visible + .cm-check__box, .cm-radio__input:focus-visible + .cm-radio__box { outline: var(--focus-ring-width) solid var(--focus-primary); outline-offset: var(--focus-ring-offset); }
.cm-check__input:disabled, .cm-radio__input:disabled { cursor: not-allowed; }
.cm-check__input:disabled + .cm-check__box, .cm-radio__input:disabled + .cm-radio__box { background: var(--surface-disabled); border-color: var(--surface-disabled); color: var(--text-base-on-disabled); }
.cm-check__input:disabled ~ .cm-check__label, .cm-radio__input:disabled ~ .cm-radio__label { color: var(--text-base-on-disabled); }
.cm-check--error .cm-check__box { border-color: var(--border-error-default); }

/* Select: native control, custom chevron */
.cm-select { position: relative; }
.cm-select__control { width: 100%; min-height: var(--control-min-height); box-sizing: border-box; appearance: none; padding: 0 var(--space-11) 0 var(--space-4);
  border: var(--border-width) solid var(--border-strong); border-radius: var(--radius-md); background: var(--surface-component); color: var(--text-base-default); font: inherit; font-size: 1rem; cursor: pointer; }
.cm-select__control:hover { border-color: var(--border-primary-hover); }
.cm-select__control:focus-visible { outline: var(--focus-ring-width) solid var(--focus-primary); outline-offset: var(--focus-ring-offset); }
.cm-select__control:disabled { background: var(--surface-disabled); border-color: var(--surface-disabled); color: var(--text-base-on-disabled); cursor: not-allowed; }
.cm-select__chevron { position: absolute; right: var(--space-4); top: 50%; width: var(--icon-size-sm); height: var(--icon-size-sm); transform: translateY(-50%); pointer-events: none; color: var(--icon-neutral); }
.cm-select--error .cm-select__control { border-color: var(--border-error-default); border-width: var(--stroke-2); }

/* Chip: a filter you can switch on, optionally removable */
.cm-chip { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--control-min-height); box-sizing: border-box; padding: 0 var(--space-4);
  border: var(--border-width) solid var(--border-strong); border-radius: var(--radius-pill); background: var(--surface-component); color: var(--text-base-default);
  font: inherit; font-size: 0.875rem; font-weight: 600; line-height: 1.4; cursor: pointer; transition: background-color var(--duration-fast) var(--easing-standard), border-color var(--duration-fast) var(--easing-standard); }
.cm-chip:hover { border-color: var(--border-primary-hover); }
.cm-chip:focus-visible { outline: var(--focus-ring-width) solid var(--focus-primary); outline-offset: var(--focus-ring-offset); }
.cm-chip[aria-pressed="true"] { background: var(--surface-tint); border-color: var(--border-primary-default); color: var(--text-primary-default); }
.cm-chip__icon { width: var(--icon-size-sm); height: var(--icon-size-sm); flex: none; }
.cm-chip:disabled { background: var(--surface-disabled); border-color: var(--surface-disabled); color: var(--text-base-on-disabled); cursor: not-allowed; }

/* Tabs */
.cm-tabs { display: flex; gap: var(--space-2); border-bottom: var(--border-width) solid var(--border-light); overflow-x: auto; scrollbar-width: thin; }
.cm-tab { min-height: var(--control-min-height); padding: 0 var(--space-4); border: 0; background: none; color: var(--text-base-neutral);
  font: inherit; font-size: 0.875rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.cm-tab:hover { color: var(--text-primary-hover); }
.cm-tab:focus-visible { outline: var(--focus-ring-width) solid var(--focus-primary); outline-offset: calc(var(--focus-ring-offset) * -1); }
.cm-tab[aria-selected="true"] { color: var(--text-primary-default); box-shadow: inset 0 calc(var(--stroke-2) * -1) 0 var(--surface-primary-default); }
.cm-tab:disabled { color: var(--text-base-on-disabled); opacity: 0.6; cursor: not-allowed; }

/* Navigable card: a whole-card link with icon, title, meta and chevron */
.cm-navcard { display: flex; align-items: center; gap: var(--space-4); min-height: var(--control-min-height); padding: var(--space-4); box-sizing: border-box;
  border: var(--border-width) solid var(--border-light); border-radius: var(--radius-lg); background: var(--surface-component); color: var(--text-base-default);
  text-decoration: none; transition: border-color var(--duration-fast) var(--easing-standard), box-shadow var(--duration-fast) var(--easing-standard); }
.cm-navcard:hover { border-color: var(--border-primary-default); box-shadow: var(--shadow-interaction); }
.cm-navcard:active { box-shadow: var(--shadow-pressed); }
.cm-navcard:focus-visible { outline: var(--focus-ring-width) solid var(--focus-primary); outline-offset: var(--focus-ring-offset); }
.cm-navcard__icon { flex: none; display: grid; place-items: center; width: var(--control-min-height); height: var(--control-min-height); border-radius: var(--radius-md); background: var(--surface-tint); color: var(--icon-primary-default); }
.cm-navcard__icon svg { width: var(--icon-size-lg); height: var(--icon-size-lg); }
.cm-navcard__body { flex: 1; min-width: 0; display: grid; }
.cm-navcard__title { font-size: 1rem; font-weight: 600; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-navcard__meta { font-size: 0.875rem; line-height: 1.4; color: var(--text-base-neutral); }
.cm-navcard__chevron { flex: none; width: var(--icon-size-sm); height: var(--icon-size-sm); color: var(--icon-neutral); }

/* ---- Core components added for the docs: Link, Switch, Textarea, Alert, Card, Accordion, Breadcrumb, generic Badge statuses, modal Dialog ---- */

/* Link: text link inside prose. Underlined so it never relies on color alone. */
.cm-link { color: var(--text-secondary-default); text-decoration: underline; text-decoration-thickness: var(--border-width); text-underline-offset: 3px;
  transition: color var(--duration-fast) var(--easing-standard); }
.cm-link:hover { color: var(--text-secondary-hover); }
.cm-link:active { color: var(--text-secondary-pressed); }
.cm-link:focus-visible { outline: var(--focus-ring-width) solid var(--focus-primary); outline-offset: var(--focus-ring-offset); border-radius: var(--radius-xs); }
.cm-link[aria-disabled="true"] { color: var(--text-base-on-disabled); text-decoration: none; cursor: not-allowed; }
.cm-link__icon { display: inline-block; width: var(--icon-size-sm); height: var(--icon-size-sm); vertical-align: -0.2em; margin-left: var(--space-1); }

/* Switch: turns a setting on or off immediately. Native checkbox with role="switch". */
.cm-switch { position: relative; display: inline-flex; align-items: center; gap: var(--space-3); min-height: var(--control-min-height); cursor: pointer; }
.cm-switch__input { position: absolute; opacity: 0; width: 2.75rem; height: var(--hit-target-floor); margin: 0; cursor: pointer; }
.cm-switch__track { flex: none; box-sizing: border-box; width: 2.75rem; height: var(--hit-target-floor); display: inline-flex; align-items: center; padding: 0 var(--space-0-5);
  border: var(--stroke-2) solid var(--border-strong); border-radius: var(--radius-pill); background: var(--surface-component);
  transition: background-color var(--duration-fast) var(--easing-standard), border-color var(--duration-fast) var(--easing-standard); }
.cm-switch__thumb { width: var(--space-4); height: var(--space-4); border-radius: var(--radius-pill); background: var(--border-strong);
  transition: transform var(--duration-fast) var(--easing-standard), background-color var(--duration-fast) var(--easing-standard); }
.cm-switch__label { font-size: 1rem; line-height: 1.5; color: var(--text-base-default); }
.cm-switch:hover .cm-switch__track { border-color: var(--border-primary-hover); }
.cm-switch__input:checked + .cm-switch__track { background: var(--surface-primary-default); border-color: var(--surface-primary-default); }
.cm-switch__input:checked + .cm-switch__track .cm-switch__thumb { background: var(--static-white); transform: translateX(var(--space-5)); }
.cm-switch__input:focus-visible + .cm-switch__track { outline: var(--focus-ring-width) solid var(--focus-primary); outline-offset: var(--focus-ring-offset); }
.cm-switch__input:disabled { cursor: not-allowed; }
.cm-switch__input:disabled + .cm-switch__track { background: var(--surface-disabled); border-color: var(--surface-disabled); }
.cm-switch__input:disabled + .cm-switch__track .cm-switch__thumb { background: var(--text-base-on-disabled); }
.cm-switch__input:disabled ~ .cm-switch__label { color: var(--text-base-on-disabled); }

/* Textarea: the text field, taller, with an optional counter */
textarea.cm-field__input { min-height: calc(var(--control-min-height) * 2.5); padding: var(--space-3) var(--space-4); resize: vertical; line-height: 1.5; }
.cm-field__meta { display: flex; justify-content: space-between; gap: var(--space-4); align-items: flex-start; }
.cm-field__count { flex: none; font-size: 0.875rem; line-height: 1.6; color: var(--text-base-neutral); margin: 0; font-variant-numeric: tabular-nums; }

/* Alert: a status message that stays in the page flow */
.cm-alert { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-4); border: var(--border-width) solid var(--border-light);
  border-radius: var(--radius-md); background: var(--surface-component); color: var(--text-base-default); }
.cm-alert__icon { flex: none; width: var(--icon-size-md); height: var(--icon-size-md); margin-top: var(--space-0-5); }
.cm-alert__body { flex: 1; min-width: 0; display: grid; gap: var(--space-1); }
.cm-alert__title { margin: 0; font-size: 1rem; font-weight: 600; line-height: 1.4; }
.cm-alert__text { margin: 0; font-size: 0.875rem; line-height: 1.6; }
.cm-alert--error { background: var(--surface-error-invert); border-color: var(--border-error-default); }
.cm-alert--error .cm-alert__icon { color: var(--icon-error); }
.cm-alert--success { background: var(--surface-success-invert); border-color: var(--border-success); }
.cm-alert--success .cm-alert__icon { color: var(--icon-success); }
.cm-alert--warning { background: var(--surface-warning-invert); border-color: var(--border-warning); }
.cm-alert--warning .cm-alert__icon { color: var(--icon-warning); }
.cm-alert--info { background: var(--surface-information-invert); border-color: var(--border-information); }
.cm-alert--info .cm-alert__icon { color: var(--icon-information); }

/* Card: a plain container for related content. Not a link: use Nav card for that. */
.cm-card { display: grid; gap: var(--space-4); align-content: start; padding: var(--space-6); border: var(--border-width) solid var(--border-light);
  border-radius: var(--radius-lg); background: var(--surface-component); color: var(--text-base-default); }
.cm-card--tint { background: var(--surface-tint); }
.cm-card__media { aspect-ratio: 16 / 9; border-radius: var(--radius-md); background: var(--surface-wash); overflow: hidden; }
.cm-card__title { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; line-height: 1.3; }
.cm-card__text { margin: 0; font-size: 1rem; line-height: 1.6; color: var(--text-base-neutral); }
.cm-card__actions { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; }

/* Accordion: native details/summary, one item each */
.cm-accordion { border-top: var(--border-width) solid var(--border-light); }
.cm-accordion__item { border-bottom: var(--border-width) solid var(--border-light); }
.cm-accordion__summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: var(--control-min-height);
  padding: var(--space-2) 0; cursor: pointer; font-size: 1rem; font-weight: 600; line-height: 1.4; color: var(--text-base-default); }
.cm-accordion__summary::-webkit-details-marker { display: none; }
.cm-accordion__summary::after { content: ""; flex: none; width: var(--space-2); height: var(--space-2); border-right: var(--stroke-2) solid currentColor; border-bottom: var(--stroke-2) solid currentColor;
  transform: rotate(45deg); transition: transform var(--duration-fast) var(--easing-standard); }
.cm-accordion__item[open] > .cm-accordion__summary::after { transform: rotate(-135deg); }
.cm-accordion__summary:hover { color: var(--text-primary-hover); }
.cm-accordion__summary:focus-visible { outline: var(--focus-ring-width) solid var(--focus-primary); outline-offset: var(--focus-ring-offset); border-radius: var(--radius-xs); }
.cm-accordion__panel { padding: 0 0 var(--space-4); font-size: 1rem; line-height: 1.6; color: var(--text-base-neutral); }
.cm-accordion__panel > :first-child { margin-top: 0; }
.cm-accordion__panel > :last-child { margin-bottom: 0; }

/* Breadcrumb: where you are in the site, as a list of links */
.cm-breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-2); list-style: none; margin: 0; padding: 0; }
.cm-breadcrumb li { display: inline-flex; align-items: center; min-height: var(--control-min-height); font-size: 0.875rem; line-height: 1.4; }
.cm-breadcrumb li + li::before { content: "/"; margin-right: var(--space-2); color: var(--text-base-neutral); }
.cm-breadcrumb a { color: var(--text-secondary-default); text-decoration: underline; text-decoration-thickness: var(--border-width); text-underline-offset: 3px; }
.cm-breadcrumb a:hover { color: var(--text-secondary-hover); }
.cm-breadcrumb a:focus-visible { outline: var(--focus-ring-width) solid var(--focus-primary); outline-offset: var(--focus-ring-offset); border-radius: var(--radius-xs); }
.cm-breadcrumb [aria-current="page"] { font-weight: 600; color: var(--text-base-default); }

/* Badge: generic statuses (the live, soon and closed variants above stay for dot statuses) */
.cm-badge--success { background: var(--surface-success-invert); border-color: var(--border-success); color: var(--text-base-default); }
.cm-badge--warning { background: var(--surface-warning-invert); border-color: var(--border-warning); color: var(--text-base-default); }
.cm-badge--error { background: var(--surface-error-invert); border-color: var(--border-error-default); color: var(--text-base-default); }
.cm-badge--info { background: var(--surface-information-invert); border-color: var(--border-information); color: var(--text-base-default); }
.cm-badge--success .cm-dot { background: var(--icon-success); }
.cm-badge--warning .cm-dot { background: var(--icon-warning); }
.cm-badge--error .cm-dot { background: var(--icon-error); }
.cm-badge--info .cm-dot { background: var(--icon-information); }

/* Dialog: modal use. Put the class cm-dialog--modal on a native <dialog> and open it with showModal(). */
.cm-dialog { position: relative; }
.cm-dialog__close { position: absolute; top: var(--space-3); right: var(--space-3); }
.cm-dialog--modal { position: fixed; inset: 0; margin: auto; width: calc(100% - var(--space-8)); max-height: calc(100dvh - var(--space-8)); overflow: auto; }
.cm-dialog--modal:not([open]) { display: none; }
@media (max-width: 767px) { .cm-dialog__actions { flex-direction: column-reverse; align-items: stretch; } .cm-dialog__actions .cm-btn { justify-content: center; } }
.cm-dialog--modal::backdrop { background: color-mix(in srgb, var(--black-900) 60%, transparent); }

@media (prefers-reduced-motion: reduce) {
  .cm-check__box, .cm-radio__box, .cm-chip, .cm-navcard, .cm-iconbtn, .cm-switch__track, .cm-switch__thumb, .cm-link, .cm-accordion__summary::after { transition: none; }
  .cm-btn, .cm-btn__arrow { transition: background-color var(--duration-fast) var(--easing-linear), color var(--duration-fast) var(--easing-linear); }
  .cm-btn:hover, .cm-btn:active { transform: none; }
  .cm-btn::after { display: none; }
  .cm-btn:hover .cm-btn__arrow { transform: none; }
  .cm-dot--live { animation: none; }
}
