:root {
  --bg: #f7f9fc;
  --panel: #fff;
  --text: #17283d;
  --muted: #63758b;
  --line: #dfe6ef;
  --accent: #245cda;
  --accent-soft: #edf3ff;
  --bad: #b42318;
  --radius: 9px;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: var(--bg); font: 14px/1.5 "Segoe UI", Arial, sans-serif; }
button, input, select, textarea { font: inherit; }
button, summary { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
h2 { font-size: 24px; line-height: 1.3; letter-spacing: -.02em; }
h3 { font-size: 16px; line-height: 1.4; }
h4 { font-size: 14px; }
small { font-size: 12px; }
button:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button:disabled { cursor: wait; opacity: .55; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--muted); }
.eyebrow, .login-badge { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* Navigation stays separate from the working area. */
.app-shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 16px 16px; background: #fff; border-right: 1px solid var(--line); display: grid; grid-template-rows: auto auto 1fr auto; gap: 28px; min-width: 0; }
.brand-block { display: flex; align-items: center; gap: 9px; padding: 0 8px; }
.brand-mark { display: flex; }
.logo-perfect { width: 40px; height: 40px; object-fit: contain; }
.brand-block h1 { font-size: 22px; letter-spacing: -.03em; }
.nav-list { display: grid; gap: 5px; }
.nav-btn { text-align: left; border: 0; border-radius: 7px; color: var(--muted); background: transparent; padding: 10px 12px; font-weight: 600; white-space: nowrap; }
.nav-btn:hover { background: #f5f7fb; color: var(--text); }
.nav-btn.active { background: var(--accent-soft); color: var(--accent); }
.sidebar-footer { min-width: 0; }
.account-menu { position: relative; }
.account-menu summary { list-style: none; border-top: 1px solid var(--line); padding: 14px 8px 0; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.account-menu summary span { display: block; font-size: 12px; color: var(--muted); }
.account-menu summary span::after { content: " ▾"; }
.account-actions { position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 20; display: grid; gap: 8px; width: max(100%, 210px); padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 6px 20px #17283d15; }
.account-actions small { color: var(--muted); overflow-wrap: anywhere; }

/* Shared controls and page layout. */
.main-shell { min-width: 0; width: 100%; max-width: 1824px; padding: 28px 32px 40px; }
.main-shell.case-page { max-width: 1376px; }
.page-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; }
.page-title-wrap { min-width: 0; }
.page-title-wrap h2 { overflow-wrap: anywhere; }
.page-title-wrap p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.page-actions, .actions, .table-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-actions { flex-shrink: 0; }
#content { min-width: 0; display: grid; gap: 20px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 8px 14px; border: 1px solid var(--accent); border-radius: 7px; color: #fff; background: var(--accent); font-weight: 600; line-height: 1.3; }
.btn:hover { background: #194dc0; border-color: #194dc0; }
.btn.secondary { color: var(--text); background: #fff; border-color: var(--line); }
.btn.ghost { color: var(--muted); background: transparent; border-color: transparent; }
.btn.secondary:hover, .btn.ghost:hover { color: var(--text); background: #f0f4fa; border-color: #cbd6e4; }
.btn.bad { color: var(--bad); background: #fff; border-color: #f1ccc8; }
.btn.small { min-height: 30px; padding: 5px 9px; font-size: 12px; }
input:not([type="checkbox"]), select, textarea { width: 100%; min-width: 0; border: 1px solid #ced8e5; border-radius: 7px; color: var(--text); background: #fff; padding: 8px 10px; }
input:not([type="checkbox"]), select { min-height: 38px; }
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid #245cda26; border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: #8190a2; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); flex-shrink: 0; }
.field { display: grid; gap: 5px; min-width: 0; }
.field label, .field small { color: var(--muted); font-size: 12px; }
.form-grid, .stack { display: grid; gap: 16px; }
.form-inline { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.toolbar-check { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.card { padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.loading { padding: 50px 20px; text-align: center; color: var(--muted); }
.empty-state { padding: 36px 20px; display: grid; gap: 6px; color: var(--muted); text-align: center; }
.empty-state strong { color: var(--text); font-weight: 600; }
.error-banner, .success-banner { padding: 10px 13px; border: 1px solid; border-radius: 7px; font-size: 13px; }
.error-banner { color: #a52219; background: #fff5f4; border-color: #f4d0cc; }
.success-banner { color: #19603a; background: #f1faf5; border-color: #cbe9d8; }

/* One toolbar, then one aligned table. */
.queue-filters { display: grid; gap: 12px; }
.queue-toolbar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.segmented { display: inline-flex; background: #edf1f7; border-radius: 8px; padding: 3px; gap: 2px; }
.segment { border: 0; background: transparent; color: var(--muted); padding: 8px 12px; border-radius: 5px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.segment:hover { color: var(--text); }
.segment.active { background: #fff; color: var(--accent); box-shadow: 0 1px 3px #17283d12; }
.queue-status { display: flex; gap: 8px; align-items: center; }
.queue-status label { color: var(--muted); font-size: 12px; }
.queue-status select { width: 150px; }
.queue-search { display: flex; gap: 8px; margin-left: auto; flex: 0 1 300px; }
.queue-search input { min-width: 100px; }
.advanced-filters summary { width: fit-content; color: var(--muted); font-size: 12px; padding: 2px 0; }
.filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 12px; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.filter-actions { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; grid-column: span 2; }
.case-list-wrap { border: 1px solid var(--line); background: #fff; border-radius: var(--radius); overflow: hidden; }
.case-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.col-case { width: 34%; }.col-customer { width: 21%; }.col-owner { width: 17%; }.col-status { width: 12%; }.col-activity { width: 16%; }
.case-table th { font-size: 12px; font-weight: 600; color: var(--muted); background: #fafbfd; text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.case-table td { padding: 17px 16px; vertical-align: middle; border-bottom: 1px solid #edf0f5; overflow-wrap: anywhere; }
.case-table tbody tr:last-child td { border-bottom: 0; }
.case-list-row { cursor: pointer; }
.case-list-row:hover, .case-list-row:focus-within { background: #f8faff; }
.case-open { text-decoration: none; display: block; max-width: 100%; padding: 0; text-align: left; border: 0; background: transparent; color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.case-open:hover { color: var(--accent); }
.case-number { color: var(--muted); font-weight: 400; margin-right: 5px; }
.case-list-desc { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 5px; }
.case-list-date { font-size: 12px; font-variant-numeric: tabular-nums; }
.case-list-date small { display: block; margin-top: 3px; color: var(--muted); }
.mobile-label { display: none; }
.badge, .pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; border-radius: 5px; padding: 3px 7px; background: #f1f4f8; color: #5e6d80; white-space: nowrap; }
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.case-status-created { background: #edf3ff; color: #245cda; }
.case-status-in_progress, .badge.open, .badge.active { background: #eaf7ef; color: #237a4c; }
.case-status-waiting { background: #fff5e2; color: #916014; }
.case-status-completed, .badge.closed { background: #f1f3f6; color: #687589; }

/* A single case header, followed by the composer and its history. */
.case-overview { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.case-controls { display: flex; align-items: end; gap: 16px; flex-wrap: wrap; }
.case-status-field { width: 165px; }
.case-owner-field { width: 260px; max-width: 100%; }
.case-work-total { margin-left: auto; display: grid; gap: 3px; align-self: center; text-align: right; }
.case-work-total span { font-size: 12px; color: var(--muted); }
.case-work-total strong { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.case-description { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 20px; line-height: 1.7; }
.case-metadata { display: flex; gap: 8px 24px; flex-wrap: wrap; margin: 16px 0 0; padding-top: 14px; border-top: 1px solid #edf0f5; color: var(--muted); font-size: 12px; }
.case-metadata div { display: flex; gap: 6px; flex-wrap: wrap; }
.case-metadata dt { font-weight: 400; }
.case-metadata dd { margin: 0; }
.case-activity { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.comment-composer { padding: 20px; display: grid; gap: 12px; background: #fafbfd; border-bottom: 1px solid var(--line); }
.comment-composer textarea { min-height: 94px; }
.comment-compose-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.comment-time { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-left: auto; max-width: 100%; }
.time-input-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; max-width: 100%; }
.time-shortcuts { display: flex; gap: 4px; }
.time-hours { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.modal-card .comment-time { margin-left: 0; }
.comment-time label { white-space: nowrap; color: var(--muted); font-size: 12px; }
.comment-time input { width: 82px; }
.activity-heading { padding: 20px 20px 0; display: flex; align-items: baseline; gap: 10px; }
.activity-heading span { color: var(--muted); font-size: 12px; }
.comments-feed { padding: 0 20px; }
.empty-comments { padding: 16px 0 24px; font-size: 13px; color: var(--muted); }
.item { padding: 20px 0; border-bottom: 1px solid #edf0f5; }
.item:last-child { border-bottom: 0; }
.item-title { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.item-title strong { font-size: 13px; font-weight: 600; }
.comment-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--muted); margin-top: 4px; font-size: 12px; }
.comment-text { margin-top: 12px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
.work-minutes { font-variant-numeric: tabular-nums; }

/* Customer, report and administration views share the same treatment. */
.customer-browser-tools { max-width: 420px; }
.customer-list-wrap { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.customer-list-head, .customer-list-row { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) minmax(0, .6fr) minmax(0, .6fr) 70px; gap: 16px; padding: 14px 16px; align-items: center; }
.customer-list-head { color: var(--muted); background: #fafbfd; font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--line); }
.customer-list-row { border-bottom: 1px solid #edf0f5; }
.customer-list-row:last-child { border-bottom: 0; }
.customer-list-row strong { font-weight: 500; }
.customer-list-name small { display: block; color: var(--muted); }
.selectable, .clickable { cursor: pointer; }
.selectable:hover, .clickable:hover { background: #f8faff; }
.customer-detail-grid { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr); gap: 20px; }
.customer-detail-block { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; min-width: 0; }
.customer-detail-block h4 { margin-bottom: 16px; }
.detail-pair { display: grid; gap: 4px; margin-top: 14px; }
.detail-pair span { color: var(--muted); font-size: 12px; }
.detail-pair strong { font-weight: 500; overflow-wrap: anywhere; }
.customer-case-row { display: flex; justify-content: space-between; gap: 20px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.customer-case-row:last-child { border-bottom: 0; }
.customer-case-row strong { font-weight: 500; }
.customer-case-row small { display: block; margin-top: 4px; color: var(--muted); }
.customer-case-row > span { color: var(--muted); font-size: 12px; }
.customer-picker select { min-height: 140px; }
.customer-picker option { padding: 6px 8px; }
.customer-picker small { overflow-wrap: anywhere; }
.inline-form { display: flex; align-items: end; gap: 14px; flex-wrap: wrap; }
.inline-form .field { flex: 1 1 170px; }
.data-table-wrap { overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.data-table { border-collapse: collapse; width: 100%; min-width: 680px; }
.data-table th, .data-table td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.data-table th { font-size: 12px; font-weight: 600; color: var(--muted); background: #fafbfd; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fafbfd; }
.report-header { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.report-header h3 { margin: 4px 0; }
.report-total { font-size: 24px; font-weight: 600; }
.log-row { display: grid; grid-template-columns: 160px 200px minmax(0, 1fr); gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.log-row:last-child { border-bottom: 0; }
.log-row strong { font-size: 13px; font-weight: 500; }
.log-row small { display: block; color: var(--muted); }
.current-user-badge { font-size: 11px; color: var(--accent); }

/* Dialogs, notifications and sign-in. */
.modal-dialog { border: 0; padding: 0; border-radius: 12px; width: min(640px, calc(100vw - 28px)); max-height: 90vh; color: var(--text); }
.modal-dialog::backdrop { background: #17283d66; }
.modal-card { padding: 24px; display: grid; gap: 20px; max-height: 90vh; overflow-y: auto; background: #fff; }
.modal-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.modal-head h2 { font-size: 20px; margin-top: 3px; }
.modal-actions { display: flex; justify-content: end; gap: 8px; border-top: 1px solid var(--line); padding-top: 16px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; max-width: calc(100vw - 48px); background: var(--text); color: #fff; padding: 11px 16px; border-radius: 8px; font-size: 13px; box-shadow: 0 4px 15px #17283d20; }
.toast.bad { background: var(--bad); }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(100%, 420px); padding: 32px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.login-logo-wrap { text-align: center; margin-bottom: 20px; }
.login-logo-large { width: 120px; height: 100px; object-fit: contain; }
.login-card h1 { font-size: 26px; margin: 6px 0; }
.login-card > p { color: var(--muted); margin-bottom: 24px; }
.login-card .success-banner { margin-bottom: 20px; }

@media (max-width: 1200px) {
  .main-shell { padding: 24px; }
  .queue-search { margin-left: 0; flex-grow: 1; }
  .queue-toolbar { gap: 12px; }
  .case-table th, .case-table td { padding-left: 12px; padding-right: 12px; }
  .comment-compose-actions .toolbar-check .muted { display: none; }
}
@media (max-width: 960px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: relative; height: auto; padding: 12px 20px 0; border-right: 0; border-bottom: 1px solid var(--line); grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 12px; }
  .sidebar > div:empty { display: none; }
  .brand-block { padding: 0; }
  .brand-block h1 { font-size: 20px; }
  .logo-perfect { width: 32px; height: 32px; }
  .nav-list { grid-row: 2; grid-column: 1 / -1; display: flex; overflow-x: auto; padding-bottom: 9px; }
  .nav-btn { flex-shrink: 0; padding: 8px 10px; font-size: 13px; }
  .sidebar-footer { grid-column: 2; grid-row: 1; max-width: 170px; }
  .account-menu summary { border: 0; padding: 0; text-align: right; }
  .account-actions { bottom: auto; top: calc(100% + 12px); left: auto; right: 0; }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .log-row { grid-template-columns: 140px 150px minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .main-shell { padding: 20px 16px 32px; }
  .page-header { align-items: start; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
  h2 { font-size: 21px; }
  .page-actions { flex-wrap: wrap; flex-shrink: 1; }
  .page-actions .btn { min-height: 34px; font-size: 12px; padding: 7px 10px; }
  .queue-toolbar { align-items: stretch; }
  .queue-scope { width: 100%; }
  .queue-scope .segment { flex: 1; padding: 9px 7px; font-size: 12px; }
  .queue-status { width: 100%; }
  .queue-status select { flex: 1; }
  .queue-search { flex-basis: 100%; }
  .filter-grid { grid-template-columns: minmax(0, 1fr); padding: 14px; }
  .filter-actions { grid-column: auto; }
  .case-table, .case-table tbody { display: block; }
  .case-table colgroup, .case-table thead { display: none; }
  .case-table .case-list-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 16px; padding: 16px; border-bottom: 1px solid var(--line); }
  .case-table .case-list-row:last-child { border-bottom: 0; }
  .case-table .case-list-row td { display: block; padding: 0; border: 0; }
  .case-table .case-list-primary, .case-table .case-list-date { grid-column: 1 / -1; }
  .mobile-label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; }
  .case-list-date { display: flex; gap: 8px; }
  .case-list-desc { font-size: 12px; }
  .case-overview, .comment-composer { padding: 16px; }
  .case-controls { gap: 12px; }
  .case-status-field { width: 140px; flex: 1 1 120px; }
  .case-owner-field { width: auto; flex: 1 1 200px; }
  .case-work-total { text-align: left; margin-left: 0; width: 100%; display: flex; align-items: baseline; gap: 10px; }
  .case-work-total strong { font-size: 16px; }
  .comment-compose-actions { gap: 12px; }
  .comment-compose-actions .toolbar-check { flex: 1; }
  .comment-time { margin-left: 0; }
  .comment-compose-actions > .btn { margin-left: auto; }
  .activity-heading { padding: 18px 16px 0; }
  .comments-feed { padding: 0 16px; }
  .item-title { flex-wrap: wrap; }
  .item-title .actions { margin-left: auto; }
  .customer-list-head { display: none; }
  .customer-list-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; }
  .customer-list-name { grid-column: 1 / -1; }
  .customer-list-meta:nth-child(3)::before { content: "Opin mál: "; color: var(--muted); }
  .customer-list-meta:nth-child(4)::before { content: "Öll mál: "; color: var(--muted); }
  .customer-detail-grid { grid-template-columns: minmax(0, 1fr); }
  .customer-case-row { flex-wrap: wrap; gap: 6px; }
  .log-row { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .form-inline { grid-template-columns: minmax(0, 1fr); }
  .modal-card { padding: 18px; }
  .modal-actions .btn { flex: 1; }
}
@media (max-width: 380px) {
  .sidebar { padding-left: 12px; padding-right: 12px; }
  .sidebar-footer { max-width: 120px; }
  .brand-block h1 { font-size: 18px; }
  .comment-compose-actions > .btn { width: 100%; }
}
@media print {
  .sidebar, .page-header, .no-print, .toast { display: none !important; }
  .app-shell { display: block; }
  .main-shell { padding: 0; max-width: none; }
  body { background: #fff; }
  .card, .data-table-wrap { border: 0; }
  .data-table { min-width: 0; }
}

/* Each comment owns its files; previews do not disturb the composer. */
.attachment-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 16px; }
.attachment-list li { min-width: 0; max-width: 100%; }
.attachment-name { display: inline-block; max-width: 100%; border: 0; background: none; padding: 2px 0; text-align: left; color: var(--accent); font-size: 13px; overflow-wrap: anywhere; }
.attachment-name:hover { text-decoration: underline; }
.attachment-add { width: 34px; height: 34px; flex: 0 0 34px; padding: 0; font-size: 24px; line-height: 1; }
.selected-attachments { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.selected-attachments[hidden] { display: none; }
.selected-attachment { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; font-size: 12px; color: var(--muted); }
.selected-attachment > span { min-width: 0; overflow-wrap: anywhere; }
.selected-attachment button { border: 0; background: none; color: var(--muted); padding: 2px 6px; font-size: 18px; line-height: 1.2; }
.selected-attachment button:hover { color: var(--bad); }
.attachment-context-menu { position: fixed; z-index: 100; max-width: calc(100vw - 16px); padding: 4px; border: 1px solid var(--line); border-radius: 6px; background: #fff; box-shadow: 0 4px 14px #17283d24; }
.attachment-context-menu button { display: block; border: 0; border-radius: 3px; background: #fff; color: var(--text); padding: 7px 14px; font-size: 13px; }
.attachment-context-menu button:hover, .attachment-context-menu button:focus-visible { background: var(--accent-soft); color: var(--accent); outline-offset: 0; }
.attachment-preview { padding: 0; width: min(1100px, calc(100vw - 32px)); max-width: calc(100vw - 32px); height: min(850px, calc(100dvh - 32px)); max-height: calc(100dvh - 32px); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--text); }
.attachment-preview[open] { display: flex; flex-direction: column; }
.attachment-preview::backdrop { background: #15253c99; }
.preview-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 16px 20px 8px; }
.preview-head h2 { font-size: 16px; min-width: 0; overflow-wrap: anywhere; }
.preview-head .actions { flex-shrink: 0; }
.preview-hint { padding: 0 20px 12px; color: var(--muted); font-size: 12px; }
.preview-body { flex: 1; min-height: 0; display: flex; justify-content: center; background: #edf1f7; }
.preview-body iframe { width: 100%; height: 100%; border: 0; }
.preview-body img { max-width: 100%; max-height: 100%; object-fit: contain; }
@media (max-width: 700px) {
  .preview-head { padding: 12px; flex-wrap: wrap; gap: 8px; }
  .preview-head .actions { margin-left: auto; }
  .preview-hint { padding: 0 12px 10px; }
}


/* Mentions keep the plain-text editor compact; suggestions float only while typing @. */
.mention-menu { position: fixed; z-index: 200; max-height: 240px; overflow-y: auto; padding: 4px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--text); box-shadow: 0 5px 20px #17283d20; }
.mention-menu[hidden] { display: none; }
.mention-option { padding: 8px 10px; cursor: pointer; border-radius: 4px; }
.mention-option strong { display: block; font-size: 13px; overflow-wrap: anywhere; }
.mention-option span { color: var(--muted); font-size: 12px; }
.mention-option[aria-selected="true"], .mention-option:hover { background: var(--accent-soft); }
.mention-no-match { padding: 10px; font-size: 13px; color: var(--muted); }
.mention-tag { color: var(--accent); background: var(--accent-soft); border-radius: 3px; padding: 1px 3px; }
.sidebar-footer { display: flex; align-items: center; gap: 6px; }
.account-menu { min-width: 0; flex: 1; }
.notification-bell { position: relative; width: 36px; height: 38px; flex: 0 0 36px; padding: 7px; }
.notification-bell svg { width: 21px; height: 21px; }
#notificationCount { position: absolute; top: -2px; right: -4px; min-width: 17px; padding: 1px 4px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 10px; line-height: 15px; }
.notifications-dialog { width: min(480px,calc(100vw - 24px)); max-width: calc(100vw - 24px); max-height: min(700px,calc(100dvh - 32px)); padding: 0; border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); }
.notifications-dialog::backdrop { background: #15253c66; }
.notifications-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; position: sticky; top: 0; background: #fff; z-index: 1; border-bottom: 1px solid var(--line); }
.notifications-head h2 { font-size: 18px; }
.notification-toolbar { padding: 4px 12px; text-align: right; }
.notification-list { margin: 0; padding: 0; list-style: none; }
.notification-item { display: grid; gap: 4px; width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 14px 16px; background: #fff; text-align: left; color: var(--text); }
.notification-item.unread { background: #f1f6ff; border-left: 3px solid var(--accent); padding-left: 13px; }
.notification-item:hover { background: #eaf1fb; }
.notification-summary, .notification-case, .notification-excerpt { min-width: 0; overflow-wrap: anywhere; }
.notification-summary { font-size: 13px; }
.notification-case { color: var(--accent); font-size: 12px; }
.notification-excerpt { color: var(--muted); font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notification-item time { color: var(--muted); font-size: 11px; }
.empty-notifications, .notification-error, .notification-limit { padding: 18px 16px; color: var(--muted); font-size: 13px; }
.notification-limit { font-size: 12px; }
.comment-highlight { background: #fff8db; outline: 2px solid #edd273; outline-offset: 5px; border-radius: 3px; }
@media (max-width: 440px) { .sidebar-footer { max-width: 160px; } }
