/**
 * MageTicket
 *
 * Fichier        : public/assets/css/responsive.css
 * Rôle           : Adaptation bord à bord pour tablette, mobile, fenêtres étroites et formulaires longs.
 * Auteur         : Régis KREMER
 * Version        : 0.33.29
 * Version projet : 0.33.0
 * Lot            : MAGETICKET ADMIN EMAIL DELIVERY SETTINGS TEMPLATES DIAGNOSTICS1
 * Base requise   : 0.33.0 + MAGETICKET RESPONSIVE INTERNAL SCROLL TICKET CREATION 422 CORRECTIVE FIX1
 * Créé le        : 2026-07-21
 * Modifié le     : 2026-07-25
 *
 * Dépendances : public/assets/css/app.css, cockpit-runtime.css et structure templates/home.php.
 * Contraintes : WCAG 2.2 AA, viewport dynamique, zones sûres, zoom autorisé, aucun débordement global.
 * Modifications : navigation mobile compatible avec les widgets personnalisés, retrait des anciens wrappers et masquage des contrôles mobiles hors breakpoint.
 */

:root {
    --visual-viewport-height: 100dvh;
    --keyboard-inset: 0px;
    --mobile-bar-h: 64px;
    --touch-target: 44px;
}

html.is-standalone {
    --standalone-offset: 1px;
}

body.is-overlay-open {
    overflow: hidden;
    overscroll-behavior: none;
}



.mobile-menu-button,
.tablet-create-button,
.tablet-details-button,
.mobile-drawer-header,
.mobile-context-header,
.mobile-action-bar,
.details-close,
.navigation-scrim {
    display: none;
}

.connection-banner,
.panel-title-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.panel-title-actions [data-open-wizard] {
    display: none;
}

.panel,
.wizard-form {
    container-type: inline-size;
}

.connection-banner {
    min-height: 42px;
    align-items: center;
    gap: 10px;
    padding: 8px max(14px, var(--safe-right)) 8px max(14px, var(--safe-left));
    border-bottom: 1px solid color-mix(in srgb, var(--orange) 55%, var(--line));
    background: color-mix(in srgb, var(--orange) 13%, var(--surface));
    color: var(--text);
    font-size: var(--fs-sm);
}

.state-surface {
    min-height: 320px;
    place-content: center;
    justify-items: center;
    gap: 10px;
    padding: 32px;
    text-align: center;
}




/* Assistant plein écran */
.wizard-shell {
    position: fixed;
    z-index: 200;
    inset: 0;
    width: 100%;
    height: var(--visual-viewport-height, 100dvh);
    min-height: 100svh;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    padding-top: var(--safe-top);
    padding-right: var(--safe-right);
    padding-bottom: max(var(--safe-bottom), var(--keyboard-inset));
    padding-left: var(--safe-left);
    background: var(--bg-deep);
    color: var(--text);
    overflow: hidden;
}

.wizard-header {
    min-height: 70px;
    display: grid;
    grid-template-columns: var(--touch-target) minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg-deep) 94%, transparent);
}

.wizard-header small,
.wizard-header h1 {
    display: block;
    margin: 0;
}

.wizard-header small {
    color: var(--muted);
    font-size: var(--fs-xs);
}

.wizard-header h1 {
    font-size: clamp(18px, 2vw, 24px);
    line-height: 1.2;
}

.wizard-save-status {
    min-width: 130px;
    color: var(--muted);
    font-size: var(--fs-xs);
    text-align: right;
}

.wizard-progress-region {
    padding: 12px 20px 10px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-soft);
}

.wizard-progress-copy {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
    font-size: var(--fs-sm);
}

.wizard-progress-region progress {
    width: 100%;
    height: 7px;
    display: block;
    border: 0;
    border-radius: 0;
    background: var(--surface-3);
    overflow: hidden;
    accent-color: var(--brand);
}

.wizard-progress-region progress::-webkit-progress-bar {
    background: var(--surface-3);
}

