/* Support OS operator desk. Plain CSS, no build step. Right-to-left, Persian. */

:root {
    --bg: #f3f4f8;
    --surface: #ffffff;
    --surface-2: #f8f9fc;
    --sunken: #eceef4;
    --text: #151a2d;
    --text-2: #3a4256;
    --muted: #6b7286;
    --line: #e5e7ef;
    --line-strong: #d3d7e2;
    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --accent-soft: #eef0fe;
    --accent-line: #d9dcfb;
    --ring: rgba(79, 70, 229, 0.18);
    --ok: #0f7a4a;
    --ok-soft: #e5f6ed;
    --ok-line: #bfe6d0;
    --warn: #9a5800;
    --warn-soft: #fff4df;
    --warn-line: #f5d9a6;
    --danger: #c0262d;
    --danger-soft: #fdeced;
    --danger-line: #f6c3c5;
    --violet: #8b5cf6;
    --sidebar: #12162a;
    --sidebar-text: #c5cae0;
    --sidebar-muted: #7d849e;
    --sidebar-hover: rgba(255, 255, 255, 0.06);
    --sidebar-active: rgba(129, 140, 248, 0.16);
    --sidebar-width: 248px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.04);
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.06);
    --shadow-lg: 0 12px 32px -8px rgba(16, 24, 40, 0.16), 0 4px 8px -4px rgba(16, 24, 40, 0.06);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Vazirmatn, system-ui, "Segoe UI", Tahoma, sans-serif;
    font-size: 14.5px;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
code {
    background: var(--sunken);
    padding: 1px 6px;
    border-radius: 6px;
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 12.5px;
}
h1 { font-size: 22px; font-weight: 800; line-height: 1.45; margin: 0; }
h1 .small { font-size: 13px; font-weight: 400; margin-inline-start: 6px; }
h2 { font-size: 16.5px; font-weight: 700; line-height: 1.5; margin: 0 0 10px; }
h3 { font-size: 15px; font-weight: 700; margin: 0; }
h4 { font-size: 14px; font-weight: 700; }
p { margin: 0 0 10px; }
p:last-child { margin-bottom: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
::selection { background: var(--accent-line); }

.icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Shell: the sidebar sits on the right, the work area beside it. */
.shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100vh; }
.main { min-width: 0; display: flex; flex-direction: column; }

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 18px 14px 14px;
    background: var(--sidebar);
    color: var(--sidebar-text);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 20px; color: #fff; font-size: 16px; font-weight: 800; }
