/* EVO FA — système de tickets (pages tickets.html, ticket.html, staff.html) */

* { margin: 0; padding: 0; box-sizing: border-box; }
button { font: inherit; color: inherit; }

:root {
    --accent: #ff6b00;
    --black: #0a0a0a;
    --dark: #141414;
    --card: #1a1a1a;
    --line: #2a2a2a;
    --line-soft: #1f1f1f;
    --muted: #9a9a9a;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    background: var(--black);
    color: #d0d0d0;
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

/* Nav */
nav.top {
    position: fixed;
    inset: 0 0 auto 0;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    z-index: 999;
    border-bottom: 2px solid var(--accent);
}
.nav-container {
    max-width: 1500px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.25rem;
    padding: 1rem 2rem;
    flex-wrap: wrap;
}
.nav-logo {
    font-size: 1.4rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent);
    letter-spacing: 0.18em;
    text-decoration: none;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
    flex-wrap: wrap;
}
.nav-links a {
    color: #fff;
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.09em;
    font-size: 0.92rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.nav-links a:hover { color: var(--accent); }
.nav-badge {
    background: var(--accent);
    color: #0a0a0a;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0;
}

/* Shell */
.wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 110px 2rem 5rem;
}
.wrap.narrow { max-width: 820px; }
.wrap.wide { max-width: 1300px; }

.page-head { margin-bottom: 2rem; }
.page-head h1 {
    color: #fff;
    font-size: 1.8rem;
    font-weight: 700;
}
.page-head p { color: var(--muted); margin-top: 0.4rem; }

