:root {
    --bg: #f6f7f4;
    --surface: #ffffff;
    --surface-soft: #fbfcfa;
    --line: #d8ded5;
    --line-strong: #c8d1c4;
    --text: #1f2a24;
    --muted: #66736c;
    --primary: #276b5d;
    --primary-dark: #1e544a;
    --accent: #b45f3a;
    --warning: #a06a00;
    --danger: #a33a3a;
    --info: #2f5f98;
    --radius: 8px;
}

.problem-reference-config {
    display: grid;
    gap: 14px;
    min-width: 0;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
}

.workflow-reference-config {
    grid-column: 1 / -1;
    min-width: 0;
}

.workflow-reference-hint { grid-column: 1 / -1; }
.workflow-reference-config[hidden], .problem-reference-config[hidden] { display: none; }
.problem-reference-config > legend { font-weight: 600; }
.problem-reference-config .reference-file-drop { order: -1; }
.problem-reference-config [data-reference-columns] {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    align-items: start;
    gap: 20px;
}
.problem-reference-config [data-reference-columns] > label {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}
.problem-reference-config select { height: 42px; width: 100%; min-width: 0; }
.problem-reference-config .reference-column-list {
    max-height: 220px;
    overflow-y: auto;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
}
.problem-reference-config .check-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.problem-reference-config .check-row input { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; }

.reference-file-drop {
    display: grid;
    gap: 6px;
    padding: 16px;
    border: 1px dashed #9db3a8;
    background: #f8fbf9;
}

.reference-file-drop span {
    color: #165f52;
}

.reference-file-drop small {
    color: #63736c;
}

.reference-file-drop input[type="file"] {
    padding: 8px;
    background: #fff;
}

.reference-import-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-left: 4px solid #247565;
    background: #e7f3ef;
}

.reference-update-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-soft);
}

.reference-update-actions .field-note { margin: 0; }
.reference-update-actions button { flex: 0 0 auto; }

@media (max-width: 700px) {
    .reference-update-actions { align-items: stretch; flex-direction: column; }
    .reference-update-actions button { width: 100%; }
}

.reference-column-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.reference-lookup {
    display: grid;
    gap: 10px;
    padding: 16px;
    border: 1px solid #cbd8d1;
    background: #f8fbf9;
}

.reference-question {
    display: grid;
    gap: 8px;
    color: #52635c;
    font-weight: 600;
}

.reference-question .reference-lookup {
    gap: 8px;
    margin-top: 4px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-weight: 400;
}

.reference-question .reference-lookup > label {
    display: grid;
    gap: 6px;
}

.reference-question #problem-reference-status {
    margin: 2px 0 0;
    color: var(--muted);
    font-weight: 400;
    line-height: 1.4;
}

.reference-question .reference-lookup[data-verification-state="found"] #problem-reference-status,
.reference-question .reference-lookup[data-verification-state="missing"] #problem-reference-status,
.reference-question .reference-lookup[data-verification-state="unavailable"] #problem-reference-status {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    border-left: 3px solid var(--primary);
    border-radius: 0 5px 5px 0;
    background: #edf7f3;
    color: #205e4f;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
}

.reference-question .reference-lookup[data-verification-state="missing"] #problem-reference-status,
.reference-question .reference-lookup[data-verification-state="unavailable"] #problem-reference-status {
    border-left-color: #ac7934;
    background: #fff5e8;
    color: #765528;
}

.reference-question .reference-lookup[data-verification-state="found"] #problem-reference-status::before,
.reference-question .reference-lookup[data-verification-state="missing"] #problem-reference-status::before,
.reference-question .reference-lookup[data-verification-state="unavailable"] #problem-reference-status::before {
    content: "✓";
    display: grid;
    flex: 0 0 20px;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #2b8065;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.reference-question .reference-lookup[data-verification-state="missing"] #problem-reference-status::before,
.reference-question .reference-lookup[data-verification-state="unavailable"] #problem-reference-status::before {
    content: "!";
    background: #ac7934;
}

.reference-lookup[hidden] {
    display: none;
}

.ticket-create-form #diagnostic-result {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 14px 0 0;
    padding: 12px 14px;
    border-left-width: 3px;
    border-radius: 0 5px 5px 0;
    background: #edf7f3;
    color: #205e4f;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
}

.ticket-create-form #diagnostic-result::before {
    content: "✓";
    display: grid;
    flex: 0 0 20px;
    place-items: center;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    border-radius: 50%;
    background: #2b8065;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.ticket-create-form #diagnostic-result[data-tone="neutral"] {
    border-left-color: #b9c8c8;
    background: #f3f6f6;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
}

