/* Components. One block per component in templates/components/, named
 * c-<component>, c-<component>__<part>, c-<component>--<variant>.
 * Every value is a token; a missing one is added to tokens.css, never here. */

/* ============================== Icon ============================== */

.c-icon {
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: var(--stroke-icon);
  vertical-align: middle;
}

.c-icon--md {
  inline-size: var(--size-icon-md);
  block-size: var(--size-icon-md);
}

.c-icon--sm {
  inline-size: var(--size-icon-sm);
  block-size: var(--size-icon-sm);
}

/* ============================== Button ============================== */

.c-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  min-block-size: var(--control-height);
  padding: var(--space-0) var(--space-16);
  border: var(--border-width) solid transparent;
  border-radius: var(--radius-md);
  font-size: var(--font-14);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--motion-fast) var(--motion-easing),
    border-color var(--motion-fast) var(--motion-easing);
}

.c-button:disabled {
  cursor: not-allowed;
  opacity: var(--opacity-disabled);
}

.c-button--primary {
  background: var(--surface-accent);
  color: var(--text-on-accent);
}

.c-button--primary:hover:not(:disabled) {
  background: var(--surface-accent-hover);
}

.c-button--primary:active:not(:disabled) {
  background: var(--surface-accent-pressed);
}

.c-button--secondary {
  background: var(--surface-card);
  border-color: var(--border-control);
  color: var(--text-primary);
}

.c-button--secondary:hover:not(:disabled),
.c-button--ghost:hover:not(:disabled) {
  background: var(--surface-hover);
}

.c-button--secondary:active:not(:disabled),
.c-button--ghost:active:not(:disabled) {
  background: var(--surface-pressed);
}

.c-button--ghost {
  background: transparent;
  color: var(--text-link);
}

.c-button--danger {
  background: var(--surface-danger);
  color: var(--text-on-accent);
}

.c-button--danger:hover:not(:disabled) {
  background: var(--surface-danger-hover);
}

.c-button--lg {
  inline-size: var(--full);
  padding-block: var(--space-48);
  font-size: var(--font-28);
  font-weight: var(--weight-bold);
}

.c-button--sm {
  min-block-size: var(--control-height-sm);
  padding: var(--space-0) var(--space-10);
  font-size: var(--font-13);
}

/* ============================== IconButton ============================== */

.c-icon-button {
  display: inline-grid;
  place-items: center;
  inline-size: var(--control-height);
  block-size: var(--control-height);
  padding: var(--space-0);
  border: var(--border-width) solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--icon-default);
  cursor: pointer;
  transition: background-color var(--motion-fast) var(--motion-easing);
}

.c-icon-button:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.c-icon-button--secondary {
  background: var(--surface-card);
  border-color: var(--border-control);
}

.c-icon-button--danger {
  color: var(--icon-danger);
}

.c-icon-button:disabled {
  cursor: not-allowed;
  opacity: var(--opacity-disabled);
}

/* ============================== Forms ============================== */

.c-form {
  display: contents;
}

.c-field {
  display: grid;
  gap: var(--space-6);
  align-content: start;
}

.c-field__label {
  font-size: var(--font-13);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
}

.c-field__required,
.c-field__error {
  color: var(--text-danger);
}

.c-field__hint,
.c-field__error {
  font-size: var(--font-12);
  line-height: var(--leading-tight);
}

.c-field__hint {
  color: var(--text-muted);
}

.c-text-input,
.c-select,
.c-textarea {
  inline-size: var(--full);
  min-block-size: var(--input-height);
  padding: var(--space-0) var(--space-12);
  border: var(--border-width) solid var(--border-control);
  border-radius: var(--radius-md);
  background: var(--surface-input);
  color: var(--text-primary);
  font-size: var(--font-15);
  line-height: var(--leading-tight);
}

.c-textarea {
  padding-block: var(--space-10);
  line-height: var(--leading-normal);
  resize: vertical;
}

.c-text-input:disabled,
.c-select:disabled,
.c-textarea:disabled {
  background: var(--surface-subtle);
  color: var(--text-disabled);
}

.c-text-input::placeholder,
.c-textarea::placeholder {
  color: var(--text-muted);
}

.c-text-input:focus,
.c-select:focus,
.c-textarea:focus {
  border-color: var(--border-focus);
  outline: var(--border-width) solid var(--border-focus);
  outline-offset: var(--space-0);
}

.c-text-input[aria-invalid="true"],
.c-field--error .c-text-input {
  border-color: var(--text-danger);
}

.c-number-input {
  font-variant-numeric: tabular-nums;
}

.c-phone-input {
  font-family: var(--font-mono);
}

.c-select {
  padding-inline-end: var(--space-32);
}

.c-city-select,
.c-type-select {
  min-inline-size: var(--space-0);
}

.c-money-input,
.c-size-input {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.c-money-input__prefix,
.c-money-input__reading {
  font-size: var(--font-13);
  color: var(--text-muted);
  white-space: nowrap;
}

.c-money-input__input {
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--tracking-amount);
}

.c-size-input__value {
  flex: 1;
}

.c-size-input__unit {
  flex: none;
  inline-size: auto;
}

.c-checkbox,
.c-radio-group__option,
.c-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-10);
  min-block-size: var(--control-height);
  cursor: pointer;
}

.c-checkbox__input,
.c-radio-group__input {
  inline-size: var(--check-size);
  block-size: var(--check-size);
  margin: var(--space-0);
  accent-color: var(--surface-accent);
}

.c-radio-group {
  display: grid;
  gap: var(--space-2);
}

.c-radio-group__legend {
  margin-block-end: var(--space-4);
  font-size: var(--font-13);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
}

.c-toggle__input {
  position: absolute;
  opacity: var(--opacity-hidden);
}

.c-toggle__track {
  position: relative;
  flex: none;
  inline-size: var(--toggle-width);
  block-size: var(--toggle-height);
  border-radius: var(--radius-full);
  background: var(--border-control);
  transition: background-color var(--motion-fast) var(--motion-easing);
}

.c-toggle__knob {
  position: absolute;
  inset-block-start: var(--space-2);
  inset-inline-start: var(--space-2);
  inline-size: var(--toggle-knob);
  block-size: var(--toggle-knob);
  border-radius: var(--radius-full);
  background: var(--surface-card);
  transition: translate var(--motion-fast) var(--motion-easing);
}

.c-toggle__input:checked + .c-toggle__track {
  background: var(--surface-accent);
}

.c-toggle__input:checked + .c-toggle__track .c-toggle__knob {
  translate: var(--space-16) var(--space-0);
}

.c-toggle__input:focus-visible + .c-toggle__track {
  outline: var(--focus-ring-width) solid var(--border-focus);
  outline-offset: var(--focus-ring-offset);
}

.c-place-picker {
  position: relative;
}