.breadcrumb {
    font-size: 0.82rem;
    color: #7a7a7a;
    margin-bottom: 1rem;
}
.breadcrumb a { color: #9a9a9a; text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span::before { content: "›"; margin: 0 0.5rem; color: #555; }

/* Boutons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent);
    color: #0a0a0a;
    border: 0;
    border-radius: 6px;
    padding: 0.6rem 1.1rem;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    text-decoration: none;
    line-height: 1;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { background: #ff8c1a; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn.ghost {
    background: transparent;
    color: #d0d0d0;
    border: 1px solid var(--line);
    font-weight: 600;
}
.btn.ghost:hover { background: transparent; border-color: var(--accent); color: #fff; }
.btn.sm { padding: 0.4rem 0.7rem; font-size: 0.78rem; }
.btn.icon-btn { padding: 0.55rem 0.7rem; font-size: 1rem; }
.btn.icon-btn i { margin: 0; }

/* Badges de statut */
.badge {
    display: inline-block;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border: 1px solid transparent;
    white-space: nowrap;
}
.st-open      { color: #ffb27a; background: rgba(255, 107, 0, 0.12); border-color: rgba(255, 107, 0, 0.4); }
.st-awaiting  { color: #ff9b9d; background: rgba(229, 72, 77, 0.14); border-color: rgba(229, 72, 77, 0.45); }
.st-progress  { color: #7db6ff; background: rgba(55, 138, 221, 0.14); border-color: rgba(55, 138, 221, 0.4); }
.st-waiting   { color: #e0c66a; background: rgba(224, 198, 106, 0.12); border-color: rgba(224, 198, 106, 0.4); }
.st-resolved  { color: #7fe0a3; background: rgba(61, 214, 140, 0.12); border-color: rgba(61, 214, 140, 0.4); }
.st-closed    { color: #9a9a9a; background: rgba(255, 255, 255, 0.05); border-color: var(--line); }

.cat-tag {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #8a8a8a;
}

/* Liste de tickets */
.ticket-list { display: flex; flex-direction: column; gap: 0.6rem; }
.ticket-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
    background: var(--card);
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease;
}
.ticket-row:hover { border-color: var(--line); }
.ticket-row .dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--accent);
    flex: 0 0 auto;
}
.ticket-row .dot.hidden { visibility: hidden; }
.ticket-main { min-width: 0; }
.ticket-main .subject {
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ticket-meta {
    font-size: 0.8rem;
    color: #7a7a7a;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}
.ticket-meta .ref { font-variant-numeric: tabular-nums; color: #8a8a8a; }
.ticket-right { display: flex; align-items: center; gap: 0.75rem; }
.ticket-right .who { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: #b0b0b0; }
.ticket-right .who img { width: 24px; height: 24px; border-radius: 50%; }

/* Formulaires */
.card {
    background: var(--card);
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    padding: 1.5rem;
}
.field { margin-bottom: 1.1rem; }
.field label {
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 0.4rem;
}
.field input,
.field select,
.field textarea {
    width: 100%;
    background: var(--black);
    border: 1px solid var(--line);
    border-radius: 6px;
    color: #fff;
    font: inherit;
    font-size: 0.95rem;
    padding: 0.6rem 0.75rem;
}
.field textarea { resize: vertical; min-height: 120px; line-height: 1.55; }
.field input:focus,
.field select:focus,
.field textarea:focus { outline: none; border-color: var(--accent); }
.field .hint { font-size: 0.78rem; color: #6a6a6a; margin-top: 0.3rem; }
.form-error {
    color: #ff9b9d;
    background: rgba(229, 72, 77, 0.1);
    border: 1px solid rgba(229, 72, 77, 0.4);
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
    font-size: 0.88rem;
    margin-bottom: 1rem;
}
.form-actions { display: flex; gap: 0.75rem; align-items: center; }

/* Fil de discussion */
.thread { display: flex; flex-direction: column; gap: 1rem; margin: 1.5rem 0; }
.msg {
    background: var(--card);
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    padding: 0.9rem 1.1rem;
    max-width: 85%;
}
.msg.mine { align-self: flex-end; border-color: rgba(255, 107, 0, 0.25); }
.msg.staff { border-left: 3px solid var(--accent); }
.msg-head {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.45rem;
    font-size: 0.85rem;
}
.msg-head img { width: 26px; height: 26px; border-radius: 50%; }
.msg-head .name { font-weight: 600; color: #fff; }
.msg-head .tag {
    font-size: 0.64rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    border: 1px solid rgba(255, 107, 0, 0.4);
    border-radius: 4px;
    padding: 0.05rem 0.35rem;
}
.msg-head time { color: #6a6a6a; margin-left: auto; }
.msg-body { line-height: 1.6; font-size: 0.97rem; color: #d8d8d8; word-wrap: break-word; }
.msg-body a { word-break: break-all; }
.msg-body strong { color: #fff; }
.msg-body em { font-style: italic; }
.msg-body del { color: #8a8a8a; }
.msg-body code {
    background: #0d0d0d;
    border: 1px solid var(--line-soft);
    border-radius: 4px;
    padding: 0.05rem 0.35rem;
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
    font-size: 0.9em;
}
.msg-body pre {
    background: #0d0d0d;
    border: 1px solid var(--line-soft);
    border-radius: 6px;
    padding: 0.7rem 0.9rem;
    overflow-x: auto;
    margin: 0.6rem 0;
}
.msg-body pre code { background: none; border: 0; padding: 0; }
.msg-body blockquote {
    border-left: 3px solid var(--line);
    margin: 0.5rem 0;
    padding: 0.2rem 0 0.2rem 0.8rem;
    color: #b0b0b0;
}
.msg-body ul, .msg-body ol { margin: 0.5rem 0; padding-left: 1.4rem; }
.msg-body li { margin: 0.2rem 0; }
.msg-body .md-img {
    display: block;
    max-width: 100%;
    max-height: 340px;
    border-radius: 6px;
    margin: 0.5rem 0;
}
.msg-body .md-vid,
.md-preview .md-vid {
    display: block;
    max-width: 100%;
    max-height: 360px;
    border-radius: 6px;
    margin: 0.5rem 0;
    background: #000;
}

/* Barre d'outils du champ de saisie */
.md-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.4rem;
}
.md-b {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 5px;
    color: #c8c8c8;
    padding: 0.3rem 0.55rem;
    font-size: 0.82rem;
    line-height: 1;
    cursor: pointer;
    min-width: 30px;
}
.md-b:hover { border-color: var(--accent); color: #fff; }
.md-b[disabled] { opacity: 0.5; cursor: progress; }
.md-b-preview { margin-left: auto; }
.md-upload {
    font-size: 0.8rem;
    color: #8a8a8a;
    margin-top: 0.4rem;
}
.md-upload.err { color: #ff9b9d; }

/* Bloc de pièces jointes (au-dessus du champ de saisie) */
.md-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: var(--black);
    border: 1px solid var(--line);
    border-radius: 8px;
}
.md-att {
    position: relative;
    width: 84px;
    height: 84px;
    border-radius: 6px;
    overflow: hidden;
    background: #000;
    flex: 0 0 auto;
}
.md-att img,
.md-att video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.md-att .x {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    line-height: 16px;
    text-align: center;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 0.85rem;
    cursor: pointer;
}
.md-att .x:hover { background: #e5484d; }
.md-att-tag {
    position: absolute;
    left: 3px;
    bottom: 3px;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(0, 0, 0, 0.65);
    color: #d0d0d0;
    padding: 0.05rem 0.3rem;
    border-radius: 3px;
}
.md-preview {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.8rem 0.9rem;
    min-height: 90px;
}

/* Participants (panel staff) */
.part-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0;
    font-size: 0.85rem;
}
.part-row img { width: 20px; height: 20px; border-radius: 50%; }
.part-row .x {
    margin-left: auto;
    background: none;
    border: 0;
    color: #ff9b9d;
    cursor: pointer;
    font-size: 0.9rem;
}
.part-results {
    border: 1px solid var(--line);
    border-radius: 6px;
    margin-top: 0.35rem;
    max-height: 180px;
    overflow-y: auto;
}
.part-results:empty { display: none; }
.part-results button {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--line-soft);
    padding: 0.4rem 0.6rem;
    color: #d0d0d0;
    cursor: pointer;
    font-size: 0.85rem;
}
.part-results button:last-child { border-bottom: 0; }
.part-results button:hover { background: rgba(255, 107, 0, 0.08); }
.part-results button img { width: 20px; height: 20px; border-radius: 50%; }

.event-sep {
    text-align: center;
    font-size: 0.78rem;
    color: #6a6a6a;
    position: relative;
    margin: 0.4rem 0;
}
.event-sep span {
    background: var(--black);
    padding: 0 0.75rem;
    position: relative;
    z-index: 1;
}
.event-sep::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 50%;
    border-top: 1px solid var(--line-soft);
}

.composer { margin-top: 1.5rem; }
.composer textarea {
    width: 100%;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: #fff;
    font: inherit;
    font-size: 0.97rem;
    padding: 0.8rem 0.9rem;
    line-height: 1.55;
    resize: vertical;
    min-height: 90px;
}
.composer textarea:focus { outline: none; border-color: var(--accent); }
.composer-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.55rem;
    font-size: 0.8rem;
    color: #6a6a6a;
}
.composer-closed {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.9rem 1.1rem;
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: 1.5rem;
}

/* Layout ticket (fil + panneau staff) */
.ticket-layout { display: grid; grid-template-columns: 1fr; gap: 2rem; }
.ticket-layout.with-panel { grid-template-columns: minmax(0, 1fr) 320px; }
/* les colonnes de grille ne doivent jamais forcer un débordement (pre, URLs longues) */
.ticket-layout > div { min-width: 0; }

/* Bouton d'ouverture/fermeture du panneau (dans l'en-tête du ticket) */
.panel-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: #c8c8c8;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.6rem;
}
.panel-toggle:hover { border-color: var(--accent); color: #fff; }
.panel-toggle i { transition: transform 0.15s ease; }
.panel-toggle.is-open i { transform: rotate(180deg); }

.staff-panel {
    background: var(--card);
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    align-self: start;
    position: sticky;
    top: 100px;
    overflow: hidden;
}
.sp-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.85rem 1.1rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--line-soft);
}
.sp-head .sp-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    font-weight: 700;
}
.sp-head .sp-close {
    background: none; border: 0; cursor: pointer;
    color: #7a7a7a; font-size: 1rem; line-height: 1;
    padding: 0.2rem 0.35rem; border-radius: 4px;
}
.sp-head .sp-close:hover { color: #fff; background: rgba(255,255,255,0.06); }
.sp-body { padding: 1.1rem; }

.sp-sec { padding: 1rem 0; border-top: 1px solid var(--line-soft); }
.sp-sec:first-child { padding-top: 0; border-top: 0; }
.sp-sec:last-child { padding-bottom: 0; }
.sp-sec > h3 {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #8a8a8a;
    margin: 0 0 0.7rem;
}

.staff-panel .who-line { display: flex; align-items: center; gap: 0.6rem; }
.staff-panel .who-line img { width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto; }
.staff-panel .who-line strong { color: #fff; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staff-panel dl { font-size: 0.84rem; margin-top: 0.7rem; display: flex; flex-direction: column; gap: 0.55rem; }
.staff-panel dl div { display: flex; flex-direction: column; gap: 0.1rem; }
.staff-panel dt { color: #7a7a7a; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.06em; }
.staff-panel dd {
    color: #e0e0e0; word-break: break-all;
    display: flex; align-items: center; gap: 0.4rem;
}
.staff-panel dd .copy {
    background: none; border: 1px solid var(--line); border-radius: 4px;
    color: #9a9a9a; cursor: pointer; font-size: 0.66rem; padding: 0.1rem 0.35rem; flex: 0 0 auto;
}
.staff-panel dd .copy:hover { border-color: var(--accent); color: #fff; }
.staff-panel select {
    width: 100%;
    background: var(--black);
    border: 1px solid var(--line);
    border-radius: 6px;
    color: #fff;
    font: inherit;
    font-size: 0.88rem;
    padding: 0.5rem 0.6rem;
    margin-bottom: 0.55rem;
}
.staff-panel .btn { width: 100%; justify-content: center; margin-bottom: 0.5rem; }
.staff-panel .btn:last-child { margin-bottom: 0; }
.staff-panel .btn.sm { width: auto; margin-bottom: 0; }
.sp-row { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.4rem; }
.sp-row .btn.sm { flex: 1 1 auto; }

/* Accès au ticket (panneau staff) */
.acc-note { font-size: 0.76rem; color: #7a7a7a; margin: 0 0 0.75rem; line-height: 1.5; }
.acc-group { margin-bottom: 0.9rem; }
.acc-group:last-child { margin-bottom: 0; }
.acc-h {
    display: block;
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #7a7a7a;
    margin-bottom: 0.35rem;
}
.acc-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.32rem 0;
    font-size: 0.85rem;
}
.acc-row img, .acc-noimg {
    width: 22px; height: 22px;
    border-radius: 50%;
    flex: 0 0 auto;
    background: var(--medium-gray);
}
.acc-name { color: #e8e8e8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.acc-role {
    margin-left: auto;
    flex: 0 0 auto;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.12rem 0.4rem;
    border-radius: 4px;
    border: 1px solid var(--line);
    color: #9a9a9a;
}
.acc-role.acc-admin { color: #ffb27a; border-color: rgba(255, 107, 0, 0.5); }
.acc-role.acc-support { color: #7db6ff; border-color: rgba(55, 138, 221, 0.5); }
.acc-row .x {
    flex: 0 0 auto;
    margin-left: 0.2rem;
    background: none; border: 0;
    color: #ff9b9d; cursor: pointer;
    font-size: 1.05rem; line-height: 1;
    padding: 0.2rem 0.35rem;
}
.acc-empty { font-size: 0.8rem; color: #7a7a7a; padding: 0.2rem 0; }
#partSearch {
    width: 100%;
    background: var(--black);
    border: 1px solid var(--line);
    border-radius: 6px;
    color: #fff;
    font: inherit;
    font-size: 0.88rem;
    padding: 0.5rem 0.6rem;
    margin-top: 0.4rem;
}
#partSearch:focus { outline: none; border-color: var(--accent); }

/* Dossier Archives (Mes tickets) */
.archive {
    margin-top: 1.5rem;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: var(--card);
}
.archive > summary {
    cursor: pointer;
    padding: 0.9rem 1.1rem;
    font-weight: 600;
    color: #c8c8c8;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.archive > summary::-webkit-details-marker { display: none; }
.archive > summary::after {
    content: "\25B8";
    margin-left: auto;
    color: #7a7a7a;
    transition: transform 0.15s ease;
}
.archive[open] > summary::after { transform: rotate(90deg); }
.archive > summary i { color: #7a7a7a; }
.archive #archiveCount { color: #7a7a7a; font-weight: 400; }
.archive .ticket-list { padding: 0 0.75rem 0.9rem; }
.archive .ticket-row { background: #161616; }

/* Filtres / compteurs (staff.html) */
.counters { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.counter {
    background: var(--card);
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    padding: 0.8rem 1.1rem;
    min-width: 120px;
}
.counter .n { font-size: 1.5rem; font-weight: 700; color: #fff; line-height: 1; }
.counter .l { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-top: 0.3rem; }

.filters {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1.25rem;
}
.filters select,
.filters input {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 6px;
    color: #fff;
    font: inherit;
    font-size: 0.88rem;
    padding: 0.45rem 0.65rem;
}
.filters input { flex: 1; min-width: 180px; }
.filters select:focus,
.filters input:focus { outline: none; border-color: var(--accent); }

.empty {
    text-align: center;
    color: #6a6a6a;
    padding: 3rem 1rem;
    border: 1px dashed var(--line);
    border-radius: 12px;
}

.needs-auth {
    text-align: center;
    padding: 3rem 1rem;
}
.needs-auth p { color: var(--muted); margin-bottom: 1.25rem; }

/* ============ RESPONSIVE ============ */

/* Empêche le zoom auto d'iOS au focus (police des champs >= 16px) */
@media (max-width: 820px) {
    .field input, .field select, .field textarea,
    .filters select, .filters input,
    .staff-panel select, .composer textarea,
    #partSearch, #fSearch {
        font-size: 16px;
    }
}

@media (max-width: 960px) {
    .ticket-layout.with-panel { display: flex; flex-direction: column; gap: 1.5rem; }
    .staff-panel { position: static; order: -1; }
}

@media (max-width: 820px) {
    .wrap { padding: 92px 1.25rem 4rem; }
    .page-head h1 { font-size: 1.5rem; }

    .filters { gap: 0.5rem; }
    .filters select { flex: 1 1 46%; min-width: 0; }
    .filters input { flex: 1 1 100%; min-width: 0; }

    .counters { gap: 0.5rem; }
    .counter { flex: 1 1 46%; min-width: 0; padding: 0.7rem 0.9rem; }
    .counter .n { font-size: 1.3rem; }

    .md-b { min-height: 34px; padding: 0.4rem 0.6rem; }
}

@media (max-width: 560px) {
    .wrap { padding: 88px 1rem 3.5rem; }

    .ticket-row {
        grid-template-columns: auto 1fr;
        gap: 0.75rem;
        padding: 0.85rem 1rem;
    }
    .ticket-right { grid-column: 1 / -1; justify-content: flex-start; flex-wrap: wrap; }
    .ticket-row .subject { white-space: normal; }
    .ticket-meta { gap: 0.5rem 0.6rem; }

    .msg { max-width: 100%; }
    .msg-head { flex-wrap: wrap; }
    .msg-head time { margin-left: 0; width: 100%; }

    .counter { flex: 1 1 100%; }

    .page-head[style] .btn:not(.icon-btn) { width: 100%; justify-content: center; }
    .page-head[style] .icon-btn { margin-left: auto; }
}
