/* Deskito UI — shared design system styles built on tokens.css. */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    background: var(--c-bg);
}

html, body {
    margin: 0;
    padding: 0;
    overflow-x: clip;
}

body {
    min-height: 100vh;
    background: var(--c-bg);
    color: var(--c-ink);
    font-family: var(--font-body);
    font-size: var(--fs-16);
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.scroll-locked { overflow: hidden; }

img, svg, video, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--c-rust); text-underline-offset: 2px; }

:focus-visible {
    outline: 2.5px solid var(--c-focus);
    outline-offset: 2px;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, .t-head {
    font-family: var(--font-head);
    font-weight: 800;
    letter-spacing: var(--ls-head);
    line-height: 1.15;
    margin: 0;
    color: var(--c-ink);
}

h1 { font-size: var(--fs-28); letter-spacing: var(--ls-head-xl); }
h2 { font-size: var(--fs-22); }
h3 { font-size: var(--fs-18); font-weight: 600; }
p { margin: 0; }

.t-display { font-family: var(--font-head); font-weight: 800; font-size: var(--fs-34); letter-spacing: var(--ls-head-xl); line-height: 1.1; }
.t-xl { font-size: var(--fs-22); }
.t-lg { font-size: var(--fs-18); }
.t-md { font-size: var(--fs-16); }
.t-sm { font-size: var(--fs-14); }
.t-xs { font-size: var(--fs-12); }
.t-strong { font-weight: 700; }
.t-soft, .muted { color: var(--c-ink-soft); }
.t-rust { color: var(--c-rust); }
.t-center, .text-center { text-align: center; }
.t-num { font-variant-numeric: tabular-nums; }
.mono-text, .t-mono { font-family: var(--font-mono); font-size: 0.85rem; }

/* ---------- Utilities ---------- */
.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.stack { display: flex; flex-direction: column; gap: var(--sp-4); }
.stack-sm { display: flex; flex-direction: column; gap: var(--sp-2); }
.stack-lg { display: flex; flex-direction: column; gap: var(--sp-6); }
.row { display: flex; align-items: center; gap: var(--sp-2); }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.grow { flex: 1 1 auto; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.card {
    background: var(--c-surface);
    border-radius: var(--r-card);
    box-shadow: var(--shadow);
    padding: var(--sp-4);
}

.ic {
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    overflow: visible;
}

/* ---------- Tones (one color per action family) ---------- */
.tone-postit { --tone: var(--c-postit); --tone-ink: var(--c-on-fill); }
.tone-pesca { --tone: var(--c-pesca); --tone-ink: var(--c-on-fill); }
.tone-lilla { --tone: var(--c-lilla); --tone-ink: var(--c-on-fill); }
.tone-salvia { --tone: var(--c-salvia); --tone-ink: var(--c-on-fill); }
.tone-mandarino { --tone: var(--c-mandarino); --tone-ink: var(--c-on-fill); }
.tone-neutral { --tone: var(--c-surface); --tone-ink: var(--c-ink); }

/* ---------- Deskito Logo ---------- */
.dlogo {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    text-decoration: none;
    color: var(--c-ink);
    user-select: none;
}

.dlogo-word {
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 28px;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--c-ink);
}

.dlogo-i { position: relative; display: inline-block; }

.dlogo-dot {
    position: absolute;
    left: 50%;
    top: -0.04em;
    width: 0.22em;
    height: 0.22em;
    margin-left: -0.11em;
    background: var(--c-mandarino);
    border-radius: 2px 2px 5px 2px;
    transform: rotate(-10deg);
}

.dlogo-sub {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--r-pill);
    background: var(--c-lilla);
    color: var(--c-on-fill);
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 14px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    min-height: 48px;
    padding: 0 var(--sp-5);
    border: 0;
    border-radius: var(--r-btn);
    font-family: var(--font-body);
    font-size: var(--fs-16);
    font-weight: 700;
    text-decoration: none;
    line-height: 1.1;
    transition: transform .12s var(--ease), background-color .15s ease, box-shadow .15s ease;
    user-select: none;
}