.wizard-progress-region progress::-webkit-progress-value {
    background: linear-gradient(90deg, var(--brand), #9e6cff);
}

.wizard-progress-region progress::-moz-progress-bar {
    background: linear-gradient(90deg, var(--brand), #9e6cff);
}

.wizard-step-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin: 9px 0 0;
    padding: 0;
    list-style: none;
    color: var(--muted);
    font-size: var(--fs-xs);
}

.wizard-step-list li {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wizard-step-list li.is-current,
.wizard-step-list li.is-complete {
    color: var(--text);
    font-weight: 700;
}

.wizard-step-list li.is-complete::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 9px;
    margin: 0 8px 1px 2px;
    border-right: 2px solid var(--green);
    border-bottom: 2px solid var(--green);
    transform: rotate(45deg);
}

.wizard-form {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
}

.error-summary {
    grid-row: 1;
    margin: 14px auto 0;
    width: min(900px, calc(100% - 32px));
    padding: 13px 15px;
    border: 1px solid var(--red);
    background: color-mix(in srgb, var(--red) 12%, var(--surface));
}

.error-summary h2 {
    margin: 0 0 6px;
    font-size: var(--fs-base);
}

.error-summary ul {
    margin: 0;
    padding-left: 20px;
    font-size: var(--fs-sm);
}

.error-summary a {
    color: var(--text);
}

.wizard-step {
    grid-row: 2;
    min-width: 0;
    min-height: 0;
    width: min(960px, 100%);
    margin: 0 auto;
    padding: clamp(22px, 4vw, 48px) clamp(18px, 5vw, 60px) 120px;
    border: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.wizard-step legend {
    width: 100%;
    margin: 0 0 8px;
    padding: 0;
    font-size: clamp(21px, 3vw, 31px);
    font-weight: 800;
    letter-spacing: -0.025em;
}


.choice-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.choice-card {
    position: relative;
    min-height: 165px;
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 20px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    cursor: pointer;
}

.choice-card:hover {
    border-color: color-mix(in srgb, var(--brand) 70%, var(--line-strong));
    background: var(--surface-2);
}

.choice-card:has(input:checked) {
    border-color: var(--brand);
    box-shadow: inset 4px 0 0 var(--brand);
    background: color-mix(in srgb, var(--brand) 9%, var(--surface));
}

.choice-card input {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 20px;
    height: 20px;
    accent-color: var(--brand);
}

.choice-card > span {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    background: var(--brand-soft);
    color: #bca8ff;
    font-size: var(--fs-xl);
}

.choice-card strong {
    font-size:var(--fs-md);
}

.choice-card small {
    color: var(--muted);
    line-height: 1.45;
}








.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"],
.field select[aria-invalid="true"],
.choice-card input[aria-invalid="true"] ~ strong {
    border-color: var(--red);
}



.upload-zone {
    min-height: 180px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    margin-bottom: 22px;
    padding: 25px;
    border: 1px dashed var(--line-strong);
    background: var(--surface-soft);
    text-align: center;
    cursor: pointer;
}

.upload-zone:hover,
.upload-zone:focus-within {
    border-color: var(--brand);
    background: color-mix(in srgb, var(--brand) 7%, var(--surface-soft));
}

.upload-zone input {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    opacity: 0;
}

.upload-zone > span {
    font-size:var(--fs-2xl);
    color: #b59cff;
}

.upload-zone small {
    max-width: 560px;
    color: var(--muted);
    line-height: 1.45;
}

.wizard-summary {
    display: grid;
    gap: 1px;
    margin: 24px 0;
    border: 1px solid var(--line);
    background: var(--line);
}

.wizard-summary > div {
    display: grid;
    grid-template-columns: minmax(150px, 28%) minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
    padding: 14px;
    background: var(--surface);
}

.wizard-summary dt {
    color: var(--muted);
    font-size: var(--fs-sm);
}

.wizard-summary dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.wizard-summary button {
    min-height: 38px;
}

.wizard-notice {
    padding: 14px;
    border-left: 4px solid var(--orange);
    background: color-mix(in srgb, var(--orange) 9%, var(--surface));
}

.wizard-notice p {
    margin: 5px 0 0;
    color: var(--muted);
}

.wizard-actions {
    grid-row: 3;
    position: relative;
    z-index: 3;
    min-height: 72px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 10px max(20px, var(--safe-right)) max(10px, var(--safe-bottom)) max(20px, var(--safe-left));
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg-deep) 96%, transparent);
    box-shadow: 0 -8px 24px rgb(0 0 0 / 14%);
}

.wizard-actions .button {
    min-height: 46px;
    min-width: 120px;
}

.wizard-save-exit {
    margin-right: auto;
}

.wizard-confirmation {
    grid-row: 2;
    min-height: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 12px;
    padding: 40px 20px 120px;
    text-align: center;
    overflow: auto;
}