.c-place-picker__options,
.c-global-search__results {
  position: absolute;
  inset-inline: var(--space-0);
  inset-block-start: calc(var(--full) + var(--space-4));
  z-index: var(--z-popover);
  display: grid;
  max-block-size: var(--popover-max-height);
  overflow-y: auto;
  border-radius: var(--radius-md);
  background: var(--surface-card);
  box-shadow: var(--shadow-popover);
}

.c-place-picker__options:empty,
.c-global-search__results:empty {
  display: none;
}

.c-place-option {
  display: block;
  inline-size: var(--full);
  padding: var(--space-8) var(--space-12);
  border: var(--space-0);
  background: transparent;
  text-align: start;
  cursor: pointer;
}

.c-place-option:hover,
.c-place-option:focus-visible {
  background: var(--surface-hover);
}

/* ============================== IdTag, Tag, SourceLabel, CountBadge ============================== */

.c-id-tag {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-6);
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: var(--font-12);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
  text-decoration: none;
  white-space: nowrap;
}

a.c-id-tag:hover {
  border-color: var(--border-selected);
  color: var(--text-link);
}

.c-id-tag--r,
.c-id-tag--l {
  color: var(--text-primary);
}

.c-id-tag--m,
.c-id-tag--d,
.c-id-tag--g {
  color: var(--text-secondary);
}

.c-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-2) var(--space-8);
  border-radius: var(--radius-full);
  font-size: var(--font-12);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
  white-space: nowrap;
}

.c-tag--tone-neutral { background: var(--status-neutral-bg); color: var(--status-neutral-fg); }
.c-tag--tone-success { background: var(--status-success-bg); color: var(--status-success-fg); }
.c-tag--tone-warning { background: var(--status-warning-bg); color: var(--status-warning-fg); }
.c-tag--tone-danger { background: var(--status-danger-bg); color: var(--status-danger-fg); }
.c-tag--tone-info { background: var(--status-info-bg); color: var(--status-info-fg); }
.c-tag--tone-accent { background: var(--surface-accent); color: var(--text-on-accent); }
.c-tag--tone-sell { background: var(--intent-sell-bg); color: var(--intent-sell-fg); }
.c-tag--tone-buy { background: var(--intent-buy-bg); color: var(--intent-buy-fg); }
.c-tag--tone-rent { background: var(--intent-rent-bg); color: var(--intent-rent-fg); }
.c-tag--tone-home { background: var(--category-home-bg); color: var(--category-home-fg); }
.c-tag--tone-plot { background: var(--category-plot-bg); color: var(--category-plot-fg); }
.c-tag--tone-commercial { background: var(--category-commercial-bg); color: var(--category-commercial-fg); }

.c-source-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-2) var(--space-8);
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius-full);
  background: var(--surface-card);
  color: var(--text-secondary);
  font-size: var(--font-12);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
  white-space: nowrap;
}

.c-source-label__dot {
  inline-size: var(--dot-size);
  block-size: var(--dot-size);
  border-radius: var(--radius-full);
  background: var(--source-manual);
}

.c-source-label--zameen .c-source-label__dot { background: var(--source-zameen); }
.c-source-label--graana .c-source-label__dot { background: var(--source-graana); }
.c-source-label--olx .c-source-label__dot { background: var(--source-olx); }
.c-source-label--lamudi .c-source-label__dot { background: var(--source-lamudi); }
.c-source-label--whatsapp .c-source-label__dot { background: var(--source-whatsapp); }
.c-source-label--waha .c-source-label__dot { background: var(--source-waha); }
.c-source-label--facebook .c-source-label__dot { background: var(--source-facebook); }
.c-source-label--manual .c-source-label__dot { background: var(--source-manual); }
.c-source-label--app .c-source-label__dot { background: var(--source-app); }

.c-count-badge {
  display: inline-grid;
  place-items: center;
  min-inline-size: var(--size-icon-md);
  padding: var(--space-0) var(--space-6);
  border-radius: var(--radius-full);
  font-size: var(--font-12);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-normal);
  font-variant-numeric: tabular-nums;
}

.c-count-badge--neutral { background: var(--status-neutral-bg); color: var(--status-neutral-fg); }
.c-count-badge--accent { background: var(--surface-accent); color: var(--text-on-accent); }
.c-count-badge--danger { background: var(--surface-danger); color: var(--text-on-accent); }

/* ============================== Avatar, values ============================== */

.c-avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  inline-size: var(--avatar-size);
  block-size: var(--avatar-size);
  border-radius: var(--radius-full);
  background: var(--surface-selected);
  color: var(--status-info-fg);
  font-size: var(--font-12);
  font-weight: var(--weight-semibold);
}

.c-money {
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--tracking-amount);
  white-space: nowrap;
}

.c-size,
.c-time {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.c-time--none {
  color: var(--text-muted);
}

/* A wait read against its SLA: how long something has been sitting. */
.c-time--ok { color: var(--sla-ok); }
.c-time--warn { color: var(--sla-warn); font-weight: var(--weight-semibold); }
.c-time--late { color: var(--sla-late); font-weight: var(--weight-bold); }

.c-place {
  display: inline-grid;
  gap: var(--space-0);
}

.c-place__name {
  font-weight: var(--weight-medium);
}

.c-place__raw {
  font-size: var(--font-12);
  color: var(--text-muted);
  font-style: italic;
}

.c-place__path {
  font-size: var(--font-12);
  color: var(--text-muted);
}

.c-phone {
  font-family: var(--font-mono);
  color: var(--text-link);
  text-decoration: none;
  white-space: nowrap;
}

.c-stat {
  display: grid;
  gap: var(--space-2);
}

.c-stat__value {
  font-size: var(--font-28);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-amount);
  font-variant-numeric: tabular-nums;
}

.c-stat__label {
  font-size: var(--font-13);
  color: var(--text-secondary);
}

.c-stat__hint {
  font-size: var(--font-12);
  color: var(--text-muted);
}

.c-meta-grid {
  display: grid;
  gap: var(--space-10);
}

.c-meta-item {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: var(--space-12);
  align-items: baseline;
}

.c-meta-item__label {
  font-size: var(--font-13);
  color: var(--text-secondary);
}

.c-meta-item__value {
  overflow-wrap: anywhere;
}

/* ============================== Stepper, Scale, ProgressBar ============================== */

.c-stepper {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-16);
}

.c-stepper__step {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  color: var(--text-muted);
  font-size: var(--font-13);
}

.c-stepper__marker {
  display: inline-grid;
  place-items: center;
  inline-size: var(--size-icon-md);
  block-size: var(--size-icon-md);
  border: var(--border-width) solid var(--border-control);
  border-radius: var(--radius-full);
  font-size: var(--font-12);
}

.c-stepper__step--done {
  color: var(--text-success);
}

.c-stepper__step--done .c-stepper__marker {
  border-color: var(--text-success);
}

.c-stepper__step--current {
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}

.c-stepper__step--current .c-stepper__marker {
  border-color: var(--border-focus);
  background: var(--surface-accent);
  color: var(--text-on-accent);
}

.c-scale {
  display: grid;
  gap: var(--space-6);
}