.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled, .btn[aria-disabled=true] { opacity: .45; cursor: default; }
.btn-block { display: flex; width: 100%; }
.btn-sm { min-height: 38px; padding: 0 var(--sp-3); font-size: var(--fs-14); border-radius: 14px; }

.btn-primary { background: var(--c-mandarino); color: var(--c-on-fill); box-shadow: 0 6px 16px rgba(255, 122, 61, 0.28); }
.btn-primary:hover:not(:disabled) { background: var(--c-mandarino-press); }
.btn-secondary { background: var(--c-surface); color: var(--c-ink); box-shadow: var(--shadow); }
.btn-secondary:hover:not(:disabled) { background: var(--c-surface-2); }
.btn-ghost { background: transparent; color: var(--c-ink); }
.btn-ghost:hover:not(:disabled) { background: var(--c-line); }
.btn-danger { background: var(--c-pesca); color: var(--c-on-fill); }
.btn-tone { background: var(--tone); color: var(--tone-ink); }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--tap);
    height: var(--tap);
    min-width: var(--tap);
    padding: 0;
    border: 0;
    border-radius: var(--r-pill);
    background: transparent;
    color: var(--c-ink);
    text-decoration: none;
    transition: background-color .12s ease;
}

.icon-btn:hover:not(:disabled) { background: var(--c-line); }
.icon-btn:disabled { opacity: .35; cursor: default; }

.link-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-1);
    min-height: var(--tap);
    padding: 0 var(--sp-2);
    border: 0;
    background: none;
    color: var(--c-rust);
    font-weight: 700;
    font-size: var(--fs-14);
    text-decoration: none;
}

/* ---------- Boot loader ---------- */
.boot-loader {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--sp-3);
    background: var(--c-bg);
    color: var(--c-ink);
}

.boot-wordmark {
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 46px;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--c-ink);
}

.boot-i { position: relative; display: inline-block; }

.boot-dot {
    position: absolute;
    left: 50%;
    top: -0.06em;
    width: 0.22em;
    height: 0.22em;
    margin-left: -0.11em;
    background: var(--c-mandarino);
    border-radius: 2px 2px 5px 2px;
    transform: rotate(-10deg);
    animation: boot-bob 1.4s var(--ease) infinite alternate;
}

.boot-sub { font-size: var(--fs-14); color: var(--c-ink-soft); min-height: 1.2em; }

@keyframes boot-bob {
    from { transform: translateY(0) rotate(-10deg); }
    to { transform: translateY(-3px) rotate(-14deg); }
}

/* ---------- Page header ---------- */
.ph {
    position: sticky;
    top: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    gap: var(--sp-1);
    min-height: 56px;
    padding: var(--sp-2) 0;
    background: var(--c-bg);
}

.ph-text { flex: 1 1 auto; min-width: 0; padding: 0 var(--sp-2); }
.ph-title { font-size: var(--fs-22); line-height: 1.2; overflow-wrap: anywhere; }
.ph-sub { font-size: var(--fs-14); color: var(--c-ink-soft); margin-top: 2px; }
.ph-actions { display: flex; align-items: center; gap: 4px; }
.ph-help-body { color: var(--c-ink); font-size: var(--fs-16); line-height: 1.5; }

/* ---------- Bottom sheet / Modal ---------- */
.sheet-root {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
}

@media (min-width: 720px) {
    .sheet-root {
        justify-content: center;
        padding: var(--sp-4);
    }
}

.sheet-scrim {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    background: var(--c-scrim);
    animation: fade-in .2s ease both;
    cursor: default;
}

.sheet {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 640px;
    max-height: 88vh;
    padding-bottom: calc(var(--safe-b) + var(--sp-4));
    border-radius: 26px 26px 0 0;
    background: var(--c-bg);
    color: var(--c-ink);
    box-shadow: var(--shadow-raised);
    animation: sheet-up .26s var(--ease) both;
}

