/*
 * UI kit v2 (survey-platform-v2).
 * Loaded after the approved A-02 styles. It refines the existing components
 * (same class names, so every page picks the changes up) and adds the ones the
 * system was missing. Colours come from theme.css tokens only, so light, dark
 * and the brand palettes keep working; directions use logical properties.
 * Reference page: /dev/components.
 */

/* ---------- Tokens ---------- */
:root {
  --dk-bg: #f5f6fa;
  --dk-border: #e8ebf1;
  --dk-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.04);
  --ui-shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.12), 0 2px 6px rgba(16, 24, 40, 0.06);
  --ui-ring: 0 0 0 3px color-mix(in srgb, var(--brand) 24%, transparent);
  --ui-ring-danger: 0 0 0 3px color-mix(in srgb, var(--st-danger) 22%, transparent);
  --ui-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ui-fast: 0.14s;
  --ui-r-sm: 8px;
  --ui-r-md: 10px;
  --ui-r-lg: 14px;
  --ui-h-sm: 32px;
  --ui-h-md: 38px;
  --ui-h-lg: 46px;
}
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --dk-bg: #0f141b; --dk-border: #2a3341; --ui-shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5); }
}
@media screen { :root[data-theme="dark"] { --dk-bg: #0f141b; --dk-border: #2a3341; --ui-shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5); } }

body { font-feature-settings: "tnum" 0; text-rendering: optimizeLegibility; }
::selection { background: color-mix(in srgb, var(--brand) 22%, transparent); }

/* One focus look everywhere: keyboard only, never on mouse click. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: none; box-shadow: var(--ui-ring); border-radius: var(--ui-r-sm); }

/* ---------- Buttons ---------- */
.button {
  position: relative;
  justify-content: center;
  border-radius: var(--ui-r-md);
  transition: background-color var(--ui-fast) var(--ui-ease), box-shadow var(--ui-fast) var(--ui-ease), transform var(--ui-fast) var(--ui-ease), filter var(--ui-fast);
  white-space: nowrap;
  user-select: none;
}
.button:not(:disabled):active { transform: translateY(1px); }
.button:hover { filter: brightness(1.07); }
.button:focus-visible { box-shadow: var(--ui-ring); }
.button--soft { background: var(--brand-soft); color: var(--brand-text); }
.button--outline, .button--ghost { background: var(--dk-surface); color: var(--dk-text); border: 1px solid var(--dk-line); }
.button--outline:hover, .button--ghost:hover { background: var(--dk-hover); filter: none; }
.button--subtle { background: transparent; color: var(--dk-text-2); border: 1px solid transparent; }
.button--subtle:hover { background: var(--dk-hover); filter: none; }
.button--link { background: none; color: var(--brand-text); padding-inline: 2px !important; min-block-size: auto !important; text-decoration: underline; text-underline-offset: 3px; }
.button--danger-soft { background: var(--st-danger-bg); color: var(--st-danger); }
.button--block { inline-size: 100%; }
:is(.dk-main, .drawer, .dialog) .button.button--lg:not(.button--sm):not(.drawer__foot *) { min-block-size: var(--ui-h-lg); padding-inline: 20px; font-size: 15px; }
.button--icon { padding: 0 !important; inline-size: var(--ui-h-md); min-inline-size: var(--ui-h-md); }
.button--icon.button--sm { inline-size: var(--ui-h-sm); min-inline-size: var(--ui-h-sm); }
.button .kbd { margin-inline-start: 4px; }
.button.is-busy > .icon { display: none; }

.button-group { display: inline-flex; }
.button-group > .button { border-radius: 0; }
.button-group > .button:first-child { border-start-start-radius: var(--ui-r-md); border-end-start-radius: var(--ui-r-md); }
.button-group > .button:last-child { border-start-end-radius: var(--ui-r-md); border-end-end-radius: var(--ui-r-md); }
.button-group > .button + .button { margin-inline-start: -1px; }

.kbd {
  display: inline-grid; place-items: center; min-inline-size: 22px; block-size: 22px; padding-inline: 6px;
  border: 1px solid var(--dk-line); border-block-end-width: 2px; border-radius: 6px;
  background: var(--dk-surface-2); color: var(--dk-muted-2); font: 600 11px/1 var(--font-mono); direction: ltr;
}

/* ---------- Fields ---------- */
:is(.dk-main, .drawer, .dialog) .field input:where(:not([type=radio], [type=checkbox])),
:is(.dk-main, .drawer, .dialog) .field select,
:is(.dk-main, .drawer, .dialog) .field textarea,
.ui-input {
  border-radius: var(--ui-r-md);
  border: 1px solid var(--dk-line);
  background-color: var(--dk-surface);
  color: var(--dk-text);
  transition: border-color var(--ui-fast), box-shadow var(--ui-fast), background-color var(--ui-fast);
}
:is(.dk-main, .drawer, .dialog) .field :is(input, select, textarea):hover:not(:disabled):not(:focus) { border-color: var(--dk-line-strong); }
:is(.dk-main, .drawer, .dialog) .field :is(input, select, textarea):focus { outline: none; border-color: var(--brand); box-shadow: var(--ui-ring); }
:is(.dk-main, .drawer, .dialog) .field :is(input, textarea)::placeholder { color: var(--dk-faint); }
:is(.dk-main, .drawer, .dialog) .field--invalid :is(input, select, textarea):focus { box-shadow: var(--ui-ring-danger); border-color: var(--st-danger); }
:is(.dk-main, .drawer, .dialog) .field textarea { padding-block: 10px; line-height: 1.7; resize: vertical; min-block-size: 96px; }
.field__label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.field__req { color: var(--st-danger); margin-inline-start: 2px; }
.field__opt { color: var(--dk-faint); font-weight: 400; font-size: 12px; }
.field__hint { line-height: 1.6; }
.field__count { font-size: 11px; color: var(--dk-faint); font-variant-numeric: tabular-nums; }
.field__count.is-over { color: var(--st-danger); font-weight: 600; }
.field__success { font-size: var(--text-xs); color: var(--st-ok); display: flex; gap: 4px; align-items: center; }
.field__success .icon { inline-size: 14px; block-size: 14px; }
.field--valid :is(input, select) { border-color: var(--st-ok-line) !important; }

/* Input with an icon, a unit or a clear button inside it. */
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > .icon { position: absolute; inset-inline-start: 12px; inline-size: 17px; block-size: 17px; color: var(--dk-faint); pointer-events: none; }
:is(.dk-main, .drawer, .dialog) .field .input-wrap > .icon + input { padding-inline-start: 38px; }
.input-wrap__end { position: absolute; inset-inline-end: 6px; display: flex; align-items: center; gap: 2px; }
.input-wrap__end .icon-button { inline-size: 28px; block-size: 28px; color: var(--dk-faint); border-radius: 7px; }
.input-wrap__end .icon-button .icon { inline-size: 16px; block-size: 16px; }
:is(.dk-main, .drawer, .dialog) .field .input-wrap:has(.input-wrap__end) input { padding-inline-end: 40px; }
.input-addon { display: flex; min-inline-size: 0; }
.input-addon > span { display: grid; place-items: center; padding-inline: 12px; border: 1px solid var(--dk-line); background: var(--dk-surface-2); color: var(--dk-muted); font-size: 13px; white-space: nowrap; }
.input-addon > span:first-child { border-start-start-radius: var(--ui-r-md); border-end-start-radius: var(--ui-r-md); border-inline-end: 0; }
.input-addon > span:last-child { border-start-end-radius: var(--ui-r-md); border-end-end-radius: var(--ui-r-md); border-inline-start: 0; }
:is(.dk-main, .drawer, .dialog) .field .input-addon > input { border-radius: 0; flex: 1 1 auto; inline-size: 1%; min-inline-size: 0; }
:is(.dk-main, .drawer, .dialog) .field .input-addon > input:first-child { border-start-start-radius: var(--ui-r-md); border-end-start-radius: var(--ui-r-md); }
:is(.dk-main, .drawer, .dialog) .field .input-addon > input:last-child { border-start-end-radius: var(--ui-r-md); border-end-end-radius: var(--ui-r-md); }

/* Select arrow drawn by CSS, mirrored by direction. */
:is(.dk-main, .drawer, .dialog) .field select, .dk-select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%238c96a8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 18px; background-position: right 10px center;
  padding-inline-end: 36px !important;
}
[dir="rtl"] :is(.dk-main, .drawer, .dialog) .field select, [dir="rtl"] .dk-select { background-position: left 10px center; }

/* ---------- Checkbox, radio and switch ---------- */
.check { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: var(--text-sm); line-height: 1.5; }
.check input { flex: none; margin: 1px 0 0; }
.check small { display: block; color: var(--dk-muted); font-size: 12px; }
.check:has(input:disabled) { opacity: 0.55; cursor: not-allowed; }
.checks { display: grid; gap: 12px; }
.checks--row { display: flex; flex-wrap: wrap; gap: 12px 24px; }

input[type="checkbox"]:not([role="switch"]), input[type="radio"] {
  appearance: none; -webkit-appearance: none;
  inline-size: 18px; block-size: 18px; margin: 0;
  border: 1.5px solid var(--dk-line-strong); background: var(--dk-surface);
  display: inline-grid; place-content: center; cursor: pointer;
  transition: background-color var(--ui-fast), border-color var(--ui-fast), box-shadow var(--ui-fast);
}
input[type="checkbox"]:not([role="switch"]) { border-radius: 5px; }
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:not([role="switch"])::before {
  content: ""; inline-size: 10px; block-size: 10px; transform: scale(0); transition: transform var(--ui-fast) var(--ui-ease);
  background: var(--brand-ink);
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}
input[type="checkbox"]:not([role="switch"]):indeterminate::before { clip-path: inset(40% 10%); transform: scale(1); }
input[type="radio"]::before { content: ""; inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--brand-ink); transform: scale(0); transition: transform var(--ui-fast) var(--ui-ease); }
input[type="checkbox"]:not([role="switch"]):is(:checked, :indeterminate), input[type="radio"]:checked { background: var(--brand); border-color: var(--brand); }
input[type="checkbox"]:not([role="switch"]):checked::before, input[type="radio"]:checked::before { transform: scale(1); }
input[type="checkbox"]:hover:not(:disabled):not(:checked), input[type="radio"]:hover:not(:disabled):not(:checked) { border-color: var(--brand); }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { box-shadow: var(--ui-ring); }
input[type="checkbox"]:disabled, input[type="radio"]:disabled { cursor: not-allowed; background: var(--dk-surface-muted); }

input[role="switch"] {
  appearance: none; -webkit-appearance: none; flex: none; margin: 0; cursor: pointer;
  inline-size: 40px; block-size: 22px; border-radius: 999px; position: relative;
  background: var(--dk-line-strong); transition: background-color var(--ui-fast) var(--ui-ease);
}
input[role="switch"]::after {
  content: ""; position: absolute; inset-block-start: 3px; inset-inline-start: 3px;
  inline-size: 16px; block-size: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.25); transition: transform var(--ui-fast) var(--ui-ease);
}
input[role="switch"]:checked { background: var(--brand); }
input[role="switch"]:checked::after { transform: translateX(18px); }
[dir="rtl"] input[role="switch"]:checked::after { transform: translateX(-18px); }
input[role="switch"]:focus-visible { box-shadow: var(--ui-ring); }
input[role="switch"]:disabled { opacity: 0.5; cursor: not-allowed; }

/* A setting row: what it does on one side, its switch on the other. */
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; border-block-end: 1px solid var(--dk-border); }
.setting-row:last-child { border-block-end: 0; }
.setting-row__text { min-inline-size: 0; }
.setting-row__text strong { display: block; font-size: 14px; font-weight: 600; }
.setting-row__text span { display: block; font-size: 12.5px; color: var(--dk-muted); line-height: 1.6; }

/* Choice cards: a radio or checkbox with a title, a line of help and an icon. */
.choices { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.choice { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1.5px solid var(--dk-line); border-radius: var(--ui-r-lg); background: var(--dk-surface); cursor: pointer; transition: border-color var(--ui-fast), background-color var(--ui-fast), box-shadow var(--ui-fast); }
.choice:hover { border-color: var(--dk-line-strong); }
.choice:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand-soft) 55%, var(--dk-surface)); }
.choice:has(input:focus-visible) { box-shadow: var(--ui-ring); }
.choice:has(input:disabled) { opacity: 0.55; cursor: not-allowed; }
.choice input { position: absolute; inset-block-start: 14px; inset-inline-end: 14px; }
.choice__icon { flex: none; inline-size: 38px; block-size: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--dk-surface-muted); color: var(--dk-muted-2); }
.choice:has(input:checked) .choice__icon { background: var(--brand); color: var(--brand-ink); }
.choice__icon .icon { inline-size: 20px; block-size: 20px; }
.choice__text { padding-inline-end: 24px; }
.choice__text strong { display: block; font-size: 14px; font-weight: 600; }
.choice__text span { display: block; font-size: 12.5px; color: var(--dk-muted); line-height: 1.6; margin-block-start: 2px; }

/* Segmented control built on radios (keyboard arrows work natively). */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--dk-surface-muted); border: 1px solid var(--dk-border); }
.seg label { position: relative; display: inline-flex; align-items: center; gap: 6px; padding-inline: 14px; min-block-size: 30px; border-radius: 8px; font-size: 13px; color: var(--dk-muted-2); cursor: pointer; transition: background-color var(--ui-fast), color var(--ui-fast), box-shadow var(--ui-fast); white-space: nowrap; }
.seg label .icon { inline-size: 16px; block-size: 16px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--dk-surface); color: var(--dk-text); font-weight: 600; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08), 0 1px 1px rgba(16, 24, 40, 0.04); }
.seg label:has(input:focus-visible) { box-shadow: var(--ui-ring); }

/* Chips: selected values that can be removed. */
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding-block: 4px; padding-inline: 10px; border-radius: 999px; background: var(--dk-surface-muted); color: var(--dk-text-2); font-size: 12.5px; border: 1px solid var(--dk-border); }
.chip--brand { background: var(--brand-soft); color: var(--brand-text); border-color: transparent; }
.chip button { display: grid; place-items: center; inline-size: 18px; block-size: 18px; margin-inline-end: -4px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; opacity: 0.7; }
.chip button:hover { opacity: 1; background: var(--dk-hover); }
.chip .icon { inline-size: 13px; block-size: 13px; }
.chip-input { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-block-size: 40px; padding: 5px 8px; border: 1px solid var(--dk-line); border-radius: var(--ui-r-md); background: var(--dk-surface); cursor: text; }
.chip-input:focus-within { border-color: var(--brand); box-shadow: var(--ui-ring); }
:is(.dk-main, .drawer, .dialog) .field .chip-input input { flex: 1; min-inline-size: 120px; border: 0 !important; box-shadow: none !important; block-size: 28px !important; min-block-size: 0; padding: 0 4px; background: transparent; }