.c-scale__svg {
  display: block;
  inline-size: var(--full);
  block-size: var(--scale-height);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.c-scale__track { fill: var(--scale-track); }
.c-scale__within { fill: var(--scale-within); }
.c-scale__over { fill: var(--scale-over); }
.c-scale__tick { fill: var(--scale-tick); }
.c-scale__marker { fill: var(--scale-marker); }

.c-scale__caption {
  font-size: var(--font-12);
  color: var(--text-secondary);
}

.c-scale--within .c-scale__caption { color: var(--sla-ok); }
.c-scale--over .c-scale__caption { color: var(--sla-warn); }
.c-scale--unknown .c-scale__caption { color: var(--text-muted); }

.c-progress-bar {
  display: grid;
  gap: var(--space-4);
}

.c-progress-bar__bar {
  inline-size: var(--full);
  block-size: var(--progress-height);
  border: var(--space-0);
  border-radius: var(--radius-full);
  background: var(--scale-track);
  overflow: hidden;
  appearance: none;
}

.c-progress-bar__bar::-webkit-progress-bar {
  background: var(--scale-track);
}

.c-progress-bar__bar::-webkit-progress-value {
  background: var(--surface-accent);
}

.c-progress-bar__bar::-moz-progress-bar {
  background: var(--surface-accent);
}

.c-progress-bar__label {
  font-size: var(--font-12);
  color: var(--text-secondary);
}

/* LiveRegion: a block the page re-reads in place; it adds no look of its own. */
.c-live-region {
  display: block;
}

/* ============================== Evidence, RawPost ============================== */

.c-evidence-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-2) var(--space-8) var(--space-2) var(--space-2);
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius-full);
  background: var(--surface-card);
  font-size: var(--font-12);
}

.c-evidence-chip__field {
  padding: var(--space-0) var(--space-6);
  border-radius: var(--radius-full);
  background: var(--surface-subtle);
  color: var(--text-secondary);
}

.c-evidence-chip__text,
.c-raw-post__mark {
  background: var(--evidence-bg);
  color: var(--evidence-fg);
}

.c-raw-post {
  max-block-size: var(--raw-post-max-height);
  overflow: auto;
  padding: var(--space-12) var(--space-16);
  border-inline-start: var(--border-width-strong) solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  font-size: var(--font-13);
  line-height: var(--leading-relaxed);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.c-raw-post__mark {
  border-radius: var(--radius-sm);
}

/* ============================== MessageBubble ============================== */

.c-message-bubble {
  display: flex;
  padding: var(--space-4) var(--space-12);
  background: var(--bubble-canvas);
}

.c-message-bubble:first-child {
  padding-block-start: var(--space-12);
}

.c-message-bubble:last-child {
  padding-block-end: var(--space-12);
}

.c-message-bubble__bubble {
  max-inline-size: var(--info-panel-width);
  padding: var(--space-6) var(--space-10);
  border-radius: var(--radius-md);
  background: var(--bubble-in-bg);
  color: var(--bubble-fg);
  font-size: var(--font-14);
  line-height: var(--leading-normal);
}

.c-message-bubble--out,
.c-message-bubble--draft {
  justify-content: flex-end;
}

.c-message-bubble--out .c-message-bubble__bubble,
.c-message-bubble--draft .c-message-bubble__bubble {
  background: var(--bubble-out-bg);
}

.c-message-bubble--draft .c-message-bubble__bubble {
  outline: var(--border-width) dashed var(--bubble-meta);
}

.c-message-bubble__text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.c-message-bubble__meta {
  margin-block-start: var(--space-2);
  color: var(--bubble-meta);
  font-size: var(--font-12);
  text-align: end;
}

.c-message-bubble__meta .c-time {
  color: inherit;
}

/* ============================== ChatLog ============================== */

/* A conversation: bubbles on the WhatsApp canvas, scrolled inside its own box
   so the reply box under it stays in view. */
.c-chat-log {
  display: block;
  max-block-size: var(--chat-log-max-height);
  overflow-y: auto;
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bubble-canvas);
}

.c-chat-log > .c-stack {
  padding: var(--space-12) var(--space-0);
}

.c-chat-log .c-cluster,
.c-chat-log .c-banner,
.c-chat-log .c-text {
  margin-inline: var(--space-12);
}

/* ============================== Timeline, Diff, Kbd ============================== */

.c-timeline {
  display: grid;
  gap: var(--space-12);
}

.c-timeline__item {
  display: grid;
  grid-template-columns: var(--timeline-dot) minmax(0, 1fr);
  gap: var(--space-12);
}

.c-timeline__dot {
  inline-size: var(--timeline-dot);
  block-size: var(--timeline-dot);
  margin-block-start: var(--space-6);
  border-radius: var(--radius-full);
  background: var(--icon-muted);
}

.c-timeline__item--success .c-timeline__dot { background: var(--text-success); }
.c-timeline__item--info .c-timeline__dot { background: var(--icon-accent); }
.c-timeline__item--warning .c-timeline__dot { background: var(--scale-tick); }
.c-timeline__item--danger .c-timeline__dot { background: var(--icon-danger); }

.c-timeline__body {
  display: grid;
  gap: var(--space-2);
}

.c-timeline__title {
  font-weight: var(--weight-medium);
}

.c-timeline__detail,
.c-timeline__body .c-time {
  font-size: var(--font-12);
  color: var(--text-muted);
}

.c-diff {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-8);
}

.c-diff__label {
  min-inline-size: var(--space-48);
  font-size: var(--font-12);
  color: var(--text-muted);
}

.c-diff__before {
  color: var(--text-danger);
}

.c-diff__after {
  color: var(--text-success);
  text-decoration: none;
}

.c-kbd {
  display: inline-flex;
  gap: var(--space-4);
}

.c-kbd__key {
  display: inline-grid;
  place-items: center;
  min-inline-size: var(--size-icon-md);
  padding: var(--space-0) var(--space-6);
  border: var(--border-width) solid var(--border-default);
  border-block-end-width: var(--border-width-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  color: var(--text-secondary);
  font-size: var(--font-12);
  line-height: var(--leading-normal);
}

/* ============================== Text, Heading, Link, EnvLabel ============================== */

.c-text {
  overflow-wrap: anywhere;
}

.c-text--muted { color: var(--text-muted); }
.c-text--secondary { color: var(--text-secondary); }
.c-text--success { color: var(--text-success); }
.c-text--warning { color: var(--text-warning); }
.c-text--danger { color: var(--text-danger); }
.c-text--mono { font-family: var(--font-mono); font-size: var(--font-13); }
.c-text--sm { font-size: var(--font-13); }

.c-heading {
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
}

.c-heading--1 { font-size: var(--font-25); font-weight: var(--weight-bold); }
.c-heading--2 { font-size: var(--font-20); }
.c-heading--3 { font-size: var(--font-16); }

.c-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  color: var(--text-link);
  text-decoration: underline;
  text-underline-offset: var(--space-2);
}