@media (min-width: 720px) {
    .sheet {
        border-radius: 26px;
        max-height: 86vh;
    }
}

.sheet-handle {
    width: 40px;
    height: 5px;
    margin: var(--sp-2) auto 0;
    border-radius: var(--r-pill);
    background: color-mix(in srgb, var(--c-ink) 20%, transparent);
}

@media (min-width: 720px) {
    .sheet-handle { display: none; }
}

.sheet-head {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-3) var(--sp-2) var(--sp-5);
}

.sheet-title { flex: 1; font-size: var(--fs-22); }
.sheet-body { overflow-y: auto; padding: var(--sp-2) var(--sp-5) var(--sp-3); overscroll-behavior: contain; }
.sheet-footer { padding: var(--sp-3) var(--sp-5) 0; display: flex; flex-direction: column; gap: var(--sp-2); }

@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- List action rows ---------- */
.list-actions { display: flex; flex-direction: column; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }

.list-action {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    width: 100%;
    min-height: 64px;
    padding: var(--sp-3);
    border: 0;
    border-radius: var(--r-card);
    background: var(--tone, var(--c-surface));
    color: var(--tone-ink, var(--c-ink));
    text-align: left;
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: transform .12s var(--ease);
}

.list-action:hover:not(:disabled) { transform: translateY(-1px); }
.list-action:active:not(:disabled) { transform: scale(0.99); }
.list-action:disabled { opacity: .45; }
.list-action-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.list-action-title { font-weight: 700; font-size: var(--fs-16); }
.list-action-hint { font-size: var(--fs-14); opacity: .82; }

/* ---------- Icon well ---------- */
.well {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: var(--r-icon);
    background: var(--c-icon-well);
    color: var(--c-on-fill);
}

.well-lg { width: 56px; height: 56px; border-radius: 18px; }

/* ---------- Action tiles ---------- */
.tile-grid {
    display: grid;
    grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr));
    gap: var(--sp-3);
}

.tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-2);
    min-height: 124px;
    padding: var(--sp-4);
    border: 0;
    border-radius: var(--r-card);
    background: var(--tone, var(--c-surface));
    color: var(--tone-ink, var(--c-ink));
    text-align: left;
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: transform .12s var(--ease);
}

.tile:hover:not(:disabled) { transform: translateY(-1px); }
.tile:active:not(:disabled) { transform: scale(0.98); }
.tile:disabled { opacity: .5; }
.tile-title { font-family: var(--font-head); font-weight: 600; font-size: var(--fs-18); letter-spacing: -0.01em; line-height: 1.2; }
.tile-text { display: flex; flex-direction: column; gap: 2px; margin-top: auto; }
.tile-hint { font-size: var(--fs-14); line-height: 1.35; color: inherit; opacity: .82; }
.tile-badge { position: absolute; top: var(--sp-3); right: var(--sp-3); }

.tile.is-wide { grid-column: 1 / -1; flex-direction: row; align-items: center; min-height: 76px; }
.tile.is-wide .tile-text { margin-top: 0; }

/* ---------- Section title ---------- */
.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2);
    margin: var(--sp-5) 0 var(--sp-3);
    min-height: 24px;
}

.section-title-main { display: inline-flex; align-items: center; gap: var(--sp-1); min-width: 0; }

.section-title-text {
    margin: 0;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--c-rust);
}

/* ---------- Chips ---------- */
.chip-row { display: flex; gap: var(--sp-2); overflow-x: auto; padding: 2px 2px var(--sp-1); scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }

.chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: none;
    min-height: 36px;
    padding: 0 14px;
    border: 0;
    border-radius: var(--r-pill);
    background: var(--tone, var(--c-surface));
    color: var(--tone-ink, var(--c-ink));
    font-size: var(--fs-14);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: var(--shadow);
}