/* File drop zone. */
.dropzone { display: grid; justify-items: center; gap: 6px; padding: 26px 16px; text-align: center; border: 1.5px dashed var(--dk-line-strong); border-radius: var(--ui-r-lg); background: var(--dk-surface-2); color: var(--dk-muted); cursor: pointer; transition: border-color var(--ui-fast), background-color var(--ui-fast); }
.dropzone:hover, .dropzone.is-over { border-color: var(--brand); background: color-mix(in srgb, var(--brand-soft) 50%, var(--dk-surface)); }
.dropzone__icon { inline-size: 44px; block-size: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); }
.dropzone strong { color: var(--dk-text); font-size: 14px; }
.dropzone small { font-size: 12px; }
.dropzone input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; }
.files { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.file { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--dk-border); border-radius: 12px; background: var(--dk-surface); font-size: 13px; }
.file__icon { inline-size: 36px; block-size: 36px; border-radius: 9px; display: grid; place-items: center; background: var(--st-info-bg); color: var(--st-info); }
.file__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file__meta { color: var(--dk-muted); font-size: 12px; }
.file .progress__bar { margin-block-start: 6px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-block-end: 1px solid var(--dk-border); overflow-x: auto; scrollbar-width: none; margin-block-end: 18px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs [role="tab"] { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 0; background: none; font: inherit; font-size: 14px; color: var(--dk-muted); cursor: pointer; white-space: nowrap; border-radius: 8px 8px 0 0; transition: color var(--ui-fast); }
.tabs [role="tab"]:hover { color: var(--dk-text); }
.tabs [role="tab"]::after { content: ""; position: absolute; inset-inline: 10px; inset-block-end: -1px; block-size: 2px; border-radius: 2px; background: var(--brand); transform: scaleX(0); transition: transform var(--ui-fast) var(--ui-ease); }
.tabs [role="tab"][aria-selected="true"] { color: var(--brand-text); font-weight: 600; }
.tabs [role="tab"][aria-selected="true"]::after { transform: scaleX(1); }
.tabs [role="tab"] .icon { inline-size: 17px; block-size: 17px; }
.tabs .tab__count { min-inline-size: 20px; block-size: 20px; padding-inline: 6px; border-radius: 999px; background: var(--dk-surface-muted); font-size: 11px; font-weight: 600; display: inline-grid; place-items: center; color: var(--dk-muted-2); }
.tabs [aria-selected="true"] .tab__count { background: var(--brand-soft); color: var(--brand-text); }
.tabs--pills { border: 0; gap: 6px; }
.tabs--pills [role="tab"] { border-radius: 999px; padding: 7px 14px; }
.tabs--pills [role="tab"]::after { display: none; }
.tabs--pills [role="tab"][aria-selected="true"] { background: var(--brand-soft); }
[role="tabpanel"][hidden] { display: none; }

/* ---------- Breadcrumbs ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 8px; padding: 0; list-style: none; font-size: 13px; color: var(--dk-muted); }
.crumbs li { display: inline-flex; align-items: center; gap: 6px; }
.crumbs li + li::before { content: "›"; font-size: 15px; line-height: 1; opacity: 0.55; }
[dir="rtl"] .crumbs li + li::before { content: "‹"; }
.crumbs a { color: var(--dk-muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand-text); text-decoration: underline; }
.crumbs [aria-current] { color: var(--dk-text); font-weight: 600; }

/* ---------- Stepper (wizards) ---------- */
.stepper { display: flex; list-style: none; margin: 0; padding: 0; counter-reset: step; }
.stepper li { flex: 1; position: relative; display: grid; justify-items: center; gap: 6px; text-align: center; font-size: 12.5px; color: var(--dk-muted); counter-increment: step; }
.stepper li::before { content: counter(step); position: relative; z-index: 1; inline-size: 32px; block-size: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--dk-surface); border: 2px solid var(--dk-line); font-weight: 700; font-size: 13px; color: var(--dk-muted); transition: all var(--ui-fast); }
.stepper li + li::after { content: ""; position: absolute; inset-block-start: 15px; inset-inline-end: 50%; inline-size: 100%; block-size: 2px; background: var(--dk-line); }
.stepper li.is-done::before { content: "✓"; background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.stepper li.is-done + li::after, .stepper li.is-done + li.is-current::after { background: var(--brand); }
.stepper li.is-current::before { border-color: var(--brand); color: var(--brand-text); box-shadow: var(--ui-ring); }
.stepper li.is-current { color: var(--dk-text); font-weight: 600; }
.stepper li.is-error::before { content: "!"; border-color: var(--st-danger); color: var(--st-danger); }
.stepper small { display: block; font-weight: 400; color: var(--dk-faint); font-size: 11.5px; }

/* ---------- Badges, status dots, avatars ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; line-height: 1.5; }
.badge--brand { background: var(--brand-soft); color: var(--brand-text); }
.badge--neutral { background: var(--st-neutral-bg); color: var(--dk-muted-2); }
.badge--violet { background: var(--st-violet-bg); color: var(--st-violet); }
.badge--outline { background: transparent; border: 1px solid var(--dk-line); color: var(--dk-text-2); }
.badge--solid { background: var(--brand); color: var(--brand-ink); }
.badge .icon { inline-size: 13px; block-size: 13px; }
.dot { inline-size: 8px; block-size: 8px; border-radius: 50%; display: inline-block; flex: none; background: currentColor; }
.dot--pulse { box-shadow: 0 0 0 0 currentColor; animation: dot-pulse 1.8s infinite; }
@keyframes dot-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 50%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .dot--pulse { animation: none; } }

.avatar { inline-size: 36px; block-size: 36px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand-text); font-weight: 700; font-size: 14px; position: relative; }
.avatar--sm { inline-size: 28px; block-size: 28px; font-size: 12px; }
.avatar--lg { inline-size: 48px; block-size: 48px; font-size: 18px; }
.avatar--t2 { background: var(--tone-green-bg); color: var(--tone-green); }
.avatar--t3 { background: var(--tone-orange-bg); color: var(--tone-orange); }
.avatar--t4 { background: var(--tone-pink-bg); color: var(--tone-pink); }
.avatar__status { position: absolute; inset-block-end: 0; inset-inline-end: 0; inline-size: 10px; block-size: 10px; border-radius: 50%; border: 2px solid var(--dk-surface); background: var(--st-ok-solid); }
.avatars { display: inline-flex; }
.avatars .avatar { border: 2px solid var(--dk-surface); }
.avatars .avatar + .avatar { margin-inline-start: -10px; }
.person { display: flex; align-items: center; gap: 10px; min-inline-size: 0; }
.person strong { display: block; font-size: 14px; font-weight: 600; }
.person > div > span { display: block; font-size: 12px; color: var(--dk-muted); }

/* ---------- Progress ---------- */
.progress__bar { block-size: 8px; }
.progress__bar span { border-radius: 999px; transition: inline-size 0.4s var(--ui-ease); }
.progress--ok .progress__bar span { background: var(--st-ok-solid); }
.progress--warn .progress__bar span { background: var(--st-warn-solid); }
.progress--danger .progress__bar span { background: var(--st-danger-solid); }
.ring { --p: 0; --c: var(--brand); inline-size: 64px; block-size: 64px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; background: radial-gradient(closest-side, var(--dk-surface) 76%, transparent 78% 100%), conic-gradient(var(--c) calc(var(--p) * 1%), var(--dk-surface-muted) 0); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.ring--lg { inline-size: 88px; block-size: 88px; font-size: 18px; }

/* ---------- Panels and cards ---------- */
.dk-panel { transition: box-shadow var(--ui-fast); }
.dk-panel--flat { box-shadow: none; }
.card-link { display: block; color: inherit; text-decoration: none; transition: border-color var(--ui-fast), box-shadow var(--ui-fast), transform var(--ui-fast); }
.card-link:hover { border-color: var(--dk-line-strong); box-shadow: var(--ui-shadow-lg); transform: translateY(-1px); }
.dk-head__actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- Alerts and banners ---------- */
.dk-main .alert, .drawer .alert, .dialog .alert { border: 1px solid transparent; border-inline-start-width: 4px; }
.alert--success { border-color: var(--st-ok-line); }
.alert--danger { border-color: var(--st-danger-line); }
.alert--warning { border-color: var(--st-warn-line); }
.alert--info, .alert:not([class*="alert--"]) { border-color: var(--st-info-line); }
.dk-main .alert--success { border-inline-start-color: var(--st-ok); }
.dk-main .alert--danger { border-inline-start-color: var(--st-danger); }
.dk-main .alert--warning { border-inline-start-color: var(--st-warn); }
.dk-main .alert--info { border-inline-start-color: var(--st-info); }
.alert__actions { display: flex; gap: 8px; margin-block-start: 8px; flex-wrap: wrap; }
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--ui-r-lg); background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 70%, #000)); color: var(--brand-ink); }
.banner .icon { inline-size: 22px; block-size: 22px; flex: none; }
.banner__text { flex: 1; min-inline-size: 0; font-size: 14px; }
.banner__text strong { display: block; }
.banner .button { background: rgba(255, 255, 255, 0.18); color: inherit; }
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--ui-r-lg); background: var(--dk-surface-2); border: 1px dashed var(--dk-line-strong); font-size: 13px; color: var(--dk-muted-2); line-height: 1.7; }
.callout .icon { inline-size: 20px; block-size: 20px; color: var(--brand-text); flex: none; margin-block-start: 2px; }

/* Toasts: a title, a line, an action and a close button; they slide in from the top. */
.toast { min-inline-size: 300px; align-items: center; padding-block: 12px; box-shadow: var(--ui-shadow-lg); }
.toast__body { flex: 1; min-inline-size: 0; }
.toast__body strong { display: block; font-size: 14px; }
.toast__body span { opacity: 0.85; font-size: 13px; }
.toast__action { border: 0; background: rgba(255, 255, 255, 0.12); color: inherit; font: inherit; font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 8px; cursor: pointer; }
.toast--info { border-inline-start: 4px solid var(--st-info-solid); }
.toast--warning { border-inline-start: 4px solid var(--st-warn-solid); }

/* ---------- Dialogs (native <dialog>) ---------- */
.dialog { box-shadow: var(--ui-shadow-lg); background: var(--dk-surface); padding: 0; overflow: hidden; }
.dialog[open] { animation: dialog-in 0.18s var(--ui-ease); }
.dialog::backdrop { background: var(--dk-overlay); } /* no blur: see .drawer-scrim in site.css */
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .dialog[open] { animation: none; } }
#confirm-dialog { padding: var(--dk-pad); }
.dialog--md { inline-size: min(560px, calc(100vw - 32px)); max-inline-size: none; }
.dialog--lg { inline-size: min(820px, calc(100vw - 32px)); max-inline-size: none; }
.dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 24px 12px; }
.dialog__head h2 { margin: 0; }
.dialog__head p { margin: 4px 0 0; }
.dialog__body { padding: 4px 24px 20px; max-block-size: 65vh; overflow-y: auto; }
.dialog__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 24px; background: var(--dk-surface-2); border-block-start: 1px solid var(--dk-border); }
.dialog__icon { inline-size: 44px; block-size: 44px; border-radius: 12px; display: grid; place-items: center; margin-block-end: 12px; background: var(--st-danger-bg); color: var(--st-danger); }

/* ---------- Tooltip ([data-tip]) and help mark ---------- */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip); position: absolute; z-index: 200; inset-block-end: calc(100% + 8px); inset-inline-start: 50%;
  translate: -50% 4px; inline-size: max-content; max-inline-size: 260px; padding: 6px 10px; border-radius: 8px;
  background: var(--dk-ink-bg); color: var(--dk-ink-text); font-size: 12px; font-weight: 500; line-height: 1.6; text-align: center; white-space: normal;
  opacity: 0; pointer-events: none; transition: opacity var(--ui-fast), translate var(--ui-fast);
}
[dir="rtl"] [data-tip]::after { translate: 50% 4px; }
[data-tip]:is(:hover, :focus-visible)::after { opacity: 1; translate: -50% 0; }
[dir="rtl"] [data-tip]:is(:hover, :focus-visible)::after { translate: 50% 0; }
.help { display: inline-grid; place-items: center; inline-size: 18px; block-size: 18px; padding: 0; border: 0; border-radius: 50%; background: var(--dk-surface-muted); color: var(--dk-muted); font: 700 11px/1 var(--font-body); cursor: help; vertical-align: middle; }

/* ---------- Dropdown menu (<details>) ---------- */
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu__list { position: absolute; z-index: 60; inset-block-start: calc(100% + 6px); inset-inline-end: 0; min-inline-size: 220px; padding: 6px; border: 1px solid var(--dk-border); border-radius: 12px; background: var(--dk-surface); box-shadow: var(--ui-shadow-lg); display: grid; }
.menu__list a, .menu__list button { display: flex; align-items: center; gap: 10px; min-block-size: 36px; padding-inline: 10px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 14px; color: var(--dk-text); text-decoration: none; text-align: start; cursor: pointer; }
.menu__list a:hover, .menu__list button:hover { background: var(--dk-hover); }
.menu__list .icon { inline-size: 17px; block-size: 17px; color: var(--dk-muted); }
.menu__list .kbd { margin-inline-start: auto; }
.menu__sep { block-size: 1px; background: var(--dk-border); margin: 4px 6px; }
.menu__label { padding: 6px 10px 2px; font-size: 11px; font-weight: 600; color: var(--dk-faint); text-transform: uppercase; letter-spacing: 0.04em; }
.menu__danger, .menu__danger .icon { color: var(--st-danger) !important; }

/* ---------- Empty, error and loading states ---------- */
.state { display: grid; justify-items: center; gap: 4px; padding: 36px 16px; text-align: center; }
.state__icon { inline-size: 56px; block-size: 56px; border-radius: 16px; display: grid; place-items: center; margin-block-end: 8px; background: var(--brand-soft); color: var(--brand-text); }
.state__icon .icon { inline-size: 26px; block-size: 26px; }
.state--error .state__icon { background: var(--st-danger-bg); color: var(--st-danger); }
.state--done .state__icon { background: var(--st-ok-bg); color: var(--st-ok); }
.state h3 { margin: 0; font-size: 16px; font-weight: 600; }
.state p { margin: 0 0 12px; font-size: 13.5px; color: var(--dk-muted); max-inline-size: 42ch; }
.state__actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.skeleton { border-radius: 6px; }
.skeleton--circle { inline-size: 40px; block-size: 40px; border-radius: 50%; }
.skeleton--title { block-size: 16px; }

/* ---------- Description list (label / value grid) ---------- */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px; background: var(--dk-border); border: 1px solid var(--dk-border); border-radius: var(--ui-r-lg); overflow: hidden; }
.facts > div { background: var(--dk-surface); padding: 12px 14px; }
.facts dt { font-size: 12px; color: var(--dk-muted); margin-block-end: 2px; }
.facts dd { margin: 0; font-size: 15px; font-weight: 600; }