.c-env-label {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-8);
  border-radius: var(--radius-sm);
  font-size: var(--font-12);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
}

.c-env-label--prod { background: var(--env-prod-bg); color: var(--env-prod-fg); }
.c-env-label--staging { background: var(--env-staging-bg); color: var(--env-staging-fg); }
.c-env-label--dev { background: var(--env-dev-bg); color: var(--env-dev-fg); }

/* ============================== Shell ============================== */

.c-shell {
  display: grid;
  grid-template-columns: var(--shell-columns);
  min-block-size: var(--viewport-height);
}

.c-shell__main {
  display: flex;
  flex-direction: column;
  min-inline-size: var(--space-0);
}

/* The status bar stays in view with the search: what a click will do is
   never scrolled away from the button. */
.c-shell__header {
  position: sticky;
  inset-block-start: var(--space-0);
  z-index: var(--z-sticky);
}

.c-shell__top {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-8) var(--page-gutter);
  border-block-end: var(--border-width) solid var(--border-default);
  background: var(--surface-card);
}

.c-shell__top [data-shell-open] {
  display: var(--shell-menu-display);
}

.c-shell__content {
  flex: 1;
  inline-size: var(--full);
  max-inline-size: var(--content-max);
  margin-inline: auto;
  padding: var(--space-24) var(--page-gutter) var(--space-48);
}

.c-shell__content:focus {
  outline: none;
}

.c-shell__scrim {
  display: none;
}

.c-shell[data-open] .c-shell__scrim {
  position: fixed;
  inset: var(--space-0);
  z-index: var(--z-scrim);
  display: var(--shell-menu-display);
  background: var(--surface-scrim);
}

/* ============================== Sidebar ============================== */

.c-sidebar {
  position: var(--shell-sidebar-position);
  inset-block: var(--space-0);
  inset-inline-start: var(--space-0);
  z-index: var(--z-sidebar);
  display: flex;
  flex-direction: column;
  inline-size: var(--sidebar-width);
  block-size: var(--viewport-height);
  border-inline-end: var(--border-width) solid var(--border-default);
  background: var(--surface-subtle);
  translate: var(--shell-sidebar-shift) var(--space-0);
  transition: translate var(--motion-base) var(--motion-easing);
}

.c-shell[data-open] .c-sidebar {
  translate: var(--space-0) var(--space-0);
}

.c-sidebar__brand {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-16) var(--space-16) var(--space-8);
}

.c-sidebar__home {
  color: var(--text-primary);
  font-size: var(--font-17);
  font-weight: var(--weight-bold);
  text-decoration: none;
}

.c-sidebar__product {
  flex: 1;
  color: var(--text-muted);
  font-size: var(--font-13);
}

.c-sidebar__brand [data-shell-close] {
  display: var(--shell-menu-display);
}

.c-sidebar__footer {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-12) var(--space-16) var(--space-16);
  border-block-start: var(--border-width) solid var(--border-default);
}

.c-sidebar__user {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  padding-block-end: var(--space-4);
}

.c-sidebar__name {
  font-weight: var(--weight-medium);
}

.c-sidebar__footer .c-button {
  justify-content: flex-start;
  inline-size: var(--full);
}

.c-sidebar__footer [aria-pressed="true"] {
  background: var(--surface-selected);
}

.c-sidebar-nav {
  flex: 1;
  display: grid;
  align-content: start;
  gap: var(--space-16);
  padding: var(--space-8) var(--space-10);
  overflow-y: auto;
}

.c-sidebar-nav__group {
  display: grid;
  gap: var(--space-2);
}

.c-sidebar-nav__heading {
  padding: var(--space-0) var(--space-10) var(--space-4);
  color: var(--text-muted);
  font-size: var(--font-12);
  font-weight: var(--weight-medium);
}

.c-sidebar-nav__item {
  display: flex;
  align-items: center;
  gap: var(--space-10);
  min-block-size: var(--control-height-sm);
  padding: var(--space-0) var(--space-10);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
}

.c-sidebar-nav__item:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.c-sidebar-nav__item--current {
  background: var(--surface-pressed);
  color: var(--text-primary);
  font-weight: var(--weight-medium);
}

.c-sidebar-nav__label {
  flex: 1;
}

/* ============================== StatusBar ============================== */

.c-status-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-16);
  padding: var(--space-6) var(--page-gutter);
  background: var(--surface-subtle);
  border-block-end: var(--border-width) solid var(--border-default);
  font-size: var(--font-12);
  color: var(--text-secondary);
}

.c-status-bar__item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
}

.c-status-bar__item--success { color: var(--text-success); }
.c-status-bar__item--warning { color: var(--text-warning); font-weight: var(--weight-semibold); }
.c-status-bar__item--danger { color: var(--text-danger); font-weight: var(--weight-bold); }

.c-status-bar__clock {
  margin-inline-start: auto;
  font-variant-numeric: tabular-nums;
}

/* The environment and approval-gate switches: a button drawn as a toggle,
   because pressing it opens a confirmation rather than flipping at once. */
.c-status-bar__switch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-0);
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.c-status-bar__switch:disabled {
  color: var(--text-disabled);
  cursor: not-allowed;
}

.c-status-bar__switch:focus-visible {
  outline: var(--focus-ring-width) solid var(--border-focus);
  outline-offset: var(--focus-ring-offset);
}

.c-status-bar__switch--danger {
  color: var(--text-danger);
  font-weight: var(--weight-bold);
}

.c-status-bar__track {
  position: relative;
  flex: none;
  inline-size: var(--toggle-width);
  block-size: var(--toggle-height);
  border-radius: var(--radius-full);
  background: var(--border-control);
  transition: background-color var(--motion-fast) var(--motion-easing);
}

.c-status-bar__knob {
  position: absolute;
  inset-block-start: var(--space-2);
  inset-inline-start: var(--space-2);
  inline-size: var(--toggle-knob);
  block-size: var(--toggle-knob);
  border-radius: var(--radius-full);
  background: var(--surface-card);
  transition: translate var(--motion-fast) var(--motion-easing);
}

.c-status-bar__switch[aria-checked="true"] .c-status-bar__track {
  background: var(--surface-accent);
}

.c-status-bar__switch[aria-checked="true"] .c-status-bar__knob {
  translate: var(--space-16) var(--space-0);
}

.c-status-bar__switch--danger .c-status-bar__track {
  background: var(--surface-danger);
}

/* ============================== GlobalSearch, SearchHit ============================== */

.c-global-search {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--space-8);
  min-block-size: var(--control-height);
  padding: var(--space-0) var(--space-10);
  border: var(--border-width) solid var(--border-control);
  border-radius: var(--radius-md);
  background: var(--surface-input);
  color: var(--icon-default);
}

.c-global-search:focus-within {
  border-color: var(--border-focus);
}

.c-global-search__input {
  flex: 1;
  min-inline-size: var(--space-0);
  border: var(--space-0);
  background: transparent;
  color: var(--text-primary);
  font-size: var(--font-14);
}