.ticket-create-form #diagnostic-result[data-tone="neutral"]::before {
    content: none;
}

.ticket-create-form .message-box-custom[data-message-symbol] {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.ticket-create-form #diagnostic-result.message-box-custom[data-message-symbol]::before,
.ticket-create-form #diagnostic-blocker.message-box-custom[data-message-symbol]::before,
.ticket-create-form #category-procedure.message-box-custom[data-message-symbol]::before,
.ticket-create-form .reference-question #problem-reference-status.message-box-custom[data-message-symbol]::before {
    content: attr(data-message-symbol);
    display: grid;
    flex: 0 0 20px;
    place-items: center;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    border-radius: 50%;
    background: var(--box-accent);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}
.ticket-create-form .message-box-custom[data-message-symbol=""]::before,
.ticket-create-form .reference-question #problem-reference-status.message-box-custom[data-message-symbol=""]::before {
    content: none !important;
    display: none !important;
}
.ticket-create-form #problem-info-panel.message-box-custom { display: block; }
.ticket-create-form #problem-info-panel.message-box-custom[data-message-symbol]:not([data-message-symbol=""])::before {
    content: attr(data-message-symbol);
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    margin-right: 7px;
    border-radius: 50%;
    background: var(--box-accent);
    color: #fff;
    font-size: 12px;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

body::before {
    content: "";
    position: fixed;
    inset: 0 0 auto;
    height: 3px;
    background: var(--primary);
    z-index: 20;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 64px;
    padding: 12px 32px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 24px rgba(31, 42, 36, .05);
}

.brand {
    color: var(--text);
    font-weight: 800;
    font-size: 20px;
}

.nav {
    display: flex;
    gap: 6px;
    flex: 1;
}

.nav a {
    padding: 8px 10px;
    border-radius: 6px;
    color: var(--muted);
    font-weight: 700;
}

.nav a:hover {
    background: #eef1ed;
    color: var(--primary);
    text-decoration: none;
}

.nav a[aria-current="page"] {
    background: #e0f0ea;
    color: var(--primary-dark);
}

.logout {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
}

.account-link {
    color: var(--primary);
    font-weight: 700;
}

.page {
    width: min(1120px, calc(100% - 32px));
    margin: 28px auto 44px;
}

.page-head,
.ticket-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 4px;
    font-size: 32px;
    line-height: 1.15;
}

h2 {
    font-size: 20px;
    line-height: 1.25;
}

.page-head p,
.ticket-head p {
    color: var(--muted);
}

.auth-panel,
.notice {
    max-width: 440px;
    margin: 80px auto;
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.form {
    display: grid;
    gap: 16px;
}

.compact-form {
    gap: 10px;
}

.settings-tabs {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    overflow-x: auto;
}

.settings-tab {
    min-height: 34px;
    padding: 7px 11px;
    white-space: nowrap;
}

.settings-tab.is-active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.settings-tab.is-active .badge {
    background: rgba(255, 255, 255, .18);
    color: #fff;
}

.settings-panel {
    margin-bottom: 16px;
}

.settings-panel[hidden] {
    display: none !important;
}

.settings-panel.form.wide,
.settings-panel.settings-test {
    padding: 14px;
}

.settings-panel fieldset {
    padding: 12px;
}

.settings-panel input,
.settings-panel select,
.settings-panel textarea {
    padding: 8px 10px;
}

.form.wide,
.details,
.comments,
.status-form,
.filters,
.table-wrap {
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 10px 28px rgba(31, 42, 36, .04);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.summary-card {
    display: grid;
    gap: 4px;
    min-height: 78px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 8px 20px rgba(31, 42, 36, .035);
}

.summary-card:hover {
    text-decoration: none;
}

.summary-card span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.summary-card strong {
    font-size: 28px;
    line-height: 1;
}

.summary-card.is-warning {
    border-color: #ecd1c3;
    background: #fff8f4;
}

.summary-card.is-danger {
    border-color: #e2b8b8;
    background: #fff1ef;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.compact-ticket-list,
.metric-list {
    display: grid;
    gap: 10px;
}

.compact-ticket,
.metric-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-soft);
}

.compact-ticket a {
    color: var(--text);
    font-weight: 800;
}

.compact-ticket small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
}

.metric-list span {
    color: var(--muted);
    font-weight: 800;
}

.metric-list strong {
    font-size: 22px;
}

