/* wwwroot/css/components.css */

/* surfaces: the large card is a glass card, the inner card and the tile stay flat on the tonal ladder (DESIGN.md 9.1, 12.00 rules 2-3) */
.ds-card { background: var(--card-bg); border-radius: var(--radius-card); padding: var(--space-5); box-shadow: var(--card-shadow); }
.ds-card:where(:not(.ds-card--inner, .ds-card--tile)) { position: relative; isolation: isolate; }
/* the 20 px blur sits on a layer behind the content: a backdrop-filter on the card itself would make it the containing block of the fixed popovers inside it (ui.js places them in viewport coordinates) */
.ds-card:where(:not(.ds-card--inner, .ds-card--tile))::before, .ds-dialog::before, .ds-drawer::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); pointer-events: none;
}
.ds-card--inner { border-radius: var(--radius-inner); padding: var(--space-4); background: var(--color-surface-1); box-shadow: none; }
.ds-card--tile { border-radius: var(--radius-md); padding: var(--space-3); background: var(--color-surface-2); box-shadow: none; }
.ds-card__head { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); }
.ds-avatar { width: 20px; height: 20px; flex: none; border-radius: 50%; background: var(--color-brand-purple); box-shadow: inset 0 0 0 1.5px var(--color-brand-purple-ring); }
.ds-avatar--lg { width: 24px; height: 24px; }
.ds-pair { display: grid; gap: var(--space-1); }
.ds-pair + .ds-pair { margin-top: var(--space-3); }
.ds-pair__label { font-weight: var(--weight-semibold); color: var(--color-text); }
.ds-pair__value { color: var(--color-text-body); }

/* buttons: radius 8, label as stored (no transform, no tracking), md 32 by default, 44 on touch (DESIGN.md 8.1) */
.ds-btn {
  --btn-h: var(--control-h-md);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--btn-h); padding: 0 var(--space-3); border: 0; border-radius: var(--radius-md);
  font-size: var(--text-sm); line-height: var(--lh-body); font-weight: var(--weight-semibold); text-decoration: none; text-align: center;
  background: var(--color-surface-2); color: var(--color-text);
  transition: background-color var(--dur-base) var(--ease), transform var(--dur-fast) var(--ease), opacity var(--dur-base) var(--ease);
}
.ds-btn--sm { --btn-h: var(--control-h-sm); padding: 0 var(--space-2); font-size: var(--text-xs); line-height: var(--lh-tight); }
.ds-btn--lg { --btn-h: var(--control-h-lg); padding: 0 var(--space-4); font-size: var(--text-md); }
.ds-btn--block { display: flex; width: 100%; }
.ds-btn:active { transform: scale(0.97); }
.ds-btn--primary { background: var(--color-primary); color: var(--color-on-primary); }
.ds-btn--accent { background: var(--color-accent); color: var(--color-on-accent); font-size: var(--text-lg); font-weight: var(--weight-bold); min-width: 120px; }
.ds-btn--dark { background: var(--color-surface-1); }
.ds-btn--secondary { background: transparent; box-shadow: inset 0 0 0 1px var(--color-border-strong); }
.ds-btn--danger { background: var(--color-negative); color: var(--color-on-negative); }
.ds-btn--ghost { background: transparent; padding: 0 var(--space-2); font-weight: var(--weight-regular); }
@media (hover: hover) {
  .ds-btn--primary:hover { background: var(--color-primary-hover); }
  .ds-btn--accent:hover { background: var(--color-accent-hover); }
  .ds-btn--dark:hover { background: var(--color-surface-hover-1); }
  .ds-btn--secondary:hover { background: var(--color-surface-hover-2); }
  .ds-btn--ghost:hover { text-decoration: underline; }
}
.ds-btn--primary:active { background: var(--color-primary-pressed); }
.ds-btn--accent:active { background: var(--color-accent-pressed); }
.ds-btn[disabled], .ds-btn[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; transform: none; }
.ds-btn[aria-busy="true"] { position: relative; color: transparent; pointer-events: none; }
.ds-btn[aria-busy="true"]::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-top-color: var(--color-on-primary); border-right-color: var(--color-on-primary); animation: ds-spin 0.8s linear infinite; }
.ds-icon-btn { display: inline-grid; place-items: center; width: var(--target-min); height: var(--target-min); border: 0; border-radius: var(--radius-md); background: transparent; color: var(--color-text-muted); }
@media (hover: hover) { .ds-icon-btn:hover { background: var(--color-surface-hover-2); color: var(--color-text); } }
.ds-icon-btn[disabled] { color: var(--color-text-disabled); cursor: not-allowed; }

/* send disc: 32 px, 44 on touch */
.ds-send { display: inline-flex; align-items: center; justify-content: center; width: var(--target-min); height: var(--target-min); flex: none; border: 0; border-radius: 50%; background: var(--color-surface-1); color: var(--color-accent); transition: background-color var(--dur-base) var(--ease), color var(--dur-base) var(--ease); }
.ds-send[disabled], .ds-send[aria-disabled="true"] { color: var(--color-send-arrow-disabled); cursor: not-allowed; }
@media (hover: hover) { .ds-send:not([disabled]):hover { background: var(--color-accent); color: var(--color-on-accent); } }

/* fields: stacked (login) and inline (contact); the caption is always a real label */
.ds-field { --field-bg: var(--color-surface-2); position: relative; display: flex; background: var(--field-bg); border-radius: var(--radius-field); box-shadow: inset 0 0 0 1px var(--field-edge); transition: background-color var(--dur-fast) var(--ease); }
.ds-field--on-card { --field-bg: var(--color-bg); }
.ds-field--stacked { flex-direction: column; justify-content: center; min-height: var(--field-stacked-h); padding: var(--space-1) var(--space-3); }
.ds-field--inline { align-items: center; gap: var(--space-2); min-height: var(--control-h-md); padding: 0 var(--space-3); border-radius: var(--radius-field-sm); }
.ds-field--inline > .ds-field__input, .ds-field--inline > .ds-select-wrap, .ds-select-wrap > .ds-select { align-self: stretch; }   /* the input or select fills the field's height, so the whole 32 / 44 px field is its target (DESIGN.md 8, 14) */
.ds-field__caption { font-size: var(--text-xs); line-height: var(--lh-tight); font-weight: var(--weight-regular); color: var(--color-text); white-space: nowrap; }
.ds-field--inline .ds-field__caption { font-weight: var(--weight-medium); text-transform: uppercase; }
.ds-field__required { color: var(--color-text-muted); font-weight: var(--weight-regular); text-transform: none; }
.ds-field__input { flex: 1; min-width: 0; padding: 0; border: 0; background: transparent; color: var(--color-text); font-size: var(--text-sm); line-height: var(--lh-body); outline: none; }
.ds-field__input::placeholder { color: var(--color-text-subtle); opacity: 1; }
.ds-field--area { flex-direction: column; align-items: stretch; border-radius: var(--radius-field); padding: var(--space-2) var(--space-3); min-height: 88px; }
.ds-field--area .ds-field__input { resize: vertical; min-height: 56px; }
@media (hover: hover) { .ds-field:hover { background: var(--color-surface-hover-2); } .ds-field--on-card:hover { background: var(--color-bg); } }
.ds-field:focus-within { outline: 2px solid var(--color-focus-ring); outline-offset: 0; }
/* the error edge is never the outline, so a focused invalid field shows both: the edge inside, the ring 2 px outside (03 section 6, AIS-126) */
.ds-field[data-invalid="true"] { box-shadow: inset 0 0 0 1.5px var(--color-negative); }
.ds-field[data-invalid="true"]:focus-within { outline-offset: 2px; }
.ds-field[aria-disabled="true"] { background: var(--color-surface-1); color: var(--color-text-disabled); }
.ds-field__help { margin-top: var(--space-2); font-size: var(--text-xs); color: var(--color-text-subtle); }
.ds-field__help--wrap { overflow-wrap: anywhere; }
.ds-field__error { display: flex; gap: var(--space-2); margin-top: var(--space-2); font-size: var(--text-xs); color: var(--color-negative); }
@media (max-width: 639px) { .ds-field--inline { flex-direction: column; align-items: stretch; justify-content: center; min-height: var(--field-stacked-h); padding: var(--space-1) var(--space-3); gap: 0; border-radius: var(--radius-field); } }
/* column fields (stacked; the contact form's inline fields; inline fields below 640 px): the input or select covers the whole field box, caption included, so a press anywhere on the
   field reaches it (DESIGN.md 14). It reaches over the field's padding and the caption with negative margins and takes the same room back as padding, so nothing moves and the caption
   shows through it; --field-cap is the caption's line, set only where a caption precedes the control. In the password field with its reveal button the input inside .ds-field__control
   takes the same pair, and its right padding keeps its text clear of the button, which stays on top at the right with its own target. */
:is(.ds-field--stacked, .ds-contact__row .ds-field--inline) > .ds-field__caption + * { --field-cap: calc(var(--text-xs) * var(--lh-tight)); }
:is(.ds-field--stacked, .ds-contact__row .ds-field--inline) > .ds-field__input, :is(.ds-field--stacked, .ds-contact__row .ds-field--inline) > .ds-select-wrap > .ds-select {
  position: relative; margin: calc(-1 * (var(--space-1) + var(--field-cap, 0px))) calc(-1 * var(--space-3)) calc(-1 * var(--space-1)); padding: calc(var(--space-1) + var(--field-cap, 0px)) var(--space-3) var(--space-1);
}
:is(.ds-field--stacked, .ds-contact__row .ds-field--inline) > .ds-select-wrap > .ds-select { padding-right: calc(var(--space-3) + 28px); }
:is(.ds-field--stacked, .ds-contact__row .ds-field--inline) > .ds-field__control > .ds-field__input {
  position: relative; margin: calc(-1 * (var(--space-1) + var(--field-cap, 0px))) calc(-1 * var(--space-3)) calc(-1 * var(--space-1)); padding: calc(var(--space-1) + var(--field-cap, 0px)) calc(var(--space-3) + var(--target-min)) var(--space-1) var(--space-3);
}
@media (max-width: 639px) {
  .ds-field--inline:not(.ds-search) > .ds-field__caption + * { --field-cap: calc(var(--text-xs) * var(--lh-tight)); }
  .ds-field--inline:not(.ds-search) > .ds-field__input, .ds-field--inline:not(.ds-search) > .ds-select-wrap > .ds-select {
    position: relative; margin: calc(-1 * (var(--space-1) + var(--field-cap, 0px))) calc(-1 * var(--space-3)) calc(-1 * var(--space-1)); padding: calc(var(--space-1) + var(--field-cap, 0px)) var(--space-3) var(--space-1);
  }
  .ds-field--inline:not(.ds-search) > .ds-select-wrap > .ds-select { padding-right: calc(var(--space-3) + 28px); }
}
/* the thresholds row's inline fields are columns at every width; from 640 px they have no block padding and keep the inline 8 px gap (16 + 8 + 20 = 44), so the control reaches over the
   caption and the gap only */
@media (min-width: 640px) {
  .ds-thresholds__row .ds-field--inline > .ds-field__input, .ds-thresholds__row .ds-field--inline > .ds-select-wrap > .ds-select {
    position: relative; margin: calc(-1 * (var(--text-xs) * var(--lh-tight) + var(--space-2))) calc(-1 * var(--space-3)) 0; padding: calc(var(--text-xs) * var(--lh-tight) + var(--space-2)) var(--space-3) 0;
  }
  .ds-thresholds__row .ds-field--inline > .ds-select-wrap > .ds-select { padding-right: calc(var(--space-3) + 28px); }
}

/* select tile (dimension picker) */
.ds-tile-grid { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: var(--space-2); }
.ds-tile { position: relative; display: flex; align-items: center; justify-content: center; min-height: max(40px, var(--target-min)); padding: var(--space-2) var(--space-3); border: 0; border-radius: var(--radius-md); background: var(--color-surface-2); color: var(--color-text); font-size: var(--text-sm); text-align: center; transition: background-color var(--dur-fast) var(--ease); }
@media (hover: hover) { .ds-tile:hover { background: var(--color-surface-hover-2); } }
.ds-tile[aria-checked="true"], .ds-tile[aria-pressed="true"] { background: var(--color-surface-3); }
.ds-tile[aria-checked="true"]::before, .ds-tile[aria-pressed="true"]::before, .ds-tile[aria-checked="true"]::after, .ds-tile[aria-pressed="true"]::after {
  content: ""; position: absolute; right: 8px; bottom: -4px; width: 18px; height: 12px; border-radius: var(--radius-pill);
  background: var(--color-check); animation: ds-pop 160ms var(--ease);
}
/* the check badge is the ::before; the ::after over it is the glyph in on-check (DESIGN.md 3), the check shape as a mask, so both themes take the colour from a token */
.ds-tile[aria-checked="true"]::after, .ds-tile[aria-pressed="true"]::after { background: var(--color-on-check); -webkit-mask: url("/icons/ui/check-dark.svg") center / 10px no-repeat; mask: url("/icons/ui/check-dark.svg") center / 10px no-repeat; }
@media (max-width: 1099px) { .ds-tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* account rows (DESIGN account-row, N-23; spec 73 section 13): the picker SC-55 and the switch dialog SC-56. AccountRow is content only; the host item is the
   button, the link of a locked row or the aria-disabled div of a row that cannot be chosen */
.ds-account-list { display: grid; gap: var(--space-1); margin: 0; padding: 0; list-style: none; }
.ds-account-list__item { display: flex; width: 100%; min-height: 56px; padding: var(--space-2) var(--space-3); border: 0; border-radius: var(--radius-md); background: none; color: var(--color-text); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.ds-account-list__item:focus-visible { outline-offset: -2px; }   /* the focus ring inside the row */
@media (hover: hover) { :is(button, a).ds-account-list__item:hover { background: var(--color-surface-hover-1); } }
.ds-account-list__item[aria-disabled="true"] { cursor: default; }
.ds-account-list__cancel { margin-top: var(--space-5); }   /* the ghost "Odjava" 20 px under the list */
.ds-account-row { display: flex; align-items: center; gap: var(--space-3); width: 100%; min-width: 0; }
.ds-account-row__text { display: grid; flex: 1; min-width: 0; }
.ds-account-row__title { overflow: hidden; font-size: var(--text-sm); font-weight: var(--weight-semibold); line-height: var(--lh-body); white-space: nowrap; text-overflow: ellipsis; }
.ds-account-row__sub { color: var(--color-text-muted); font-size: var(--text-xs); line-height: var(--lh-body); }
.ds-account-row__trail { display: flex; flex: none; align-items: center; gap: var(--space-2); }
.ds-account-row__lock, .ds-account-row__last { color: var(--color-text-muted); }
.ds-account-row__last { font-size: var(--text-xs); white-space: nowrap; }
.ds-account-row--disabled, .ds-account-row--disabled .ds-account-row__sub { color: var(--color-text-disabled); }
.ds-account-switch__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }   /* SC-56: the title and the close button (N-23) */
.ds-account-switch__head .ds-h2 { margin: 0; }
.ds-account-switch__list { margin-top: var(--space-4); }
.ds-account-list__item > .ds-spinner { flex: none; align-self: center; margin-inline-start: var(--space-2); }   /* the chosen row's 16 px spinner during the switch */
.ds-account-list__item:disabled { cursor: default; color: var(--color-text-disabled); }
.ds-shared-signin { margin: 0 0 var(--space-2); font-size: var(--text-xs); font-weight: var(--weight-regular); color: var(--color-text-subtle); }   /* N-23: „Važi za sve vaše naloge.“ under the card title, 12/400 text-subtle */
.ds-other-account { margin-top: var(--space-3); color: var(--color-text-muted); text-align: center; }   /* MA-R11 item 4: the other-account line under a 403, 404 or not-found state */

/* chips and badges */
.ds-chip { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1); min-width: 120px; height: 24px; padding: 0 var(--space-2); border-radius: var(--radius-chip); background: var(--color-surface-2); color: var(--color-text); font-size: var(--text-xs); }
.ds-chip--filter { min-width: 0; height: var(--control-h-sm); padding: 0 var(--space-3); border: 0; }
.ds-chip--filter[aria-pressed="true"] { background: var(--color-surface-3); }
.ds-status { display: inline-flex; align-items: center; gap: var(--space-1); height: 20px; padding: 0 var(--space-2); border-radius: var(--radius-pill); font-size: var(--text-xs); font-weight: var(--weight-semibold); background: var(--tint-neutral); color: var(--color-text-muted); }
.ds-status--info { background: var(--tint-info); color: var(--color-info); }
.ds-status--warning { background: var(--tint-warning); color: var(--color-warning); }
.ds-status--negative { background: var(--tint-negative); color: var(--color-negative); }
.ds-status--positive { background: var(--tint-positive); color: var(--color-positive-strong); }
:is(a, button).ds-status { position: relative; }
:is(a, button).ds-status::before { content: ""; position: absolute; inset: min(0px, calc(50% - var(--target-min) / 2)) 0; }   /* a 20 px badge that is a link or button keeps its look and is a 32 / 44 px target (DESIGN.md 8.7, 14 rule 2) */
.ds-count { display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--radius-pill); background: var(--color-negative); color: var(--color-on-negative); font-size: var(--text-xs); font-weight: var(--weight-bold); }

/* toggle, checkbox */
.ds-toggle { position: relative; display: inline-block; width: 36px; height: 20px; flex: none; border: 0; padding: 0; border-radius: var(--radius-pill); background: var(--color-toggle-off); transition: background-color var(--dur-base) var(--ease); }
.ds-toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--hdr-text); transition: transform var(--dur-base) var(--ease); }   /* the knob is white on both tracks in both themes (DESIGN.md 8.4): hdr-text is white in both */
.ds-toggle[aria-checked="true"] { background: var(--color-primary); }
.ds-toggle[aria-checked="true"]::after { transform: translateX(16px); background: var(--color-on-primary); }   /* AIS-A538: a dark knob on the logo green (8.95:1; white would be 2.28:1) */
.ds-toggle::before { content: ""; position: absolute; inset: calc((20px - var(--target-min)) / 2) min(0px, calc((36px - var(--target-min)) / 2)); }   /* the 36 x 20 pill reaches the target size (32, 44 on touch); its ::after is the knob */
.ds-check { appearance: none; width: 16px; height: 16px; margin: 0; border: 2px solid var(--color-text-subtle); border-radius: var(--radius-xs); background: transparent; display: inline-grid; place-content: center; }
.ds-check:checked { background: var(--color-primary) url("/icons/ui/check-dark.svg") center / 12px no-repeat; border-color: var(--color-primary); }

/* progress, utilization */
.ds-progress { display: flex; height: 20px; border-radius: var(--radius-pill); overflow: hidden; background: var(--color-surface-2); font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--color-on-accent); }
.ds-progress__used { display: grid; place-items: center; background: var(--color-accent); min-width: 2.5rem; }
.ds-progress__rest { display: grid; place-items: center; background: var(--color-accent-strong); flex: 1; }
.ds-progress--warn .ds-progress__used { background: var(--color-warning); }
.ds-bar { height: 6px; border-radius: var(--radius-pill); background: var(--color-surface-2); overflow: hidden; }
.ds-bar__fill { height: 100%; background: var(--color-accent); border-radius: inherit; transition: width var(--dur-slow) var(--ease); }

/* package card: 220-260 x min 320, the price button (32) overlaps the bottom edge by 16 (DESIGN.md 9.1) */
.ds-package { position: relative; display: flex; flex-direction: column; min-height: 320px; padding: var(--space-7) var(--space-4) var(--space-8); border-radius: var(--radius-inner); background: var(--color-surface-1); }
.ds-package__title { text-align: center; font-weight: var(--weight-semibold); text-transform: uppercase; margin-bottom: var(--space-4); }
.ds-package__cta { position: absolute; left: 50%; bottom: -16px; transform: translateX(-50%); width: min(160px, calc(100% - 32px)); }
.ds-package__note { position: absolute; left: 0; right: 0; top: calc(100% + var(--space-8)); text-align: center; }   /* 24 below the button, which ends 16 below the card */

/* data table (app skin): header 32, row 36, compact 32, cell padding 0 12 (DESIGN.md 9.3) */
.ds-table-wrap { position: relative; overflow: auto; max-width: 100%; }   /* relative: the hidden labels of the cells belong to the scroller, they must not widen the page */
.ds-visual .ds-table-wrap:focus-visible { outline-offset: -2px; }   /* the scroll box as a keyboard stop (AIS-V935) keeps the base ring; in a visual, whose body or chart box scrolls with no room around it, the ring is drawn inside (DESIGN.md 15.2 rule 3) */
.ds-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--text-sm); }
.ds-table th { position: sticky; top: 0; z-index: var(--z-sticky); height: var(--table-head-h); padding: 0 var(--space-3); text-align: left; background: var(--color-surface-2); color: var(--color-text-muted); font-size: var(--text-xs); line-height: var(--lh-tight); font-weight: var(--weight-semibold); text-transform: uppercase; letter-spacing: var(--tracking-upper); white-space: nowrap; }
.ds-table td { height: var(--table-row-h); padding: 0 var(--space-3); border-bottom: 1px solid var(--color-border-subtle); color: var(--color-text); }
.ds-table .is-num { text-align: right; font-variant-numeric: tabular-nums; }
.ds-table tbody tr.is-selected { background: var(--color-surface-3); }
@media (hover: hover) { .ds-table tbody tr:hover { background: var(--color-surface-hover-2); } }
.ds-table tfoot td { position: sticky; bottom: 0; background: var(--color-surface-2); font-weight: var(--weight-bold); border-top: 1px solid var(--color-border-strong); }
.ds-table th[aria-sort] { cursor: pointer; }

/* report replica skin: the native report frame is a report card and a dark island (tokens.css, base.css; DESIGN.md 3.6, 9.5a) */
.ds-report { background: var(--color-report-frame); border-radius: var(--radius-card); padding: var(--space-3); overflow: auto; box-shadow: var(--report-shadow); }   /* height from its page grid (fills the viewport) */
.ds-report__tile { background: var(--color-report-panel); border-radius: var(--radius-md); padding: var(--space-3); min-width: 0; }
.ds-report__title { font-size: var(--text-xs); font-weight: var(--weight-bold); margin-bottom: var(--space-2); }
.ds-rtable { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--text-xs); line-height: 16px; color: var(--color-text); }
.ds-rtable th { padding: 3px var(--space-2); background: var(--color-report-header); font-weight: var(--weight-bold); text-align: center; vertical-align: middle; }
.ds-rtable td { padding: 3px var(--space-2); text-align: left; vertical-align: middle; }
.ds-rtable td.is-num { text-align: right; font-variant-numeric: tabular-nums; }
.ds-rtable td:first-child { border-right: 1px solid var(--color-report-divider); }
.ds-rtable tbody tr:nth-child(odd) { background: var(--color-report-frame); }
.ds-rtable tbody tr:nth-child(even) { background: var(--color-report-panel); }
.ds-rtable tfoot td, .ds-rtable .is-total td { font-weight: var(--weight-bold); }

/* chat */
.ds-chat { --chat-inset: 4px; display: flex; flex-direction: column; background: var(--color-surface-1); border-radius: var(--radius-xl); padding: var(--space-3) var(--space-4); min-height: 0; }
.ds-chat__head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: 40px; font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.ds-chat__log { flex: 1; min-height: 0; overflow-y: auto; padding: var(--space-3) var(--chat-inset); font-size: var(--text-chat); line-height: var(--lh-chat); color: var(--color-text-body); hyphens: auto; }
.ds-chat__log h3 { margin: var(--space-3) 0 0; font-size: var(--text-chat); font-weight: var(--weight-bold); color: var(--color-text); }
.ds-msg--user { margin-left: auto; max-width: 80%; width: fit-content; padding: var(--space-2) var(--space-3); border-radius: var(--radius-lg); background: var(--color-surface-2); color: var(--color-text); }
.ds-chat__input { display: flex; align-items: center; gap: var(--space-2); min-height: 56px; padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3); border-radius: var(--radius-chat); background: var(--color-surface-2); }
.ds-chat__input textarea { flex: 1; min-width: 0; padding: 0; resize: none; border: 0; outline: none; background: transparent; color: var(--color-text); font-size: var(--text-chat); line-height: var(--lh-chat); max-height: 9.6rem; }
.ds-chat__input textarea::placeholder { color: var(--color-text-subtle); }
.ds-chat__input:focus-within { outline: 2px solid var(--color-focus-ring); }
.ds-bdot { flex: none; display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--brand-dot); box-shadow: var(--brand-dot-glow); }   /* the brand dot (AIS-517) */
.ds-export-menu { display: contents; }   /* only a handle for the roving focus of the answer toolbar */

/* voice button: state lives in data-state */
.ds-voice { position: relative; display: inline-flex; align-items: center; justify-content: center; width: var(--target-min); height: var(--target-min); flex: none; border: 0; border-radius: 50%; background: transparent; color: var(--color-text-muted); }
@media (hover: hover) { .ds-voice[data-state="idle"]:hover { background: var(--color-surface-hover-2); color: var(--color-text); } }
.ds-voice[data-state="unavailable"] { color: var(--color-text-disabled); }
.ds-voice[data-state="listening"], .ds-voice[data-state="hearing"] { background: var(--color-accent); color: var(--color-on-accent); }
.ds-voice[data-state="listening"]::before, .ds-voice[data-state="listening"]::after,
.ds-voice[data-state="hearing"]::before, .ds-voice[data-state="hearing"]::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--color-accent); opacity: 0; animation: ds-ring 1.2s var(--ease) infinite; }
.ds-voice[data-state="listening"]::after, .ds-voice[data-state="hearing"]::after { animation-delay: 0.6s; }
.ds-voice[data-state="thinking"] { background: var(--color-surface-2); color: var(--color-accent); }
.ds-voice[data-state="speaking"] { background: var(--color-accent-strong); color: var(--color-on-accent); }
.ds-speaking-line { background: var(--color-surface-2); border-radius: var(--radius-xs); }

/* feedback: toast, dialog, drawer, skeleton, spinner */
.ds-toast-host { position: fixed; right: var(--space-4); bottom: var(--space-4); z-index: var(--z-toast); display: flex; flex-direction: column; max-width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.ds-toast-region { display: flex; flex-direction: column; gap: var(--space-2); }   /* the two live regions are always there; empty ones take no room and no clicks */
.ds-toast-region:has(.ds-toast) + .ds-toast-region:has(.ds-toast) { margin-top: var(--space-2); }
.ds-toast-host .ds-toast { pointer-events: auto; }
.ds-toast { display: flex; gap: var(--space-2); padding: var(--space-3); border-radius: var(--radius-md); background: var(--color-surface-3); box-shadow: var(--shadow-overlay); font-size: var(--text-sm); animation: ds-rise var(--dur-slow) var(--ease); }
.ds-scrim { position: fixed; inset: 0; z-index: var(--z-dialog); background: var(--color-scrim); display: grid; place-items: center; padding: var(--space-4); }
.ds-dialog { position: relative; isolation: isolate; width: min(480px, 100%); max-height: 90dvh; overflow: auto; padding: var(--space-5); border-radius: var(--radius-card); background: var(--card-bg); box-shadow: var(--card-shadow); animation: ds-rise var(--dur-slow) var(--ease); }   /* a glass card; its blur layer is the ::before of the surfaces block */
.ds-dialog__actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-5); flex-wrap: wrap; }
.ds-dialog__note { margin: var(--space-3) 0 0; color: var(--color-text-muted); }   /* a muted line under the message (the Microsoft note of a password reset, spec 28 11.4) */
.ds-dialog__list { display: grid; gap: var(--space-2); margin: 0 0 var(--space-3); padding-inline-start: var(--space-5); }   /* the consequences above the message (ending or replacing the Microsoft connection, spec 28 9.7) */
.ds-dialog .ds-field__caption { white-space: normal; }   /* a long caption wraps instead of widening the bottom sheet at 320-390 px (AIS-149) */
/* the large variant of the notification editor (DESIGN N-19 dialog-large; DialogHost unchanged): a fixed header and footer around a scrolling body; the editor root
   fills the surface, so a click on empty dialog space focuses the root and its Esc handling sees the key */
.ds-dialog:has(> .ds-dialog-large) { display: flex; width: min(1120px, 100vw - 64px); height: min(880px, 100vh - 64px); max-width: none; max-height: none; padding: 0; overflow: hidden; }
.ds-dialog-large { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; }
.ds-dialog-large__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-5) var(--space-5) var(--space-3); }
.ds-dialog-large__head .ds-h2 { margin: 0; }
.ds-dialog-large__body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-1) var(--space-5) var(--space-4); }
.ds-dialog-large__foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-5) var(--space-5); border-top: 1px solid var(--color-border-subtle); }
.ds-dialog-large__push { margin-inline-start: auto; }
.ds-dialog-large__question { flex: 1 1 auto; margin: 0; }
.ds-dialog--full { display: flex; flex-direction: column; width: min(1600px, 100vw - 32px); height: calc(100vh - 32px); max-width: none; max-height: none; padding: 0; overflow: hidden; overflow: clip; }   /* dialog-full (DESIGN.md N-21, 13 section 3): the data map only; the actions sit in its header, no footer */
.ds-dialog-full__head { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); padding: var(--space-5) var(--space-5) var(--space-3); }   /* one column the width of the dialog: a long title or tab strip wraps or scrolls inside it */
.ds-dialog-full__body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding: 0 var(--space-5) var(--space-5); }   /* each pane inside scrolls on its own */
.ds-dialog-full__bar { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: var(--space-2); padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom)); border-top: 1px solid var(--color-border-subtle); background: var(--color-surface-1); }   /* below 768 px: Sačuvaj primary at the end, the other actions in the overflow menu */
.ds-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: var(--z-drawer); width: min(480px, 100vw); padding: var(--space-5); background: var(--card-bg); border-radius: var(--radius-card) 0 0 var(--radius-card); box-shadow: var(--card-shadow); overflow: auto; animation: ds-slide var(--dur-slow) var(--ease); }   /* a glass card, radius on its free side */
.ds-menu { min-width: 200px; padding: var(--space-1); border-radius: var(--radius-md); background: var(--color-surface-3); box-shadow: var(--shadow-overlay); }
.ds-menu [role="menuitem"], .ds-menu [role="menuitemradio"] { display: flex; align-items: center; gap: var(--space-2); min-height: var(--target-min); padding: 0 var(--space-3); border-radius: var(--radius-chip); }
@media (hover: hover) { .ds-menu [role="menuitem"]:hover, .ds-menu [role="menuitemradio"]:hover { background: var(--color-surface-hover-2); } }
/* the shimmer is a translucent veil of the border tokens, so it differs from whatever it stands on (content panel, surface-1 card, glass card; 1.2:1 at rest and 1.5:1 at the highlight in both themes); it appears after 300 ms, no flash for a fast load (DESIGN.md 13) */
.ds-skeleton { border-radius: var(--radius-md); background: linear-gradient(90deg, var(--color-border-subtle), var(--color-border-strong), var(--color-border-subtle)); background-size: 200% 100%; animation: ds-shimmer 1.4s linear infinite, ds-delay-show 1ms linear 300ms backwards; }
.ds-spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--color-surface-3); border-top-color: var(--color-accent); animation: ds-spin 0.8s linear infinite; }
.ds-empty { display: grid; justify-items: center; gap: var(--space-3); padding: var(--space-7) var(--space-4); text-align: center; }
.ds-empty p { max-width: 420px; color: var(--color-text-muted); }
.ds-alert { display: flex; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--tint-negative); color: var(--color-negative); font-size: var(--text-sm); }
.ds-alert--warning { background: var(--tint-warning); color: var(--color-warning); }
.ds-alert--info { background: var(--tint-info); color: var(--color-info); }
.ds-unsaved { margin-top: var(--space-3); flex-wrap: wrap; align-items: center; }   /* AIS-A527 K1: the unsaved-changes line of a dialog or drawer */
.ds-drawer > .ds-unsaved { margin: var(--space-3) var(--space-5) 0; }
.ds-unsaved__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-left: auto; }
.ds-offline-bar { padding: 6px var(--gutter); background: var(--tint-warning); color: var(--color-warning); font-size: var(--text-xs); text-align: center; }

/* contact screen: slanted surface-2 shape behind the content */
.ds-contact { position: relative; min-height: 480px; }
.ds-contact__shape { position: absolute; inset: 0; background: var(--color-surface-2); border-radius: var(--radius-inner) 0 0 var(--radius-inner); clip-path: polygon(0 0, 32.3% 0, 51.4% 100%, 0 100%); }
/* the slanted layout needs a panel wide enough for the 360 px information column under the 32.3 % top edge and the 480 px form beside it, a viewport of about 1600 px
   (with the 232 px sidebar the panel at 1440 is about 1100 px wide); below that the shape is a plain card above the form (13 section 5.3) */
@media (max-width: 1599px) { .ds-contact__shape { position: static; clip-path: none; border-radius: var(--radius-inner); padding: var(--space-5); } }

/* keyframes */
@keyframes ds-spin { to { transform: rotate(360deg); } }
@keyframes ds-shimmer { to { background-position: -200% 0; } }
@keyframes ds-bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-4px); } }
@keyframes ds-ring { 0% { transform: scale(1); opacity: 0.35; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes ds-pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes ds-rise { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ds-slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* high contrast / forced colours */
@media (forced-colors: active) {
  .ds-card, .ds-workspace, .ds-panel, .ds-field, .ds-btn, .ds-tile, .ds-chip, .ds-chat__input { border: 1px solid CanvasText; }
  .ds-tile[aria-checked="true"], .ds-sidebar__item[aria-current="page"], .ds-segmented__item[aria-selected="true"], .ds-segmented__item[aria-pressed="true"] { outline: 2px solid Highlight; }   /* the pill has no fill here */
}
@media (max-width: 767px) {
  .ds-toast-host { left: var(--space-4); right: var(--space-4); top: calc(env(safe-area-inset-top) + var(--space-3)); bottom: auto; max-width: none; }
  .ds-scrim:has(> .ds-dialog) { padding: 0; place-items: end stretch; }   /* a dialog is a bottom sheet: edge to edge, anchored to the bottom (DESIGN.md 14.1, N-16) */
  .ds-dialog { align-self: end; width: 100%; padding-bottom: calc(var(--space-5) + env(safe-area-inset-bottom)); border-radius: var(--radius-card) var(--radius-card) 0 0; }
  .ds-dialog:has(> .ds-dialog-large) { align-self: stretch; width: 100vw; height: 100dvh; border-radius: 0; }
  .ds-dialog.ds-dialog--full { align-self: stretch; width: 100vw; height: 100dvh; padding-bottom: 0; border-radius: 0; }   /* dialog-full: full screen, radius 0, the sticky action bar at the bottom */
  .ds-dialog-full__head { padding: var(--space-4) var(--space-4) var(--space-2); }
  .ds-dialog-full__body { padding: 0 var(--space-4) var(--space-3); }
  .ds-dialog-large__foot .ds-btn { flex: 1 1 0; }
  .ds-dialog-large__question { flex-basis: 100%; }
  .ds-drawer { width: 100vw; border-radius: 0; }
  .ds-chat__input { padding-bottom: calc(var(--space-2) + env(safe-area-inset-bottom)); }
}

/* added by the shell ticket: parts of the Tier-F components that the delivered rules do not cover -------------- */
.ds-icon, .ds-feature-icon { flex: none; }
.ds-formfield { display: grid; }
.ds-field__control { position: relative; display: flex; align-items: center; }
.ds-field__control .ds-field__input { width: 100%; padding-right: var(--target-min); }   /* no 211 px minimum from the input's default size (AIS-149, 320 px) */
/* the show/hide button is centred on the right end of the stacked field (the control row sits 4 px above the field's bottom edge, inside its 12 px inset) */
.ds-field__reveal { position: absolute; right: calc((var(--field-stacked-h) - var(--target-min)) / 2 - var(--space-3)); bottom: calc((var(--field-stacked-h) - var(--target-min)) / 2 - var(--space-1)); }
.ds-empty__title { font-size: var(--text-lg); line-height: 1.5; font-weight: var(--weight-semibold); }
h1.ds-empty__title { font-size: var(--text-xl); line-height: 1.4; }   /* the system pages: heading-1 20/28 (18/26 on phones), DESIGN.md 4.1 */
@media (max-width: 767px) { h1.ds-empty__title { font-size: var(--text-login); line-height: 1.44; } }
.ds-empty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-3); margin-top: var(--space-2); }
.ds-empty[data-density="page"] { padding-block: var(--space-8); }
.ds-alert { align-items: flex-start; }
.ds-alert > svg { margin-top: 2px; }
.ds-alert__text { flex: 1; min-width: 0; }
@media (max-width: 767px) { .ds-alert { flex-wrap: wrap; } .ds-alert__text { flex: 1 1 calc(100% - 28px); } .ds-alert .ds-alert__link { margin-left: 0; } }   /* phones: the actions wrap under the text instead of squeezing it */
.ds-btn svg { flex: none; }
.ds-chip .ds-icon-btn { width: 32px; height: 32px; margin: calc(-1 * var(--space-1)) calc(-1 * var(--space-2)) calc(-1 * var(--space-1)) calc(-1 * var(--space-1)); color: var(--color-text-muted); }   /* the remove button of a 24 px chip reaches 4 px past it: 32 px at every pointer, not the touch token (DESIGN.md 14 E-1: the chip rows wrap 8 px apart, so the targets touch and never overlap) */
.ds-chip--filter { cursor: pointer; }
.ds-hero-blob { display: block; width: 300px; max-width: 100%; height: auto; }
.ds-tenant-logo { display: block; width: auto; max-width: 146px; height: 32px; }
.ds-tenant-wordmark { font-size: var(--text-lg); line-height: 1.2; font-weight: var(--weight-semibold); color: var(--color-text); white-space: nowrap; }
.ds-avatar { display: inline-grid; place-items: center; }
.ds-avatar__head { fill: var(--color-text); }
.ds-avatar__body { fill: var(--color-accent); }
.ds-avatar__spark { fill: var(--color-negative); }
.ds-brand-logo { position: relative; display: inline-block; }
.ds-brand--text { display: inline-flex; align-items: baseline; width: auto; height: auto; font-size: var(--text-display); line-height: 1; font-weight: var(--weight-bold); letter-spacing: -0.02em; }
.ds-brand__period { display: inline-block; width: 0.28em; height: 0.28em; margin-left: 0.08em; border-radius: 50%; background: var(--brand-green); }
.ds-brand__dot { fill: var(--brand-green); }   /* AIS-A538: exactly the logo dot */
.ds-brand-logo--login .ds-brand { width: 198px; height: 93px; }   /* the login mark with its powered-by lines drawn in the same SVG: the smallest size that keeps them at the 12 px floor (DESIGN.md 4.1, 7.3) */
.ds-brand-logo--compact .ds-brand { width: 64px; height: 32px; }   /* the other card pages: the top-bar size of the mark */
.ds-tooltip-wrap { position: relative; display: inline-flex; }
:where(button.ds-tooltip-wrap) { margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: default; }   /* the named trigger of an icon tooltip looks like the span one */
.ds-tooltip { position: absolute; left: 50%; top: calc(100% + 6px); z-index: var(--z-toast); width: max-content; max-width: 260px; padding: var(--space-1) var(--space-2); border-radius: var(--radius-xs); background: var(--color-surface-3); color: var(--color-text); font-size: var(--text-xs); line-height: 1.4; transform: translateX(-50%); visibility: hidden; opacity: 0; pointer-events: none; transition: opacity var(--dur-fast) var(--ease); }
@media (hover: hover) { .ds-tooltip-wrap:hover > .ds-tooltip { visibility: visible; opacity: 1; transition-delay: var(--tooltip-delay, 400ms); } }   /* a tap focuses the trigger, so :focus-within below opens the tip on touch */
.ds-tooltip-wrap:focus-within > .ds-tooltip { visibility: visible; opacity: 1; transition-delay: 0ms; }
.ds-tooltip-wrap[data-dismissed] > .ds-tooltip { visibility: hidden; opacity: 0; transition-delay: 0ms; }
.ds-tabstrip { display: flex; gap: var(--space-6); box-shadow: inset 0 -1px 0 var(--color-border-subtle); }   /* the 1 px rule under the row; the indicator of the current tab sits on it */
/* segmented tabs: the well with the raised pill, derived from the domain well (DESIGN.md 8.5, 12.00 rule 5) */
.ds-segmented { display: inline-flex; gap: 2px; max-width: 100%; padding: 3px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; border-radius: var(--radius-xl); background: var(--well-bg); box-shadow: var(--well-shadow); --ds-fade: 28px; --ds-fade-start: 0px; --ds-fade-end: 0px; }   /* one track: where the items do not fit it scrolls sideways, never wraps (DESIGN.md 8.5); the edge fade is drawn from data-more-start / data-more-end, which TabStrip keeps current (ui.js revealCurrent) */
.ds-segmented::-webkit-scrollbar { display: none; }
.ds-segmented[data-more-start="true"] { --ds-fade-start: var(--ds-fade); }
.ds-segmented[data-more-end="true"] { --ds-fade-end: var(--ds-fade); }
.ds-segmented:is([data-more-start="true"], [data-more-end="true"]) { -webkit-mask-image: linear-gradient(90deg, transparent, var(--color-text) var(--ds-fade-start), var(--color-text) calc(100% - var(--ds-fade-end)), transparent); mask-image: linear-gradient(90deg, transparent, var(--color-text) var(--ds-fade-start), var(--color-text) calc(100% - var(--ds-fade-end)), transparent); }
.ds-segmented__item { position: relative; display: inline-flex; flex: none; align-items: center; justify-content: center; gap: var(--space-1); min-width: 80px; min-height: var(--control-h-md); padding: 0 var(--space-3); border: 0; border-radius: var(--radius-seg); background: transparent; color: var(--color-text-muted); font-size: var(--text-sm); font-weight: var(--weight-medium); text-decoration: none; white-space: nowrap; }   /* 32 high (44 on touch); the track 38 / 50 with its 3 px inset; a label stays on one line */
.ds-segmented__item::before { content: ""; position: absolute; inset: -3px 0; }   /* the hit area covers the track's 3 px inset: each item's target is as high as the track (DESIGN.md 8.5, 14) */
.ds-segmented__item:focus-visible { outline-offset: -2px; }   /* the ring inside the item: the scrolling track never clips it (DESIGN.md 15.2 rule 3) */
@media (hover: hover) { .ds-segmented__item:hover { color: var(--color-text); } }
.ds-segmented__item[aria-selected="true"], .ds-segmented__item[aria-pressed="true"] { background: var(--pill-bg); color: var(--pill-text); box-shadow: var(--pill-shadow); font-weight: var(--weight-semibold); }
.ds-toast { align-items: center; }
.ds-toast__text { flex: 1; min-width: 0; }
.ds-toast__action { color: var(--color-accent); font-weight: var(--weight-semibold); text-decoration: underline; }
.ds-toast--error > .ds-icon { color: var(--color-negative); }   /* the glyph carries the status; the text stays text (light negative on surface-3 is 4.30:1, DESIGN.md 3.5) */
.ds-toast--warning { color: var(--color-warning); }
.ds-toast .ds-icon-btn { margin: calc(-1 * var(--space-2)) calc(-1 * var(--space-2)) calc(-1 * var(--space-2)) 0; }
.ds-h2 { margin-bottom: var(--space-3); }
.ds-brand__powered-name { text-transform: uppercase; }
.ds-brand-logo__powered { display: block; margin-top: var(--space-1); font-size: var(--text-xs); color: var(--color-text); }
.ds-brand-logo__powered strong { font-weight: var(--weight-bold); }
h1[tabindex="-1"]:focus, main[tabindex="-1"]:focus { outline: none; }

/* shared form controls (AIS-17): label/value list, text area, select, checkbox, radio, range, search ------------- */
.ds-pair-list { margin: 0; padding: 0; }
.ds-pair__label, .ds-pair__value { margin: 0; overflow-wrap: anywhere; }
@media (min-width: 640px) { .ds-pair--inline { grid-template-columns: minmax(8rem, 30%) minmax(0, 1fr); align-items: baseline; gap: var(--space-4); } }
.ds-field__counter { align-self: flex-end; margin-top: var(--space-1); font-size: var(--text-xs); font-variant-numeric: tabular-nums; color: var(--color-text-muted); }
.ds-select-wrap { position: relative; display: flex; flex: 1; align-items: center; min-width: 0; }
.ds-select { appearance: none; padding-right: 28px; cursor: pointer; text-overflow: ellipsis; }
.ds-select option, .ds-select optgroup { background: var(--color-surface-3); color: var(--color-text); }
.ds-select:disabled { opacity: 1; color: var(--color-text-muted); cursor: not-allowed; }   /* the value is text a person reads: never text-disabled (DESIGN.md 15.1), and the browser's own 0.7 dimming is off */
/* a bare select (no .ds-field around it) draws its own ring; inside a .ds-field the field's :focus-within ring is the one (03 section 6, H-27 HA-3) */
.ds-select:focus-visible { outline: 2px solid var(--color-focus-ring); outline-offset: 2px; }
.ds-field .ds-select:focus-visible { outline: none; }
.ds-select__chevron { position: absolute; right: 0; pointer-events: none; color: var(--color-text-muted); }
.ds-checkbox { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--target-min); color: var(--color-text); font-size: var(--text-sm); cursor: pointer; }
.ds-checkbox:has(input:disabled) { color: var(--color-text-muted); cursor: not-allowed; }   /* the label is read, so text-muted (15.1); the dim box (.ds-check:disabled) and the cursor say it cannot change */
.ds-check:disabled { border-color: var(--color-text-disabled); }
.ds-radio-group { display: grid; gap: var(--space-1); min-width: 0; margin: 0; padding: 0; border: 0; }
/* 02 section 15.8: an area that is read-only while signed in as a user; the disabled fieldset disables every control inside and adds no box of its own,
   so the layout of its parent applies to its children */
.ds-fieldset-plain { display: contents; min-width: 0; margin: 0; padding: 0; border: 0; }
.ds-radio-group--inline { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-6); }
.ds-radio-item { display: flex; align-items: flex-start; gap: var(--space-2); min-height: var(--target-min); padding-block: 6px; color: var(--color-text); font-size: var(--text-sm); line-height: var(--lh-body); cursor: pointer; }   /* a one-line item is 32 high (44 on touch) */
.ds-radio-item:has(input:disabled) { color: var(--color-text-disabled); cursor: not-allowed; }
.ds-radio-item__text { display: grid; gap: 2px; }
.ds-radio-item__description { font-size: var(--text-xs); line-height: 1.4; color: var(--color-text-muted); }
.ds-radio { appearance: none; flex: none; width: 16px; height: 16px; margin: 2px 0 0; border: 2px solid var(--color-text); border-radius: 50%; background: transparent; display: inline-grid; place-content: center; }
.ds-radio::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--color-primary-text); transform: scale(0); transition: transform var(--dur-fast) var(--ease); }
.ds-radio:checked::before { transform: scale(1); }
.ds-radio:disabled { border-color: var(--color-text-disabled); }
.ds-range-field { display: flex; align-items: center; gap: var(--space-3); min-height: var(--target-min); }
.ds-range-field__value { min-width: 3.5rem; text-align: right; font-size: var(--text-sm); font-variant-numeric: tabular-nums; color: var(--color-text); }
.ds-range { flex: 1; min-width: 0; height: var(--target-min); margin: 0; background: transparent; appearance: none; -webkit-appearance: none; cursor: pointer; }
.ds-range:disabled { cursor: not-allowed; opacity: 0.4; }
.ds-range::-webkit-slider-runnable-track { height: 2px; border-radius: var(--radius-pill); background: var(--color-text-subtle); }
.ds-range::-moz-range-track { height: 2px; border-radius: var(--radius-pill); background: var(--color-text-subtle); }
.ds-range::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -6px; border: 0; border-radius: 50%; background: var(--color-primary-text); }
.ds-range::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--color-primary-text); }
.ds-field.ds-search, .ds-field.ds-chip-editor__field { flex-direction: row; align-items: center; min-height: var(--control-h-md); padding: 0 0 0 var(--space-3); border-radius: var(--radius-field-sm); }   /* the clear button sits in the right end */
.ds-field.ds-search { gap: var(--space-2); }   /* the icon keeps its 8 px from the text below 640 px too, where the inline field pattern drops its gap */
.ds-search .ds-icon { color: var(--color-text-muted); }
.ds-search input::-webkit-search-cancel-button { appearance: none; display: none; }

/* shared overlays and lists (AIS-17): drawer, chip list, file drop zone ------------------------------------------- */
.ds-scrim--drawer { display: block; padding: 0; }
.ds-drawer { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.ds-drawer__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); padding: var(--space-5) var(--space-4) var(--space-3) var(--space-5); }   /* padding 20; the close button's own inset makes up the right */
.ds-drawer__titles { min-width: 0; }
.ds-drawer__title { font-size: var(--text-lg); line-height: 1.5; font-weight: var(--weight-semibold); overflow-wrap: anywhere; }   /* heading-2 16/24 600 */
.ds-drawer__subtitle { margin-top: var(--space-1); font-size: var(--text-sm); color: var(--color-text-muted); }
.ds-drawer__subtitle-badge { margin-left: var(--space-2); }
.ds-drawer__body { flex: 1; min-height: 0; padding: var(--space-1) var(--space-5) var(--space-5); overflow-y: auto; }
.ds-drawer__footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2); padding: var(--space-3) var(--space-5); border-top: 1px solid var(--color-border-subtle); background: var(--color-surface-1); }
.ds-chip-list { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.ds-chip--muted { color: var(--color-text-muted); }
.ds-chip--more { min-width: 0; }
.ds-chip--info { min-width: 0; background: var(--tint-info); color: var(--color-info); }   /* the free-query marker (spec 47 10.3): the info tint of the status badge, the 24 px chip shape */
.ds-chip-editor { display: grid; gap: var(--space-3); }
.ds-chip-editor__add { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.ds-chip-editor__add .ds-field { flex: 1 1 14rem; }
.ds-field.ds-chip-editor__field { align-items: center; min-height: var(--control-h-md); padding: 0 var(--space-3); border-radius: var(--radius-field-sm); }
.ds-dropzone { position: relative; display: grid; justify-items: center; align-content: center; gap: var(--space-2); min-height: 96px; padding: var(--space-4); border: 2px dashed var(--color-border-strong); border-radius: var(--radius-inner); background: var(--color-surface-2); color: var(--color-text); text-align: center; transition: background-color var(--dur-fast) var(--ease); }
@media (hover: hover) { .ds-dropzone:hover:not([data-busy="true"]) { background: var(--color-surface-hover-2); } }
.ds-dropzone:focus-within { outline: 2px solid var(--color-focus-ring); outline-offset: 2px; }
.ds-dropzone[data-busy="true"] { cursor: not-allowed; opacity: 0.7; }
.ds-dropzone__input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.ds-dropzone__input:disabled { cursor: not-allowed; }
.ds-dropzone__body { display: grid; justify-items: center; gap: var(--space-2); pointer-events: none; }
.ds-dropzone__hint { font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-dropzone__rows { display: grid; gap: var(--space-2); margin: var(--space-3) 0 0; padding: 0; list-style: none; font-size: var(--text-sm); }
.ds-dropzone__row { display: grid; gap: var(--space-1); }
.ds-dropzone__name { overflow-wrap: anywhere; }
.ds-dropzone__error { display: flex; gap: var(--space-2); font-size: var(--text-xs); color: var(--color-negative); }
.ds-bar__fill--indeterminate { width: 100%; background: linear-gradient(90deg, var(--color-surface-3), var(--color-accent), var(--color-surface-3)); background-size: 200% 100%; animation: ds-shimmer 1.4s linear infinite; }
@media (forced-colors: active) { .ds-drawer, .ds-dropzone, .ds-search, .ds-chip-editor__field { border: 1px solid CanvasText; } }

/* shared data display (AIS-17): data table extras, filter bar, pager ----------------------------------------------- */
.ds-datatable { min-width: 0; }
.ds-table-toolbar { margin-bottom: var(--space-3); }
.ds-table--compact td { height: var(--table-row-compact-h); }
@media (pointer: coarse), (max-width: 767px) { .ds-table--compact tbody tr:has(.ds-btn--sm) { --table-row-compact-h: var(--touch-min); } }   /* row pitch (DESIGN.md 14): a row with sm buttons is as tall as their 44 px hit areas, so adjacent rows touch and never overlap; a stacked card (td height: auto) is unchanged */
.ds-table--static-header th { position: static; }
.ds-table__primary { font-weight: var(--weight-semibold); }
.ds-table__actions { text-align: right; white-space: nowrap; }
.ds-table__row--clickable { cursor: pointer; }
/* the row button (13 section 4.1, H-27 HA-5): the row's Tab stop and name, drawn as the cell content it wraps */
.ds-table__rowbutton { display: block; width: 100%; margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; line-height: inherit; letter-spacing: inherit; text-align: inherit; text-transform: inherit; cursor: pointer; }
.ds-table tbody tr.is-selected > td:first-child, .ds-rtable tbody tr.is-selected > td:first-child { box-shadow: inset 3px 0 0 var(--color-accent); }   /* the selected row is not told by colour alone */
.ds-table td.ds-table__empty { height: auto; border-bottom: 0; }
.ds-table__sort { display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--target-min); padding: 0; border: 0; background: transparent; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; text-align: inherit; cursor: pointer; }
@media (hover: hover) { .ds-table__sort:hover { color: var(--color-text); } }
.ds-table__caret--idle { opacity: 0.4; }
.ds-table--sticky-first th:first-child, .ds-table--sticky-first td:first-child { position: sticky; left: 0; }
.ds-table--sticky-first th:first-child { z-index: calc(var(--z-sticky) + 1); }
.ds-table--sticky-first td:first-child { background: var(--table-surface, var(--color-surface-1)); }
.ds-table--sticky-first tbody tr.is-selected td:first-child { background: var(--color-surface-3); }
@media (hover: hover) { .ds-table--sticky-first tbody tr:hover td:first-child { background: var(--color-surface-hover-2); } }
@media (max-width: 639px) { .ds-col-hide-640 { display: none; } }
@media (max-width: 767px) { .ds-col-hide-768 { display: none; } }
@media (max-width: 1099px) { .ds-col-hide-1100 { display: none; } }
@media (max-width: 1279px) { .ds-col-hide-1280 { display: none; } }
@media (max-width: 639px) {
  .ds-table--stack, .ds-table--stack tbody, .ds-table--stack tfoot, .ds-table--stack tr, .ds-table--stack td { display: block; }
  .ds-table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ds-table--stack tbody tr, .ds-table--stack tfoot tr { margin-bottom: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--color-surface-2); }
  .ds-table--stack td { display: flex; justify-content: space-between; gap: var(--space-4); height: auto; padding: var(--space-2) 0; border-bottom: 0; text-align: right; }
  .ds-table--stack td::before { content: attr(data-label); flex: none; font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-upper); text-align: left; text-transform: uppercase; color: var(--color-text-muted); }
  .ds-table--stack td.ds-table__primary { display: block; text-align: left; }
  .ds-table--stack td.ds-table__primary::before, .ds-table--stack td.ds-table__actions::before, .ds-table--stack td.ds-table__empty::before { content: none; }
  .ds-table--stack td.ds-table__actions { justify-content: flex-end; }
  .ds-table--stack.ds-table--sticky-first th:first-child, .ds-table--stack.ds-table--sticky-first td:first-child { position: static; background: transparent; }
  .ds-table--stack td > .ds-table__rowbutton { flex: 1 1 auto; width: auto; min-width: 0; }   /* beside the header label of a stacked cell */
  .ds-table--stack tbody tr.is-selected { box-shadow: inset 3px 0 0 var(--color-accent); }   /* a stacked row is a card: the bar is on the card */
  .ds-table--stack tbody tr.is-selected > td:first-child { box-shadow: none; }
}
.ds-filterbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-3); }
.ds-filterbar__filters, .ds-filterbar__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); min-width: 0; }   /* toolbar items 8 px apart */
.ds-filterbar__filters { flex: 1 1 auto; }
.ds-filterbar__filters > .ds-formfield { grid-template-columns: minmax(0, 1fr); min-width: 0; max-width: 100%; }   /* a select with long options shrinks on a phone instead of widening the page */
.ds-filterbar__filters .ds-select { min-width: 0; }
/* AIS-525: filters that belong together (a date range) wrap as one group; on a phone the group itself may wrap */
.ds-filterbar__group { display: flex; flex-wrap: nowrap; align-items: center; gap: var(--space-2); min-width: 0; max-width: 100%; }
.ds-filterbar__group > .ds-formfield { grid-template-columns: minmax(0, 1fr); min-width: 0; }
@media (max-width: 479px) { .ds-filterbar__group { flex-wrap: wrap; } }
.ds-pager { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-2); padding-top: var(--space-3); font-size: var(--text-sm); font-variant-numeric: tabular-nums; color: var(--color-text-muted); }
.ds-pager__range { margin-right: var(--space-2); }
@keyframes ds-delay-show { from { opacity: 0; } to { opacity: 1; } }

/* report components I (AIS-18): report table skin, expander, signed values, KPI card, sparkline, date range ---------- */
.ds-table-error { margin-bottom: var(--space-3); }
.ds-table-footer { margin-top: var(--space-3); }
.ds-table tr[data-child-of] > td:first-child { padding-inline-start: calc(var(--space-3) + 16px); }
.ds-rtable tr[data-child-of] > td:first-child { padding-inline-start: 24px; }
.ds-rtable th[aria-sort="ascending"]::after, .ds-rtable th[aria-sort="descending"]::after { content: ""; display: block; width: 0; height: 0; margin: 2px auto 0; border-inline: 4px solid transparent; }
.ds-rtable th[aria-sort="ascending"]::after { border-bottom: 5px solid currentColor; }
.ds-rtable th[aria-sort="descending"]::after { border-top: 5px solid currentColor; }
.ds-rtable__sort { position: relative; display: inline-block; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: center; cursor: pointer; }
.ds-rtable__sort::before { content: ""; position: absolute; inset: min(0px, calc(50% - 12px)); }   /* at least 24 x 24 on a fine pointer through a hit area, so the 22 px header row keeps its height (DESIGN.md 14 E-2) */
.ds-rtable td.ds-table__empty { text-align: center; border-right: 0; }
.ds-rtable .is-total { background: var(--color-report-panel); }
.ds-rtable .is-total td { border-top: 1px solid var(--color-report-divider); }
.ds-rtable--sticky-header th { position: sticky; top: 0; z-index: var(--z-sticky); }
.ds-rtable--sticky-first th:first-child, .ds-rtable--sticky-first td:first-child { position: sticky; left: 0; }
.ds-rtable--sticky-first td:first-child { background: inherit; }
.ds-rtable--sticky-first th:first-child { z-index: calc(var(--z-sticky) + 1); }
@media (pointer: coarse) { .ds-rtable__sort { min-width: var(--touch-min); min-height: var(--touch-min); } }
.ds-expander { position: relative; display: inline-block; flex: none; width: 12px; height: 12px; margin-inline-end: 6px; padding: 0; vertical-align: -1px; border: 1px solid var(--color-text-muted); border-radius: 0; background: transparent; color: var(--color-text-muted); cursor: pointer; }
.ds-expander::before { content: "+"; position: absolute; inset: 0; display: grid; place-items: center; font-size: var(--text-count); line-height: 1; }
.ds-expander[aria-expanded="true"]::before { content: "\2212"; }
.ds-expander::after { content: ""; position: absolute; inset: calc(50% - 11px); }   /* 22 x 22 around the box's centre whatever its border renders at: the height of a one-line report row, so the expanders of adjacent rows touch and never overlap (DESIGN.md 14 E-2) */
.ds-expander__spinner { display: inline-block; width: 12px; height: 12px; margin-inline-end: 6px; vertical-align: -2px; border-width: 1.5px; }
/* under a coarse pointer and on phones the hit area is 44 wide and stays 22 high (DESIGN.md 14 E-2) */
@media (pointer: coarse), (max-width: 767px) { .ds-expander::after { inset: calc(50% - 11px) calc(50% - 22px); } }
@media (hover: hover) { .ds-expander:hover { color: var(--color-text); border-color: var(--color-text); } }

.ds-delta { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ds-delta-badge { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ds-delta-badge svg { width: 12px; height: 12px; }

.ds-kpi { align-items: flex-start; display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; background: var(--color-surface-1); }
.ds-kpi--surface-2 { background: var(--color-surface-2); }
.ds-kpi__label { font-size: var(--text-xs); line-height: 1.5; color: var(--color-text-muted); }
.ds-kpi__value { font-size: var(--text-kpi); line-height: 1.27; font-weight: var(--weight-bold); color: var(--color-text); overflow-wrap: anywhere; }
.ds-kpi__delta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.ds-kpi__period, .ds-kpi__caption { font-size: var(--text-xs); line-height: 1.5; color: var(--color-text-muted); }
.ds-kpi__compare { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); font-size: var(--text-xs); line-height: 1.5; color: var(--color-text-muted); }   /* one comparison line (64 section 5.2 item 3) */
.ds-spark { display: block; overflow: visible; }
.ds-spark__line { fill: none; stroke: var(--color-text-muted); stroke-width: 2px; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ds-spark__dot { fill: var(--color-accent); }

.ds-datebox-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.ds-datebox-field__legend { margin-bottom: var(--space-1); padding: 0; border-bottom: 1px solid var(--color-text-muted); font-size: var(--text-xs); font-weight: var(--weight-bold); }
.ds-datebox-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); }
.ds-datebox-item { position: relative; display: inline-flex; align-items: center; gap: 2px; }
.ds-datebox { box-sizing: content-box; width: 9.5ch; min-width: 62px; height: 22px; padding: 0 var(--space-1); border: 1px solid var(--color-report-divider); border-radius: 3px; background: var(--color-surface-1); color: var(--color-text); font-size: var(--text-xs); text-align: center; font-variant-numeric: tabular-nums; }   /* content-box: 22 + 2 x 1 px border = 24 outside, the E-2 minimum (DESIGN.md 14) */
.ds-datebox[aria-invalid="true"] { border-color: var(--color-negative); box-shadow: inset 0 0 0 0.5px var(--color-negative); }   /* 1.5 px with the border; the :focus-visible ring stays */
.ds-datebox:disabled { color: var(--color-text-disabled); cursor: not-allowed; }
.ds-datebox-item .ds-icon-btn { width: 28px; height: 28px; }
.ds-datebox-item .ds-icon-btn svg { width: 16px; height: 16px; }
@media (pointer: coarse) { .ds-datebox-item .ds-icon-btn { width: var(--touch-min); height: var(--touch-min); } }
.ds-datebox-slider { position: relative; height: var(--target-min); }
.ds-datebox-slider__track { position: absolute; left: 22px; right: 22px; top: 50%; height: 2px; transform: translateY(-50%); background: var(--color-text-muted); }
.ds-datebox-slider__thumb { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; background: transparent; appearance: none; -webkit-appearance: none; pointer-events: none; }
.ds-datebox-slider__thumb::-webkit-slider-runnable-track { height: 100%; background: transparent; }
.ds-datebox-slider__thumb::-moz-range-track { height: 100%; background: transparent; }
.ds-datebox-slider__thumb::-webkit-slider-thumb { -webkit-appearance: none; box-sizing: content-box; width: 14px; height: 14px; border: 15px solid transparent; border-radius: 50%; background: var(--color-text); background-clip: padding-box; pointer-events: auto; cursor: pointer; }
.ds-datebox-slider__thumb::-moz-range-thumb { box-sizing: content-box; width: 14px; height: 14px; border: 15px solid transparent; border-radius: 50%; background: var(--color-text); background-clip: padding-box; pointer-events: auto; cursor: pointer; }
.ds-datebox-slider__thumb:focus-visible { outline: none; }
.ds-datebox-slider__thumb:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--color-focus-ring); outline-offset: -15px; }
.ds-datebox-slider__thumb:focus-visible::-moz-range-thumb { outline: 2px solid var(--color-focus-ring); outline-offset: -15px; }
.ds-datebox-slider__thumb:disabled::-webkit-slider-thumb { background: var(--color-text-disabled); background-clip: padding-box; cursor: not-allowed; }
.ds-datebox-slider__thumb:disabled::-moz-range-thumb { background: var(--color-text-disabled); background-clip: padding-box; cursor: not-allowed; }
@media (forced-colors: active) { .ds-delta-badge, .ds-expander, .ds-datebox { border: 1px solid CanvasText; } }

/* report components II (AIS-19): report frame and tiles, slicers, charts, how calculated, source chip ------------------- */
.ds-report__body { display: grid; gap: var(--space-3); margin-top: var(--space-3); }
@media (max-width: 1099px) { .ds-report { max-height: 100%; } }
.ds-report__tile { display: flex; flex-direction: column; gap: var(--space-2); }
.ds-report__tile[data-state="loading"], .ds-report__tile[data-state="empty"], .ds-report__tile[data-state="error"] { min-height: 8rem; }
.ds-report__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-2); }
.ds-report__title { margin: 0; line-height: 1.5; }
.ds-report__title-actions { display: flex; flex: none; align-items: center; gap: var(--space-1); }
.ds-report__skeleton { flex: 1; min-height: 6rem; }
.ds-report__empty { display: grid; flex: 1; place-items: center; margin: 0; text-align: center; font-size: var(--text-xs); line-height: 1.5; color: var(--color-text-muted); }

.ds-slicerbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2) var(--space-4); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: linear-gradient(90deg, var(--color-nav-start) 0%, var(--color-nav-peak) 26%, var(--color-nav-mid) 52%, var(--color-nav-end) 80%, var(--color-nav-edge) 100%); }
.ds-slicerbar__home { flex: none; }
.ds-slicerbar__home .ds-icon-btn { width: var(--target-min); height: var(--target-min); border-radius: var(--radius-xs); background: var(--color-surface-1); color: var(--color-text); }
.ds-slicerbar__groups { display: contents; }
.ds-slicerbar__logo { flex: none; margin-left: auto; }
@media (max-width: 1399px) {
  .ds-slicerbar__logo { order: 1; }
  .ds-slicerbar__groups { display: flex; flex: 1 0 100%; flex-wrap: wrap; order: 2; gap: var(--space-2) var(--space-4); }
}
@media (pointer: coarse) { .ds-slicerbar__home .ds-icon-btn { width: var(--touch-min); height: var(--touch-min); } }
@media (forced-colors: active) { .ds-report__tile { border: 1px solid CanvasText; } }

.ds-chart-frame { display: flow-root; position: relative; min-width: 0; }
.ds-chart-frame__toggle { position: absolute; top: 0; right: 0; z-index: 1; }
.ds-chart__table { margin-top: var(--target-min); }
.ds-chart { --chart-surface: var(--color-surface-1); container-type: inline-size; position: relative; margin: 0; overflow-x: auto; }
.ds-chart--report { --chart-surface: var(--color-report-panel); }
.ds-chart__svg { position: relative; display: block; width: 100%; min-width: 320px; height: auto; }
.ds-chart__empty { margin: 0; padding: var(--space-5) var(--space-3); text-align: center; font-size: var(--text-xs); line-height: 1.5; color: var(--color-text-muted); }
.ds-chart__gridline { stroke: var(--color-border-subtle); stroke-width: 1px; }
.ds-chart--report .ds-chart__gridline { stroke: var(--color-report-divider); stroke-dasharray: 1 3; }
.ds-chart__axis { stroke: var(--color-border-strong); stroke-width: 1px; }
.ds-chart--report .ds-chart__axis { stroke: var(--color-report-divider); }
.ds-chart__zero { stroke: var(--color-border-strong); stroke-width: 1px; }   /* the zero line of an axis that crosses zero (64 section 5.2 item 2) */
.ds-chart__ytick, .ds-chart__xtick, .ds-chart__axis-title { fill: var(--color-text-muted); font-size: var(--text-xs); }
@container (max-width: 519px) { .ds-chart__xtick--odd { display: none; } }
.ds-chart-s--a { --series: var(--color-accent-strong); }
.ds-chart-s--b { --series: var(--color-chart-pair-light); }
.ds-chart-s--1 { --series: var(--color-chart-1); --series-label: var(--color-chart-label-1); }
.ds-chart-s--2 { --series: var(--color-chart-2); --series-label: var(--color-chart-label-2); }
.ds-chart-s--3 { --series: var(--color-chart-3); --series-label: var(--color-chart-label-3); }
.ds-chart-s--4 { --series: var(--color-chart-4); --series-label: var(--color-chart-label-4); }
.ds-chart-s--5 { --series: var(--color-chart-5); --series-label: var(--color-chart-label-5); }
.ds-chart-s--6 { --series: var(--color-chart-6); --series-label: var(--color-chart-label-6); }
.ds-chart-s--7 { --series: var(--color-chart-7); --series-label: var(--color-chart-label-7); }
.ds-chart-s--8 { --series: var(--color-chart-8); --series-label: var(--color-chart-label-8); }
.ds-chart__bar, .ds-chart__enddot, .ds-chart__lone, .ds-chart__point, .ds-chart__tipdot { fill: var(--series); }
.ds-chart__seglabel { fill: var(--color-on-accent); font-size: var(--text-xs); pointer-events: none; }
.ds-chart__seglabel--above { fill: var(--color-text); }
.ds-chart--app .ds-chart__seglabel:not(.ds-chart__seglabel--above) { fill: var(--series-label, var(--color-on-accent)); }   /* AIS-V934 (DESIGN.md 3.7, ST-20): a segment label takes its slot's label token, so it is 4.5:1 or more on its fill in both themes: near-black on every dark slot and on the light slots 1, 2, 5, 6, 7, 8, white only on light 3 and 4 */
.ds-chart__line { fill: none; stroke: var(--series); stroke-width: 2px; stroke-linejoin: round; stroke-linecap: round; }
.ds-chart__area { fill: var(--series); fill-opacity: 0.1; stroke: none; }
.ds-chart__enddot, .ds-chart__point { stroke: var(--chart-surface); stroke-width: 2px; }
.ds-chart__endlabel { fill: var(--color-text); font-size: var(--text-xs); }
.ds-chart__hit { fill: transparent; }
.ds-chart__cross { stroke: var(--color-border-strong); stroke-width: 1px; }
.ds-chart__cross, .ds-chart__point, .ds-chart__tip { visibility: hidden; pointer-events: none; }
.ds-chart__cat:focus-within > .ds-chart__cross, .ds-chart__cat:focus-within > .ds-chart__point, .ds-chart__cat:focus-within > .ds-chart__tip { visibility: visible; }
@media (hover: hover) { .ds-chart__cat:hover > .ds-chart__cross, .ds-chart__cat:hover > .ds-chart__point, .ds-chart__cat:hover > .ds-chart__tip { visibility: visible; } }
.ds-chart__tip rect { fill: var(--color-surface-3); }
.ds-chart__tiptext { fill: var(--color-text); font-size: var(--text-xs); }
.ds-chart__tiptext--bold { font-weight: var(--weight-bold); }
.ds-chart__legend { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); margin: 0; padding: 0; list-style: none; font-size: var(--text-xs); line-height: 1.5; color: var(--color-text-muted); }
.ds-chart__legend-item { display: inline-flex; align-items: center; gap: var(--space-2); }
.ds-chart__dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--series); }
.ds-chart__legend--overlay { position: absolute; top: 2%; left: 0; right: var(--target-min); }
.ds-chart--line .ds-chart__legend { margin-bottom: var(--space-2); }

.ds-hbar-wrap { --hbar-label: 38%; --hbar-gutter: 3.75rem; }
.ds-hbar-wrap { padding-top: 2.5rem; }
.ds-hbar-body { position: relative; }
.ds-hbar { position: relative; margin: 0; padding: 0; list-style: none; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--color-scrollbar-thumb) transparent; }
.ds-hbar::-webkit-scrollbar { width: 4px; }
.ds-hbar::-webkit-scrollbar-thumb { border-radius: var(--radius-pill); background: var(--color-scrollbar-thumb); }
.ds-hbar__row { display: grid; grid-template-columns: var(--hbar-label) minmax(0, 1fr); align-items: center; height: 17px; font-size: var(--text-xs); line-height: 17px; }
.ds-hbar__row:focus-visible { outline-offset: -2px; }
.ds-hbar__label { overflow: hidden; padding-right: var(--space-2); text-overflow: ellipsis; white-space: nowrap; color: var(--color-text); }
.ds-hbar__plot { display: flex; align-items: center; min-width: 0; margin-right: var(--hbar-gutter); }
.ds-hbar__bar { flex: none; height: 14px; background: var(--color-accent-strong); }
.ds-hbar__value { flex: none; margin-left: var(--space-1); white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--color-text); }
.ds-hbar__bar--compare { height: 6px; background: var(--series); }
.ds-chart--app .ds-hbar__bar { border-radius: 0 var(--radius-xs) var(--radius-xs) 0; background: var(--series); }   /* chart-1, the comparison chart-2; 4 px rounded data end */
.ds-chart--app .ds-hbar__bar--neg { border-radius: var(--radius-xs) 0 0 var(--radius-xs); }
.ds-hbar--compare .ds-hbar__row { height: 25px; align-items: start; }   /* 14 px bar, 2 px gap, 6 px comparison bar, 3 px to the next row */
.ds-hbar__plot--compare { position: relative; }
.ds-hbar__track { position: absolute; top: 17.5px; left: 0; right: 0; display: flex; height: 6px; }   /* 2 px under the 14 px bar centred in the 17 px line */
.ds-hbar__zero { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px solid var(--color-border-strong); }
.ds-hbar__legend { align-items: center; min-height: var(--target-min); padding-right: var(--target-min); }
.ds-hbar__legend + .ds-hbar-wrap { padding-top: var(--space-2); }
.ds-hbar__grid { position: absolute; top: 0; bottom: 0; left: var(--hbar-label); right: var(--hbar-gutter); pointer-events: none; }
.ds-hbar__gridline { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px solid var(--color-border-subtle); }
.ds-chart--report .ds-hbar__gridline { border-left: 1px dotted var(--color-report-divider); }
.ds-hbar__ref { position: absolute; z-index: 1; top: 0; bottom: 0; width: 0; border-left: 1px dashed var(--color-text-muted); }
.ds-hbar__reflabel { position: absolute; bottom: 100%; left: 0; transform: translateX(-50%); white-space: nowrap; font-size: var(--text-xs); line-height: 1.5; color: var(--color-text-muted); }
.ds-hbar__axis { position: relative; height: 1.5rem; margin: var(--space-1) var(--hbar-gutter) 0 var(--hbar-label); }
.ds-hbar__tick { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; font-size: var(--text-xs); line-height: 1.5; color: var(--color-text-muted); }

/* visual renderers (spec 64 section 5): VisualView, its states and the KPI, table, bar and line renderers. Colours only through the kit's chart-1 / chart-2
   series classes and the delta tones; layout only here. A chat chart is 272 px high. */
.ds-visual { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; min-height: 0; }
.ds-visual__title { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--color-text); }
.ds-visual__note { margin: 0; font-size: var(--text-xs); line-height: 1.5; color: var(--color-text-muted); }
.ds-visual__body { position: relative; display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.ds-visual__empty { margin: auto 0; padding: var(--space-5) var(--space-3); text-align: center; font-size: var(--text-xs); line-height: 1.5; color: var(--color-text-muted); }
.ds-visual__skeleton { flex: 1 1 auto; min-height: 96px; }
.ds-visual--chat .ds-visual__skeleton { min-height: 272px; }
.ds-visual__mark { color: var(--color-text-muted); }
.ds-visual__table td.is-num { white-space: nowrap; }   /* a figure and its unit stay on one line; the table scrolls inside its place */
.ds-widgetview { position: relative; min-width: 0; }   /* a chat chart on the dashboard's renderer (DESIGN N-20, spec 70 8.6): the bare chart under its title */
.ds-widgetview--kpi { max-width: 320px; }   /* a normal KPI card in chat, at most 320 wide */
.ds-widgetview__host { min-width: 0; }
.ds-widgetview__host[role="figure"] { margin-top: var(--target-min); }   /* one row above the chart, the table toggle's */
@media (forced-colors: active) { .ds-widgetview__host svg * { forced-color-adjust: none; } }   /* bars and lines keep their colours */

.ds-howcalc { border-radius: var(--radius-md); background: var(--color-surface-2); font-size: var(--text-sm); line-height: 1.5; color: var(--color-text-body); }
.ds-howcalc__summary { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: var(--target-min); padding: 0 var(--space-3); border-radius: var(--radius-md); list-style: none; cursor: pointer; font-weight: var(--weight-semibold); color: var(--color-text); }
.ds-howcalc__summary::-webkit-details-marker { display: none; }
@media (hover: hover) { .ds-howcalc__summary:hover { background: var(--color-surface-hover-2); } }
.ds-howcalc__chevron { flex: none; color: var(--color-text-muted); }
.ds-howcalc[open] .ds-howcalc__chevron { transform: rotate(180deg); }
.ds-howcalc__body { display: grid; justify-items: start; gap: var(--space-3); padding: 0 var(--space-3) var(--space-3); }
.ds-howcalc__sections { display: grid; gap: var(--space-3); width: 100%; margin: 0; }
.ds-howcalc__section dt { font-size: var(--text-xs); font-weight: var(--weight-bold); letter-spacing: var(--tracking-upper); text-transform: uppercase; color: var(--color-text-muted); }
.ds-howcalc__section dd { margin: var(--space-1) 0 0; overflow-wrap: anywhere; }
.ds-howcalc__list { display: grid; gap: var(--space-1); margin: 0; padding: 0; list-style: none; }
.ds-howcalc__key { font-weight: var(--weight-semibold); color: var(--color-text); }
.ds-howcalc__queries { display: grid; gap: var(--space-2); }   /* spec 47 10.2: one list per query under its method */
.ds-howcalc__badge { margin-left: var(--space-2); }
.ds-howcalc__note { margin: 0; font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-howcalc__define { text-decoration: none; }   /* spec 47 10.2 TM-10, DESIGN.md 9.4a: the 8.9 inline link under a path line, underlined on hover; a 44 px row under a coarse pointer and on phones */
@media (hover: hover) { .ds-howcalc__define:hover { text-decoration: underline; } }
@media (pointer: coarse), (max-width: 767px) { .ds-howcalc__define { display: inline-flex; align-items: center; min-height: var(--touch-min); } }
@media (forced-colors: active) { .ds-howcalc, .ds-sourcechip { border: 1px solid CanvasText; } }

.ds-sourcechip { display: inline-flex; align-items: center; gap: var(--space-1); max-width: 100%; min-height: 24px; padding: 0 var(--space-2); border-radius: var(--radius-chip); background: var(--color-surface-2); font-size: var(--text-xs); line-height: 1.5; text-decoration: none; color: var(--color-text); }
.ds-sourcechip svg { flex: none; }
.ds-sourcechip__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-sourcechip__text--clip { max-width: 360px; }   /* a platform citation (title, section, pages) is clipped; the full text stays in the DOM and in the tooltip (spec 60 9.4) */
.ds-sourcechip__demo { flex: none; color: var(--color-text-muted); }
.ds-sourcechip--stale { background: var(--tint-warning); }
.ds-sourcechip__stale { display: inline-flex; flex: none; align-items: center; gap: var(--space-1); font-weight: var(--weight-semibold); color: var(--color-warning); }
a.ds-sourcechip { position: relative; }
/* chips smaller than the target reach it through a transparent hit area (DESIGN.md 14): a filter chip 28 + 2 x 2 = 32 (36 + 2 x 4 = 44 under touch); a source chip 24 + 2 x 4 = 32
   at every pointer and width (E-1: the chips under an answer wrap 8 px apart, so their targets touch and never overlap) */
a.ds-sourcechip::after { content: ""; position: absolute; inset: -4px 0; }
button.ds-chip { position: relative; }
button.ds-chip::before { content: ""; position: absolute; inset: calc((var(--control-h-sm) - var(--target-min)) / 2) 0; }
@media (hover: hover) { a.ds-sourcechip:hover { background: var(--color-surface-hover-2); } a.ds-sourcechip--stale:hover { background: var(--tint-warning); } }

/* report slicer bar extras and tile grid (AIS-21) ------------------------------------------------------------------------- */
.ds-slicerbar__logo .ds-tenant-logo { height: 28px; max-width: 125px; }
.ds-slicerbar__logo .ds-tenant-wordmark { font-size: var(--text-md); }
.ds-slicerbar .ds-datebox-field__legend { width: 100%; }
.ds-slicerbar .ds-datebox-slider { height: 28px; }

.ds-report-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
.ds-report-grid > .ds-report__tile { min-height: 0; }
.ds-report-grid .ds-datatable { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; }
.ds-report-grid .ds-table-wrap { flex: 1 1 auto; min-height: 0; }
.ds-report-grid .ds-chart-frame { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; }
.ds-report-grid .ds-hbar-wrap { padding-top: 0; }
.ds-report-grid .ds-hbar-wrap--ref { padding-top: 1.5rem; }
.ds-rtable--sticky-header tfoot td { position: sticky; bottom: 0; z-index: var(--z-sticky); background: var(--color-report-panel); }
.ds-report-grid .ds-rtable th, .ds-report-grid .ds-rtable td { padding: 3px 3px; }
.ds-report-grid .ds-rtable td:first-child, .ds-report-grid .ds-rtable th:first-child { overflow-wrap: anywhere; }
.ds-report-grid .ds-rtable td.is-num { white-space: nowrap; }
.ds-report-grid .ds-chart { height: 100%; }
.ds-report-grid .ds-chart__svg { height: 100%; }
.ds-chart--report .ds-chart__legend { column-gap: var(--space-2); }
.ds-report-grid .ds-rtable tr > :first-child { min-width: 34px; }
.ds-chart--report .ds-chart__legend--overlay { right: 36px; }

/* report tile grid of the placeholder module pages (AIS-22, AIS-73) ------------------------------------------------------ */
.ds-report-grid--preview > .ds-report__tile { min-width: 0; }
.ds-tile__split { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); min-width: 0; }
.ds-tile__split > * { min-width: 0; }
.ds-report-grid--preview .ds-table-wrap { max-height: 340px; }
.ds-report-grid--preview .ds-rtable tr > :first-child { min-width: 3.5rem; }
.ds-report-grid--preview .ds-chart, .ds-report-grid--preview .ds-chart__svg { height: auto; }
.ds-report-grid--preview .ds-chart__svg { max-height: 340px; }
.ds-kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: var(--space-3); }
.ds-kpi-row .ds-kpi__value { font-size: var(--text-lg); }
.ds-report__caption { margin: 0; font-size: var(--text-xs); line-height: 1.5; color: var(--color-text-muted); }
@media (min-width: 1100px) {
  .ds-report-grid--preview { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .ds-report-grid--preview > .ds-tile--span-6 { grid-column: span 6; }
  .ds-report-grid--preview > .ds-tile--span-4 { grid-column: span 4; }
  .ds-report-grid--preview > .ds-tile--span-3 { grid-column: span 3; }
  .ds-report-grid--preview > .ds-tile--span-2 { grid-column: span 2; }
}
/* a tile wide enough for a table and a chart side by side shows them so, whatever the viewport; a narrower one stacks them */
.ds-report-grid--preview > .ds-report__tile { container-type: inline-size; }
@container (min-width: 1000px) {
  .ds-tile__split:has(> .ds-chart-frame:first-child) { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .ds-tile__split:has(> .ds-chart-frame:last-child) { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
}
.ds-report-grid--preview .ds-rtable--labels .ds-rtable tr > :first-child { min-width: 7rem; }

/* company profile (SC-04 view, SC-15 edit): Profile.png, DESIGN S-04 */
.ds-company { display: grid; gap: var(--space-5); min-width: 0; }
.ds-company__logo { display: flex; align-items: center; justify-content: center; padding-top: var(--space-2); }
.ds-company__logo .ds-tenant-logo { height: 26px; max-width: 120px; }   /* the centred tenant logo ~120 x 26 (DESIGN S-04) */
.ds-company__logo-caption { margin: var(--space-4) 0 var(--space-2); }
.ds-company__legal { margin: 0 0 var(--space-3); font-size: var(--text-sm); font-weight: var(--weight-bold); line-height: var(--lh-body); overflow-wrap: anywhere; }
.ds-company__address, .ds-company__ids { display: grid; margin: 0 0 var(--space-3); font-size: var(--text-sm); line-height: var(--lh-body); color: var(--color-text-body); overflow-wrap: anywhere; }
.ds-company__fields { display: grid; gap: var(--space-4); }
.ds-company__hint { margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); }
.ds-company__sublabel { margin: 0 0 var(--space-3); font-size: var(--text-xs); font-weight: var(--weight-medium); text-transform: uppercase; color: var(--color-text-body); }   /* LISTA KOMPANIJA: 12/500 (DESIGN S-04) */
.ds-company__counter { margin: var(--space-2) 0 0; font-size: var(--text-xs); color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.ds-company__right { display: flex; flex-direction: column; align-self: stretch; gap: var(--space-4); min-width: 0; }
.ds-company__actions { display: flex; justify-content: flex-end; gap: var(--space-3); margin-top: auto; }
.ds-company__summary p { margin: 0; }
.ds-company__summary ul { margin: var(--space-1) 0 0; padding-inline-start: var(--space-5); }
@media (max-width: 767px) {
  /* the button area becomes a bar pinned to the bottom of the screen; the column wrapper steps aside so the whole panel is its containing block */
  .ds-company__right { display: contents; }
  .ds-company__actions { position: sticky; bottom: 0; z-index: var(--z-sticky); padding: var(--space-3); border-radius: var(--radius-inner); background: var(--color-surface-1); }
  .ds-company__actions .ds-btn { flex: 1 1 0; min-width: 0; }
}
.ds-company .ds-pair { gap: 0; }
.ds-company .ds-pair + .ds-pair { margin-top: var(--space-2); }
.ds-company .ds-pair__label, .ds-company .ds-pair__value { font-size: var(--text-sm); line-height: var(--lh-body); }
.ds-company__logo-remove { margin-top: var(--space-3); }

/* subscription (SC-05): Profile - Sub.png, DESIGN S-05 */
.ds-subscription { display: grid; gap: var(--space-5); min-width: 0; }
.ds-subscription__plan { margin: 0; padding-left: calc(20px + var(--space-2)); font-size: var(--text-sm); font-weight: var(--weight-bold); line-height: var(--lh-body); text-transform: uppercase; overflow-wrap: anywhere; }   /* under the card title: the 20 px card icon + its 8 px gap */
.ds-subscription__usage { margin: 0 0 var(--space-3); font-size: var(--text-sm); font-weight: var(--weight-bold); font-variant-numeric: tabular-nums; }
.ds-subscription__extension { margin: var(--space-3) 0 0; font-size: var(--text-sm); color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.ds-subscription .ds-pair, .ds-package .ds-pair { gap: 0; }
.ds-subscription .ds-pair + .ds-pair { margin-top: var(--space-2); }
.ds-package .ds-pair + .ds-pair { margin-top: var(--space-4); }
.ds-subscription .ds-pair__label, .ds-subscription .ds-pair__value { font-size: var(--text-sm); line-height: var(--lh-body); }
.ds-subscription__right { min-width: 0; }
.ds-subscription__head { display: flex; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-4); }   /* 24 px feature icon + heading-2 (DESIGN S-05) */
.ds-subscription__title { margin: 0; }
.ds-subscription__cards { display: flex; flex-wrap: wrap; align-items: stretch; gap: 64px var(--space-4); padding-bottom: 64px; }   /* cards 220-260 wide, 16 apart (DESIGN 5.2); a row wraps where three do not fit. 64 = the price button's 16 px overlap + the 24 px gap + the caption line below it */
.ds-subscription__cards > * { flex: 1 1 220px; min-width: min(100%, 220px); max-width: 260px; }
.ds-subscription__cards--note { row-gap: calc(64px + 110px); padding-bottom: calc(64px + 110px); }   /* room for the pending-change note under the current card (110 px), in every row */
.ds-package .ds-pair__label, .ds-package .ds-pair__value { font-size: var(--text-sm); line-height: var(--lh-body); }
.ds-package__cta .ds-tooltip-wrap { display: flex; width: 100%; }
.ds-package__title { font-size: var(--text-sm); line-height: var(--lh-body); letter-spacing: 0; }   /* body-strong, UPPERCASE as stored (DESIGN 4.1) */
.ds-package[aria-current="true"] .ds-btn[aria-disabled="true"] { opacity: 1; }
.ds-package__caption { margin: 0; font-size: var(--text-sm); }
.ds-subscription__pending { display: grid; justify-items: center; gap: var(--space-2); margin-top: var(--space-2); font-size: var(--text-sm); color: var(--color-text-muted); }
.ds-subscription__pending p { margin: 0; }
.ds-package-dialog__plan { margin: 0 0 var(--space-4); }
.ds-package-dialog__facts { margin-bottom: var(--space-4); }
.ds-package-dialog__facts .ds-pair { gap: 0; }
.ds-package-dialog__facts .ds-pair + .ds-pair { margin-top: var(--space-2); }
@media (max-width: 1099px) { .ds-subscription__cards { flex-direction: column; align-items: center; } .ds-subscription__cards > * { flex: none; width: 100%; max-width: 360px; } }   /* one per row, max 360, centred (DESIGN 14.1) */

/* contact us (SC-06): Profile - Contact us.png, DESIGN S-06; the panel has no padding here, the slanted shape fills it and the panel is transparent, so the workspace frame shows around the shape */
.ds-panel:has(.ds-contact) { background: transparent; padding: 0; }
.ds-contact__shape { display: flex; flex-direction: column; justify-content: center; }
.ds-contact__info { display: grid; gap: var(--space-8); padding: var(--space-7) 0 var(--space-7) var(--space-6); }   /* the information column, inset 24 (DESIGN S-06) */
.ds-contact__block { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--space-4); align-items: center; max-width: 360px; }   /* the text column at most 360 px (13 section 5.3) */
.ds-contact__block > .ds-feature-icon { grid-column: 1; grid-row: 1; }
.ds-contact__title { grid-column: 2; grid-row: 1; margin: 0; overflow-wrap: anywhere; }
.ds-contact__text { grid-column: 2; margin: var(--space-2) 0 0; font-size: var(--text-sm); line-height: var(--lh-body); color: var(--color-text-body); }   /* 13/400 (DESIGN S-06) */
.ds-contact__social { grid-column: 2; justify-self: start; display: inline-grid; place-items: center; width: var(--target-min); height: var(--target-min); margin-top: var(--space-3); border-radius: var(--radius-md); background: var(--color-bg); color: var(--color-text-muted); }   /* the 32 px rounded-square tile, 16 px glyph (DESIGN S-06) */
.ds-contact__social--inert { color: var(--color-text-subtle); }
@media (hover: hover) { a.ds-contact__social:hover { color: var(--color-text); } }
.ds-contact__form { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: center; min-height: 480px; width: min(480px, 100%); margin-left: min(56%, calc(100% - 480px - var(--space-6))); }   /* the form at most 480 px (13 section 5.3) */
.ds-contact__fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }   /* form fields 12 apart (DESIGN 5.3) */
.ds-contact__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: var(--space-3); }
.ds-contact__row > * { min-width: 0; }
.ds-contact__row .ds-formfield { grid-template-columns: minmax(0, 1fr); }
.ds-contact__row .ds-field { min-width: 0; }
/* the caption sits above the value in the two fields of the row (the pattern of phones, 44 px stacked fields), so an e-mail address of 30 characters fits in the 480 px form and is never truncated */
@media (min-width: 640px) { .ds-contact__row .ds-field--inline { flex-direction: column; align-items: stretch; justify-content: center; gap: 0; min-height: var(--field-stacked-h); padding-block: var(--space-1); } }
.ds-contact__fields .ds-field--area { min-height: 200px; padding-top: var(--space-3); }   /* the textarea at least 200 high (DESIGN S-06) */
.ds-contact__fields .ds-field--area .ds-field__input { flex: 1; resize: none; }
.ds-contact__avatar { position: absolute; top: var(--space-2); right: var(--space-2); }   /* the 24 px avatar disc in the textarea's top-right corner (DESIGN 7.2) */
.ds-contact__submit { display: flex; justify-content: center; margin-top: var(--space-1); }   /* 12 (field gap) + 4 = 16 below the textarea (DESIGN S-06) */
.ds-contact__submit .ds-btn { min-width: min(200px, 100%); }   /* SEND MESSAGE: primary md, min 200 wide, centred */
.ds-contact__sent { display: grid; justify-items: center; gap: var(--space-4); padding: var(--space-6); border-radius: var(--radius-inner); background: var(--color-surface-1); text-align: center; }
.ds-contact__check { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-pill); background: var(--color-primary); color: var(--color-on-primary); }   /* a 40 px check disc with the 20 px glyph (DESIGN 7.1 sizes) */
.ds-contact__sent-text { margin: 0; font-size: var(--text-sm); font-weight: var(--weight-bold); line-height: var(--lh-body); }
.ds-contact__skeleton { display: grid; gap: var(--space-3); }
@media (max-width: 1599px) {
  .ds-panel:has(.ds-contact) { padding: var(--space-5) var(--space-6); }
  .ds-contact { min-height: 0; }
  .ds-contact__info { gap: var(--space-6); padding: 0; }
  .ds-contact__form { min-height: 0; width: min(480px, 100%); margin: var(--space-5) 0 0; }
}
@media (max-width: 1099px) {
  .ds-panel:has(.ds-contact) { padding: var(--space-5); }
  .ds-contact__form { width: 100%; }
  .ds-contact__submit .ds-btn { width: 100%; }
}
@media (max-width: 639px) {
  .ds-contact__row { grid-template-columns: minmax(0, 1fr); }
  .ds-contact__shape { padding: var(--space-5); }
  .ds-contact__block { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-2); }
  .ds-contact__block > .ds-feature-icon, .ds-contact__title, .ds-contact__text, .ds-contact__social { grid-column: 1; grid-row: auto; }
  .ds-contact__title { font-size: var(--text-xl); }
}

/* AI chat panel: header, log, answer typesetting, evidence, feedback, actions, input (36 section 3) ------------------------------------------ */
.ds-chat { position: relative; min-width: 0; }
.ds-chat__title { margin: 0; font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.ds-chat__head-actions { display: flex; align-items: center; gap: var(--space-1); }
.ds-chat__info { position: static; display: inline-flex; align-items: center; justify-content: center; min-width: var(--target-min); min-height: var(--target-min); color: var(--color-text-muted); }
.ds-chat__info .ds-tooltip { text-align: start; left: auto; right: 0; transform: none; width: max-content; max-width: min(360px, 80vw); display: flex; flex-direction: column; gap: var(--space-2); }   /* the tip hangs from the header (the icon is not the containing block): it opens leftwards from the header's right edge, so it stays inside the panel wherever the icon sits, and carries the context chips */
.ds-chat__info-note { display: block; }
.ds-chat__chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.ds-chat__chips .ds-chip { min-width: 0; height: auto; min-height: 24px; padding-block: var(--space-1); line-height: var(--lh-tight); }   /* 24 high on one line, wraps when long */
.ds-chat__log { position: relative; scrollbar-gutter: stable; }   /* contains the visually hidden announcements, so they neither scroll the page nor escape the log */
.ds-chat__greeting { color: var(--color-text-body); }
.ds-chat__skeleton { display: grid; gap: var(--space-3); }
.ds-chat__alert, .ds-chat__quota { margin-block: var(--space-2); }
.ds-chat__prompts { display: flex; flex-wrap: wrap; gap: var(--space-2); padding-bottom: var(--space-3); }
.ds-chip--prompt { min-width: 0; height: auto; min-height: 28px; padding: var(--space-1) var(--space-3); border: 0; text-align: left; line-height: 1.4; cursor: pointer; }
@media (hover: hover) { .ds-chip--prompt:hover { background: var(--color-surface-3); } }
@media (pointer: coarse), (max-width: 767px) { .ds-chip--prompt { min-height: var(--touch-min); } }
.ds-chat__input textarea { field-sizing: content; min-height: calc(2 * var(--lh-chat) * var(--text-chat)); overflow-y: auto; }
@media (pointer: coarse), (max-width: 767px) { .ds-chat__input textarea { min-height: var(--touch-min); } }   /* the plain question field (the guided entry, the comment fields) is a 44 px target, not the 40 px of its two lines (DESIGN.md 14.1 Chat) */
.ds-chat__input[data-disabled="true"] { opacity: 0.7; }
.ds-chat__counter { align-self: flex-end; flex: none; font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-send { flex: none; display: inline-grid; place-items: center; width: var(--target-min); height: var(--target-min); padding: 0; border: 0; border-radius: 50%; background: var(--color-surface-1); color: var(--color-send-arrow-disabled); }
.ds-send[data-state="ready"] { color: var(--color-accent); }
.ds-send[data-state="stop"] { background: var(--color-accent); color: var(--color-on-accent); }
.ds-send[disabled] { cursor: not-allowed; }
@media (hover: hover) { .ds-send[data-state="ready"]:hover { background: var(--color-surface-3); } .ds-send[data-state="stop"]:hover { background: var(--color-accent-hover); } }
@media (forced-colors: active) { .ds-send { border: 1px solid CanvasText; } }

/* waiting feedback */
.ds-typing-row { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-4); color: var(--color-text-muted); font-size: var(--text-xs); }
.ds-typing-row .ds-bdot { animation: ds-hop 0.9s cubic-bezier(.3, 0, .3, 1) infinite; }
.ds-typing-row__text {
  background: linear-gradient(90deg, var(--color-text-muted) 30%, var(--color-text) 50%, var(--color-text-muted) 70%); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: ds-shimmer-text 1.6s linear infinite;
}
@keyframes ds-hop { 0%, 100% { transform: translateY(0) scale(1.15, .85); } 35% { transform: translateY(-6px) scale(.92, 1.08); } 60% { transform: translateY(0) scale(1.08, .92); } }
@keyframes ds-shimmer-text { to { background-position: -200% 0; } }
.ds-typing-row .ds-bar { width: 160px; }
.ds-bar--indeterminate { position: relative; }
.ds-bar--indeterminate .ds-bar__fill { display: block; width: 40%; animation: ds-indeterminate 1.4s linear infinite; }
@keyframes ds-indeterminate { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) { .ds-typing-row .ds-bdot, .ds-bar--indeterminate .ds-bar__fill { animation: none; } .ds-bar--indeterminate .ds-bar__fill { width: 100%; } .ds-typing-row__text { animation: none; background: none; color: inherit; } }

/* messages */
.ds-msg { margin-top: var(--space-4); }
.ds-msg--ai { display: flex; gap: var(--space-3); }
.ds-msg__icon { flex: none; margin-top: 2px; }
.ds-msg__content { min-width: 0; flex: 1; }
.ds-msg__muted { margin-top: var(--space-2); color: var(--color-text-muted); }
.ds-msg__voice { margin-right: var(--space-2); vertical-align: middle; color: var(--color-text-muted); }
.ds-msg--highlight { outline: 2px solid var(--color-accent); outline-offset: -2px; border-radius: var(--radius-md); }   /* drawn inside the message: the scrolling chat log clips anything outside it */

/* answer typesetting (DESIGN 9.4) */
.ds-answer { min-width: 0; }
.ds-answer strong { font-weight: var(--weight-bold); color: var(--color-text); }
.ds-chat-heading { margin: var(--space-4) 0 0; font-size: var(--text-chat); font-weight: var(--weight-bold); color: var(--color-text); }
.ds-chat__log .ds-chat-p { margin-top: var(--space-3); }
.ds-chat__log .ds-chat-lines { margin-top: var(--space-3); }
.ds-chat__log .ds-chat-lines > .ds-chat-p, .ds-chat__log .ds-chat-line { margin-top: 0; }
/* AIS-524: in a wide chat (the delta layout, a wide or full chat on a large screen) the answer's running text keeps a readable line of about 80 characters;
   the cards, tables and charts keep the width of the chat, and the short label: value lines are left to wrap freely */
.ds-chat__log :is(.ds-chat-p, .ds-chat-note, .ds-chat-heading) { max-width: 75ch; }
.ds-chat-notice { margin-top: var(--space-3); }
.ds-chat-note { display: flex; align-items: flex-start; gap: var(--space-2); margin: var(--space-3) 0 0; color: var(--color-text-muted); }   /* the general-knowledge closing note (DESIGN N-01): no alert frame */
.ds-chat-note svg { flex: none; margin-top: 3px; }
.ds-alert__link { flex: none; margin-left: auto; color: inherit; font-weight: var(--weight-semibold); white-space: nowrap; }
.ds-chat-table { margin-top: var(--space-3); }
.ds-chat-table__scroll { max-width: 100%; margin-top: var(--space-2); overflow-x: auto; }
.ds-chat-table .ds-table td.is-num { white-space: nowrap; }   /* a figure and its unit stay on one line; the table scrolls sideways instead (13 columns of the delta table) */
.ds-chat-visual { max-width: 640px; margin-top: var(--space-3); }   /* the chat chart of SC-09 (DESIGN N-20): at most 640 x 272 in the table's place */
.ds-chat-visual-note { margin: var(--space-2) 0 0; }   /* beside the report: „Grafikon je prikazan u AI asistentu.“ under the table, 12/16 muted */

/* evidence */
.ds-evidence { display: grid; gap: var(--space-2); margin-top: var(--space-4); font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-evidence > * { min-width: 0; }   /* a grid item may shrink below its longest word, so the log never scrolls sideways at 320 px */
.ds-evidence__line { margin: 0; }
.ds-evidence__label { font-weight: var(--weight-semibold); color: var(--color-text); }
.ds-evidence__sources { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.ds-freequery { position: static; }   /* the free-query help (spec 47 10.3) opens under the whole sources row, so it never runs past the chat panel's edge */
.ds-freequery .ds-tooltip { left: 0; right: 0; width: auto; max-width: none; transform: none; }
.ds-evidence__facts .ds-table th { text-align: left; text-transform: none; letter-spacing: normal; white-space: normal; position: static; z-index: auto; height: var(--table-row-compact-h); padding: var(--space-1) var(--space-3); background: none; border-bottom: 1px solid var(--color-border-subtle); font-size: var(--text-sm); line-height: var(--lh-body); font-weight: var(--weight-regular); color: var(--color-text-muted); }   /* the facts' row labels as written (DESIGN N-01): a 9.3 body row that wraps, none of the header-row look */
.ds-evidence__facts .ds-table td.is-num { white-space: nowrap; }   /* a figure and its unit stay on one line; the label wraps instead (390 px) */

/* the plain answer's meaning clauses (36 3.5a, DESIGN 9.4a answer-meaning-note): glyph plus words, no tint, radius or padding */
.ds-meaning { display: grid; gap: var(--space-1); margin: 0 0 var(--space-2); padding: 0; list-style: none; }
.ds-meaning__item { display: flex; align-items: flex-start; gap: var(--space-2); min-width: 0; color: var(--color-text-body); overflow-wrap: anywhere; }
.ds-meaning__glyph { flex: none; margin-top: 2px; color: var(--color-info); }   /* top-aligned with the first 20 px line */
.ds-meaning--warning .ds-meaning__glyph { color: var(--color-warning); }

/* the one details card under an answer (36 3.6a, DESIGN 9.4a answer-details): a button across the card, collapsed; nothing inside collapses again */
.ds-details { margin-top: var(--space-3); border-radius: var(--radius-md); background: var(--color-surface-2); font-size: var(--text-sm); line-height: var(--lh-body); color: var(--color-text-body); }
.ds-details__header { display: flex; align-items: flex-start; gap: var(--space-2); width: 100%; min-height: var(--target-min); padding: 6px var(--space-3); border: 0; border-radius: var(--radius-md); background: transparent; color: var(--color-text); font: inherit; text-align: left; cursor: pointer; }
@media (hover: hover) { .ds-details__header:hover { background: var(--color-surface-hover-2); } }
.ds-details__heading { display: flex; flex: 1; flex-wrap: wrap; align-items: center; align-content: center; gap: var(--space-1) var(--space-2); min-width: 0; min-height: calc(var(--target-min) - 12px); }
.ds-details__label { font-weight: var(--weight-semibold); color: var(--color-text); }
.ds-details__markers { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); min-width: 0; font-weight: var(--weight-regular); }
.ds-details__markers .ds-chip { min-width: 0; margin-block: -2px; white-space: nowrap; }   /* the 24 px chip keeps its look inside the 20 px line, so a header with it is still 32 (44) high */
/* a marker is one line at every width down to 320 px: as wide as its text, never wider than its line; a longer text ends in an ellipsis, the glyph stays, and the full text is in the button's name (DESIGN.md 9.4a) */
.ds-details__markers .ds-status { height: auto; min-height: 20px; max-width: 100%; min-width: 0; padding-block: 2px; line-height: var(--lh-tight); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-details__markers .ds-status > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ds-details__markers .ds-status > svg { flex: none; }
.ds-details__chevron { flex: none; margin-top: calc((var(--target-min) - 28px) / 2); color: var(--color-text-muted); transition: transform var(--dur-fast) var(--ease); }
.ds-details__header[aria-expanded="true"] .ds-details__chevron { transform: rotate(180deg); }
/* a narrow chat: the markers take their own full-width line under the label and the chevron stays on the label's line (it leaves the flow), so the demo badge fits one line instead of wrapping inside
   itself and the header is only as tall as the wrapped markers need (DESIGN.md 9.4a); wide enough, label, markers and chevron share one 32 (44) high line */
/* AIS-524 merge: the container is the details card itself (as the empty state is for the tool cards), never the chat - containment on the chat would make it the
   containing block of its fixed menus; 492 px of it is the 520 px chat less the chat's padding */
.ds-details { container: ds-chat / inline-size; }
@container ds-chat (max-width: 492px) {
  .ds-details__header { position: relative; }
  .ds-details__chevron { position: absolute; top: 6px; right: var(--space-3); }
  .ds-details__header:has(.ds-details__markers) .ds-details__chevron { margin-top: 2px; }   /* with markers the label stands at the top of a 44 (touch) header too: the chevron centres on its first 20 px line, as in the wide header */
  .ds-details__markers { flex-basis: 100%; }
}
.ds-details__body { display: grid; gap: var(--space-3); padding: 0 var(--space-3) var(--space-3); }
.ds-details__body[hidden] { display: none; }
.ds-details__body > *, .ds-details .ds-evidence > * { min-width: 0; }   /* a grid item may shrink below its longest word, so the log never scrolls sideways at 320 px */
.ds-details__section { padding-top: var(--space-3); border-top: 1px solid var(--color-border-subtle); }
.ds-details__body > .ds-details__section:first-child, .ds-details__body > .ds-evidence:first-child > .ds-details__section:first-child { padding-top: 0; border-top: 0; }
.ds-details__title { margin: 0 0 var(--space-2); font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-text); }
.ds-details__caption { margin: var(--space-2) 0 0; font-size: var(--text-xs); line-height: var(--lh-tight); color: var(--color-text-muted); }
.ds-details .ds-evidence { display: contents; font-size: inherit; color: inherit; }   /* the evidence sections are sections of the card */
.ds-details .ds-evidence__line { font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-details .ds-meaning { margin: 0; }
.ds-details .ds-chat-p, .ds-details .ds-chat-table { margin-top: 0; }
.ds-howcalc--embedded { border-radius: 0; background: none; }
.ds-howcalc--embedded .ds-howcalc__body { padding: 0; }
@media (forced-colors: active) { .ds-details { border: 1px solid CanvasText; } .ds-details .ds-howcalc--embedded { border: 0; } }

/* feedback toolbar and report-gap note */
.ds-feedback { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-3); }
.ds-feedback .ds-icon-btn[aria-pressed="true"] { background: var(--color-surface-2); color: var(--color-accent); }
.ds-feedback__note { display: flex; align-items: center; gap: var(--space-2); margin: 0; font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-feedback__form { display: grid; gap: var(--space-3); width: min(360px, calc(100vw - 48px)); }
/* the "Zadatak kreiran" badge as the trigger of the menu of the answer's tasks (63 section 5.6): the badge itself, on a target-size button with no chrome of its own */
.ds-feedback__tasks { display: inline-flex; }
.ds-feedback__tasks-trigger { display: inline-flex; align-items: center; min-height: var(--target-min); padding: 0 var(--space-1); border: 0; border-radius: var(--radius-md); background: transparent; font: inherit; cursor: pointer; }
@media (hover: hover) { .ds-feedback__tasks-trigger:hover { background: var(--color-surface-hover-2); } }

/* action plan */
.ds-actions { margin-top: var(--space-3); }
.ds-actions__list { display: grid; gap: var(--space-3); margin: 0; padding: 0; list-style: none; }
.ds-action { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius-md); background: var(--color-surface-2); }
.ds-action__body { flex: 1 1 200px; min-width: 0; }
.ds-chat__log .ds-action__body p { margin-top: 0; }
.ds-action__title { font-weight: var(--weight-bold); color: var(--color-text); }
.ds-action__rationale { margin-top: var(--space-1); }
.ds-action__meta { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); margin-top: var(--space-1); font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-action__buttons { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); }
.ds-action__link { text-decoration: none; }
.ds-actions__note { margin-top: var(--space-2); font-size: var(--text-xs); color: var(--color-text-muted); }

/* tiles: a disabled tile keeps its fill and greys its label (DESIGN.md 8.6), and a tile that sits in its tooltip still fills the grid cell */
.ds-tile[aria-disabled="true"] { color: var(--color-text-disabled); cursor: not-allowed; }
.ds-tile-grid > .ds-tooltip-wrap > .ds-tile { flex: 1 1 auto; }
@media (hover: hover) { .ds-tile[aria-disabled="true"]:hover { background: var(--color-surface-2); } .ds-tile[aria-disabled="true"][aria-checked="true"]:hover { background: var(--color-surface-3); } }
/* the Delta dimension picker (DESIGN.md S-03, spec 66 section 8.4): the prompt 12 px under the report card, over the tiles; four 140 px columns where they fit, else as many as fit;
   the reason of blocked tiles under them */
.ds-picker { margin-top: var(--space-3); container: ds-picker / inline-size; }
.ds-prompt { margin: 0 0 var(--space-3); font-size: var(--text-sm); font-weight: var(--weight-semibold); line-height: var(--lh-body); color: var(--color-text); }
.ds-picker__reason { margin: var(--space-3) 0 0; font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-picker .ds-tile { padding-inline: var(--space-2); }
@media (min-width: 1100px) { @container ds-picker (width < 584px) { .ds-picker .ds-tile-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); } } }
/* the empty chat while Delta is current (spec 66 section 8.3): the Delta feature icon over its hint, centred */
.ds-chat__delta-empty { display: grid; justify-items: center; align-content: center; gap: var(--space-3); min-height: 240px; height: 100%; color: var(--color-text-muted); text-align: center; }
.ds-chat__delta-empty p { margin: 0; }

/* opportunity cards of the income generator (32 section 3.1, DESIGN N-13): the accent of the group is never the only cue, the group heading names it */
.ds-opportunities { display: grid; gap: var(--space-4); margin-top: var(--space-3); }
.ds-opportunities > .ds-status { justify-self: start; }
.ds-opportunity-group { display: grid; gap: var(--space-3); }
.ds-opportunity-group > .ds-chat-heading { margin-top: var(--space-2); }
.ds-opportunity { --opportunity-accent: var(--color-chart-1); display: grid; gap: var(--space-2); padding: var(--space-4); border-inline-start: 3px solid var(--opportunity-accent); border-radius: var(--radius-inner); background: var(--color-surface-2); }
.ds-opportunity[data-group="priceMargin"] { --opportunity-accent: var(--color-chart-2); }
.ds-opportunity[data-group="promoEfficiency"] { --opportunity-accent: var(--color-chart-3); }
.ds-chat__log .ds-opportunity p, .ds-chat__log .ds-opportunity h4 { margin: 0; }
.ds-opportunity__title { font-size: var(--text-md); font-weight: var(--weight-bold); color: var(--color-text); }
.ds-opportunity__evidence { display: grid; gap: var(--space-1); margin: 0; padding: 0; list-style: none; font-variant-numeric: tabular-nums; }
.ds-opportunity__label { color: var(--color-text-muted); }
.ds-opportunity__potential { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); font-variant-numeric: tabular-nums; }
.ds-opportunity__rule { color: var(--color-text-muted); }
.ds-opportunity__buttons { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
@media (forced-colors: active) { .ds-opportunity { border: 1px solid CanvasText; } }

/* popover and menu (13 section 3.4) */
.ds-popover-anchor { display: inline-flex; }
.ds-popover-backdrop { position: fixed; inset: 0; z-index: var(--z-drawer); }
.ds-popover { position: fixed; top: 0; left: 0; z-index: calc(var(--z-drawer) + 1); max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); overflow: auto; padding: var(--space-4); border-radius: var(--radius-md); background: var(--color-surface-3); box-shadow: var(--shadow-overlay); }
.ds-popover[role="menu"] { padding: 0; background: none; box-shadow: none; }
.ds-menu__item { width: 100%; border: 0; background: none; color: var(--color-text); font-size: var(--text-sm); text-align: left; }
.ds-menu__item--danger > .ds-icon { color: var(--color-negative); }   /* the glyph carries the danger; the text stays text (light negative on surface-3 is 4.30:1, DESIGN.md 3.5) */
.ds-menu [role="menuitem"][aria-disabled="true"], .ds-menu [role="menuitemradio"][aria-disabled="true"] { color: var(--color-text-disabled); cursor: not-allowed; }
.ds-menu [role="menuitem"]:focus-visible, .ds-menu [role="menuitemradio"]:focus-visible { background: var(--color-surface-hover-2); }
.ds-menu [aria-checked="true"] { font-weight: var(--weight-semibold); }   /* the current choice: a leading check and bold text (DESIGN.md 8.3) */
.ds-menu__check { display: inline-flex; flex: none; width: 16px; }   /* also kept empty on the other choices, so their labels line up */
.ds-menu__more { flex: none; margin-left: auto; color: var(--color-text-muted); }   /* the chevron of an entry that opens a submenu */
.ds-menu__separator { height: 1px; margin: var(--space-1) 0; background: var(--color-border-subtle); }
.ds-menu__text { display: grid; gap: 2px; padding-block: var(--space-2); }   /* an entry with a second line (MenuItem.Description, e.g. why it is disabled) */
.ds-menu__description { max-width: 16rem; font-size: var(--text-xs); color: var(--color-text-muted); white-space: normal; }
@media (forced-colors: active) { .ds-popover, .ds-menu, .ds-action { border: 1px solid CanvasText; } }

/* conversation list of the assistant page (36 section 3.10) */
.ds-convlist { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; padding: var(--space-4); border-radius: var(--radius-inner); background: var(--color-surface-1); }   /* an inner card on the content panel: radius 14 (DESIGN.md 12.00 rule 3) */
.ds-convlist__body { display: flex; flex-direction: column; gap: var(--space-1); min-height: 0; margin: calc(-1 * var(--space-1)); padding: var(--space-1); overflow-y: auto; scrollbar-width: thin; }   /* 4 px of room inside the scroll box: the focus ring of the rename input (2 px, offset 2 px) is not clipped (03 section 6) */
.ds-convlist__skeleton { display: grid; gap: var(--space-2); }
.ds-convlist__empty { margin: var(--space-3) 0; color: var(--color-text-muted); font-size: var(--text-sm); }
.ds-convlist__empty > p { margin: 0 0 var(--space-1); }
.ds-convlist__empty-title { color: var(--color-text); font-weight: var(--weight-semibold); }
.ds-convlist__group { margin: var(--space-3) 0 var(--space-1) var(--space-3); font-size: var(--text-xs); font-weight: var(--weight-medium); text-transform: uppercase; letter-spacing: var(--tracking-upper); color: var(--color-text-muted); }
.ds-convlist__items { display: flex; flex-direction: column; gap: var(--space-1); margin: 0; padding: 0; list-style: none; }
.ds-conv { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); border-radius: var(--radius-md); }
.ds-conv[data-selected="true"] { background: var(--color-surface-3); box-shadow: inset 2px 0 0 var(--color-primary-text); }   /* AIS-A533: the open one - background and a 2 px green line on the left; AIS-V934 (RD-03): the line is primary-text, the brand green on dark and the ink on light (4.81:1 on the light surface-3, the brand green was 1.80) */
.ds-conv__open { display: flex; flex: 1; align-items: center; gap: var(--space-2); min-width: 0; min-height: var(--target-min); padding: 0 var(--space-3); border: 0; border-radius: var(--radius-md); background: transparent; color: var(--color-text); font-size: var(--text-sm); text-align: left; }
.ds-conv__open[aria-current="true"] { font-weight: var(--weight-semibold); }
.ds-conv__open[aria-disabled="true"] { cursor: not-allowed; color: var(--color-text-muted); }
.ds-conv__title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-conv[data-archived="true"] .ds-conv__title { color: var(--color-text-muted); }
@media (hover: hover) { .ds-conv:not([data-selected="true"]):hover { background: var(--color-surface-hover-2); } }
/* AIS-A533 („like Claude's history“): the "…" of a row shows on hover or focus (always on touch); the header with « ; the 56 px rail; the archived view and its link */
.ds-conv > .ds-popover-anchor { position: absolute; top: 50%; right: var(--space-1); transform: translateY(-50%); }   /* over the row's end: the title keeps the width until the "…" shows */
.ds-conv__more { width: 32px; height: 32px; opacity: 0; }
.ds-conv:focus-within .ds-conv__more, .ds-conv__more[aria-expanded="true"] { opacity: 1; }
@media (hover: hover) { .ds-conv:hover .ds-conv__more { opacity: 1; } }
.ds-conv:focus-within .ds-conv__open, .ds-conv:has(.ds-conv__more[aria-expanded="true"]) .ds-conv__open { padding-right: calc(32px + var(--space-2)); }
@media (hover: hover) { .ds-conv:hover .ds-conv__open { padding-right: calc(32px + var(--space-2)); } }
@media (hover: none) { .ds-conv__more { opacity: 1; } .ds-conv .ds-conv__open { padding-right: calc(32px + var(--space-2)); } }
.ds-conv__actions { display: inline-flex; flex: none; gap: var(--space-1); }
.ds-convlist__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.ds-convlist__title { margin: 0; font-size: var(--text-md); font-weight: var(--weight-bold); }
.ds-convlist__collapse, .ds-convlist--rail .ds-icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: var(--radius-md); }
.ds-convlist--rail { align-items: center; gap: var(--space-2); width: 56px; padding: var(--space-3) 0; }
.ds-convlist--rail .ds-convlist__rail-new { background: var(--color-primary); color: var(--color-on-primary); }   /* the rail's "+" is the primary "Novi razgovor" */
.ds-convlist__archived-link, .ds-convlist__back { display: inline-flex; align-items: center; gap: var(--space-2); align-self: flex-start; min-height: var(--target-min); padding: 0 var(--space-2); border: 0; border-radius: var(--radius-md); background: none; color: var(--color-text-muted); font: inherit; font-size: var(--text-sm); cursor: pointer; }
.ds-convlist__archived-link { margin-top: auto; }
@media (hover: hover) { .ds-convlist__archived-link:hover, .ds-convlist__back:hover { background: var(--color-surface-hover-2); color: var(--color-text); } }
.ds-convlist__archived-head { display: grid; gap: var(--space-2); }
.ds-convlist__archived-title { margin: 0; font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.ds-convlist__note { margin: 0; font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-conv__rename, .ds-assistant__title-input { flex: 1; min-width: 0; min-height: var(--control-h-md); padding: 0 var(--space-3); border: 0; border-radius: var(--radius-md); background: var(--color-surface-2); color: var(--color-text); font-size: var(--text-sm); }
.ds-conv__rename:focus-visible, .ds-assistant__title-input:focus-visible { outline: 2px solid var(--color-focus-ring); }
.ds-conv__rename[aria-invalid="true"], .ds-assistant__title-input[aria-invalid="true"] { box-shadow: inset 0 0 0 1.5px var(--color-negative); }
.ds-conv__rename[aria-invalid="true"]:focus-visible, .ds-assistant__title-input[aria-invalid="true"]:focus-visible { outline-offset: 2px; }
.ds-assistant__title-error { flex-basis: 100%; margin: 0 var(--space-3) var(--space-1); font-size: var(--text-xs); color: var(--color-negative); }
.ds-conv__error { display: flex; flex-basis: 100%; align-items: flex-start; gap: var(--space-2); margin: 0 var(--space-3) var(--space-1); font-size: var(--text-xs); color: var(--color-text); }
.ds-conv__error > .ds-icon { flex: none; color: var(--color-negative); }   /* the glyph carries the status, the text stays text (light negative on the selected row, surface-3, is 4.30:1; DESIGN.md 3.5) */
@media (forced-colors: active) { .ds-convlist, .ds-conv[data-selected="true"], .ds-conv__rename, .ds-assistant__title-input { border: 1px solid CanvasText; } }

/* the header chips of the full-page chat (domain dropdown, editable title) and the archived notice */
.ds-chat__head-extras { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); padding-bottom: var(--space-2); }
.ds-chat__archived { margin-block: var(--space-2); }
.ds-assistant__domain { flex: none; width: 200px; max-width: 100%; }
.ds-assistant__domain.ds-field--inline { min-height: var(--control-h-md); }
.ds-assistant__title { display: flex; flex: 1 1 220px; flex-wrap: wrap; align-items: center; gap: var(--space-1); min-width: 0; }
.ds-assistant__title-btn { display: inline-flex; align-items: center; gap: var(--space-2); max-width: 100%; min-height: var(--target-min); padding: 0 var(--space-3); border: 0; border-radius: var(--radius-md); background: transparent; color: var(--color-text); font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.ds-assistant__title-btn:disabled { cursor: not-allowed; color: var(--color-text-muted); }
@media (hover: hover) { .ds-assistant__title-btn:not(:disabled):hover { background: var(--color-surface-hover-2); } }
.ds-assistant__title-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-text); }
.ds-assistant__title-new { padding: 0 var(--space-3); font-size: var(--text-sm); color: var(--color-text-muted); }
.ds-convlist > .ds-btn { padding-inline: var(--space-3); white-space: nowrap; }
@media (max-width: 767px) { .ds-assistant__history { min-width: var(--target-min); } }   /* the history button is icon only below 400 px: 44 wide as it is high (DESIGN.md 14) */

/* phones (DESIGN 14.1, Chat): the suggested questions are one scrolling row, each chip wraps its own text; the history button of the full-page chat is compact */
@media (max-width: 767px) {
  .ds-chat__prompts { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .ds-chat__prompts .ds-chip--prompt { flex: none; width: max-content; max-width: min(14rem, 70vw); height: auto; padding-block: var(--space-2); text-align: left; white-space: normal; }
  .ds-chat__prompts .ds-chip--prompt:focus-visible { outline-offset: -2px; }   /* inside the chip: the scrolling row never clips the ring (DESIGN.md 15.2 rule 3) */
  .ds-assistant__history { padding-inline: var(--space-3); letter-spacing: 0; white-space: nowrap; }
  .ds-chat__log { min-height: 96px; }   /* the log never collapses to a few pixels under the notice, the voice bar and the input */
}
/* 320 px phones (verification P1 A-7): header, notice, voice bar and input have to fit the 568 px of the sheet and leave the log 96 px. The speaker switch is the first row of the voice settings popover (the
   gear stays), the history button is its icon (its name is read out), a suggested question is one line, the quota notice and the input are compact */
@media (max-width: 399px) {
  .ds-voice-controls .ds-voice-toggle { display: none; }
  .ds-chat__prompts .ds-chip--prompt { display: block; max-width: 12rem; overflow: hidden; line-height: calc(var(--touch-min) - 2 * var(--space-2)); text-overflow: ellipsis; white-space: nowrap; }
  .ds-chat__quota { gap: var(--space-2); margin-block: var(--space-1); padding: var(--space-2) var(--space-3); font-size: var(--text-xs); }
  .ds-chat__prompts { padding-block: var(--space-1); margin-block: calc(-1 * var(--space-1)); }   /* the row scrolls: room for the chips' 4 px hit areas, so it does not scroll vertically (DESIGN.md 14) */
  .ds-chat__input { gap: var(--space-1); padding-inline: var(--space-2); }   /* the field keeps a usable width beside the microphone and the send disc */
  .ds-assistant__history-label { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.ds-report { position: relative; }   /* the frame scrolls its tables: their hidden labels (absolutely positioned) belong to the frame, they must not widen the page on a phone */

/* voice (34 section 7, DESIGN N-01 voice states): button states beyond the delivered rules, the status line, the speaker toggle, the captions, the settings popover and SC-40 ----------------------- */
.ds-voice[data-state="requesting"], .ds-voice[data-state="thinking"] { background: var(--color-surface-2); color: var(--color-accent); }
.ds-voice[data-state="error"] { color: var(--color-negative); }
.ds-voice[data-state="unavailable"] { cursor: not-allowed; }
.ds-voice[data-state="speaking"] { gap: 3px; }
.ds-voice__spinner { position: absolute; inset: 0; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--color-accent); animation: ds-spin 0.8s linear infinite; }
.ds-voice__bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.ds-voice__bars i { width: 3px; height: 4px; border-radius: 1px; background: currentColor; animation: ds-wave 0.9s ease-in-out infinite; }
.ds-voice__bars i:nth-child(2) { animation-delay: 0.15s; }
.ds-voice__bars i:nth-child(3) { animation-delay: 0.3s; }
@keyframes ds-wave { 0%, 100% { height: 4px; } 50% { height: 14px; } }
.ds-voice--large { width: 48px; height: 48px; }
@media (prefers-reduced-motion: reduce) {
  .ds-voice[data-state="listening"]::before, .ds-voice[data-state="hearing"]::before { inset: -3px; opacity: 1; animation: none; }
  .ds-voice[data-state="listening"]::after, .ds-voice[data-state="hearing"]::after { display: none; }
  .ds-voice__spinner { animation: none; border-top-color: var(--color-accent); border-right-color: var(--color-accent); }
  .ds-voice__bars i { animation: none; height: 10px; }
}
@media (forced-colors: active) { .ds-voice, .ds-voice-toggle { border: 1px solid CanvasText; } }

.ds-chat__voice-bar { display: flex; justify-content: flex-end; margin-bottom: var(--space-2); }
.ds-chat__voice-status { margin-bottom: var(--space-2); }
.ds-voice-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.ds-voice-toggle { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--target-min); padding: 0 var(--space-3); border: 1px solid var(--color-border-strong); border-radius: var(--radius-md); background: transparent; color: var(--color-text-muted); font-size: var(--text-sm); }
.ds-voice-toggle[aria-checked="true"] { border-color: var(--color-accent); background: var(--color-accent); color: var(--color-on-accent); }
@media (hover: hover) { .ds-voice-toggle[aria-checked="false"]:hover { background: var(--color-surface-hover-2); color: var(--color-text); } }

.ds-voice-status { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-3); min-height: var(--target-min); padding-inline: var(--space-3); font-size: var(--text-sm); color: var(--color-text-muted); }
.ds-voice-meter { display: inline-flex; align-items: flex-end; gap: 3px; height: 20px; flex: none; }
.ds-voice-meter i { width: 4px; border-radius: 2px; background: var(--color-surface-3); }
.ds-voice-meter i:nth-child(1) { height: 6px; }
.ds-voice-meter i:nth-child(2) { height: 9px; }
.ds-voice-meter i:nth-child(3) { height: 12px; }
.ds-voice-meter i:nth-child(4) { height: 15px; }
.ds-voice-meter i:nth-child(5) { height: 18px; }
.ds-voice-meter i[data-on="true"] { background: var(--color-accent); }
.ds-voice-status__text { font-weight: var(--weight-medium); color: var(--color-text); }
.ds-voice-status__partial { flex: 1 1 12rem; min-width: 0; color: var(--color-text-muted); overflow-wrap: anywhere; }

.ds-voice-caption { margin-top: var(--space-3); padding-left: var(--space-3); border-left: 2px solid var(--color-border-strong); font-size: var(--text-sm); color: var(--color-text-body); }
.ds-voice-caption__head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-3); margin: 0 0 var(--space-2); color: var(--color-text-muted); }
.ds-voice-chip { display: inline-flex; align-items: center; gap: var(--space-2); padding: 2px var(--space-3); border-radius: var(--radius-pill); background: var(--color-accent); color: var(--color-on-accent); font-size: var(--text-xs); font-weight: var(--weight-semibold); }
.ds-voice-caption__hint { font-size: var(--text-xs); }
.ds-voice-caption__text { margin: 0; }
.ds-voice-caption__sentence { padding: 1px 4px; border-radius: var(--radius-xs); }
.ds-voice-caption__sentence[data-current="true"] { background: var(--color-surface-2); color: var(--color-text); }
.ds-voice-caption__mock { min-height: var(--target-min); }
.ds-msg__edit { margin: calc((20px - var(--target-min)) / 2) calc(-1 * var(--space-2)) calc((20px - var(--target-min)) / 2) var(--space-1); vertical-align: middle; }   /* the icon button reaches past the 20 px line of the bubble */

.ds-voice-pop { display: grid; gap: var(--space-4); width: min(340px, calc(100vw - 48px)); }
.ds-voice-pop__row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.ds-voice-pop__field { display: grid; gap: var(--space-2); }
.ds-voice-pop__field > label { font-size: var(--text-sm); color: var(--color-text-muted); }
.ds-voice-pop__note { margin: 0; font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-voice-pop__status { display: grid; gap: var(--space-1); padding-top: var(--space-3); border-top: 1px solid var(--color-border-subtle); font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-voice-pop__status p { margin: 0; }

.ds-voice-panel { display: grid; justify-items: center; gap: var(--space-4); padding: var(--space-6) var(--space-5); border-radius: var(--radius-chat); background: var(--color-surface-2); text-align: center; }
.ds-voice-orb { position: relative; display: grid; place-items: center; width: 96px; height: 96px; border-radius: 50%; background: var(--color-surface-3); color: var(--color-accent); }
.ds-voice-orb[data-state="listening"], .ds-voice-orb[data-state="hearing"] { background: var(--color-accent); color: var(--color-on-accent); }
.ds-voice-orb[data-state="listening"]::before, .ds-voice-orb[data-state="listening"]::after,
.ds-voice-orb[data-state="hearing"]::before, .ds-voice-orb[data-state="hearing"]::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--color-accent); opacity: 0; animation: ds-ring 1.2s var(--ease) infinite; }
.ds-voice-orb[data-state="listening"]::after, .ds-voice-orb[data-state="hearing"]::after { animation-delay: 0.6s; }
.ds-voice-orb[data-state="thinking"]::before { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 3px solid transparent; border-top-color: var(--color-accent); animation: ds-spin 0.9s linear infinite; }
.ds-voice-orb[data-state="speaking"] { background: var(--color-accent-strong); color: var(--color-on-accent); }
.ds-voice-orb .ds-voice__bars { height: 40px; gap: 6px; }
.ds-voice-orb .ds-voice__bars i { width: 7px; animation-name: ds-wave-big; }
@keyframes ds-wave-big { 0%, 100% { height: 8px; } 50% { height: 40px; } }
.ds-voice-panel__status { justify-content: center; }
.ds-voice-panel .ds-voice-status__text { font-size: var(--text-lg); }
.ds-voice-panel .ds-voice-status__partial { flex-basis: 100%; text-align: center; }
.ds-voice-panel__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-3); }
.ds-voice-panel__hint { margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); }
.ds-voice-panel__timing { margin: 0; font-size: var(--text-xs); color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.ds-voice-panel__engines { display: grid; gap: 2px; font-size: var(--text-xs); color: var(--color-text-subtle); }
@media (prefers-reduced-motion: reduce) {
  .ds-voice-orb[data-state="listening"]::before, .ds-voice-orb[data-state="hearing"]::before { inset: -4px; opacity: 1; animation: none; }
  .ds-voice-orb[data-state="listening"]::after, .ds-voice-orb[data-state="hearing"]::after { display: none; }
  .ds-voice-orb[data-state="thinking"]::before { animation: none; border-color: var(--color-accent); }
  .ds-voice-orb .ds-voice__bars i { animation: none; height: 24px; }
}
@media (min-width: 768px) {
  .ds-voice-panel { grid-template-columns: auto minmax(0, 1fr); justify-items: start; align-items: center; column-gap: var(--space-6); padding: var(--space-4) var(--space-6); text-align: left; }
  .ds-voice-panel .ds-voice-orb { grid-row: 1 / span 4; }
  .ds-voice-panel > :not(.ds-voice-orb) { grid-column: 2; }
  .ds-voice-panel:has(> .ds-voice-panel__timing) .ds-voice-orb { grid-row: 1 / span 5; }
  .ds-voice-panel__status, .ds-voice-panel__actions { justify-content: flex-start; }
  .ds-voice-panel .ds-voice-status__partial { text-align: left; }
}
@media (max-width: 767px) {
  .ds-voice-panel { position: fixed; inset: 0; z-index: var(--z-dialog); align-content: center; border-radius: 0; background: var(--color-surface-1); padding-bottom: calc(var(--space-6) + env(safe-area-inset-bottom)); }
}

/* tasks, notifications and the mail outbox (AIS-39): origin chip, due and effect badges, stepper, list and detail of "Moji zadaci", notification rows, outbox -------------------- */
.ds-prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.ds-prewrap--box { max-height: 20rem; overflow: auto; padding: var(--space-4); border-radius: var(--radius-md); background: var(--color-bg); font-size: var(--text-sm); }   /* a flat read-only field on a glass drawer, no edge (DESIGN.md 6): the fill of the fields beside it (8.2, bg on a card); surface-2 is the glass itself in the dark theme */
.ds-dialog__form { display: grid; gap: var(--space-4); margin-top: var(--space-4); }

/* the filter bar on the surface-2 content panel: fields and chips take the darker fill so that they stay visible */
.ds-filterbar--panel .ds-field { --field-bg: var(--color-surface-1); }
.ds-filterbar--panel .ds-search { min-width: min(100%, 22rem); }
.ds-filterbar--panel .ds-chip--filter { background: var(--color-surface-1); }
.ds-filterbar--panel .ds-chip--filter[aria-pressed="true"] { background: var(--color-surface-3); }
/* the same bar inside a surface-1 card (the instruction list) takes bg, the fill DESIGN.md 8.2 gives a field on a surface-1 card; a selected chip stays surface-3 (AIS-310) */
.ds-card .ds-filterbar--panel .ds-field { --field-bg: var(--color-bg); }
.ds-card .ds-filterbar--panel .ds-chip--filter:not([aria-pressed="true"]) { background: var(--color-bg); }
@media (max-width: 639px) {
  .ds-filterbar--scroll .ds-filterbar__filters { flex-wrap: nowrap; overflow-x: auto; padding-block: var(--space-1); margin-block: calc(-1 * var(--space-1)); }   /* room for the chips' 4 px hit areas inside the scrolling row (DESIGN.md 14) */
  .ds-filterbar--scroll .ds-chip { flex: none; }
  .ds-filterbar--scroll .ds-chip:focus-visible { outline-offset: -2px; }   /* the ring inside the chip, never clipped by the row (DESIGN.md 15.2 rule 3) */
}

.ds-origin { display: inline-flex; align-items: center; gap: var(--space-1); height: 24px; padding: 0 var(--space-2); border-radius: var(--radius-chip); background: var(--color-surface-2); color: var(--color-text-body); font-size: var(--text-xs); white-space: nowrap; }
.ds-origin--compact { flex: none; width: 24px; padding: 0; justify-content: center; }
.ds-due { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.ds-due__date { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ds-effect { display: inline-flex; align-items: center; gap: var(--space-1); height: 20px; padding: 0 var(--space-2); border-radius: var(--radius-pill); background: var(--tint-neutral); color: var(--color-text-body); font-size: var(--text-xs); font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ds-effect--muted { font-weight: var(--weight-regular); color: var(--color-text-muted); }

.ds-stepper { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.ds-stepper__step { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--color-text-muted); font-size: var(--text-sm); }
.ds-stepper__step + .ds-stepper__step::before { content: ""; width: 24px; height: 2px; margin-right: var(--space-1); background: var(--color-border-strong); }
.ds-stepper__mark { display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border: 2px solid var(--color-border-strong); border-radius: 50%; font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.ds-stepper__step.is-done .ds-stepper__mark { border-color: var(--color-primary); background: var(--color-primary); color: var(--color-on-primary); }
.ds-stepper__step.is-current { color: var(--color-text); font-weight: var(--weight-semibold); }
.ds-stepper__step.is-current:not(.is-done) .ds-stepper__mark { border-color: var(--color-accent); color: var(--color-accent); }
.ds-stepper--compact .ds-stepper__label { font-size: var(--text-xs); }

.ds-tasks-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.ds-tasks-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
@media (max-width: 479px) { .ds-tasks-head > .ds-segmented { display: flex; width: 100%; } .ds-tasks-head > .ds-segmented .ds-segmented__item { flex: 1 0 auto; min-width: 0; padding-inline: var(--space-2); } }   /* the task tabs on a phone: the full width, one row that spreads the items and scrolls if they do not fit (never two rows) */
.ds-tasks { display: grid; grid-template-columns: minmax(0, 3fr) minmax(360px, 2fr); gap: var(--space-5); align-items: start; }   /* AIS-525: the list and the detail share the width 60/40, the detail at least 360 px */
.ds-tasks__list, .ds-tasks__detail { min-width: 0; }
.ds-tasks__list .ds-table th, .ds-tasks__list .ds-table td { padding-inline: var(--space-3); }
.ds-tasks__detail-body { display: grid; gap: var(--space-4); }
@media (max-width: 1099px) {
  .ds-tasks { grid-template-columns: minmax(0, 1fr); }
  .ds-tasks__detail { display: none; }
}
/* the title cell (63 5.2, DESIGN N-03): the origin glyph and the title, then a muted line with the other person and the comment and file counts (12 px text, 14 px glyphs) */
.ds-task-title { display: grid; gap: var(--space-1); min-width: 0; }
.ds-task-title__main { display: inline-flex; align-items: center; gap: var(--space-2); min-width: 0; }
.ds-task-title__text { min-width: 7rem; overflow-wrap: break-word; }
.ds-task-title__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); padding-inline-start: calc(24px + var(--space-2)); font-size: var(--text-xs); color: var(--color-text-muted); }   /* under the title text: the 24 px origin glyph and its gap */
.ds-task-count { display: inline-flex; align-items: center; gap: var(--space-1); font-variant-numeric: tabular-nums; }
/* Tabla (63 5.4, DESIGN N-03 board-column / board-lane / task-card): the summary strip (12/400 muted labels, 13/600 counts, no colour), then the column rows inside
   one sideways scroller (never the page); columns are equal shares of at least 200 px, 12 px apart; a lane header over each grouped row; no motion at all, so
   prefers-reduced-motion has nothing to stop. Phones: a scrolling status tab row over one card list, lanes as section labels. */
.ds-tasks-board, .ds-board { min-width: 0; }
.ds-board { display: grid; gap: var(--space-3); }
.ds-board .ds-filterbar { margin-bottom: 0; }
.ds-board__summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-2); margin: 0; font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-board__count { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-text); font-variant-numeric: tabular-nums; }
.ds-board__pair:not(:last-child)::after { content: "·"; content: "·" / ""; margin-inline-start: var(--space-2); }   /* the middot ends a line, never starts one, and is not read out */
.ds-board__scroller { min-width: 0; overflow-x: auto; overflow-y: hidden; padding-bottom: var(--space-2); scrollbar-width: thin; }
.ds-board__lanes { display: grid; gap: var(--space-3); min-width: min-content; }
.ds-board__columns { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: var(--space-3); align-items: start; }
.ds-board-column { display: grid; align-content: start; gap: var(--space-2); min-width: 0; padding: var(--space-2); border: 1px dashed transparent; border-radius: var(--radius-inner); background: var(--color-surface-1); }
.ds-board-column--target { border-color: var(--color-accent); }   /* a column the dragged card may land on */
.ds-board-column__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-2); min-height: 32px; margin: 0; padding: var(--space-1) var(--space-1) 0; font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-text); }
.ds-board-column__count { font-size: var(--text-xs); color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.ds-board-column__caption { font-size: var(--text-xs); font-weight: var(--weight-regular); color: var(--color-text-muted); }
.ds-board-lane { display: grid; gap: var(--space-2); padding-top: var(--space-2); border-top: 1px solid var(--color-border-subtle); }
.ds-board-lane__head { position: sticky; left: 0; justify-self: start; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); min-height: 36px; margin: 0; font-size: var(--text-xs); font-weight: var(--weight-regular); color: var(--color-text-muted); }   /* sticky: the lane's name stays in view while the column row scrolls sideways */
.ds-board-lane__toggle { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--target-min); padding: 0 var(--space-1); border: 0; border-radius: var(--radius-md); background: none; color: var(--color-text); font: inherit; font-size: var(--text-sm); font-weight: var(--weight-semibold); cursor: pointer; }
@media (hover: hover) { .ds-board-lane__toggle:hover { background: var(--color-surface-hover-1); } }
.ds-board-lane__counts { font-variant-numeric: tabular-nums; }
.ds-task-card { position: relative; display: grid; gap: var(--space-2); min-width: 0; padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--color-surface-2); }
@media (hover: hover) { .ds-task-card:hover { background: var(--color-surface-hover-2); } }
.ds-task-card[draggable="true"] { cursor: grab; }
.ds-task-card--dragging { opacity: 0.4; }   /* the placeholder at the origin while the browser draws the moving card */
.ds-task-card__title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin-inline-end: calc(var(--target-min) - var(--space-2)); font-size: var(--text-sm); font-weight: var(--weight-semibold); line-height: 1.4; color: var(--color-text); text-decoration: none; overflow-wrap: anywhere; }
.ds-task-card__title::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-md); }   /* the link's hit area is the whole card (9.3) */
.ds-task-card__title:focus-visible { outline: none; }
.ds-task-card__title:focus-visible::after { outline: 2px solid var(--color-focus-ring); outline-offset: 2px; }
.ds-task-card__menu { position: absolute; top: var(--space-1); right: var(--space-1); }   /* a separate stop beside the link, above its hit area by source order; no z-index, so an open menu is not trapped under the next card */
.ds-task-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-task-card__meta > .ds-due { display: contents; }   /* the date and its markers wrap one by one inside the row */
.ds-task-card__meta > .ds-initials { margin-inline-start: auto; }
.ds-task-card__reason { margin: 0; overflow: hidden; font-size: var(--text-xs); color: var(--color-text-muted); text-overflow: ellipsis; white-space: nowrap; }
.ds-task-card > .ds-effect { justify-self: start; }
.ds-initials--none { border: 1px dashed var(--color-border-strong); background: none; }   /* Bez izvršioca: an empty disc */
.ds-board__tabs { margin-inline: calc(-1 * var(--space-3)); padding: var(--space-1) var(--space-3) var(--space-2); overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }   /* the status well scrolls sideways inside the panel; the padding keeps its focus ring and pill shadow in view */
.ds-board__tabs .ds-segmented__item { flex: none; }
.ds-board__list { display: grid; gap: var(--space-2); }
.ds-board__section { margin: var(--space-2) 0 0; font-size: var(--text-xs); font-weight: var(--weight-bold); letter-spacing: var(--tracking-upper); text-transform: uppercase; color: var(--color-text-muted); }

/* the task dialog (SC-50): the visibility caption in text-muted, and the attachment-chip row with the ghost "Priloži datoteku" over a stretched native file input */
.ds-task-dialog .ds-field__help { color: var(--color-text-muted); }
.ds-task-dialog__origin { margin: 0; font-size: var(--text-xs); color: var(--color-text-muted); }   /* "Nastalo iz: Chat, {date}" of a task made from an answer */
.ds-task-files { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-2); }
.ds-task-attach { position: relative; gap: var(--space-2); }
.ds-task-attach > input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.ds-task-attach:focus-within { outline: 2px solid var(--color-focus-ring); outline-offset: 2px; }
.ds-attachment { display: grid; gap: var(--space-1); min-width: 0; max-width: 280px; }
.ds-attachment__chip { display: inline-flex; align-items: center; gap: var(--space-2); min-width: 0; min-height: 32px; padding-left: var(--space-2); border-radius: var(--radius-md); background: var(--color-surface-2); color: var(--color-text-body); }
.ds-attachment__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--color-text); }
.ds-attachment__size { flex: none; font-size: var(--text-xs); color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.ds-attachment__chip .ds-icon-btn { flex: none; }
.ds-attachment__thumb { display: block; width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-md); background: var(--color-surface-2); }
.ds-attachment__deleted { font-size: var(--text-xs); color: var(--color-text-muted); overflow-wrap: anywhere; }

.ds-task-detail { display: grid; gap: var(--space-4); min-width: 0; }
.ds-task-detail > .ds-status { justify-self: start; }
.ds-task-detail__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.ds-task-detail__head > .ds-icon-btn { flex: none; }   /* a long title never squeezes the edit button below its target */
.ds-task-detail__title { font-size: var(--text-lg); line-height: 1.4; font-weight: var(--weight-bold); overflow-wrap: anywhere; }
.ds-task-detail__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.ds-task-detail__section { display: grid; gap: var(--space-2); }
.ds-task-detail__h { font-size: var(--text-xs); font-weight: var(--weight-bold); letter-spacing: var(--tracking-upper); text-transform: uppercase; color: var(--color-text-muted); }
.ds-task-detail__caption, .ds-task-detail__muted { font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-task-detail__measure { font-weight: var(--weight-semibold); }
.ds-task-detail__origin { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.ds-task-detail__origin > a { display: inline-flex; align-items: center; min-height: var(--target-min); }   /* a link that stands on its own is a control (DESIGN.md 14 E-4): 32, 44 on touch and phones */
.ds-task-detail__person { display: inline-flex; align-items: center; gap: var(--space-2); }
.ds-task-effects { display: grid; gap: var(--space-3); margin: 0; padding: 0; list-style: none; }
.ds-task-effects__item { display: grid; gap: var(--space-1); }
.ds-task-effects__kind { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-task-effects__text { font-size: var(--text-sm); color: var(--color-text-body); }
/* the task conversation (63 5.3, DESIGN N-03 activity-item / comment-box): an initials disc, then the name, time and text without bubbles; history lines are one muted
   line with a glyph and no disc; the comment box is the chat input's surface, sticky at the bottom of the detail (above the safe area on phones) */
.ds-initials { display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--color-surface-3); color: var(--color-text); font-size: var(--text-xs); font-weight: var(--weight-semibold); line-height: 1; }
.ds-activity { display: grid; gap: var(--space-3); margin: 0; padding: 0; list-style: none; }
.ds-activity__item { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: var(--space-3); align-items: start; }
.ds-activity__body { display: grid; justify-items: start; gap: var(--space-2); min-width: 0; }
.ds-activity__body > * { max-width: 100%; }
.ds-activity__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); width: 100%; min-height: 24px; }
.ds-activity__name { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-text); }
.ds-activity__time, .ds-activity__muted { font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-activity__time { font-variant-numeric: tabular-nums; }
.ds-activity__meta .ds-popover-anchor { margin-inline-start: auto; }
.ds-activity__meta .ds-icon-btn { margin-block: calc((24px - var(--target-min)) / 2); }   /* the menu button (32 px, 44 touch) reaches into the gaps, so the row stays as high as the initials disc */
.ds-activity__text { font-size: var(--text-chat); line-height: var(--lh-chat); color: var(--color-text-body); }
.ds-activity__edit { display: grid; gap: var(--space-2); width: 100%; }
.ds-activity__edit-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2); }
.ds-activity__history { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); padding-block: var(--space-1); font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-comment-box { position: sticky; bottom: 0; z-index: 1; display: grid; gap: var(--space-2); padding-block: var(--space-2); background: var(--color-surface-1); }
.ds-comment-box__field { display: grid; gap: var(--space-2); min-height: 72px; padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3); border-radius: var(--radius-chat); background: var(--color-surface-2); }
.ds-comment-box__field:focus-within { outline: 2px solid var(--color-focus-ring); }
.ds-comment-box__field textarea { min-height: var(--target-min); resize: none; font-size: var(--text-chat); line-height: var(--lh-chat); }
.ds-comment-box__field .ds-field__counter { justify-self: end; margin-top: 0; }
.ds-comment-box__toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); }
.ds-comment-box__send { margin-inline-start: auto; }
.ds-comment-box__reply { display: grid; gap: var(--space-3); min-width: 240px; }
/* the voice note (63 4.7, DESIGN.md comment-box / voice-note): while recording the meter, "Snimam... m:ss" (13/600) and a stop button take the text's place; a pending
   note is the browser's audio element with Snimi ponovo and Odbaci, the captions 12/400 muted; a stored one is the audio over "Prepis" and its text. No custom player. */
.ds-comment-box__recording { min-height: 56px; padding-inline: 0; }
.ds-comment-box__recording .ds-voice-status__text { font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; }
.ds-comment-box__stop { margin-inline-start: auto; }
.ds-comment-box__note { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.ds-comment-box__note .ds-voice-note__audio { flex: 1 1 240px; }
.ds-comment-box__note-actions { display: inline-flex; flex-wrap: wrap; gap: var(--space-2); }   /* the two buttons wrap together */
.ds-comment-box__caption { margin: 0; font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-voice-note { display: grid; justify-items: start; gap: var(--space-2); width: 100%; }
.ds-voice-note__audio { display: block; width: 100%; max-width: 360px; }
@media (max-width: 767px) {
  .ds-comment-box { padding-bottom: calc(var(--space-2) + env(safe-area-inset-bottom)); }
}
@media (forced-colors: active) { .ds-comment-box__field, .ds-initials { border: 1px solid CanvasText; } }

.ds-notif-group + .ds-notif-group { margin-top: var(--space-5); }
.ds-notif-group__title { margin-bottom: var(--space-2); font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-upper); text-transform: uppercase; color: var(--color-text-muted); }
.ds-notif-list { display: grid; gap: var(--space-1); margin: 0; padding: 0; list-style: none; }
.ds-notif { display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: 48px; padding: var(--space-1) var(--space-3); border: 0; border-radius: var(--radius-md); background: transparent; color: var(--color-text); text-align: left; }
@media (hover: hover) { .ds-notif:hover { background: var(--color-surface-hover-2); } }
.ds-notif.is-read { color: var(--color-text-muted); }
.ds-notif__body { display: grid; flex: 1; gap: 2px; min-width: 0; }
.ds-notif__title { font-weight: var(--weight-semibold); overflow-wrap: break-word; }
.ds-notif.is-read .ds-notif__title { font-weight: var(--weight-regular); }
.ds-notif__detail { font-size: var(--text-xs); color: var(--color-text-muted); overflow-wrap: break-word; }
.ds-notif__meta { display: inline-flex; flex: none; align-items: center; gap: var(--space-2); font-size: var(--text-xs); color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.ds-notif__dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--color-accent); }
.ds-notif__go { flex: none; color: var(--color-text-muted); }
.ds-notif-skeleton { display: grid; gap: var(--space-3); }
/* phones: full-width rows, the time under the text instead of beside it, a card with less padding */
@media (max-width: 639px) {
  .ds-notif-card, .ds-tasks__list .ds-card { padding: var(--space-3); }
  .ds-notif { display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: start; gap: var(--space-1) var(--space-3); padding-inline: var(--space-2); }
  .ds-notif > .ds-feature-icon { grid-row: 1 / span 2; }
  .ds-notif__meta { grid-column: 2; }
  .ds-notif__go { display: none; }
  .ds-tasks__list .ds-table--stack td { flex-wrap: wrap; justify-content: flex-start; gap: var(--space-1) var(--space-3); }
  .ds-tasks__list .ds-table--stack td.ds-table__primary { display: flex; }
  .ds-tasks__list .ds-table--stack td:empty { display: none; }
}

.ds-outbox__banner { margin-bottom: var(--space-4); }
.ds-outbox__channel { display: inline-flex; align-items: center; gap: var(--space-2); }
.ds-outbox__recipient { display: grid; min-width: 0; padding-block: var(--space-1); overflow-wrap: break-word; }   /* name over address: a two-line row of 48 (DESIGN.md 9.3); the address breaks only when it cannot fit */
.ds-outbox__status { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); white-space: nowrap; }   /* the badge never wraps out of its 20 px pill */
.ds-outbox__body-title { margin: var(--space-5) 0 var(--space-2); font-size: var(--text-sm); font-weight: var(--weight-bold); }
@media (forced-colors: active) { .ds-origin, .ds-effect, .ds-notif__dot, .ds-attachment__chip { border: 1px solid CanvasText; } }

/* access matrix (13 section 5.4): rows of three native radios against the levels none / read / contribute; below 640 px a row stacks and every radio shows its level */
.ds-matrix { display: grid; min-width: 0; }
.ds-matrix__head, .ds-matrix__row { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 4.5rem); align-items: center; gap: var(--space-2); }
.ds-matrix__head { padding-bottom: var(--space-2); font-size: var(--text-xs); line-height: 1.3; font-weight: var(--weight-semibold); color: var(--color-text-muted); text-align: center; }
.ds-matrix__row { min-height: var(--target-min); padding-block: var(--space-2); border-top: 1px solid var(--color-border-subtle); }
.ds-matrix__label { display: grid; gap: var(--space-1); justify-items: start; min-width: 0; }
.ds-matrix__name { font-size: var(--text-sm); font-weight: var(--weight-semibold); overflow-wrap: anywhere; }
.ds-matrix__sub { font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-matrix__label .ds-status { height: auto; min-height: 20px; padding-block: var(--space-1); border-radius: var(--radius-chip); line-height: 1.3; }
.ds-matrix__levels { grid-column: 2 / -1; display: grid; grid-template-columns: repeat(3, 4.5rem); gap: var(--space-2); min-width: 0; margin: 0; padding: 0; border: 0; }
.ds-matrix__cell { display: inline-flex; align-items: center; justify-content: center; min-height: var(--target-min); cursor: pointer; }
.ds-matrix__cell:has(input:disabled) { color: var(--color-text-muted); cursor: not-allowed; }   /* the level label below 640 px is text a person reads: text-muted, the radio itself shows the disabled state (DESIGN.md 15.1) */
.ds-matrix__locked { grid-column: 2 / -1; font-size: var(--text-sm); color: var(--color-text-muted); }
.ds-matrix__hint { margin-top: var(--space-3); font-size: var(--text-xs); color: var(--color-text-muted); }
@media (min-width: 640px) { .ds-matrix__level { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }
@media (max-width: 639px) {
  .ds-matrix__head { display: none; }
  .ds-matrix__row { grid-template-columns: minmax(0, 1fr); }
  .ds-matrix__levels { grid-column: 1; display: flex; flex-wrap: wrap; gap: 0 var(--space-5); }
  .ds-matrix__locked { grid-column: 1; }
  .ds-matrix__cell { gap: var(--space-2); font-size: var(--text-sm); }
}

/* users and access (SC-25): the tab row, the toolbar chips, the two-line cells of the users table, the sections of the editor drawers, switch rows and check lists */
.ds-admin-tabs { margin-bottom: var(--space-5); }
.ds-admin-tabs .ds-tabstrip { flex-wrap: wrap; gap: var(--space-3) var(--space-6); }   /* a wrapped row sits 12 px below the one above: 2 x the 6 px block hit area of a tab, so the rows' areas touch and never overlap (DESIGN.md 14) */
.ds-admin-bar .ds-filterbar__actions { margin-left: auto; }
@media (max-width: 639px) { .ds-admin-tabs .ds-section-tab { white-space: normal; text-align: left; } }
.ds-admin-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.ds-admin-alert { margin-bottom: var(--space-4); }
.ds-admin-card { padding: var(--space-4); }
.ds-admin-card .ds-table th, .ds-admin-card .ds-table td { padding-inline: var(--space-2); }
.ds-admin-card .ds-table th { white-space: normal; }
.ds-users-table td:nth-child(2) { overflow-wrap: break-word; }
/* from 1100 px up the row actions stay in view while the wide users table scrolls sideways */
@media (min-width: 1100px) {
  .ds-users-table .ds-table__actions { position: sticky; right: 0; background: var(--color-surface-1); box-shadow: -1px 0 0 var(--color-border-subtle); }
  .ds-users-table th.ds-table__actions { z-index: calc(var(--z-sticky) + 1); background: var(--color-surface-2); }
}
@media (hover: hover) and (min-width: 1100px) { .ds-users-table tbody tr:hover td.ds-table__actions { background: var(--color-surface-hover-2); } }
.ds-admin-card .ds-table td { padding-block: var(--space-1); }   /* a two-line cell (name over user name) makes a 48 px row */
@media (max-width: 767px) { .ds-admin-card .ds-table td.ds-table__empty > * { position: sticky; left: 0; width: min(100%, calc(100vw - 6rem)); margin-inline: 0; } }   /* a table wider than its card (users 770 px, audit, usage, sources) spans the empty cell across all of it: the message stays as wide as the visible card (minus the cell padding), pinned to its left edge, instead of centring off-screen */
.ds-admin-card .ds-chip { min-width: 0; }
.ds-admin-card .ds-chip-list { gap: var(--space-1); }
.ds-admin-card .ds-status { white-space: nowrap; }
.ds-user-cell { display: grid; gap: 2px; justify-items: start; min-width: 0; }
.ds-user-cell__name { font-weight: var(--weight-bold); white-space: nowrap; }
.ds-user-cell__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); min-width: 0; }   /* the name and the badge Administrator platforme after it (DESIGN N-23) */
.ds-user-cell__sub { font-size: var(--text-xs); color: var(--color-text-muted); }
/* phones: the sticky name column is narrow (the name and the owner badge wrap), so more of the scrolling columns stays in view */
@media (max-width: 639px) {
  .ds-admin-card { padding: var(--space-3); }
  .ds-users-table td:first-child { max-width: 9.5rem; }
  .ds-users-table .ds-user-cell__name { white-space: normal; }
  .ds-users-table .ds-user-cell__sub { overflow-wrap: anywhere; }
  .ds-users-table .ds-user-cell .ds-status { height: auto; min-height: 20px; padding-block: var(--space-1); border-radius: var(--radius-chip); white-space: normal; line-height: 1.3; }
}
.ds-form-section { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); padding-block: var(--space-4); border-top: 1px solid var(--color-border-subtle); }
.ds-form-section:first-of-type { padding-top: 0; border-top: 0; }
.ds-form-section__title { font-size: var(--text-xs); line-height: var(--lh-tight); font-weight: var(--weight-bold); letter-spacing: var(--tracking-upper); text-transform: uppercase; color: var(--color-text-muted); }
.ds-form-section .ds-formfield, .ds-csettings .ds-formfield { grid-template-columns: minmax(0, 1fr); }
.ds-form-section__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.ds-toggle:disabled { opacity: 0.4; cursor: not-allowed; }
.ds-switch-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: var(--target-min); font-size: var(--text-sm); color: var(--color-text); }
/* DESIGN N-18 "The setting rows": the debug checkbox row, the spinner after its label while it saves, the help and the refusal on lines of their own */
.ds-debug-setting { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--space-2); }
.ds-debug-setting > .ds-field__help, .ds-debug-setting > .ds-alert { flex-basis: 100%; }
.ds-debug-setting > .ds-alert { margin-top: var(--space-2); }
.ds-debug-setting .ds-checkbox:has(input[aria-readonly="true"]) { cursor: default; }   /* the service account's row: shown, not changed */
/* DESIGN N-18 (spec 39 9.1, 9.4): the Debug button, the debug panel and its log. Colours only from tokens; no shadow, no scrim. The `code` family only in .ds-debug-payload--code.
   The docked grid tracks and the slide-in are in layout.css. */
.ds-debug-button[aria-expanded="true"] { background: var(--color-surface-2); color: var(--color-text); }   /* open = the pressed look */
.ds-debug-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius-inner); background: var(--color-surface-1); }   /* an inner card: radius 14 (DESIGN.md 12.00 rule 3) */
.ds-debug-panel__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: 40px; font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-text); }
.ds-debug-panel__note, .ds-debug-marker { display: flex; align-items: flex-start; gap: var(--space-2); margin: 0; font-size: var(--text-xs); line-height: var(--lh-tight); color: var(--color-text-muted); }   /* 12/400 muted with the 16 px info glyph */
.ds-debug-panel__note { margin-bottom: var(--space-2); }
/* the log scrolls inside the panel with the thin scrollbar of DESIGN 8.8 (colours from base.css); question groups 12 apart */
.ds-debug-log { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: var(--space-3); overflow-y: auto; scrollbar-width: thin; scrollbar-gutter: stable; }
.ds-debug-group { display: flex; flex-direction: column; min-width: 0; }
/* a step row is a button: min 36 (44 under touch and below 768), rows separated by border-subtle rules, 12 px text, tabular timing */
.ds-debug-step { display: flex; align-items: center; gap: var(--space-2); width: 100%; min-height: 36px; padding: var(--space-1) 0; border: 0; border-top: 1px solid var(--color-border-subtle); background: none; color: var(--color-text-muted); font: inherit; font-size: var(--text-xs); line-height: var(--lh-tight); font-variant-numeric: tabular-nums; text-align: left; cursor: pointer; }
.ds-debug-step:focus-visible { outline-offset: -2px; }   /* inside the scrolling log the ring is drawn inside the row (DESIGN.md 15.2 rule 3) */
.ds-debug-step--nested { width: calc(100% - var(--space-4)); margin-inline-start: var(--space-4); padding-inline-start: var(--space-2); border-inline-start: 1px solid var(--color-border-subtle); }   /* the work of a tool step: indented 16 with a 1 px guide */
.ds-debug-body { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; padding: 0 0 var(--space-2) var(--space-6); }   /* inset 24, blocks 8 apart */
/* a recorded content: surface-2, radius 8, 12/18 text-body, wraps in place (no sideways scroll), collapsed to 12 lines until data-expanded="true" */
.ds-debug-payload { max-height: calc(12lh + 2 * var(--space-2)); margin: 0; padding: var(--space-2) var(--space-3); overflow: hidden; border-radius: var(--radius-md); background: var(--color-surface-2); color: var(--color-text-body); font-family: var(--font-family); font-size: var(--text-xs); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.ds-debug-payload[data-expanded="true"] { max-height: none; }
.ds-debug-payload--code { font-family: var(--font-family-code); font-size: var(--text-code); line-height: var(--lh-code); }
.ds-debug-newsteps { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: center; min-height: 40px; background: var(--color-surface-1); }   /* sticks to the bottom of the log while following is paused */
/* the inner parts (N-18 anatomy 3-7): the question header (48, two lines; the question 13/600 wraps, never truncated), the row's word, summary (the only ellipsis) and
   timing, the body's caption/value lines (12/600 muted, 12/400 text), passages, the copy row, notes in the log's flow; the switch of the view form under the chat header */
.ds-debug-group__head { display: flex; align-items: flex-start; gap: var(--space-2); width: 100%; min-height: 48px; padding: var(--space-1) 0; border: 0; background: none; color: var(--color-text-muted); font: inherit; font-size: var(--text-xs); line-height: var(--lh-tight); text-align: left; cursor: pointer; }
.ds-debug-group__head:focus-visible { outline-offset: -2px; }
.ds-debug-group__head > .ds-icon { flex: none; margin-top: 2px; }
.ds-debug-group__head > .ds-status { flex: none; margin-left: auto; }
.ds-debug-group__text { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.ds-debug-group__question { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-text); overflow-wrap: anywhere; }
.ds-debug-group__caption { overflow: hidden; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }   /* one caption line each, so a folded group stays about 48 high */
.ds-debug-group__steps, .ds-debug-item { display: flex; flex-direction: column; min-width: 0; }
.ds-debug-step > .ds-icon, .ds-debug-step > .ds-spinner { flex: none; }
.ds-debug-step__label { flex: none; font-weight: var(--weight-semibold); color: var(--color-text); }
.ds-debug-step__summary { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-debug-step__time { flex: none; }
.ds-debug-step__failed, .ds-debug-line--failed { color: var(--color-negative); }   /* the alert glyph of a failed step; a figure not found in the data */
.ds-debug-note { padding-block: var(--space-2); border-top: 1px solid var(--color-border-subtle); }
.ds-debug-body__copy { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-2); font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-debug-line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); margin: 0; font-size: var(--text-xs); line-height: var(--lh-tight); overflow-wrap: anywhere; }
.ds-debug-line__label { font-weight: var(--weight-semibold); color: var(--color-text-muted); }
.ds-debug-line__value { min-width: 0; color: var(--color-text); }
.ds-debug-line__source { min-width: 0; font-weight: var(--weight-semibold); color: var(--color-text); }
.ds-debug-passages { display: flex; flex-direction: column; gap: var(--space-3); margin: 0; padding: 0; list-style: none; }
.ds-debug-passage, .ds-debug-payload-block { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.ds-debug-payload-block { align-items: flex-start; }
.ds-debug-payload-block > .ds-debug-payload { align-self: stretch; }
.ds-debug-layer { min-width: 0; }
.ds-debug-table .is-num { white-space: nowrap; }   /* a figure never breaks; the table scrolls in its own container */
.ds-chat__debug-switch { margin-bottom: var(--space-2); }
:is(.ds-debug-panel__head, .ds-debug-panel__toolbar) .ds-status { white-space: nowrap; }   /* the state word stays on one line in its 20 px badge */
@media (pointer: coarse), (max-width: 767px) { .ds-debug-step { min-height: var(--touch-min); } }
@media (prefers-reduced-motion: reduce) {
  .ds-debug-log { scroll-behavior: auto; }   /* following jumps to the newest step, never smooth-scrolls */
  .ds-debug-log .ds-spinner { animation: none; border-right-color: var(--color-accent); }   /* a static spinner */
}
/* DESIGN N-18 item 3a (spec 68 §3.7): the timeline strip of a finished question under the open group's header, inset 24 left and 16 right; two 8 px rows 2 px apart on
   surface-2, segments by start and duration with a 1 px surface-1 edge at their right end, chart tokens by kind, marks as 2 px muted ticks; the summary wraps. */
.ds-debug-timeline { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; padding: 0 var(--space-4) var(--space-2) var(--space-6); }
.ds-debug-timeline__track { display: flex; flex-direction: column; gap: 2px; }
.ds-debug-timeline__row { position: relative; height: 8px; border-radius: var(--radius-xs); background: var(--color-surface-2); }
.ds-debug-timeline__seg { position: absolute; top: 0; bottom: 0; box-sizing: border-box; border-right: 1px solid var(--color-surface-1); border-radius: 2px; }
.ds-debug-timeline__seg--model { background: var(--color-chart-1); }
.ds-debug-timeline__seg--data { background: var(--color-chart-2); }
.ds-debug-timeline__seg--knowledge { background: var(--color-chart-3); }
.ds-debug-timeline__seg--phase { background: var(--color-chart-4); }
.ds-debug-timeline__seg--mark { width: 2px; border: 0; border-radius: 0; background: var(--color-text-muted); }
.ds-debug-timeline__summary { margin: 0; font-size: var(--text-xs); line-height: var(--lh-tight); font-variant-numeric: tabular-nums; color: var(--color-text-muted); overflow-wrap: anywhere; }
@media (forced-colors: active) { .ds-debug-timeline__seg { outline: 1px solid CanvasText; } }
.ds-check-list { display: grid; min-width: 0; }
.ds-check-list--scroll { max-height: 16rem; overflow-y: auto; }
.ds-temp-password { display: flex; align-items: flex-end; gap: var(--space-2); }
.ds-temp-password .ds-formfield { flex: 1; min-width: 0; }
.ds-csettings { display: grid; gap: var(--space-4); max-width: 40rem; }
.ds-csettings__pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); align-items: start; }
@media (max-width: 639px) { .ds-csettings__pair { grid-template-columns: minmax(0, 1fr); } }

/* domains (SC-26): the banner row, the grid of domain cards (1 / 2 / 3 columns), the card and the panels of the access drawer */
.ds-domains-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); margin-bottom: var(--space-5); }
.ds-domains-head .ds-alert { flex: 1 1 18rem; }
.ds-domain-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
@media (min-width: 768px) { .ds-domain-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .ds-domain-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ds-domain-card { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.ds-domain-card[aria-busy="true"] { opacity: 0.6; }
.ds-domain-card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); }
.ds-domain-card__name { min-width: 0; overflow-wrap: anywhere; }
.ds-domain-card__facts { display: grid; gap: var(--space-1); font-size: var(--text-sm); }
.ds-domain-card__warning { display: flex; align-items: center; gap: var(--space-2); color: var(--color-warning); font-weight: var(--weight-bold); }
.ds-domain-card__reason { color: var(--color-text-muted); }
.ds-domain-card__reason::first-letter { text-transform: uppercase; }
.ds-domain-card__switch { margin-top: auto; padding-top: var(--space-3); border-top: 1px solid var(--color-border-subtle); }
.ds-domain-card__switch .ds-field__help { margin-top: 0; }
.ds-domain-card__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.ds-domain-card__icons { display: inline-flex; flex-wrap: wrap; }
.ds-domain-access__alert { margin-top: var(--space-4); }
.ds-domain-access__panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); margin-top: var(--space-4); }

/* data sources (SC-27, AIS-43): the head row, the eight-column table, the drawer of one source and its forms -------- */
.ds-sources-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-3) var(--space-4); margin-bottom: var(--space-5); }
.ds-sources-head .ds-btn--ghost { margin-right: auto; white-space: normal; text-align: left; }
.ds-sources-table .ds-table { min-width: 66rem; }   /* eight columns: below 1100 px the table scrolls sideways inside its wrapper, it never stacks */
.ds-sources-table .ds-table__primary { white-space: nowrap; }
.ds-sources-table td:nth-child(2) { min-width: 11.5rem; }   /* the type label takes two lines at most */
.ds-sources-table td:nth-child(n+6) { white-space: nowrap; }   /* dates stay on one line */
@media (max-width: 639px) { .ds-sources-table td.ds-table__primary { max-width: 9.5rem; white-space: normal; overflow-wrap: anywhere; } }   /* phones: a narrow name column leaves room for the scrolling ones */
.ds-source-badges { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }
.ds-source-dataset-line { margin: 0 0 var(--space-4); }   /* spec 26 23.24.2: the dataset line keeps the badges' gap above the tab strip */
.ds-source-live { margin-inline-start: var(--space-2); vertical-align: middle; }   /* the live pill (her .ds-live-pill, RD-24) after the name of a source in the list */
.ds-source-live, .ds-source-badges .ds-live-pill { box-sizing: border-box; height: 20px; padding-block: 0; font-size: var(--text-xs); }   /* as tall as the status badges beside it (20 px, text-xs); her pill is 4 / 10 px padding on the 13 px body */
.ds-source-alert { margin-top: var(--space-4); }
.ds-source-panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); margin-top: var(--space-4); }
.ds-source-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.ds-source-actions .ds-tooltip { left: 0; transform: none; }   /* the button sits near the left edge of the drawer: the tooltip opens rightwards */
.ds-source-table .ds-table th, .ds-source-table .ds-table td { padding-inline: var(--space-2); }
.ds-source-table .ds-table th { white-space: normal; }
.ds-source-table .ds-table td { height: auto; padding-block: var(--space-2); vertical-align: top; }
.ds-source-table .ds-status { white-space: nowrap; }
.ds-source-notes { display: grid; gap: var(--space-1); }
.ds-source-notes .ds-field__help { margin: 0; }
@media (max-width: 767px) { .ds-source-tabs-wrap { margin: calc(-1 * var(--space-1)); padding: var(--space-1); overflow-x: auto; scrollbar-width: thin; } .ds-source-tabs { width: max-content; } .ds-source-tabs .ds-segmented__item { flex: none; white-space: nowrap; } }   /* three tabs (Struktura, Zdravlje, Izveštaj) do not fit a phone: the well keeps its 44 px items and scrolls sideways inside the drawer (DESIGN.md 14.1, as the domain row); the wrapper's padding keeps the focus ring in view */
.ds-source-tables summary { min-height: var(--target-min); display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); font-weight: var(--weight-bold); color: var(--color-text); cursor: pointer; }
.ds-source-tables ul { margin: 0; padding-left: var(--space-5); font-size: var(--text-sm); color: var(--color-text-body); }
.ds-source-status { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.ds-form-group { display: grid; gap: var(--space-2); min-width: 0; }
.ds-source-footer { display: contents; }   /* only a handle for the focus: the buttons stay items of the drawer footer */
/* the tab "Izveštaj" (spec 27 14.2): one sentence per check of the connection test, its glyph says passed or failed (never the colour alone) */
.ds-report-checks { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.ds-report-check { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--color-text); }
.ds-report-check .ds-icon { flex: none; }
.ds-report-check--ok .ds-icon { color: var(--color-positive); }
.ds-report-check--failed .ds-icon { color: var(--color-negative); }
.ds-report-filters { margin: 0; padding-left: var(--space-5); }

/* ---- Instructions (SC-22, DESIGN N-05): strip, segment nav, list, detail, editor, submit step, versions, conflicts, usage -------------------------- */
.ds-istrip { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-5); font-size: var(--text-sm); color: var(--color-text); }
.ds-istrip__item { white-space: nowrap; }
.ds-istrip__conflicts { position: relative; border: 0; cursor: pointer; font-family: inherit; }
.ds-istrip__conflicts::before { content: ""; position: absolute; inset: calc((20px - var(--target-min)) / 2) 0; }   /* the 20 px badge button keeps its look and is a 32 / 44 px target (DESIGN.md 14) */
.ds-segnav { display: flex; flex-direction: column; gap: var(--space-1); }
.ds-segnav__item { display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: var(--target-min); padding: var(--space-2) var(--space-3); border: 0; border-radius: var(--radius-md); background: transparent; color: var(--color-text-muted); font-family: inherit; font-size: var(--text-sm); text-align: left; cursor: pointer; }
.ds-segnav__item[aria-selected="true"] { background: var(--color-surface-3); color: var(--color-text); font-weight: var(--weight-bold); }
@media (hover: hover) { .ds-segnav__item:not([aria-selected="true"]):hover { background: var(--color-surface-hover-2); color: var(--color-text); } }
.ds-segnav__number { display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--color-surface-2); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.ds-segnav__text { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.ds-segnav__caption { font-size: var(--text-xs); font-weight: var(--weight-regular); color: var(--color-text-subtle); }
.ds-segnav__item[aria-selected="true"] .ds-segnav__caption { color: var(--color-text-muted); }   /* text-subtle on the selected surface-3 is 4.47:1 in light (DESIGN.md 3.5) */
.ds-segnav__count { flex: none; min-width: 24px; padding: 0 var(--space-2); border-radius: var(--radius-pill); background: var(--color-surface-2); font-size: var(--text-xs); font-weight: var(--weight-semibold); text-align: center; font-variant-numeric: tabular-nums; }
.ds-segnav__item[aria-selected="true"] .ds-segnav__count, .ds-segnav__item[aria-selected="true"] .ds-segnav__number { background: var(--color-surface-1); }
@media (max-width: 1099px) {
  /* the segmented well (DESIGN.md 8.5, 12.00 rule 5): the track with its 3 px inset, 32 / 44 px items at radius 9 whose hit areas cover the inset, the raised pill on the selected one; the ring inside the item, the track scrolls */
  .ds-segnav { flex-direction: row; gap: 2px; padding: 3px; overflow-x: auto; border-radius: var(--radius-xl); background: var(--well-bg); box-shadow: var(--well-shadow); scrollbar-width: thin; }
  .ds-segnav__item { position: relative; flex: none; width: auto; min-height: var(--control-h-md); padding: 0 var(--space-3); border-radius: var(--radius-seg); white-space: nowrap; }
  .ds-segnav__item::before { content: ""; position: absolute; inset: -3px 0; }
  .ds-segnav__item:focus-visible { outline-offset: -2px; }
  .ds-segnav__item[aria-selected="true"] { background: var(--pill-bg); color: var(--pill-text); box-shadow: var(--pill-shadow); font-weight: var(--weight-semibold); }
  .ds-segnav__number, .ds-segnav__caption { display: none; }
}
@media (hover: hover) and (max-width: 1099px) { .ds-segnav__item:not([aria-selected="true"]):hover { background: transparent; } }   /* in the well only the text brightens (DESIGN.md 8.5) */
.ds-ifilters { margin-bottom: var(--space-4); }
.ds-ifilters .ds-filterbar__actions { margin-left: auto; }
.ds-ibadges { display: inline-flex; flex-wrap: wrap; gap: var(--space-1); }
.ds-mandatory { background: var(--color-accent); color: var(--color-on-accent); }
.ds-itable__title { display: grid; gap: var(--space-1); }
.ds-itable__name { font-weight: var(--weight-semibold); }
.ds-itable__summary { font-size: var(--text-xs); font-weight: var(--weight-regular); color: var(--color-text-muted); white-space: normal; }
.ds-itable__level { display: grid; gap: 2px; }
.ds-itable__target { font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-itable .ds-table td { height: auto; padding-block: var(--space-2); vertical-align: top; }
.ds-itable .ds-table th { white-space: normal; }
.ds-itable__cards { display: none; margin: 0; padding: 0; list-style: none; }
@media (max-width: 639px) {
  .ds-itable .ds-table-wrap { display: none; }
  .ds-itable__cards { display: grid; gap: var(--space-3); }
}
.ds-icard { display: grid; gap: var(--space-2); width: 100%; padding: var(--space-4); border: 0; border-radius: var(--radius-md); background: var(--color-surface-2); color: var(--color-text); font-family: inherit; font-size: var(--text-sm); text-align: left; }
.ds-icard--compact { padding: var(--space-3); }
button.ds-icard { cursor: pointer; }
@media (hover: hover) { button.ds-icard:hover { background: var(--color-surface-hover-2); } }
.ds-icard__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.ds-icard__title { font-weight: var(--weight-semibold); }
.ds-icard__meta { display: flex; flex-wrap: wrap; gap: var(--space-3); font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-icard__summary { color: var(--color-text-body); white-space: pre-wrap; }
.ds-levelchips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.ds-levelchips__chip[aria-disabled="true"] { color: var(--color-text-disabled); cursor: not-allowed; }
.ds-levelchips__chip[aria-checked="true"] { background: var(--color-surface-3); color: var(--color-text); font-weight: var(--weight-semibold); }
.ds-precedence { display: grid; gap: var(--space-1); }
.ds-precedence__caption { margin: 0; }
.ds-idetail { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
.ds-idetail > .ds-btn { justify-self: start; }
.ds-idetail__head { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
.ds-idetail__titles { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.ds-idetail__titles h2 { margin: 0; }
.ds-idetail__meta, .ds-idetail__tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); font-size: var(--text-sm); }
.ds-idetail__levels { display: grid; gap: var(--space-2); }
.ds-idetail__tabs { align-self: start; }
.ds-idetail__panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
.ds-idetail__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-3); }
.ds-ieditor, .ds-segform { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }   /* the single column may shrink below its widest child: the fields keep the card's inner padding at 390 px */
.ds-ieditor .ds-formfield, .ds-segform .ds-formfield { grid-template-columns: minmax(0, 1fr); }
.ds-segform__pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--space-3); }
.ds-issue-warning { margin-top: calc(-1 * var(--space-2)); }
.ds-thresholds { display: grid; gap: var(--space-2); }
.ds-thresholds .ds-btn { justify-self: start; }
.ds-thresholds__row { display: flex; flex-wrap: wrap; align-items: end; gap: var(--space-2); padding: var(--space-2); border-radius: var(--radius-md); background: var(--color-surface-2); }
.ds-thresholds__row .ds-formfield { flex: 1 1 10rem; }
.ds-thresholds__row .ds-field--inline { flex-direction: column; align-items: stretch; }
.ds-thresholds__row > .ds-field__error { flex: 1 0 100%; margin-top: 0; }
.ds-overrides { display: grid; gap: var(--space-2); }
.ds-reviewbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--color-surface-2); font-size: var(--text-sm); }
.ds-reviewbar__text { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); min-width: 0; }
.ds-reviewbar__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-left: auto; }
.ds-versions { display: grid; gap: var(--space-3); }
.ds-versions__list { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.ds-versions__row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--color-surface-2); font-size: var(--text-sm); }
.ds-versions__row.is-current { box-shadow: inset 0 0 0 1px var(--color-border-strong); }
.ds-versions__number { font-weight: var(--weight-semibold); }
.ds-versions__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); flex: 1 1 auto; min-width: 0; }
.ds-versions__diff-title { margin: 0; font-size: var(--text-md); font-weight: var(--weight-semibold); }
.ds-diff { display: grid; gap: var(--space-3); }
.ds-diff__field { display: grid; gap: var(--space-1); }
.ds-diff__label { font-size: var(--text-xs); font-weight: var(--weight-bold); letter-spacing: var(--tracking-upper); text-transform: uppercase; color: var(--color-text-muted); }
.ds-diff__pair { display: grid; gap: var(--space-2); }
.ds-diff--side .ds-diff__pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ds-diff__side { display: flex; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-radius: var(--radius-xs); font-size: var(--text-sm); white-space: pre-wrap; overflow-wrap: anywhere; }
.ds-diff__side--before { background: var(--tint-negative); color: var(--color-negative); }
.ds-diff__side--after { background: var(--tint-positive); color: var(--color-positive-strong); }
.ds-diff__glyph { flex: none; font-weight: var(--weight-bold); font-variant-numeric: tabular-nums; }
.ds-diff__text { color: var(--color-text-body); }
@media (max-width: 767px) { .ds-diff--side .ds-diff__pair { grid-template-columns: minmax(0, 1fr); } }
.ds-conflict { display: grid; gap: var(--space-3); }
.ds-conflict__cards { display: grid; gap: var(--space-3); }
.ds-conflict__side { display: grid; gap: var(--space-1); min-width: 0; }
.ds-conflict__caption { font-size: var(--text-xs); font-weight: var(--weight-bold); letter-spacing: var(--tracking-upper); text-transform: uppercase; color: var(--color-text-muted); }
.ds-conflict .ds-formfield { grid-template-columns: minmax(0, 1fr); }
.ds-conflict__actions { margin-top: var(--space-3); }
.ds-conflicts__list { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.ds-conflicts__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--color-surface-2); font-size: var(--text-sm); }
.ds-conflicts__text { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); min-width: 0; }
.ds-usage { display: grid; gap: var(--space-3); }
.ds-usage__counts { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; font-size: var(--text-sm); }
.ds-usage__counts li { display: flex; align-items: center; gap: var(--space-2); }
.ds-usage__trend { display: grid; gap: var(--space-1); }
.ds-create-instruction { display: grid; gap: var(--space-3); }
.ds-create-instruction .ds-formfield { grid-template-columns: minmax(0, 1fr); }
.ds-chipfield .ds-chip-editor { display: grid; gap: var(--space-2); }

/* instruction preview ("Pregled efekta", 45 section 8) */
.ds-preview { display: grid; gap: var(--space-4); }
.ds-preview__head { display: grid; gap: var(--space-1); }
.ds-preview__title { margin: 0; font-size: var(--text-md); font-weight: var(--weight-semibold); }
.ds-preview__hint { margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); }
.ds-preview__questions { display: grid; gap: var(--space-3); }
.ds-preview__question { display: flex; align-items: flex-end; gap: var(--space-2); }
.ds-preview__field { flex: 1 1 auto; min-width: 0; }
.ds-preview .ds-formfield { grid-template-columns: minmax(0, 1fr); }
.ds-preview__tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.ds-preview__verified { flex: 1 1 16rem; min-width: 0; }
.ds-preview__progress { display: grid; gap: var(--space-2); }
.ds-preview__progress-text { font-size: var(--text-sm); color: var(--color-text-muted); }
.ds-preview__results { display: grid; gap: var(--space-3); }
.ds-preview__pair { display: grid; gap: var(--space-3); padding: var(--space-3); border-radius: var(--radius-md); background: var(--color-surface-2); }
.ds-preview__pair-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.ds-preview__pair-title { margin: 0; font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.ds-preview__pair-question { flex: 1 1 auto; min-width: 0; font-size: var(--text-sm); }
.ds-preview__columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.ds-preview__column { display: grid; align-content: start; gap: var(--space-2); padding: var(--space-3); border-radius: var(--radius-md); background: var(--color-surface-1); }
.ds-preview__column-title { font-size: var(--text-xs); font-weight: var(--weight-bold); letter-spacing: var(--tracking-upper); text-transform: uppercase; color: var(--color-text-muted); }
.ds-preview__answer { margin: 0; font-size: var(--text-sm); line-height: var(--leading-relaxed, 1.5); overflow-wrap: anywhere; }
.ds-preview__chips { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.ds-idetail__preview { padding: var(--space-4); border-radius: var(--radius-inner); background: var(--color-surface-1); }
@media (max-width: 767px) {
  .ds-preview__columns { grid-template-columns: minmax(0, 1fr); }
}

/* ---- SC-23 Documents and sources (DESIGN N-06, 41 section 9) ---- */
.ds-feeds__list { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.ds-feeds__row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: var(--target-min); padding: var(--space-2) 0; border-bottom: 1px solid var(--color-border-subtle); }
.ds-feeds__row:last-child { border-bottom: 0; }
.ds-feeds__text { display: grid; gap: 2px; min-width: 0; }
.ds-feeds__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); }
.ds-feeds__name { font-weight: var(--weight-semibold); }
.ds-feeds__meta, .ds-feeds__state { font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-stable .ds-table td { height: auto; padding-block: var(--space-2); vertical-align: top; }
.ds-stable .ds-table th { white-space: normal; }
.ds-stable__name { font-weight: var(--weight-semibold); }
.ds-stable__status { display: grid; gap: var(--space-1); }
.ds-stable__hint { font-size: var(--text-xs); color: var(--color-warning); }
@media (max-width: 1099px) {
  .ds-stable .ds-table-wrap { overflow-x: auto; }
  .ds-stable .ds-table { min-width: 960px; }   /* seven columns: the table scrolls inside its card instead of squeezing the names (DESIGN 14.1) */
  .ds-stable .ds-table th:first-child, .ds-stable .ds-table td:first-child { position: sticky; left: 0; z-index: 1; background: var(--color-surface-1); }
}
.ds-sdetail { display: grid; gap: var(--space-5); }
.ds-sdetail__section { display: grid; gap: var(--space-2); }
.ds-sdetail__section h3, .ds-sdetail__section h4 { margin: 0; }
.ds-sdetail__subtitle { font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-sdetail__domains { margin-top: var(--space-2); }
.ds-sdetail__excerpt { margin: 0; padding: var(--space-3); border-radius: var(--radius-md); background: var(--color-surface-2); color: var(--color-text-body); font-size: var(--text-sm); white-space: pre-wrap; overflow-wrap: anywhere; }
.ds-sdetail__attribution { margin: 0; font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-sdetail__link { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--text-sm); }
.ds-sdetail__versions { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.ds-sdetail__version { display: grid; gap: 2px; padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--color-surface-2); font-size: var(--text-sm); }
.ds-sdetail__version-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.ds-sdetail__form { display: grid; gap: var(--space-4); }
.ds-sdetail__file { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); font-size: var(--text-sm); }
.ds-sdetail__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-3); }
.ds-wizard { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); margin: 0 0 var(--space-4); padding: 0; list-style: none; }
.ds-wizard__step { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--color-text-muted); font-size: var(--text-sm); }
.ds-wizard__step.is-current { color: var(--color-text); font-weight: var(--weight-semibold); }
.ds-wizard__step.is-current .ds-stepper__mark { border-color: var(--color-accent); color: var(--color-accent); }
.ds-wizard__step.is-done .ds-stepper__mark { border-color: var(--color-primary); background: var(--color-primary); color: var(--color-on-primary); }
.ds-wizard__body { display: grid; gap: var(--space-4); }
.ds-wizard__tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ds-uprows { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.ds-uprow { display: grid; gap: var(--space-1); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--color-surface-2); font-size: var(--text-sm); }
.ds-uprow__file { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); }
.ds-uprow__name { font-weight: var(--weight-semibold); overflow-wrap: anywhere; }
.ds-uprow__size { font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-uprow__error { display: flex; gap: var(--space-2); font-size: var(--text-xs); color: var(--color-negative); }
.ds-uprow .ds-btn, .ds-uprow > .ds-status { justify-self: start; }   /* the state badge keeps its own width instead of stretching across the row */

/* ---- SC-33 Template library (43 section 8): notice, filter bar, card grid, detail drawer, preview, copy dialog, editor ---- */
.ds-templates { display: grid; gap: var(--space-4); margin-top: var(--space-4); }
.ds-templates__types { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.ds-templates__types .ds-chip { min-width: 0; }
.ds-templates .ds-filterbar__filters .ds-select-wrap { min-width: 11rem; }
.ds-templates__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
@media (max-width: 1279px) { .ds-templates__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) { .ds-templates__grid { grid-template-columns: minmax(0, 1fr); } }
.ds-tcard { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; padding: var(--space-4); border-radius: var(--radius-inner); background: var(--color-surface-1); }   /* an inner card on the content panel: radius 14, padding 16 (DESIGN.md 9.1) */
.ds-tcard__badges { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.ds-tcard__badges .ds-status { min-width: 0; }
.ds-tcard__title { margin: 0; font-size: var(--text-md); font-weight: var(--weight-semibold); color: var(--color-text); overflow-wrap: anywhere; }
.ds-tcard__description { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; margin: 0; color: var(--color-text-body); font-size: var(--text-sm); }
.ds-tcard__meta { margin: 0; font-size: var(--text-xs); overflow-wrap: anywhere; }
.ds-tcard__copies { margin: 0; color: var(--color-text); font-size: var(--text-xs); font-weight: var(--weight-semibold); }
.ds-tcard__actions { display: flex; justify-content: flex-end; margin-top: auto; }
.ds-tdetail { display: grid; gap: var(--space-4); }
.ds-tdetail > p { margin: 0; }
.ds-tdetail__versions { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.ds-tdetail__versions li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--color-surface-2); font-size: var(--text-sm); }
.ds-tdetail__footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-3); }
.ds-tpreview { display: grid; gap: var(--space-4); }
.ds-tpreview__section { display: grid; gap: var(--space-2); }
.ds-tpreview__section h3, .ds-tpreview__section p { margin: 0; }
.ds-tpreview__list, .ds-tpreview__steps { margin: 0; padding-left: var(--space-5); display: grid; gap: var(--space-1); color: var(--color-text-body); font-size: var(--text-sm); }
.ds-tpreview__steps li { display: grid; gap: 2px; }
.ds-tpreview__steps li > strong { color: var(--color-text); }
.ds-tpreview__terms { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: var(--space-1) var(--space-4); margin: 0; font-size: var(--text-sm); }
.ds-tpreview__terms dt { font-weight: var(--weight-semibold); color: var(--color-text); }
.ds-tpreview__terms dd { margin: 0; color: var(--color-text-body); }
.ds-tpreview__table th, .ds-tpreview__table td { padding: var(--space-2) var(--space-3); vertical-align: top; }
.ds-tpreview__table tbody th { position: static; height: auto; text-transform: none; letter-spacing: normal; color: var(--color-text); font-size: var(--text-sm); background: transparent; }
.ds-tpreview__threshold { display: block; white-space: nowrap; }
.ds-tpreview__badges { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.ds-tpreview__placeholder { padding: 0 var(--space-2); border-radius: var(--radius-pill); background: var(--color-surface-3); color: var(--color-accent); font-family: var(--font-family-code); font-size: var(--text-xs); }
.ds-copy-template { display: grid; gap: var(--space-3); }
.ds-copy-template .ds-formfield { grid-template-columns: minmax(0, 1fr); }
.ds-copy-template > p { margin: 0; }
.ds-tlink { color: var(--color-accent); font-size: var(--text-sm); text-decoration: underline; }
.ds-teditor { display: grid; gap: var(--space-3); }
.ds-teditor__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.ds-teditor__row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 767px) { .ds-teditor__row, .ds-teditor__row--3 { grid-template-columns: minmax(0, 1fr); } }
.ds-teditor__tools { display: flex; justify-content: flex-end; margin-top: var(--space-1); }
.ds-teditor__issues { display: grid; gap: var(--space-2); padding: var(--space-3); border-radius: var(--radius-md); background: var(--color-surface-2); }
.ds-teditor__issues h3 { margin: 0; }
.ds-teditor__issues ul { display: grid; gap: var(--space-1); margin: 0; padding-left: var(--space-4); }
.ds-teditor__issues li { font-family: var(--font-family-code); font-size: var(--text-xs); overflow-wrap: anywhere; }

/* SC-21 guided entry (46 section 6, DESIGN N-05): the conversation card beside the proposals card; stacked behind segmented tabs below 1100 px and in drawer mode. */
.ds-guided { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--space-5); align-items: start; margin-top: var(--space-4); }
.ds-guided--stacked { grid-template-columns: minmax(0, 1fr); }
.ds-guided__tabs { justify-self: start; }
.ds-guided__chat, .ds-guided__proposals { min-width: 0; }
.ds-guided__chat[hidden], .ds-guided__proposals[hidden] { display: none; }
.ds-guided__loading { display: grid; gap: var(--space-3); }
.ds-guided__banner { margin-bottom: var(--space-3); }
.ds-guided__log { display: flex; flex-direction: column; gap: var(--space-3); max-height: 50vh; overflow-y: auto; padding: var(--space-3) 0; font-size: var(--text-chat); line-height: var(--lh-chat); color: var(--color-text-body); scrollbar-gutter: stable; }
.ds-guided__ai { margin: 0; }
.ds-guided__user { margin-top: 0; }
.ds-guided__status { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 40px; margin-top: var(--space-2); font-size: var(--text-sm); }
.ds-guided__input { margin-top: var(--space-2); }
.ds-guided__actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-3); }
.ds-guided__error, .ds-guided__closed { margin-top: var(--space-3); }
.ds-guided__list { display: grid; gap: var(--space-3); }
.ds-guided__card { background: var(--color-surface-2); }
.ds-guided__card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.ds-guided__card-title { margin: 0; font-size: var(--text-md); font-weight: var(--weight-bold); color: var(--color-text); overflow-wrap: anywhere; }
.ds-guided__chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.ds-guided__levels { margin-top: var(--space-2); }
.ds-guided__lines { display: grid; gap: var(--space-1); margin: var(--space-3) 0 0; padding-left: var(--space-4); font-size: var(--text-sm); color: var(--color-text-body); overflow-wrap: anywhere; }
.ds-guided__card-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.ds-guided__finish { display: flex; justify-content: flex-end; margin-top: var(--space-4); }
.ds-guided__editor { display: grid; gap: var(--space-4); }
.ds-guided-page { display: grid; gap: var(--space-3); margin-top: var(--space-4); }
.ds-guided-page__title { margin: 0; }
.ds-guided-page__start { display: grid; gap: var(--space-4); max-width: 520px; margin-top: var(--space-4); }
@media (max-width: 1099px) { .ds-guided { grid-template-columns: minmax(0, 1fr); } }
.ds-guided--stacked .ds-guided__banner { flex-wrap: wrap; }
.ds-guided--stacked .ds-guided__banner .ds-alert__text { flex: 1 1 200px; }
/* SC-24 knowledge gaps (42 section 7, DESIGN N-07) */
.ds-gaps { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); margin-top: var(--space-4); }
.ds-gaps__main { min-width: 0; }
.ds-gaps__tabs { margin-bottom: var(--space-4); flex-wrap: wrap; }
.ds-gaps__panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); min-width: 0; }
.ds-gaps__toolbar { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.ds-gaps__toolbar .ds-search { flex: 1 1 260px; min-width: 0; max-width: 420px; }
.ds-gaps__toolbar .ds-field__input { min-width: 0; }
.ds-gaps__list { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
.ds-gaps__empty { display: flex; align-items: center; gap: var(--space-2); margin: 0; padding: var(--space-4); border-radius: var(--radius-md); background: var(--color-surface-2); color: var(--color-positive); font-size: var(--text-md); }
.ds-gaps__empty span { color: var(--color-text); }
.ds-gap-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--color-surface-2); }
.ds-gap-row__main { display: grid; gap: var(--space-2); flex: 1 1 320px; min-width: 0; }
.ds-gap-row__title { margin: 0; font-size: var(--text-md); font-weight: var(--weight-bold); color: var(--color-text); overflow-wrap: anywhere; }
.ds-gap-row__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); font-size: var(--text-sm); color: var(--color-text-body); }
.ds-gap-row__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); max-width: 100%; }
.ds-gap-row__actions .ds-btn { max-width: 100%; white-space: normal; }
.ds-gap-kpis { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
.ds-gap-kpis__cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: var(--space-3); }
.ds-gap-kpis__period { justify-self: end; max-width: 100%; overflow-x: auto; }
.ds-meter { display: grid; gap: var(--space-2); padding: var(--space-4); border-radius: var(--radius-md); background: var(--color-surface-2); }
.ds-meter__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2); }
.ds-meter__label { font-size: var(--text-sm); color: var(--color-text-body); }
.ds-meter__figure { display: inline-flex; align-items: center; gap: var(--space-1); }
.ds-meter__value { font-size: var(--text-lg); font-weight: var(--weight-bold); color: var(--color-text); }
.ds-meter--warning .ds-meter__figure .ds-icon { color: var(--color-warning); }   /* the glyph beside the figure says the tier without the fill colour (DESIGN.md 3.5, 8.8) */
.ds-meter--negative .ds-meter__figure .ds-icon { color: var(--color-negative); }
.ds-meter__track { position: relative; height: 12px; border-radius: var(--radius-pill); background: var(--color-surface-1); }
.ds-meter__fill { position: absolute; inset: 0 auto 0 0; border-radius: var(--radius-pill); background: var(--color-accent); }
.ds-meter--warning .ds-meter__fill { background: var(--color-warning); }
.ds-meter--negative .ds-meter__fill { background: var(--color-negative); }
.ds-meter__target { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--color-text); }
.ds-meter__caption { font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-coverage { display: grid; gap: var(--space-4); }
.ds-coverage__meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: var(--space-3); }
.ds-coverage__cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: var(--space-3); }
.ds-coverage__lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: var(--space-4); }
.ds-coverage__list { display: grid; gap: var(--space-2); align-content: start; }
.ds-coverage__items { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.ds-coverage__item { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--color-surface-2); font-size: var(--text-sm); }
.ds-coverage__title { flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; }
.ds-gdetail { display: grid; gap: var(--space-5); }
.ds-gdetail__section { display: grid; gap: var(--space-2); }
.ds-gdetail__section h3 { margin: 0; }
.ds-gdetail__list { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.ds-gdetail__question, .ds-gdetail__event { display: grid; gap: 2px; padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--color-surface-2); font-size: var(--text-sm); overflow-wrap: anywhere; }
.ds-gdetail__retest { display: flex; align-items: flex-start; gap: var(--space-2); margin: 0; font-size: var(--text-sm); }
.ds-gdetail__retest--passed .ds-icon { color: var(--color-positive); }
.ds-gdetail__retest--failed .ds-icon { color: var(--color-warning); }
.ds-my-gaps__list { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.ds-my-gaps__item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--color-surface-2); }
.ds-my-gaps__title { flex: 1 1 14rem; min-width: 0; color: var(--color-text); overflow-wrap: anywhere; }
.ds-reviews__title { overflow-wrap: anywhere; }
.ds-reviews__actions { display: inline-flex; flex-wrap: wrap; gap: var(--space-2); }
.ds-guided__hint { display: flex; align-items: center; gap: var(--space-2); margin: var(--space-3) 0 0; }
.ds-gdetail__askers { display: grid; gap: 2px; margin: 0; }
.ds-gap-dismiss__reasons { display: grid; gap: var(--space-2); margin: var(--space-4) 0 var(--space-3); }
/* ProgressBar (54 section 4, DESIGN 8.8): the bar with its label and elapsed time as text beside it */
.ds-progressbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); min-width: 0; }
.ds-progressbar .ds-bar { flex: 1 1 6rem; min-width: 4rem; }
.ds-progressbar .ds-bar__fill { display: block; }
.ds-progressbar__label { flex: none; font-size: var(--text-sm); font-variant-numeric: tabular-nums; color: var(--color-text); }
.ds-progressbar__elapsed { flex: none; font-size: var(--text-xs); color: var(--color-text-muted); }
/* SC-30 AI quality (44 section 5) */
.ds-aiq { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); margin-top: var(--space-4); }
.ds-aiq .ds-filterbar { margin-bottom: 0; }
.ds-aiq-filters__group { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); max-width: 100%; }
.ds-aiq-filters__group .ds-segmented { max-width: 100%; }   /* no overflow clip: it cut the focus ring of an item at the track's top and bottom edge (DESIGN.md 15.2) */
.ds-aiq-filters__group .ds-segmented__item { min-width: 72px; }
.ds-aiq-filters__label { font-size: var(--text-xs); font-weight: var(--weight-medium); text-transform: uppercase; color: var(--color-text-muted); }
.ds-aiq-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); }
@media (max-width: 1099px) { .ds-aiq-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 559px) { .ds-aiq-kpis { grid-template-columns: minmax(0, 1fr); } }
.ds-aiq-kpis .ds-kpi .ds-status { margin-top: var(--space-2); }
.ds-aiq__panels { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
@media (min-width: 1100px) { .ds-aiq__panels { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ds-aiq__reasons { grid-column: 1 / -1; } }
.ds-aiq-panel { display: grid; gap: var(--space-3); min-width: 0; }
.ds-aiq-panel h2 { margin: 0; }
.ds-aiq-queries { display: grid; gap: var(--space-2); min-width: 0; }   /* spec 47 10.6: the query texts of an incident, payload blocks in the `code` family */
.ds-aiq-queries > * { margin: 0; }
.ds-aiq-panel__empty { margin: 0; padding: var(--space-3); }
.ds-aiq-panel__bar { min-width: 10rem; }
.ds-aiq-reasons { display: grid; gap: var(--space-3); margin: 0; padding: 0; list-style: none; }
.ds-aiq-reasons__row { display: grid; grid-template-columns: minmax(8rem, 16rem) minmax(0, 1fr); align-items: center; gap: var(--space-3); font-size: var(--text-sm); }
@media (max-width: 559px) { .ds-aiq-reasons__row { grid-template-columns: minmax(0, 1fr); gap: var(--space-1); } }
.ds-aiq-reasons__label { color: var(--color-text-body); overflow-wrap: anywhere; }
.ds-aiq-rating { display: inline-flex; align-items: center; gap: var(--space-1); white-space: nowrap; }
.ds-aiq-rating--up .ds-icon { color: var(--color-positive); }
.ds-aiq-rating--down .ds-icon { color: var(--color-warning); }
.ds-aiq-table__question { display: block; min-width: 12rem; overflow-wrap: anywhere; }
.ds-aiq-table__date { white-space: nowrap; }
.ds-aiq-detail { display: grid; gap: var(--space-5); }
.ds-aiq-detail__text { margin: 0; overflow-wrap: anywhere; }
.ds-aiq-detail__answer { white-space: pre-wrap; }
.ds-aiq-detail__sources { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.ds-aiq-detail__hint { margin: 0; font-size: var(--text-sm); }
.ds-aiq-detail__reported { align-self: center; font-size: var(--text-sm); }
.ds-aiq-applied { display: grid; gap: var(--space-1); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--color-surface-2); font-size: var(--text-sm); overflow-wrap: anywhere; }
.ds-aiq-applied__title { color: var(--color-accent); font-weight: var(--weight-bold); }
.ds-aiq-platform { display: grid; gap: var(--space-4); min-width: 0; }
/* SC-20 team and duties (50 section 6, DESIGN N-04): banner, tabs, team tree beside the members table, role cards, duty cards, editor preview, stats drawer */
.ds-team { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); margin-top: var(--space-4); }
.ds-team__banner { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); }
.ds-team__banner-text { margin: 0; color: var(--color-text); font-size: var(--text-md); font-weight: var(--weight-bold); }
.ds-team__main { min-width: 0; }
.ds-team__tabs { margin: calc(-1 * var(--space-2)) calc(-1 * var(--space-3)) var(--space-4); padding: var(--space-2) var(--space-3) 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }   /* the 8 px above and 12 px at the ends keep the hit area of a tab inside the scrolling row; the rule and the indicator sit on its bottom edge, the focus ring is drawn inside the tab */
.ds-team__tabs .ds-section-tab { flex: none; }
.ds-team__tabs .ds-section-tab::before { inset-block: calc(-1 * var(--space-2)) 0; }   /* the 36 px tab grows 8 px upwards only: a 44 px target that the row's bottom edge does not clip; its width is the in-page strip rule of layout.css (DESIGN.md 14) */
.ds-team__panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); min-width: 0; }
.ds-team-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-4); }
.ds-team-toolbar .ds-btn { display: inline-flex; align-items: center; gap: var(--space-2); }
.ds-team-members { display: grid; grid-template-columns: minmax(11rem, 15rem) minmax(0, 1fr); gap: var(--space-5); align-items: start; }
.ds-team-members__main { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); min-width: 0; }
.ds-team-members__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.ds-team-members__title { display: grid; gap: var(--space-1); min-width: 0; }
.ds-team-members__title h2, .ds-team-members__title p { margin: 0; overflow-wrap: anywhere; }
.ds-team-tree { padding: var(--space-3); border-radius: var(--radius-inner); background: var(--color-surface-2); }
.ds-team-tree__list { display: grid; gap: var(--space-1); margin: 0; padding: 0; list-style: none; }
.ds-team-tree__list--nested { margin-top: var(--space-1); padding-left: var(--space-4); }
.ds-team-tree__node { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); width: 100%; min-height: var(--target-min); padding: var(--space-2) var(--space-3); border: 0; border-radius: var(--radius-md); background: transparent; color: var(--color-text-body); font: inherit; font-size: var(--text-sm); text-align: left; cursor: pointer; }
.ds-team-tree__node--team { color: var(--color-text); font-weight: var(--weight-bold); }
.ds-team-tree__node[aria-current="true"] { background: var(--color-surface-3); color: var(--color-text); }
@media (hover: hover) { .ds-team-tree__node:hover { background: var(--color-surface-hover-2); } }
.ds-team-tree__name { min-width: 0; overflow-wrap: anywhere; }
.ds-team-tree__count { flex: none; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.ds-team-tree-select { display: none; }
@media (max-width: 1099px) {
  .ds-team-members { grid-template-columns: minmax(0, 1fr); }
  .ds-team-tree { display: none; }
  .ds-team-tree-select { display: block; }
}
.ds-team-table td:nth-child(3) { min-width: 9rem; overflow-wrap: break-word; }
.ds-team-table__tasks { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-variant-numeric: tabular-nums; }
.ds-team-temp { display: flex; align-items: flex-end; gap: var(--space-2); }
.ds-team-temp__value { display: grid; flex: 1; gap: var(--space-1); min-width: 0; }
.ds-team-temp__code { display: block; padding: var(--space-3); border-radius: var(--radius-md); background: var(--color-bg); color: var(--color-text); font-size: var(--text-md); overflow-wrap: anywhere; user-select: all; }
.ds-team-roles { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
@media (min-width: 768px) { .ds-team-roles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .ds-team-roles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ds-team-roles-tab { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
.ds-team-role { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; background: var(--color-surface-2); }
.ds-team-role--highlight, .ds-duty-card--highlight { box-shadow: inset 0 0 0 2px var(--color-accent); }
.ds-team-role__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.ds-team-role__name { margin: 0; color: var(--color-text); font-size: var(--text-lg); font-weight: var(--weight-bold); overflow-wrap: anywhere; }
.ds-team-role__description { margin: 0; color: var(--color-text-body); font-size: var(--text-sm); overflow-wrap: anywhere; }
.ds-team-role__facts { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); font-size: var(--text-sm); }
.ds-team-role__profile { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
a.ds-team-role__profile-link { position: relative; color: var(--color-text); text-decoration: none; }
a.ds-team-role__profile-link::before { content: ""; position: absolute; inset: calc((24px - var(--target-min)) / 2) 0; }   /* the 24 px chip that is a link: a 32 / 44 px target (DESIGN.md 14) */
@media (hover: hover) { a.ds-team-role__profile-link:hover { background: var(--color-surface-3); } }
.ds-team-role__actions, .ds-duty-card__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: auto; }
.ds-team-dutybar { margin-bottom: 0; }
.ds-team-dutybar .ds-filterbar__filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); min-width: 0; }
.ds-team-dutybar__state { min-width: min(100%, 16rem); }
.ds-duty-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); min-width: 0; }
.ds-duty-card { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; background: var(--color-surface-2); scroll-margin-top: var(--space-8); }
.ds-duty-card[aria-busy="true"] { opacity: 0.6; }
.ds-duty-card__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.ds-duty-card__title { flex: 1 1 14rem; min-width: 0; margin: 0; color: var(--color-text); font-size: var(--text-md); font-weight: var(--weight-bold); overflow-wrap: anywhere; }
.ds-duty-card__facts { display: grid; gap: var(--space-1); }
.ds-duty-card__line { display: flex; align-items: flex-start; gap: var(--space-2); margin: 0; color: var(--color-text-body); font-size: var(--text-sm); overflow-wrap: anywhere; }
.ds-duty-card__line .ds-icon { flex: none; margin-top: 2px; color: var(--color-text-muted); }
.ds-duty-card__meta { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); margin: 0; color: var(--color-text-muted); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.ds-duty-editor { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
.ds-duty-editor__alert { margin-bottom: var(--space-4); }
.ds-duty-editor__group { display: grid; gap: var(--space-2); }
.ds-trigger { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); padding: var(--space-4); border-radius: var(--radius-inner); background: var(--color-surface-2); }
.ds-trigger__pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
@media (max-width: 479px) { .ds-trigger__pair { grid-template-columns: minmax(0, 1fr); } }
.ds-duty-preview { display: grid; gap: var(--space-2); background: var(--color-surface-2); }
.ds-duty-preview h3 { margin: 0; }
.ds-duty-preview__next { margin: 0; color: var(--color-text); white-space: pre-line; overflow-wrap: anywhere; }
.ds-duty-stats { display: grid; gap: var(--space-5); }
.ds-duty-stats__counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: var(--space-2); margin: 0; }
.ds-duty-stats__count { display: grid; gap: var(--space-1); padding: var(--space-3); border-radius: var(--radius-md); background: var(--color-surface-2); }
.ds-duty-stats__count dt { color: var(--color-text-muted); font-size: var(--text-xs); }
.ds-duty-stats__count dd { margin: 0; color: var(--color-text); font-size: var(--text-lg); font-weight: var(--weight-bold); font-variant-numeric: tabular-nums; }
.ds-duty-stats__reasons { display: grid; gap: var(--space-2); }
.ds-duty-stats__reasons h3, .ds-duty-stats__reasons p { margin: 0; }
.ds-duty-stats__list { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.ds-duty-stats__reason { display: grid; gap: 2px; padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--color-surface-2); font-size: var(--text-sm); overflow-wrap: anywhere; }
.ds-duty-stats__who { color: var(--color-text-muted); font-size: var(--text-xs); }
.ds-duty-stats__note { display: flex; align-items: flex-start; gap: var(--space-2); margin: 0; color: var(--color-text-body); font-size: var(--text-sm); }
.ds-team-discussion { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); min-width: 0; }
.ds-team-discussion__role { max-width: 28rem; }
.ds-team-proposals { display: grid; gap: var(--space-3); min-width: 0; }
.ds-team-proposals h2 { margin: 0; }
.ds-team-proposals__empty { margin: 0; padding: var(--space-4); border-radius: var(--radius-md); background: var(--color-surface-2); }
@media (forced-colors: active) { .ds-team-tree, .ds-trigger, .ds-team-temp__code, .ds-duty-stats__count { border: 1px solid CanvasText; } }
.ds-team-discussion .ds-guided__chat, .ds-team-discussion .ds-guided__proposals { background: var(--color-surface-2); }
.ds-team-discussion .ds-guided__card { background: var(--color-surface-3); }
.ds-team-role .ds-chip { background: var(--color-surface-3); }
/* SC-18 weekly brief (52 section 5, DESIGN N-02): header card, KPI row (2 x 2 below 768 px), deviation cards (a scroll-snap row on phones), paired inner cards, footer. */
.ds-brief { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); margin-top: var(--space-4); }
.ds-brief .ds-card__head { flex-wrap: wrap; }
.ds-brief__tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-left: auto; min-width: 0; }
.ds-brief__tools .ds-field { margin: 0; }
.ds-brief__chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.ds-brief__chips .ds-chip { min-width: 0; max-width: 100%; overflow-wrap: anywhere; height: auto; min-height: 28px; }
.ds-brief__headline { margin: var(--space-4) 0 0; font-size: var(--text-md); color: var(--color-text-body); overflow-wrap: anywhere; }
.ds-brief__meta { margin: var(--space-2) 0 0; font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-brief .ds-card > .ds-alert { margin-top: var(--space-3); }
.ds-brief__kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); }
.ds-brief__kpis .ds-kpi { border-radius: var(--radius-inner); }   /* the four KPI cards stand beside the inner cards of the page and share their radius (AIS-V619) */
@media (max-width: 767px) { .ds-brief__kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ds-brief__kpis .ds-kpi__value { font-size: var(--text-lg); } }
.ds-brief__deviations { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
@media (max-width: 767px) {
  .ds-brief__deviations { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: var(--space-2); }
  .ds-brief__deviations > .ds-deviation { flex: 0 0 min(85%, 18rem); scroll-snap-align: start; }
}
.ds-brief__pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: var(--space-4); align-items: start; }
.ds-brief__bullets, .ds-brief__counts, .ds-brief__tasks { display: grid; gap: var(--space-2); margin: 0; padding-left: var(--space-5); font-size: var(--text-sm); color: var(--color-text-body); overflow-wrap: anywhere; }
.ds-brief__counts { padding-left: 0; list-style: none; }
.ds-brief__tasks { margin-top: var(--space-4); padding-left: 0; list-style: none; }
.ds-brief__tasks li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); min-height: var(--target-min); }
.ds-brief__tasks a, .ds-brief .ds-action__link { display: inline-flex; align-items: center; min-height: var(--target-min); }
.ds-brief__subtitle { margin: var(--space-4) 0 var(--space-2); font-size: var(--text-sm); font-weight: var(--weight-bold); color: var(--color-text); }
.ds-brief__footer { display: grid; gap: var(--space-3); }
.ds-brief-feedback { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.ds-brief-feedback .ds-feedback { margin-top: 0; }
.ds-brief-feedback__thanks { margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); }
.ds-deviation { display: grid; gap: var(--space-3); align-content: start; min-width: 0; padding: var(--space-4); border-radius: var(--radius-inner); background: var(--color-surface-2); }
.ds-deviation__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.ds-deviation__title { margin: 0; font-size: var(--text-md); font-weight: var(--weight-bold); color: var(--color-text); overflow-wrap: anywhere; }
.ds-deviation__spark { max-width: 100%; height: auto; }
.ds-deviation__why { justify-self: start; min-height: var(--target-min); min-width: var(--target-min); padding: 0; border: 0; background: none; color: var(--color-accent); font: inherit; font-size: var(--text-sm); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.ds-brief-banner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); margin-bottom: var(--space-4); padding: var(--space-3) var(--space-4); border-radius: var(--radius-inner); background: var(--color-surface-1); }
.ds-brief-banner__text { flex: 1 1 16rem; margin: 0; font-size: var(--text-sm); color: var(--color-text-body); overflow-wrap: anywhere; }
.ds-brief-banner__actions { display: flex; align-items: center; gap: var(--space-2); }
@media (forced-colors: active) { .ds-deviation, .ds-brief-banner { border: 1px solid CanvasText; } }
/* SC-28 audit trail (54 section 5.1, DESIGN N-10): filter bar, the append-only table with a truncated object column, the detail drawer and the stored-answer view */
.ds-audit { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); margin-top: var(--space-4); }
.ds-audit .ds-filterbar { margin-bottom: 0; }
.ds-audit-filters__group { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); max-width: 100%; }
.ds-audit-filters__group .ds-segmented { max-width: 100%; }
.ds-audit-filters__group .ds-segmented__item { min-width: 72px; }
@media (max-width: 479px) { .ds-audit-filters__group .ds-segmented { display: flex; width: 100%; } .ds-audit-filters__group .ds-segmented__item { flex: 1 1 0; min-width: 0; padding-inline: var(--space-2); } }
.ds-audit-filters__label { font-size: var(--text-xs); font-weight: var(--weight-medium); text-transform: uppercase; color: var(--color-text-muted); }
.ds-audit-filters .ds-field__input[type="date"] { min-width: 9.5rem; }
.ds-audit-table__time { white-space: nowrap; }
.ds-audit-table__object { display: block; max-width: 28rem; }
.ds-audit-detail { display: grid; gap: var(--space-5); }
.ds-audit-detail__text { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.ds-audit-detail__actor { display: flex; flex-direction: column; gap: var(--space-1); }   /* a platform configuration row from a file import: the line under the actor (spec 71 section 7.5) */
.ds-audit-answer { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); max-width: 960px; margin-top: var(--space-4); }
.ds-audit-answer__card { display: grid; gap: var(--space-4); }
.ds-audit-answer__title { margin: 0; }
.ds-audit-answer__sources { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.ds-usage { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); margin-top: var(--space-4); }
.ds-usage .ds-filterbar { margin-bottom: 0; }
.ds-usage__tabs { justify-self: start; max-width: 100%; }
.ds-usage__scope { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.ds-usage-filters .ds-field__input[type="date"] { min-width: 9.5rem; }
.ds-usage__kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); }
@media (max-width: 1099px) { .ds-usage__kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 559px) { .ds-usage__kpis { grid-template-columns: minmax(0, 1fr); } }
.ds-usage__kpis .ds-progress { align-self: stretch; margin-top: var(--space-3); }
.ds-usage__charts, .ds-usage__tables { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
@media (max-width: 1099px) { .ds-usage__charts, .ds-usage__tables { grid-template-columns: minmax(0, 1fr); } }
.ds-usage__note { margin: var(--space-3) 0 0; font-size: var(--text-sm); }
.ds-usage-hint { margin: var(--space-3) 0 0; text-align: center; }
.ds-usage-platform, .ds-usage-metrics { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
.ds-usage-metrics__bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.ds-alert.ds-usage-survey { flex-wrap: wrap; align-items: center; border: 1px solid var(--color-accent); }
.ds-usage-metrics__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
@media (max-width: 1099px) { .ds-usage-metrics__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 559px) { .ds-usage-metrics__grid { grid-template-columns: minmax(0, 1fr); } }
.ds-usage-metric { display: grid; align-content: start; gap: var(--space-2); }
.ds-usage-metric__value { margin: 0; font-size: var(--text-kpi); line-height: 1.27; font-weight: var(--weight-bold); color: var(--color-text); }
.ds-usage-metric__target, .ds-usage-metric__detail { margin: 0; font-size: var(--text-sm); overflow-wrap: anywhere; }
.ds-usage-metric__extra { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); margin: var(--space-2) 0 0; font-size: var(--text-sm); }
.ds-usage-metric__extra strong { font-weight: var(--weight-semibold); }
.ds-usage-metric .ds-status { justify-self: start; }
.ds-usage-survey-dialog { display: grid; gap: var(--space-4); }
.ds-setup { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); max-width: 960px; margin-top: var(--space-4); }
.ds-setup .ds-progressbar { margin-top: var(--space-2); }
.ds-setup__steps { display: grid; gap: var(--space-3); margin: 0; padding: 0; list-style: none; }
.ds-setup-step { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-4); }
.ds-setup-step__disc { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: var(--radius-pill); background: var(--color-surface-3); color: var(--color-text); font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.ds-setup-step__disc--done { background: var(--color-primary); color: var(--color-on-primary); }
.ds-setup-step__text { display: grid; gap: var(--space-1); min-width: 0; }
.ds-setup-step__title { margin: 0; font-size: var(--text-md); font-weight: var(--weight-semibold); color: var(--color-text); overflow-wrap: anywhere; }
.ds-setup-step__description, .ds-setup-step__progress { margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); overflow-wrap: anywhere; }
.ds-setup-step__progress { color: var(--color-text-body); }
.ds-setup-step__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-2); }
@media (max-width: 767px) {
  .ds-setup-step { grid-template-columns: auto minmax(0, 1fr); }
  .ds-setup-step__actions { grid-column: 1 / -1; justify-content: flex-start; }
}
.ds-demo { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); margin-top: var(--space-4); }
.ds-demo__intro { margin: 0; color: var(--color-text-body); }
.ds-demo__bar, .ds-demo__chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.ds-demo__chips { gap: var(--space-2); }
.ds-demo__chips .ds-chip { background: var(--color-surface-3); }
.ds-demo__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
@media (max-width: 1099px) { .ds-demo__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 559px) { .ds-demo__grid { grid-template-columns: minmax(0, 1fr); } }
.ds-demo-card { display: grid; align-content: start; gap: var(--space-3); }
.ds-demo-card__hint { margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); overflow-wrap: anywhere; }
.ds-demo-card__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.ds-demo-card__actions .ds-progressbar, .ds-demo-card__actions .ds-switch-row, .ds-demo-card__actions .ds-formfield { flex: 1 1 100%; }
.ds-demo-result { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.ds-demo-result__row { display: grid; grid-template-columns: minmax(0, 1fr) auto 5rem; align-items: center; gap: var(--space-3); font-size: var(--text-sm); }
.ds-demo-result__job { overflow-wrap: anywhere; color: var(--color-text); }
.ds-demo-result__duration { text-align: right; color: var(--color-text-muted); }
@media (max-width: 559px) {
  .ds-demo-result__row { grid-template-columns: minmax(0, 1fr) auto; row-gap: var(--space-1); }
  .ds-demo-result__job { grid-column: 1 / -1; }
  .ds-demo-result .ds-status { justify-self: start; }
}
.ds-demo-reset { display: grid; gap: var(--space-4); }

/* SC-38 data export and deletion, platform deletion requests (55 section 5) */
.ds-data-export { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); margin-top: var(--space-4); }
.ds-data-export__card { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: var(--space-4); }
.ds-data-export__card > .ds-card__head { margin-bottom: calc(var(--space-5) - var(--space-4)); }
.ds-data-export__text { margin: 0; color: var(--color-text-body); }
.ds-data-export__text a { display: inline-flex; align-items: center; min-height: var(--target-min); }   /* the link stands on its own line: a control, 32 px (44 on phones), not a text line (DESIGN.md 14 E-4) */
.ds-data-export__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.ds-data-export__consequences { display: grid; gap: var(--space-2); margin: 0; padding-left: var(--space-5); color: var(--color-text-body); }
.ds-data-export__status, .ds-data-export__tenant { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.ds-data-export__reason { font-size: var(--text-sm); color: var(--color-text-muted); }
.ds-data-export__tenant .ds-chip { min-width: 0; background: var(--color-surface-3); }
.ds-data-export__pending { flex-wrap: wrap; align-items: center; }
.ds-data-export__pending .ds-alert__text { flex: 1 1 20rem; }
.ds-data-export__countdown { font-weight: var(--weight-bold); white-space: nowrap; }
.ds-deletion-dialog { display: grid; gap: var(--space-4); }
.ds-deletion-dialog .ds-data-export__consequences { font-size: var(--text-sm); }

/* SC-31 model and tests (35 sections 6 and 19.8, DESIGN N-11) */
.ds-model { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); margin-top: var(--space-4); }
.ds-model__bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-5); }
.ds-model-providers { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.ds-model-provider { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); min-height: var(--target-min); padding: var(--space-1) var(--space-3); border-radius: var(--radius-chip); background: var(--color-surface-2); font-size: var(--text-sm); color: var(--color-text); }
.ds-model-provider__models { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--color-text-muted); }
.ds-model__card { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: var(--space-4); }
.ds-model__card > .ds-card__head { flex-wrap: wrap; margin-bottom: 0; }
/* the two row cards (35 section 19.8): full width and stacked; from 768 px the selects and the buttons share a line and wrap; below 640 px the selects stack
   and the buttons (44 px on phones through --control-h-md) stand under them */
.ds-model-row { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: var(--space-3); }
.ds-model-row > .ds-card__head { margin-bottom: 0; }
.ds-model-row__help, .ds-model-row__tasks, .ds-model-row__active, .ds-model-row__mixed p { margin: 0; overflow-wrap: anywhere; }
.ds-model-row__help { font-size: var(--text-sm); color: var(--color-text-muted); }
.ds-model-row__tasks { font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-model-row__active { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); color: var(--color-text); }
.ds-model-row__label { font-weight: var(--weight-semibold); }
.ds-model-row__mixed { display: grid; gap: var(--space-2); font-size: var(--text-sm); color: var(--color-text-body); }
.ds-model-row__mixed ul { margin: 0; padding-left: var(--space-5); overflow-wrap: anywhere; }
.ds-model-row__choice { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.ds-model-row__choice > .ds-formfield { flex: 1 1 16rem; min-width: 0; grid-template-columns: minmax(0, 1fr); }   /* a select is as wide as its longest priced option: the field keeps its own width and the select shrinks (ellipsis) */
.ds-model-row__choice > .ds-formfield:first-child { flex: 0 1 18rem; }
.ds-model-row__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.ds-model-row__actions .ds-btn { white-space: nowrap; }
@media (max-width: 639px) {
  .ds-model-row__choice { flex-direction: column; align-items: stretch; }
  .ds-model-row__choice > .ds-formfield, .ds-model-row__choice > .ds-formfield:first-child { flex: none; }
}
.ds-model__check { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.ds-model__check > p { flex: 1 1 24rem; margin: 0; }
.ds-model-outcome { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.ds-model-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-3); }
@media (max-width: 1099px) { .ds-model-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 639px) { .ds-model-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ds-model-kpis .ds-kpi__value { font-size: var(--text-lg); } }
.ds-model__history { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
@media (max-width: 639px) { .ds-model__history { grid-template-columns: minmax(0, 1fr); } }
.ds-model-results__summary { display: block; max-width: 22rem; overflow-wrap: anywhere; }
.ds-model-questions__text, .ds-model-questions__domain { display: block; overflow-wrap: anywhere; }
.ds-model-questions__domain { font-size: var(--text-sm); font-weight: var(--weight-regular); color: var(--color-text-muted); }
.ds-model-testset { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
.ds-model-testset__bar { display: flex; justify-content: flex-end; }
.ds-model-testset .ds-table__sort { min-width: var(--target-min); }   /* the one-word "Br." header is 40 px wide: its sort button reaches the 44 px target on phones (DESIGN.md 14) */
.ds-model-question__delete { margin-inline-end: auto; }   /* the editor's delete sits at the left of the drawer footer (35 18.2) */
.ds-model-readonly__note { margin: var(--space-3) 0 0; }
.ds-model-result { display: grid; gap: var(--space-4); }
.ds-model-result__question { margin: 0; font-weight: var(--weight-semibold); color: var(--color-text); overflow-wrap: anywhere; }
.ds-model-result__answer { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--color-text-body); }
.ds-model-facts { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.ds-model-fact { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.ds-model-fact--found .ds-model-fact__word, .ds-model-fact--found .ds-icon, .ds-model-diff--fixed { color: var(--color-positive); }
.ds-model-fact--missing .ds-model-fact__word, .ds-model-fact--missing .ds-icon, .ds-model-diff--worse { color: var(--color-negative); }
.ds-model-fact__word, .ds-model-diff { font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.ds-model-fact__text { color: var(--color-text); overflow-wrap: anywhere; }
.ds-model__history .ds-formfield { grid-template-columns: minmax(0, 1fr); }

/* SC-46 AI PODEŠAVANJA and the section on SC-32 (spec 59 §10): the agent-context editor in the card shape of MODEL I TESTOVI; tokens only. */
.ds-agent-context { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
.ds-agent-context .ds-formfield { grid-template-columns: minmax(0, 1fr); }
.ds-agent-context__status { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin: 0; font-size: var(--text-sm); color: var(--color-text); }
.ds-agent-context__status a { display: inline-flex; align-items: center; min-height: var(--target-min); }   /* "Otvori AI podešavanja" stands on its own line when the row wraps: a control, 32 px (44 on phones), not a 20 px text line (DESIGN.md 14 E-4) */
.ds-agent-context__fills { font-size: var(--text-sm); color: var(--color-text-body); overflow-wrap: anywhere; }
.ds-agent-context__fills p, .ds-agent-context__fills ul { margin: 0 0 var(--space-2); }
.ds-agent-context__fills ul { padding-left: var(--space-5); }
.ds-agent-context__token { display: inline-block; padding: 0 var(--space-2); border-radius: var(--radius-pill); background: var(--color-surface-3); color: var(--color-text); white-space: nowrap; }   /* a placeholder token (`{{name}}`, copyable): a small pill in the UI font, never the code family (DESIGN.md 4.1) */
.ds-model__history .ds-field { min-width: 0; }

/* placeholder modules (AIS-73, 22 section 4, DESIGN N-14): the DEMO ribbon over the caption, number cards in the report-panel colour, tile skeletons after 300 ms */
.ds-ribbon { position: absolute; top: 0; right: 0; padding: 2px var(--space-2); border-radius: var(--radius-xs); background: var(--tint-info); color: var(--color-info); font-size: var(--text-xs); font-weight: var(--weight-bold); line-height: 1.5; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.ds-module__head { position: relative; min-height: 1.75rem; margin-bottom: var(--space-3); padding-right: 9rem; }
.ds-module__caption { margin: 0; padding-top: 2px; font-size: var(--text-xs); line-height: 1.5; color: var(--color-text-muted); }
.ds-module-kpis .ds-kpi { background: var(--color-report-panel); }
/* embedded report frame (AIS-257, spec 27 9, DESIGN 9.5, design-system 5.5): the frame fills the report column (report-card radius 18 (--radius-card), fill report-frame, no border or padding; the
   report-shadow comes from layout.css; the report scrolls inside itself, never the page); the SDK host, the overlay and the ribbon are siblings. The overlay covers the frame for the notices
   and the skeleton, lets clicks through to the report otherwise, and is the size container of the notice icon (64 px in a frame higher than 600 px). */
.ds-embed { position: relative; display: flex; flex-direction: column; min-width: 0; height: 100%; }
.ds-embed__frame { position: relative; flex: 1 1 auto; min-height: 520px; overflow: hidden; border-radius: var(--radius-card); background: var(--color-report-frame); }
.ds-embed__host { position: absolute; inset: 0; }
/* the frame sits mid-page, so the shell's "off the top" skip-link trick would show the link over the tool row: hidden until focused, then inside the frame's top left */
.ds-embed > .ds-skip-link:not(:focus) { width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ds-embed__overlay { position: absolute; inset: 0; display: flex; flex-direction: column; overflow: auto; container-type: size; pointer-events: none; }
.ds-embed__overlay > * { pointer-events: auto; }
.ds-embed__overlay--cover { background: var(--color-report-frame); pointer-events: auto; }
.ds-embed__overlay--cover > .ds-notice { margin: auto; }
.ds-embed__ribbon { position: absolute; top: var(--space-3); right: var(--space-3); z-index: 1; }
.ds-embed__ribbon .ds-ribbon { position: static; }
.ds-embed[data-state="SessionEnded"] .ds-embed__ribbon { top: calc(32px + var(--space-3)); }   /* the stand-in ribbon 12 px below the 32 px session strip, never over its link */
.ds-ribbon--warning { background: var(--tint-warning); color: var(--color-warning); }
.ds-embed__skeleton { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: var(--space-3); padding: var(--space-3); }
.ds-embed__tile { grid-column: span 2; border-radius: var(--radius-md); background: linear-gradient(90deg, var(--color-report-panel), var(--color-report-header), var(--color-report-panel)); background-size: 200% 100%; animation: ds-shimmer 1.4s linear infinite; }
.ds-embed__tile:nth-child(n + 4) { grid-column: span 3; }
.ds-embed__skeleton--standin .ds-embed__tile { background: var(--color-report-panel); animation: none; }
@media (prefers-reduced-motion: reduce) { .ds-embed__tile { animation: none; } }
/* the notice block: the Empty pattern of DESIGN 13 (icon 40 / 64, title 16/600, sentences 13/400 muted at most 420 px wide, the muted account line 12/400) */
.ds-notice { position: relative; display: grid; justify-items: center; gap: var(--space-3); max-width: 100%; padding: var(--space-7) var(--space-4); border-radius: var(--radius-md); background: var(--color-report-frame); text-align: center; }
.ds-notice__title { margin: 0; font-size: var(--text-lg); line-height: 1.5; font-weight: var(--weight-semibold); color: var(--color-text); }
.ds-notice__text { max-width: 420px; margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); }
.ds-notice__text .ds-icon { margin-right: var(--space-2); vertical-align: text-bottom; }
.ds-notice__text--negative .ds-icon { color: var(--color-negative); }
.ds-notice__text--warning .ds-icon { color: var(--color-warning); }
.ds-notice__account { margin: 0; font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-notice__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-3); margin-top: var(--space-2); }
.ds-notice--large .ds-notice__icon { width: 64px; height: 64px; }
@container (min-height: 601px) { .ds-notice__icon { width: 64px; height: 64px; } }
/* the banners above the frame (Preview: info, Source unavailable: warning) and the session strip inside it: 32 px, glyph + text 13/400 (DESIGN.md 9.5) */
.ds-banner { display: flex; align-items: center; gap: var(--space-2); min-height: 32px; padding: var(--space-1) var(--space-3); border-radius: var(--radius-md); font-size: var(--text-sm); color: var(--color-text); }
.ds-banner--info { background: var(--tint-info); }
.ds-banner--info .ds-icon { color: var(--color-info); }
.ds-banner--warning { background: var(--tint-warning); }
.ds-banner--warning .ds-icon { color: var(--color-warning); }
.ds-banner__text { flex: 1 1 auto; min-width: 0; }
.ds-banner__trail { color: var(--color-text-muted); }
.ds-banner .ds-btn { margin-block: calc((24px - var(--btn-h)) / 2); }   /* a banner action reaches past the strip's 4 px inset, so the strip stays 32 px (the touch target of 44 too) */
.ds-session-strip { position: relative; display: flex; align-items: center; gap: var(--space-2); min-height: 32px; padding: 0 var(--space-3); background: var(--tint-warning); color: var(--color-text); font-size: var(--text-sm); }
.ds-session-strip > .ds-icon { color: var(--color-warning); }
.ds-session-strip__text { flex: 1 1 auto; min-width: 0; }
.ds-session-strip .ds-btn { margin-block: calc((32px - var(--btn-h)) / 2); }   /* the link's touch target of 44 reaches past the bar, which stays 32 px */
/* competitor analysis, dynamic pricing and 3M LOGICIEL (22 section 4) */
.ds-competitors__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-3); }
.ds-competitors__chips { display: flex; flex-wrap: wrap; gap: var(--space-2); min-width: 0; }
.ds-competitors__events { display: grid; gap: var(--space-2); margin: 0; padding-left: var(--space-4); font-size: var(--text-sm); line-height: 1.5; }
.ds-table td.ds-table__span { color: var(--color-text-muted); }
.ds-pricing__rule { margin: 0 0 var(--space-3); font-size: var(--text-sm); line-height: 1.5; }
.ds-pricing__filter { max-width: 22rem; margin-bottom: var(--space-3); }
.ds-pricing__table { --table-surface: var(--color-report-panel); }   /* the sticky first column takes the tile's fill, not the near-black surface-1 of the app skin (AIS-V626) */
.ds-pricing__table th:first-child, .ds-pricing__table td:first-child { min-width: 14rem; }
.ds-pricing__table .ds-status { white-space: nowrap; }
.ds-pricing__disclaimer { margin-top: var(--space-3); }
.ds-module3m { display: grid; justify-items: center; gap: var(--space-5); }
.ds-module3m__card { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); width: 100%; max-width: 640px; text-align: center; }
.ds-module3m__title { margin: 0; font-size: var(--text-xl); }
.ds-module3m__text { margin: 0; color: var(--color-text-muted); }
.ds-module3m__features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); width: 100%; max-width: 640px; margin: 0; padding: 0; list-style: none; }
.ds-module3m__feature { display: flex; flex-direction: column; gap: var(--space-1); height: 100%; color: var(--color-text-muted); }
.ds-module3m__feature-title { font-weight: var(--weight-bold); }
.ds-module3m__feature-note { font-size: var(--text-xs); }
@media (max-width: 599px) {
  .ds-module3m__features { grid-template-columns: minmax(0, 1fr); }
}

/* tenants and support mode (AIS-75, 11 sections 6.5-6.7, DESIGN N-08 pattern; no mock-up) */
.ds-support-enter__tenant { margin: 0 0 var(--space-3); font-weight: var(--weight-bold); color: var(--color-text); }
.ds-tenants__name, .ds-tenants__plan { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.ds-tenants__tips { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-2); min-width: 7rem; font-size: var(--text-sm); white-space: nowrap; }   /* ZADATAK 11: the number right of the bar */
/* ZADATAK 11 (11:15): on a wide screen the Klijenti table keeps sensible columns - at most 1400 px, the rest of the card stays empty on the right */
.ds-tenants-table { max-width: 1400px; }
.ds-tenants__bar { height: 8px; }
.ds-tenant, .ds-tenant__overview, .ds-tenant-plan { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
.ds-tenant__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.ds-tenant__name { margin: 0; overflow-wrap: anywhere; }
.ds-tenant .ds-admin-tabs { margin-bottom: 0; }
.ds-model .ds-admin-tabs { margin-bottom: 0; }   /* the grid gap already spaces the strip */
.ds-tenant__overview .ds-admin-alert { margin-bottom: 0; }
.ds-tenant__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.ds-tenant__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
@media (max-width: 767px) { .ds-tenant__grid { grid-template-columns: minmax(0, 1fr); } }
.ds-tenant__card { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: var(--space-4); }
.ds-tenant__card > .ds-card__head { margin-bottom: 0; }
.ds-tenant-settings, .ds-branding-fields, .ds-tenant-branding .ds-admin-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
.ds-tenant-settings .ds-formfield, .ds-branding-fields .ds-formfield, .ds-tenant-plan .ds-formfield { grid-template-columns: minmax(0, 1fr); }
.ds-branding-fields .ds-field__caption { white-space: normal; }
.ds-tenant-branding { display: grid; grid-template-columns: minmax(0, 1fr) minmax(15rem, 22rem); align-items: start; gap: var(--space-4); }
@media (max-width: 1023px) { .ds-tenant-branding { grid-template-columns: minmax(0, 1fr); } }
.ds-tenant-plan__extension { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: var(--space-4); }
@media (max-width: 639px) { .ds-tenant-plan__extension { grid-template-columns: minmax(0, 1fr); } }
.ds-branding-preview { display: grid; gap: var(--space-3); margin: 0; min-width: 0; }
.ds-branding-preview__caption { font-size: var(--text-xs); font-weight: var(--weight-bold); letter-spacing: var(--tracking-upper); text-transform: uppercase; color: var(--color-text-muted); }
.ds-branding-preview__login { display: grid; justify-items: center; gap: var(--space-3); padding: var(--space-5) var(--space-4); border-radius: var(--radius-inner); background: var(--color-surface-1); text-align: center; }
.ds-drawer .ds-branding-preview__login { background: var(--color-surface-2); }
.ds-branding-preview__slogan { margin: 0; font-size: var(--text-sm); color: var(--color-text-body); overflow-wrap: anywhere; }
.ds-branding-preview__bar { display: flex; align-items: center; gap: var(--space-3); min-width: 0; padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--color-surface-3); }
.ds-branding-preview__product { min-width: 0; font-size: var(--text-sm); font-weight: var(--weight-bold); color: var(--color-text); overflow-wrap: anywhere; }

/* MY SETTINGS (AIS-76, 10 section 5, DESIGN 12.0 / N-12): inner cards in the two panel columns; "Sačuvano" beside the title; skeleton cards after 300 ms */
.ds-settings__card > .ds-card__head { flex-wrap: wrap; }
.ds-settings__saved { margin-left: auto; font-size: var(--text-sm); color: var(--color-positive); }
.ds-settings__help, .ds-settings__note { margin: 0; font-size: var(--text-sm); color: var(--color-text-body); overflow-wrap: anywhere; }
.ds-settings__note { margin-top: var(--space-4); color: var(--color-text-muted); }
.ds-settings__help + .ds-settings__switches, .ds-settings__fields + .ds-settings__switches { margin-top: var(--space-3); }
.ds-settings__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-4); }
.ds-settings__muted { color: var(--color-text-muted); }
.ds-settings__label { display: grid; gap: 2px; }
.ds-settings__label .ds-settings__muted { font-size: var(--text-xs); }
.ds-settings__name { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.ds-settings__name-box { flex: 1 1 12rem; min-width: 0; min-height: var(--control-h-md); padding: 0; border-radius: var(--radius-field-sm); }   /* the input inside is the whole 32 / 44 px box (DESIGN.md 14) */
.ds-settings__name-field .ds-field__error { margin-top: var(--space-2); }
.ds-settings__badges { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
.ds-settings__name-box > .ds-field__input { width: 100%; align-self: stretch; padding-inline: var(--space-4); }
.ds-settings__fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
.ds-settings__fields .ds-formfield { grid-template-columns: minmax(0, 1fr); }
.ds-settings__range { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
@media (max-width: 479px) { .ds-settings .ds-segmented { display: flex; } .ds-settings .ds-segmented__item { flex: 1 1 0; min-width: 0; padding-inline: var(--space-2); } }
/* MICROSOFT NALOG (AIS-274, spec 28 11.3, DESIGN N-12): the date lines under the account row; below 640 px the card's buttons stack full width at the 44 px button height */
.ds-settings__lines { display: grid; gap: var(--space-1); margin-top: var(--space-3); }
/* background access row (AIS-295, spec 28 11.3): below the account rows, above the buttons */
.ds-settings__background { margin-top: var(--space-4); }
@media (max-width: 639px) { .ds-settings__actions--stack { flex-direction: column; } .ds-settings__actions--stack > .ds-btn { width: 100%; min-height: var(--touch-min); } }

/* support inbox (AIS-77, 12 section 8; no mock-up: DESIGN 9.3 table, 9.8 drawer) */
.ds-inbox__sender { display: grid; min-width: 11rem; overflow-wrap: anywhere; }
.ds-inbox__preview { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; max-width: 28rem; overflow: hidden; overflow-wrap: anywhere; }
.ds-inbox-detail__text { margin: 0; }
.ds-inbox-detail__replies { display: grid; gap: var(--space-3); margin: 0; padding: 0; list-style: none; }
.ds-inbox-detail__reply { display: grid; gap: var(--space-1); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--color-surface-2); }
.ds-inbox-detail__reply-head { font-size: var(--text-sm); }
.ds-inbox-detail__reply p { margin: 0; }

/* touch targets below 768 px (03 section 6, DESIGN.md 14, H-27 HA-11): a control that looks smaller than 44 x 44 gets a transparent hit area of at least 44 x 44
   (the .ds-domain-tab::before pattern) without changing its look; where neighbours are closer, the hit area stops where it would overlap theirs */
@media (max-width: 767.98px) {
  a.ds-sourcechip, button.ds-chip, .ds-rtable__sort, .ds-datebox-item .ds-icon-btn, .ds-slicerbar__home .ds-icon-btn, .ds-users-table .ds-table__actions .ds-icon-btn { position: relative; }
  .ds-rtable__sort::before, .ds-slicerbar__home .ds-icon-btn::before {
    content: ""; position: absolute; inset: min(0px, calc(50% - 22px));
  }
  .ds-users-table .ds-table__actions .ds-icon-btn::before, .ds-datebox-item .ds-icon-btn::before { content: ""; position: absolute; inset: min(0px, calc(50% - 22px)) 0; }   /* side by side with their neighbours (three row actions; date field and calendar button): taller, not wider */
  .ds-table__rowbutton { display: grid; align-content: center; min-height: var(--touch-min); }   /* the row's named stop (a name or title cell) is a 44 px target on phones (DESIGN.md 14) */
  button.ds-chip::before, a.ds-sourcechip::after { content: ""; position: absolute; inset: -4px 0; }   /* filter and source chips wrap with an 8 px row gap: half of it above and below */
}
/* a sm button keeps its compact look (28, 36 under a coarse pointer and on phones) and gets a transparent hit area of target-min: 32 on a fine pointer, 44 under a coarse pointer and on phones (DESIGN.md 8.1, 14 rule 2) */
.ds-btn--sm { position: relative; }
.ds-btn--sm::before { content: ""; position: absolute; inset: min(0px, calc(50% - var(--target-min) / 2)) 0; }
/* prefers-contrast: more (DESIGN.md 15.2 rule 13, H-27 HW-4): buttons get an edge as the fields do */
@media (prefers-contrast: more) {
  .ds-btn { border: 1px solid var(--color-field-border-hc); }
}
/* forced colours drop box-shadows: an invalid field keeps a 2 px edge, the error text with its glyph stays the main cue (03 section 6, AIS-126) */
@media (forced-colors: active) {
  .ds-field[data-invalid="true"], .ds-datebox[aria-invalid="true"], .ds-conv__rename[aria-invalid="true"], .ds-assistant__title-input[aria-invalid="true"] { border-width: 2px; }
}

/* platform administrators (SC-44, DESIGN N-17): the name cell with its origin badge, two-line rows of 48 px, the e-mail value, the name line of the step-up dialog ------ */
.ds-pa-cell { display: grid; gap: 2px; justify-items: start; min-width: 0; }
.ds-pa-cell__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); min-width: 0; }
.ds-pa-cell .ds-user-cell__name { white-space: normal; overflow-wrap: anywhere; }
.ds-pa-cell .ds-user-cell__sub { line-height: var(--lh-tight); overflow-wrap: anywhere; }   /* 12/16: the name (20) and the user name (16) make the 48 px two-line row (DESIGN.md 5.4) */
.ds-pa-email { overflow-wrap: break-word; }
.ds-pa-table .ds-table__actions { white-space: nowrap; }
@media (min-width: 640px) { .ds-pa-table .ds-table td { height: 48px; } }   /* two lines: the name over the user name (DESIGN.md 5.4) */
@media (min-width: 640px) { .ds-pa-table .ds-pa-cell { min-width: 9.5rem; } }   /* the floor of the name column: it holds the widest badge ("Servisni nalog" 132 px, English "Service account" 144 px) beside nothing else, so the badges wrap under the name inside the cell instead of being painted over the e-mail; the frame scrolls rather than squeezing it */
@media (min-width: 640px) and (max-width: 1099px) { .ds-pa-table .ds-table { min-width: 48rem; } }   /* the frame scrolls sideways with the name column fixed; the row actions stay icon buttons (DV-25) */
@media (max-width: 639px) {
  .ds-pa-bar .ds-filterbar__filters > * { flex: 1 1 100%; min-width: 0; }   /* the search and the state select take a full row each, the add button the full width at 44 px */
  .ds-pa-bar .ds-filterbar__actions { flex: 1 1 100%; margin-left: 0; }
  .ds-pa-bar .ds-filterbar__actions .ds-btn { flex: 1 1 auto; justify-content: center; }
  .ds-pa-table .ds-table--stack td:not(.ds-table__primary) { flex-wrap: wrap; row-gap: var(--space-1); }   /* a long label and a badge side by side would clip the badge: it wraps below the label instead */
  .ds-pa-table .ds-table--stack td:not(.ds-table__primary):not(.ds-table__actions) > * { margin-left: auto; }   /* the value stays at the right edge, beside the label or below it */
  .ds-pa-table .ds-table__rowbutton { display: flex; align-items: center; min-height: var(--touch-min); }   /* the name button of a card is 44 px high (PA-AC18), also when the card has no badge row */
}
.ds-stepup__subject { display: grid; gap: 2px; margin: var(--space-4) 0 0; min-width: 0; }
.ds-stepup__name { font-weight: var(--weight-bold); overflow-wrap: anywhere; }
.ds-stepup__user { font-size: var(--text-xs); color: var(--color-text-muted); overflow-wrap: anywhere; }

/* MY NOTIFICATIONS: the notification page SC-47 and the editor SC-48 (DESIGN N-19) */
.ds-unotif { display: flex; flex-direction: column; gap: var(--space-3); }
.ds-unotif__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.ds-unotif__head .ds-h2 { margin: 0; overflow-wrap: anywhere; }
.ds-unotif__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-inline-start: auto; }
.ds-unotif__caption { margin: 0; font-size: var(--text-xs); line-height: var(--lh-tight); color: var(--color-text-muted); }
.ds-unotif__history-title { margin: var(--space-3) 0 0; }
.ds-unotif__history { display: flex; flex-direction: column; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.ds-unotif__row { display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: var(--target-min); padding: 0 var(--space-2); border: 0; border-radius: var(--radius-md); background: none; color: var(--color-text); font: inherit; text-align: start; cursor: pointer; white-space: nowrap; }
@media (hover: hover) { .ds-unotif__row:hover { background: var(--color-surface-hover-2); } }   /* the rows rest on the content panel (surface-2) */
.ds-unotif__chevron { flex: none; color: var(--color-text-muted); transform: rotate(-90deg); transition: transform var(--dur-fast) var(--ease); }
.ds-unotif__row[aria-expanded="true"] .ds-unotif__chevron { transform: none; }
.ds-unotif__when { font-variant-numeric: tabular-nums; }
.ds-unotif__reason { margin: 0 0 0 calc(var(--space-2) + 16px + var(--space-3)); font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-unotif__result { --table-surface: var(--color-surface-2); padding-inline-start: var(--space-2); }   /* the answer's sticky first column takes the panel's surface, not the chat's */
/* the editor body is a scrolling flex column (AIS-511): only the card may shrink, and only down to its own minimum; it clips, so a long answer never spills over the condition.
   The answer scrolls inside the card: at most min(360px, 42vh), less when the body needs the room for the condition and the e-mail line, never under 180 px */
.ds-unotif-editor__fields, .ds-unotif-editor__condition, .ds-unotif-editor__email { flex: none; }
.ds-unotif-editor__fields { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-3) var(--space-4); }
.ds-unotif-editor__fields > .ds-formfield { flex: 1 1 160px; min-width: 0; }
.ds-unotif-editor__fields > .ds-formfield:first-child { flex: 2 1 280px; }   /* Naziv is the widest field; Učestalost and Dan share the rest */
.ds-unotif-editor__card { flex: 0 1 auto; display: flex; flex-direction: column; gap: var(--space-3); min-height: 280px; padding: var(--space-4); border-radius: var(--radius-inner); background: var(--color-surface-2); overflow: hidden; }
.ds-unotif-editor__card .ds-chat__input { flex: none; background: var(--color-surface-1); }
.ds-unotif-editor__result { --table-surface: var(--color-surface-2); flex: 1 1 auto; display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); min-width: 0; min-height: 180px; max-height: min(360px, 42vh); overflow-y: auto; overscroll-behavior: contain; padding: 2px var(--space-2) 2px 2px; font-size: var(--text-chat); line-height: var(--lh-chat); color: var(--color-text-body); }
.ds-unotif-editor__result > .ds-msg { margin-top: 0; align-self: stretch; }
.ds-unotif-editor__hint { margin: auto 0; color: var(--color-text-muted); }
.ds-unotif-editor__condition { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); }
.ds-unotif-editor__condition > .ds-formfield { align-self: stretch; }
.ds-unotif-editor__email { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-3); }
.ds-unotif-editor__email-caption { font-size: var(--text-xs); line-height: var(--lh-tight); color: var(--color-text-muted); }
@media (max-width: 767px) {
  .ds-unotif-editor__fields > .ds-formfield, .ds-unotif-editor__fields > .ds-formfield:first-child { flex-basis: 100%; }
  .ds-unotif-editor__email { row-gap: var(--space-1); padding-bottom: var(--space-1); }
}

/* the due chips of a task (DueChips): a pill per date, pressed when chosen */
.ds-period__chip { position: relative; min-height: 32px; padding: 0 var(--space-3); border-radius: var(--radius-pill); border: 1px solid var(--color-border-subtle); background: var(--color-surface-2); color: var(--color-text-body); font: inherit; font-size: var(--text-sm); cursor: pointer; }
.ds-period__chip::before { content: ""; position: absolute; inset: min(0px, calc(50% - var(--target-min) / 2)) 0; }   /* 32 high (36 under touch) with a 32 / 44 px hit area: the 8 px row gap leaves the areas touching, never overlapping (DESIGN.md 8.7, 14) */
@media (pointer: coarse), (max-width: 767px) { .ds-period__chip { min-height: 36px; } }
@media (hover: hover) { .ds-period__chip:hover { background: var(--color-surface-hover-2); } }
.ds-period__chip[aria-pressed="true"] { border-color: var(--color-accent); background: color-mix(in srgb, var(--color-accent) 18%, transparent); color: var(--color-text); }

/* ==== redesign 2026-11: the chat ======================================================================================================== */
/* a glass card: translucent, a fine light edge, soft deep shadow, a blue glow in its corner */
.ds-chat { isolation: isolate; overflow: hidden; padding: 14px; border-radius: var(--radius-card); background: var(--card-bg); box-shadow: var(--card-shadow); }
.ds-chat::before { content: ""; position: absolute; top: -120px; right: -80px; z-index: -1; width: 320px; height: 320px; border-radius: 50%; background: var(--chat-glow); filter: blur(40px); pointer-events: none; }
/* the 20 px blur sits on a layer under the glow and the content: a backdrop-filter on the chat itself would make it the containing block of the composer's fixed tool menu */
.ds-chat::after { content: ""; position: absolute; inset: 0; z-index: -2; border-radius: inherit; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); pointer-events: none; }

/* header: the orb, the title with its subtitle, the size switch, the actions; a fading hairline under it */
.ds-chat__head { flex-wrap: wrap; justify-content: flex-start; gap: 10px; row-gap: 6px; min-height: 0; padding: 0 0 12px 4px; }   /* AIS-A528, AIS-V933: where the actions leave the title less than 8.5rem (the history and hide buttons, any chat card narrower than about 420 px) they wrap to a second row instead of squeezing the title; a wide card keeps one row (DESIGN.md 9.7) */
.ds-chat__head::after { content: ""; position: absolute; left: 4px; right: 4px; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--chat-hair), transparent); }
/* the avatar is the brand dot (AIS-517): a 14 px dot in a 26 px box, and a ring that ripples out of it while an answer comes (the motion: layout.css) */
.ds-chat__orb { position: relative; flex: none; display: grid; place-items: center; width: 26px; height: 26px; }
.ds-chat__orb::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--brand-dot); box-shadow: var(--brand-dot-glow); }
.ds-chat__orb::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; border: 1.5px solid var(--brand-dot-ring); opacity: 0; pointer-events: none; }
.ds-chat__heading { display: flex; flex: 1 1 8.5rem; flex-direction: column; min-width: 0; line-height: 1.25; }
.ds-chat__title { overflow: hidden; font-size: var(--text-chat-title); letter-spacing: -0.01em; text-overflow: ellipsis; white-space: nowrap; }
.ds-chat__subtitle { overflow: hidden; font-size: var(--text-micro); font-weight: var(--weight-regular); color: var(--color-text-subtle); text-overflow: ellipsis; white-space: nowrap; }
.ds-chat__head-actions { gap: 2px; margin-inline-start: auto; }
.ds-chat__new { box-shadow: inset 0 0 0 1px var(--chat-hair); color: var(--color-text); }
.ds-chat-size { display: none; gap: var(--space-1); margin-inline-end: var(--space-1); padding: 3px; border-radius: var(--radius-lg); background: var(--well-bg); box-shadow: var(--well-shadow); }
@media (min-width: 1100px) { .ds-chat-size { display: flex; } }
.ds-chat-size__btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 26px; padding: 0; border: 0; border-radius: var(--radius-seg-sm); background: transparent; color: var(--color-text-subtle); cursor: pointer; }
.ds-chat-size__btn::before { content: ""; position: absolute; inset: -3px -2px; }   /* the 28 x 26 look keeps a 32 x 32 hit area (DESIGN.md 14 rule 2): into the well's 3 px padding and half of the 4 px gap, so neighbours touch and never overlap */
@media (pointer: coarse) { .ds-chat-size { gap: 16px; padding-inline: 8px; } .ds-chat-size__btn::before { inset: -9px -8px; } }   /* DESIGN.md 3.1.6: the same 28 x 26 look (the well stays 32 high, 132 wide) with 44 x 44 hit areas: 8 px end inset and 16 px gap, so neighbours touch and never overlap */
.ds-chat-size__btn[aria-pressed="true"] { background: var(--seg-on-bg); color: var(--color-text); box-shadow: var(--seg-on-shadow); }
@media (hover: hover) { .ds-chat-size__btn[aria-pressed="false"]:hover { color: var(--color-text); } }

/* the log; over the whole workspace the conversation is a centred column of at most 760 px */
.ds-chat__log { padding: var(--space-5) var(--space-1); }
:is(.ds-grid-report[data-chat-size="full"], .ds-assistant) .ds-chat__log { padding-inline: max(4px, calc((100% - 980px) / 2)); }   /* AIS-A528 K8: tables and cards up to 980 px */
:is(.ds-grid-report[data-chat-size="full"], .ds-assistant) .ds-chat__log :is(.ds-msg--user, .ds-chat-p, .ds-answer__lines, .ds-chat-heading, .ds-meaning, .ds-chat-notice, .ds-chat-note, .ds-msg__muted, .ds-feedback, .ds-chat__empty, .ds-chat-table__sorted) { max-width: 760px; margin-inline: auto; }   /* the text in the centred 760 px column */
:is(.ds-grid-report[data-chat-size="full"], .ds-assistant) :is(.ds-composer, .ds-chat__disclaimer, .ds-chat__alert, .ds-chat__quota, .ds-chat__voice-bar, .ds-chat > .ds-chat__chips) { width: 100%; max-width: 760px; margin-inline: auto; }
/* AIS-A534: the assistant page's chat is the same centred column (text 760 px, tables 980 px) */
.ds-chat__subtitle--picker { display: inline-flex; align-items: center; gap: var(--space-1); overflow: visible; }   /* the subtitle clips its text; here it holds the domain chip, whose hit area reaches above and below it */
.ds-chat__domain-chip { position: relative; display: inline-flex; align-items: center; gap: var(--space-1); min-height: 24px; padding: 0 var(--space-2); border: 0; border-radius: var(--radius-pill); background: var(--chat-hover); color: var(--color-text); font: inherit; font-size: var(--text-xs); font-weight: var(--weight-medium); cursor: pointer; }
.ds-chat__domain-chip::before { content: ""; position: absolute; inset: min(0px, calc(50% - var(--target-min) / 2)) 0; }   /* the 24 px chip keeps its look and is a 32 / 44 px target (DESIGN.md 8.7, 14 rule 2) */
.ds-chat__domain-chip[aria-expanded="true"] { background: var(--color-surface-hover-2); }
@media (hover: hover) { .ds-chat__domain-chip:hover { background: var(--color-surface-hover-2); } }
.ds-chat__domain-chip .ds-icon { display: block; color: var(--color-text-muted); }
.ds-msg--user { padding: 10px 15px; border-radius: var(--radius-bubble); background: var(--chat-bubble); box-shadow: var(--chat-bubble-shadow); }

/* the empty chat: the greeting, the tool cards, the suggested questions as a list */
.ds-chat__empty { display: flex; flex-direction: column; justify-content: safe center; gap: 22px; height: 100%; min-height: 0; padding: var(--space-2) 0; }
.ds-chat__empty > * { flex: none; }
/* the suggested questions take the room that is left under the greeting and the tool cards, whole rows only: a column that wraps and clips (no cut row, no scrolling empty chat under the quota notice); the title and the
   first row are one unit (the lead), behind a first item of no height, so the title never stands alone */
.ds-chat__empty > .ds-chat__prompts { flex: 0 1 auto; flex-flow: column wrap; align-content: flex-start; min-height: 0; overflow: hidden; }
.ds-chat__prompts::before { content: ""; width: 100%; height: 0; margin-bottom: -2px; }
.ds-chat__prompts > * { width: 100%; flex: none; }
.ds-chat__prompts-lead { display: flex; flex-direction: column; gap: 2px; }
.ds-chat__hello-title { margin: 0; font-size: var(--text-greeting); line-height: 1.2; font-weight: 300; letter-spacing: -0.03em; color: var(--color-text); }
.ds-chat__hello-title strong { font-weight: var(--weight-semibold); }
.ds-chat__hello .ds-chat__greeting { margin: 6px 0 0; color: var(--color-text-muted); }
/* a tool of the ToolSelector (DESIGN.md 8.5, restored for the cards in AIS-V606): a borderless button, the icon left of the label; a disabled one is muted */
.ds-tool { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--control-h-md); padding: 0 var(--space-3); border: 0; border-radius: var(--radius-md); background: none; color: var(--color-text); font-size: var(--text-sm); font-weight: var(--weight-regular); white-space: nowrap; }
.ds-tool__icon { width: 20px; height: 20px; flex: none; }
.ds-tool[aria-disabled="true"] .ds-tool__icon { opacity: 0.5; }
.ds-toolrow--cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; min-height: 0; margin: 0; }
.ds-toolrow--cards .ds-tool {
  flex-direction: column; align-items: flex-start; gap: 10px; min-height: 0; padding: 14px; border-radius: var(--radius-inner); text-align: left; white-space: normal;
  background: var(--tool-off-bg); box-shadow: var(--tool-off-shadow); color: var(--color-text); font-weight: var(--weight-regular); cursor: pointer;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.ds-toolrow--cards .ds-tool[aria-checked="true"] { background: var(--tool-on-bg); box-shadow: var(--tool-on-shadow); font-weight: var(--weight-regular); }
@media (hover: hover) {
  .ds-toolrow--cards .ds-tool:not([aria-disabled="true"]):hover { transform: translateY(-3px); background: var(--tool-off-bg); box-shadow: var(--tool-off-shadow), 0 14px 30px -16px var(--lift-glow); }
  .ds-toolrow--cards .ds-tool[aria-checked="true"]:hover { background: var(--tool-on-bg); box-shadow: var(--tool-on-shadow), 0 14px 30px -16px var(--lift-glow); }
}
.ds-toolrow--cards .ds-tool:not([aria-disabled="true"]):active { transform: scale(0.97); }   /* AIS-A516: a press gives way a little */
.ds-toolrow--cards .ds-tool[aria-disabled="true"] { cursor: not-allowed; color: var(--color-text-muted); }
.ds-toolrow--cards .ds-tool .ds-tooltip { left: 14px; transform: none; }
.ds-tool__well { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--radius-lg); box-shadow: var(--tool-well-shadow); }
.ds-tool__well[data-tool-key="fastconclusion"] { background: var(--tool-well-fast); }
.ds-tool__well[data-tool-key="delta"] { background: var(--tool-well-delta); }
.ds-tool__well[data-tool-key="income"] { background: var(--tool-well-income); }
.ds-toolrow--cards .ds-tool__icon { width: 22px; height: 22px; }
.ds-tool__text { display: flex; flex-direction: column; gap: 2px; }
.ds-toolrow--cards .ds-tool__label { font-size: var(--text-sm); font-weight: var(--weight-semibold); letter-spacing: -0.01em; }
.ds-tool__desc { font-size: var(--text-tool-desc); line-height: 1.45; color: var(--color-text-muted); }
.ds-chat__prompts { display: flex; flex-direction: column; flex-wrap: nowrap; gap: 2px; margin: 0; padding: 0; overflow: visible; }
.ds-chat__prompts-title { padding: 0 4px 6px; font-size: var(--text-kicker); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-kicker); text-transform: uppercase; color: var(--color-text-subtle); }
.ds-chat__prompts .ds-chip--prompt {
  display: flex; align-items: center; gap: 10px; flex: none; width: 100%; max-width: none; min-height: 0; height: auto; padding: 10px 12px; border-radius: var(--radius-lg);
  background: transparent; color: var(--color-text-body); font-size: var(--text-sm); line-height: 1.4; text-align: left; white-space: normal; overflow: visible;
}
.ds-chip__text { flex: 1; min-width: 0; }
.ds-chip__arrow { flex: none; opacity: 0.5; }
@media (hover: hover) { .ds-chat__prompts .ds-chip--prompt:hover { background: var(--chat-hover); } }   /* no lift: the block clips its overflow to whole rows (merge of develop, the owner's choice) */
@media (pointer: coarse), (max-width: 767px) { .ds-chat__prompts .ds-chip--prompt { min-height: var(--touch-min); } }   /* a 44 px target on a phone too, so fewer rows fit there (spec 66 8.3 item 6) */
.ds-chat__prompts .ds-chip--prompt:focus-visible { outline-offset: -2px; }   /* the block clips its overflow: the ring is drawn inside the row at every width (DESIGN.md 15.2 rule 3) */

/* the composer: a rounded field inside a glowing edge (green to blue), the tool button, the hint, the microphone and the send button below the question */
.ds-composer { position: relative; margin-top: var(--space-1); padding: 1px; border-radius: var(--radius-composer); background: var(--composer-ring); box-shadow: var(--composer-ring-shadow); }
.ds-composer:focus-within { outline: 2px solid var(--color-focus-ring); outline-offset: 2px; }
.ds-composer .ds-composer__box { display: flex; flex-direction: column; align-items: stretch; gap: var(--space-2); min-height: 0; padding: var(--space-3) 10px 10px var(--space-4); border-radius: calc(var(--radius-composer) - 1px); background: var(--composer-bg); }
.ds-composer .ds-composer__box:focus-within { outline: none; }
.ds-composer .ds-composer__box textarea { font-size: var(--text-composer); line-height: 1.5; }
.ds-composer__row { display: flex; align-items: center; gap: 6px; }
.ds-composer__hint { flex: 0 1 auto; min-width: 0; margin-inline: auto var(--space-1); overflow: hidden; font-size: var(--text-micro); color: var(--color-text-subtle); text-overflow: ellipsis; white-space: nowrap; }   /* gives way in a narrow chat: the microphone and the send disc always fit */
@media (pointer: coarse), (max-width: 767px) {
  .ds-composer__hint { display: none; }
  .ds-composer__hint + * { margin-inline-start: auto; }   /* the hint's spacer: the microphone and the send disc stay at the end of the row */
  .ds-composer__row > .ds-popover-anchor, .ds-composer__tool { min-width: 0; }   /* down to 320 px the pill gives way: its name ends in an ellipsis (the full name is its accessible name) */
}
.ds-composer__tool {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px 0 8px; border: 0; border-radius: var(--radius-pill); background: transparent;
  position: relative; color: var(--color-text); font-size: var(--text-xs); font-weight: var(--weight-medium); white-space: nowrap; box-shadow: inset 0 0 0 1px var(--chat-hair); cursor: pointer;
}
.ds-composer__tool[aria-expanded="true"] { background: var(--chat-hover); }
@media (hover: hover) { .ds-composer__tool:hover { background: var(--chat-hover); } }
.ds-composer__tool-chevron { opacity: 0.6; }
.ds-composer__tool-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ds-composer .ds-voice { width: 34px; height: 34px; }
.ds-composer .ds-send { width: 36px; height: 36px; background: var(--send-bg); color: var(--send-fg); box-shadow: var(--send-shadow); }
.ds-composer .ds-send[data-state="disabled"] { opacity: 0.45; box-shadow: none; }
@media (hover: hover) { .ds-composer .ds-send[data-state="ready"]:hover, .ds-composer .ds-send[data-state="stop"]:hover { background: var(--send-bg); filter: brightness(1.08); } }   /* the stop disc too: never the kit's accent hover */
@media (pointer: coarse), (max-width: 767px) {
  .ds-composer .ds-send, .ds-composer .ds-voice { width: var(--touch-min); height: var(--touch-min); }
  .ds-composer .ds-composer__box textarea { min-height: var(--touch-min); }   /* the question field is a 44 px target, not the 40 px of its two lines */
  .ds-composer__tool::before { content: ""; position: absolute; inset: -6px 0; }   /* the 32 px pill keeps its look; its hit area is 44 high */
}
.ds-chat__disclaimer { margin: var(--space-2) 0 0; font-size: var(--text-micro); line-height: 1.45; text-align: center; color: var(--color-text-subtle); }

/* the actions under an answer: quiet 30 px icon buttons, the export at the end of the row */
.ds-feedback { gap: 2px; color: var(--color-text-subtle); }
.ds-feedback .ds-icon-btn { border-radius: var(--radius-md); color: inherit; }
@media (pointer: fine) {
  .ds-feedback .ds-icon-btn { position: relative; width: 30px; height: 30px; }
  .ds-feedback .ds-icon-btn::before { content: ""; position: absolute; inset: -1px; }   /* the 30 px look keeps a 32 x 32 hit area (DESIGN.md 14); with the 2 px gap the targets touch and never overlap */
}
.ds-feedback .ds-icon-btn svg { width: 16px; height: 16px; }
@media (hover: hover) { .ds-feedback .ds-icon-btn:hover { background: var(--chat-hover); color: var(--color-text); } }
@media (hover: hover) { .ds-chat .ds-icon-btn:hover { background: var(--chat-hover); color: var(--color-text); } }   /* every icon button inside the chat card, the header's included (DESIGN.md icon-button) */
.ds-feedback .ds-export-menu { margin-inline-start: auto; }

/* the live badge of the data line */
.ds-live-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--radius-pill); background: var(--live-bg); color: var(--live-text); font-weight: var(--weight-medium); white-space: nowrap; }
:root[data-theme="light"] .ds-source-badges :is(.ds-live-pill, .ds-status--positive) { background: color-mix(in srgb, var(--brand-green) 12%, var(--color-surface-1)); }   /* AIS-V817 / AIS-V818: opaque in the light drawer, for the live pill and the positive badges beside it; the translucent tint over the drawer glass left the ink at 3.5-4.4:1, on white it is 5.56:1 at every width (DESIGN.md 15.1) */
.ds-live-pill__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--live-dot); box-shadow: 0 0 8px var(--live-dot); }
/* a narrow chat stacks the tool cards as rows (icon left of the text), so the greeting, the tools and the suggestions fit above the composer. AIS-524: the
   container is the empty state, not the chat (containment would make the chat the containing block of its fixed menus); 492 px of it is the 520 px chat less
   its padding */
.ds-chat__empty { container: ds-chat / inline-size; }
@container ds-chat (max-width: 492px) {
  .ds-toolrow--cards { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .ds-toolrow--cards .ds-tool { flex-direction: row; align-items: center; gap: var(--space-3); padding: 10px var(--space-3); }
  .ds-chat__empty > * { margin-block: -2px; }   /* the 22 px gap of the empty chat as 18 px */
}

/* redesign 2026-11: the bce. mark on the cards follows the theme (white letters on dark, dark letters on light); the login card shows it larger */
.ds-brand.ds-brand--themed { display: inline-flex; width: auto; height: auto; }
.ds-brand--themed img { width: auto; height: 30px; }
.ds-brand-logo--login .ds-brand.ds-brand--themed { width: auto; height: auto; }
.ds-brand-logo--login .ds-brand--themed img { height: 48px; }
/* AIS-520: the bce. mark on the login card - its dot is masked off (both logo files are 260 x 96 with the dot at x 225-259, y 61-95, as in AIS-517) and a
   separate brand dot sits on its place; a tenant's own text mark is not touched */
.ds-brand-logo--login .ds-brand--themed { position: relative; }
.ds-brand-logo--login .ds-brand--themed img { clip-path: inset(0 13.5% 0 0); }
.ds-brand__ldot {
  position: absolute; left: 93.1%; top: 81.2%; width: 13.5%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; pointer-events: none;
  background: var(--brand-dot); transition: box-shadow 0.4s;
}
.ds-brand__ldot.mm-glow { box-shadow: var(--brand-dot-glow); }
.ds-brand-logo--login .ds-brand-logo__powered { margin-top: var(--space-2); font-weight: var(--weight-regular); }
.ds-brand__on-light { display: none; }
:root[data-theme="light"] .ds-brand__on-dark { display: none; }
:root[data-theme="light"] .ds-brand__on-light { display: block; }

/* the tenant's logo is shown as uploaded, never recoloured; it is made for a dark ground, so on a light surface of the light theme it sits on a small dark plate
   (the top bar's band and the report frame are dark already) */
:root[data-theme="light"] .ds-tenant-logo:not(.ds-topbar .ds-tenant-logo, .ds-embed__frame .ds-tenant-logo) {
  box-sizing: content-box; padding: 6px 10px; border-radius: 10px; background: var(--color-report-frame);
}

/* AIS-A528 K4: the tools once, as chips above the question (prototype "Čet") */
.ds-composer__tools { display: flex; flex-wrap: nowrap; gap: 6px; margin: calc(-1 * var(--space-1)) 0 var(--space-1); padding-block: var(--space-1); overflow-x: auto; scrollbar-width: none; }   /* the row scrolls and so clips: its 4 px block padding holds the chips' hit areas (the margin gives it back, the chips do not move) */
.ds-composer__tools::-webkit-scrollbar { display: none; }
.ds-toolrow--chips .ds-tool { position: relative; flex: none; min-height: 30px; gap: 6px; padding: 0 10px 0 7px; border-radius: var(--radius-pill); background: var(--chat-hover); box-shadow: inset 0 0 0 1px var(--chat-hair); color: var(--color-text-body); font-size: var(--text-xs); }
.ds-toolrow--chips .ds-tool::before { content: ""; position: absolute; inset: min(0px, calc(50% - var(--target-min) / 2)) 0; }   /* 30 (36 under touch) high with a 32 / 44 px hit area (DESIGN.md 5.4, 14 rule 2) */
.ds-toolrow--chips .ds-tool:focus-visible { outline-offset: -2px; }   /* the ring inside the chip: the scrolling row never clips it (DESIGN.md 15.2 rule 3) */
.ds-toolrow--chips .ds-tool__icon { width: 16px; height: 16px; }
.ds-toolrow--chips .ds-tool[aria-checked="true"] { background: color-mix(in srgb, var(--color-accent) 16%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-accent) 60%, transparent); color: var(--color-text); }
@media (hover: hover) { .ds-toolrow--chips button.ds-tool:hover { background: var(--color-surface-hover-2); } }
@media (pointer: coarse), (max-width: 767px) { .ds-toolrow--chips .ds-tool { min-height: 36px; } }
/* AIS-A528 K6: the voice answers and "Razgovor" as icons in the composer's row */
.ds-composer__voice { display: inline-flex; align-items: center; gap: 2px; }
.ds-composer__voice .ds-voice-controls { display: inline-flex; align-items: center; gap: 2px; }
.ds-voice-toggle--icon { min-height: var(--target-min); min-width: var(--target-min); padding: 0 6px; border: 0; justify-content: center; }
.ds-voice-toggle--icon .ds-voice-toggle__label { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ds-voice-toggle--icon[aria-checked="true"] { background: color-mix(in srgb, var(--color-accent) 22%, transparent); color: var(--color-text); }
@media (max-width: 399px) { .ds-composer__voice .ds-voice-toggle--icon { display: inline-flex; } }
/* AIS-A528 K5: the answer's details as a side panel inside the chat */
.ds-chat__side { position: absolute; top: 0; right: 0; bottom: 0; z-index: 6; display: flex; flex-direction: column; gap: var(--space-3); width: min(380px, 92%); padding: var(--space-4); overflow-y: auto; background: var(--color-surface-3); box-shadow: -1px 0 0 var(--chat-hair), var(--chat-side-shadow); animation: ds-side-in var(--dur-slow) var(--ease); }
.ds-chat__side-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.ds-chat__side-title { margin: 0; font-size: var(--text-md); font-weight: var(--weight-bold); }
.ds-details--panel { border: 0; background: none; padding: 0; }
.ds-details--panel .ds-details__body { padding: 0; }
@keyframes ds-side-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ds-chat__side { animation: none; } }
/* AIS-A528 K9: the conclusion first and highlighted, the text at most ~75ch, the table sorted by its measure with bars in the full chat */
.ds-answer--rich > p, .ds-answer--rich > .ds-answer__lines { max-width: 75ch; }
.ds-chat-lead { padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: color-mix(in srgb, var(--brand-green) 10%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-green) 35%, transparent); color: var(--color-text); }
.ds-chat-table__sorted { margin: var(--space-2) 0 0; font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-answer-bar { display: block; width: 100%; min-width: 60px; height: 8px; border-radius: var(--radius-pill); background: var(--chat-hover); overflow: hidden; }
.ds-answer-bar__fill { display: block; height: 100%; border-radius: inherit; background: var(--color-accent); }
.ds-answer-bar__fill.is-negative { background: var(--color-negative); }
/* AIS-A537: an answer table is as wide as its content (at most the chat; 980 px in the whole workspace, K8) and scrolls inside itself, never the page. The text column takes
   what its longest name needs up to ~40ch, the numbers ~14ch on the right. The first column is not sticky in the chat: its solid cell background drew a dark band on the
   chat's glass. Each header has a handle on its right edge (ui.js attachTableResizer: drag, double-click fits, arrows ±16 px, at least 64 px). */
.ds-chat-table__scroll .ds-table-wrap { overflow-x: auto; overscroll-behavior-x: contain; }
.ds-chat-table__scroll .ds-table { width: auto; max-width: none; }
.ds-chat-table__scroll .ds-table :is(th, td):not(.is-num) { max-width: 40ch; }
.ds-chat-table__scroll .ds-table td:not(.is-num) { overflow-wrap: anywhere; }
.ds-chat-table__scroll .ds-table :is(th, td).is-num { min-width: 14ch; }
.ds-chat-table__scroll .ds-table--sticky-first :is(th, td):first-child { position: static; }
.ds-chat-table__scroll .ds-table--sticky-first td:first-child { background: transparent; }
@media (hover: hover) { .ds-chat-table__scroll .ds-table--sticky-first tbody tr:hover td:first-child { background: transparent; } }
.ds-chat-table__scroll .ds-table[data-resized] { table-layout: fixed; }
.ds-chat-table__scroll .ds-table[data-resized] :is(th, td) { max-width: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ds-chat-table__scroll .ds-table[data-resized] td.is-num { overflow: visible; }   /* a number is never cut: its column cannot get narrower than the number (ui.js) */
.ds-chat-table__scroll th { position: relative; }
.ds-table__resize { position: absolute; top: 0; right: 0; bottom: 0; z-index: 2; width: 8px; cursor: col-resize; touch-action: none; border-radius: var(--radius-xs); }
.ds-table__resize::before { content: ""; position: absolute; top: 20%; bottom: 20%; right: 0; width: 2px; border-radius: 1px; background: transparent; transition: background-color var(--dur-fast) var(--ease); }
.ds-table__resize:focus-visible::before, .ds-table__resize.is-dragging::before { background: var(--chat-grip, var(--color-border-strong)); }
@media (hover: hover) { .ds-chat-table__scroll th:hover .ds-table__resize::before, .ds-table__resize:hover::before { background: var(--chat-grip, var(--color-border-strong)); } }
.ds-table__resize:focus-visible { outline-offset: -2px; }
/* AIS-A528 B8: the conversation history as a drawer from the chat's start edge */
.ds-chat__side--start { right: auto; left: 0; width: min(340px, 92%); box-shadow: 1px 0 0 var(--chat-hair), var(--chat-side-shadow-start); animation-name: ds-side-in-start; }
@keyframes ds-side-in-start { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
.ds-chat__side--start .ds-convlist { min-height: 0; }
.ds-chat__side--start .ds-convlist { flex: 1; padding: 0; background: none; }   /* AIS-A533: inside the drawer the list is the drawer's content, not a card */
.ds-chat__scrim { position: absolute; inset: 0; z-index: 5; border-radius: inherit; background: color-mix(in srgb, var(--color-bg) 35%, transparent); }   /* under the drawer (z 6): a click on it closes the drawer */
/* AIS-A529: the round „+“ in the brand green (a flat dot with a dark plus), the ✓ of a task made, the quiet icons of a proposal, the struck-through dismissed line */
.ds-task-plus { position: relative; display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: var(--brand-green); color: var(--brand-dot-hi-fg); cursor: pointer; }
.ds-task-plus:not(.is-done)::before { content: ""; position: absolute; inset: min(0px, calc(50% - var(--target-min) / 2)); }   /* the 28 px disc keeps its look and is a 32 / 44 px target (DESIGN.md 5.4, 14 rule 2); the done check does nothing, so it has no area to swallow a neighbour's tap */
@media (hover: hover) { .ds-task-plus:hover:not([aria-disabled="true"]) { filter: brightness(1.08); } }
.ds-task-plus:focus-visible { outline: 2px solid var(--color-focus-ring); outline-offset: 2px; }
.ds-task-plus.is-done { background: color-mix(in srgb, var(--brand-green) 22%, transparent); color: var(--color-primary-text); cursor: default; }
.ds-feedback__plus { margin-inline-start: auto; display: inline-flex; }
.ds-action__icons { display: inline-flex; align-items: center; gap: var(--space-1); flex: none; }
@media (pointer: coarse), (max-width: 767px) { .ds-action__icons { gap: var(--space-2); } }   /* the task "+" (28 px, hit area 44: 8 px each side) beside the 44 px dismiss button: the areas touch and never overlap (DESIGN.md 14) */
.ds-action__icons--quiet { opacity: 0.5; transition: opacity var(--dur-fast, 0.15s); }
:is(.ds-action, .ds-opportunity):focus-within .ds-action__icons--quiet { opacity: 1; }
@media (hover: hover) { :is(.ds-action, .ds-opportunity):hover .ds-action__icons--quiet { opacity: 1; } }
.ds-action__dismiss { color: var(--color-text-subtle); }
.ds-action__title { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.ds-task-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--brand-green) 16%, transparent); color: var(--color-primary-text); font-size: var(--text-xs); font-weight: var(--weight-semibold); text-decoration: none; }
.ds-action--dismissed { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-1) var(--space-4); background: none; }
.ds-action__struck { color: var(--color-text-subtle); }
.ds-link-btn { padding: 0; border: 0; background: none; color: var(--color-accent); font: inherit; font-size: var(--text-sm); cursor: pointer; }
@media (hover: hover) { .ds-link-btn:hover { text-decoration: underline; } }
.ds-opportunity__head { display: flex; align-items: center; gap: var(--space-2); }
.ds-opportunity__head .ds-opportunity__title { flex: 1; min-width: 0; margin: 0; }
/* AIS-A529 P1/B5: the task dialog from an answer or a proposal */
.ds-ai-tag { display: inline-block; margin-inline-start: var(--space-2); padding: 1px 8px; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--brand-green) 14%, transparent); color: var(--color-primary-text); font-size: var(--text-micro); font-style: normal; font-weight: var(--weight-semibold); }
.ds-field > .ds-ai-tag { align-self: flex-start; margin-inline-start: 0; }   /* AIS-V934 (ST-9, DESIGN.md 8.7): a field is a flex column, so a direct child stretches; the tag stays a small pill under the caption */
.ds-ai-field { display: grid; gap: 2px; }
.ds-ai-field__label { margin: 0; font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-ai-field__value { margin: 0; color: var(--color-text); }
.ds-task-dialog__ai { display: flex; align-items: center; gap: var(--space-2); margin: 0; font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-bdot--sm { width: 9px; height: 9px; }
.ds-chiprow { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-2); }
.ds-people { display: grid; gap: var(--space-2); }
.ds-people__list { display: grid; gap: 2px; max-height: 200px; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.ds-people__row { display: flex; align-items: center; gap: var(--space-2); min-height: 36px; padding: 0 var(--space-2); border-radius: var(--radius-md); cursor: pointer; }
.ds-people__row[data-active="true"] { background: var(--color-surface-hover-2); }
@media (hover: hover) { .ds-people__row:hover { background: var(--color-surface-hover-2); } }
.ds-people__row[aria-selected="true"] { background: color-mix(in srgb, var(--color-accent) 16%, transparent); }
.ds-people__name { flex: 1; min-width: 0; }
.ds-people__empty { padding: var(--space-2); color: var(--color-text-muted); font-size: var(--text-sm); }
.ds-initials--tinted { background: var(--initials-bg, var(--color-surface-3)); color: var(--color-on-accent); }
/* AIS-A529 B13: the task overview */
.ds-tov { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }   /* AIS-V926: the track never takes the inner card's min-content (the 860 px table), so the table scrolls inside its wrap at 390 */
.ds-tov__bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); }
.ds-tov__counters { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.ds-tov__counter { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 40px; padding: 0 var(--space-3); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-md); background: var(--color-surface-2); color: var(--color-text-body); font: inherit; cursor: pointer; }
.ds-tov__counter[aria-pressed="true"] { border-color: var(--color-accent); color: var(--color-text); }
.ds-tov__sdot { width: 8px; height: 8px; border-radius: 50%; background: var(--tov-status, var(--color-text-subtle)); }
.ds-tov [data-status="proposed"] { --tov-status: var(--color-info); }
.ds-tov [data-status="open"] { --tov-status: var(--color-text-subtle); }
.ds-tov [data-status="inProgress"] { --tov-status: var(--color-warning); }
.ds-tov [data-status="late"] { --tov-status: var(--color-negative); }
.ds-tov [data-status="done"] { --tov-status: var(--color-positive); }
.ds-tov [data-status="rejected"] { --tov-status: var(--color-text-disabled); }
.ds-tov__table .ds-table { min-width: 860px; }   /* seven columns: the kit table scrolls inside itself (first column sticky), it never stacks (DESIGN.md 9.3, more than five columns) */
.ds-tov__group + .ds-tov__group { margin-top: var(--space-4); }
.ds-tov__group-title { margin: 0 0 var(--space-2); font-size: var(--text-sm); font-weight: var(--weight-bold); color: var(--color-text); }
@media (max-width: 639px) { .ds-tov__table .ds-table__rowbutton { max-width: 11rem; } }   /* the sticky title column leaves room for the others to scroll into view */
.ds-tov__swatch { display: inline-block; width: 10px; height: 10px; margin-inline-end: var(--space-2); border-radius: var(--radius-xs); background: var(--tov-tint); }
.ds-tov__n { margin-inline-start: var(--space-1); color: var(--color-text-muted); font-weight: var(--weight-regular); }
.ds-tov__title { display: block; color: var(--color-text); }
.ds-tov__sub { display: block; font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-tov__team { display: inline-flex; align-items: center; min-height: 20px; padding: 0 var(--space-2); border-radius: var(--radius-pill); background: color-mix(in srgb, var(--tov-tint) 18%, transparent); color: var(--color-text); font-size: var(--text-xs); white-space: nowrap; }
.ds-tov__who { display: inline-flex; align-items: center; gap: var(--space-2); white-space: nowrap; }
.ds-tov__late { color: var(--color-negative); font-weight: var(--weight-semibold); }
:root[data-theme="light"] .ds-table tr.is-selected .ds-tov__late { color: var(--color-text); }   /* light negative on surface-3 is 4.30:1 (DESIGN.md 3.5); the Kasni badge and the semibold figure still tell it */
.ds-tov__status { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 20px; padding: 0 var(--space-2); border-radius: var(--radius-pill); background: color-mix(in srgb, var(--tov-status) 16%, transparent); color: var(--color-text); font-size: var(--text-xs); white-space: nowrap; }
.ds-tov__origin { margin: 0; font-size: var(--text-xs); color: var(--color-text-muted); white-space: nowrap; }
.ds-tov__panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: var(--z-drawer); display: flex; flex-direction: column; gap: var(--space-3); width: min(400px, 100vw); padding: var(--space-5); overflow-y: auto; background: var(--color-surface-3); box-shadow: var(--chat-side-shadow); animation: ds-side-in var(--dur-slow) var(--ease); }
.ds-tov__chain, .ds-tov__history { display: grid; gap: var(--space-1); margin: 0; padding-inline-start: var(--space-5); font-size: var(--text-sm); }
@media (prefers-reduced-motion: reduce) { .ds-tov__panel { animation: none; } }
/* AIS-A530 K13: the teams as cards - a band in the team colour, coloured rings around the avatars, the colour dots */
.ds-team-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: var(--space-4); align-items: start; }
.ds-team-cards__note { grid-column: 1 / -1; margin: 0; font-size: var(--text-xs); }
.ds-team-card { overflow: hidden; border-radius: var(--radius-card); background: var(--color-surface-2); box-shadow: inset 0 4px 0 var(--team-color); }
.ds-team-card__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); padding: var(--space-5) var(--space-4) var(--space-3); border-bottom: 1px solid var(--color-border-subtle); }
.ds-team-card__badge { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--team-color); color: var(--color-on-accent); font-weight: var(--weight-bold); }
.ds-team-card__titles { flex: 1 1 8rem; min-width: 0; }
.ds-team-card__name { margin: 0; font-size: var(--text-md); font-weight: var(--weight-bold); }
.ds-team-card__manager { margin: 0; font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-team-card__dots { display: flex; flex-wrap: wrap; margin-inline-start: auto; }   /* no gap: the 32 / 44 px buttons touch and never overlap; the row drops under the name where it does not fit */
.ds-team-card__dot { display: grid; place-items: center; width: var(--target-min); height: var(--target-min); padding: 0; border: 0; background: none; cursor: pointer; }   /* a 32 px button (44 under touch) that draws the 16 px dot */
.ds-team-card__dot::after { content: ""; width: 16px; height: 16px; border-radius: 50%; background: var(--dot); }
.ds-team-card__dot[aria-checked="true"]::after { box-shadow: 0 0 0 2px var(--color-surface-2), 0 0 0 3px var(--color-text); }
.ds-team-card__members { display: grid; margin: 0; padding: 0; list-style: none; }
.ds-team-card__member { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-border-subtle); }
.ds-team-card__avatar { position: relative; display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: color-mix(in srgb, var(--team-color) 25%, var(--color-surface-3)); box-shadow: 0 0 0 2px var(--team-color); color: var(--color-text); font-size: var(--text-xs); font-weight: var(--weight-bold); cursor: pointer; }
.ds-team-card__photo { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 50%; background: var(--color-scrim); color: var(--color-text); font-size: var(--text-xs); opacity: 0; transition: opacity var(--dur-fast, 0.15s); }
:root[data-theme="light"] .ds-team-card__photo { background: color-mix(in srgb, var(--color-surface-1) 88%, transparent); }   /* AIS-V934 (ST-24): in the light theme the label is dark text, so the veil is light, not the dark scrim (4.04-4.25:1 over the avatar tints): 88 % of surface-1, 17.5:1 or more over the tint of every chart slot; dark keeps the scrim (17.6:1 or more) */
.ds-team-card__avatar:focus-visible .ds-team-card__photo { opacity: 1; }
@media (hover: hover) { .ds-team-card__avatar:hover .ds-team-card__photo { opacity: 1; } }
.ds-team-card__who { display: grid; flex: 1; min-width: 0; font-size: var(--text-xs); }
.ds-team-card__member-name { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-text); }
.ds-team-card__counts { display: grid; justify-items: end; font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-team-card__counts strong { font-size: var(--text-md); color: var(--color-text); }
.ds-team-card__add { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); color: var(--color-text-muted); text-decoration: none; font-size: var(--text-sm); }
@media (hover: hover) { .ds-team-card__add:hover { color: var(--color-text); } }
@media (prefers-reduced-motion: reduce) { .ds-team-card__photo { transition: none; } }
/* AIS-A531: the feature icons - a Lucide icon in its colour on a soft tile of the same colour (border-radius 28 %, the colour at 16 % / 12 %) */
.ds-feature-icon { display: inline-grid; place-items: center; flex: none; width: var(--fi-tile, auto); height: var(--fi-tile, auto); border-radius: 28%; color: var(--fi-color, var(--icon-gray)); background: color-mix(in srgb, var(--fi-color, var(--icon-gray)) var(--icon-tile-mix), transparent); }
.ds-feature-icon--bare { width: auto; height: auto; border-radius: 0; background: none; }
.ds-feature-icon__svg { display: block; flex: none; }
.ds-feature-icon--blue { --fi-color: var(--icon-blue); }
.ds-feature-icon--violet { --fi-color: var(--icon-violet); }
.ds-feature-icon--green { --fi-color: var(--icon-green); }
.ds-feature-icon--amber { --fi-color: var(--icon-amber); }
.ds-feature-icon--teal { --fi-color: var(--icon-teal); }
.ds-feature-icon--pink { --fi-color: var(--icon-pink); }
.ds-feature-icon--red { --fi-color: var(--icon-red); }
.ds-feature-icon--gray { --fi-color: var(--icon-gray); }

/* Dashboards (N-20; spec 70 §8.4): the dashboard lab's styles (lab/dashboard/wwwroot/css/dashboard.css). They use only the tokens and reuse the kit (ds-btn,
   ds-dialog, ds-field, ds-segmented, ds-table, ...); every class starts with ds-dash-. GridStack's own sheet is /lib/gridstack/gridstack.min.css, linked by the page. */
.ds-dash-i { display: inline-block; width: 16px; height: 16px; flex: none; background: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
@media (forced-colors: active) { .ds-dash-i { background: CanvasText; } }
@media (forced-colors: active) { .ds-dash-tile, .ds-dash-panelbox, .ds-dash-gitem { border: 1px solid CanvasText; } }

/* --- page: the toolbar, the caption, the canvas and the gallery beside it, in the content panel; the page scrolls, the open gallery stays in view ------ */
.ds-dash-app { display: flex; flex-direction: column; min-width: 0; }
.ds-dash-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); min-width: 0; }
.ds-dash-bar__title { min-width: 0; max-width: 300px; margin: 0; }
.ds-dash-bar__name { width: 300px; max-width: 100%; padding: 0; border: 0; border-bottom: 1px solid transparent; background: transparent; color: var(--color-text); font: inherit; font-size: var(--text-lg); font-weight: var(--weight-semibold); line-height: 1.5; }
@media (hover: hover) { .ds-dash-bar__name:hover { border-bottom-color: var(--color-border-strong); } }
.ds-dash-bar__name:focus-visible { outline: none; border-bottom-color: var(--color-accent); }
.ds-dash-app[data-mode="edit"] .ds-dash-bar__title, .ds-dash-app[data-mode="view"] .ds-dash-bar__name { display: none; }
.ds-dash-bar__mode .ds-segmented__item { min-width: 96px; }
.ds-dash-bar__tools { display: flex; align-items: center; gap: var(--space-1); }
.ds-dash-bar__narrow { display: none; font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-dash-bar__push { flex: 1; }
.ds-dash-bar__gallery[aria-pressed="true"] { background: var(--tool-on-bg); box-shadow: var(--tool-on-shadow); }
.ds-dash-bar button[disabled] { opacity: 0.4; cursor: not-allowed; }
.ds-dash-flip .ds-dash-i { transform: scaleX(-1); }
.ds-dash-app[data-mode="view"] :is(.ds-dash-bar__tools, .ds-dash-menu__edit) { display: none; }
.ds-dash-menuwrap { position: relative; }
.ds-dash-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: var(--z-drawer); min-width: 290px; }
.ds-dash-menu button { display: flex; align-items: center; gap: var(--space-2); width: 100%; min-height: var(--target-min); padding: 0 var(--space-3); border: 0; border-radius: var(--radius-xs); background: transparent; color: var(--color-text); text-align: start; }
@media (hover: hover) { .ds-dash-menu button:hover { background: var(--color-surface-hover-2); } }
.ds-dash-menu [data-act="delete"] .ds-dash-i { color: var(--color-negative); }   /* the destructive glyph carries the danger, the text stays text (RD-19) */
.ds-dash-caption { margin: var(--space-1) 0 var(--space-2); font-size: var(--text-xs); line-height: var(--lh-tight); color: var(--color-text-muted); }
@media (max-width: 1099px) {
  .ds-dash-app[data-mode] .ds-dash-bar__title { display: block; }
  .ds-dash-app[data-mode] :is(.ds-dash-bar__name, .ds-dash-bar__mode, .ds-dash-bar__tools, .ds-dash-menu__edit) { display: none; }
  .ds-dash-bar__narrow { display: inline; }
}
@media (max-width: 767px) { .ds-dash-bar__narrow { display: none; } }

.ds-dash-stage { display: flex; align-items: flex-start; gap: var(--space-3); min-width: 0; }
.ds-dash-canvas { position: relative; flex: 1; min-width: 0; margin-inline: -8px; }
.ds-dash-empty { position: absolute; inset: 120px 0 auto; display: grid; justify-items: center; gap: var(--space-2); color: var(--color-text-muted); text-align: center; pointer-events: none; }
.ds-dash-empty[hidden] { display: none; }
.ds-dash-empty__title { font-size: var(--text-login); font-weight: var(--weight-semibold); color: var(--color-text); }

/* --- the grid --------------------------------------------------------------------------------------------------- */
.ds-dash-grid.is-editing { background-image: radial-gradient(circle at center, var(--color-border-strong) 1.2px, transparent 1.8px); background-size: var(--gs-column-width) var(--gs-cell-height); background-position: calc(var(--gs-column-width) / -2) calc(var(--gs-cell-height) / -2); border-radius: var(--radius-inner); }
.ds-dash-grid .grid-stack-item-content { overflow: hidden; border-radius: var(--radius-inner); }
.ds-dash-grid .grid-stack-placeholder > .placeholder-content { background: var(--tint-info); border: 1px dashed var(--color-accent); border-radius: var(--radius-inner); }
.ds-dash-grid .grid-stack-item.ui-draggable-dragging > .grid-stack-item-content, .ds-dash-grid .grid-stack-item.ui-resizable-resizing > .grid-stack-item-content { box-shadow: var(--shadow-overlay); }
.ds-dash-grid .grid-stack-item.ui-draggable-dragging { opacity: 0.94; }
.ds-dash-grid.is-editing .ds-dash-tile { cursor: grab; }
.ds-dash-grid.is-editing .ui-draggable-dragging .ds-dash-tile { cursor: grabbing; }

/* resize handles: a corner grip and quiet edges, only on the hovered card (spec 64 6.2) */
.grid-stack > .grid-stack-item > .ui-resizable-handle { background: none !important; transform: none !important; opacity: 0; transition: opacity var(--dur-fast) var(--ease); z-index: 12; }
.grid-stack > .grid-stack-item.ui-resizable-resizing > .ui-resizable-handle { opacity: 1; }
@media (hover: hover) { .grid-stack > .grid-stack-item:hover > .ui-resizable-handle { opacity: 1; } }
.grid-stack > .grid-stack-item > .ui-resizable-se { right: 8px; bottom: 8px; width: 20px; height: 20px; cursor: nwse-resize; }
.grid-stack > .grid-stack-item > .ui-resizable-sw { left: 8px; bottom: 8px; width: 20px; height: 20px; cursor: nesw-resize; }
.grid-stack > .grid-stack-item > .ui-resizable-se::after, .grid-stack > .grid-stack-item > .ui-resizable-sw::after { content: ""; position: absolute; bottom: 5px; width: 9px; height: 9px; border-bottom: 2px solid var(--color-accent); }
.grid-stack > .grid-stack-item > .ui-resizable-se::after { right: 5px; border-right: 2px solid var(--color-accent); border-bottom-right-radius: 3px; }
.grid-stack > .grid-stack-item > .ui-resizable-sw::after { left: 5px; border-left: 2px solid var(--color-accent); border-bottom-left-radius: 3px; }
.grid-stack > .grid-stack-item > .ui-resizable-e, .grid-stack > .grid-stack-item > .ui-resizable-w { top: 30%; bottom: 30%; height: auto; width: 10px; cursor: ew-resize; }
.grid-stack > .grid-stack-item > .ui-resizable-e { right: 3px; }
.grid-stack > .grid-stack-item > .ui-resizable-w { left: 3px; }
.grid-stack > .grid-stack-item > .ui-resizable-s { left: 30%; right: 30%; bottom: 3px; width: auto; height: 10px; cursor: ns-resize; }
.grid-stack > .grid-stack-item > :is(.ui-resizable-e, .ui-resizable-w, .ui-resizable-s)::after { content: ""; position: absolute; inset: 4px; border-radius: var(--radius-pill); background: var(--color-accent); opacity: 0.7; }
@media (pointer: coarse) { .grid-stack > .grid-stack-item > .ui-resizable-handle { opacity: 1; } }

/* --- a card ----------------------------------------------------------------------------------------------------- */
.ds-dash-tile { position: relative; display: flex; flex-direction: column; height: 100%; min-width: 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius-inner); background: var(--color-surface-1); outline-offset: -2px; }
.ds-dash-tile--glass { background: var(--card-bg); box-shadow: var(--card-shadow); }
.ds-dash-tile--plain { background: transparent; padding: var(--space-2); }
.ds-dash-tile--bare { background: transparent; padding: 0; }
.ds-dash-tile__head { flex: none; min-width: 0; margin-bottom: var(--space-1); }
.ds-dash-tile__head .ds-card-title { font-size: var(--text-xs); }
.ds-dash-tile__sub { margin: 0; font-size: var(--text-xs); line-height: var(--lh-tight); color: var(--color-text-muted); }
.ds-dash-tile__body { position: relative; flex: 1; min-height: 0; min-width: 0; overflow: hidden; container-type: size; }
.ds-dash-tile__foot { flex: none; display: flex; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-1); font-size: var(--text-xs); line-height: var(--lh-tight); color: var(--color-text-subtle); }
.ds-dash-tile__source { margin-inline-start: auto; }
.ds-dash-tile__tools, .ds-dash-panel > .ds-dash-tile__tools { position: absolute; top: 6px; right: 6px; z-index: 11; display: none; gap: 2px; padding: 2px; border-radius: var(--radius-md); background: var(--color-surface-3); box-shadow: var(--shadow-overlay); }
.ds-dash-grid.is-editing .ds-dash-tile:focus-within > .ds-dash-tile__tools, .ds-dash-grid.is-editing .ds-dash-panel:focus-within > .ds-dash-tile__tools { display: flex; }
@media (hover: hover) {
  .ds-dash-grid.is-editing .grid-stack-item:hover > .grid-stack-item-content > .ds-dash-tile > .ds-dash-tile__tools,
  .ds-dash-grid.is-editing .grid-stack-item:hover > .ds-dash-panelbox > .ds-dash-panel > .ds-dash-tile__tools { display: flex; }
  .ds-dash-grid.is-editing .grid-stack-item:has(.grid-stack-item:hover) > .ds-dash-panelbox > .ds-dash-panel > .ds-dash-tile__tools { display: none; }
}
.ds-dash-tool { position: relative; display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: var(--radius-xs); background: transparent; color: var(--color-text-muted); }
.ds-dash-tool::after { content: ""; position: absolute; inset: -3px; }   /* the 32 px hit area of the 26 px box (DESIGN.md dashboard-widget tools) */
@media (pointer: coarse) { .ds-dash-tool::after { inset: -9px; } }   /* 44 px under a coarse pointer */
@media (hover: hover) { .ds-dash-tool:hover { background: var(--color-surface-hover-2); color: var(--color-text); } }
.ds-dash-tool .ds-dash-i { width: 14px; height: 14px; }
.ds-dash-problem { display: grid; place-items: center; height: 100%; padding: var(--space-3); color: var(--color-text-subtle); font-size: var(--text-xs); text-align: center; }
.ds-dash-skeleton { height: 100%; padding: var(--space-2); }
.ds-dash-skeleton .ds-skeleton { display: block; height: 100%; }
.ds-dash-tile__note { flex: none; margin: var(--space-1) 0 0; font-size: var(--text-xs); line-height: var(--lh-tight); color: var(--color-text-subtle); }

/* --- panels ----------------------------------------------------------------------------------------------------- */
.ds-dash-grid .ds-dash-panelbox, .ds-dash-editor__frame.ds-dash-panelbox { display: flex; flex-direction: column; border-radius: var(--radius-card); background: var(--card-bg); box-shadow: var(--card-shadow); overflow: hidden auto; }
.ds-dash-grid .ds-dash-panelbox[data-surface="solid"] { background: var(--color-surface-2); box-shadow: none; }
.ds-dash-grid .ds-dash-panelbox[data-surface="plain"] { background: transparent; box-shadow: inset 0 0 0 1px var(--color-border-subtle); }
.ds-dash-panel { position: sticky; top: 0; z-index: 10; flex: none; padding: var(--space-3) var(--space-4) var(--space-1); }
.ds-dash-panel__head { min-height: 20px; min-width: 0; border-radius: var(--radius-xs); }
.ds-dash-grid.is-editing .ds-dash-panel__head { cursor: grab; }
.ds-dash-panel__head .ds-card-title { font-size: var(--text-sm); }
.ds-dash-panel__tabs { display: flex; gap: var(--space-5); margin-top: var(--space-2); box-shadow: inset 0 -1px 0 var(--color-border-subtle); }
.ds-dash-panel__tab { position: relative; min-height: var(--target-min); padding: 0; border: 0; background: transparent; color: var(--color-text-muted); font-size: var(--text-sm); }
.ds-dash-panel__tab[aria-selected="true"] { color: var(--color-text); font-weight: var(--weight-medium); }
.ds-dash-panel__tab[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--color-primary); }
.ds-dash-panel__hint { display: none; position: absolute; inset: 56px 16px 16px; align-items: center; justify-content: center; border: 1px dashed var(--color-border-strong); border-radius: var(--radius-inner); color: var(--color-text-subtle); font-size: var(--text-xs); pointer-events: none; }
.ds-dash-panelbox:not(:has(.grid-stack-item)) > .ds-dash-panel__hint { display: flex; }
.ds-dash-panelbox > .grid-stack { flex: 1 0 auto; margin: 0 8px 8px; }
.ds-dash-panelbox > .grid-stack .grid-stack-item-content { border-radius: var(--radius-inner); }

/* --- figures ---------------------------------------------------------------------------------------------------- */
.ds-dash-kpi { display: flex; flex-direction: column; height: 100%; min-height: 0; gap: 2px; }
.ds-dash-kpi__row { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-2); }
.ds-dash-kpi__value { font-size: var(--text-kpi); line-height: 1.27; font-weight: var(--weight-bold); color: var(--color-text); font-variant-numeric: tabular-nums; }
.ds-dash-delta { display: inline-flex; align-items: center; gap: 2px; font-size: var(--text-xs); font-weight: var(--weight-medium); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ds-dash-delta .ds-dash-i { width: 12px; height: 12px; }
.ds-dash-kpi__lines { display: grid; gap: 2px; }
.ds-dash-kpi__lines .ds-kpi__compare { flex-wrap: nowrap; white-space: nowrap; overflow: hidden; }
.ds-dash-kpi__lines .ds-kpi__compare-label { flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; min-width: 28px; }
.ds-dash-kpi__lines .ds-kpi__compare > :not(.ds-kpi__compare-label) { flex: none; }
@container (max-width: 300px) { .ds-dash-kpi__att { display: none; } }
/* the figure follows the card's width in the type steps (the lab's clamp(17px, 11cqw, 22px)) */
@container (max-width: 199px) { .ds-dash-kpi__value { font-size: var(--text-login); } }
@container (max-width: 159px) { .ds-dash-kpi__value { font-size: var(--text-lg); } }
.ds-dash-kpi__spark { position: relative; flex: 1; min-height: 14px; margin-top: var(--space-1); }
.ds-dash-spark { position: absolute; inset: 0; width: 100%; height: 100%; }
.ds-dash-spark__dot { position: absolute; width: 8px; height: 8px; margin: -4px -4px 0 0; border-radius: 50%; background: var(--color-accent); box-shadow: 0 0 0 2px var(--color-surface-1); }
@container (max-height: 104px) { .ds-dash-kpi__lines { display: none; } }
@container (max-height: 60px) { .ds-dash-kpi__spark { display: none; } }

.ds-dash-strip { display: flex; align-items: center; height: 100%; gap: var(--space-5); overflow: hidden; }
.ds-dash-strip__item { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding-inline-start: var(--space-5); border-inline-start: 1px solid var(--color-border-subtle); }
.ds-dash-strip__item:first-child { padding-inline-start: 0; border-inline-start: 0; }
.ds-dash-strip .ds-dash-kpi__value { font-size: var(--text-kpi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* the strip's figures shrink with the strip in the type steps (the lab's clamp(13px, 2.4cqw, 22px)) */
@container (max-width: 900px) { .ds-dash-strip .ds-dash-kpi__value { font-size: var(--text-login); } }
@container (max-width: 660px) { .ds-dash-strip .ds-dash-kpi__value { font-size: var(--text-lg); } }
@container (max-width: 540px) { .ds-dash-strip .ds-dash-kpi__value { font-size: var(--text-sm); } }
.ds-dash-gitem__html .ds-dash-strip__item:nth-child(n+4) { display: none; }

.ds-dash-progress { display: flex; flex-direction: column; justify-content: space-evenly; height: 100%; gap: var(--space-2); overflow-y: auto; }
.ds-dash-progress__top { display: flex; justify-content: space-between; gap: var(--space-2); font-size: var(--text-xs); color: var(--color-text-body); }
.ds-dash-progress__top b { font-variant-numeric: tabular-nums; font-weight: var(--weight-semibold); color: var(--color-text); }
.ds-dash-progress__track, .ds-dash-top__track { height: 6px; margin-top: 3px; border-radius: var(--radius-pill); background: var(--color-surface-3); overflow: hidden; }
.ds-dash-progress__track span, .ds-dash-top__track span { display: block; height: 100%; border-radius: var(--radius-pill); background: var(--color-chart-1); }
.ds-dash-progress__sub { margin-top: 2px; font-size: var(--text-xs); line-height: var(--lh-tight); color: var(--color-text-subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ds-dash-top { display: flex; flex-direction: column; justify-content: space-evenly; height: 100%; margin: 0; padding: 0; list-style: none; gap: var(--space-1); overflow-y: auto; }
.ds-dash-top li { display: flex; align-items: center; gap: var(--space-2); }
.ds-dash-top__rank { flex: none; width: 18px; color: var(--color-text-subtle); font-size: var(--text-xs); font-variant-numeric: tabular-nums; text-align: right; }
.ds-dash-top__main { flex: 1; min-width: 0; }
.ds-dash-top__line { display: flex; justify-content: space-between; gap: var(--space-2); font-size: var(--text-xs); color: var(--color-text-body); }
.ds-dash-top__line b { flex: none; font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; color: var(--color-text); }

/* --- tables ----------------------------------------------------------------------------------------------------- */
.ds-dash-tablewrap { height: 100%; overflow: auto; }
.ds-dash-tablewrap .ds-table { font-size: var(--text-xs); }
.ds-dash-tablewrap .ds-table th { background: var(--color-surface-2); white-space: nowrap; }
.ds-dash-tablewrap .ds-table td { height: 32px; white-space: nowrap; }
.ds-dash-tablewrap .ds-table th.is-num { text-align: right; }
.ds-dash-table--dense td { height: 26px !important; }
.ds-dash-pivot td { border-bottom: 1px solid var(--color-surface-1); }
.ds-dash-pivot__row { position: static; height: auto; padding: 0 var(--space-3); background: transparent !important; font-weight: var(--weight-regular); text-align: left; }
.ds-dash-table__bar { position: relative; }
.ds-dash-table__fill { position: absolute; inset: 6px auto 6px 0; border-radius: 0 var(--radius-xs) var(--radius-xs) 0; background: var(--color-chart-1); opacity: 0.32; }
.ds-dash-table__val { position: relative; }

/* --- text and filters ------------------------------------------------------------------------------------------- */
.ds-dash-heading { display: flex; align-items: center; height: 100%; font-weight: var(--weight-semibold); color: var(--color-text); }
.ds-dash-heading[style*="center"] { justify-content: center; }
.ds-dash-heading[style*="right"] { justify-content: flex-end; }
.ds-dash-heading--sm { font-size: var(--text-sm); }
.ds-dash-heading--md { font-size: var(--text-lg); }
.ds-dash-heading--lg { font-size: var(--text-xl); }
.ds-dash-heading--xl { font-size: var(--text-hero); }
.ds-dash-section { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: var(--space-2); box-shadow: inset 0 -1px 0 var(--color-border-subtle); }
.ds-dash-section__title { font-size: var(--text-lg); font-weight: var(--weight-semibold); color: var(--color-text); }
.ds-dash-section__sub { font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-dash-text { height: 100%; overflow-y: auto; font-size: var(--text-sm); line-height: var(--lh-body); color: var(--color-text-body); }
.ds-dash-text p + p, .ds-dash-text p + ul, .ds-dash-text ul + p { margin-top: var(--space-2); }
.ds-dash-text ul { margin: 0; padding-inline-start: var(--space-4); }
.ds-dash-text strong { color: var(--color-text); }
.ds-dash-insight { display: flex; flex-direction: column; gap: var(--space-2); height: 100%; }
.ds-dash-insight__kind { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--text-xs); font-weight: var(--weight-semibold); }
.ds-dash-insight--info .ds-dash-insight__kind { color: var(--color-info); }
.ds-dash-insight--positive .ds-dash-insight__kind { color: var(--color-positive-strong); }
.ds-dash-insight--warning .ds-dash-insight__kind { color: var(--color-warning); }
.ds-dash-insight--negative .ds-dash-insight__kind { color: var(--color-negative); }
.ds-dash-divider { display: flex; align-items: center; gap: var(--space-3); height: 100%; color: var(--color-text-muted); font-size: var(--text-xs); }
.ds-dash-divider::before, .ds-dash-divider::after { content: ""; flex: 1; height: 1px; background: var(--color-border-subtle); }
.ds-dash-slicer { display: flex; align-items: center; height: 100%; }
.ds-dash-slicer .ds-field { width: 100%; }
.ds-dash-grid.is-editing .ds-dash-slicer > * { pointer-events: none; }
.ds-dash-seg-fill { display: flex; width: 100%; overflow-x: auto; }
.ds-dash-seg-fill .ds-segmented__item { flex: 1 0 auto; min-width: 0; padding-inline: var(--space-2); white-space: nowrap; }
/* the status line under a filter's control: the reset note of the other time filter, or the date filter's refusal (spec 70 §5.7a; DESIGN N-20) */
.ds-dash-filter { display: flex; flex-direction: column; justify-content: safe center; height: 100%; min-height: 0; overflow-y: auto; }   /* a narrow widget whose control and line wrap past its height scrolls inside, never sideways */
.ds-dash-filter > .ds-dash-slicer { height: auto; }
.ds-dash-filter__line { margin: var(--space-1) 0 0; font-size: var(--text-xs); line-height: var(--lh-tight); color: var(--color-text-muted); }
.ds-dash-filter__line:empty { margin: 0; }
.ds-dash-filter__line[data-error="true"] { color: var(--color-negative); }
/* the date filter: the boxes OD and DO (the inline field of 8.2, typed or picked), then Sve and the status line (spec 70 5.7a, AIS-V1013). At the default 5 x 2 (a body
   of about 395 x 74 px at 1440) the boxes and Sve share one line and the status line sits under them. A body too narrow for that line (5 columns in an 1100 px window,
   about 250 px) gives each box a line, Sve beside the second, and its status line needs a third line that scrolls inside (the measured shortfall of
   D-20261116-impl-v1013-filter-sizes); from 6 columns there the boxes share a line and Sve the second with the status line. The phone layout sizes the widget to its
   content */
.ds-dash-datefilter { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); min-width: 0; }
.ds-dash-datefilter__item { position: relative; flex: 1 1 auto; align-items: center; gap: var(--space-1); min-width: 0; min-height: var(--control-h-md); padding: 0 0 0 var(--space-2); border-radius: var(--radius-field-sm); }
.ds-dash-datefilter__item > .ds-field__caption { font-weight: var(--weight-medium); text-transform: uppercase; color: var(--color-text-muted); }
.ds-dash-datefilter__item > .ds-field__input { flex: 1 0 auto; align-self: stretch; width: 9.5ch; font-variant-numeric: tabular-nums; }
.ds-dash-datefilter__item > .ds-field__input::placeholder { font-size: var(--text-xs); }   /* the hint dd.mm.gggg. is wider than a date: at the input's 13 px it lost its last dot */
.ds-dash-datefilter__item > .ds-icon-btn { flex: none; }
.ds-dash-datefilter .ds-segmented__item { min-width: 0; }
.ds-dash-datefilter > .ds-dash-filter__line { flex: 1 1 11rem; margin: 0; }   /* beside Sve where 11rem are left, else on a line of its own */
.ds-dash-datefilter > .ds-dash-filter__line:empty { flex-basis: 0; }   /* the empty status line (kept in the layout for its live region) never takes a line of its own */
.ds-dash-datefilter__native { position: absolute; bottom: 0; left: 0; width: 1px; height: 1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); }
.ds-dash-grid.is-editing .ds-dash-datefilter > * { pointer-events: none; }
.ds-dash-gitem[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; }   /* the board holds its one date filter (§5.7a); the reason is the title */

/* --- tooltip ---------------------------------------------------------------------------------------------------- */
.ds-dash-tt { display: grid; gap: 3px; padding: 8px 10px; max-width: 280px; font-size: var(--text-xs); line-height: var(--lh-tight); }
.ds-dash-tt__head { font-weight: var(--weight-semibold); color: var(--color-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-dash-tt__row { display: flex; align-items: center; gap: 6px; color: var(--color-text-body); }
.ds-dash-tt__mark { flex: none; width: 8px; height: 8px; border-radius: 2px; }
.ds-dash-tt__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-dash-tt b { font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; color: var(--color-text); padding-inline-start: 12px; white-space: nowrap; }

/* --- gallery: beside the grid, never over it, no scrim (the grid stays a drop target) ------------------------------ */
.ds-dash-gallery { flex: none; display: flex; flex-direction: column; gap: var(--space-3); width: 0; padding: 0; visibility: hidden; overflow: hidden; background: var(--card-bg); box-shadow: var(--card-shadow); border-radius: var(--radius-card) 0 0 var(--radius-card); }
.ds-dash-gallery.is-open { position: sticky; top: var(--space-4); width: min(384px, 100vw); max-height: calc(100dvh - 2 * var(--space-4)); padding: var(--space-5) var(--space-4) var(--space-3); visibility: visible; }
.ds-dash-gallery__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-2); }
.ds-dash-gallery__sub { margin-top: 2px; font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-dash-gallery__search, .ds-dash-gallery > .ds-dash-seg-fill { flex: none; }
.ds-dash-gallery__search .ds-dash-i { color: var(--color-text-subtle); }
.ds-dash-gallery__list { flex: 1; min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: var(--space-4); padding-inline-end: 2px; }
.ds-dash-gallery__none { color: var(--color-text-muted); text-align: center; }
.ds-dash-ggroup__title { margin: 0 0 var(--space-2); font-size: var(--text-xs); font-weight: var(--weight-bold); letter-spacing: var(--tracking-upper); text-transform: uppercase; color: var(--color-text-muted); }
.ds-dash-ggrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.ds-dash-ggroup[hidden], .ds-dash-gitem[hidden] { display: none; }
.ds-dash-gitem { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-2); border-radius: var(--radius-lg); background: var(--tool-off-bg); box-shadow: var(--tool-off-shadow); cursor: grab; user-select: none; transition: box-shadow var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease); }
@media (hover: hover) { .ds-dash-gitem:hover { background: var(--tool-on-bg); box-shadow: var(--tool-on-shadow); } }
.ds-dash-gitem__thumb { position: relative; height: 78px; overflow: hidden; border-radius: var(--radius-md); background: var(--color-surface-1); pointer-events: none; }
.ds-dash-gitem__thumb > svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.ds-dash-gitem__html { width: 280px; height: 150px; padding: 12px 16px; transform: scale(0.52); transform-origin: 0 0; container-type: size; }
.ds-dash-gitem__panel { position: absolute; inset: 8px; display: flex; flex-direction: column; gap: 5px; padding: 6px; border-radius: var(--radius-md); background: var(--card-bg); box-shadow: var(--card-shadow); }
.ds-dash-gitem__panel .head { width: 45%; height: 5px; border-radius: 3px; background: var(--color-border-strong); }
.ds-dash-gitem__panel .tabs { display: flex; gap: 4px; }
.ds-dash-gitem__panel .tabs i { width: 20px; height: 4px; border-radius: 2px; background: var(--color-accent); opacity: 0.8; }
.ds-dash-gitem__panel .tabs i + i { background: var(--color-border-strong); }
.ds-dash-gitem__panel .body { flex: 1; border-radius: 4px; border: 1px dashed var(--color-border-strong); }
.ds-dash-gitem__name { font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--color-text-body); }
/* the drag ghost must never catch the pointer: GridStack finds the grid under it with elementFromPoint, and the chart library's SVG sets its own pointer-events */
.ds-dash-gitem--ghost, .ds-dash-gitem--ghost * { pointer-events: none !important; }
.ds-dash-gitem--ghost { z-index: var(--z-toast); opacity: 0.94; box-shadow: var(--tool-on-shadow), var(--shadow-overlay); background: var(--color-surface-3); cursor: grabbing; }

/* --- the customization modal ------------------------------------------------------------------------------------ */
.ds-dialog.ds-dash-editor-dialog:has(> .ds-dialog-large) { width: min(1520px, 100vw - 40px); height: min(920px, 100vh - 40px); }
.ds-dash-editor__title { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.ds-dash-editor { flex: 1; min-height: 0; display: grid; grid-template-columns: 372px minmax(0, 1fr) 376px; gap: var(--space-4); padding: 0 var(--space-5) var(--space-4); }
.ds-dash-editor__settings { display: flex; flex-direction: column; gap: var(--space-3); min-height: 0; min-width: 0; }
.ds-dash-editor__pane { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: var(--space-4); padding: 2px 6px 4px 2px; }
.ds-dash-editor__stage { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; min-height: 0; border-radius: var(--radius-inner); background: var(--well-bg); box-shadow: var(--well-shadow); overflow: hidden; }
.ds-dash-editor__frame { position: relative; inset: auto; flex: none; border-radius: var(--radius-inner); overflow: hidden; }
.ds-dash-editor__problems { position: absolute; left: var(--space-3); right: var(--space-3); bottom: var(--space-3); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--tint-negative); color: var(--color-text); font-size: var(--text-xs); }
.ds-dash-editor__problemlist { margin: 0; padding-inline-start: var(--space-4); }
.ds-dash-editor__chat { min-height: 0; min-width: 0; display: flex; }
.ds-dash-editor:not(:has(> .ds-dash-editor__chat)) { grid-template-columns: 372px minmax(0, 1fr); }
.ds-dash-editor__intro { font-size: var(--text-xs); }
.ds-dash-formgroup { display: grid; gap: var(--space-2); }
.ds-dash-formgroup [hidden] { display: none; }
.ds-dash-formgroup__title { margin: 0; font-size: var(--text-xs); font-weight: var(--weight-bold); letter-spacing: var(--tracking-upper); text-transform: uppercase; color: var(--color-text-muted); }
.ds-dash-toggle { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: var(--target-min); font-size: var(--text-sm); color: var(--color-text-body); }
.ds-dash-listfield { display: grid; gap: var(--space-2); justify-items: start; }
.ds-dash-listfield__row { display: flex; align-items: center; gap: var(--space-1); width: 100%; }
.ds-dash-listfield__row .ds-field { flex: 1; }
.ds-dash-needs ul { display: grid; gap: var(--space-1); margin: var(--space-2) 0 0; padding: 0; list-style: none; font-size: var(--text-xs); color: var(--color-text-body); }
.ds-dash-needs li { display: flex; flex-direction: column; }
.ds-dash-needs b { font-weight: var(--weight-semibold); color: var(--color-text); }
.ds-dash-needs__meta { color: var(--color-text-subtle); }
.ds-dash-needs__rows { margin-top: var(--space-1); font-size: var(--text-xs); color: var(--color-text-subtle); }
.ds-dash-dataarea { display: flex; flex-direction: column; gap: var(--space-2); min-height: 0; }
.ds-dash-datalist { display: grid; gap: var(--space-1); margin: 0; padding-left: var(--space-4); font-size: var(--text-xs); color: var(--color-text-body); }

/* the chat inside the modal */
.ds-dash-chat { position: relative; flex: 1; min-width: 0; padding: 14px; border-radius: var(--radius-inner); background: var(--color-surface-1); }
.ds-dash-chat .ds-chat__log { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-3) 4px; }
.ds-dash-chat__greeting { font-size: var(--text-lg); font-weight: var(--weight-semibold); color: var(--color-text); }
.ds-dash-chat__needs { margin-top: var(--space-1); font-size: var(--text-xs); color: var(--color-text-muted); }
.ds-dash-chat__kicker { margin-bottom: var(--space-1); font-size: var(--text-kicker); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-kicker); text-transform: uppercase; color: var(--color-text-subtle); }
.ds-dash-chat__msg { color: var(--color-text-body); font-size: var(--text-sm); }
.ds-dash-chat__revert { display: inline-flex; align-items: center; gap: var(--space-1); margin-top: var(--space-1); padding: 0; border: 0; background: transparent; color: var(--color-accent); font-size: var(--text-xs); }
.ds-dash-chat__reverted { display: block; margin-top: var(--space-1); color: var(--color-text-subtle); font-size: var(--text-xs); }
.ds-dash-chat__typing { display: flex; gap: 4px; padding: var(--space-1) 0; }
.ds-dash-chat__typing > span:not(.ds-visually-hidden) { width: 6px; height: 6px; border-radius: 50%; background: var(--color-text-subtle); animation: ds-dash-pulse 1s infinite var(--ease); }
.ds-dash-chat__typing > span:nth-child(2) { animation-delay: 0.16s; }
.ds-dash-chat__typing > span:nth-child(3) { animation-delay: 0.32s; }
@keyframes ds-dash-pulse { 0%, 100% { opacity: 0.3; } 40% { opacity: 1; } }
.ds-dash-chat .ds-composer__box textarea { width: 100%; }
.ds-dash-chat .ds-composer__row { justify-content: flex-end; }
.ds-dash-send { display: inline-grid; place-items: center; width: var(--target-min); height: var(--target-min); padding: 0; border: 0; border-radius: 50%; background: var(--send-bg); color: var(--send-fg); box-shadow: var(--send-shadow); }
.ds-dash-send[disabled] { background: var(--color-surface-2); color: var(--color-send-arrow-disabled); box-shadow: none; cursor: not-allowed; }

@media (max-width: 1279px) {
  .ds-dash-editor { grid-template-columns: 320px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 300px; }
  .ds-dash-editor__settings { grid-row: 1 / span 2; }
  .ds-dash-editor:not(:has(> .ds-dash-editor__chat)) { grid-template-rows: minmax(0, 1fr); }
}
@media (max-width: 767px) {
  .ds-dialog.ds-dash-editor-dialog:has(> .ds-dialog-large) { width: 100%; height: 100%; }
  .ds-scrim:has(.ds-dash-editor-dialog) { padding: 0; }
  .ds-dash-editor { display: flex; flex-direction: column; overflow-y: auto; padding-inline: var(--space-3); }
  .ds-dash-editor__stage { flex: none; height: 300px; order: -1; }   /* DESIGN widget-editor phone: the preview first, then the settings */
  .ds-dash-editor__settings { flex: none; }
  .ds-dash-editor__pane { overflow: visible; }
  .ds-dash-editor__chat { flex: none; height: 460px; }
  .ds-dash-gallery.is-open { position: fixed; inset: 0; z-index: var(--z-drawer); width: 100%; border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) { .ds-dash-chat__typing > span { animation: none !important; } }