.c-global-search__input:focus {
  outline: none;
}

.c-search-hit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-8) var(--space-12);
  padding: var(--space-8) var(--space-12);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  text-decoration: none;
}

a.c-search-hit:hover,
a.c-search-hit:focus-visible {
  background: var(--surface-hover);
}

.c-search-hit__main {
  flex: 1;
  display: grid;
  min-inline-size: var(--space-0);
}

.c-search-hit__title {
  font-weight: var(--weight-medium);
}

.c-search-hit__detail {
  font-size: var(--font-12);
  color: var(--text-muted);
}

.c-search-hit__tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

/* ThreadItem: one conversation in the inbox's list. */
.c-thread-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-10);
  padding: var(--space-10) var(--space-12);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  text-decoration: none;
}

.c-thread-item:hover,
.c-thread-item:focus-visible {
  background: var(--surface-hover);
}

.c-thread-item--current,
.c-thread-item--current:hover {
  background: var(--surface-selected);
}

.c-thread-item__body {
  flex: 1;
  display: grid;
  gap: var(--space-2);
  min-inline-size: var(--space-0);
}

.c-thread-item__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-8);
}

.c-thread-item__title {
  overflow: hidden;
  font-weight: var(--weight-semibold);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.c-thread-item__head .c-time {
  flex: none;
  font-size: var(--font-12);
  color: var(--text-muted);
}

.c-thread-item__preview {
  overflow: hidden;
  font-size: var(--font-13);
  color: var(--text-secondary);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.c-thread-item__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

/* ============================== PageHeader, Split, Card, Section ============================== */

.c-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-16);
}

.c-page-header__text {
  display: grid;
  gap: var(--space-4);
}

.c-page-header__title {
  font-size: var(--font-25);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-amount);
}

.c-page-header__subtitle {
  color: var(--text-secondary);
}

.c-page-header__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
}

.c-split-layout {
  display: grid;
  grid-template-columns: var(--split-columns);
  gap: var(--space-24);
  align-items: start;
}

.c-split-pane {
  display: grid;
  gap: var(--space-16);
  min-inline-size: var(--space-0);
}

.c-split-pane--aside {
  position: sticky;
  inset-block-start: var(--space-16);
}

/* A drawer: the aside is one row opened from the list beside it. */
.c-split-layout--drawer > .c-split-pane--aside {
  order: var(--drawer-order);
}

/* Start: the aside opens the row — a list beside what it opens — and below the
   first breakpoint what was opened comes first. */
.c-split-layout--start {
  grid-template-columns: var(--split-start-columns);
}

.c-split-layout--start > .c-split-pane--main {
  order: var(--split-start-main-order);
}

.c-card {
  min-inline-size: var(--space-0);
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
}

.c-card__header {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-16) var(--space-20) var(--space-0);
}

.c-card__title {
  font-size: var(--font-16);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
}

.c-card__subtitle {
  font-size: var(--font-13);
  color: var(--text-muted);
}

.c-card__body {
  padding: var(--space-16) var(--space-20) var(--space-20);
}

.c-section {
  display: grid;
  gap: var(--space-12);
}

.c-section__header {
  display: grid;
  gap: var(--space-2);
}

.c-section__title {
  font-size: var(--font-20);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
}

.c-section__description {
  color: var(--text-secondary);
}

/* ============================== Tabs, Toolbar, FilterBar ============================== */

.c-tabs {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  border-block-end: var(--border-width) solid var(--border-default);
}

.c-tabs__tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-10) var(--space-12);
  border-block-end: var(--border-width-strong) solid transparent;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
}

.c-tabs__tab:hover {
  color: var(--text-primary);
}

.c-tabs__tab--current {
  border-block-end-color: var(--border-focus);
  color: var(--text-primary);
  font-weight: var(--weight-medium);
}

.c-toolbar,
.c-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-12);
}

.c-filter-bar > .c-field {
  flex: 1;
  min-inline-size: var(--grid-min);
}

/* ============================== Table, Pager ============================== */

.c-table {
  overflow-x: auto;
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius-md);
}

.c-table__table {
  inline-size: var(--full);
  border-collapse: collapse;
  font-size: var(--font-13);
}

.c-table__head {
  padding: var(--table-cell-pad);
  background: var(--surface-subtle);
  color: var(--text-secondary);
  font-size: var(--font-12);
  font-weight: var(--weight-medium);
  text-align: start;
  white-space: nowrap;
}

.c-table__head--numeric,
.c-td--numeric {
  text-align: end;
  font-variant-numeric: tabular-nums;
}

.c-td {
  padding: var(--table-cell-pad);
  border-block-start: var(--border-width) solid var(--border-subtle);
  vertical-align: top;
}

/* A text column that must stay readable when its neighbours do not wrap. */
.c-td--wide {
  min-inline-size: var(--table-col-wide);
}

.c-tr:hover .c-td {
  background: var(--surface-hover);
}

.c-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12);
  padding-block-start: var(--space-12);
}

.c-pager__label {
  color: var(--text-muted);
  font-size: var(--font-13);
}

/* ============================== EmptyState, ActionBar ============================== */

.c-empty-state {
  display: grid;
  justify-items: center;
  gap: var(--space-8);
  padding: var(--space-40) var(--space-24);
  border: var(--border-width) dashed var(--border-default);
  border-radius: var(--radius-lg);
  color: var(--icon-muted);
  text-align: center;
}

.c-empty-state__title {
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}

.c-empty-state__body {
  color: var(--text-secondary);
}

.c-action-bar {
  position: sticky;
  inset-block-end: var(--space-0);
  z-index: var(--z-sticky);
  display: flex;
  flex-direction: var(--action-bar-direction);
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12);
  min-block-size: var(--action-bar-height);
  padding: var(--space-12) var(--space-20);
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  box-shadow: var(--shadow-popover);
}

/* ============================== Stack, Cluster, Grid ============================== */

.c-stack {
  display: grid;
  align-content: start;
  min-inline-size: var(--space-0);
}

.c-stack--tight { gap: var(--space-8); }
.c-stack--normal { gap: var(--space-16); }
.c-stack--loose { gap: var(--space-32); }

.c-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.c-cluster--tight { gap: var(--space-6); }
.c-cluster--normal { gap: var(--space-12); }
.c-cluster--between { gap: var(--space-12); justify-content: space-between; }

.c-grid {
  display: grid;
  gap: var(--space-16);
  align-items: start;
}

.c-grid--two {
  grid-template-columns: repeat(auto-fit, minmax(min(var(--grid-two-min), var(--full)), 1fr));
}

.c-grid--auto {
  grid-template-columns: repeat(auto-fill, minmax(min(var(--grid-min), var(--full)), 1fr));
}

/* ============================== Toast ============================== */

.c-toast-region {
  position: fixed;
  inset-block-end: var(--space-16);
  inset-inline-end: var(--space-16);
  z-index: var(--z-toast);
  display: grid;
  gap: var(--space-8);
  inline-size: min(var(--toast-width), calc(var(--full) - var(--space-32)));
}