.wizard-confirmation > span {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    border: 1px solid var(--green);
    border-radius: 50%;
    background: color-mix(in srgb, var(--green) 14%, var(--surface));
    color: var(--green);
    font-size:var(--fs-2xl);
}

.wizard-confirmation h2,
.wizard-confirmation p {
    margin: 0;
}

.wizard-confirmation p {
    max-width: 600px;
    color: var(--muted);
    line-height: 1.55;
}

/* Tablette : rail, split view et détails en tiroir */
@media (max-width: 1100px) and (min-width: 701px) and (min-height: 521px) {
    :root {
        --sidebar-w: 72px;
        --topbar-h: calc(60px + var(--safe-top));
    }

    .workspace {
        min-height: 100dvh;
        grid-template-rows: var(--topbar-h) minmax(calc(100dvh - var(--topbar-h)), auto);
    }

    .workspace-topbar {
        grid-template-columns: 72px minmax(220px, 1fr) auto auto;
        gap: 8px;
        min-height: var(--topbar-h);
        height: var(--topbar-h);
        padding: calc(7px + var(--safe-top)) max(10px, var(--safe-right)) 7px max(10px, var(--safe-left));
    }

    .wordmark span,
    .top-filter,
    .profile-button,
    .top-actions .icon-button:not([data-theme-toggle]),
    .global-search kbd {
        display: none;
    }

    .wordmark {
        justify-content: center;
    }

    .tablet-create-button {
        display: inline-grid;
        min-width: var(--touch-target);
        min-height: var(--touch-target);
        border-color: var(--brand);
        background: var(--brand);
        color: #fff;
    }

    .sidebar {
        top: var(--topbar-h);
        height: calc(100dvh - var(--topbar-h));
        padding-right: 8px;
        padding-left: max(8px, var(--safe-left));
    }

    .sidebar .nav-item {
        justify-content: center;
        min-height: 50px;
        padding: 0;
        font-size: 0;
    }

    .sidebar .nav-item span {
        width: auto;
        font-size:var(--fs-xl);
    }

    .sidebar-collapse {
        display: none;
    }

    .dashboard {
        padding: 8px max(8px, var(--safe-right)) max(12px, var(--safe-bottom)) 8px;
    }

    .connection-banner {
        display: flex;
        margin: -8px calc(-1 * max(8px, var(--safe-right))) 8px -8px;
    }

    .ticket-list {
        height: calc(100% - 118px);
        overflow: auto;
        overscroll-behavior: contain;
    }

    .message-stream {
        min-height: 0;
        height: auto;
        overflow: auto;
        overscroll-behavior: contain;
    }

    .composer {
        position: static;
        height: 92px;
        background: var(--bg-deep);
    }

    .header-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .panel-title-actions [data-open-wizard] {
        display: inline-grid;
    }
}