.chip[aria-pressed=true], .chip.is-selected { background: var(--c-ink); color: var(--c-bg); }
.chip-count { font-variant-numeric: tabular-nums; font-weight: 700; opacity: .75; }

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 26px;
    padding: 0 10px;
    border-radius: var(--r-pill);
    background: var(--tone);
    color: var(--tone-ink);
    font-size: var(--fs-12);
    font-weight: 700;
    white-space: nowrap;
}

/* ---------- Stamp ---------- */
.stamp {
    display: inline-block;
    padding: 6px 14px;
    border: 2.5px dashed var(--c-rust);
    border-radius: 10px;
    color: var(--c-rust);
    font-family: var(--font-head);
    font-weight: 800;
    font-size: var(--fs-16);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transform: rotate(-6deg);
    line-height: 1.1;
}

/* ---------- Empty state ---------- */
.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--sp-3);
    padding: var(--sp-6) var(--sp-4);
}

.empty-title { font-size: var(--fs-22); }
.empty-body { max-width: 38ch; color: var(--c-ink-soft); }
.empty-actions { display: flex; flex-direction: column; align-items: stretch; gap: var(--sp-2); margin-top: var(--sp-2); width: 100%; max-width: 320px; }

.mascot { display: block; height: auto; margin: 0 auto; user-select: none; -webkit-user-drag: none; }

/* ---------- Tip note (post-it) ---------- */
.tip {
    position: relative;
    display: flex;
    gap: var(--sp-3);
    padding: var(--sp-4);
    border-radius: 6px 6px 22px 6px;
    background: var(--tone, var(--c-postit));
    color: var(--c-on-fill);
    box-shadow: 0 2px 0 rgba(122, 62, 22, 0.08), 0 8px 18px rgba(122, 62, 22, 0.10);
}

.tip.is-rotated { transform: rotate(-0.8deg); }
.tip-text { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-14); line-height: 1.45; }
.tip-title { font-weight: 800; font-size: var(--fs-16); }

/* ---------- Segmented choice ---------- */
.seg {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border-radius: var(--r-pill);
    background: var(--c-surface-2);
}

.seg-opt {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 0 var(--sp-3);
    border: 0;
    border-radius: var(--r-pill);
    background: transparent;
    color: var(--c-ink-soft);
    font-size: var(--fs-14);
    font-weight: 600;
    white-space: nowrap;
}

.seg-opt[aria-checked=true] { background: var(--c-surface); color: var(--c-ink); box-shadow: var(--shadow); font-weight: 700; }

/* ---------- Presets ---------- */
.presets { display: flex; flex-direction: column; gap: var(--sp-2); }

.preset {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    width: 100%;
    min-height: 60px;
    padding: var(--sp-3) var(--sp-4);
    border: 2px solid transparent;
    border-radius: var(--r-card);
    background: var(--c-surface);
    color: var(--c-ink);
    text-align: left;
    box-shadow: var(--shadow);
}

.preset-radio {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid color-mix(in srgb, var(--c-ink) 35%, transparent);
}

.preset[aria-checked=true] { border-color: var(--c-mandarino); }
.preset[aria-checked=true] .preset-radio { border-color: var(--c-mandarino); background: var(--c-mandarino); color: var(--c-on-fill); }
.preset-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.preset-title { font-weight: 700; }
.preset-hint { font-size: var(--fs-14); color: var(--c-ink-soft); }

/* ---------- Forms & Switch toggles ---------- */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-label {
    font-size: var(--fs-12);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--c-rust);
}

.d-input, .d-select, .d-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--c-line);
    border-radius: 14px;
    background: var(--c-surface);
    color: var(--c-ink);
    font-size: var(--fs-16);
    transition: border-color .15s ease;
}

.d-input:focus, .d-select:focus, .d-textarea:focus {
    outline: none;
    border-color: var(--c-mandarino);
}

.d-textarea { min-height: 82px; resize: vertical; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: var(--sp-3);
}

.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    padding: 12px 14px;
    border-radius: 16px;
    background: var(--c-surface);
    box-shadow: var(--shadow);
}