/* A page with an action bar keeps its toasts at the top: at the bottom they
   would cover the bar's buttons for the whole dwell. */
.c-shell:has(.c-action-bar) ~ .c-toast-region {
  inset-block-start: var(--space-16);
  inset-block-end: auto;
}

.c-toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-10);
  padding: var(--space-12) var(--space-12) var(--space-12) var(--space-16);
  border-inline-start: var(--border-width-strong) solid var(--icon-muted);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  box-shadow: var(--shadow-popover);
  animation: c-toast-in var(--motion-base) var(--motion-easing),
    c-toast-out var(--motion-base) var(--motion-easing) var(--toast-dwell) forwards;
}

.c-toast--static {
  animation: none;
}

.c-toast--success { border-inline-start-color: var(--text-success); }
.c-toast--warning { border-inline-start-color: var(--scale-tick); }
.c-toast--danger { border-inline-start-color: var(--icon-danger); }
.c-toast--info { border-inline-start-color: var(--icon-accent); }

.c-toast--success .c-icon { color: var(--text-success); }
.c-toast--warning .c-icon { color: var(--text-warning); }
.c-toast--danger .c-icon { color: var(--icon-danger); }
.c-toast--info .c-icon { color: var(--icon-accent); }

.c-toast__text {
  flex: 1;
}

.c-toast__close {
  display: inline-grid;
  place-items: center;
  padding: var(--space-0);
  border: var(--space-0);
  background: transparent;
  color: var(--icon-default);
  cursor: pointer;
}

.c-toast__close .c-icon {
  color: var(--icon-default);
}

@keyframes c-toast-in {
  from {
    opacity: var(--opacity-hidden);
    translate: var(--space-0) var(--space-8);
  }
}

@keyframes c-toast-out {
  to {
    opacity: var(--opacity-hidden);
    visibility: hidden;
  }
}

/* ============================== Banner ============================== */

.c-banner {
  display: flex;
  gap: var(--space-12);
  padding: var(--space-12) var(--space-16);
  border-radius: var(--radius-md);
}

.c-banner__body {
  display: grid;
  gap: var(--space-2);
}

.c-banner__title {
  font-weight: var(--weight-semibold);
}

.c-banner--info { background: var(--status-info-bg); color: var(--status-info-fg); }
.c-banner--success { background: var(--status-success-bg); color: var(--status-success-fg); }
.c-banner--warning { background: var(--status-warning-bg); color: var(--status-warning-fg); }
.c-banner--danger { background: var(--status-danger-bg); color: var(--status-danger-fg); }
.c-banner--band { background: var(--status-band-bg); color: var(--status-band-fg); }

/* ============================== Dialog ============================== */

.c-dialog {
  inline-size: min(var(--dialog-width), calc(var(--full) - var(--space-32)));
  padding: var(--space-0);
  border: var(--space-0);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-popover);
}

.c-dialog::backdrop {
  background: var(--surface-scrim);
}

.c-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12);
  padding: var(--space-16) var(--space-16) var(--space-0) var(--space-24);
}

.c-dialog__title {
  font-size: var(--font-17);
  font-weight: var(--weight-semibold);
}

.c-dialog__description {
  padding: var(--space-4) var(--space-24) var(--space-0);
  color: var(--text-secondary);
}

.c-dialog__body {
  padding: var(--space-16) var(--space-24) var(--space-24);
}

.c-shortcuts-dialog {
  display: grid;
  gap: var(--space-8);
}

.c-shortcuts-dialog__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
}

/* ============================== Spinner, Skeleton ============================== */

.c-spinner {
  display: inline-grid;
  place-items: center;
}

.c-spinner__ring {
  inline-size: var(--size-icon-md);
  block-size: var(--size-icon-md);
  border: var(--border-width-strong) solid var(--border-default);
  border-block-start-color: var(--surface-accent);
  border-radius: var(--radius-full);
  animation: c-spin var(--motion-spin) linear infinite;
}

.c-skeleton {
  display: grid;
  gap: var(--space-8);
  inline-size: var(--full);
}

.c-skeleton__line {
  display: block;
  block-size: var(--space-12);
  border-radius: var(--radius-sm);
  background: var(--surface-pressed);
  animation: c-pulse var(--skeleton-cycle) var(--motion-easing) infinite alternate;
}

.c-skeleton__line:last-child {
  inline-size: var(--pct-half);
}

@keyframes c-spin {
  to {
    rotate: var(--turn);
  }
}

@keyframes c-pulse {
  to {
    opacity: var(--opacity-skeleton);
  }
}

/* ============================== Swatch (/design only) ============================== */

.c-swatch {
  display: grid;
  grid-template-columns: var(--space-40) minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: var(--space-12);
  align-items: center;
}

.c-swatch__sample {
  grid-row: span 2;
  display: grid;
  place-items: center;
  inline-size: var(--space-40);
  block-size: var(--space-32);
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
}

.c-swatch__sample--space {
  inline-size: auto;
  block-size: var(--space-8);
  border: var(--space-0);
  background: var(--surface-accent);
}

.c-swatch__sample--value {
  border-style: dashed;
}

.c-swatch__name {
  font-size: var(--font-12);
  overflow-wrap: anywhere;
}

.c-swatch__value {
  font-size: var(--font-12);
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

/* ============================== Breadcrumb ============================== */

.c-breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-6);
  font-size: var(--font-13);
  color: var(--text-muted);
}

.c-breadcrumb__item + .c-breadcrumb__item::before {
  content: "/";
  margin-inline-end: var(--space-6);
  color: var(--text-disabled);
}

.c-breadcrumb__link {
  color: var(--text-link);
  text-decoration: none;
}

.c-breadcrumb__link:hover {
  text-decoration: underline;
}

.c-breadcrumb__current {
  color: var(--text-secondary);
}

/* ============================== Sortable ============================== */

.c-sortable {
  display: grid;
  gap: var(--space-12);
}

.c-sortable-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-8);
  align-items: start;
  padding: var(--space-12);
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
}

.c-sortable-item:not([data-sortable-item]) {
  grid-template-columns: minmax(0, 1fr);
}

.c-sortable-item--muted {
  background: var(--surface-subtle);
  color: var(--text-muted);
}

.c-sortable-item--dragging {
  position: relative;
  z-index: var(--z-popover);
  border-color: var(--border-focus);
  box-shadow: var(--shadow-popover);
}

.c-sortable-item__controls {
  display: grid;
  justify-items: center;
  gap: var(--space-2);
}

.c-sortable-item__handle {
  display: inline-grid;
  place-items: center;
  inline-size: var(--control-height-sm);
  block-size: var(--control-height-sm);
  border: var(--space-0);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--icon-default);
  cursor: grab;
  touch-action: none;
}

.c-sortable-item__handle:hover {
  background: var(--surface-hover);
}

.c-sortable-item__body {
  display: grid;
  gap: var(--space-8);
  min-inline-size: var(--space-0);
}

