:root {
    color-scheme: light;
    --ink: #202124;
    --muted: #68707d;
    --line: #e9eaec;
    --surface: #fff;
    --canvas: #fff;
    --navy: #202124;
    --blue: #35383e;
    --radius: 9px;
    --shadow: 0 1px 2px rgb(0 0 0 / 2%);
    --sidebar-width: 224px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; scrollbar-gutter: stable; }
body { margin: 0; color: var(--ink); background: var(--canvas); font: 13px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button, a, input, select { touch-action: manipulation; }
button:disabled { cursor: default; opacity: .5; }
form { margin: 0; }
input, select, textarea { display: block; width: 100%; min-width: 0; min-height: 36px; padding: 8px 11px; color: var(--ink); background: #fff; border: 1px solid #dedfe2; border-radius: 6px; box-shadow: 0 1px 2px #00000003; }
textarea { min-height: 110px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #68707d; }
input:focus, select:focus, textarea:focus { outline: 3px solid #2528300c; border-color: #8d919a; }
input[type="checkbox"] { display: inline-block; flex: 0 0 16px; width: 16px; height: 16px; min-height: 16px; margin: 0; padding: 0; accent-color: #25272b; box-shadow: none; }
button:focus-visible, a:focus-visible { outline: 2px solid #8d919a; outline-offset: 3px; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { line-height: 1.3; overflow-wrap: anywhere; }
h1 { margin-bottom: 7px; font-size: 24px; font-weight: 650; letter-spacing: -.8px; }
h2 { margin-bottom: 14px; font-size: 16px; font-weight: 600; letter-spacing: -.2px; }
h3 { margin-bottom: 7px; font-size: 14px; font-weight: 600; }
h4 { margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 500; }
p { margin-bottom: 14px; }
strong { font-weight: 600; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ui-icon, .nav-icon { display: inline-block; flex: 0 0 auto; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* Quiet application chrome keeps the data in the foreground. */
.app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; align-self: start; height: 100dvh; padding: 18px 12px 16px; background: #fafafa; border-right: 1px solid var(--line); overflow-y: auto; }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; padding: 0 10px; }
.brand { display: flex; align-items: center; gap: 8px; color: #232428; font-size: 16px; font-weight: 650; letter-spacing: -.4px; line-height: 1.2; }
.brand:hover { text-decoration: none; }
.sidebar-label { margin: 28px 10px 10px; color: #95989e; font-size: 11px; font-weight: 450; }
.navigation { display: grid; gap: 3px; }
.navigation > a { display: flex; align-items: center; gap: 10px; min-height: 35px; padding: 8px 10px; color: #60646d; border-radius: 6px; font-size: 13px; font-weight: 450; }
.navigation > a:hover { color: #25272b; background: #f0f0f1; text-decoration: none; }
.navigation > a.is-active { color: #24262b; background: #ececee; font-weight: 550; }
.navigation > a.is-active .nav-icon { color: #24262b; }
.nav-icon { color: #7d8189; width: 16px; height: 16px; }
.sidebar-note { margin-top: auto; padding: 18px 10px 0; color: #555961; font-size: 12px; }
.sidebar-note > span { display: block; margin-bottom: 5px; color: #999ca3; font-size: 10px; }
.sidebar-note strong { font-size: 12px; font-weight: 500; }
.nav-toggle { display: none; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 6px; color: #5f636b; background: #fff; border: 1px solid #e4e5e7; border-radius: 6px; }
.workspace { display: flex; flex-direction: column; min-width: 0; min-height: 100dvh; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 53px; padding: 10px 28px; background: #fff; border-bottom: 1px solid var(--line); }
.topbar-path { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 12px; }
.topbar-path > a { color: #8c9097; }
.topbar-path > span:last-child { color: #41454d; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.path-divider { color: #b8bbc1; }
.account-menu { display: flex; align-items: center; gap: 8px; min-width: 0; }
.avatar { display: grid; place-items: center; flex: 0 0 26px; height: 26px; color: #737780; background: #f2f3f4; border: 1px solid #e8e9eb; border-radius: 50%; font-size: 10px; }
.account-menu strong { display: block; font-size: 11px; font-weight: 500; }
.account-menu small { display: block; color: #68707d; font-size: 10px; }
.account-menu form { margin-left: 8px; }
.account-menu .text-button { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.account-menu .ui-icon { width: 14px; height: 14px; }
.content { flex: 1; width: 100%; max-width: 1560px; min-width: 0; margin-inline: auto; padding: 32px 28px; }
.footer { width: 100%; max-width: 1560px; margin-inline: auto; padding: 0 28px 18px; color: #a2a5ab; font-size: 10px; }
:where(.panel, .page-heading, .section-heading, .detail-grid, .overview-grid, .stats-grid, .grant-panel, .filter-bar) > * { min-width: 0; }
.page-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 25px; }
.page-heading p { margin-bottom: 0; color: var(--muted); font-size: 12px; }
.eyebrow { display: block; margin-bottom: 8px; color: #9a9da4; font-size: 10px; font-weight: 450; letter-spacing: .2px; }
.heading-count { display: inline-block; margin-left: 7px; padding: 2px 5px; color: #68707d; background: #f5f5f6; border-radius: 4px; font-size: 11px; font-weight: 450; letter-spacing: 0; vertical-align: middle; }
.panel { min-width: 0; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; max-width: 100%; min-height: 34px; padding: 7px 12px; color: #fff; background: #25272b; border: 1px solid #25272b; border-radius: 6px; box-shadow: 0 1px 2px #00000008; font-size: 12px; font-weight: 500; line-height: 1.4; text-align: center; white-space: normal; overflow-wrap: anywhere; }
.button:hover { color: #fff; background: #36383e; text-decoration: none; }
.button-secondary { color: #5a5e67; background: #fff; border-color: #e0e2e5; }
.button-secondary:hover { color: #25272b; background: #f7f7f8; border-color: #d1d4d9; }
.button-small { min-height: 29px; padding: 5px 9px; font-size: 11px; }
.button-danger-outline { color: #a74a53; background: #fff; border-color: #ead4d7; }
.button-danger-outline:hover { color: #a13440; background: #fff5f6; border-color: #dca5ad; }
.button-danger { background: #b34b57; border-color: #b34b57; }
.button-danger:hover { background: #9e3a47; }
.button-success { color: #fff; background: #39765c; border-color: #39765c; }
.button-success:hover { background: #30664e; border-color: #30664e; }
.application-decision-actions button[aria-disabled="true"] { pointer-events: none; opacity: .55; cursor: progress; }
.confirmation-dialog { width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: 0; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 20px 70px #15191f29; }
.confirmation-dialog[open] { animation: confirmation-enter 140ms ease-out; }
.confirmation-dialog::backdrop { background: #171b263d; backdrop-filter: blur(3px); }
body:has(.confirmation-dialog[open]) { overflow: hidden; }
.confirmation-dialog-body { padding: 25px; }
.confirmation-dialog h2 { margin-bottom: 12px; font-size: 20px; font-weight: 600; line-height: 1.4; letter-spacing: -.35px; }
.confirmation-dialog p { margin-bottom: 24px; color: var(--muted); font-size: 13px; }
.confirmation-dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }
.confirmation-dialog-actions .button { min-height: 37px; padding-inline: 15px; }
.shipment-editor { width: min(680px, calc(100vw - 32px)); }
.shipment-editor-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.shipment-editor-heading h2 { margin-bottom: 7px; }
.shipment-editor-heading p { margin-bottom: 0; font-size: 12px; }
.dialog-close { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 30px; width: 30px; height: 30px; padding: 5px; color: #767c85; background: #fafbfc; border: 1px solid var(--line); border-radius: 6px; }
.dialog-close:hover { color: var(--ink); background: #f0f2f4; }
.shipment-editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.shipment-editor-grid .form-field { margin-bottom: 0; }
.shipment-editor-wide { grid-column: 1 / -1; }
.shipment-editor-grid textarea { min-height: 90px; }
.shipment-editor .shipment-editor-note { margin: 18px 0 22px; font-size: 12px; }
.shipment-row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.shipment-edit-button .ui-icon { width: 14px; height: 14px; }
.shipment-delivery-warning { color: #8a682c; }
.toast-region { position: fixed; z-index: 1100; top: 18px; right: 20px; width: min(390px, calc(100vw - 32px)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 11px; padding: 13px 12px 13px 15px; border: 1px solid; border-radius: 9px; box-shadow: 0 6px 24px #152d2112; pointer-events: auto; animation: toast-enter 180ms ease-out; }
.toast-success { color: #39765c; background: #f3fbf6; border-color: #d7eade; }
.toast-icon { flex: 0 0 21px; width: 21px; height: 21px; }
.toast-message { flex: 1; min-width: 0; margin: 0; font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.toast-close { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 28px; width: 28px; height: 28px; padding: 5px; color: #648371; background: none; border: 0; border-radius: 5px; }
.toast-close:hover { color: #285d43; background: #e3f2e9; }
@keyframes confirmation-enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-enter { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
    .confirmation-dialog[open], .toast { animation: none; }
}
.button-row, .table-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.button-row { margin-top: 16px; }
.text-button { padding: 4px 0; color: #82868e; background: none; border: 0; font-size: 12px; }
.text-button:hover { color: var(--ink); }
.text-danger { color: #ae4854; }
.inline-link { font-size: 12px; font-weight: 500; }
.muted { color: var(--muted); }
.compact { margin-bottom: 0; font-size: 12px; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.shipment-form { max-width: 620px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { min-width: 0; padding: 18px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.stat-card:hover { border-color: #cdd0d6; text-decoration: none; }
.stat-card > span { color: #7b7f87; font-size: 12px; }
.stat-card > strong { display: block; margin-top: 14px; font-size: 29px; font-weight: 550; letter-spacing: -.8px; line-height: 1.1; }
.stat-card small { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; color: #a1a4ab; font-size: 10px; }
.stat-accent > strong { color: #946e30; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; }
.welcome-panel > p { max-width: 620px; color: var(--muted); }

.table-panel { padding: 0; border-radius: 8px; box-shadow: none; }
.filter-bar { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(150px, 185px) auto; align-items: end; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.filter-field, .search-field { display: block; min-width: 0; }
.filter-field > span:not(.sr-only), .search-field > span:not(.sr-only) { display: block; margin-bottom: 6px; color: #68707d; font-size: 11px; font-weight: 450; }
.filter-bar input, .filter-bar select { min-height: 33px; padding: 6px 9px; font-size: 12px; }
.filter-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; min-height: 33px; }
.filter-bar.application-filters { position: relative; grid-template-columns: minmax(200px, 1fr) minmax(150px, 185px) auto auto; }
.filter-bar.awaiting-publications-filters { grid-template-columns: minmax(220px, 1fr) auto; }
.users-filters .filter-field { display: flex; flex-direction: column; gap: 6px; }
.users-filters .filter-field > span { margin-bottom: 0; }
.users-filters input, .users-filters select { height: 34px; min-height: 34px; line-height: 20px; }
.awaiting-publications-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.application-filters .filter-actions { grid-column: auto; }
.table-scroll { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; scrollbar-color: #bbc2cc #f2f4f7; }
.table-scroll::-webkit-scrollbar { height: 9px; }
.table-scroll::-webkit-scrollbar-track { background: #f2f4f7; }
.table-scroll::-webkit-scrollbar-thumb { background: #bbc2cc; border: 2px solid #f2f4f7; border-radius: 8px; }
.table-scroll-navigation { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 14px; color: #737d8b; background: #fcfcfd; border-top: 1px solid var(--line); font-size: 11px; }
.table-scroll-buttons { display: flex; gap: 6px; }
.table-scroll-buttons .button { min-height: 28px; padding: 4px 8px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
.data-table { table-layout: fixed; }
thead { background: #fafbfc; }
th { padding: 10px 14px; color: #68707d; border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 450; line-height: 1.4; }
td { padding: 11px 14px; border-bottom: 1px solid #eef0f2; vertical-align: middle; overflow-wrap: anywhere; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fcfcfd; }
.users-table .col-user { width: 36%; }
.users-table .col-access { width: 23%; }
.users-table .col-activity { width: 23%; }
.users-table .col-actions { width: 18%; }
.publications-table .col-user { width: 22%; }
.publications-table .col-publication { width: 22%; }
.publications-table .col-status { width: 15%; }
.publications-table .col-comment { width: 25%; }
.publications-table .col-date { width: 16%; }
.roles-table .col-user { width: 27%; }
.roles-table .col-access { width: 22%; }
.roles-table .col-invite { width: 29%; }
.roles-table .col-actions { width: 22%; }
.applications-table th:first-child { width: 36%; }
.applications-table th:nth-child(2) { width: 25%; }
.applications-table th:nth-child(3) { width: 23%; }
.cell-stack { display: grid; gap: 3px; }
.cell-primary, .person-name { color: #33363d; font-size: 12px; font-weight: 550; overflow-wrap: anywhere; }
.cell-secondary, .cell-note { display: block; margin-top: 4px; color: #68707d; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.cell-stack .cell-secondary, .cell-stack .cell-note { margin-top: 0; }
.cell-metrics { display: flex; flex-direction: column; gap: 3px; color: #68707d; font-size: 11px; }
.cell-metrics strong { color: #454a54; font-weight: 500; }
.publication-link-cell, .publication-comment-cell { min-width: 0; max-width: none; }
.publication-url, .comment-preview { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.compact-external-link { display: inline-flex; align-items: center; gap: 6px; width: 100%; min-width: 0; max-width: 100%; vertical-align: middle; }
.publication-url-caption { display: block; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.external-link-icon { display: block; flex: 0 0 14px; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.cell-user .person-name { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.action-cell { text-align: right; }
.badge { display: inline-flex; align-items: center; justify-content: center; gap: 5px; width: fit-content; max-width: 100%; padding: 2px 6px; color: #68707d; background: #fafbfc; border: 1px solid #e7e9ed; border-radius: 4px; font-size: 11px; font-weight: 450; line-height: 1.4; white-space: normal; }
.badge::before { content: ''; flex: 0 0 4px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .7; }
.badge { overflow-wrap: normal; word-break: normal; }
.badge-neutral { color: #68707d; }
.badge-admin { color: #7c6ba4; background: #f9f7fd; border-color: #ece6f5; }
.badge-success { color: #39765c; background: #f5fbf8; border-color: #dfeee6; }
.badge-warning { color: #8a682c; background: #fffcf5; border-color: #f2e9d3; }
.status-dot, .small-dot { display: inline-block; flex: 0 0 5px; width: 5px; height: 5px; margin-right: 6px; background: #64a58c; border-radius: 50%; }
.dot-label { display: flex; align-items: center; color: var(--muted); font-size: 11px; }
.dot-green { background: #64a58c; }
.dot-gray { background: #68707d; }
.table-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 13px 18px; color: #68707d; border-top: 1px solid var(--line); font-size: 10px; }
.pagination { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.pagination a { font-size: 10px; }
.empty-state { padding: 44px 20px; color: var(--muted); text-align: center; }
.empty-state h2 { margin: 14px 0 7px; font-size: 15px; }
.empty-state p { margin: 0; font-size: 12px; }
.empty-symbol { display: inline-grid; place-items: center; width: 38px; height: 38px; color: #989da6; background: #f7f8f9; border: 1px solid var(--line); border-radius: 8px; font-size: 21px; }
.empty-inline { padding: 24px; color: var(--muted); text-align: center; }

/* Selection actions appear only while they are relevant. */
.table-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.table-tools h2 { margin: 0; }
.table-heading-summary { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 10px; }
.table-heading-summary > .muted { font-size: 12px; }
.table-view-label, .bulk-select-all { display: inline-flex; align-items: center; gap: 7px; color: #777d86; font-size: 11px; }
.table-view-label { padding-right: 12px; border-right: 1px solid var(--line); }
.table-view-icon, .action-icon { flex: 0 0 auto; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.bulk-select-all, .bulk-row-selector { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.bulk-select-all-mobile { display: none; }
.bulk-applications-table th.bulk-selection-heading { padding-right: 0; text-align: center; }
.bulk-decision-hint { margin-left: auto; color: #68707d; font-size: 10px; }
.bulk-applications-table .col-selection { width: 42px; }
.bulk-applications-table .col-user { width: 33%; }
.bulk-applications-table .col-access { width: 24%; }
.bulk-applications-table .col-activity { width: 25%; }
.bulk-applications-table .col-actions { width: 18%; }
.bulk-applications-table td.bulk-selection-cell { padding-right: 0; text-align: center; }
.bulk-applications-table td { line-height: 20px; }
.bulk-applications-table .person-name { line-height: 20px; }
.bulk-applications-table .badge { vertical-align: middle; }
.bulk-applications-table .bulk-row-selector { display: flex; justify-content: center; margin: 0; line-height: 1; }
.bulk-applications-table td.bulk-selection-cell { line-height: 0; }
.bulk-applications-table tr.is-selected, .bulk-applications-table tr.is-selected:hover { background: #f6f7f9; }
.bulk-mobile-label { display: none; }
.bulk-unavailable { color: #c0c4cc; }
.bulk-actionbar { position: fixed; z-index: 60; left: calc(var(--sidebar-width) + (100% - var(--sidebar-width)) / 2); bottom: 24px; display: flex; align-items: center; gap: 12px; width: max-content; max-width: calc(100% - var(--sidebar-width) - 48px); padding: 6px 8px; color: #ebedef; background: #202122; border: 1px solid #111; border-radius: 9px; box-shadow: 0 8px 24px #00000018, 0 1px 3px #00000015; transform: translateX(-50%); }
.bulk-clear-selection { display: inline-grid; place-items: center; flex: 0 0 26px; width: 26px; height: 26px; padding: 5px; color: #b9bdc3; background: #282a2c; border: 1px solid #3b3d40; border-radius: 5px; }
.bulk-clear-selection:hover { color: #fff; background: #36383b; }
.bulk-selection-count { font-size: 11px; white-space: nowrap; }
.bulk-actionbar-separator { align-self: stretch; flex: 0 0 1px; margin-block: 2px; background: #3b3d40; }
.bulk-actionbar-actions { display: flex; align-items: center; gap: 4px; }
.bulk-action-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 28px; padding: 5px 9px; color: #e5e7eb; background: transparent; border: 0; border-radius: 5px; font-size: 11px; white-space: nowrap; }
.bulk-action-button:hover { background: #343638; }
.bulk-action-reject { color: #e5a3a9; }
body:has(.bulk-actionbar:not([hidden])) .content { padding-bottom: 110px; }

.notice { position: relative; margin-bottom: 18px; padding: 10px 13px 10px 32px; color: #477560; background: #f0faf5; border: 1px solid #dbede3; border-radius: 6px; font-size: 12px; overflow-wrap: anywhere; }
.notice::before { position: absolute; top: 13px; left: 12px; content: '✓'; width: 12px; height: 12px; color: #589078; border: 1px solid #85b29b; border-radius: 50%; font-size: 9px; line-height: 10px; text-align: center; }
.error { color: #b24c59; font-size: 12px; overflow-wrap: anywhere; }
.validation-summary { margin-bottom: 16px; }
.validation-summary ul { margin: 0; padding: 10px 12px 10px 28px; background: #fff4f5; border: 1px solid #f0dcdf; border-radius: 6px; }
.validation-summary:empty, .field-validation-valid, .validation-summary-valid { display: none; }
.form-field { min-width: 0; margin-bottom: 16px; }
.form-field label { display: block; margin-bottom: 6px; color: #565b65; font-size: 12px; font-weight: 450; }
.form-field .error { display: block; margin-top: 5px; }
.form-field small, .helper-text { display: block; margin-top: 6px; color: #68707d; font-size: 11px; }
.input-validation-error { border-color: #d5a4ad; }
.breadcrumb { display: inline-block; margin-bottom: 18px; color: #9499a2; font-size: 11px; }
.profile-heading { align-items: flex-start; }
.application-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 9px 12px; margin-bottom: 8px; }
.application-title-row h1 { min-width: 0; margin: 0; }
.application-title-row > .badge { flex: 0 0 auto; }
.identity-line.application-identity { align-items: baseline; }
.application-identity .mono { font-size: inherit; line-height: inherit; }
.identity-line { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 12px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; }
.application-details-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; gap: 20px; }
.application-profile-stack, .application-blog-stack { display: grid; min-width: 0; gap: 14px; }
.application-profile-stack { align-self: stretch; grid-template-rows: auto 1fr; }
.application-secondary-blog { padding-block: 16px; }
.application-secondary-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.application-secondary-metrics span { display: block; color: var(--muted); font-size: 10px; }
.application-secondary-metrics strong { display: block; margin-top: 3px; font-size: 16px; font-weight: 550; overflow-wrap: anywhere; }
.application-blog-context .tag-list { margin-bottom: 0; }
.application-blog-context h3 { margin-top: 20px; }
.application-decision-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.data-list { margin: 0; }
.data-list > div { display: grid; grid-template-columns: minmax(100px, 140px) minmax(0, 1fr); gap: 14px; padding: 11px 0; border-bottom: 1px solid #f0f1f3; font-size: 12px; }
.data-list > div:last-child { padding-bottom: 0; border-bottom: 0; }
.data-list dt { color: #68707d; }
.data-list dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.activity-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 20px 0; }
.activity-counts strong { display: block; margin-bottom: 4px; font-size: 23px; font-weight: 550; }
.activity-counts span { color: var(--muted); font-size: 11px; }
.divider { height: 1px; margin: 20px 0; background: var(--line); }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.section-block { margin-top: 22px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.section-heading h2, .section-heading h3 { margin-bottom: 0; }
.section-heading > .muted { font-size: 11px; }
.blog-card, .publication-card { margin-bottom: 16px; }
.reach-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 20px; padding: 16px; background: #fafbfc; border: 1px solid #eef0f2; border-radius: 7px; }
.reach-grid > div { min-width: 0; }
.reach-grid span { display: block; color: #68707d; font-size: 11px; }
.reach-grid strong { display: block; margin-top: 6px; font-size: 22px; font-weight: 550; line-height: 1.3; overflow-wrap: anywhere; }
.application-primary-metrics { padding: 16px 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; }
.application-primary-metrics strong { font-size: 29px; }
.additional-links { margin-top: 20px; }
.additional-links > div { margin-top: 7px; font-size: 12px; }
.panel-heading { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0; }
.review-comment { margin-bottom: 16px; padding: 14px; background: #fafbfc; border: 1px solid #eef0f2; border-radius: 6px; font-size: 12px; }
.review-comment > strong { color: #7d838d; font-size: 11px; }
.review-comment p { margin: 7px 0 0; }
.metadata { display: flex; flex-wrap: wrap; gap: 8px 16px; color: #68707d; font-size: 11px; }
.metadata > span { max-width: 100%; overflow-wrap: anywhere; }
.multiline { white-space: pre-wrap; overflow-wrap: anywhere; }
.break-word { overflow-wrap: anywhere; word-break: break-word; }
.nowrap { white-space: nowrap; }
.danger-zone { margin-top: 28px; border-color: #ecd8dc; box-shadow: none; }
.danger-zone h2 { color: #aa4d5b; }
.danger-zone > p { color: var(--muted); }
.deletion-confirmation { margin-top: 20px; padding-top: 20px; border-top: 1px solid #f0dfe3; }
.deletion-confirmation p { max-width: 740px; }
.deletion-confirmation form { max-width: 560px; margin-top: 20px; }
.grant-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 24px; }
.grant-panel h2 { margin-bottom: 8px; }
.grant-form { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; }
.grant-form .form-field { flex: 1 1 190px; margin-bottom: 0; }
.grant-form .button { flex: 0 1 auto; min-height: 36px; }
.grant-form input, .grant-form > .button { height: 36px; min-height: 36px; }
.grant-validation { flex-basis: 100%; }
.invite-panel { margin-bottom: 20px; background: #f8f9fd; border-color: #e2e5f1; }
.secret-output { display: block; margin-bottom: 14px; padding: 14px; background: #fff; border: 1px solid #dfe3ed; border-radius: 6px; font: 12px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; user-select: all; }
.page-note { max-width: 880px; margin-top: 20px; color: var(--muted); font-size: 12px; }

/* Each field owns a column; the viewport scrolls when all columns are shown. */
.column-picker { position: relative; flex: 0 0 auto; }
.columns-trigger { gap: 6px; list-style: none; cursor: pointer; user-select: none; }
.columns-trigger::-webkit-details-marker { display: none; }
.columns-trigger::marker { content: ''; }
.columns-trigger .ui-icon { width: 14px; height: 14px; }
.column-picker[open] .columns-trigger { background: #f5f6f8; border-color: #cdd1d8; }
.column-picker-count { padding-left: 3px; color: #8b929e; font-size: 10px; font-variant-numeric: tabular-nums; }
.column-picker-panel { position: absolute; top: calc(100% + 7px); right: 0; z-index: 80; width: 258px; max-width: calc(100vw - 32px); padding: 7px; background: #fff; border: 1px solid #e2e5e9; border-radius: 9px; box-shadow: 0 8px 24px #1d243414, 0 2px 5px #1d243408; }
.column-picker-heading { padding: 7px 8px 9px; color: #9299a4; font-size: 10px; }
.column-picker-options { display: grid; max-height: 310px; overflow-y: auto; overscroll-behavior: contain; }
.column-picker-option { display: flex; align-items: center; gap: 9px; min-height: 33px; padding: 7px 8px; color: #5b6472; border-radius: 5px; cursor: pointer; font-size: 12px; }
.column-picker-option:hover { background: #f7f8fa; }
.column-picker-option > span { flex: 1 1 auto; min-width: 0; }
.column-picker-option input[type="checkbox"] { flex: 0 0 16px; width: 16px; height: 16px; min-height: 16px; padding: 0; }
.column-picker-option:has(input:disabled) { cursor: default; color: #7c8491; }
.column-picker-option input:disabled { opacity: .45; }
.column-lock { flex: 0 0 auto; width: 12px; height: 12px; fill: none; stroke: #a2a9b4; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.column-picker-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 5px; padding: 9px 8px 3px; border-top: 1px solid #eef0f3; }
.column-picker-footer .text-button { color: #5e6776; font-size: 11px; }
.column-picker-footer > span { color: #939aa5; font-size: 10px; }
.table-tools > .column-picker { margin-left: auto; }
.table-tools:has(> .column-picker) .bulk-decision-hint { margin-left: 0; }
.customizable-table th[data-column] { --column-width: 145px; }
.customizable-table th[data-column="name"] { --column-width: 215px; }
.customizable-table th[data-column="telegram"], .customizable-table th[data-column="manager"], .customizable-table th[data-column="reviewedBy"] { --column-width: 125px; }
.customizable-table th[data-column="selection"] { --column-width: 44px; }
.customizable-table th[data-column="actions"] { --column-width: 115px; }
.customizable-table th[data-column="blogs"], .customizable-table th[data-column="applications"], .customizable-table th[data-column="publications"], .customizable-table th[data-column="version"] { --column-width: 85px; }
.customizable-table th[data-column="brand"], .customizable-table th[data-column="direction"] { --column-width: 115px; }
.customizable-table th[data-column="subscribers"], .customizable-table th[data-column="monthlyReach"] { --column-width: 125px; }
.customizable-table th[data-column="averageReach"] { --column-width: 145px; }
.customizable-table th[data-column="project"], .customizable-table th[data-column="invite"] { --column-width: 225px; }
.customizable-table th[data-column="created"], .customizable-table th[data-column="reviewedAt"], .customizable-table th[data-column="lastMessageAt"] { --column-width: 160px; }
.customizable-table th[data-column="url"] { --column-width: 250px; }
.customizable-table th[data-column="network"] { --column-width: 145px; }
.customizable-table th[data-column="topic"] { --column-width: 200px; }
.customizable-table th[data-column="primary"] { --column-width: 110px; }
.customizable-table th[data-column="links"] { --column-width: 250px; }
.customizable-table th[data-column="tracking"] { --column-width: 180px; }
.customizable-table th[data-column="trackingSentAt"] { --column-width: 170px; }
.customizable-table th[data-column="blogUrl"] { --column-width: 250px; }
.awaiting-publications-table th[data-column="actions"] { --column-width: 245px; }
.shipments-table th[data-column="actions"] { --column-width: 215px; }
.shipments-table th[data-column="status"] { --column-width: 180px; }
.bulk-applications-table th[data-column="status"] { --column-width: 165px; }
.bulk-applications-table th[data-column="actions"] { --column-width: 145px; }
.customizable-table th[data-column="managerComment"] { --column-width: 250px; }
.customizable-table th[data-column="delivery"] { --column-width: 160px; }
.customizable-table th[data-column="deliveryAttempts"] { --column-width: 90px; }
@media (min-width: 681px) {
    .shipments-table th[data-column="actions"], .shipments-table td[data-column="actions"] { position: sticky; right: 0; z-index: 2; background: #fff; box-shadow: -1px 0 0 var(--line), -8px 0 12px -11px #25272b40; }
    .shipments-table th[data-column="actions"] { z-index: 3; background: #fafbfc; }
    .shipments-table tbody tr:hover td[data-column="actions"] { background: #fcfcfd; }
}
.customizable-table th[data-column="body"], .customizable-table th[data-column="comment"], .customizable-table th[data-column="lastMessage"] { --column-width: 280px; }
.customizable-table td.numeric, .customizable-table th.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.customizable-table td[data-column="created"], .customizable-table td[data-column="reviewedAt"], .customizable-table td[data-column="lastMessageAt"] { color: #737d8b; font-size: 11px; }
.customizable-table .cell-user .person-name { -webkit-line-clamp: 2; }
@media (min-width: 681px) {
    .customizable-table { table-layout: fixed; width: max(100%, var(--table-min-width, 100%)); min-width: var(--table-min-width, 100%); }
    .customizable-table th[data-column] { width: var(--column-width); min-width: var(--column-width); }
    .customizable-table td[data-column="telegram"], .customizable-table td[data-column="username"], .customizable-table td[data-column="created"], .customizable-table td[data-column="reviewedAt"], .customizable-table td[data-column="lastMessageAt"] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 680px) {
    .shipment-editor-grid { grid-template-columns: minmax(0, 1fr); }
    .shipment-editor-heading { gap: 12px; }
    .bulk-applications-table .bulk-row-selector { justify-content: flex-start; line-height: 1.4; }
    .confirmation-dialog-body { padding: 21px; }
    .confirmation-dialog-actions .button { flex: 1; }
    .toast-region { top: 12px; right: 16px; }
    .filter-bar.awaiting-publications-filters { grid-template-columns: minmax(0, 1fr); }
    .table-scroll-navigation { display: none; }
    .filter-actions, .table-tools { position: relative; }
    .column-picker { position: static; }
    .column-picker-panel { max-height: calc(100dvh - 40px); }
    .column-picker-options { max-height: min(310px, 45dvh); }
    .customizable-table td.numeric { text-align: left; }
    .customizable-table { min-width: 0; }
}

/* Authentication uses the same quiet, neutral controls. */
.auth-page { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; min-height: 100dvh; padding: 40px 20px; background-color: #f8f9fa; background-image: linear-gradient(#e9ebee55 1px, transparent 1px), linear-gradient(90deg, #e9ebee55 1px, transparent 1px); background-size: 46px 46px; }
.auth-brand { color: #555a62; font-size: 14px; font-weight: 500; }
.auth-card { width: 100%; max-width: 400px; overflow: hidden; padding: 26px 28px 0; background: #fff; border: 1px solid #e3e5e8; border-radius: 11px; box-shadow: 0 3px 12px #00000003; }
.auth-tabs { display: flex; align-items: center; justify-content: center; gap: 4px; margin-bottom: 26px; }
.auth-tab { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 5px 9px; color: #8d929a; border: 1px solid transparent; border-radius: 5px; font-size: 11px; }
.auth-tab svg { flex: 0 0 auto; width: 14px; height: 14px; }
.auth-tab:hover { color: #363a43; text-decoration: none; background: #fafbfc; }
.auth-tab.is-active { color: #343840; background: #fff; border-color: #e8eaed; box-shadow: 0 1px 3px #00000006; }
.auth-heading { margin-bottom: 23px; }
.auth-card h1 { margin-bottom: 8px; font-size: 20px; font-weight: 600; letter-spacing: -.5px; }
.auth-description, .auth-card p { color: #68707d; font-size: 12px; line-height: 1.6; }
.auth-description:last-child { margin-bottom: 0; }
.auth-form > .button { width: 100%; margin-top: 4px; min-height: 36px; background-image: linear-gradient(#303338, #202328); }
.auth-form > .button:hover { background-image: linear-gradient(#3d4147, #2b2e34); }
.auth-card .form-field label { color: #5b616c; font-size: 11px; }
.auth-card input { min-height: 37px; font-size: 12px; }
.auth-card .helper-text { font-size: 10px; }
.auth-form .auth-code-button { width: 100%; margin-top: 10px; font-size: 11px; }
.auth-footer { margin: 25px -28px 0; padding: 16px 18px; color: #68707d; background: #fcfcfd; border-top: 1px solid #eef0f2; text-align: center; font-size: 11px; }
.auth-footer p { margin: 0; font-size: 11px; }
.auth-footer a { color: #5a606a; text-decoration: underline; text-underline-offset: 2px; }
.auth-error-card { padding-bottom: 26px; }
.auth-error-icon { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 18px; color: #b87f86; background: #fff5f6; border: 1px solid #f1dfe3; border-radius: 8px; }
.auth-error-icon svg { width: 18px; height: 18px; }
.skip-link { position: fixed; top: 10px; left: 10px; z-index: 1000; padding: 9px 14px; color: var(--ink); background: #fff; border: 1px solid #9299a5; border-radius: 5px; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.table-scroll:focus-visible { outline: 2px solid #a1a8b4; outline-offset: -2px; }

@media (max-width: 1200px) {
    .filter-bar.application-filters { grid-template-columns: minmax(0, 1fr) minmax(150px, 185px); }
    .application-filters > .column-picker { justify-self: end; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .overview-grid, .detail-grid, .grant-panel { grid-template-columns: minmax(0, 1fr); }
    .grant-form { max-width: 620px; }
}
@media (max-width: 1000px) {
    .filter-bar { grid-template-columns: minmax(0, 1fr) minmax(145px, 180px); }
    .filter-actions { grid-column: 1 / -1; }
    .topbar-path > a, .path-divider { display: none; }
}
@media (max-width: 900px) {
    .application-details-grid { grid-template-columns: minmax(0, 1fr); }
    .app-shell { grid-template-columns: minmax(0, 1fr); }
    .sidebar { position: static; height: auto; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
    .sidebar-heading { padding: 0; }
    .nav-toggle { display: inline-flex; }
    .sidebar-label, .sidebar-note { display: none; }
    .navigation { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-top: 10px; }
    .has-js .navigation:not(.is-open) { display: none; }
    .topbar { min-height: 49px; padding: 8px 20px; }
    .content { padding: 24px 20px; }
    .footer { padding: 0 20px 16px; }
    .bulk-actionbar { left: 50%; max-width: calc(100% - 32px); }
    .account-menu strong { font-size: 10px; }
}
@media (max-width: 680px) {
    .application-primary-blog .application-primary-metrics strong { font-size: 24px; }
    .application-decision-actions .button { flex: 1 1 180px; }
    html { scrollbar-gutter: auto; }
    .sidebar { padding-inline: 16px; }
    .navigation { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .topbar { padding-inline: 16px; }
    .topbar-path { font-size: 11px; }
    .content { padding: 24px 16px; }
    .footer { padding-inline: 16px; }
    h1 { font-size: 23px; }
    .page-heading { gap: 14px; margin-bottom: 22px; }
    .page-heading > .button { width: 100%; }
    .panel { padding: 17px; }
    .table-panel { padding: 0; }
    .filter-bar { grid-template-columns: minmax(0, 1fr); padding: 16px; gap: 12px; }
    .filter-bar.application-filters { grid-template-columns: minmax(0, 1fr) auto; }
    .application-filters > .filter-field { grid-column: 1 / -1; }
    .filter-actions { grid-column: auto; }
    .filter-actions .button { flex: 1; }
    .filter-bar input, .filter-bar select { min-height: 37px; }
    .users-filters input, .users-filters select { height: 37px; }
    .table-tools { padding: 11px 15px; gap: 10px; }
    .bulk-decision-hint { display: block; flex-basis: 100%; margin-left: 0; }
    .table-scroll { overflow-x: visible; }
    .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
    .data-table colgroup, .data-table thead { display: none; }
    .data-table tbody { padding: 12px; }
    .data-table tr { margin-bottom: 11px; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 7px; }
    .data-table tr:last-child { margin-bottom: 0; }
    .data-table td { padding: 7px 0; border-bottom: 0; text-align: left; }
    .data-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 5px; color: #68707d; font-size: 10px; }
    .data-table .cell-primary { font-size: 13px; }
    .bulk-applications-table td.bulk-selection-cell { padding: 3px 0 10px; text-align: left; border-bottom: 1px solid #f0f1f3; }
    .bulk-mobile-label { display: inline; color: #7d838e; font-size: 11px; }
    .bulk-select-all-mobile { display: inline-flex; margin: 12px 12px 0; }
    .bulk-applications-table .bulk-selection-cell:has(.bulk-unavailable) { display: none; }
    .bulk-actionbar { bottom: 12px; flex-wrap: wrap; justify-content: space-between; gap: 8px; width: max-content; max-width: calc(100% - 24px); padding: 8px; }
    .bulk-actionbar-actions { flex-basis: 100%; flex-wrap: wrap; gap: 6px; }
    .bulk-actionbar-separator { display: none; }
    .bulk-action-button { flex: 1 1 110px; padding: 8px 7px; min-height: 34px; font-size: 10px; }
    .cell-metrics { flex-direction: row; flex-wrap: wrap; gap: 5px 12px; }
    .table-footer { padding: 13px 15px; gap: 12px; }
    .data-list > div { grid-template-columns: minmax(0, 1fr); gap: 5px; }
    .reach-grid { gap: 13px; padding: 13px; }
    .reach-grid strong { font-size: 20px; }
    .metadata { gap: 8px; }
    .button-row > .button { flex: 1 1 100%; }
    .grant-form { display: grid; grid-template-columns: minmax(0, 1fr); }
    .grant-form .form-field, .grant-form .button { width: 100%; }
    .auth-page { justify-content: flex-start; gap: 22px; padding: 32px 16px; }
    .auth-card { padding: 24px 22px 0; }
    .auth-footer { margin-inline: -22px; }
    .auth-error-card { padding-bottom: 24px; }
}
@media (max-width: 420px) {
    .account-menu { gap: 6px; }
    .account-menu strong { display: none; }
    .account-menu form { margin-left: 4px; }
    .stats-grid { gap: 10px; }
    .stat-card { padding: 14px; }
    .stat-card > strong { font-size: 26px; }
    .stat-card small { display: block; font-size: 10px; }
    .stat-card small > span { display: none; }
    .reach-grid { grid-template-columns: minmax(0, 1fr); }
    .reach-grid > div { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
    .reach-grid > div + div { padding-top: 10px; border-top: 1px solid var(--line); }
    .reach-grid strong { margin-top: 0; }
}

/* One conversation keeps its history and composer in the same frame. */
.chat-shell.panel { display: flex; flex-direction: column; height: calc(100dvh - 126px); min-height: 440px; padding: 0; overflow: hidden; }
.chat-shell [hidden] { display: none !important; }
.chat-header { display: flex; align-items: center; flex: 0 0 auto; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.chat-back { display: inline-grid; place-items: center; flex: 0 0 32px; width: 32px; height: 36px; color: #7a818c; border-radius: 7px; font-size: 22px; }
.chat-back:hover { color: var(--navy); background: #f5f6f8; text-decoration: none; }
.chat-identity { flex: 1 1 180px; min-width: 0; }
.chat-identity h1 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin: 0 0 4px; font-size: 16px; line-height: 1.3; letter-spacing: -.2px; }
.chat-identity .mono { display: block; color: var(--muted); font-size: 12px; }
.chat-connection { color: var(--muted); font-size: 11px; }
.chat-header-actions { display: flex; align-items: center; justify-content: flex-end; flex: 0 1 auto; flex-wrap: wrap; gap: 10px 14px; }
.chat-profile-link { font-size: 13px; font-weight: 600; white-space: nowrap; }
.chat-feedback { flex: 0 0 auto; max-height: 96px; overflow-y: auto; padding: 10px 20px; color: #656d85; background: #f4f6fc; border-bottom: 1px solid #e3e7f2; font-size: 13px; overflow-wrap: anywhere; }
.chat-feedback p, .chat-feedback .validation-summary { margin: 0; }
.chat-feedback .validation-summary ul { margin: 0; padding-left: 18px; }
.chat-feedback.is-error, .chat-feedback[data-error="true"] { color: #a94b58; background: #fff5f6; border-color: #eed9dd; }
.chat-thread { position: relative; flex: 1 1 0; min-height: 0; overflow: hidden; background: #fafbfc; }
.chat-history { display: flex; flex-direction: column; align-items: stretch; gap: 12px; height: 100%; min-height: 0; padding: 22px 24px; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-gutter: stable; }
.chat-history:focus-visible { outline: 2px solid #a3bfe7; outline-offset: -2px; }
.chat-message { align-self: flex-start; flex: 0 0 auto; width: fit-content; max-width: min(82%, 640px); padding: 10px 14px; border: 1px solid #e7eaef; border-radius: 12px 12px 12px 3px; background: #fff; overflow-wrap: anywhere; }
.chat-message-outgoing { align-self: flex-end; background: #f1f3f7; border-color: #e2e6ed; border-radius: 12px 12px 3px 12px; }
.chat-message-header { margin-bottom: 4px; color: #8c949f; font-size: 12px; line-height: 1.4; }
.chat-message .chat-message-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.55; }
.chat-message-attachment { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.chat-message-attachment > span { font-size: 17px; }
.chat-message-meta { display: flex; align-items: baseline; justify-content: flex-end; flex-wrap: wrap; gap: 4px 10px; margin-top: 7px; color: #9ba2ac; font-size: 11px; line-height: 1.4; }
.chat-message-meta time { white-space: nowrap; }
.chat-delivery[data-delivery-status="sent"] { color: #5d917d; }
.chat-delivery[data-delivery-status="cancelled"], .chat-delivery[data-delivery-status="failed"] { color: #a08a62; }
.chat-empty { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 8px; max-width: 340px; min-height: 140px; margin: auto; color: var(--muted); text-align: center; font-size: 13px; }
.chat-empty strong { color: #69717e; font-size: 15px; }
.chat-empty-symbol { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 4px; color: #9ca4af; background: #f5f6f8; border: 1px solid #e7eaef; border-radius: 50%; font-size: 21px; }
.chat-new.button { position: absolute; right: 20px; bottom: 16px; min-height: 36px; box-shadow: 0 3px 12px #172d4926; }
.chat-mode { flex: 0 0 auto; padding: 14px 20px; color: var(--muted); background: #fff; border-top: 1px solid var(--line); font-size: 13px; }
.chat-compose { flex: 0 0 auto; padding: 14px 20px; border-top: 1px solid var(--line); background: #fff; }
.chat-compose textarea { min-height: 64px; max-height: 160px; padding: 10px 12px; resize: vertical; font-size: 14px; line-height: 1.45; }
.chat-compose > .error { display: block; margin-top: 6px; }
.chat-compose-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.chat-file { display: flex; align-items: center; flex: 1 1 auto; gap: 9px; min-width: 0; }
.chat-attach { display: inline-grid; position: relative; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; color: #8e96a1; border: 1px solid #e3e6eb; border-radius: 8px; cursor: pointer; }
.chat-attach:hover { color: var(--navy); background: #f8f9fb; }
.chat-attach:focus-within { outline: 3px solid #a6adba; outline-offset: 2px; }
.chat-attach input { min-height: 0; }
.chat-file-name { min-width: 0; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.chat-remove-file { display: inline-grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; padding: 0; color: #9199a5; background: #f4f6f9; border: 0; border-radius: 50%; font-size: 20px; line-height: 1; }
.chat-remove-file:hover { color: #a85865; background: #fff5f6; }
.chat-send.button { flex: 0 0 auto; min-height: 38px; padding: 8px 14px; font-size: 13px; }
.chat-send > span { font-size: 17px; line-height: 1; }
.chat-shell button:disabled { cursor: wait; opacity: .65; }

@media (max-width: 900px) {
    .chat-shell.panel { height: calc(100dvh - 150px); }
}
@media (max-width: 680px) {
    .chat-shell.panel { min-height: 440px; }
    .chat-header { flex-wrap: wrap; gap: 10px; padding: 14px; }
    .chat-back { flex-basis: 28px; width: 28px; }
    .chat-identity { flex-basis: calc(100% - 42px); }
    .chat-identity h1 { font-size: 17px; }
    .chat-header-actions { justify-content: flex-start; gap: 8px 12px; width: 100%; }
    .chat-header-actions .button { min-height: 34px; padding: 6px 10px; font-size: 12px; }
    .chat-history { gap: 10px; padding: 16px 12px; }
    .chat-message { max-width: 92%; padding: 9px 11px; }
    .chat-feedback, .chat-mode { padding: 10px 14px; }
    .chat-compose { padding: 12px; }
    .chat-compose-actions { gap: 8px; }
    .chat-file { gap: 7px; }
    .chat-file-name { font-size: 11px; }
    .chat-new.button { right: 12px; bottom: 12px; }
}

body:has(.chat-shell) .footer { display: none; }