.compact-summary {
    grid-template-columns: repeat(4, minmax(140px, 1fr));
}

label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    background: #fff;
    font: inherit;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(39, 107, 93, .14);
}

fieldset {
    margin: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
}

legend {
    padding: 0 6px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.role-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
}

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-weight: 700;
}

.checkbox input {
    width: auto;
}

.field-note {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.resident-picker {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fbfcfa;
    position: relative;
}

.field-label {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.resident-toggle {
    width: 100%;
    padding: 10px 40px 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    position: relative;
}

.resident-toggle::after {
    content: "";
    position: absolute;
    right: 14px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: translateY(-65%) rotate(45deg);
}

.resident-dropdown {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 16px 36px rgba(31, 42, 36, .16);
    z-index: 20;
}

.resident-results {
    display: grid;
    gap: 4px;
    max-height: 260px;
    overflow: auto;
}

.resident-option {
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.resident-option:hover,
.resident-option[aria-selected="true"] {
    background: #e0f0ea;
    color: var(--primary);
}

.resident-empty {
    margin: 0;
    padding: 10px;
    color: var(--muted);
}

textarea {
    resize: vertical;
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease, transform .15s ease;
}

button:hover,
.button:hover {
    text-decoration: none;
    border-color: var(--primary);
    transform: translateY(-1px);
}

.primary {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.primary:hover {
    border-color: var(--primary-dark);
    background: var(--primary-dark);
}

.danger {
    border-color: var(--danger);
    color: var(--danger);
}

.danger:hover {
    border-color: var(--danger);
    background: #f8e6df;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(31, 42, 36, .42);
}

.modal-panel {
    width: min(640px, 100%);
    display: grid;
    gap: 16px;
    padding: 20px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(31, 42, 36, .24);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.modal-head h2 {
    margin: 0;
}

.modal-close {
    min-width: 40px;
    padding: 0;
    font-size: 24px;
    line-height: 1;
}

button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.grid {
    display: grid;
    gap: 16px;
}

.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.compact-actions {
    justify-content: flex-start;
    margin-bottom: 12px;
}

.filters {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(0, 1fr)) auto;
    gap: 16px;
    align-items: end;
    margin-bottom: 20px;
}

.ticket-filters {
    grid-template-columns: repeat(4, minmax(130px, 1fr)) auto;
}

.filters button {
    min-width: 110px;
}

.page-actions {
    display: flex;
    align-items: end;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.view-as-compact {
    display: flex;
    align-items: end;
    gap: 8px;
}

.view-as-compact label {
    width: 230px;
}

.view-as-compact select,
.view-as-compact button {
    min-height: 38px;
    padding-top: 8px;
    padding-bottom: 8px;
}

.view-as-compact button {
    min-width: 64px;
}

.view-as-inline-note {
    margin: -10px 0 18px;
    color: #8a5a10;
    font-weight: 800;
}

.view-as-bar,
.view-as-banner {
    display: flex;
    align-items: end;
    gap: 12px;
    margin-bottom: 16px;
    padding: 14px 16px;
    border: 1px solid #dfc890;
    border-left: 4px solid #b7791f;
    border-radius: var(--radius);
    background: #fff7df;
}

.view-as-bar label {
    width: min(360px, 100%);
}

.view-as-note {
    color: #8a5a10;
    font-weight: 800;
}

.filter-search {
    grid-column: 1 / -1;
    min-width: 0;
}

.filter-search input {
    width: 100%;
}

.filter-reset {
    min-width: 112px;
    justify-content: center;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
    background: var(--surface-soft);
}

tbody tr {
    transition: background-color .15s ease;
}

tbody tr:hover {
    background: #fbfcfa;
}

tr:last-child td {
    border-bottom: 0;
}

.user-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 14px;
    margin-bottom: 14px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.user-search label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.user-search input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

.user-search span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.users-table-wrap {
    overflow-x: visible;
}

.users-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    font-size: 14px;
}

.users-table th,
.users-table td {
    padding: 11px 8px;
    vertical-align: middle;
}

.users-table th:nth-child(1),
.users-table td:nth-child(1) {
    width: 8%;
}

.users-table th:nth-child(2),
.users-table td:nth-child(2) {
    width: 7%;
}

.users-table th:nth-child(3),
.users-table td:nth-child(3) {
    width: 17%;
}

.users-table th:nth-child(4),
.users-table td:nth-child(4) {
    width: 8%;
}

.users-table th:nth-child(5),
.users-table td:nth-child(5) {
    width: 10%;
}

.users-table th:nth-child(6),
.users-table td:nth-child(6) {
    width: 10%;
}

.users-table th:nth-child(7),
.users-table td:nth-child(7),
.users-table th:nth-child(8),
.users-table td:nth-child(8),
.users-table th:nth-child(9),
.users-table td:nth-child(9),
.users-table th:nth-child(10),
.users-table td:nth-child(10),
.users-table th:nth-child(11),
.users-table td:nth-child(11) {
    width: 6%;
}

.users-table th:nth-child(12),
.users-table td:nth-child(12) {
    width: 8%;
}

.users-table th,
.users-table td,
.cell-email,
.cell-roles {
    overflow-wrap: anywhere;
    word-break: normal;
}

.cell-center {
    text-align: center;
}

.cell-action {
    text-align: right;
}

.cell-action .button {
    min-width: 86px;
    justify-content: center;
}

.muted-line {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 9px;
    border-radius: 999px;
    background: #eef1ed;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
}

.soft-label {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 9px;
    border-radius: 999px;
    background: #eef1ed;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.soft-label.is-overdue {
    background: #f8e6df;
    color: var(--danger);
}

.ticket-title-cell a {
    display: inline-block;
    color: var(--text);
    font-weight: 800;
}

.ticket-title-cell small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-weight: 700;
}

.priority-haute,
.priority-urgente {
    background: #f8e6df;
    color: var(--danger);
}

.priority-basse {
    background: #e6eef8;
    color: var(--info);
}

.status-nouveau {
    background: #e6eef8;
    color: var(--info);
}

.status-en_cours {
    background: #fff1d1;
    color: var(--warning);
}

.status-resolu,
.status-clos {
    background: #e0f0ea;
    color: var(--primary);
}

.status-supprime {
    background: #ece8e3;
    color: #6f6258;
}

.ticket-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.back {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--muted);
}

.details {
    margin-bottom: 20px;
}

dl {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 0 0 18px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.section-heading h2 {
    margin: 0;
}

.section-heading h3 {
    margin: 0;
    font-size: 18px;
}

dt {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

dd {
    margin: 2px 0 0;
    font-weight: 700;
}

dl > div {
    min-height: 58px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-soft);
}

.description {
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.description h2 {
    margin: 0 0 10px;
    font-size: 20px;
}

.description p {
    margin: 0;
    line-height: 1.6;
}

.status-form {
    display: flex;
    align-items: end;
    gap: 16px;
    margin-bottom: 20px;
}

.status-form label {
    width: min(320px, 100%);
}

.reminder-panel {
    display: grid;
    gap: 14px;
}

.reminder-form {
    display: grid;
    grid-template-columns: minmax(130px, .8fr) minmax(110px, .7fr) minmax(260px, 2fr) auto;
    gap: 12px;
    align-items: end;
}

.reminder-message {
    min-width: 0;
}

.reminder-list {
    display: grid;
    gap: 10px;
}

.reminder-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
}

.reminder-item p {
    margin: 4px 0;
}

.reminder-item small {
    color: var(--muted);
}

.reminder-item.is-sent,
.reminder-item.is-cancelled {
    opacity: .72;
}

.comment {
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.event-log {
    margin-bottom: 20px;
}

.event-log .timeline-event::before {
    background: var(--info);
}

.event-log .comment p {
    color: var(--muted);
}

.event-log code {
    color: var(--text);
    font-weight: 800;
}

.timeline-event {
    position: relative;
    padding-left: 18px;
}

.timeline-event::before {
    content: "";
    position: absolute;
    left: 0;
    top: 20px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
}

.comment header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
}

.comment p {
    margin: 8px 0 0;
}

.comment-form {
    margin-top: 20px;
}

.attachment-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.attachment-list a {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fbfcfa;
    font-weight: 700;
}

.attachment-list img {
    width: 84px;
    height: 64px;
    object-fit: cover;
    border-radius: 4px;
}

.settings-test {
    margin-top: 20px;
}

.form-submit {
    display: flex;
    align-items: end;
}

.compact {
    margin-bottom: 12px;
}

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

.reference-block {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px;
}

.settings-panel[data-settings-panel="refs"] .reference-block {
    max-height: 390px;
    overflow: auto;
}

.problem-category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 16px 0;
}

.problem-create-card {
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
    overflow: hidden;
}

.problem-create-card > summary {
    display: grid;
    gap: 2px;
    padding: 14px 16px;
    cursor: pointer;
    font-weight: 800;
    list-style: none;
}

.problem-create-card > summary::-webkit-details-marker {
    display: none;
}

.problem-create-card > summary small {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.problem-create-card[open] > summary {
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.problem-create-card .problem-type-form {
    padding: 16px;
}

.problem-group[hidden] {
    display: none !important;
}

.reference-block h3 {
    margin: 0 0 10px;
}

.reference-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
    border-top: 1px solid var(--line);
}

.reference-row button,
.settings-panel .filters button {
    min-height: 32px;
    padding: 6px 10px;
}

.compact-table th,
.compact-table td {
    padding: 8px;
    text-align: center;
}

.compact-table td:first-child,
.compact-table th:first-child {
    text-align: left;
}

.category-admin {
    margin-top: 8px;
    padding: 0;
    border-top: 1px solid var(--line);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    overflow: hidden;
}

.problem-sort-item.is-dragging {
    opacity: .55;
}

.problem-drag-handle {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--muted);
    cursor: grab;
    user-select: none;
}

.problem-drag-handle:active {
    cursor: grabbing;
}

.problem-sort-status {
    display: inline-block;
    min-width: 110px;
    margin-left: 8px;
    color: var(--muted);
    font-weight: 700;
}

.category-admin > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 58px;
    padding: 12px 14px;
    cursor: pointer;
    font-weight: 800;
    list-style: none;
}

.category-admin > summary::-webkit-details-marker {
    display: none;
}

.category-admin > summary::before {
    content: "›";
    color: var(--primary);
    font-size: 22px;
    line-height: 1;
    transform: rotate(0deg);
    transition: transform .15s ease;
}

.category-admin[open] > summary::before {
    transform: rotate(90deg);
}

.category-admin[open] > summary {
    border-bottom: 1px solid var(--line);
    background: var(--surface-soft);
}

.problem-summary-main {
    display: grid;
    gap: 2px;
    flex: 1;
}

.problem-summary-main small {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.problem-summary-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.category-form {
    padding: 14px;
}

.problem-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 0 14px 14px;
}

.diagnostic-panel,
.prediagnostic-summary {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
}

.procedure-note {
    margin-bottom: 12px;
    padding: 12px;
    border-left: 4px solid var(--primary);
    background: #e0f0ea;
    white-space: pre-line;
    font-weight: 700;
}

.blocker-note {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid #e2b8b8;
    border-left: 4px solid var(--danger);
    border-radius: 6px;
    background: #f8e6df;
    color: var(--danger);
    font-weight: 800;
}

.similar-ticket-panel {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid #dfc890;
    border-left: 4px solid #b7791f;
    border-radius: var(--radius);
    background: #fff7df;
}

.similar-ticket-panel[hidden] {
    display: none;
}

.similar-ticket-panel p {
    margin: 4px 0 0;
    color: var(--muted);
}

.similar-ticket-list {
    display: grid;
    gap: 10px;
}

.similar-ticket {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.similar-ticket-main {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.similar-ticket-main a {
    font-weight: 800;
}

.similar-ticket-main span,
.similar-ticket-main small {
    color: var(--muted);
}

.similar-ticket-reasons {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.similar-ticket-reasons span {
    padding: 5px 8px;
    border-radius: 999px;
    background: #e0f0ea;
    color: var(--primary-dark);
    font-size: .85rem;
    font-weight: 800;
}

.similar-ticket-reasons .similar-confidence {
    background: #fff1d6;
    color: #8a5a10;
}

.similar-ticket-reasons .similar-confidence.is-strong {
    background: #fde2dc;
    color: #9f2d2d;
}

.diagnostic-fields {
    display: grid;
    gap: 12px;
}

.diagnostic-step {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.prediagnostic-summary {
    margin: 16px 0;
}

.prediagnostic-summary h2 {
    margin-bottom: 8px;
}

.question-builder {
    display: grid;
    gap: 0;
    margin-top: 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    overflow: hidden;
}

.workflow-builder-head,
.workflow-overview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.workflow-builder-head {
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
}

.workflow-builder-head h3,
.workflow-builder-head p {
    margin: 0;
}

.workflow-builder-head p {
    color: var(--muted);
    font-size: 14px;
}

.workflow-save-hint,
.workflow-overview-head span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.workflow-palette {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-soft);
}

.workflow-palette-label {
    margin-right: 4px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.workflow-tool {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 6px 10px;
    border-color: var(--line-strong);
    background: #fff;
    cursor: grab;
}

.workflow-tool:active {
    cursor: grabbing;
}

.workflow-tool-icon {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    color: var(--primary);
    font-size: 14px;
    font-weight: 800;
}

.workflow-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(270px, .75fr);
    min-height: 280px;
}

.workflow-canvas {
    position: relative;
    display: grid;
    align-content: start;
    gap: 0;
    min-width: 0;
    padding: 24px 20px;
    background-color: #f7f9f6;
    background-image: radial-gradient(#ccd5cb 1px, transparent 1px);
    background-size: 18px 18px;
    transition: box-shadow .15s ease;
}

.workflow-canvas.is-drop-target {
    box-shadow: inset 0 0 0 3px var(--primary);
}

.workflow-terminal {
    position: relative;
    z-index: 1;
    justify-self: center;
    padding: 7px 16px;
    border-radius: 999px;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}

.workflow-terminal::after,
.workflow-question::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 100%;
    width: 2px;
    height: 18px;
    background: var(--line-strong);
}

.workflow-start {
    margin-bottom: 18px;
    background: var(--primary);
}

.workflow-end {
    margin-top: 18px;
    background: var(--text);
}

.workflow-end::after {
    display: none;
}

.question-list {
    display: grid;
    gap: 18px;
}

.question-row {
    position: relative;
    display: grid;
    gap: 0;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 6px 18px rgba(31, 42, 36, .07);
}

.question-row.is-dragging {
    opacity: .55;
    box-shadow: 0 12px 28px rgba(31, 42, 36, .16);
}

.workflow-question-head {
    display: grid;
    grid-template-columns: 34px 28px minmax(0, 1fr) auto 34px;
    align-items: center;
    gap: 8px;
    min-height: 52px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
}

.workflow-drag-handle,
.icon-button {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
}

.workflow-drag-handle {
    cursor: grab;
    letter-spacing: -4px;
}

.workflow-drag-handle:active {
    cursor: grabbing;
}

.icon-button:hover,
.workflow-drag-handle:hover {
    background: #eef1ed;
}

.danger-text {
    color: var(--danger);
    font-size: 22px;
}

.workflow-step-number {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.workflow-question-title {
    overflow: hidden;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workflow-required-badge {
    padding: 3px 7px;
    border-radius: 999px;
    background: #edf3ef;
    color: var(--primary-dark);
    font-size: 11px;
    font-weight: 800;
}

.workflow-question-settings {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
    padding: 14px;
}

.workflow-label-field { grid-column: 1 / -1; }

.workflow-options-field {
    grid-column: 1 / -1;
}

.workflow-options-field small {
    color: var(--muted);
    font-weight: 400;
}

.workflow-required-control {
    min-height: 42px;
    margin-bottom: 0;
    padding: 0 4px 8px;
}

.question-message {
    grid-column: 1 / -2;
}

.question-assignment {
    grid-column: 1 / -2;
    background: #fbfcfa;
}

.question-remove {
    align-self: end;
}

.branch-builder {
    display: grid;
    gap: 10px;
    padding: 14px;
    border-top: 1px solid var(--line);
    background: var(--surface-soft);
}

.branch-builder-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.branch-builder-head span {
    color: var(--muted);
    font-size: 12px;
}

.branch-editor-row {
    display: grid;
    grid-template-columns: minmax(190px, .9fr) minmax(210px, 1.1fr) 32px;
    gap: 10px;
    align-items: end;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.branch-route {
    display: flex;
    align-items: center;
    gap: 8px;
    align-self: center;
    min-width: 0;
}

.branch-route-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    background: #fff;
}

.branch-answer {
    overflow: visible;
    font-weight: 800;
    overflow-wrap: anywhere;
    white-space: normal;
}

.branch-remove {
    grid-column: 3;
    grid-row: 1;
    align-self: end;
    color: var(--danger);
    font-size: 20px;
}

.branch-detail-field {
    grid-column: 1 / -1;
}

.workflow-overview {
    min-width: 0;
    padding: 18px;
    border-left: 1px solid var(--line);
    background: #fff;
}

.workflow-overview-head {
    margin-bottom: 12px;
}

.scenario-preview {
    display: grid;
    gap: 10px;
}

.scenario-preview h4 {
    margin: 0;
}

.scenario-card {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
}

.scenario-card-head {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
}

.scenario-card-head > span {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

.scenario-card-head small {
    color: var(--muted);
}

.scenario-branches {
    display: grid;
    gap: 8px;
}

.scenario-branch {
    display: grid;
    grid-template-columns: minmax(80px, .65fr) minmax(0, 1.35fr);
    gap: 6px;
    align-items: center;
}

.scenario-answer {
    overflow: hidden;
    padding: 5px 7px;
    border-radius: 999px;
    background: #eef1ed;
    font-size: 12px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scenario-action {
    padding: 6px 7px;
    border-left: 3px solid var(--primary);
    background: #e0f0ea;
    font-size: 12px;
    font-weight: 700;
}

.scenario-action.is-continuing {
    border-left-color: var(--warning);
    background: #fff6df;
    color: #76520d;
}

.scenario-action.is-creating {
    border-left-color: var(--primary);
    background: #e0f0ea;
    color: var(--primary-dark);
}

.scenario-action.is-blocking {
    border-left-color: var(--danger);
    background: #f8e6df;
    color: var(--danger);
}

.scenario-action.is-assigning {
    border-left-color: var(--info);
    background: #e6eef8;
    color: var(--info);
}

.workflow-empty {
    display: grid;
    justify-items: center;
    gap: 3px;
    margin-bottom: 18px;
    padding: 26px 16px;
    border: 2px dashed var(--line-strong);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .85);
    color: var(--muted);
    text-align: center;
}

.workflow-empty strong {
    color: var(--text);
}

.assignment-box {
    background: #fbfcfa;
}

.assignment-box legend {
    color: var(--primary);
}

.role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px 14px;
}

.role-grid label {
    display: flex !important;
    grid-template-columns: none;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--text);
    font-weight: 700;
}

.check-row {
    display: flex !important;
    grid-template-columns: none;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    color: var(--text);
    font-weight: 700;
}

.role-grid input[type="checkbox"],
.check-row input[type="checkbox"] {
    width: auto;
    margin: 0;
    flex: 0 0 auto;
}

.inline-form {
    display: inline-flex;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.photo-grid img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--line);
}

.drop-zone {
    display: grid;
    justify-items: start;
    gap: 8px;
    padding: 20px;
    border: 2px dashed var(--line);
    border-radius: var(--radius);
    background: #fbfcfa;
    color: var(--muted);
    cursor: pointer;
}

.drop-zone.is-dragover {
    border-color: var(--primary);
    background: #e0f0ea;
}

.file-input-native {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.drop-zone-button {
    margin-top: 4px;
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.drop-zone-button:hover {
    border-color: var(--primary-dark);
    background: var(--primary-dark);
}

.photo-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.ticket-create-form {
    padding-bottom: 24px;
}

.ticket-create-form #category-diagnostic {
    padding: 22px 0;
}

.ticket-create-form #category-procedure {
    margin: 18px 0 0;
    padding: 13px 16px;
    border-left-width: 3px;
    border-radius: 0 5px 5px 0;
    background: #f2f6f5;
    color: var(--text);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
}

.ticket-create-form .diagnostic-fields {
    gap: 14px;
    margin-top: 18px;
}

.ticket-create-form .diagnostic-question {
    display: grid;
    gap: 11px;
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fafcfb;
    color: var(--text);
    font-size: 14px;
    font-weight: 400;
}

.ticket-create-form .diagnostic-question-title {
    display: block;
    color: var(--text);
    font-size: 15px;
    font-weight: 650;
    line-height: 1.45;
}

.ticket-create-form .reference-question .reference-lookup {
    margin-top: 0;
    gap: 12px;
}

.ticket-create-form .reference-question .reference-lookup > label {
    font-size: 13px;
    font-weight: 600;
}

.ticket-create-form #diagnostic-blocker {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 14px 0 0;
    padding: 12px 14px;
    border: 0;
    border-left: 3px solid var(--danger);
    border-radius: 0 5px 5px 0;
    background: #fff1ee;
    color: #9e3540;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
}

.ticket-create-form #diagnostic-blocker::before {
    content: "!";
    display: grid;
    flex: 0 0 20px;
    place-items: center;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    border-radius: 50%;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.ticket-create-form #diagnostic-actions {
    margin-top: 16px;
}

.ticket-create-form #diagnostic-actions button:disabled {
    opacity: .7;
}

.ticket-create-form #diagnostic-actions:has(button:disabled) {
    display: none;
}