/* ============================== PanelTabs, Disclosure ============================== */

.c-panel-tabs {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  border-block-end: var(--border-width) solid var(--border-default);
}

.c-panel-tabs__tab {
  padding: var(--space-8) var(--space-10);
  border: var(--space-0);
  border-block-end: var(--border-width-strong) solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: var(--font-13);
  white-space: nowrap;
  cursor: pointer;
}

.c-panel-tabs__tab:hover {
  color: var(--text-primary);
}

.c-panel-tabs__tab--current {
  border-block-end-color: var(--border-focus);
  color: var(--text-primary);
  font-weight: var(--weight-medium);
}

.c-tab-panel {
  display: grid;
  gap: var(--space-12);
  padding-block-start: var(--space-12);
}

.c-tab-panel[hidden] {
  display: none;
}

.c-disclosure__summary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  color: var(--text-secondary);
  font-size: var(--font-13);
  cursor: pointer;
  list-style: none;
}

.c-disclosure__summary::-webkit-details-marker {
  display: none;
}

.c-disclosure__summary .c-icon {
  transition: rotate var(--motion-fast) var(--motion-easing);
}

.c-disclosure[open] > .c-disclosure__summary .c-icon {
  rotate: var(--turn-quarter);
}

.c-disclosure__body {
  display: grid;
  gap: var(--space-8);
  padding-block-start: var(--space-8);
}

/* ============================== MessagePreview ============================== */

.c-message-preview {
  display: grid;
  gap: var(--space-8);
}

.c-message-preview__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
}

.c-message-preview__count {
  font-family: var(--font-mono);
  font-size: var(--font-12);
  color: var(--text-muted);
}

.c-message-preview__count--over {
  color: var(--text-danger);
  font-weight: var(--weight-semibold);
}

.c-message-preview__formatted {
  border-radius: var(--radius-md);
  overflow: hidden;
}