.brand:hover { color: #fff; text-decoration: none; }
.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, var(--violet));
    color: #fff;
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: 0.5px;
    direction: ltr;
    box-shadow: 0 4px 12px -2px rgba(99, 102, 241, 0.5);
}
.side-nav { flex: 1; display: flex; flex-direction: column; gap: 18px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-title { padding: 0 10px 4px; color: var(--sidebar-muted); font-size: 11.5px; font-weight: 600; }
.side-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    font-size: 14px;
    transition: background 0.15s, color 0.15s;
}
.side-nav a .icon { opacity: 0.8; }
.side-nav a:hover { background: var(--sidebar-hover); color: #fff; text-decoration: none; }
.side-nav a.active { background: var(--sidebar-active); color: #fff; font-weight: 600; box-shadow: inset -3px 0 0 #818cf8; }
.side-nav a.active .icon { opacity: 1; color: #a5b4fc; }
.side-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    padding: 12px 6px 2px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.avatar {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #2c3350;
    color: #fff;
    font-weight: 700;
}
.who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.45; }
.who strong { display: block; color: #fff; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who a { color: inherit; text-decoration: none; min-width: 0; display: block; }
.who a:hover strong { text-decoration: underline; }
.sidebar .muted { color: var(--sidebar-muted); }

.appbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 60px;
    padding: 10px 28px;
    background: rgba(243, 244, 248, 0.88);
    backdrop-filter: saturate(1.4) blur(10px);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--line);
}
.status-strip { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.shadow-note {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 4px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.7;
}
.shadow-note .dot { width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; background: #a3a9bb; }
.shadow-note.live .dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.shadow-note.danger { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.shadow-note.danger .dot { background: var(--danger); box-shadow: 0 0 0 3px rgba(192, 38, 45, 0.15); }
.shadow-note a { font-weight: 600; }

button.icon-button, .icon-button {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    min-height: 0;
    flex-shrink: 0;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: inherit;
    box-shadow: none;
    cursor: pointer;
}
.sidebar .icon-button:hover { background: var(--sidebar-hover); color: #fff; }
.appbar .icon-button { background: var(--surface); border-color: var(--line); color: var(--text-2); box-shadow: var(--shadow-xs); }
.appbar .icon-button:hover, .appbar .icon-button.active { border-color: var(--line-strong); color: var(--accent); text-decoration: none; }
.bell .notice-count { position: absolute; top: -6px; inset-inline-start: -6px; }
.menu-button { display: none; }
.scrim { display: none; }

.page { width: 100%; max-width: 1320px; margin: 0 auto; padding: 24px 28px 64px; }

/* Sign-in: centred, no sidebar. */
body.guest {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(1200px 600px at 100% -10%, rgba(99, 102, 241, 0.14), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, rgba(139, 92, 246, 0.12), transparent 60%),
        var(--bg);
}
.guest-page { max-width: 440px; padding: 32px 16px; }
.guest-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 20px; font-size: 18px; font-weight: 800; }
.guest .card.narrow { padding: 28px 28px 22px; box-shadow: var(--shadow-lg); }
.guest .card.narrow h1 { margin-bottom: 18px; }
.guest .card.narrow button[type="submit"] { width: 100%; min-height: 42px; }
.guest .card.narrow .stack + p { margin-top: 14px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: var(--radius); background: var(--sunken); }
.tabs a {
    padding: 5px 14px;
    border-radius: 9px;
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.tabs .count {
    display: inline-block;
    min-width: 22px;
    margin-inline-start: 4px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(21, 26, 45, 0.06);
    font-size: 11.5px;
    line-height: 20px;
    text-align: center;
}
.tabs a.active .count { background: var(--accent-soft); color: var(--accent); }

.card {
    margin-bottom: 16px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card.narrow { max-width: 640px; margin-inline: auto; }

.flash {
    margin-bottom: 16px;
    padding: 12px 16px;
    border: 1px solid var(--ok-line);
    border-radius: 10px;
    background: var(--ok-soft);
    color: var(--ok);
    font-weight: 500;
}
.flash.error { border-color: var(--danger-line); background: var(--danger-soft); color: var(--danger); }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.danger { color: var(--danger); }
.nowrap { white-space: nowrap; }
.num { text-align: left; direction: ltr; unicode-bidi: plaintext; white-space: nowrap; font-variant-numeric: tabular-nums; }

table { border-collapse: collapse; width: 100%; }
table.list {
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}
table.list th, table.list td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: right; vertical-align: top; }
table.list th { background: var(--surface-2); color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
table.list tbody tr:last-child td { border-bottom: 0; }
table.list tbody tr { transition: background 0.12s; }
table.list tbody tr:hover { background: #fafbff; }
table.list .snippet { max-width: 420px; }
table.list .snippet a { color: var(--text-2); }
table.list .snippet a:hover { color: var(--accent); }
table.list tr.group th { background: var(--sunken); color: var(--text); font-size: 13.5px; }
table.list tr.group a { margin-inline-start: 10px; font-weight: 500; }
table.list tbody tr.group:hover { background: transparent; }
table.compact td, table.compact th { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; }
table.compact th { color: var(--muted); font-size: 12.5px; font-weight: 600; }
table.compact tr:last-child td { border-bottom: 0; }
table.matrix th, table.matrix td { padding: 6px 8px; border: 1px solid var(--line); text-align: center; }
table.matrix th { background: var(--surface-2); font-size: 12.5px; font-weight: 600; }
table.matrix td.hit { background: var(--ok-soft); color: var(--ok); font-weight: 600; }
table.matrix td.miss { background: var(--danger-soft); color: var(--danger); }
.scroll { overflow-x: auto; }
table code { white-space: nowrap; }
.scroll > table.list { overflow: visible; }

.badge {
    display: inline-block;
    padding: 0 9px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--sunken);
    color: var(--text-2);
    font-size: 12px;
    font-weight: 500;
    line-height: 22px;
    white-space: nowrap;
    vertical-align: middle;
}
.badge.ok, .badge.sentiment-happy, .badge.status-completed, .badge.status-valid, .badge.bucket-confident { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.badge.warn, .badge.sentiment-unhappy, .badge.status-pending, .badge.status-in_review, .badge.status-skipped,
.badge.status-expiring, .badge.status-processing, .badge.status-submitted, .badge.status-uploaded, .badge.status-estimating, .badge.status-estimated, .badge.bucket-semi_confident { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.badge.danger, .badge.sentiment-angry, .badge.status-failed, .badge.status-expired, .badge.bucket-uncertain { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.badge.status-testing, .badge.status-queued, .badge.status-running { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.badge.muted, .badge.status-superseded { background: var(--surface-2); border-color: var(--line); color: var(--muted); }
.badge.status-draft { background: var(--sunken); }
.badge.channel { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }

.score {
    display: inline-block;
    min-width: 46px;
    padding: 1px 8px;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
    text-align: center;
    direction: ltr;
    font-variant-numeric: tabular-nums;
}
.score.overdue { background: var(--danger-soft); color: var(--danger); }
.score.muted { background: var(--sunken); color: var(--muted); }

/* A case: the conversation, and the side panels. */
.case-layout { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 20px; align-items: start; }
.thread { display: flex; flex-direction: column; gap: 10px; }
.bubble {
    max-width: 80%;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}
.bubble.customer { align-self: flex-start; border-start-start-radius: 4px; }
.bubble.operator { align-self: flex-end; border-start-end-radius: 4px; border-color: var(--accent-line); background: var(--accent-soft); }
.bubble.ai { border-color: #c8def9; background: #ecf4ff; }
.bubble.bot { border-style: dashed; background: #f6f7f9; }
.bubble header { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 2px; color: var(--muted); font-size: 12.5px; }
.bubble header strong { color: var(--text); font-size: 13px; }
.bubble .text { white-space: normal; overflow-wrap: anywhere; }
.bubble-action { margin-top: 4px; }
.attachments { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.attachment { margin: 0; }
.attachment-thumb { display: block; max-width: 260px; max-height: 260px; border: 1px solid var(--line); border-radius: var(--radius-sm); object-fit: contain; background: var(--surface-2); }
.attachment audio { max-width: 100%; }
.attachment-file { overflow-wrap: anywhere; }
.attachment-description { margin-top: 4px; color: var(--text); overflow-wrap: anywhere; }
.thread > .card { margin-top: 6px; margin-bottom: 0; }
.side { display: flex; flex-direction: column; }
.side > .card h2 { font-size: 15px; }
.masked { margin: 6px 0; padding: 8px 10px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-2); }

dl.fields { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; margin: 8px 0; }
dl.fields dt { color: var(--muted); font-size: 13px; }
dl.fields dd { margin: 0; }

/* Forms */
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack > button, .stack > .button { align-self: flex-start; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.row label { flex: 1; min-width: 90px; }
label { display: flex; flex-direction: column; gap: 6px; color: var(--text-2); font-size: 13px; font-weight: 500; }
label.inline { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; margin-inline-end: 14px; font-weight: 400; }
fieldset { margin: 0; padding: 8px 14px 12px; border: 1px solid var(--line); border-radius: 10px; }
legend { padding: 0 6px; color: var(--muted); font-size: 12.5px; }
input, select, textarea {
    min-height: 40px;
    padding: 7px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder, textarea::placeholder { color: #9aa0b2; }
input:hover, select:hover, textarea:hover { border-color: #bfc5d4; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0; accent-color: var(--accent); box-shadow: none; }
input[type="file"] { padding: 6px; background: var(--surface-2); }
textarea { resize: vertical; line-height: 1.85; }

button, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 7px 18px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.1);
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, color 0.15s;
}
button:not(:disabled):hover, .button:hover { background: var(--accent-hover); color: #fff; text-decoration: none; }
button:focus-visible, .button:focus-visible, .tabs a:focus-visible, .side-nav a:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
button.secondary, .button.secondary { border-color: var(--line-strong); background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }
button.secondary:not(:disabled):hover, .button.secondary:hover { border-color: #bfc5d4; background: var(--surface-2); color: var(--text); }
button.danger, .button.danger { background: var(--danger); color: #fff; }
button.danger:not(:disabled):hover, .button.danger:hover { background: #a51f25; }
button.secondary.danger { border-color: var(--danger-line); background: var(--surface); color: var(--danger); }
button.secondary.danger:not(:disabled):hover { background: var(--danger-soft); }
button.link { min-height: 0; padding: 0; border: 0; background: none; color: var(--accent); font-weight: 500; box-shadow: none; }
button.link:hover { background: none; color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
button.link.small { font-size: 12.5px; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

details > summary { margin: 6px 0; color: var(--accent); font-weight: 500; cursor: pointer; }
details > summary:hover { color: var(--accent-hover); }
details.card > summary { margin: 0; }
details[open].card > summary { margin-bottom: 10px; }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { padding: 8px 0; border-bottom: 1px solid var(--line); }
ul.plain li:last-child { border-bottom: 0; }

.progress { height: 8px; margin: 8px 0; overflow: hidden; border-radius: 999px; background: var(--sunken); }
.progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(270deg, var(--accent), var(--violet)); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 16px; margin-bottom: 16px; }
.grid-2 > .card { margin-bottom: 0; }
.pager { display: flex; gap: 12px; justify-content: center; align-items: center; padding: 16px; color: var(--muted); font-size: 13.5px; }
.pager a, .pager > span.muted { padding: 5px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.pager a:hover { border-color: var(--line-strong); text-decoration: none; }
.pager > span.muted { opacity: 0.6; }

/* Knowledge base and live data */
.subnav { margin: 0 0 18px; }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions form { display: inline; }
.side-answer { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.side-answer h4 { display: flex; justify-content: space-between; margin: 0 0 8px; }
.bar { display: inline-block; min-width: 1px; height: 8px; border-radius: 999px; background: var(--accent); vertical-align: middle; }
.bar.shadow { background: var(--violet); }
.bar.eval { background: #d98e04; }
.bar.ok { background: #16a066; }
.bar.danger { background: var(--danger); }
.bar-cell { width: 45%; white-space: nowrap; }
.notice-count {
    display: inline-block;
    min-width: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--bg);
}
.unread { font-weight: 600; }
.follow-up { border-color: var(--warn-line); border-inline-start: 4px solid var(--warn); background: var(--warn-soft); }
.human-queue { border-color: var(--danger-line); border-inline-start: 4px solid var(--danger); }
.grades { display: flex; flex-wrap: wrap; gap: 12px; }
.grades fieldset { margin: 0; }
.grades label.inline { margin-left: 6px; }
.warnings { margin: 8px 0; padding: 10px 14px; border: 1px solid var(--warn-line); border-radius: 10px; background: var(--warn-soft); color: var(--warn); }
.warnings ul { margin: 4px 0 0; padding-inline-start: 18px; }
.ltr { direction: ltr; unicode-bidi: plaintext; text-align: left; }
.checklist { max-height: 420px; overflow-y: auto; padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.checklist label { flex-direction: row; align-items: center; gap: 8px; padding: 4px 0; font-size: 14px; font-weight: 400; }
.hint { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; font-weight: 400; }

/* Answer drafts (phase 3) */
.draft h4 { margin: 12px 0 4px; font-size: 13px; }
.draft-text { margin: 8px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); line-height: 2.1; }
.draft-text .unsourced { background: var(--danger-soft); text-decoration: underline wavy var(--danger); text-underline-offset: 4px; }
.draft-text sup { margin-inline-start: 2px; font-size: 11px; }
.draft-text sup.tool { color: var(--ok); }
.draft-actions { margin: 10px 0; }
ol.sources { margin: 2px 0 6px; padding-inline-start: 22px; }
ol.found-cards { margin: 4px 0 8px; padding-inline-start: 22px; }
.burst-questions { margin: 8px 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.burst-questions ol, ol.burst-questions-list { margin: 4px 0 0; padding-inline-start: 22px; }
.burst-questions li { margin-bottom: 4px; }
ol.candidates { margin: 4px 0 8px; padding-inline-start: 22px; }
ol.candidates li { margin-bottom: 12px; }
ol.candidates .candidate-text { margin: 4px 0; padding: 8px 10px; border-inline-start: 3px solid var(--warn-line); background: var(--surface-2); border-radius: 6px; }
ol.found-cards li { margin-bottom: 10px; }
ol.found-cards .prewrap { margin-top: 4px; padding: 8px 10px; border-inline-start: 3px solid var(--line); background: var(--surface-2); border-radius: 6px; }

/* Phones and narrow windows: the sidebar slides in from the right. */
@media (max-width: 960px) {
    .shell { grid-template-columns: minmax(0, 1fr); }
    .sidebar {
        position: fixed;
        inset-block: 0;
        inset-inline-start: 0;
        z-index: 40;
        width: 272px;
        transform: translateX(100%);
        transition: transform 0.2s ease;
        box-shadow: var(--shadow-lg);
    }
    .nav-toggle:checked ~ .shell .sidebar { transform: none; }
    .nav-toggle:checked ~ .shell .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(15, 23, 42, 0.45); }
    .menu-button { display: inline-grid; }
    .appbar { padding: 10px 16px; align-items: flex-start; }
    .page { padding: 18px 16px 48px; }
    .case-layout { grid-template-columns: minmax(0, 1fr); }
    .bubble { max-width: 100%; }
    .card { padding: 16px; }
    dl.fields { grid-template-columns: 110px 1fr; }
    .toolbar { align-items: flex-start; }
}

@media (max-width: 640px) {
    h1 { font-size: 19px; }
    .shadow-note { border-radius: 10px; }
    .tabs { display: flex; }
    table.list { display: block; overflow-x: auto; }
}

@media print {
    .sidebar, .appbar, .scrim, .menu-button { display: none; }
    .shell { display: block; }
    body { background: #fff; }
    .card { box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

/* «وب‌سرویس»: request and response examples. */
pre.code {
    margin: 8px 0 12px;
    padding: 10px 12px;
    background: var(--sunken);
    border-radius: 8px;
    overflow-x: auto;
    text-align: left;
    white-space: pre;
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 12.5px;
    line-height: 1.6;
}
.api-doc h3 { margin: 22px 0 8px; }
.webservice code { direction: ltr; unicode-bidi: isolate; }

/* The inbox's choice of inputs, order and mobile search (2026-11-17). */
.inbox-filters { margin-bottom: 18px; padding: 12px 16px; }
.inbox-filters .inbox-lines { flex: 2 1 260px; }
.inbox-filters .inbox-lines .hint { display: inline; }
.inbox-filters > label { flex: 1 1 180px; }
.inbox-filters > .row { flex: 0 0 auto; }
.case-mobile { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
/* 2026-11-21: the customers counted as one person, each with its tickets and the button that splits it off. */
.same-person { border-top: 1px solid var(--line, #e5e7eb); padding-top: 8px; margin-top: 8px; }
.same-person:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.same-person form { margin: 0 0 4px; }
#inbox-results.loading { opacity: .55; transition: opacity .15s; }
.inbox-filters [hidden] { display: none; }