/* ---------- Sticky save bar (forms with changes) ---------- */
.savebar { position: sticky; inset-block-end: 16px; z-index: 25; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; margin-block-start: 18px; border-radius: 14px; background: var(--dk-ink-bg); color: var(--dk-ink-text); box-shadow: var(--ui-shadow-lg); animation: savebar-in 0.2s var(--ui-ease); }
[dir="rtl"] .savebar { padding: 10px 16px 10px 12px; }
.savebar[hidden] { display: none; }
.savebar__text { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.savebar__text .dot { color: var(--st-warn-solid); background: #f0b45a; }
.savebar .button--subtle { color: var(--dk-ink-text); }
.savebar .button--subtle:hover { background: rgba(255, 255, 255, 0.1); }
@keyframes savebar-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Settings layout: section list + content (survey settings in one place) ---------- */
.settings-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 20px; align-items: start; }
.settings-nav { position: sticky; inset-block-start: calc(var(--dk-header-h) + 16px); display: grid; gap: 2px; padding: 8px; border: 1px solid var(--dk-border); border-radius: var(--dk-radius); background: var(--dk-surface); }
.settings-nav a { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; color: var(--dk-text-2); text-decoration: none; font-size: 14px; }
.settings-nav a:hover { background: var(--dk-hover); }
.settings-nav a[aria-current="true"] { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
.settings-nav a .icon { inline-size: 18px; block-size: 18px; }
.settings-nav__state { inline-size: 18px; block-size: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.settings-nav__state--ok { background: var(--st-ok-bg); color: var(--st-ok); }
.settings-nav__state--todo { background: var(--st-warn-bg); color: var(--st-warn); }
.settings-nav__state--off { background: var(--dk-surface-muted); color: var(--dk-faint); }
.settings-nav__head { padding: 8px 10px 10px; border-block-end: 1px solid var(--dk-border); margin-block-end: 6px; }
.settings-nav__head small { display: block; font-size: 12px; color: var(--dk-muted); margin-block-end: 6px; }
.settings-section { scroll-margin-block-start: calc(var(--dk-header-h) + 16px); }
.settings-section + .settings-section { margin-block-start: 16px; }
.settings-section__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-block-end: 6px; }
.settings-section__head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.settings-section__head p { margin: 2px 0 0; font-size: 13px; color: var(--dk-muted); }
.settings-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 8px 4px; }
.readiness { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.readiness li { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.readiness .icon { inline-size: 16px; block-size: 16px; }
.readiness .is-ok { color: var(--st-ok); }
.readiness .is-todo { color: var(--st-warn); }
.readiness a { margin-inline-start: auto; font-size: 12px; color: var(--brand-text); }
@media (max-width: 1000px) {
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { position: static; grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; }
  .settings-nav__head { display: none; }
}

/* ---------- Tables ---------- */
.dk-main .table th { font-weight: 600; letter-spacing: 0.01em; }
.dk-main .table td { transition: background-color var(--ui-fast); }
.table tbody tr:has(input[type="checkbox"]:checked) { background: color-mix(in srgb, var(--brand-soft) 45%, transparent); }
.bulkbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; margin-block-end: 10px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-text); font-size: 13px; font-weight: 600; }
.bulkbar .button { margin-inline-start: 0; }
.bulkbar__grow { flex: 1; }

/* ---------- The components page itself ---------- */
.kit { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.kit-toc { position: sticky; inset-block-start: calc(var(--dk-header-h) + 16px); display: grid; gap: 2px; font-size: 13.5px; }
.kit-toc__title { font-size: 12px; font-weight: 600; color: var(--dk-faint); padding-inline: 10px; margin-block-end: 4px; }
.kit-toc a { display: block; padding: 7px 10px; border-radius: 8px; color: var(--dk-muted-2); text-decoration: none; border-inline-start: 2px solid transparent; }
.kit-toc a:hover { color: var(--dk-text); background: var(--dk-hover); }
.kit-toc a[aria-current="true"] { color: var(--brand-text); background: var(--brand-soft); font-weight: 600; }
.kit-body { display: grid; gap: 28px; min-inline-size: 0; }
.kit-sec { scroll-margin-block-start: calc(var(--dk-header-h) + 16px); display: grid; gap: 16px; }
.kit-sec__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.kit-sec__head h2 { margin: 0; font-size: 20px; font-weight: 700; }
.kit-sec__head p { margin: 4px 0 0; color: var(--dk-muted); font-size: 13.5px; max-inline-size: 75ch; }
.kit-new { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; background: var(--st-ok-bg); color: var(--st-ok); font-size: 11px; font-weight: 700; margin-inline-start: 8px; vertical-align: middle; }
.kit-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.kit-demo { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.kit-demo + .kit-demo { margin-block-start: 14px; }
.kit-label { display: block; font-size: 12px; font-weight: 600; color: var(--dk-faint); margin: 0 0 10px; }
.kit-label:not(:first-child) { margin-block-start: 18px; }
.kit-note { margin: 12px 0 0; font-size: 12.5px; color: var(--dk-muted); line-height: 1.7; }
.kit-note b { color: var(--dk-text-2); }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.swatch { border: 1px solid var(--dk-border); border-radius: 12px; overflow: hidden; background: var(--dk-surface); font-size: 12px; }
.swatch__color { block-size: 56px; }
.swatch__meta { padding: 8px 10px; }
.swatch__meta b { display: block; font-size: 12.5px; }
.swatch__meta code { font-size: 11px; background: none; padding: 0; color: var(--dk-muted); }
.type-scale { display: grid; gap: 10px; }
.type-scale > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; align-items: baseline; padding-block: 6px; border-block-end: 1px dashed var(--dk-border); }
.type-scale small { color: var(--dk-faint); font-size: 12px; font-family: var(--font-mono); direction: ltr; text-align: start; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.icon-grid button { display: grid; justify-items: center; gap: 6px; padding: 12px 6px; border: 1px solid var(--dk-border); border-radius: 12px; background: var(--dk-surface); color: var(--dk-text-2); font: inherit; font-size: 11px; cursor: pointer; transition: border-color var(--ui-fast), background-color var(--ui-fast); }
.icon-grid button:hover { border-color: var(--brand); color: var(--brand-text); background: var(--brand-soft); }
.icon-grid .icon { inline-size: 22px; block-size: 22px; }
.brand-pick { display: inline-flex; gap: 6px; align-items: center; }
.brand-pick button { inline-size: 26px; block-size: 26px; border-radius: 50%; border: 2px solid var(--dk-surface); box-shadow: 0 0 0 1px var(--dk-line); cursor: pointer; }
.brand-pick button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--dk-text); }
.compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.compare > div { padding: 14px; border-radius: 12px; font-size: 13px; line-height: 1.7; }
.compare__before { background: var(--st-danger-bg); color: var(--st-danger-ink); }
.compare__after { background: var(--st-ok-bg); color: var(--st-ok-ink); }
.compare b { display: block; margin-block-end: 4px; }
.compare ul { margin: 0; padding-inline-start: 18px; }
@media (max-width: 1100px) {
  .kit { grid-template-columns: minmax(0, 1fr); }
  .kit-toc { position: sticky; inset-block-start: var(--dk-header-h); z-index: 15; grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; padding: 8px 0; background: var(--dk-bg); }
  .kit-toc__title { display: none; }
}
@media (max-width: 640px) { .compare { grid-template-columns: minmax(0, 1fr); } .kit-grid { grid-template-columns: minmax(0, 1fr); } }

/* =====================================================================
   Tables v2: calm rows, sticky head, row actions on hover, density.
   ===================================================================== */
.dk-main .table-wrap { border-radius: var(--ui-r-lg); box-shadow: none; }
.dk-main .table { border-collapse: separate; border-spacing: 0; }
.dk-main .table th {
  position: sticky; inset-block-start: 0; z-index: 2;
  background: var(--dk-surface-2); color: var(--dk-muted-2);
  font-size: 12.5px; font-weight: 600; padding-block: 11px;
  border-block-end: 1px solid var(--dk-border); white-space: nowrap;
}
.dk-main .table td { padding-block: 14px; border-block-end: 1px solid var(--dk-border); color: var(--dk-text-2); line-height: 1.55; }
.dk-main .table td strong, .dk-main .table td .survey-name { color: var(--dk-text); }
.dk-main .table tbody tr { transition: background-color var(--ui-fast) var(--ui-ease); }
.dk-main .table tbody tr:hover { background: color-mix(in srgb, var(--dk-hover) 70%, transparent); }
.dk-main .table td.num, .dk-main .table th.num { text-align: end; font-variant-numeric: tabular-nums; }
.dk-main .table td.col-main { min-inline-size: 220px; }
.dk-main .table .progress { min-inline-size: 120px; }
.dk-main .table td .cell-sub { display: block; font-size: 12px; color: var(--dk-muted); margin-block-start: 2px; }
.table .col-check { inline-size: 44px; min-inline-size: 44px !important; padding-inline-end: 0; }
/* Quiet row actions: visible on hover or keyboard focus; always visible on touch screens. */
.row-actions { display: inline-flex; gap: 2px; opacity: 0; transition: opacity var(--ui-fast); }
tr:hover .row-actions, tr:focus-within .row-actions { opacity: 1; }
@media (hover: none) { .row-actions { opacity: 1; } }
.row-actions .icon-button { inline-size: 32px; block-size: 32px; color: var(--dk-muted); border-radius: 8px; }
.row-actions .icon-button:hover { color: var(--dk-text); background: var(--dk-surface-muted); }
.row-actions .icon-button .icon { inline-size: 17px; block-size: 17px; }
/* Density: comfortable (default) or compact, chosen per table. */
.table--compact td { padding-block: 8px !important; }
.table--compact th { padding-block: 8px !important; }
.table--striped tbody tr:nth-child(even) { background: color-mix(in srgb, var(--dk-surface-2) 80%, transparent); }
.table-wrap--scroll { max-block-size: 420px; overflow: auto; }
.table__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 4px 0; font-size: 13px; color: var(--dk-muted); }
.sort-btn { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
.sort-btn:hover { color: var(--dk-text); }
.sort-btn .icon { inline-size: 14px; block-size: 14px; opacity: 0.5; }
.sort-btn[aria-sort] .icon { opacity: 1; color: var(--brand-text); }

/* =====================================================================
   Cards v2: survey card with a status stripe, stat cards, gentle lift.
   ===================================================================== */
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.scard {
  --stripe: var(--dk-line-strong);
  position: relative; display: grid; gap: 14px; padding: 18px;
  border: 1px solid var(--dk-border); border-radius: var(--dk-radius); background: var(--dk-surface);
  box-shadow: var(--dk-shadow); overflow: hidden;
  transition: transform 0.2s var(--ui-ease), box-shadow 0.2s var(--ui-ease), border-color 0.2s;
}
.scard::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; inline-size: 4px; background: var(--stripe); }
.scard:hover { transform: translateY(-2px); box-shadow: var(--ui-shadow-lg); border-color: var(--dk-line); }
.scard--published { --stripe: var(--st-ok-solid); }
.scard--paused { --stripe: var(--st-warn-solid); }
.scard--draft { --stripe: var(--st-info-solid); }
.scard--archived { --stripe: var(--st-neutral-solid); }
.scard__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.scard__title { margin: 0; font-size: 15.5px; font-weight: 600; line-height: 1.5; color: var(--dk-text); }
.scard__title a { color: inherit; text-decoration: none; }
.scard__title a::after { content: ""; position: absolute; inset: 0; } /* whole card clickable */
.scard__meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--dk-muted); }
.scard__meta span { display: inline-flex; align-items: center; gap: 5px; }
.scard__meta .icon { inline-size: 14px; block-size: 14px; }
.scard__progress { display: grid; gap: 6px; }
.scard__progress-head { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--dk-muted); }
.scard__progress-head b { color: var(--dk-text); font-variant-numeric: tabular-nums; font-weight: 600; }
.scard__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-block-start: 12px; border-block-start: 1px solid var(--dk-border); }
.scard__foot .button, .scard .menu { position: relative; z-index: 1; } /* stay clickable above the card link */