.switch-btn {
    position: relative;
    flex: none;
    width: 50px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: var(--r-pill);
    background: color-mix(in srgb, var(--c-ink) 20%, transparent);
    transition: background-color .18s ease;
}

.switch-btn::after {
    content: "";
    position: absolute;
    left: 3px;
    top: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 2px 6px rgba(43, 35, 48, 0.22);
    transition: transform .18s var(--ease);
}

.switch-btn[aria-checked=true] { background: var(--c-mandarino); }
.switch-btn[aria-checked=true]::after { transform: translateX(20px); }

/* ---------- Toast ---------- */
.toast-host {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 1700;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(92vw, 440px);
    pointer-events: none;
}

.toast-item {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: 12px 16px;
    border-radius: var(--r-btn);
    background: var(--tone, var(--c-ink));
    color: var(--tone-ink, var(--c-bg));
    box-shadow: var(--shadow-raised);
    font-weight: 600;
    font-size: var(--fs-14);
    pointer-events: auto;
    animation: sheet-up .2s var(--ease) both;
}

.offline-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--r-pill);
    font-size: var(--fs-12);
    font-weight: 700;
    background: var(--c-salvia);
    color: var(--c-on-fill);
    border: 0;
}

/* ---------- "i" button (InfoButton) ---------- */
.info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: var(--tap);
    height: var(--tap);
    margin: calc((var(--tap) - 28px) / -2) 0;
    padding: 0;
    border: 0;
    border-radius: var(--r-pill);
    background: transparent;
    color: var(--c-on-fill);
    vertical-align: middle;
}

.info-btn-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: var(--r-pill);
    background: var(--c-postit);
    box-shadow: 0 1px 0 rgba(43, 35, 48, 0.14);
    transition: transform .15s var(--ease);
}

.info-btn:hover .info-btn-dot { transform: scale(1.06); }
.info-btn:active .info-btn-dot { transform: scale(0.92); }
.info-btn.is-lg .info-btn-dot { width: 32px; height: 32px; }

.info-body {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    color: var(--c-ink);
    font-size: var(--fs-16);
    line-height: 1.5;
}

.info-text { margin: 0; }

.info-example {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    padding: var(--sp-3);
    border-radius: var(--r-icon);
    background: var(--c-surface-2);
    font-size: var(--fs-14);
    line-height: 1.45;
}

.info-example-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.info-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    padding: var(--sp-2) 0;
}

.info-item .well {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: var(--tone, var(--c-surface-2));
    color: var(--tone-ink, var(--c-ink));
}

.info-item-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: var(--fs-14);
    line-height: 1.45;
}

.info-item-text strong { font-size: var(--fs-16); }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ---------- Chiedi all'IA ---------- */
.ai-intro {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3);
    border-radius: var(--r-card);
    background: var(--c-lilla);
    color: var(--c-on-fill);
}
.ai-intro .mascot, .ai-intro img, .ai-intro svg { flex: none; }
.ai-intro-list { flex: 1 1 220px; margin: 0; padding-left: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-1); font-size: var(--fs-14); }
.ai-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-4); }
.ai-step { display: flex; gap: var(--sp-3); align-items: flex-start; }
.ai-step-num {
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: var(--r-pill);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--c-mandarino);
    color: var(--c-on-fill);
    font-weight: 800;
}
.ai-step-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.ai-privacy { display: flex; align-items: center; gap: var(--sp-2); margin: 0; font-size: var(--fs-14); color: var(--c-ink-soft); }
.ai-changes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.ai-change { border-radius: var(--r-card); background: var(--c-surface-2); }
.ai-change-label { display: flex; align-items: flex-start; gap: var(--sp-2); padding: var(--sp-3); cursor: pointer; }
.ai-change-label input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.ai-change-text { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-16); }
.ai-change.is-invalid { opacity: .7; }
.ai-change.is-invalid .ai-change-label { cursor: default; }
.ai-change-problem { font-size: var(--fs-14); color: var(--c-rust); }
