:root {
    --bg: #eef5f0;
    --card: #ffffff;
    --text: #13311f;
    --muted: #5c6b62;
    --line: #d8e4db;
    --primary: #1b6f5f;
    --primary-dark: #155548;
    --accent: #f4fbf7;
    --danger: #c0392b;
    --warning: #d97706;
    --success: #15803d;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

a { color: var(--primary); }
a:hover { color: var(--primary-dark); }

.layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: linear-gradient(135deg, #1b6f5f 0%, #2e8b78 100%);
    color: #fff;
    padding: 16px max(24px, calc((100% - 1440px) / 2));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: 0 8px 24px rgba(27, 111, 95, 0.2);
}

.topbar__brand { display: flex; flex-direction: column; gap: 4px; }
.topbar .logo { font-weight: 800; font-size: 22px; }
.topbar__meta { font-size: 13px; opacity: .92; }

.topnav {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.topnav a {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    padding: 9px 12px;
    border-radius: 999px;
    transition: background .2s ease, opacity .2s ease;
}
.topnav a:hover,
.topnav a.is-active {
    background: rgba(255,255,255,.16);
}

.content {
    width: min(1440px, calc(100vw - 32px));
    margin: 24px auto 40px;
}

.card {
    background: var(--card);
    border-radius: 18px;
    padding: 20px 22px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    border: 1px solid rgba(27, 111, 95, 0.08);
}

.page-head,
.toolbar,
.inline-actions,
.quick-links,
.info-grid,
.stats-grid,
.filter-grid,
.card-grid,
.form-grid,
.detail-grid,
.media-grid,
.comment-grid,
.kanban {
    display: grid;
    gap: 14px;
}

.page-head {
    grid-template-columns: 1fr auto;
    align-items: end;
    margin-bottom: 16px;
}
.page-head h1,
.page-head h2,
.page-head h3,
.card h2,
.card h3 { margin: 0; }
.page-subtitle,
.text-small,
.muted {
    color: var(--muted);
    font-size: 14px;
}
.text-small { font-size: 13px; }

.stats-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stat-card {
    background: var(--accent);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px 16px;
}
.stat-card__value {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.1;
    margin-top: 8px;
}
.stat-card__label { font-size: 13px; color: var(--muted); }

.card-grid,
.detail-grid,
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.filter-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: end; }
.quick-links { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.info-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.media-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.comment-grid { grid-template-columns: 1fr; }
.kanban { grid-template-columns: repeat(6, minmax(220px, 1fr)); align-items: start; }

@media (max-width: 1100px) {
    .filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .card-grid,
    .detail-grid,
    .form-grid { grid-template-columns: 1fr; }
    .kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .content { width: calc(100vw - 20px); margin: 16px auto 28px; }
    .topbar { padding: 14px 16px; }
    .page-head { grid-template-columns: 1fr; }
    .filter-grid { grid-template-columns: 1fr; }
    .kanban { grid-template-columns: 1fr; }
}

.input-row { margin-bottom: 12px; }
.input-row label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}
.input-row input,
.input-row select,
.input-row textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #c9d9cf;
    font-size: 14px;
    color: var(--text);
    background: #fff;
}
.input-row input[type="checkbox"],
.input-row input[type="radio"],
input[type="checkbox"],
input[type="radio"] {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    padding: 0;
    margin: 2px 0 0;
    accent-color: var(--primary);
    box-shadow: none;
}
.check-row,
.input-row label.check-row {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 10px;
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
}
.check-row span { min-width: 0; }
.check-stack { display: grid; gap: 10px; }
.field-title { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
.user-form { max-width: 900px; margin: 20px 0 28px; }
.user-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.user-form-grid .input-row { margin: 0; min-width: 0; }
.user-form-grid .full { grid-column: 1 / -1; }
.users-page h3 { margin: 24px 0 14px; }
.users-page .table { min-width: 900px; }
.users-page .table td { vertical-align: middle; }
.users-page .col-name { min-width: 160px; overflow-wrap: anywhere; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px 12px; min-width: 170px; }
.row-actions .inline-form { margin: 0; }
.account-status { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; }
.zone-form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto; gap: 14px; align-items: end; margin: 16px 0; }
.zone-form-grid .input-row { margin: 0; }
.zone-form-grid .check-row { min-height: 40px; align-items: center; }
.route-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin: 16px 0; }
.mgmt .row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.mgmt .box { min-width: 0; border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.mgmt .box h3 { margin-bottom: 14px; }
.mgmt .hint { font-size: 13px; color: var(--muted); }
.mgmt code { overflow-wrap: anywhere; }
.mgmt .btn { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px; border: 0; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.mgmt .btn-primary { background: var(--primary); color: #fff; }
.mgmt .btn-danger { background: var(--danger); color: #fff; }
.mgmt .btn-ghost { background: var(--accent); color: var(--primary); }
.mgmt textarea, .mgmt select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fff; }
.mgmt textarea { min-height: 90px; }
.mgmt table { width: 100%; border-collapse: collapse; }
.mgmt th, .mgmt td { padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 13px; text-align: left; overflow-wrap: anywhere; }
.mgmt .badge--on { background: var(--primary); color: #fff; }
.mgmt .alert { padding: 12px 14px; border-radius: 12px; margin: 16px 0; }
.mgmt .alert--ok { background: #ebfff1; color: var(--success); }
.mgmt .alert--err { background: #fff2f0; color: var(--danger); }
.mgmt .biglink { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.bot-checklist { margin: 14px 0; padding-left: 20px; }
.bot-checklist li { margin: 8px 0; }
.bot-diagnostics { margin-top: 16px; }
.bot-diagnostics dt { font-size: 13px; color: var(--muted); margin-top: 10px; }
.bot-diagnostics dd { margin: 2px 0 0; overflow-wrap: anywhere; }
@media (max-width: 900px) {
    .user-form-grid, .mgmt .row { grid-template-columns: 1fr; }
    .zone-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
    .card { padding: 18px 14px; border-radius: 12px; }
    .topnav { gap: 4px; }
    .topnav a { padding: 7px 9px; }
    .zone-form-grid, .route-grid { grid-template-columns: 1fr; }
    .form-actions .button { width: 100%; }
}
.input-row textarea { resize: vertical; min-height: 84px; }
.input-row input:focus,
.input-row select:focus,
.input-row textarea:focus {
    outline: none;
    border-color: #53a38f;
    box-shadow: 0 0 0 4px rgba(83, 163, 143, 0.14);
}

.button,
.button-secondary,
.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
}
.button {
    background: var(--primary);
    color: #fff;
}
.button:hover { background: var(--primary-dark); color: #fff; }
.button.secondary,
.button-secondary {
    background: #eef2ef;
    color: var(--text);
}
.button.secondary:hover,
.button-secondary:hover {
    background: #dde8e0;
    color: var(--text);
}
.button-link {
    background: transparent;
    color: var(--primary);
    padding: 0;
    min-height: auto;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    background: #eef2ef;
    color: var(--text);
    border: 1px solid rgba(0,0,0,.08);
    white-space: nowrap;
}
.badge.priority-low { background: #e9f4ff; color: #275277; }
.badge.priority-high { background: #fff0df; color: #a84f0f; }
.badge.priority-urgent { background: #ffe4e1; color: #a32918; }
.badge.status-new { background: #edf7ff; color: #245e87; }
.badge.status-analysis { background: #fff7db; color: #8a5d00; }
.badge.status-in_progress { background: #ffe7dc; color: #b45309; }
.badge.status-review { background: #f1e8ff; color: #6b21a8; }
.badge.status-done { background: #e9f9ef; color: #166534; }
.badge.status-cancelled { background: #fbe9e9; color: #991b1b; }

.notice {
    padding: 12px 14px;
    border-radius: 14px;
    margin-bottom: 14px;
    border: 1px solid transparent;
}
.notice.success { background: #ebfff1; color: var(--success); border-color: #bfe7c9; }
.notice.error { background: #fff2f0; color: var(--danger); border-color: #f1c3bc; }
.notice.info { background: #f2fbff; color: #1d5a78; border-color: #c7e4ef; }

.table-wrap {
    width: 100%;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
}
.table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
    font-size: 13px;
}
.table th,
.table td {
    border-bottom: 1px solid #edf2ee;
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}
.table th {
    background: #f8fcf9;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--muted);
}
.table tbody tr:hover { background: #f8fcf9; }
.row-clickable { cursor: pointer; }

.ticket-card {
    background: #fff;
    border-radius: 14px;
    padding: 12px;
    border: 1px solid #dfe8e1;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
    cursor: pointer;
}
.ticket-card:hover { transform: translateY(-1px); }
.kanban-column {
    background: #f7fbf9;
    border-radius: 16px;
    padding: 12px;
    border: 1px solid #d9ece5;
}
.kanban-column h3 { margin: 0 0 10px; font-size: 16px; }

.detail-box,
.filter-box,
.quick-box {
    background: #f8fcf9;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
}
.detail-box__title { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.detail-box__value { font-size: 15px; line-height: 1.5; }

.media-item {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    padding: 10px;
}
.media-item img,
.media-item video {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: 10px;
    display: block;
    background: #f2f2f2;
}
.media-item__footer { margin-top: 8px; font-size: 12px; color: var(--muted); }

.comment-card {
    background: #f9fbfa;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
}
.comment-card__meta {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
}
.comment-card__body {
    line-height: 1.55;
    white-space: pre-wrap;
}
.scope-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.scope-pills a {
    display: inline-flex;
    padding: 8px 12px;
    border-radius: 999px;
    text-decoration: none;
    background: #eef2ef;
    color: var(--text);
    border: 1px solid transparent;
}
.scope-pills a.is-active {
    background: #e0f3eb;
    color: var(--primary-dark);
    border-color: #9ecfbe;
}

hr.section-sep {
    border: none;
    border-top: 1px solid var(--line);
    margin: 20px 0;
}

.nav-logout { display:inline-flex; margin:0; }
.nav-logout button, .link-button {
    font: inherit; color:inherit; border:0; background:none; cursor:pointer;
    padding:0; text-decoration:underline;
}
.nav-logout button { padding:8px 12px; text-decoration:none; }
.nav-logout button:hover, .link-button:hover { text-decoration:underline; }
.inline-form { display:inline; margin:0 0 0 8px; }
.pagination { display:flex; align-items:center; justify-content:center; gap:10px; margin-top:18px; }
.ticket-list { display:grid; gap:8px; margin-top:12px; }
.ticket-row { display:flex; flex-wrap:wrap; align-items:center; gap:10px; color:var(--text); text-decoration:none; border:1px solid var(--line); border-radius:12px; padding:12px; min-width:0; }
.ticket-row strong { overflow-wrap:anywhere; }
.ticket-row:hover { background:#f7faf8; }
.zone-section { border-top:1px solid var(--line); padding:16px 0; }
.zone-section h3 { margin-bottom:12px; }
.zone-members { display:flex; flex-wrap:wrap; gap:12px 18px; margin:12px 0; }
.zone-members label { display:inline-flex; align-items:center; gap:6px; }
.submit-once button[disabled] { opacity:.6; cursor:wait; }
@media (max-width:700px) {
    .filter-grid, .form-grid { grid-template-columns:1fr; }
    .ticket-row { align-items:flex-start; }
    .pagination .button { flex:1; text-align:center; }
    .topnav { flex-wrap:wrap; }
}

/* Staff workspace: consistent dimensions and contained overflow. */
:root { --bg:#f4f7f8; --text:#17312e; --muted:#647573; --line:#dfe7e5; --accent:#f5f9f8; --shadow:0 2px 8px rgba(19,49,44,.035); }
html {font-size:15px;}
body {font-size:15px;line-height:1.5;}
.layout {display:grid;grid-template-columns:224px minmax(0,1fr);min-height:100vh;}
.app-sidebar {position:sticky;top:0;height:100vh;display:flex;flex-direction:column;gap:24px;background:#153f38;color:#fff;padding:26px 16px;}
.brand {font-size:21px;font-weight:750;line-height:1.25;letter-spacing:-.4px;text-decoration:none;color:#fff; padding:0 10px;}
.brand span {display:block;font-size:12px;font-weight:450;letter-spacing:.3px;color:#c1d9d1;margin-top:5px;}
.app-nav {display:flex;flex-direction:column;gap:5px;}
.app-nav a {padding:10px 12px;text-decoration:none;border-radius:8px;color:#d9e8e2;font-size:14px;font-weight:550;}
.app-nav a:hover,.app-nav a.is-active {background:#28564c;color:#fff;}
.sidebar-user {margin-top:auto;padding:16px 10px 0;border-top:1px solid #396057;font-size:13px;overflow-wrap:anywhere;}
.sidebar-user small {display:block;color:#bed4cc;margin:4px 0 12px;}
.sidebar-user button {color:#d9e8e2;font-size:13px;}
.app-workspace {min-width:0;}
.workspace-bar {height:64px;padding:0 30px;display:flex;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid var(--line);background:#fff;}
.workspace-bar strong {font-size:14px;font-weight:600;}
.workspace-bar span {font-size:13px;color:var(--muted);}
.content {width:100%;max-width:1640px;margin:0 auto;padding:28px 30px 48px;min-width:0;}
.card {border:1px solid var(--line);border-radius:12px;padding:22px;margin-bottom:20px;box-shadow:var(--shadow);min-width:0;}
h1 {font-size:26px;font-weight:700;line-height:1.3;letter-spacing:-.6px;margin:10px 0;}
h2 {font-size:18px;line-height:1.4;}h3 {font-size:16px;}
.inline-actions,.toolbar {display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
.button {border-radius:8px;min-height:40px;padding:9px 14px;font-size:14px;font-weight:600;line-height:1.4;}
.button.secondary {background:#f1f6f3;color:var(--primary);border:1px solid #dce6e0;}
.full-width {width:100%;}
input,select,textarea,button {font:inherit;}
textarea {resize:vertical;}
input:not([type=checkbox]):not([type=radio]),select,textarea {max-width:100%;min-width:0;}
.input-row input,.input-row select,.input-row textarea,.comment-composer textarea {border-radius:8px;padding:9px 11px;border:1px solid #ccd9d3;background:#fff;color:var(--text);width:100%;font-size:14px;}
.input-row input[type=file] {padding:8px;font-size:12px;}
:focus-visible {outline:3px solid #8ccdbb;outline-offset:3px;}
.table-wrap {max-width:100%;overflow:auto;border:1px solid var(--line);border-radius:10px;}
.table {width:100%;border-collapse:collapse;}
.table th,.table td {padding:12px 14px;font-size:14px;vertical-align:top;}
.table th {background:#f5f8f7;color:var(--muted);font-weight:600;white-space:nowrap;}
.table td {overflow-wrap:anywhere;}
.filter-grid {grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;}
.stats-grid {gap:14px;}.stat-card {border-radius:10px;background:#fff;}.stat-card__value {font-size:28px;}
.badge {border-radius:6px;padding:4px 8px;font-size:12px;max-width:100%;white-space:normal;overflow-wrap:anywhere;}
.kanban-viewport {max-width:100%;overflow-x:auto;padding:0 0 12px;overscroll-behavior-x:contain;}
.kanban {display:grid;grid-template-columns:repeat(6,248px);gap:14px;width:max-content;min-width:100%;align-items:start;}
.kanban-column {min-width:0;width:auto;background:#f3f7f5;border:1px solid var(--line);border-radius:10px;padding:12px;}
.kanban-column h3 {display:flex;align-items:center;justify-content:space-between;font-size:14px;margin:0 0 14px;}
.ticket-card {padding:13px;background:#fff;border:1px solid #dbe5df;border-radius:9px;box-shadow:none;margin-top:9px;overflow-wrap:anywhere;cursor:pointer;}
.ticket-card:hover {border-color:#81b6a4;box-shadow:0 2px 7px #17312e0d;}
.ticket-heading {display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin-bottom:22px;}
.ticket-heading p {margin:6px 0 0;}.ticket-number {color:var(--muted);font-weight:450;}.back-link {font-size:13px;text-decoration:none;}
.ticket-status {flex-shrink:0;font-size:13px;margin-top:35px;padding:7px 12px;}
.ticket-workspace {display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:22px;align-items:start;}
.ticket-main,.ticket-sidebar {min-width:0;}.ticket-sidebar {position:sticky;top:18px;}
.section-heading {display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:16px;}
.ticket-prose {white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.7;font-size:14px;}
.initial-comment {border-top:1px solid var(--line);margin-top:20px;padding-top:16px;}
.attachments-section {border-top:1px solid var(--line);margin-top:20px;padding-top:16px;}
.attachments-section summary,.technical-audit summary {cursor:pointer;font-size:14px;font-weight:600;}
.attachment-grid {display:grid;grid-template-columns:repeat(auto-fill,minmax(116px,146px));gap:10px;margin-top:12px;}
.attachment-thumb {position:relative;min-width:0;border:1px solid var(--line);border-radius:8px;overflow:hidden;text-decoration:none;background:#f4f6f5;}
.attachment-thumb img,.attachment-thumb video {display:block;width:100%;height:104px;object-fit:contain;background:#edf1ef;}
.attachment-thumb>span:last-child {display:block;padding:6px 9px;font-size:11px;background:#fff;color:var(--muted);}
.attachment-play {position:absolute;top:34px;left:calc(50% - 12px);font-size:24px;color:#fff;text-shadow:0 1px 5px #000;}
.comment-attachments {grid-template-columns:repeat(auto-fill,116px);}.comment-attachments img,.comment-attachments video {height:82px;}
.ticket-properties h2,.ticket-update h2 {margin-bottom:18px;}.ticket-properties dl {margin:0;}.ticket-properties dt {font-size:12px;color:var(--muted);margin-top:15px;}.ticket-properties dd {font-size:14px;margin:4px 0 0;overflow-wrap:anywhere;}.ticket-properties small {display:block;color:var(--muted);margin-top:6px;}.ticket-properties form {margin-top:20px;}
.ticket-update .input-row {margin-bottom:14px;}.ticket-sidebar .card {padding:20px;}
.review-banner {display:flex;align-items:center;gap:16px;padding:13px 18px;background:#f2edff;border:1px solid #ddd3f4;border-radius:10px;margin-bottom:20px;color:#514077;font-size:13px;}.review-banner span {color:#73628d;}
.discussion {padding:0;overflow:hidden;}.tab-bar {display:flex;gap:20px;padding:0 22px;border-bottom:1px solid var(--line);}
.tab-bar button {background:none;border:0;border-bottom:2px solid transparent;cursor:pointer;font-weight:600;padding:17px 0;color:var(--muted);font-size:14px;}
.tab-bar button[aria-selected=true] {border-bottom-color:var(--primary);color:var(--primary);}
.count-pill {display:inline-block;background:#edf2ef;color:var(--muted);border-radius:5px;padding:1px 6px;font-size:11px;font-weight:600;margin-left:5px;}
[role=tabpanel] {padding:22px;}[hidden] {display:none!important;}
.comment-composer {margin-bottom:24px;border-bottom:1px solid var(--line);padding-bottom:22px;}.comment-composer textarea {display:block;}
.composer-actions {display:flex;gap:12px;justify-content:space-between;align-items:center;margin-top:10px;}.file-picker {font-size:12px;color:var(--muted);}.file-picker input {display:block;font-size:12px;max-width:250px;margin-top:5px;}
.comment-feed {display:flex;flex-direction:column;gap:0;}.thread-comment {display:flex;gap:12px;padding:18px 0;border-bottom:1px solid #edf1ef;}.thread-comment:first-child {padding-top:0;}.thread-comment:last-child {border-bottom:0;padding-bottom:0;}
.comment-avatar {display:flex;align-items:center;justify-content:center;width:32px;height:32px;flex:0 0 32px;font-size:12px;font-weight:700;background:#e7f1ed;border-radius:50%;color:#306451;}
.thread-comment__content {min-width:0;flex:1;}.thread-comment__header {display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:7px;font-size:12px;}.thread-comment__header time {color:var(--muted);margin-left:auto;font-size:11px;}.role-tag {color:var(--muted);font-size:10px;background:#f0f4f2;border-radius:4px;padding:2px 5px;}.comment-status {display:inline-block;margin:0 0 8px;color:#746094;font-size:11px;}
.activity-timeline {list-style:none;margin:0;padding:0;}.activity-timeline li {position:relative;padding:0 0 24px 23px;border-left:1px solid #d8e6df;margin-left:5px;font-size:13px;}.activity-timeline li:before {content:'';position:absolute;width:9px;height:9px;border-radius:50%;background:#66a08c;left:-5px;top:4px;}.activity-timeline li:last-child {border:0;padding-bottom:0;}.activity-timeline__line {display:flex;align-items:baseline;gap:14px;justify-content:space-between;}.activity-timeline time {font-size:11px;color:var(--muted);white-space:nowrap;}.activity-timeline p {margin:7px 0 4px;}.technical-audit {border-top:1px solid var(--line);margin-top:28px;padding-top:18px;}.technical-audit details {padding:9px 0;}.technical-audit pre {max-width:100%;overflow:auto;font-size:11px;background:#f4f6f5;padding:12px;border-radius:6px;white-space:pre-wrap;overflow-wrap:anywhere;}
.empty-state {font-size:14px;color:var(--muted);padding:20px 0;margin:0;}
.media-dialog {border:0;padding:0;max-width:94vw;max-height:92vh;border-radius:12px;background:#12211d;box-shadow:0 20px 90px #0008;}.media-dialog::backdrop {background:#0b1914c9;}.media-dialog img,.media-dialog video {display:block;max-width:90vw;max-height:82vh;object-fit:contain;}.media-dialog button {position:absolute;right:10px;top:10px;width:36px;height:36px;border:0;border-radius:50%;background:#fff;color:#17312e;font-size:22px;cursor:pointer;}
@media(max-width:1180px) {.layout {grid-template-columns:190px minmax(0,1fr);}.app-sidebar {padding:22px 12px;}.content {padding:24px 20px;}.ticket-workspace {grid-template-columns:minmax(0,1fr) 280px;gap:16px;}.ticket-sidebar .card {padding:16px;}.filter-grid {grid-template-columns:repeat(3,minmax(0,1fr));}.brand {font-size:19px;}}
@media(max-width:950px) {.layout {display:block;}.app-sidebar {position:static;height:auto;display:block;padding:15px 18px;}.brand {display:block;padding:0;}.brand span {display:none;}.app-nav {display:flex;flex-direction:row;gap:4px;margin-top:12px;overflow:auto;}.app-nav a {white-space:nowrap;padding:8px 10px;}.sidebar-user {margin:12px 0 0;padding:10px 0 0;display:flex;align-items:center;gap:12px;}.sidebar-user small {margin:0;}.sidebar-user form {margin-left:auto;}.workspace-bar {display:none;}.content {padding:22px 18px;}.ticket-sidebar {position:static;}.ticket-heading h1 {font-size:23px;}}
@media(max-width:760px) {.ticket-workspace {grid-template-columns:1fr;}.ticket-sidebar {display:grid;grid-template-columns:1fr;}.ticket-heading {gap:10px;}.ticket-status {margin-top:32px;}.ticket-heading h1 {font-size:21px;}.card {padding:18px;}.filter-grid,.form-grid,.detail-grid {grid-template-columns:1fr;}.review-banner {align-items:flex-start;flex-direction:column;gap:4px;}.thread-comment__header time {margin-left:0;width:100%;}.composer-actions {align-items:flex-start;}.activity-timeline__line {display:block;}.activity-timeline time {display:block;margin-top:4px;}.table {min-width:800px;}.tab-bar,[role=tabpanel] {padding-left:16px;padding-right:16px;}.kanban {grid-template-columns:repeat(6,248px);}.page-head {grid-template-columns:1fr;}}
/* Notification journal: readable chat list and bounded message cards. */
.notification-sources{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:14px}
.notification-filter{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:18px 0}
.notification-filter select{width:auto;max-width:100%;margin:0}
.notification-workspace{display:grid;grid-template-columns:minmax(220px,290px) minmax(0,1fr);gap:20px;align-items:start}
.notification-workspace .card{min-width:0;padding:20px}
.notification-chat{display:flex;flex-direction:column;gap:5px;padding:13px 12px;margin:0 -4px 6px;border:1px solid transparent;border-radius:9px;color:var(--text,#172b4d);text-decoration:none;overflow-wrap:anywhere}
.notification-chat span,.notification-chat time{font-size:12px;color:#63758a}
.notification-chat.is-active{border-color:#a9c6f4;background:#edf4ff}
.notification-chat:hover{background:#f3f6fa}
.notification-message{padding:17px 0;border-bottom:1px solid #e4eaf1;overflow-wrap:anywhere}
.notification-message header,.notification-message footer{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.notification-message header{margin-bottom:9px;justify-content:space-between}
.notification-message time,.notification-message footer{font-size:12px;color:#63758a}
.notification-message footer{margin-top:12px}
.notification-message.direction-in{padding-left:14px;border-left:3px solid #d8e5f8}
.delivery-status{border-radius:6px;background:#edf1f7;padding:4px 8px;color:#334b67;font-weight:600}
.delivery-sent,.delivery-received{background:#e8f5ee;color:#176b45}
.delivery-failed{background:#fff0ed;color:#a1372b}
.delivery-uncertain{background:#fff5df;color:#835807}
.notification-pages{display:flex;justify-content:space-between;gap:12px;margin-top:16px;flex-wrap:wrap}
.thread-comment__header strong a{color:#1c5eac;text-decoration:underline;text-underline-offset:3px}
@media(max-width:760px){.notification-workspace{grid-template-columns:minmax(0,1fr)}.notification-chats{max-height:340px;overflow:auto}.notification-message header{align-items:flex-start;flex-direction:column}.notification-workspace .card{padding:16px}}

/* Bot greeting and menu settings */
.bot-settings {margin:24px 0;padding:22px;border:1px solid var(--line);border-radius:12px;min-width:0;}
.bot-settings h3 {margin:0 0 18px;}.bot-settings h4 {margin:24px 0 10px;}
.bot-welcome-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px;}
.bot-settings-form label {display:block;font-weight:600;margin:0 0 8px;}
.bot-settings-form textarea {min-height:0;resize:vertical;line-height:1.5;}
.bot-settings-form .hint {margin:8px 0 16px;}
.bot-settings-scroll {overflow-x:auto;}.bot-buttons-table {min-width:620px;}.bot-commands-table {min-width:460px;}
.bot-buttons-table td:nth-child(2),.bot-commands-table td:nth-child(2) {width:50%;}
.bot-settings-form input:not([type=checkbox]):not([type=hidden]) {width:100%;min-width:0;box-sizing:border-box;}
.bot-buttons-table input[type=number] {max-width:88px;}.bot-settings-form input[type=checkbox] {width:18px;height:18px;accent-color:var(--primary);}
.bot-settings-form th label {margin:0;font-size:13px;}.bot-welcome-picture {margin-top:18px;}.bot-welcome-picture summary {cursor:pointer;}
@media(max-width:800px){.bot-welcome-grid {grid-template-columns:1fr;}.bot-settings {padding:16px;}.bot-settings .form-actions {display:flex;flex-wrap:wrap;gap:10px;}}

.bot-preview {margin:18px 0;padding:16px;background:#f5f8f7;border-radius:10px;}.bot-preview summary {cursor:pointer;font-weight:600;margin-bottom:12px;}.bot-preview-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;}.bot-preview-bubble {white-space:pre-wrap;overflow-wrap:anywhere;background:white;padding:16px;border-radius:10px;margin:10px 0;line-height:1.5;}.bot-preview-button {display:block;padding:10px 14px;background:#e2eeea;color:#153d32;border-radius:8px;text-align:center;overflow-wrap:anywhere;}.bot-preview-keys {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:12px 0 20px;}.delivery-actions {display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin-top:12px;}.bot-preview-menu {max-width:560px;margin-top:16px;}.bot-preview select {max-width:420px;}@media(max-width:800px){.bot-preview-grid{grid-template-columns:1fr;}}