.c-message-preview__raw {
  max-block-size: var(--raw-post-max-height);
  overflow: auto;
  margin: var(--space-0);
  padding: var(--space-12);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  font-family: var(--font-mono);
  font-size: var(--font-12);
  line-height: var(--leading-normal);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.c-message-preview__raw[hidden],
.c-message-preview__formatted[hidden] {
  display: none;
}

.c-message-preview__follows {
  display: grid;
  gap: var(--space-4);
  padding-inline-start: var(--space-16);
  color: var(--text-secondary);
  font-size: var(--font-13);
}

.c-message-bubble__bold { font-weight: var(--weight-bold); }
.c-message-bubble__italic { font-style: italic; }
.c-message-bubble__strike { text-decoration: line-through; }

/* swatches:begin — generated by views/design.swatch_css(); a test keeps it in step */
.c-swatch--accent-50 { background: var(--accent-50); }
.c-swatch--accent-100 { background: var(--accent-100); }
.c-swatch--accent-200 { background: var(--accent-200); }
.c-swatch--accent-600 { background: var(--accent-600); }
.c-swatch--accent-700 { background: var(--accent-700); }
.c-swatch--accent-800 { background: var(--accent-800); }
.c-swatch--grey-0 { background: var(--grey-0); }
.c-swatch--grey-25 { background: var(--grey-25); }
.c-swatch--grey-50 { background: var(--grey-50); }
.c-swatch--grey-75 { background: var(--grey-75); }
.c-swatch--grey-100 { background: var(--grey-100); }
.c-swatch--grey-150 { background: var(--grey-150); }
.c-swatch--grey-400 { background: var(--grey-400); }
.c-swatch--grey-500 { background: var(--grey-500); }
.c-swatch--grey-600 { background: var(--grey-600); }
.c-swatch--grey-1000 { background: var(--grey-1000); }
.c-swatch--green-50 { background: var(--green-50); }
.c-swatch--green-700 { background: var(--green-700); }
.c-swatch--orange-50 { background: var(--orange-50); }
.c-swatch--orange-band { background: var(--orange-band); }
.c-swatch--orange-tick { background: var(--orange-tick); }
.c-swatch--orange-700 { background: var(--orange-700); }
.c-swatch--red-50 { background: var(--red-50); }
.c-swatch--red-500 { background: var(--red-500); }
.c-swatch--red-700 { background: var(--red-700); }
.c-swatch--red-800 { background: var(--red-800); }
.c-swatch--teal-50 { background: var(--teal-50); }
.c-swatch--teal-700 { background: var(--teal-700); }
.c-swatch--violet-50 { background: var(--violet-50); }
.c-swatch--violet-700 { background: var(--violet-700); }
.c-swatch--sky-50 { background: var(--sky-50); }
.c-swatch--sky-700 { background: var(--sky-700); }
.c-swatch--sand-50 { background: var(--sand-50); }
.c-swatch--sand-700 { background: var(--sand-700); }
.c-swatch--plum-50 { background: var(--plum-50); }
.c-swatch--plum-700 { background: var(--plum-700); }
.c-swatch--yellow-100 { background: var(--yellow-100); }
.c-swatch--brand-zameen { background: var(--brand-zameen); }
.c-swatch--brand-graana { background: var(--brand-graana); }
.c-swatch--brand-olx { background: var(--brand-olx); }
.c-swatch--brand-lamudi { background: var(--brand-lamudi); }
.c-swatch--brand-whatsapp { background: var(--brand-whatsapp); }
.c-swatch--brand-waha { background: var(--brand-waha); }
.c-swatch--brand-facebook { background: var(--brand-facebook); }
.c-swatch--whatsapp-canvas { background: var(--whatsapp-canvas); }
.c-swatch--whatsapp-out { background: var(--whatsapp-out); }
.c-swatch--whatsapp-ink { background: var(--whatsapp-ink); }
.c-swatch--whatsapp-meta { background: var(--whatsapp-meta); }
.c-swatch--font-12 { font-size: var(--font-12); }
.c-swatch--font-13 { font-size: var(--font-13); }
.c-swatch--font-14 { font-size: var(--font-14); }
.c-swatch--font-15 { font-size: var(--font-15); }
.c-swatch--font-16 { font-size: var(--font-16); }
.c-swatch--font-17 { font-size: var(--font-17); }
.c-swatch--font-20 { font-size: var(--font-20); }
.c-swatch--font-25 { font-size: var(--font-25); }
.c-swatch--font-28 { font-size: var(--font-28); }
.c-swatch--space-0 { inline-size: var(--space-0); }
.c-swatch--space-2 { inline-size: var(--space-2); }
.c-swatch--space-4 { inline-size: var(--space-4); }
.c-swatch--space-6 { inline-size: var(--space-6); }
.c-swatch--space-8 { inline-size: var(--space-8); }
.c-swatch--space-10 { inline-size: var(--space-10); }
.c-swatch--space-12 { inline-size: var(--space-12); }
.c-swatch--space-16 { inline-size: var(--space-16); }
.c-swatch--space-20 { inline-size: var(--space-20); }
.c-swatch--space-24 { inline-size: var(--space-24); }
.c-swatch--space-32 { inline-size: var(--space-32); }
.c-swatch--space-40 { inline-size: var(--space-40); }
.c-swatch--space-48 { inline-size: var(--space-48); }
.c-swatch--weight-regular { font-weight: var(--weight-regular); }
.c-swatch--weight-medium { font-weight: var(--weight-medium); }
.c-swatch--weight-semibold { font-weight: var(--weight-semibold); }
.c-swatch--weight-bold { font-weight: var(--weight-bold); }
.c-swatch--leading-tight { line-height: var(--leading-tight); }
.c-swatch--leading-normal { line-height: var(--leading-normal); }
.c-swatch--leading-relaxed { line-height: var(--leading-relaxed); }
.c-swatch--text-primary { background: var(--text-primary); }
.c-swatch--text-secondary { background: var(--text-secondary); }
.c-swatch--text-muted { background: var(--text-muted); }
.c-swatch--text-disabled { background: var(--text-disabled); }
.c-swatch--text-link { background: var(--text-link); }
.c-swatch--text-on-accent { background: var(--text-on-accent); }
.c-swatch--text-success { background: var(--text-success); }
.c-swatch--text-warning { background: var(--text-warning); }
.c-swatch--text-danger { background: var(--text-danger); }
.c-swatch--surface-page { background: var(--surface-page); }
.c-swatch--surface-card { background: var(--surface-card); }
.c-swatch--surface-subtle { background: var(--surface-subtle); }
.c-swatch--surface-hover { background: var(--surface-hover); }
.c-swatch--surface-pressed { background: var(--surface-pressed); }
.c-swatch--surface-input { background: var(--surface-input); }
.c-swatch--surface-selected { background: var(--surface-selected); }
.c-swatch--surface-accent { background: var(--surface-accent); }
.c-swatch--surface-accent-hover { background: var(--surface-accent-hover); }
.c-swatch--surface-accent-pressed { background: var(--surface-accent-pressed); }
.c-swatch--surface-danger { background: var(--surface-danger); }
.c-swatch--surface-danger-hover { background: var(--surface-danger-hover); }
.c-swatch--surface-scrim { background: var(--surface-scrim); }
.c-swatch--border-subtle { background: var(--border-subtle); }
.c-swatch--border-default { background: var(--border-default); }
.c-swatch--border-control { background: var(--border-control); }
.c-swatch--border-selected { background: var(--border-selected); }
.c-swatch--border-focus { background: var(--border-focus); }
.c-swatch--icon-default { background: var(--icon-default); }
.c-swatch--icon-muted { background: var(--icon-muted); }
.c-swatch--icon-accent { background: var(--icon-accent); }
.c-swatch--icon-danger { background: var(--icon-danger); }
.c-swatch--status-success-bg { background: var(--status-success-bg); }
.c-swatch--status-success-fg { background: var(--status-success-fg); }
.c-swatch--status-warning-bg { background: var(--status-warning-bg); }
.c-swatch--status-warning-fg { background: var(--status-warning-fg); }
.c-swatch--status-danger-bg { background: var(--status-danger-bg); }
.c-swatch--status-danger-fg { background: var(--status-danger-fg); }
.c-swatch--status-info-bg { background: var(--status-info-bg); }
.c-swatch--status-info-fg { background: var(--status-info-fg); }
.c-swatch--status-neutral-bg { background: var(--status-neutral-bg); }
.c-swatch--status-neutral-fg { background: var(--status-neutral-fg); }
.c-swatch--status-band-bg { background: var(--status-band-bg); }
.c-swatch--status-band-fg { background: var(--status-band-fg); }
.c-swatch--intent-sell-bg { background: var(--intent-sell-bg); }
.c-swatch--intent-sell-fg { background: var(--intent-sell-fg); }
.c-swatch--intent-buy-bg { background: var(--intent-buy-bg); }
.c-swatch--intent-buy-fg { background: var(--intent-buy-fg); }
.c-swatch--intent-rent-bg { background: var(--intent-rent-bg); }
.c-swatch--intent-rent-fg { background: var(--intent-rent-fg); }
.c-swatch--category-home-bg { background: var(--category-home-bg); }
.c-swatch--category-home-fg { background: var(--category-home-fg); }
.c-swatch--category-plot-bg { background: var(--category-plot-bg); }
.c-swatch--category-plot-fg { background: var(--category-plot-fg); }
.c-swatch--category-commercial-bg { background: var(--category-commercial-bg); }
.c-swatch--category-commercial-fg { background: var(--category-commercial-fg); }
.c-swatch--source-zameen { background: var(--source-zameen); }
.c-swatch--source-graana { background: var(--source-graana); }
.c-swatch--source-olx { background: var(--source-olx); }
.c-swatch--source-lamudi { background: var(--source-lamudi); }
.c-swatch--source-whatsapp { background: var(--source-whatsapp); }
.c-swatch--source-waha { background: var(--source-waha); }
.c-swatch--source-facebook { background: var(--source-facebook); }
.c-swatch--source-manual { background: var(--source-manual); }
.c-swatch--source-app { background: var(--source-app); }
.c-swatch--env-prod-bg { background: var(--env-prod-bg); }
.c-swatch--env-prod-fg { background: var(--env-prod-fg); }
.c-swatch--env-staging-bg { background: var(--env-staging-bg); }
.c-swatch--env-staging-fg { background: var(--env-staging-fg); }
.c-swatch--env-dev-bg { background: var(--env-dev-bg); }
.c-swatch--env-dev-fg { background: var(--env-dev-fg); }
.c-swatch--scale-track { background: var(--scale-track); }
.c-swatch--scale-within { background: var(--scale-within); }
.c-swatch--scale-over { background: var(--scale-over); }
.c-swatch--scale-tick { background: var(--scale-tick); }
.c-swatch--scale-marker { background: var(--scale-marker); }
.c-swatch--sla-ok { background: var(--sla-ok); }
.c-swatch--sla-warn { background: var(--sla-warn); }
.c-swatch--sla-late { background: var(--sla-late); }
.c-swatch--bubble-canvas { background: var(--bubble-canvas); }
.c-swatch--bubble-in-bg { background: var(--bubble-in-bg); }
.c-swatch--bubble-out-bg { background: var(--bubble-out-bg); }
.c-swatch--bubble-fg { background: var(--bubble-fg); }
.c-swatch--bubble-meta { background: var(--bubble-meta); }
.c-swatch--evidence-bg { background: var(--evidence-bg); }
.c-swatch--evidence-fg { background: var(--evidence-fg); }
.c-swatch--radius-sm { border-radius: var(--radius-sm); }
.c-swatch--radius-md { border-radius: var(--radius-md); }
.c-swatch--radius-lg { border-radius: var(--radius-lg); }
.c-swatch--radius-full { border-radius: var(--radius-full); }
.c-swatch--shadow-popover { box-shadow: var(--shadow-popover); }
/* swatches:end */