/* Mobile : flux séquentiel bord à bord */
@media (max-width: 700px), (max-height: 520px) and (max-width: 900px) {
    :root {
        --topbar-h: calc(56px + var(--safe-top));
        --sidebar-w: 0px;
    }

    html,
    body {
        min-height: 100%;
        overscroll-behavior-y: none;
    }

    .workspace {
        min-height: var(--visual-viewport-height, 100dvh);
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: var(--topbar-h) minmax(0, 1fr);
        padding: 0;
        background: var(--bg);
    }

    .workspace-topbar {
        position: sticky;
        top: 0;
        z-index: 50;
        grid-column: 1;
        display: grid;
        grid-template-columns: var(--touch-target) var(--touch-target) minmax(0, 1fr) var(--touch-target);
        gap: 6px;
        height: var(--topbar-h);
        min-height: var(--topbar-h);
        padding: calc(6px + var(--safe-top)) max(8px, var(--safe-right)) 6px max(8px, var(--safe-left));
        border-bottom: 1px solid var(--line);
    }

    .mobile-menu-button,
    .tablet-create-button {
        display: inline-grid;
        width: var(--touch-target);
        height: var(--touch-target);
    }

    .tablet-create-button {
        border-color: var(--brand);
        background: var(--brand);
        color: #fff;
    }

    .wordmark {
        width: var(--touch-target);
        justify-content: center;
    }

    .wordmark img {
        width: 32px;
        height: 32px;
    }

    .wordmark span,
    .top-filter,
    .profile-button,
    .top-actions,
    .global-search kbd {
        display: none;
    }

    .global-search {
        min-width: 0;
        height: var(--touch-target);
        border-radius: 0;
    }

    .global-search input {
        font-size:var(--fs-md);
    }

    .sidebar {
        position: fixed;
        z-index: 120;
        inset: 0 auto 0 0;
        width: min(86vw, 340px);
        height: var(--visual-viewport-height, 100dvh);
        display: flex !important;
        padding: var(--safe-top) 10px var(--safe-bottom) max(10px, var(--safe-left));
        transform: translateX(-105%);
        transition: transform .2s ease;
        box-shadow: 20px 0 45px rgb(0 0 0 / 35%);
    }

    .workspace.is-navigation-open .sidebar {
        transform: translateX(0);
    }

    .mobile-drawer-header {
        min-height: 58px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 4px 8px;
        border-bottom: 1px solid var(--line);
        font-size:var(--fs-md);
    }

    .sidebar nav {
        margin-top: 10px;
    }

    .sidebar .nav-item {
        min-height: 52px;
        justify-content: flex-start;
        padding: 0 12px;
        font-size: var(--fs-base);
    }

    .sidebar .nav-item span {
        font-size:var(--fs-xl);
    }

    .sidebar-collapse {
        display: none;
    }

    .navigation-scrim {
        position: fixed;
        z-index: 110;
        inset: 0;
        display: block;
        background: rgb(2 8 20 / 62%);
        backdrop-filter: blur(2px);
    }

    .dashboard {
        grid-column: 1;
        min-width: 0;
        min-height: 0;
        height: calc(var(--visual-viewport-height, 100dvh) - var(--topbar-h));
        padding: 0 0 calc(var(--mobile-bar-h) + var(--safe-bottom));
        overflow: hidden;
    }

    .connection-banner {
        display: flex;
    }

    .mobile-context-header {
        min-height: 52px;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 7px;
        padding: 4px max(8px, var(--safe-right)) 4px max(8px, var(--safe-left));
        border-bottom: 1px solid var(--line);
        background: var(--surface-soft);
    }

    .mobile-context-header > div {
        min-width: 0;
    }

    .mobile-context-header small,
    .mobile-context-header strong {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-context-header small {
        color: var(--muted);
        font-size: var(--fs-xs);
    }

    .mobile-context-header strong {
        font-size: var(--fs-base);
    }

    .workspace[data-mobile-view="queue"] [data-mobile-screen]:not([data-mobile-screen="queue"]),
    .workspace[data-mobile-view="ticket"] [data-mobile-screen]:not([data-mobile-screen="ticket"]),
    .workspace[data-mobile-view="details"] [data-mobile-screen]:not([data-mobile-screen="details"]) {
        display: none;
    }

    .workspace[data-mobile-view="queue"] [data-mobile-screen="queue"]:not([hidden]),
    .workspace[data-mobile-view="ticket"] [data-mobile-screen="ticket"]:not([hidden]),
    .workspace[data-mobile-view="details"] [data-mobile-screen="details"]:not([hidden]) {
        display: grid;
    }

    .panel-title {
        min-height: 48px;
        height: auto;
        padding: 5px max(10px, var(--safe-right)) 5px max(10px, var(--safe-left));
    }

    .panel-title h2 {
        font-size: var(--fs-md);
    }

    .panel-title .icon-button,
    .panel-title-actions [data-open-wizard] {
        display: inline-grid;
        min-width: var(--touch-target);
        min-height: var(--touch-target);
    }

    .panel-search {
        height: 46px;
        margin: 0 max(8px, var(--safe-right)) 8px max(8px, var(--safe-left));
        border-radius: 0;
    }

    .panel-search input {
        font-size:var(--fs-md);
    }

    .ticket-list {
        height: calc(100% - 139px);
        padding: 0;
        overflow-y: auto;
        overscroll-behavior-y: contain;
        scroll-padding-bottom: calc(var(--mobile-bar-h) + var(--safe-bottom));
    }

    .ticket-row {
        min-height: 68px;
        height: auto;
        grid-template-columns: 40px minmax(0, 1fr) auto;
        gap: 10px;
        padding: 9px max(12px, var(--safe-right)) 9px max(12px, var(--safe-left));
        border-inline: 0;
        border-radius: 0;
    }

    .ticket-row .avatar {
        width: 40px;
        height: 40px;
    }

    .ticket-copy strong {
        font-size: var(--fs-base);
    }

    .ticket-copy small,
    .ticket-meta time {
        font-size: var(--fs-xs);
    }

    .panel-footer-link {
        min-height: 50px;
        height: auto;
        padding: 8px max(12px, var(--safe-right)) 8px max(12px, var(--safe-left));
    }

    .ticket-header {
        min-height: 0;
        display: block;
        padding: 13px max(12px, var(--safe-right)) 11px max(12px, var(--safe-left));
    }

    .ticket-header h1 {
        margin-bottom: 9px;
        font-size:var(--fs-lg);
        line-height: 1.22;
    }

    .ticket-status {
        gap: 7px;
        flex-wrap: wrap;
        font-size: var(--fs-xs);
    }

    .header-actions {
        display: none;
    }

    .tabs {
        height: 48px;
        gap: 2px;
        padding: 0 max(7px, var(--safe-left));
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scrollbar-width: none;
    }

    .tabs::-webkit-scrollbar {
        display: none;
    }

    .tabs button {
        flex: 0 0 auto;
        min-width: max-content;
        padding: 0 10px;
        font-size: var(--fs-sm);
    }

    .message-stream {
        min-height: 0;
        height: auto;
        padding: 10px max(10px, var(--safe-right)) 14px max(10px, var(--safe-left));
        overflow-y: auto;
        overscroll-behavior-y: contain;
        scroll-padding-bottom: 130px;
    }

    .message {
        grid-template-columns: 36px minmax(0, 1fr);
        margin-bottom: 10px;
        padding: 10px;
        border-radius: 0;
    }

    .message .avatar {
        width: 36px;
        height: 36px;
    }

    .message header {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .message header strong {
        font-size: var(--fs-sm);
    }

    .message header time {
        flex-basis: 100%;
        margin-left: 0;
    }

    .message p {
        font-size: var(--fs-sm);
        line-height: 1.55;
    }

    .composer {
        position: sticky;
        bottom: 0;
        width: 100%;
        height: auto;
        min-height: 116px;
        margin: 0;
        border-inline: 0;
        border-bottom: 0;
        border-radius: 0;
        padding-bottom: var(--keyboard-inset);
        background: var(--bg-deep);
    }

    .composer-tabs {
        height: 36px;
    }

    .composer textarea {
        height: 45px;
        padding: 10px 12px;
        font-size:var(--fs-md);
    }

    .composer-actions {
        min-height: 42px;
        padding: 4px max(8px, var(--safe-right)) 5px max(8px, var(--safe-left));
    }

    .composer-actions .button {
        min-height: var(--touch-target);
        min-width: 100px;
    }

    .details-panel {
        position: static;
        transform: none;
        overflow-y: auto;
        overscroll-behavior-y: contain;
        padding-bottom: calc(var(--mobile-bar-h) + var(--safe-bottom));
    }

    .details-close {
        display: inline-grid;
    }

    .details-list {
        padding: 5px max(14px, var(--safe-right)) 12px max(14px, var(--safe-left));
    }

    .details-list > div {
        grid-template-columns: 1fr;
        gap: 4px;
        min-height: 0;
        padding: 11px 0;
        border-bottom: 1px solid var(--line);
    }

    .details-list dt,
    .details-list dd {
        font-size: var(--fs-sm);
    }

    .timeline {
        padding: 14px max(14px, var(--safe-right)) 8px max(14px, var(--safe-left));
    }

    .timeline h3 {
        font-size: var(--fs-base);
    }

    .timeline li {
        min-height: 60px;
    }

    .timeline strong,
    .timeline small,
    .timeline time {
        font-size: var(--fs-xs);
    }

    .mobile-action-bar {
        position: fixed;
        z-index: 60;
        right: 0;
        bottom: 0;
        left: 0;
        min-height: calc(var(--mobile-bar-h) + var(--safe-bottom));
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        padding: 4px var(--safe-right) var(--safe-bottom) var(--safe-left);
        border-top: 1px solid var(--line);
        background: color-mix(in srgb, var(--bg-deep) 96%, transparent);
        backdrop-filter: blur(16px);
    }

    .mobile-action-bar button {
        min-width: 0;
        min-height: 56px;
        display: grid;
        place-content: center;
        gap: 2px;
        border: 0;
        background: transparent;
        color: var(--muted);
    }

    .mobile-action-bar button[aria-current="page"] {
        color: #b59dff;
        box-shadow: inset 0 3px 0 var(--brand);
    }

    .mobile-action-bar button > span {
        font-size:var(--fs-lg);
        line-height: 1;
    }

    .mobile-action-bar small {
        font-size: var(--fs-xs);
    }

    .state-surface {
        height: calc(100% - 52px);
        display: grid;
        padding-right: max(24px, var(--safe-right));
        padding-left: max(24px, var(--safe-left));
    }

    .wizard-header {
        min-height: 64px;
        grid-template-columns: var(--touch-target) minmax(0, 1fr);
        padding: 8px max(10px, var(--safe-right)) 8px max(10px, var(--safe-left));
    }

    .wizard-save-status {
        grid-column: 2;
        min-width: 0;
        margin-top: -8px;
        text-align: left;
    }

    .wizard-progress-region {
        padding: 10px max(12px, var(--safe-right)) 9px max(12px, var(--safe-left));
    }

    .wizard-step-list {
        grid-template-columns: repeat(5, minmax(52px, 1fr));
        overflow-x: auto;
    }

    .wizard-step {
        width: 100%;
        padding: 22px max(16px, var(--safe-right)) calc(125px + var(--keyboard-inset)) max(16px, var(--safe-left));
        scrollbar-gutter: auto;
    }

    .choice-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .choice-card {
        min-height: 120px;
        grid-template-columns: 44px minmax(0, 1fr);
        align-items: start;
        align-content: center;
    }

    .choice-card input {
        top: 12px;
        right: 12px;
    }

    .choice-card > span {
        grid-row: 1 / span 2;
    }

    .choice-card small {
        grid-column: 2;
    }

    .wizard-summary > div {
        grid-template-columns: 1fr auto;
    }

    .wizard-summary dt {
        grid-column: 1;
    }

    .wizard-summary dd {
        grid-column: 1 / -1;
    }

    .wizard-summary button {
        grid-column: 2;
        grid-row: 1;
    }

    .wizard-actions {
        min-height: calc(70px + var(--safe-bottom));
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        gap: 8px;
        padding: 8px max(10px, var(--safe-right)) max(8px, var(--safe-bottom)) max(10px, var(--safe-left));
    }

    .wizard-actions .button {
        min-width: 0;
        min-height: 48px;
    }

    .wizard-save-exit {
        display: none;
    }

    .wizard-actions [data-wizard-next] {
        grid-column: 2;
    }

    .wizard-actions [data-wizard-prev] {
        grid-column: 1;
    }
}

@media (max-width: 900px) and (orientation: landscape) and (max-height: 520px) {
    :root {
        --mobile-bar-h: 54px;
    }

    .workspace-topbar {
        grid-template-columns: var(--touch-target) var(--touch-target) minmax(0, 1fr) var(--touch-target);
    }

    .mobile-context-header {
        min-height: 44px;
    }

    .ticket-header {
        padding-block: 8px;
    }

    .ticket-header h1 {
        font-size:var(--fs-md);
    }

    .ticket-status span:last-child {
        display: none;
    }

    .wizard-progress-region {
        padding-block: 6px;
    }

    .wizard-step-list {
        display: none;
    }

    .wizard-step {
        padding-top: 14px;
    }
}

/* Container queries : composants étroits, split redimensionné et fenêtres intégrées */
@container (max-width: 390px) {
    .details-list > div {
        grid-template-columns: 1fr;
    }

    .priority-content {
        grid-template-columns: 1fr;
        height: auto;
    }
}

@container (max-width: 620px) {
    .kanban {
        grid-template-columns: 1fr 1fr;
        overflow: auto;
    }

    .kanban > div {
        height: auto;
        min-height: 150px;
    }
}

@container (max-width: 680px) {
    .form-grid,
    .choice-grid {
        grid-template-columns: 1fr;
    }
}

/* Fenêtres pliables à deux segments lorsque le navigateur expose l’API. */


@media (prefers-contrast: more) {
    :root {
        --line: color-mix(in srgb, currentColor 38%, transparent);
        --line-strong: color-mix(in srgb, currentColor 58%, transparent);
        --focus: #ffd54a;
    }

    .button.primary,
    .tablet-create-button {
        border: 2px solid currentColor;
        background: var(--brand-strong);
    }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .details-panel {
        transition: none !important;
    }
}

@media print {
    .workspace-topbar,
    .sidebar,
    .mobile-action-bar,
    .wizard-shell,
    .connection-banner {
        display: none !important;
    }

    .dashboard {
        padding: 0;
    }
}