@media (max-width: 700px) {
    .ticket-create-form .diagnostic-question {
        padding: 14px;
    }

    .ticket-create-form #diagnostic-actions button {
        width: 100%;
    }
}

.ticket-create-form .actions[data-ticket-actions] {
    position: sticky;
    bottom: 0;
    z-index: 8;
    margin: 8px -20px -20px;
    padding: 12px 20px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(8px);
}

.ticket-create-form .actions[data-ticket-actions] .primary {
    min-width: 150px;
}

.ticket-create-form .drop-zone {
    min-height: 150px;
}

.ticket-create-form .drop-zone strong {
    font-size: 18px;
}

.preview-item {
    display: grid;
    gap: 8px;
}

.preview-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--line);
}

.map-picker {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.map-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.map-frame {
    position: relative;
    width: 100%;
    height: 420px;
    min-height: 320px;
    background: #dfe8df;
}

.map-error {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    padding: 24px;
    color: var(--danger);
    font-weight: 700;
    text-align: center;
}

.leaflet-container {
    font: inherit;
}

.leaflet-control-layers label {
    display: block;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.empty {
    color: var(--muted);
    text-align: center;
}

.flash {
    margin-bottom: 20px;
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: #e0f0ea;
    color: var(--primary);
    font-weight: 700;
}

.flash-error {
    background: #f8e6df;
    color: var(--danger);
}

.notification-preview {
    border-left: 4px solid var(--primary);
}

.recipient-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.recipient-chip {
    display: grid;
    gap: 3px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-soft);
}

.recipient-chip strong {
    font-size: 14px;
}

.recipient-chip span,
.recipient-chip small {
    color: var(--muted);
    font-size: 13px;
}

@media (max-width: 760px) {
    .page-head,
    .ticket-head,
    .status-form {
        align-items: stretch;
        flex-direction: column;
    }

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

    .topbar {
        flex-wrap: wrap;
        gap: 8px 12px;
        min-height: 0;
        padding: 10px 16px;
    }

    .nav {
        order: 3;
        width: 100%;
        flex: 0 0 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .nav a {
        white-space: nowrap;
    }

    .logout {
        margin-left: auto;
        gap: 8px;
    }

    .account-link {
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .logout button {
        min-height: 34px;
        padding: 6px 9px;
    }

    .two,
    .three,
    .filters,
    .dashboard-grid,
    .summary-grid,
    .question-row,
    dl {
        grid-template-columns: 1fr;
    }

    .compact-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .compact-summary .summary-card {
        min-height: 68px;
        padding: 12px;
    }

    .question-message {
        grid-column: auto;
    }

    .view-as-bar,
    .view-as-banner,
    .page-actions,
    .view-as-compact {
        align-items: stretch;
        flex-direction: column;
    }

    .view-as-compact label {
        width: 100%;
    }

    .question-assignment {
        grid-column: auto;
    }

    .branch-editor-row {
        grid-template-columns: 1fr;
    }

    .branch-remove,
    .branch-detail-field {
        grid-column: 1;
        grid-row: auto;
    }

    .workflow-workspace {
        grid-template-columns: 1fr;
    }

    .workflow-overview {
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .workflow-question-settings {
        grid-template-columns: 1fr;
    }

    .workflow-options-field,
    .branch-detail-field {
        grid-column: auto;
    }

    .workflow-required-control {
        padding-bottom: 0;
    }

    .workflow-question-head {
        grid-template-columns: 34px 28px minmax(0, 1fr) 34px;
    }

    .workflow-required-badge {
        display: none;
    }

    .workflow-builder-head,
    .workflow-overview-head,
    .branch-builder-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .scenario-branch {
        grid-template-columns: 1fr;
    }

    .category-admin > summary,
    .problem-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .problem-summary-meta {
        justify-content: flex-start;
    }

    .table-wrap {
        overflow-x: auto;
    }

    th,
    td {
        white-space: nowrap;
    }

    .ticket-title-cell small {
        white-space: normal;
    }

    .ticket-create-form {
        padding: 14px;
    }

    .ticket-create-form input,
    .ticket-create-form select,
    .ticket-create-form textarea,
    .ticket-create-form button,
    .ticket-create-form .button {
        min-height: 46px;
        font-size: 16px;
    }

    .ticket-create-form .actions[data-ticket-actions] {
        display: grid;
        grid-template-columns: 1fr;
        margin: 8px -14px -14px;
        padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
    }

    .ticket-create-form .actions[data-ticket-actions] .button,
    .ticket-create-form .actions[data-ticket-actions] button,
    .ticket-create-form .drop-zone-button,
    .ticket-create-form fieldset button {
        width: 100%;
    }

    .ticket-create-form .drop-zone {
        justify-items: stretch;
        text-align: center;
    }

    .map-frame {
        height: 360px;
    }
}