.stat { position: relative; display: grid; gap: 6px; padding: 18px; border: 1px solid var(--dk-border); border-radius: var(--dk-radius); background: var(--dk-surface); box-shadow: var(--dk-shadow); }
.stat__label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--dk-muted); }
.stat__icon { inline-size: 34px; block-size: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--kpi-bg, var(--brand-soft)); color: var(--kpi-ink, var(--brand-text)); }
.stat__icon .icon { inline-size: 18px; block-size: 18px; }
.stat__value { font-size: 28px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; color: var(--dk-text); letter-spacing: -0.01em; }
.stat__trend { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.stat__trend--up { background: var(--st-ok-bg); color: var(--st-ok); }
.stat__trend--down { background: var(--st-danger-bg); color: var(--st-danger); }
.stat__foot { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--dk-muted); }
.spark { display: block; inline-size: 100%; block-size: 36px; }
.spark path { fill: none; stroke: var(--kpi-ink, var(--brand)); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spark .spark__area { fill: var(--kpi-ink, var(--brand)); opacity: 0.08; stroke: none; }

/* =====================================================================
   Motion: short, soft and never in the way.
   ===================================================================== */
@keyframes ui-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes ui-fade { from { opacity: 0; } to { opacity: 1; } }
.ui-reveal { opacity: 0; }
.ui-reveal.is-in { animation: ui-rise 0.45s var(--ui-ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
[data-region]:not(.is-loading) > * { animation: ui-fade 0.2s ease-out; }
.drawer { transition: transform 0.28s var(--ui-ease); }
.row-menu__list--floating, .menu__list { animation: ui-pop 0.14s var(--ui-ease); transform-origin: top; }
@keyframes ui-pop { from { opacity: 0; transform: translateY(-4px) scale(0.98); } to { opacity: 1; transform: none; } }
.count-up { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .ui-reveal { opacity: 1; }
  .scard:hover, .card-link:hover { transform: none; }
}

/* =====================================================================
   Eye comfort: softer text, readable line length, calm dark mode.
   ===================================================================== */
:root { --dk-text: #1f2937; }
.dk-main { line-height: 1.65; }
.dk-main p { max-inline-size: 80ch; }
.dk-main .dk-sub, .dk-main .field__hint { color: var(--dk-muted); }
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --dk-text: #dfe4ec; --dk-bg: #0e1319; --dk-surface: #161c24; }
}
@media screen { :root[data-theme="dark"] { --dk-text: #dfe4ec; --dk-bg: #0e1319; --dk-surface: #161c24; } }

/* Header on phones: the title gives way so language, theme, bell and the user fit in one row. */
@media (max-width: 600px) {
  .dk-topbar, .dk-shell.is-collapsed .dk-topbar { gap: 6px; padding-inline-end: 10px; }
  .dk-topbar__title { display: none; }
  .dk-topbar form.lang-switch { margin-inline-start: auto; }
  .dk-topbar .lang-switch button { padding-inline: 8px; font-size: 12px; }
  .dk-topbar .theme-switch button { inline-size: 30px; }
  .dk-bell { inline-size: 36px; block-size: 36px; }
  .dk-user { gap: 4px; }
  .dk-user .dk-avatar { display: none; }
}

/* =====================================================================
   v3 — "Researcher signature": a design language taken from the field
   researcher's own tools (clipboard, ID badge, stamp, map pin, ruler).
   ===================================================================== */
@property --p { syntax: "<number>"; inherits: true; initial-value: 0; }
:root {
  --ill-brand: var(--brand); --ill-brand-soft: var(--brand-soft); --ill-accent: var(--brand2); --ill-accent-soft: var(--brand2-soft);
  --ill-warm: #eb6834; --ill-sun: #eda100; --ill-ink: #2b3445; --ill-paper: #ffffff; --ill-line: #e3e7ee; --ill-ground: #eef1f6;
  --ui-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}
@media screen and (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --ill-ink: #dfe4ec; --ill-paper: #1e2530; --ill-line: #323c4b; --ill-ground: #1a212b; } }
@media screen { :root[data-theme="dark"] { --ill-ink: #dfe4ec; --ill-paper: #1e2530; --ill-line: #323c4b; --ill-ground: #1a212b; } }
.ill { display: block; inline-size: 100%; block-size: auto; overflow: visible; }

/* ---------- Brand mark: a check inside a map pin ---------- */
.mark { inline-size: 40px; block-size: 40px; flex: none; }
.mark__pin { fill: var(--brand); }
.mark__check { fill: none; stroke: var(--brand-ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.mark:hover .mark__check, .is-in .mark__check { animation: draw 0.6s var(--ui-ease) both; }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

/* ---------- Sheet: a panel that reads like a survey form on a clipboard ---------- */
.sheet { position: relative; margin-block-start: 14px; }
.sheet::before { /* the clip */
  content: ""; position: absolute; inset-block-start: -11px; inset-inline-start: 50%; translate: -50% 0; z-index: 1;
  inline-size: 74px; block-size: 20px; border-radius: 7px 7px 10px 10px;
  background: linear-gradient(var(--dk-line-strong), var(--dk-line-strong)) center 6px / 26px 4px no-repeat, var(--dk-surface-muted);
  border: 1px solid var(--dk-line); box-shadow: 0 2px 4px rgba(16, 24, 40, 0.08);
}
[dir="rtl"] .sheet::before { translate: 50% 0; }
.sheet--ruled { background-image: repeating-linear-gradient(to bottom, transparent 0 35px, color-mix(in srgb, var(--dk-line) 30%, transparent) 35px 36px); background-position: 0 84px; }
.sheet__margin { position: absolute; inset-block: 0; inset-inline-start: 18px; inline-size: 1px; background: color-mix(in srgb, var(--st-danger) 25%, transparent); }

/* ---------- Section heading tile ---------- */
.tile { inline-size: 40px; block-size: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand-text); }
.tile .icon { inline-size: 20px; block-size: 20px; }
.tile--accent { background: var(--brand2-soft); color: var(--brand2-text); }

/* ---------- Badges v3 ---------- */
.badge { --b-c: var(--dk-muted-2); --b-bg: var(--st-neutral-bg); padding: 3px 10px; font-weight: 600; letter-spacing: 0.01em; background: var(--b-bg); color: var(--b-c); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--b-c) 18%, transparent); }
.badge--success { --b-c: var(--st-ok); --b-bg: var(--st-ok-bg); }
.badge--warning { --b-c: var(--st-warn); --b-bg: var(--st-warn-bg); }
.badge--danger { --b-c: var(--st-danger); --b-bg: var(--st-danger-bg); }
.badge--info { --b-c: var(--st-info); --b-bg: var(--st-info-bg); }
.badge--brand { --b-c: var(--brand-text); --b-bg: var(--brand-soft); }
.badge--violet { --b-c: var(--st-violet); --b-bg: var(--st-violet-bg); }
.badge--neutral { --b-c: var(--dk-muted-2); --b-bg: var(--st-neutral-bg); }
.badge--solid { --b-c: var(--brand-ink); --b-bg: var(--brand); box-shadow: none; }
.badge--outline { --b-bg: transparent; box-shadow: inset 0 0 0 1px var(--dk-line); }
.badge--lg { padding: 5px 12px; font-size: 13px; }
.badge--sm { padding: 1px 7px; font-size: 11px; }
.badge .dot { inline-size: 6px; block-size: 6px; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }
.badge__count { min-inline-size: 18px; block-size: 18px; padding-inline: 5px; margin-inline-end: -6px; border-radius: 999px; background: var(--b-c); color: var(--dk-surface); font-size: 10.5px; display: inline-grid; place-items: center; }
.badge--icon .icon { inline-size: 13px; block-size: 13px; }
.badge-split { display: inline-flex; border-radius: 999px; overflow: hidden; font-size: 11.5px; font-weight: 600; box-shadow: inset 0 0 0 1px var(--dk-line); }
.badge-split > span { padding: 3px 9px; }
.badge-split > span:first-child { background: var(--dk-surface-muted); color: var(--dk-muted-2); }
.badge-split > span:last-child { background: var(--brand-soft); color: var(--brand-text); }

/* Stamp: the review decision on a response, like a rubber stamp on paper. */
.stamp { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border: 2px solid currentColor; border-radius: 8px; font-weight: 800; font-size: 13px; letter-spacing: 0.04em; transform: rotate(-4deg); opacity: 0.9; background: color-mix(in srgb, currentColor 6%, transparent); }
.stamp .icon { inline-size: 16px; block-size: 16px; }
.stamp--ok { color: var(--st-ok); }
.stamp--no { color: var(--st-danger); transform: rotate(3deg); }
.stamp--fix { color: var(--st-warn); transform: rotate(-2deg); }
.stamp.is-in, .is-in .stamp { animation: stamp-in 0.45s var(--ui-spring) both; }
@keyframes stamp-in { from { opacity: 0; transform: scale(1.8) rotate(-12deg); } to { opacity: 0.9; } }

/* ---------- Avatars v3: steady colours per person, presence and role ---------- */
.avatar { --a1: #7c74ff; --a2: #5148e0; background: linear-gradient(140deg, var(--a1), var(--a2)); color: #fff; font-weight: 700; box-shadow: 0 0 0 2px var(--dk-surface), 0 2px 6px rgba(16, 24, 40, 0.12); text-shadow: 0 1px 1px rgba(0, 0, 0, 0.12); }
.avatar--h1 { --a1: #7c74ff; --a2: #5148e0; }
.avatar--h2 { --a1: #2bc4a8; --a2: #0f8f7c; }
.avatar--h3 { --a1: #ff9a62; --a2: #e0602b; }
.avatar--h4 { --a1: #f27aa3; --a2: #c13f6c; }
.avatar--h5 { --a1: #5aa6f5; --a2: #2a6fc9; }
.avatar--h6 { --a1: #d9a43a; --a2: #a8730d; }
.avatar--muted { --a1: var(--dk-surface-muted); --a2: var(--dk-surface-muted); color: var(--dk-muted); text-shadow: none; }
.avatar--xl { inline-size: 64px; block-size: 64px; font-size: 24px; }
.avatar--square { border-radius: 12px; }
.avatar__status { inline-size: 12px; block-size: 12px; border: 2px solid var(--dk-surface); box-shadow: none; }
.avatar__status--online { background: var(--st-ok-solid); }
.avatar__status--away { background: var(--st-warn-solid); }
.avatar__status--off { background: var(--dk-faint); }
.avatar__status--field { inline-size: 16px; block-size: 16px; display: grid; place-items: center; background: var(--brand2); inset-block-end: -2px; inset-inline-end: -2px; }
.avatar__status--field::after { content: ""; inline-size: 6px; block-size: 6px; border-radius: 50% 50% 50% 0; background: #fff; transform: rotate(-45deg); }
.avatar__status--online::before { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--st-ok-solid); animation: ping 1.8s var(--ui-ease) infinite; }
@keyframes ping { 0% { transform: scale(1); opacity: 0.8; } 80%, 100% { transform: scale(2.2); opacity: 0; } }
.avatar__role { position: absolute; inset-block-start: -4px; inset-inline-end: -6px; inline-size: 18px; block-size: 18px; border-radius: 6px; display: grid; place-items: center; background: var(--dk-surface); color: var(--brand-text); box-shadow: 0 1px 3px rgba(16, 24, 40, 0.2); }
.avatar__role .icon { inline-size: 12px; block-size: 12px; }
.avatars .avatar { transition: transform 0.2s var(--ui-spring); }
.avatars:hover .avatar { margin-inline-start: -4px; }
.avatars .avatar:hover { transform: translateY(-3px); z-index: 2; }
.avatars .avatar:first-child { margin-inline-start: 0; }

/* ---------- Researcher ID badge ---------- */
.idcard { position: relative; inline-size: 230px; padding: 30px 16px 16px; border-radius: 16px; background: var(--dk-surface); border: 1px solid var(--dk-border); box-shadow: var(--ui-shadow-lg); text-align: center; display: grid; justify-items: center; gap: 6px; transform-origin: 50% -40px; }
.idcard::before { /* lanyard */ content: ""; position: absolute; inset-block-end: 100%; inset-inline-start: 50%; translate: -50% 0; inline-size: 14px; block-size: 34px; background: repeating-linear-gradient(135deg, var(--brand) 0 6px, color-mix(in srgb, var(--brand) 75%, #000) 6px 12px); border-radius: 3px 3px 0 0; }
[dir="rtl"] .idcard::before { translate: 50% 0; }
.idcard::after { /* punch hole */ content: ""; position: absolute; inset-block-start: 10px; inset-inline-start: 50%; translate: -50% 0; inline-size: 34px; block-size: 7px; border-radius: 99px; background: var(--dk-bg); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12); }
[dir="rtl"] .idcard::after { translate: 50% 0; }
.idcard:hover { animation: swing 1.2s var(--ui-ease); }
@keyframes swing { 20% { transform: rotate(3deg); } 45% { transform: rotate(-2deg); } 70% { transform: rotate(1deg); } 100% { transform: none; } }
.idcard__band { position: absolute; inset-inline: 0; inset-block-start: 0; block-size: 58px; border-radius: 16px 16px 0 0; background: linear-gradient(135deg, var(--brand-soft), color-mix(in srgb, var(--brand2-soft) 70%, var(--brand-soft))); z-index: 0; }
.idcard > :not(.idcard__band) { position: relative; z-index: 1; }
.idcard strong { font-size: 15px; }
.idcard__role { font-size: 12px; color: var(--dk-muted); }
.idcard__code { font: 600 12px var(--font-mono); color: var(--dk-text-2); background: var(--dk-surface-muted); padding: 2px 8px; border-radius: 6px; direction: ltr; }
.idcard__stats { display: grid; grid-template-columns: repeat(3, 1fr); inline-size: 100%; gap: 4px; margin-block-start: 6px; padding-block-start: 10px; border-block-start: 1px dashed var(--dk-line); }
.idcard__stats b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
.idcard__stats small { font-size: 11px; color: var(--dk-muted); }

/* ---------- Quota ruler: progress against a target with milestone ticks ---------- */
.quota { display: grid; gap: 6px; }
.quota__head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--dk-muted); }
.quota__head b { font-size: 18px; color: var(--dk-text); font-variant-numeric: tabular-nums; }
.quota__track { position: relative; block-size: 12px; border-radius: 999px; background: var(--dk-surface-muted); overflow: hidden; }
.quota__fill { position: absolute; inset-block: 0; inset-inline-start: 0; inline-size: var(--v, 0%); border-radius: 999px; background: linear-gradient(90deg, var(--brand2), color-mix(in srgb, var(--brand2) 70%, var(--brand))); transition: inline-size 1s var(--ui-ease); }
[dir="rtl"] .quota__fill { background: linear-gradient(-90deg, var(--brand2), color-mix(in srgb, var(--brand2) 70%, var(--brand))); }
.quota__fill::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent); background-size: 50% 100%; background-repeat: no-repeat; animation: sheen 2.4s linear infinite; }
@keyframes sheen { from { background-position: -60% 0; } to { background-position: 160% 0; } }
.quota__ticks { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(25% - 1px), color-mix(in srgb, var(--dk-surface) 85%, transparent) calc(25% - 1px) 25%); pointer-events: none; }
.quota__scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--dk-faint); font-variant-numeric: tabular-nums; }
.ui-reveal:not(.is-in) .quota__fill, .ui-reveal:not(.is-in) .progress__bar span { inline-size: 0 !important; }
.progress__bar span { transition: inline-size 1s var(--ui-ease); }

/* Ring fill animates from 0 to its value (@property --p). */
.ring { transition: --p 1.1s var(--ui-ease); }
.ui-reveal:not(.is-in) .ring { --p: 0 !important; }
@media screen and (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --ill-abaya: #3a4155; --ill-cloth2: #aab3c2; } }
@media screen { :root[data-theme="dark"] { --ill-abaya: #3a4155; --ill-cloth2: #aab3c2; } }

/* ---------- Question chips and answer completeness ---------- */
.q-chip { display: inline-grid; place-items: center; min-inline-size: 30px; block-size: 24px; padding-inline: 7px; border-radius: 7px; background: var(--brand-soft); color: var(--brand-text); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.answer-dots { display: inline-flex; gap: 3px; align-items: center; }
.answer-dots i { inline-size: 7px; block-size: 7px; border-radius: 2px; background: var(--st-ok-solid); }
.answer-dots i.is-skip { background: var(--dk-line-strong); }
.answer-dots i.is-flag { background: var(--st-warn-solid); }
.geo { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 7px; border-radius: 8px; background: var(--dk-surface-muted); font: 500 12px var(--font-mono); color: var(--dk-text-2); direction: ltr; }
.geo .icon { inline-size: 14px; block-size: 14px; color: var(--st-danger); }

/* ---------- Hero banner ---------- */
.hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; gap: 24px; padding: 28px 32px; border-radius: 20px; background: linear-gradient(135deg, var(--brand-soft) 0%, color-mix(in srgb, var(--brand2-soft) 60%, var(--dk-surface)) 100%); border: 1px solid var(--dk-border); }
.hero__bg { position: absolute; inset: 0; opacity: 0.55; pointer-events: none; }
.hero__text { position: relative; display: grid; gap: 10px; }
.hero__kicker { display: inline-flex; align-items: center; gap: 8px; inline-size: fit-content; padding: 4px 12px; border-radius: 999px; background: var(--dk-surface); color: var(--brand-text); font-size: 12.5px; font-weight: 600; box-shadow: var(--dk-shadow); }
.hero h2 { margin: 0; font-size: 28px; font-weight: 800; line-height: 1.35; color: var(--dk-text); }
.hero h2 em { font-style: normal; color: var(--brand-text); }
.hero p { margin: 0; color: var(--dk-muted-2); font-size: 14.5px; max-inline-size: 52ch; }
.hero__facts { display: flex; flex-wrap: wrap; gap: 18px; margin-block-start: 6px; }
.hero__facts div { display: grid; }
.hero__facts b { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--dk-text); }
.hero__facts small { font-size: 12px; color: var(--dk-muted); }
.hero__art { position: relative; max-inline-size: 460px; justify-self: end; inline-size: 100%; }
@media (max-width: 900px) { .hero { grid-template-columns: minmax(0, 1fr); padding: 22px; } .hero__art { justify-self: center; max-inline-size: 360px; } .hero h2 { font-size: 22px; } }

/* Illustration motion hooks. Rules must target the class alone: page selectors
   with an ancestor outside the <use> shadow tree do not reach the clones. */
.ill-float { animation: float 5s ease-in-out infinite; transform-box: fill-box; }
.ill-pin { animation: pin-drop 0.8s var(--ui-spring) both, bob 3.6s 0.8s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
.ill-pin:nth-of-type(2) { animation-delay: 0.2s, 1s; } .ill-pin:nth-of-type(3) { animation-delay: 0.4s, 1.2s; }
.ill-pulse { animation: ill-ping 2.4s var(--ui-ease) infinite; transform-box: fill-box; transform-origin: center; }
.ill-check { stroke-dasharray: 1; animation: draw 0.9s 0.4s var(--ui-ease) both; }
.ill-bar { animation: grow 0.9s 0.2s var(--ui-ease) both; transform-box: fill-box; transform-origin: 50% 100%; }
.ill-bar:nth-of-type(2) { animation-delay: 0.3s; } .ill-bar:nth-of-type(3) { animation-delay: 0.4s; } .ill-bar:nth-of-type(4) { animation-delay: 0.5s; }
.ill-blink { animation: twinkle 2.8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.ill-blink:nth-of-type(2n) { animation-delay: 0.9s; } .ill-blink:nth-of-type(3n) { animation-delay: 1.7s; }
@keyframes bob { 50% { transform: translateY(-3px); } }
@keyframes ill-ping { 0% { transform: scale(0.8); opacity: 0.7; } 100% { transform: scale(1.6); opacity: 0; } }
@keyframes float { 50% { transform: translateY(-6px); } }
@keyframes pin-drop { from { transform: translateY(-40px) scale(0.6); opacity: 0; } 60% { opacity: 1; } to { transform: none; } }
@keyframes grow { from { transform: scaleY(0); } to { transform: none; } }
@keyframes twinkle { 50% { transform: scale(0.5); opacity: 0.3; } }

/* ---------- Empty states v3: illustration + a clear next step ---------- */
.empty { display: grid; justify-items: center; gap: 6px; padding: 28px 18px 30px; text-align: center; }
.empty .ill { inline-size: min(220px, 70%); margin-block-end: 8px; }
.empty h3 { margin: 0; font-size: 17px; font-weight: 700; }
.empty p { margin: 0 0 12px; font-size: 13.5px; color: var(--dk-muted); max-inline-size: 40ch; line-height: 1.7; }
.empty__actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.empty__tips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-block-start: 10px; }
.empty__tips span { font-size: 12px; color: var(--dk-muted-2); background: var(--dk-surface-muted); border-radius: 999px; padding: 3px 10px; }

/* ---------- Tabs: one sliding indicator (ui-kit.js positions it) ---------- */
.tabs { position: relative; }
.tabs.has-ink [role="tab"]::after { display: none; }
.tabs__ink { position: absolute; inset-block-end: -1px; block-size: 2px; border-radius: 2px; background: var(--brand); transition: inset-inline-start 0.3s var(--ui-ease), inline-size 0.3s var(--ui-ease); }
.tabs--pills .tabs__ink { inset-block: 0; block-size: auto; border-radius: 999px; background: var(--brand-soft); z-index: 0; }
.tabs--pills.has-ink [role="tab"] { position: relative; z-index: 1; background: transparent !important; }

/* ---------- Toast timer ---------- */
.toast { position: relative; overflow: hidden; animation: toast-in 0.35s var(--ui-spring); }
.toast__timer { position: absolute; inset-inline: 0; inset-block-end: 0; block-size: 3px; background: currentColor; opacity: 0.35; transform-origin: right; animation: timer 6s linear forwards; }
[dir="ltr"] .toast__timer { transform-origin: left; }
@keyframes timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.toast--success .toast__timer { color: #4ad39b; } .toast--danger .toast__timer { color: #ff8a8a; } .toast--info .toast__timer { color: #7aaef2; }

/* Switch knob springs; checkbox ticks pop. */
input[role="switch"]::after { transition: transform 0.3s var(--ui-spring), inline-size 0.2s; }
input[role="switch"]:active::after { inline-size: 20px; }
input[type="checkbox"]:not([role="switch"])::before { transition: transform 0.25s var(--ui-spring); }

/* Page background motif behind the content (very light). */
.kit { position: relative; }
.bg-motif { position: fixed; inset: 0; z-index: -1; opacity: 0.5; pointer-events: none; }

/* =====================================================================
   Inputs v4: one frame per control. Icons, units, prefixes and buttons sit
   inside a single bordered box, so RTL/LTR corners can never break apart.
   ===================================================================== */
.control {
  --c-h: 44px;
  display: flex; align-items: center; min-block-size: var(--c-h); inline-size: 100%;
  border: 1px solid var(--dk-line); border-radius: 12px; background: var(--dk-surface);
  transition: border-color var(--ui-fast), box-shadow var(--ui-fast), background-color var(--ui-fast);
  overflow: hidden;
}
.control:hover { border-color: var(--dk-line-strong); }
.control:focus-within { border-color: var(--brand); box-shadow: var(--ui-ring); }
:is(.dk-main, .drawer, .dialog) .field .control > input,
:is(.dk-main, .drawer, .dialog) .field .control > select,
.control > input, .control > select {
  flex: 1 1 auto; inline-size: 1%; min-inline-size: 0; block-size: calc(var(--c-h) - 2px) !important; min-block-size: 0;
  border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background-color: transparent;
  padding-inline: 12px; font: inherit; font-size: 14.5px; color: var(--dk-text); outline: none;
}
.control > input::placeholder { color: var(--dk-faint); }
.control__icon { display: grid; place-items: center; padding-inline-start: 13px; color: var(--dk-faint); transition: color var(--ui-fast); }
.control__icon .icon { inline-size: 18px; block-size: 18px; }
.control__icon + input { padding-inline-start: 9px; }
.control:focus-within .control__icon { color: var(--brand-text); }
.control__unit, .control__prefix { display: flex; align-items: center; align-self: stretch; padding-inline: 12px; background: var(--dk-surface-2); color: var(--dk-muted); font-size: 13px; white-space: nowrap; }
.control__unit { border-inline-start: 1px solid var(--dk-border); }
.control__prefix { border-inline-end: 1px solid var(--dk-border); direction: ltr; font-variant-numeric: tabular-nums; gap: 6px; }
.control__btn { display: grid; place-items: center; inline-size: 32px; block-size: 32px; margin-inline-end: 6px; border: 0; border-radius: 8px; background: transparent; color: var(--dk-faint); cursor: pointer; flex: none; transition: background-color var(--ui-fast), color var(--ui-fast), opacity var(--ui-fast), transform var(--ui-fast); }
.control__btn:hover { background: var(--dk-hover); color: var(--dk-text); }
.control__btn .icon { inline-size: 17px; block-size: 17px; }
.control__btn[data-clear] { opacity: 0; pointer-events: none; transform: scale(0.7); }
.control.has-value .control__btn[data-clear] { opacity: 1; pointer-events: auto; transform: none; }
.control .kbd { margin-inline-end: 10px; }
.control.has-value .kbd { display: none; }
/* Stepper − / + */
.control__step { display: grid; place-items: center; align-self: stretch; inline-size: 42px; border: 0; background: var(--dk-surface-2); color: var(--dk-text-2); font-size: 18px; font-weight: 600; cursor: pointer; transition: background-color var(--ui-fast), color var(--ui-fast); }
.control__step:first-child { border-inline-end: 1px solid var(--dk-border); }
.control__step:hover { background: var(--brand-soft); color: var(--brand-text); }
.control__step:active { transform: scale(0.94); }
.control--center > input { text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.control > input[dir="ltr"] { text-align: start; }
[dir="rtl"] .control > input[dir="ltr"] { text-align: right; }
.control--mono > input { font-family: var(--font-mono); letter-spacing: 0.06em; }
/* States */
.field--invalid .control { border-color: var(--st-danger); background: var(--st-field-bad-bg); }
.field--invalid .control:focus-within { box-shadow: var(--ui-ring-danger); }
.field--valid .control { border-color: var(--st-ok-line); }
.field--valid .control__icon { color: var(--st-ok); }
.control:has(> input:disabled) { background: var(--dk-surface-muted); border-style: dashed; }
.control:has(> input:disabled) > input { color: var(--dk-muted); cursor: not-allowed; }
.control:has(> input[readonly]) { background: var(--dk-surface-2); }
.field.is-shaking .control { animation: shake 0.4s var(--ui-ease); }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.field__status { min-block-size: 18px; }
.field label { transition: color var(--ui-fast); }
.field:focus-within > label, .field:focus-within .field__label-row label { color: var(--brand-text); }
.field__error, .field__success { animation: ui-rise 0.25s var(--ui-ease); }

/* Password strength */
.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-block-start: 8px; }
.strength i { block-size: 4px; border-radius: 4px; background: var(--dk-surface-muted); transition: background-color 0.3s var(--ui-ease); }
.strength[data-level="1"] i:nth-child(-n+1) { background: var(--st-danger-solid); }
.strength[data-level="2"] i:nth-child(-n+2) { background: var(--st-warn-solid); }
.strength[data-level="3"] i:nth-child(-n+3) { background: var(--brand2); }
.strength[data-level="4"] i { background: var(--st-ok-solid); }
.rules { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; font-size: 12px; color: var(--dk-muted); }
.rules li { display: flex; align-items: center; gap: 6px; transition: color var(--ui-fast); }
.rules li::before { content: ""; inline-size: 14px; block-size: 14px; border-radius: 50%; border: 1.5px solid var(--dk-line-strong); flex: none; transition: all 0.25s var(--ui-spring); }
.rules li.is-ok { color: var(--st-ok); }
.rules li.is-ok::before { border-color: var(--st-ok-solid); background: var(--st-ok-solid) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5'/%3E%3C/svg%3E") center / 10px no-repeat; }

/* Quick choices under a field (date shortcuts, suggestions) */
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-block-start: 8px; }
.quick button { border: 1px dashed var(--dk-line-strong); background: transparent; color: var(--dk-muted-2); font: inherit; font-size: 12px; padding: 3px 10px; border-radius: 999px; cursor: pointer; transition: all var(--ui-fast); }
.quick button:hover, .quick button[aria-pressed="true"] { border-style: solid; border-color: var(--brand); color: var(--brand-text); background: var(--brand-soft); }

/* Combobox: a select with search and rich options */
.combo { position: relative; }
.combo__trigger { inline-size: 100%; display: flex; align-items: center; gap: 10px; min-block-size: 44px; padding-inline: 12px 10px; border: 1px solid var(--dk-line); border-radius: 12px; background: var(--dk-surface); color: var(--dk-text); font: inherit; font-size: 14.5px; cursor: pointer; text-align: start; transition: border-color var(--ui-fast), box-shadow var(--ui-fast); }
.combo__trigger:hover { border-color: var(--dk-line-strong); }
.combo__trigger[aria-expanded="true"] { border-color: var(--brand); box-shadow: var(--ui-ring); }
.combo__trigger .combo__value { flex: 1; min-inline-size: 0; display: flex; align-items: center; gap: 8px; }
.combo__trigger .combo__placeholder { color: var(--dk-faint); }
.combo__trigger > .icon { inline-size: 18px; block-size: 18px; color: var(--dk-faint); transition: transform 0.2s var(--ui-ease); }
.combo__trigger[aria-expanded="true"] > .icon { transform: rotate(180deg); }
.combo__pop { position: absolute; z-index: 40; inset-inline: 0; inset-block-start: calc(100% + 6px); padding: 6px; border: 1px solid var(--dk-border); border-radius: 14px; background: var(--dk-surface); box-shadow: var(--ui-shadow-lg); animation: ui-pop 0.16s var(--ui-ease); transform-origin: top; }
.combo__pop[hidden] { display: none; }
.combo__search { display: flex; align-items: center; gap: 8px; padding: 4px 8px 8px; border-block-end: 1px solid var(--dk-border); margin-block-end: 4px; color: var(--dk-faint); }
.combo__search input { flex: 1; border: 0; background: transparent; font: inherit; font-size: 14px; color: var(--dk-text); outline: none; min-block-size: 32px; }
.combo__search .icon { inline-size: 16px; block-size: 16px; }
.combo__list { list-style: none; margin: 0; padding: 0; max-block-size: 240px; overflow-y: auto; display: grid; gap: 2px; }
.combo__list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; font-size: 14px; }
.combo__list li:hover, .combo__list li.is-active { background: var(--dk-hover); }
.combo__list li[aria-selected="true"] { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
.combo__list li[aria-selected="true"]::after { content: "✓"; margin-inline-start: auto; }
.combo__list li small { display: block; font-size: 12px; color: var(--dk-muted); font-weight: 400; }
.combo__list li[hidden] { display: none; }
.combo__empty { padding: 14px; text-align: center; font-size: 13px; color: var(--dk-muted); }

/* Auto-growing textarea */
textarea[data-autogrow] { overflow: hidden; resize: none !important; transition: block-size 0.12s ease; }

/* ---------- Survey answer inputs (what respondents use) ---------- */
.likert { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.likert label { position: relative; display: grid; justify-items: center; gap: 6px; padding: 12px 6px 10px; border: 1.5px solid var(--dk-line); border-radius: 14px; background: var(--dk-surface); cursor: pointer; font-size: 12px; color: var(--dk-muted-2); text-align: center; transition: all 0.2s var(--ui-ease); }
.likert label:hover { border-color: var(--dk-line-strong); transform: translateY(-2px); }
.likert input { position: absolute; opacity: 0; }
.likert .face { inline-size: 34px; block-size: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--dk-surface-muted); transition: all 0.25s var(--ui-spring); }
.likert .face svg { inline-size: 22px; block-size: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.likert label:has(input:checked) { border-color: var(--lk); color: var(--dk-text); font-weight: 600; background: color-mix(in srgb, var(--lk) 9%, var(--dk-surface)); }
.likert label:has(input:checked) .face { background: var(--lk); color: #fff; transform: scale(1.12); }
.likert label:has(input:focus-visible) { box-shadow: var(--ui-ring); }
.likert label:nth-child(1) { --lk: #d0393b; } .likert label:nth-child(2) { --lk: #eb6834; } .likert label:nth-child(3) { --lk: #b2a100; }
.likert label:nth-child(4) { --lk: #1baf7a; } .likert label:nth-child(5) { --lk: #12744f; }

.stars { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.stars input { position: absolute; opacity: 0; }
.stars label { cursor: pointer; color: var(--dk-line-strong); transition: color var(--ui-fast), transform 0.2s var(--ui-spring); }
.stars label svg { inline-size: 30px; block-size: 30px; fill: currentColor; }
.stars label:hover, .stars label:hover ~ label, .stars input:checked ~ label { color: #f5b400; }
.stars label:hover { transform: scale(1.18) rotate(-6deg); }
[dir="ltr"] .stars { flex-direction: row-reverse; }

.nps { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 4px; }
.nps label { position: relative; display: grid; place-items: center; block-size: 40px; border-radius: 10px; border: 1px solid var(--dk-line); background: var(--dk-surface); font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; cursor: pointer; transition: all 0.2s var(--ui-ease); }
.nps input { position: absolute; opacity: 0; }
.nps label:hover { transform: translateY(-2px); border-color: var(--nc); color: var(--nc); }
.nps label:has(input:checked) { background: var(--nc); border-color: var(--nc); color: #fff; transform: translateY(-2px) scale(1.06); box-shadow: 0 6px 14px color-mix(in srgb, var(--nc) 35%, transparent); }
.nps label:nth-child(-n+7) { --nc: #d0393b; } .nps label:nth-child(8), .nps label:nth-child(9) { --nc: #d08a00; } .nps label:nth-child(n+10) { --nc: #12744f; }
.nps__legend { display: flex; justify-content: space-between; margin-block-start: 6px; font-size: 12px; color: var(--dk-muted); }

.yesno { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.yesno label { display: flex; align-items: center; justify-content: center; gap: 8px; min-block-size: 48px; border: 1.5px solid var(--dk-line); border-radius: 14px; cursor: pointer; font-weight: 600; transition: all 0.2s var(--ui-ease); }
.yesno input { position: absolute; opacity: 0; }
.yesno label:first-child:has(input:checked) { border-color: var(--st-ok-solid); background: var(--st-ok-bg); color: var(--st-ok); }
.yesno label:last-child:has(input:checked) { border-color: var(--st-danger-solid); background: var(--st-danger-bg); color: var(--st-danger); }
.yesno .icon { inline-size: 18px; block-size: 18px; }

.slider { position: relative; padding-block-start: 30px; }
.slider input[type="range"] { -webkit-appearance: none; appearance: none; inline-size: 100%; block-size: 8px; border-radius: 999px; background: linear-gradient(to left, var(--brand) var(--fill, 50%), var(--dk-surface-muted) var(--fill, 50%)); outline: none; margin: 0; }
[dir="ltr"] .slider input[type="range"] { background: linear-gradient(to right, var(--brand) var(--fill, 50%), var(--dk-surface-muted) var(--fill, 50%)); }
.slider input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; inline-size: 22px; block-size: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--brand); box-shadow: 0 2px 6px rgba(16, 24, 40, 0.2); cursor: grab; transition: transform 0.2s var(--ui-spring); }
.slider input[type="range"]::-moz-range-thumb { inline-size: 18px; block-size: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--brand); cursor: grab; }
.slider input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.2); cursor: grabbing; }
.slider input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: var(--ui-ring); }
.slider__bubble { position: absolute; inset-block-start: 0; inset-inline-start: var(--fill, 50%); translate: 50% 0; padding: 2px 9px; border-radius: 8px; background: var(--dk-ink-bg); color: #fff; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none; }
[dir="ltr"] .slider__bubble { translate: -50% 0; }
.slider__scale { display: flex; justify-content: space-between; margin-block-start: 8px; font-size: 12px; color: var(--dk-muted); }

.geo-capture { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px; border: 1.5px dashed var(--dk-line-strong); border-radius: 14px; }
.geo-capture.is-done { border-style: solid; border-color: var(--st-ok-line); background: var(--st-ok-bg); }
.geo-capture__note { font-size: 12.5px; color: var(--dk-muted); flex: 1; min-inline-size: 160px; }

.otp { display: flex; gap: 8px; direction: ltr; justify-content: center; }
.otp input { inline-size: 48px; block-size: 56px; text-align: center; font: 700 22px var(--font-mono); border: 1.5px solid var(--dk-line); border-radius: 12px; background: var(--dk-surface); color: var(--dk-text); transition: all 0.2s var(--ui-ease); }
.otp input:focus { outline: none; border-color: var(--brand); box-shadow: var(--ui-ring); transform: translateY(-2px); }
.otp input.is-filled { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-text); }
.otp.is-done input { border-color: var(--st-ok-solid); background: var(--st-ok-bg); color: var(--st-ok); animation: ui-pop 0.3s var(--ui-spring); }
.otp-sep { align-self: center; color: var(--dk-faint); }
.answer-q { display: grid; gap: 10px; padding-block: 16px; border-block-end: 1px dashed var(--dk-line); }
.answer-q:last-child { border-block-end: 0; }
.answer-q__title { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: 14.5px; }
.field-group { display: grid; gap: 0 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.field-group__title { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; font-size: 13px; font-weight: 700; color: var(--dk-text-2); }
.field-group__title::after { content: ""; flex: 1; block-size: 1px; background: var(--dk-border); }
@media (max-width: 640px) { .likert { grid-template-columns: repeat(5, minmax(56px, 1fr)); overflow-x: auto; } .nps { grid-template-columns: repeat(6, 1fr); } .rules { grid-template-columns: 1fr; } }

/* =====================================================================
   Softer progress palette (user feedback: same colours, gentler).
   ===================================================================== */
:root {
  --soft-ok-a: #5fd3a8; --soft-ok-b: #2bb383;
  --soft-warn-a: #ffc56b; --soft-warn-b: #f5a03a;
  --soft-danger-a: #ff9b9b; --soft-danger-b: #f06b6b;
  --soft-brand-a: color-mix(in srgb, var(--brand) 60%, #fff); --soft-brand-b: var(--brand);
  --soft-teal-a: #6fe0d2; --soft-teal-b: #1fb5a6;
  --track: color-mix(in srgb, var(--dk-surface-muted) 70%, var(--dk-surface));
}
.progress__bar, .quota__track { background: var(--track); }
.progress__bar span { background: linear-gradient(90deg, var(--soft-teal-b), var(--soft-teal-a)); }
[dir="rtl"] .progress__bar span { background: linear-gradient(-90deg, var(--soft-teal-b), var(--soft-teal-a)); }
.progress--ok .progress__bar span { background: linear-gradient(-90deg, var(--soft-ok-b), var(--soft-ok-a)); }
.progress--warn .progress__bar span { background: linear-gradient(-90deg, var(--soft-warn-b), var(--soft-warn-a)); }
.progress--danger .progress__bar span { background: linear-gradient(-90deg, var(--soft-danger-b), var(--soft-danger-a)); }
.progress--brand .progress__bar span { background: linear-gradient(-90deg, var(--soft-brand-b), var(--soft-brand-a)); }
[dir="ltr"] .progress--ok .progress__bar span { background: linear-gradient(90deg, var(--soft-ok-b), var(--soft-ok-a)); }
[dir="ltr"] .progress--warn .progress__bar span { background: linear-gradient(90deg, var(--soft-warn-b), var(--soft-warn-a)); }
.ring { background: radial-gradient(closest-side, var(--dk-surface) 78%, transparent 80% 100%), conic-gradient(var(--c) calc(var(--p) * 1%), var(--track) 0); }
.ring--ok { --c: var(--soft-ok-b); } .ring--warn { --c: var(--soft-warn-b); } .ring--brand { --c: var(--soft-brand-b); } .ring--teal { --c: var(--soft-teal-b); }
.ring small { display: block; font-size: 10px; font-weight: 500; color: var(--dk-muted); margin-block-start: -2px; }
.ring-item { display: grid; justify-items: center; gap: 8px; font-size: 12.5px; color: var(--dk-muted-2); }
.region-list { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.region-list li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: center; }
.region-list .tile { inline-size: 34px; block-size: 34px; border-radius: 10px; }
.region-list .tile .icon { inline-size: 17px; block-size: 17px; }
.region-list__head { display: flex; justify-content: space-between; font-size: 13px; margin-block-end: 6px; }
.region-list__head b { font-weight: 600; color: var(--dk-text); }
.region-list__head span { color: var(--dk-muted); font-variant-numeric: tabular-nums; }

/* =====================================================================
   Upload v2: inviting drop area, type chips, animated drag state, rich file rows.
   ===================================================================== */
.upload { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 20px; padding: 22px 24px; border-radius: 18px; cursor: pointer;
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--brand-soft) 70%, transparent), transparent 60%), var(--dk-surface-2);
  transition: background-color 0.2s, transform 0.2s var(--ui-ease); }
.upload::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: repeating-linear-gradient(90deg, var(--dk-line-strong) 0 8px, transparent 8px 14px) top / 100% 1.5px no-repeat,
              repeating-linear-gradient(90deg, var(--dk-line-strong) 0 8px, transparent 8px 14px) bottom / 100% 1.5px no-repeat,
              repeating-linear-gradient(0deg, var(--dk-line-strong) 0 8px, transparent 8px 14px) left / 1.5px 100% no-repeat,
              repeating-linear-gradient(0deg, var(--dk-line-strong) 0 8px, transparent 8px 14px) right / 1.5px 100% no-repeat; }
.upload:hover::before, .upload.is-over::before { background:
  repeating-linear-gradient(90deg, var(--brand) 0 8px, transparent 8px 14px) top / 100% 1.5px no-repeat,
  repeating-linear-gradient(90deg, var(--brand) 0 8px, transparent 8px 14px) bottom / 100% 1.5px no-repeat,
  repeating-linear-gradient(0deg, var(--brand) 0 8px, transparent 8px 14px) left / 1.5px 100% no-repeat,
  repeating-linear-gradient(0deg, var(--brand) 0 8px, transparent 8px 14px) right / 1.5px 100% no-repeat; }
.upload.is-over::before { animation: ants 0.6s linear infinite; }
@keyframes ants { to { background-position: 14px 0, -14px 100%, 0 -14px, 100% 14px; } }
.upload.is-over { transform: scale(1.01); background-color: var(--brand-soft); }
.upload:focus-visible { outline: none; box-shadow: var(--ui-ring); }
.upload__art { position: relative; inline-size: 96px; block-size: 84px; }
.upload__art svg { inline-size: 100%; block-size: 100%; overflow: visible; }
.upload__cloud { fill: var(--dk-surface); stroke: var(--brand); stroke-width: 2; }
.upload__arrow { stroke: var(--brand); stroke-width: 2.6; fill: none; stroke-linecap: round; stroke-linejoin: round; animation: up 1.6s ease-in-out infinite; }
.upload.is-over .upload__arrow { animation-duration: 0.6s; }
@keyframes up { 0%, 100% { transform: translateY(2px); } 50% { transform: translateY(-4px); } }
.upload__doc { animation: float 4s ease-in-out infinite; transform-box: fill-box; }
.upload__doc--b { animation-delay: 1.2s; }
.upload__text strong { display: block; font-size: 15.5px; color: var(--dk-text); }
.upload__text p { margin: 2px 0 10px; font-size: 13px; color: var(--dk-muted); }
.upload__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.upload__types { display: flex; gap: 6px; flex-wrap: wrap; }
.ftype { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px; font: 700 10.5px var(--font-mono); letter-spacing: 0.04em; direction: ltr; }
.ftype--xlsx { background: #e3f6ec; color: #16794b; } .ftype--csv { background: #e6f1ff; color: #2563c4; } .ftype--pdf { background: #fdebea; color: #c23a35; } .ftype--docx { background: #e8edff; color: #3a55c8; } .ftype--img { background: #fff1e0; color: #b8631a; }
@media screen and (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ftype { background: var(--dk-surface-muted); } }
.upload input[type="file"] { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; pointer-events: none; }
@media (max-width: 640px) { .upload { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; } .upload__row { justify-content: center; } }

.files { gap: 10px; margin-block-start: 12px; }
.file { grid-template-columns: 42px minmax(0, 1fr) auto; padding: 12px 14px; border-radius: 14px; animation: ui-rise 0.3s var(--ui-ease); transition: border-color 0.2s, background-color 0.2s; }
.file__icon { inline-size: 42px; block-size: 46px; border-radius: 8px; position: relative; display: grid; place-items: end center; padding-block-end: 6px; font: 800 9px var(--font-mono); letter-spacing: 0.04em; color: #fff; background: var(--ft, #5b6574); clip-path: polygon(0 0, 72% 0, 100% 22%, 100% 100%, 0 100%); }
.file__icon::after { content: ""; position: absolute; inset-block-start: 0; inset-inline-end: 0; inline-size: 28%; block-size: 22%; background: rgba(255, 255, 255, 0.35); }
[dir="rtl"] .file__icon { clip-path: polygon(28% 0, 100% 0, 100% 100%, 0 100%, 0 22%); }
.file--xlsx .file__icon { --ft: #1f9d61; } .file--csv .file__icon { --ft: #2f7be0; } .file--pdf .file__icon { --ft: #e0534d; } .file--docx .file__icon { --ft: #4b67e0; } .file--img .file__icon { --ft: #e08a2f; }
.file__top { display: flex; justify-content: space-between; gap: 10px; }
.file__meta { display: flex; gap: 8px; align-items: center; }
.file__state { font-size: 12px; font-weight: 600; color: var(--brand-text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.file.is-done { border-color: var(--st-ok-line); }
.file.is-done .file__state { color: var(--st-ok); }
.file.is-error { border-color: var(--st-danger-line); background: var(--st-field-bad-bg); }
.file.is-error .file__state { color: var(--st-danger); }
.file .progress__bar { block-size: 5px; }
.file.is-done .progress__bar { display: none; }
.file__actions { display: flex; gap: 2px; }

/* Panels side by side keep their own height (no empty stretched space). */
.kit-grid { align-items: start; }

/* Banner: soft, light, brand-tinted (user feedback: no heavy dark fill). */
.banner { background: linear-gradient(135deg, var(--brand-soft), color-mix(in srgb, var(--brand2-soft) 55%, var(--brand-soft))); color: var(--dk-text); border: 1px solid color-mix(in srgb, var(--brand) 14%, transparent); }
.banner > .icon { inline-size: 40px; block-size: 40px; padding: 10px; border-radius: 12px; background: var(--dk-surface); color: var(--brand-text); box-shadow: var(--dk-shadow); }
.banner__text { color: var(--dk-muted-2); }
.banner__text strong { color: var(--dk-text); }
.banner .button { background: var(--dk-surface); color: var(--brand-text); box-shadow: var(--dk-shadow); }
.banner .button:hover { background: var(--dk-surface); filter: brightness(0.98); }
.banner__close { margin-inline-start: -4px; color: var(--dk-muted); }

/* Publish readiness: ring summary + one tidy row per item. */
.publish { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 24px; align-items: start; margin-block-start: 14px; }
.publish__summary { display: grid; justify-items: center; gap: 10px; padding: 18px 12px; border-radius: 16px; background: var(--dk-surface-2); border: 1px solid var(--dk-border); text-align: center; }
.publish__summary strong { font-size: 14px; }
.publish__summary span { font-size: 12px; color: var(--dk-muted); line-height: 1.6; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checklist li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--dk-border); background: var(--dk-surface); transition: border-color var(--ui-fast), background-color var(--ui-fast); }
.checklist__icon { inline-size: 30px; block-size: 30px; border-radius: 50%; display: grid; place-items: center; }
.checklist__icon .icon { inline-size: 16px; block-size: 16px; }
.checklist li.is-ok .checklist__icon { background: var(--st-ok-bg); color: var(--st-ok); }
.checklist li.is-todo { border-color: color-mix(in srgb, var(--st-warn) 30%, var(--dk-border)); background: color-mix(in srgb, var(--st-warn-bg) 45%, var(--dk-surface)); }
.checklist li.is-todo .checklist__icon { background: var(--st-warn-bg); color: var(--st-warn); }
.checklist__text strong { display: block; font-size: 13.5px; font-weight: 600; color: var(--dk-text); }
.checklist__text span { display: block; font-size: 12px; color: var(--dk-muted); }
.publish__foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-block-start: 14px; padding-block-start: 14px; border-block-start: 1px dashed var(--dk-line); }
.publish__foot .kit-note { margin: 0; display: inline-flex; align-items: center; gap: 6px; }
.publish__foot .kit-note .icon { inline-size: 15px; block-size: 15px; color: var(--st-warn); }
@media (max-width: 760px) { .publish { grid-template-columns: minmax(0, 1fr); } }

/* =====================================================================
   Ornaments: the project's visual signature (topographic contours of the
   field, an eight-point star, a dotted route ending in a pin, the pin-check
   watermark). Drawn with CSS masks, so they take the brand colour in both themes.
   ===================================================================== */
:root { --orn-topo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 420 300'%3E%3Cg fill='none' stroke='black' stroke-width='1.2'%3E%3Cpath d='M146.6 190.0 L147.4 191.9 L147.5 193.9 L146.9 195.8 L145.6 197.4 L143.8 198.9 L141.7 200.0 L139.6 201.0 L137.5 201.7 L135.5 202.4 L133.7 203.1 L132.0 203.8 L130.4 204.5 L128.8 205.1 L127.2 205.7 L125.4 206.1 L123.6 206.3 L121.8 206.3 L120.0 206.1 L118.3 205.8 L116.6 205.4 L114.9 205.1 L113.2 205.0 L111.3 204.9 L109.2 204.9 L107.0 204.9 L104.6 204.7 L102.2 204.2 L100.0 203.4 L98.2 202.2 L96.9 200.7 L96.3 198.8 L96.3 196.9 L96.8 195.0 L97.7 193.1 L98.7 191.5 L99.8 190.0 L100.6 188.6 L101.0 187.3 L101.2 186.0 L101.2 184.5 L101.0 182.9 L101.0 181.2 L101.2 179.5 L101.8 177.8 L102.8 176.2 L104.2 174.9 L105.9 173.9 L107.9 173.2 L109.9 172.7 L112.0 172.3 L114.0 172.1 L116.0 171.9 L118.0 171.7 L120.0 171.6 L122.0 171.5 L124.0 171.7 L126.0 172.1 L127.8 172.8 L129.4 173.9 L130.7 175.2 L131.7 176.6 L132.5 178.1 L133.1 179.5 L133.8 180.7 L134.6 181.8 L135.8 182.7 L137.3 183.6 L139.1 184.4 L141.2 185.5 L143.3 186.7 L145.2 188.2Z'/%3E%3Cpath d='M176.2 190.0 L177.9 194.1 L178.1 198.2 L176.7 202.2 L174.0 205.7 L170.2 208.7 L165.8 211.2 L161.3 213.1 L156.9 214.7 L152.7 216.2 L148.9 217.6 L145.4 219.1 L142.0 220.5 L138.6 222.0 L135.1 223.2 L131.4 224.0 L127.6 224.4 L123.8 224.4 L120.0 223.9 L116.4 223.3 L112.8 222.6 L109.3 222.0 L105.6 221.6 L101.6 221.5 L97.2 221.5 L92.5 221.5 L87.4 221.0 L82.4 220.0 L77.8 218.3 L74.0 215.8 L71.3 212.5 L69.9 208.7 L69.9 204.6 L71.0 200.5 L72.9 196.6 L75.1 193.1 L77.3 190.0 L79.0 187.1 L80.0 184.4 L80.4 181.5 L80.2 178.4 L80.0 175.1 L79.9 171.5 L80.3 167.8 L81.5 164.2 L83.7 160.9 L86.6 158.2 L90.3 156.0 L94.4 154.5 L98.7 153.4 L103.0 152.7 L107.3 152.2 L111.6 151.8 L115.8 151.4 L120.0 151.1 L124.3 151.0 L128.5 151.3 L132.7 152.2 L136.5 153.8 L139.8 156.0 L142.6 158.7 L144.7 161.7 L146.4 164.9 L147.7 167.8 L149.1 170.5 L150.9 172.7 L153.3 174.6 L156.5 176.4 L160.4 178.2 L164.7 180.4 L169.2 183.1 L173.1 186.3Z'/%3E%3Cpath d='M205.8 190.0 L208.4 196.2 L208.6 202.5 L206.5 208.5 L202.4 214.0 L196.6 218.6 L190.0 222.3 L183.0 225.3 L176.2 227.8 L170.0 230.0 L164.2 232.1 L158.8 234.4 L153.6 236.6 L148.4 238.8 L143.0 240.6 L137.4 242.0 L131.6 242.6 L125.7 242.5 L120.0 241.8 L114.4 240.8 L109.0 239.7 L103.7 238.8 L98.0 238.3 L92.0 238.1 L85.3 238.1 L78.0 238.0 L70.3 237.4 L62.7 235.9 L55.6 233.2 L49.8 229.3 L45.7 224.3 L43.6 218.5 L43.5 212.3 L45.2 206.0 L48.1 200.1 L51.5 194.8 L54.8 190.0 L57.4 185.6 L58.9 181.4 L59.5 177.0 L59.3 172.3 L58.9 167.2 L58.7 161.7 L59.4 156.1 L61.3 150.6 L64.5 145.6 L69.1 141.4 L74.6 138.2 L80.9 135.8 L87.5 134.2 L94.1 133.1 L100.7 132.3 L107.1 131.7 L113.6 131.1 L120.0 130.6 L126.5 130.5 L133.0 131.0 L139.3 132.3 L145.2 134.7 L150.3 138.0 L154.5 142.2 L157.8 146.8 L160.3 151.6 L162.3 156.1 L164.4 160.2 L167.1 163.6 L170.8 166.5 L175.6 169.2 L181.6 172.1 L188.3 175.4 L195.0 179.4 L201.1 184.3Z'/%3E%3Cpath d='M235.3 190.0 L238.9 198.3 L239.2 206.8 L236.4 214.9 L230.7 222.2 L223.0 228.4 L214.1 233.5 L204.7 237.5 L195.6 240.8 L187.2 243.7 L179.4 246.6 L172.2 249.6 L165.3 252.7 L158.2 255.6 L151.0 258.1 L143.4 259.9 L135.6 260.7 L127.7 260.6 L120.0 259.7 L112.5 258.3 L105.3 256.8 L98.0 255.6 L90.5 254.9 L82.3 254.7 L73.3 254.7 L63.5 254.6 L53.2 253.7 L42.9 251.7 L33.5 248.1 L25.6 242.9 L20.1 236.2 L17.2 228.3 L17.1 220.0 L19.4 211.6 L23.3 203.6 L27.9 196.4 L32.3 190.0 L35.8 184.1 L37.9 178.4 L38.6 172.6 L38.4 166.2 L37.8 159.3 L37.6 151.9 L38.5 144.4 L41.0 137.0 L45.4 130.3 L51.5 124.7 L59.0 120.3 L67.4 117.1 L76.2 114.9 L85.2 113.5 L94.0 112.4 L102.7 111.5 L111.3 110.7 L120.0 110.1 L128.8 110.0 L137.5 110.6 L146.0 112.5 L153.8 115.6 L160.7 120.1 L166.4 125.7 L170.8 132.0 L174.1 138.4 L176.9 144.5 L179.8 149.9 L183.4 154.5 L188.3 158.5 L194.8 162.1 L202.8 165.9 L211.8 170.3 L220.9 175.8 L229.1 182.4Z'/%3E%3Cpath d='M264.9 190.0 L269.3 200.5 L269.8 211.1 L266.2 221.3 L259.1 230.5 L249.5 238.3 L238.2 244.6 L226.5 249.6 L215.0 253.8 L204.4 257.5 L194.7 261.2 L185.6 264.9 L176.9 268.8 L168.1 272.4 L158.9 275.6 L149.4 277.8 L139.6 278.8 L129.7 278.7 L120.0 277.5 L110.6 275.8 L101.5 274.0 L92.4 272.5 L82.9 271.6 L72.6 271.3 L61.3 271.3 L49.0 271.1 L36.0 270.0 L23.1 267.5 L11.3 263.0 L1.4 256.4 L-5.5 248.0 L-9.1 238.2 L-9.2 227.6 L-6.4 217.1 L-1.5 207.1 L4.2 198.1 L9.8 190.0 L14.1 182.6 L16.8 175.4 L17.8 168.1 L17.5 160.1 L16.7 151.5 L16.5 142.2 L17.6 132.7 L20.8 123.4 L26.3 115.0 L33.9 107.9 L43.3 102.4 L53.9 98.4 L65.0 95.7 L76.3 93.9 L87.4 92.5 L98.3 91.4 L109.1 90.4 L120.0 89.6 L131.0 89.4 L142.0 90.3 L152.6 92.6 L162.5 96.6 L171.2 102.2 L178.3 109.2 L183.8 117.1 L188.0 125.1 L191.5 132.8 L195.1 139.6 L199.6 145.4 L205.8 150.4 L214.0 154.9 L224.1 159.7 L235.4 165.3 L246.8 172.1 L257.0 180.4Z'/%3E%3Cpath d='M294.5 190.0 L299.8 202.6 L300.3 215.4 L296.1 227.7 L287.5 238.8 L275.9 248.1 L262.3 255.7 L248.2 261.8 L234.4 266.8 L221.6 271.3 L209.9 275.7 L199.0 280.2 L188.5 284.9 L177.9 289.3 L166.9 293.0 L155.4 295.7 L143.6 297.0 L131.7 296.8 L120.0 295.4 L108.7 293.3 L97.7 291.1 L86.7 289.3 L75.3 288.2 L63.0 287.9 L49.3 287.9 L34.5 287.7 L18.9 286.4 L3.4 283.3 L-10.9 277.9 L-22.8 270.0 L-31.2 259.8 L-35.5 248.0 L-35.6 235.3 L-32.2 222.6 L-26.3 210.6 L-19.4 199.8 L-12.7 190.0 L-7.5 181.1 L-4.2 172.5 L-3.1 163.6 L-3.5 154.1 L-4.4 143.6 L-4.7 132.4 L-3.3 120.9 L0.6 109.8 L7.1 99.7 L16.4 91.2 L27.7 84.5 L40.4 79.7 L53.8 76.4 L67.3 74.2 L80.7 72.7 L93.8 71.3 L106.9 70.1 L120.0 69.1 L133.2 68.9 L146.5 69.9 L159.3 72.7 L171.2 77.5 L181.6 84.3 L190.2 92.7 L196.8 102.2 L201.9 111.9 L206.1 121.1 L210.4 129.3 L215.9 136.3 L223.3 142.3 L233.2 147.8 L245.3 153.5 L258.9 160.2 L272.6 168.5 L285.0 178.5Z'/%3E%3Cpath d='M324.0 190.0 L330.3 204.7 L330.9 219.8 L325.9 234.1 L315.9 247.1 L302.3 258.0 L286.5 266.9 L269.9 274.0 L253.8 279.8 L238.9 285.1 L225.1 290.2 L212.4 295.5 L200.1 300.9 L187.7 306.1 L174.8 310.5 L161.4 313.6 L147.6 315.1 L133.7 314.9 L120.0 313.3 L106.8 310.8 L93.9 308.2 L81.1 306.1 L67.7 304.9 L53.3 304.5 L37.4 304.5 L20.0 304.2 L1.8 302.7 L-16.4 299.1 L-33.1 292.8 L-47.0 283.5 L-56.8 271.7 L-61.8 257.8 L-62.0 243.0 L-58.0 228.2 L-51.1 214.1 L-43.0 201.4 L-35.2 190.0 L-29.1 179.6 L-25.3 169.5 L-24.0 159.1 L-24.4 148.0 L-25.4 135.7 L-25.8 122.7 L-24.2 109.2 L-19.7 96.2 L-12.0 84.4 L-1.2 74.4 L12.0 66.6 L26.9 61.0 L42.6 57.2 L58.4 54.6 L74.0 52.8 L89.4 51.2 L104.7 49.8 L120.0 48.7 L135.5 48.4 L150.9 49.6 L165.9 52.8 L179.9 58.4 L192.1 66.4 L202.1 76.2 L209.9 87.3 L215.8 98.7 L220.7 109.5 L225.7 119.0 L232.1 127.2 L240.8 134.2 L252.4 140.6 L266.6 147.3 L282.4 155.2 L298.5 164.8 L313.0 176.5Z'/%3E%3Cpath d='M353.6 190.0 L360.8 206.9 L361.5 224.1 L355.7 240.5 L344.3 255.3 L328.7 267.9 L310.6 278.0 L291.7 286.2 L273.2 292.9 L256.1 298.9 L240.4 304.7 L225.7 310.8 L211.7 317.0 L197.5 322.9 L182.8 328.0 L167.4 331.5 L151.6 333.2 L135.6 333.0 L120.0 331.1 L104.9 328.3 L90.2 325.4 L75.5 323.0 L60.2 321.5 L43.6 321.0 L25.4 321.1 L5.5 320.8 L-15.4 319.0 L-36.2 314.9 L-55.3 307.7 L-71.2 297.1 L-82.4 283.5 L-88.2 267.7 L-88.4 250.7 L-83.8 233.7 L-75.9 217.6 L-66.6 203.1 L-57.7 190.0 L-50.7 178.1 L-46.4 166.5 L-44.8 154.7 L-45.3 141.9 L-46.5 127.9 L-46.9 112.9 L-45.1 97.5 L-39.9 82.6 L-31.1 69.1 L-18.8 57.7 L-3.6 48.8 L13.4 42.3 L31.4 37.9 L49.5 35.0 L67.4 32.9 L85.0 31.1 L102.4 29.4 L120.0 28.2 L137.7 27.9 L155.4 29.3 L172.6 32.9 L188.5 39.3 L202.5 48.4 L214.0 59.8 L222.9 72.4 L229.7 85.4 L235.3 97.8 L241.0 108.8 L248.4 118.1 L258.4 126.1 L271.6 133.5 L287.8 141.1 L306.0 150.1 L324.4 161.2 L340.9 174.5Z'/%3E%3Cpath d='M383.2 190.0 L391.2 209.0 L392.0 228.4 L385.6 246.9 L372.7 263.6 L355.1 277.7 L334.7 289.2 L313.4 298.3 L292.6 305.9 L273.3 312.6 L255.6 319.3 L239.1 326.1 L223.3 333.1 L207.3 339.7 L190.7 345.4 L173.4 349.4 L155.6 351.3 L137.6 351.1 L120.0 349.0 L103.0 345.9 L86.4 342.5 L69.8 339.8 L52.6 338.2 L33.9 337.6 L13.4 337.7 L-8.9 337.3 L-32.5 335.4 L-55.9 330.7 L-77.5 322.6 L-95.4 310.7 L-108.0 295.3 L-114.5 277.5 L-114.7 258.4 L-109.6 239.2 L-100.8 221.1 L-90.2 204.7 L-80.2 190.0 L-72.3 176.5 L-67.4 163.6 L-65.7 150.2 L-66.2 135.8 L-67.6 120.0 L-68.0 103.1 L-66.0 85.8 L-60.2 69.0 L-50.2 53.8 L-36.4 40.9 L-19.3 30.9 L-0.1 23.6 L20.1 18.7 L40.6 15.4 L60.7 13.0 L80.5 11.0 L100.2 9.1 L120.0 7.7 L140.0 7.4 L159.9 8.9 L179.3 13.1 L197.2 20.3 L213.0 30.5 L225.9 43.3 L235.9 57.6 L243.5 72.2 L249.9 86.1 L256.4 98.5 L264.6 109.0 L275.9 118.0 L290.8 126.3 L309.0 135.0 L329.5 145.1 L350.2 157.5 L368.9 172.6Z'/%3E%3Cpath d='M412.8 190.0 L421.7 211.1 L422.6 232.7 L415.4 253.3 L401.1 271.9 L381.5 287.6 L358.8 300.3 L335.1 310.5 L312.0 318.9 L290.5 326.4 L270.8 333.8 L252.5 341.4 L234.9 349.2 L217.1 356.6 L198.7 362.9 L179.4 367.3 L159.6 369.5 L139.6 369.2 L120.0 366.9 L101.0 363.4 L82.6 359.7 L64.2 356.6 L45.0 354.8 L24.3 354.2 L1.5 354.3 L-23.4 353.9 L-49.6 351.7 L-75.7 346.5 L-99.7 337.5 L-119.6 324.2 L-133.7 307.2 L-140.9 287.3 L-141.1 266.0 L-135.4 244.8 L-125.6 224.6 L-113.9 206.4 L-102.7 190.0 L-93.9 175.0 L-88.5 160.6 L-86.6 145.7 L-87.2 129.7 L-88.7 112.2 L-89.2 93.4 L-86.8 74.1 L-80.4 55.5 L-69.4 38.5 L-53.9 24.2 L-34.9 13.0 L-13.6 4.9 L8.9 -0.6 L31.6 -4.2 L54.1 -6.9 L76.1 -9.2 L98.0 -11.2 L120.0 -12.8 L142.2 -13.2 L164.4 -11.4 L185.9 -6.8 L205.9 1.2 L223.4 12.6 L237.8 26.8 L248.9 42.7 L257.4 59.0 L264.5 74.4 L271.7 88.2 L280.9 99.9 L293.4 109.9 L310.0 119.1 L330.3 128.8 L353.1 140.0 L376.1 153.9 L396.9 170.6Z'/%3E%3Cpath d='M348.4 60.0 L347.7 61.2 L346.9 62.4 L346.1 63.5 L345.5 64.5 L344.9 65.6 L344.4 66.7 L343.9 67.8 L343.2 68.8 L342.3 69.8 L341.2 70.7 L340.0 71.4 L338.6 71.9 L337.2 72.3 L335.8 72.7 L334.3 73.0 L332.9 73.3 L331.5 73.8 L330.0 74.3 L328.4 74.8 L326.7 75.2 L324.8 75.4 L323.0 75.4 L321.3 74.9 L319.8 74.2 L318.6 73.0 L317.8 71.6 L317.4 70.1 L317.3 68.5 L317.4 67.0 L317.6 65.7 L317.6 64.6 L317.5 63.7 L317.0 62.8 L316.3 61.9 L315.3 61.0 L314.3 60.0 L313.4 58.8 L312.7 57.6 L312.3 56.2 L312.3 54.9 L312.7 53.5 L313.4 52.3 L314.3 51.2 L315.3 50.1 L316.5 49.2 L317.7 48.2 L318.9 47.3 L320.2 46.5 L321.7 45.7 L323.2 45.1 L324.9 44.8 L326.6 44.7 L328.4 45.0 L330.0 45.5 L331.5 46.4 L332.8 47.4 L333.9 48.4 L334.9 49.3 L335.8 50.0 L336.9 50.5 L338.0 50.8 L339.5 51.0 L341.1 51.1 L342.9 51.4 L344.7 51.8 L346.4 52.4 L347.8 53.4 L348.8 54.5 L349.3 55.9 L349.4 57.3 L349.1 58.7Z'/%3E%3Cpath d='M373.5 60.0 L371.6 62.9 L369.7 65.6 L368.0 68.1 L366.5 70.6 L365.2 73.1 L364.0 75.7 L362.6 78.3 L361.0 80.8 L358.9 83.2 L356.4 85.2 L353.5 86.9 L350.3 88.1 L347.0 89.1 L343.6 89.9 L340.2 90.6 L336.9 91.4 L333.5 92.4 L330.0 93.6 L326.2 94.8 L322.1 95.8 L317.8 96.3 L313.5 96.2 L309.5 95.2 L305.9 93.4 L303.1 90.7 L301.3 87.4 L300.3 83.7 L300.1 80.1 L300.4 76.6 L300.7 73.5 L300.9 70.9 L300.4 68.6 L299.4 66.6 L297.6 64.6 L295.4 62.4 L293.0 60.0 L290.9 57.3 L289.2 54.2 L288.3 51.1 L288.3 47.9 L289.2 44.8 L290.8 41.9 L292.9 39.2 L295.4 36.8 L298.1 34.5 L300.9 32.3 L303.9 30.1 L307.0 28.1 L310.4 26.3 L314.0 24.9 L318.0 24.1 L322.0 23.9 L326.1 24.6 L330.0 25.9 L333.5 27.9 L336.6 30.2 L339.2 32.5 L341.5 34.7 L343.8 36.4 L346.2 37.6 L349.0 38.3 L352.3 38.8 L356.1 39.1 L360.3 39.6 L364.6 40.6 L368.6 42.2 L371.9 44.4 L374.3 47.1 L375.6 50.2 L375.7 53.5 L374.9 56.9Z'/%3E%3Cpath d='M398.5 60.0 L395.6 64.6 L392.6 68.8 L389.9 72.8 L387.5 76.7 L385.5 80.7 L383.6 84.7 L381.4 88.8 L378.9 92.8 L375.6 96.5 L371.6 99.7 L367.0 102.3 L362.0 104.3 L356.7 105.8 L351.4 107.0 L346.1 108.2 L340.9 109.5 L335.6 111.1 L330.0 112.9 L324.0 114.8 L317.6 116.4 L310.8 117.2 L304.1 117.0 L297.7 115.5 L292.1 112.6 L287.7 108.3 L284.7 103.2 L283.2 97.4 L282.9 91.6 L283.3 86.2 L283.9 81.3 L284.1 77.1 L283.4 73.6 L281.7 70.4 L279.0 67.2 L275.5 63.8 L271.8 60.0 L268.3 55.7 L265.7 50.9 L264.3 45.9 L264.3 40.9 L265.7 36.0 L268.2 31.5 L271.6 27.3 L275.5 23.4 L279.7 19.8 L284.2 16.3 L288.8 12.9 L293.7 9.8 L299.1 6.9 L304.8 4.7 L311.0 3.4 L317.5 3.2 L323.9 4.2 L330.0 6.3 L335.5 9.4 L340.4 13.0 L344.5 16.7 L348.1 20.1 L351.7 22.8 L355.5 24.7 L359.9 25.9 L365.1 26.5 L371.2 27.1 L377.8 27.9 L384.6 29.4 L390.8 31.9 L396.1 35.3 L399.8 39.7 L401.8 44.6 L402.1 49.8 L400.8 55.0Z'/%3E%3Cpath d='M423.5 60.0 L419.6 66.3 L415.5 72.1 L411.8 77.5 L408.5 82.9 L405.8 88.3 L403.1 93.8 L400.2 99.3 L396.7 104.8 L392.3 109.8 L386.9 114.2 L380.6 117.8 L373.7 120.5 L366.5 122.6 L359.2 124.2 L352.0 125.8 L344.9 127.6 L337.6 129.8 L330.0 132.3 L321.8 134.8 L313.0 137.0 L303.8 138.1 L294.6 137.9 L285.8 135.8 L278.2 131.8 L272.2 126.0 L268.2 118.9 L266.1 111.1 L265.7 103.2 L266.2 95.7 L267.0 89.1 L267.3 83.4 L266.4 78.5 L264.1 74.1 L260.3 69.8 L255.6 65.2 L250.5 60.0 L245.8 54.1 L242.3 47.6 L240.4 40.8 L240.3 33.9 L242.2 27.2 L245.6 21.0 L250.2 15.3 L255.6 10.0 L261.3 5.1 L267.4 0.3 L273.8 -4.3 L280.5 -8.6 L287.8 -12.5 L295.7 -15.5 L304.1 -17.3 L312.9 -17.6 L321.7 -16.2 L330.0 -13.3 L337.6 -9.1 L344.1 -4.1 L349.8 0.9 L354.8 5.5 L359.6 9.2 L364.8 11.8 L370.8 13.4 L377.9 14.3 L386.2 15.0 L395.3 16.2 L404.5 18.3 L413.1 21.6 L420.2 26.3 L425.3 32.2 L428.1 39.0 L428.4 46.1 L426.7 53.2Z'/%3E%3C/g%3E%3C/svg%3E"); --orn-star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpolygon points='19.07,19.07 4.93,19.07 4.93,4.93 19.07,4.93'/%3E%3Cpolygon points='12.00,22.00 2.00,12.00 12.00,2.00 22.00,12.00'/%3E%3C/svg%3E"); --orn-route: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 120'%3E%3Cpath d='M10 100 C 120 20, 220 120, 330 60 S 520 10, 560 40' fill='none' stroke='black' stroke-width='2.2' stroke-dasharray='2 9' stroke-linecap='round'/%3E%3Cpath d='M560 18c-8 0-14 6-14 13.5C546 42 560 52 560 52s14-10 14-20.5C574 24 568 18 560 18z'/%3E%3Ccircle cx='10' cy='100' r='5'/%3E%3C/svg%3E"); --orn-pin: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M20 3c-7.7 0-14 6-14 13.6C6 26.8 20 37 20 37s14-10.2 14-20.4C34 9 27.7 3 20 3z M13.5 17.5l4.5 4.5 8.5-9' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E"); }
.orn { position: absolute; pointer-events: none; background: var(--brand); -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.orn--topo { --m: var(--orn-topo); opacity: 0.13; }
.orn--route { --m: var(--orn-route); opacity: 0.22; }
.orn--pin { --m: var(--orn-pin); opacity: 0.08; }
.orn--star { --m: var(--orn-star); background: var(--brand2); }
@media (prefers-reduced-motion: no-preference) {
  .orn--topo { animation: topo-drift 18s ease-in-out infinite alternate; }
  .orn--star.is-spin { animation: spin 14s linear infinite; }
}
@keyframes topo-drift { to { transform: translate(-10px, 6px) rotate(-2deg); } }

/* Hero ornaments and the facts strip */
.hero { isolation: isolate; }
.hero > .orn--topo { inset-block-start: -40px; inset-inline-end: -60px; inline-size: 520px; block-size: 380px; z-index: -1; }
.hero > .orn--route { inset-block-end: 6px; inset-inline-start: 30%; inline-size: 46%; block-size: 90px; z-index: -1; }
[dir="rtl"] .hero > .orn--route { transform: scaleX(-1); }
.hero > .orn--pin { inset-block-start: -18px; inset-inline-start: 41%; inline-size: 150px; block-size: 150px; z-index: -1; transform: rotate(-12deg); }
.hero__kicker .orn--star { position: static; display: inline-block; inline-size: 12px; block-size: 12px; }
.hero__facts { gap: 0; inline-size: fit-content; padding: 8px 6px; border-radius: 16px; background: color-mix(in srgb, var(--dk-surface) 72%, transparent); border: 1px solid color-mix(in srgb, var(--dk-surface) 60%, var(--dk-border)); box-shadow: var(--dk-shadow); backdrop-filter: blur(6px); }
.hero__facts > div { display: grid; grid-template-columns: auto auto; column-gap: 10px; align-items: center; padding-inline: 16px; }
.hero__facts > div + div { border-inline-start: 1px dashed var(--dk-line-strong); }
.hero__facts .tile { grid-row: span 2; inline-size: 34px; block-size: 34px; border-radius: 10px; }
.hero__facts .tile .icon { inline-size: 17px; block-size: 17px; }
.hero__facts b { font-size: 20px; line-height: 1.2; }
.hero h2 em { background: linear-gradient(transparent 62%, color-mix(in srgb, var(--brand2) 28%, transparent) 62% 90%, transparent 90%); padding-inline: 2px; }
@media (max-width: 640px) { .hero__facts { inline-size: 100%; } .hero__facts > div { padding-inline: 8px; } .hero > .orn--pin { display: none; } }

/* Section headings carry the star; panels can carry contour corners. */
.kit-sec__head h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.kit-sec__head h2::before { content: ""; inline-size: 14px; block-size: 14px; flex: none; background: var(--brand2); -webkit-mask: var(--orn-star) center / contain no-repeat; mask: var(--orn-star) center / contain no-repeat; }
.kit-sec__head h2 .kit-new { margin-inline-start: 0; }
.deco-corner { position: relative; overflow: hidden; isolation: isolate; }
.deco-corner::after { content: ""; position: absolute; z-index: -1; inset-block-start: -50px; inset-inline-end: -70px; inline-size: 240px; block-size: 170px; background: var(--brand); opacity: 0.07; -webkit-mask: var(--orn-topo) center / contain no-repeat; mask: var(--orn-topo) center / contain no-repeat; pointer-events: none; }
.idcard__band { overflow: hidden; }
.idcard__band::after { content: ""; position: absolute; inset: -20px -30px; background: var(--brand); opacity: 0.12; -webkit-mask: var(--orn-topo) center / cover no-repeat; mask: var(--orn-topo) center / cover no-repeat; }
.empty { position: relative; isolation: isolate; }
.empty::before { content: ""; position: absolute; z-index: -1; inset-block-start: 6px; inset-inline: 10%; block-size: 170px; background: var(--brand); opacity: 0.06; -webkit-mask: var(--orn-topo) center / contain no-repeat; mask: var(--orn-topo) center / contain no-repeat; }
.divider-star { display: flex; align-items: center; gap: 10px; color: var(--dk-faint); font-size: 12px; margin-block: 18px; }
.divider-star::before, .divider-star::after { content: ""; flex: 1; block-size: 1px; background: linear-gradient(90deg, transparent, var(--dk-line-strong), transparent); }
.divider-star span { inline-size: 12px; block-size: 12px; background: var(--brand2); -webkit-mask: var(--orn-star) center / contain no-repeat; mask: var(--orn-star) center / contain no-repeat; }

/* Empty state for icons without an illustration: the icon on a decorated tile. */
.empty__tile { position: relative; inline-size: 92px; block-size: 92px; display: grid; place-items: center; margin-block-end: 10px; }
.empty__tile::before { content: ""; position: absolute; inset: 0; background: var(--brand-soft); -webkit-mask: var(--orn-star) center / contain no-repeat; mask: var(--orn-star) center / contain no-repeat; animation: spin 40s linear infinite; }
.empty__tile span { position: relative; inline-size: 52px; block-size: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--dk-surface); color: var(--brand-text); box-shadow: var(--dk-shadow); }
.empty__tile .icon { inline-size: 26px; block-size: 26px; }
.empty-state p { margin-inline: auto; }

/* Hero facts stay on one row; they shrink before they wrap. */
.hero__facts { flex-wrap: nowrap; max-inline-size: 100%; }
.hero__facts > div { padding-inline: 12px; min-inline-size: 0; }
.hero__facts small { white-space: nowrap; }
.hero__text { container-type: inline-size; }
@container (max-width: 520px) { .hero__facts .tile { inline-size: 28px; block-size: 28px; } .hero__facts > div { padding-inline: 10px; column-gap: 8px; } .hero__facts b { font-size: 18px; } }
@container (max-width: 420px) { .hero__facts .tile { display: none; } .hero__facts > div { grid-template-columns: auto; } }

/* Scrollbars: see ui-tools.css (applies to every page). */


/* "812 / 1,000" must read left-to-right inside Arabic text (otherwise it shows as 1,000 / 812). */
:is(.side2__field-goal b, .region-list__head span, .scard__progress-head b, .quota__head > span:last-child, .settings-nav__head .progress__value) { direction: ltr; unicode-bidi: isolate; }

@media screen and (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero h2 em { background: linear-gradient(transparent 70%, color-mix(in srgb, var(--brand2) 16%, transparent) 70% 92%, transparent 92%); } }
@media screen { :root[data-theme="dark"] .hero h2 em { background: linear-gradient(transparent 70%, color-mix(in srgb, var(--brand2) 16%, transparent) 70% 92%, transparent 92%); } }

/* Toned buttons (soft status colour), used by row actions across the survey pages. */
.button--tone-warning { background: var(--st-warn-bg); color: var(--st-warn-ink, var(--st-warn)); border-color: transparent; }
.button--tone-danger { background: var(--st-danger-bg); color: var(--st-danger-ink, var(--st-danger)); border-color: transparent; }
.button--tone-success { background: var(--st-ok-bg); color: var(--st-ok-ink, var(--st-ok)); border-color: transparent; }
.button--tone-brand { background: var(--brand-soft); color: var(--brand-text); border-color: transparent; }
:is(.button--tone-warning, .button--tone-danger, .button--tone-success, .button--tone-brand):hover { filter: brightness(0.97); }

/* Extra-small avatar (inline mentions, history rows). */
.avatar--xs { inline-size: 22px; block-size: 22px; font-size: 10px; }
/* An Arabic name in an English page (or the reverse) keeps the page's alignment. */
.person :is([dir="auto"], bdi) { text-align: match-parent; }

/* ---------- Multi-choice filter (.msel, ui-kit.js) ---------- */
.msel { position: relative; display: inline-flex; min-inline-size: 0; max-inline-size: 100%; }
.field .msel, .msel--block { display: flex; inline-size: 100%; }
.msel__btn { display: flex; align-items: center; gap: 8px; inline-size: 100%; min-inline-size: 150px; min-block-size: 40px; padding-inline: 12px 10px; border: 1px solid var(--dk-line); border-radius: 11px; background: var(--dk-surface); color: var(--dk-muted); font: inherit; font-size: 13.5px; text-align: start; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s; }
.msel__btn:hover { border-color: var(--dk-line-strong, var(--dk-line)); }
.msel__btn:focus-visible, .msel.is-open .msel__btn { outline: none; border-color: var(--brand); box-shadow: var(--ui-ring); }
.msel__btn.has-value { color: var(--dk-text); background: color-mix(in srgb, var(--brand-soft) 40%, var(--dk-surface)); border-color: color-mix(in srgb, var(--brand) 35%, var(--dk-line)); }
.msel__text { flex: 1; min-inline-size: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.msel__btn.has-value .msel__text { font-weight: 600; }
.msel__more { flex: none; padding: 1px 7px; border-radius: 999px; background: var(--brand); color: var(--brand-ink); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.msel__chev { flex: none; inline-size: 12px; block-size: 12px; background: var(--dk-faint); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; transition: transform 0.2s; }
.msel.is-open .msel__chev { transform: rotate(180deg); background: var(--brand-text); }
.msel__pop { position: absolute; z-index: 60; inset-block-start: calc(100% + 6px); inset-inline-start: 0; inline-size: max(100%, 280px); max-inline-size: min(380px, calc(100vw - 24px)); padding: 8px; border: 1px solid var(--dk-border); border-radius: 14px; background: var(--dk-surface); box-shadow: var(--dk-pop-shadow); animation: tt-pop 0.16s var(--ui-ease, ease) both; }
.msel__pop--up { inset-block-start: auto; inset-block-end: calc(100% + 6px); }
.msel__search { display: flex; align-items: center; gap: 8px; margin-block-end: 6px; padding-inline: 10px; border: 1px solid var(--dk-line); border-radius: 10px; color: var(--dk-faint); }
.msel__search:focus-within { border-color: var(--brand); box-shadow: var(--ui-ring); }
.msel__search .icon { inline-size: 16px; block-size: 16px; flex: none; }
.msel__search input { flex: 1; min-inline-size: 0; block-size: 36px; border: 0; outline: 0; background: transparent; color: var(--dk-text); font: inherit; font-size: 13px; }
.msel__tools { display: flex; align-items: center; gap: 4px; padding: 2px 4px 6px; border-block-end: 1px dashed var(--dk-border); margin-block-end: 4px; }
.msel__count { flex: 1; font-size: 11.5px; color: var(--dk-muted); }
.msel__tools button { border: 0; background: none; padding: 4px 8px; border-radius: 8px; color: var(--brand-text); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.msel__tools button:hover { background: var(--brand-soft); }
.msel__list { display: grid; gap: 1px; max-block-size: 280px; overflow-y: auto; overscroll-behavior: contain; }
.msel__opt { display: flex; align-items: center; gap: 10px; min-block-size: 36px; padding-inline: 8px; border-radius: 9px; font-size: 13.5px; color: var(--dk-text); cursor: pointer; }
.msel__opt:hover, .msel__opt:focus-visible { background: var(--dk-hover); outline: none; }
.msel__opt[aria-selected="true"] { background: color-mix(in srgb, var(--brand-soft) 55%, transparent); }
.msel__opt input { flex: none; inline-size: 17px; block-size: 17px; margin: 0; accent-color: var(--brand); cursor: pointer; }
.msel__opt span { flex: 1; min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msel__opt small { flex: none; color: var(--dk-faint); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.msel__opt--group { margin-block-start: 4px; font-weight: 700; }
.msel__opt--group:first-child { margin-block-start: 0; }
.msel__opt--child { padding-inline-start: 30px; }
@media (max-width: 640px) {
  .msel__pop { position: fixed; inset: auto 12px 12px 12px; inline-size: auto; max-inline-size: none; max-block-size: 70vh; display: flex; flex-direction: column; }
  .msel__list { max-block-size: none; flex: 1; }
}
/* Inside a .field the general input rules (height, border, padding) must not reach the widget's own parts. */
.msel .msel__opt input[type="checkbox"] { inline-size: 17px; block-size: 17px; min-block-size: 0; padding: 0; margin: 0; border-radius: 5px; flex: none; }
.msel .msel__search input[type="search"], .msel .msel__search input[type="search"]:focus { min-block-size: 0; block-size: 36px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; outline: 0; }
.msel__more { direction: ltr; unicode-bidi: isolate; }
