:root {
  color-scheme: light;
  --ink: #173246;
  --muted: #6d7f8c;
  --navy: #173b57;
  --blue: #2e6f92;
  --blue-soft: #eaf4f8;
  --sky: #f4f9fb;
  --cream: #fff9ed;
  --gold: #e8a93e;
  --green: #2f7d65;
  --green-soft: #e9f6f0;
  --orange: #b86b20;
  --orange-soft: #fff1df;
  --choir: #7a5a86;
  --choir-soft: #f5edf7;
  --red: #b14b4b;
  --red-soft: #fff0ef;
  --line: #dbe6eb;
  --panel: rgba(255, 255, 255, 0.96);
  --shadow: 0 18px 50px rgba(34, 69, 88, 0.11);
  --radius: 22px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: #eef5f7; }
body { margin: 0; color: var(--ink); background: radial-gradient(circle at 14% -10%, #fff6dd 0, transparent 30%), linear-gradient(145deg, #f7fbfc 0%, #edf5f7 55%, #f7faf7 100%); min-height: 100vh; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }

.login-gate { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 18% 0%, #fff2cf 0, transparent 34%), linear-gradient(145deg, #eff7f9, #e8f1f4); }
.login-gate[hidden] { display: none; }
.login-card { width: min(420px, 100%); padding: 34px; border: 1px solid rgba(255,255,255,.92); border-radius: 26px; background: rgba(255,255,255,.96); box-shadow: 0 26px 80px rgba(25,65,87,.18); }
.login-logo { display: block; width: min(270px, 78%); height: auto; margin: 0 0 24px; }
.login-card h2 { margin-bottom: 10px; font-size: 26px; letter-spacing: -.025em; }
.login-card > p:not(.eyebrow):not(.login-error) { margin-bottom: 24px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.login-card label { display: block; color: var(--ink); font-size: 12px; font-weight: 750; }
.login-card input { width: 100%; margin-top: 8px; border: 1px solid #c8d9e0; border-radius: 12px; padding: 12px; outline: none; }
.login-card input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(46,111,146,.12); }
.login-card .primary-button { width: 100%; margin-top: 8px; }
.login-error { min-height: 20px; margin: 8px 0 2px; color: var(--red); font-size: 11px; }

.app-shell { max-width: 1840px; margin: 0 auto; padding: 0 28px 32px; }
.topbar { min-height: 86px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.brand-logo { display: block; width: 174px; height: auto; flex: 0 0 auto; }
.brand-context { min-width: 0; padding-left: 16px; border-left: 1px solid rgba(23, 59, 87, .14); }
.eyebrow { margin: 0 0 4px; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 22px; letter-spacing: -.02em; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.toolbar-button { border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; color: var(--navy); background: rgba(255,255,255,.84); font-size: 12px; font-weight: 750; cursor: pointer; }
.toolbar-button:hover { border-color: #b8cdd6; background: #fff; }
.toolbar-button strong { display: inline-grid; min-width: 20px; height: 20px; margin-left: 4px; place-items: center; border-radius: 999px; color: #fff; background: var(--blue); font-size: 10px; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; padding: 7px 11px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.status-pill.success { color: var(--green); background: var(--green-soft); }
.status-pill.warning { color: var(--orange); background: var(--orange-soft); }
.status-pill.danger { color: var(--red); background: var(--red-soft); }
.status-pill.neutral { color: #607582; background: #edf3f5; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(47, 125, 101, .12); }
.reviewer-chip { display: flex; align-items: center; gap: 10px; border: 0; background: rgba(255, 255, 255, .78); border-radius: 15px; padding: 7px 12px 7px 8px; cursor: pointer; box-shadow: 0 8px 22px rgba(46, 78, 96, .08); }
.reviewer-chip small, .reviewer-chip strong { display: block; text-align: left; }
.reviewer-chip small { color: var(--muted); font-size: 10px; margin-bottom: 2px; }
.reviewer-chip strong { font-size: 13px; }
.avatar { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, var(--blue), var(--navy)); font-weight: 800; }

.program-switcher { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 14px; padding: 11px 13px 11px 18px; border: 1px solid rgba(211,226,232,.92); border-radius: 18px; background: rgba(255,255,255,.78); box-shadow: 0 10px 30px rgba(33,73,94,.06); }
.program-switcher-label { min-width: 148px; }
.program-switcher-label span, .program-switcher-label small { display: block; }
.program-switcher-label span { color: var(--navy); font-size: 12px; font-weight: 850; }
.program-switcher-label small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.program-tabs { display: flex; align-items: center; justify-content: flex-end; gap: 7px; min-width: 0; overflow-x: auto; padding: 2px; }
.program-tab { flex: 0 0 auto; border: 1px solid transparent; border-radius: 12px; padding: 9px 13px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 800; cursor: pointer; transition: .16s ease; }
.program-tab:hover { color: var(--navy); background: #f3f8fa; }
.program-tab.active { color: #fff; background: var(--navy); box-shadow: 0 7px 15px rgba(23,59,87,.16); }
.program-tab[data-program="wind_band"].active { background: var(--blue); }
.program-tab[data-program="choir"].active { background: var(--choir); }
.program-tab[data-program="unassigned"].active { background: var(--orange); }

.overview { display: grid; grid-template-columns: minmax(250px, .8fr) minmax(600px, 1.7fr); gap: 28px; align-items: end; padding: 26px 30px; border: 1px solid rgba(255,255,255,.8); border-radius: var(--radius); background: linear-gradient(115deg, rgba(255,255,255,.92), rgba(247,252,251,.82)); box-shadow: var(--shadow); }
.overview-copy h2 { margin: 0 0 8px; font-size: clamp(24px, 2.2vw, 34px); letter-spacing: -.035em; }
.overview-copy p:last-child { margin-bottom: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(100px, 1fr)); gap: 11px; }
.kpi-card { padding: 15px; min-height: 96px; border-radius: 18px; border: 1px solid #e7eef1; background: #fff; position: relative; overflow: hidden; }
.kpi-card::after { content: ""; position: absolute; width: 50px; height: 50px; border-radius: 50%; right: -20px; top: -20px; background: var(--blue-soft); }
.kpi-card strong { display: block; margin: 4px 0 2px; font-size: 29px; line-height: 1; letter-spacing: -.04em; }
.kpi-card span { color: var(--muted); font-size: 11px; font-weight: 700; }
.kpi-card small { color: #8a9aa5; font-size: 10px; }
.kpi-card.risk::after { background: var(--red-soft); }
.kpi-card.collab::after { background: var(--orange-soft); }

.workspace { display: grid; grid-template-columns: minmax(290px, .8fr) minmax(430px, 1.15fr) minmax(400px, 1.05fr); gap: 16px; margin-top: 16px; min-height: calc(100vh - 260px); }
.panel { background: var(--panel); border: 1px solid rgba(211,226,232,.92); border-radius: var(--radius); box-shadow: 0 12px 38px rgba(33, 73, 94, .075); overflow: hidden; min-width: 0; }
.panel-heading { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.panel-heading h3 { margin: 0; font-size: 18px; }
.icon-button { border: 1px solid var(--line); background: #fff; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; cursor: pointer; }
.icon-button:hover { border-color: #b8cdd6; background: var(--sky); }
.icon-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.filter-tabs { display: flex; gap: 6px; padding: 10px 14px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.filter-tab { border: 0; border-radius: 10px; padding: 8px 11px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.filter-tab.active { color: var(--navy); background: var(--blue-soft); }
.conversation-list { max-height: calc(100vh - 358px); min-height: 480px; overflow-y: auto; padding: 8px; }
.conversation-card { width: 100%; border: 1px solid transparent; border-radius: 17px; background: transparent; padding: 14px; margin-bottom: 6px; text-align: left; cursor: pointer; transition: .16s ease; }
.conversation-card:hover { background: #f5fafb; }
.conversation-card.active { border-color: #b9d4df; background: linear-gradient(135deg, #eef7fa, #f9fcfc); box-shadow: inset 3px 0 0 var(--blue); }
.intake-card { cursor: default; border-color: #e0eaee; background: #fbfdfd; }
.intake-card:hover { background: #fbfdfd; }
.intake-external-id { margin: 5px 0 0; overflow-wrap: anywhere; color: #8a9aa5; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }
.candidate-programs { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; color: var(--muted); font-size: 10px; }
.intake-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 11px; }
.intake-actions button { border: 0; border-radius: 9px; padding: 8px 7px; color: var(--blue); background: var(--blue-soft); font-size: 10px; font-weight: 800; cursor: pointer; }
.intake-actions button[data-target-program="choir"] { color: var(--choir); background: var(--choir-soft); }
.intake-actions button:disabled { opacity: .38; cursor: not-allowed; }
.card-top, .card-meta, .card-tags, .draft-meta, .review-actions, .student-facts, .fact-tags, .risk-list { display: flex; align-items: center; }
.card-top { justify-content: space-between; gap: 8px; }
.card-top strong { font-size: 14px; }
.time { color: #93a2aa; font-size: 10px; white-space: nowrap; }
.class-label { color: var(--muted); font-size: 11px; margin-left: 5px; }
.message-preview { margin: 8px 0 10px; color: #526a78; font-size: 12px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { justify-content: space-between; gap: 8px; }
.card-tags { min-width: 0; gap: 5px; flex-wrap: wrap; }
.mini-tag { display: inline-flex; align-items: center; border-radius: 7px; padding: 4px 7px; color: var(--blue); background: var(--blue-soft); font-size: 10px; font-weight: 700; }
.program-badge { display: inline-flex; align-items: center; max-width: 100%; border-radius: 999px; padding: 4px 8px; color: var(--blue); background: var(--blue-soft); font-size: 9px; font-weight: 850; line-height: 1.25; white-space: nowrap; }
.program-badge.choir { color: var(--choir); background: var(--choir-soft); }
.program-badge.unassigned { color: var(--orange); background: var(--orange-soft); }
.program-badge.other { color: #607582; background: #edf3f5; }
.risk-dot { width: 8px; height: 8px; border-radius: 50%; background: #8eb4c5; }
.risk-dot.high { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.risk-dot.medium { background: var(--gold); box-shadow: 0 0 0 4px var(--orange-soft); }

.conversation-heading { align-items: flex-start; }
.conversation-kicker { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.conversation-kicker .eyebrow { margin-bottom: 0; }
.conversation-heading-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.conversation-title h3 { margin-bottom: 5px; font-size: 19px; }
.conversation-title p { margin: 0; color: var(--muted); font-size: 11px; }
.student-facts { gap: 8px; flex-wrap: wrap; min-height: 52px; padding: 10px 18px; border-bottom: 1px solid var(--line); background: #fbfdfd; }
.student-fact { padding: 6px 9px; border-radius: 9px; background: #f0f5f7; font-size: 11px; }
.student-fact strong { color: var(--navy); margin-left: 3px; }
.message-thread { height: calc(100vh - 392px); min-height: 505px; overflow-y: auto; padding: 22px; background: linear-gradient(180deg, #fbfdfd 0%, #f5fafb 100%); }
.routing-guide { max-width: 520px; margin: 60px auto; padding: 22px; border: 1px solid #dce9ed; border-radius: 18px; background: #fff; box-shadow: 0 10px 28px rgba(33,73,94,.06); }
.routing-guide strong { font-size: 14px; }
.routing-guide p { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.75; }
.message-row { display: flex; margin-bottom: 15px; }
.message-row.outbound { justify-content: flex-end; }
.message-bubble { max-width: 78%; padding: 12px 14px; border-radius: 6px 17px 17px 17px; background: #fff; border: 1px solid #e2ebee; box-shadow: 0 6px 16px rgba(41, 78, 96, .055); font-size: 13px; line-height: 1.72; white-space: pre-wrap; }
.message-row.outbound .message-bubble { border-radius: 17px 6px 17px 17px; color: #173c4f; background: #dff0f5; border-color: #cae4ec; }
.message-time { display: block; margin-top: 6px; color: #95a4ac; font-size: 9px; text-align: right; }

.review-panel { display: flex; flex-direction: column; }
.review-content { flex: 1; overflow-y: auto; max-height: calc(100vh - 280px); min-height: 590px; padding: 18px 20px 22px; }
.empty-state { display: grid; place-content: center; text-align: center; color: var(--muted); }
.empty-state h4 { margin-bottom: 7px; color: var(--ink); }
.empty-state p { max-width: 280px; font-size: 12px; line-height: 1.6; }
.empty-illustration { width: 54px; height: 54px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 18px; color: var(--green); background: var(--green-soft); font-size: 24px; font-weight: 900; }
.review-section { margin-bottom: 17px; }
.section-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 800; }
.draft-editor { width: 100%; min-height: 180px; resize: vertical; border: 1px solid #cbdde4; border-radius: 16px; padding: 14px; color: var(--ink); background: #fff; line-height: 1.72; font-size: 13px; outline: none; box-shadow: inset 0 1px 3px rgba(22,55,72,.03); }
.draft-editor:focus { border-color: #6fa6bd; box-shadow: 0 0 0 4px rgba(65, 137, 169, .1); }
.compact-editor { min-height: 130px; margin-top: 8px; }
.message-entry-label { display: block; margin-top: 16px; }
.draft-meta { justify-content: space-between; gap: 8px; margin-top: 7px; color: #84949d; font-size: 10px; }
.fact-tags, .risk-list { gap: 6px; flex-wrap: wrap; }
.fact-tag { padding: 6px 8px; border-radius: 8px; color: #426777; background: #eef5f7; font-size: 10px; }
.risk-box { border-radius: 14px; padding: 12px; background: var(--cream); border: 1px solid #f2dfaf; }
.risk-box.high { background: var(--red-soft); border-color: #f1ceca; }
.risk-item { display: flex; align-items: flex-start; gap: 7px; margin-top: 7px; color: #785830; font-size: 11px; line-height: 1.5; }
.risk-box.high .risk-item { color: #8b4646; }
.risk-item::before { content: "•"; font-weight: 900; }
.guardrail-error { color: var(--red); background: var(--red-soft); border: 1px solid #edc8c5; border-radius: 12px; padding: 10px; margin-bottom: 8px; font-size: 11px; line-height: 1.5; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
label { color: #617785; font-size: 11px; font-weight: 700; }
select, input[type="text"], input[type="password"], input[type="datetime-local"] { width: 100%; margin-top: 6px; border: 1px solid #ccdce2; border-radius: 11px; padding: 10px; background: #fff; outline: none; }
select:focus, input:focus { border-color: #6fa6bd; box-shadow: 0 0 0 3px rgba(65,137,169,.09); }
.approval-check { display: flex; align-items: flex-start; gap: 9px; border-radius: 13px; padding: 11px; background: var(--green-soft); color: #326b59; line-height: 1.45; cursor: pointer; }
.approval-check input { margin-top: 2px; accent-color: var(--green); }
.review-actions { gap: 8px; flex-wrap: wrap; margin-top: 13px; }
.primary-button, .secondary-button, .danger-button { border: 0; border-radius: 12px; padding: 11px 14px; font-size: 12px; font-weight: 800; cursor: pointer; transition: .15s ease; }
.primary-button { color: #fff; background: linear-gradient(135deg, #2d718f, #17445d); box-shadow: 0 8px 18px rgba(31,92,120,.18); }
.primary-button:hover { transform: translateY(-1px); }
.primary-button:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.secondary-button { color: var(--navy); background: var(--blue-soft); }
.danger-button { color: var(--red); background: var(--red-soft); }
.review-actions .primary-button { flex: 1 1 180px; }
.review-actions .secondary-button, .review-actions .danger-button { flex: 1 1 90px; }
.sent-card { padding: 18px; border-radius: 17px; background: var(--green-soft); color: #326a58; }
.sent-card h4 { margin-bottom: 7px; }
.sent-card p { margin-bottom: 0; font-size: 12px; line-height: 1.6; }
.resource-box { border: 1px solid #c9dfe7; border-radius: 14px; padding: 12px; background: var(--blue-soft); }
.resource-item { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid rgba(65,137,169,.14); font-size: 11px; }
.resource-item:first-of-type { border-top: 0; }
.resource-item span { color: var(--muted); }
.manual-resource-list { margin: 0 0 12px; padding: 10px; border-radius: 10px; background: #fff; color: var(--ink); font-size: 11px; line-height: 1.7; }
.manual-resource-list a { color: var(--blue); font-weight: 800; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 30; padding: 12px 18px; border-radius: 13px; color: #fff; background: #183d53; box-shadow: 0 12px 35px rgba(19,51,70,.25); font-size: 12px; transition: .22s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #963f3f; }
dialog { border: 0; border-radius: 20px; padding: 0; box-shadow: 0 28px 80px rgba(21,48,63,.28); width: min(430px, calc(100vw - 30px)); }
dialog::backdrop { background: rgba(23,50,70,.35); backdrop-filter: blur(3px); }
.settings-form { padding: 22px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.dialog-heading h3 { margin: 0; }
.field-help { color: var(--muted); font-size: 11px; line-height: 1.5; margin: 8px 0 16px; }
.loading { padding: 30px; text-align: center; color: var(--muted); font-size: 12px; }
.wide-dialog { width: min(620px, calc(100vw - 30px)); }
.tasks-dialog { width: min(760px, calc(100vw - 30px)); }
.import-guide, .platform-note { padding: 14px; border-radius: 14px; background: var(--blue-soft); color: #426777; font-size: 12px; line-height: 1.65; }
.import-guide p { margin: 4px 0 7px; }
.import-guide a { color: var(--blue); font-weight: 800; }
.import-guide a.disabled-link { opacity: .48; cursor: not-allowed; }
.import-program-picker { display: block; margin-top: 16px; color: var(--ink); }
.import-program-picker select { margin-top: 7px; }
.file-picker { display: block; margin: 16px 0 10px; padding: 14px; border: 1px dashed #abc7d3; border-radius: 14px; background: #fbfdfd; }
.file-picker input { display: block; width: 100%; margin-top: 9px; font-size: 12px; }
.import-preview { min-height: 46px; margin-bottom: 14px; padding: 11px; border-radius: 11px; color: var(--muted); background: #f3f7f8; font-size: 11px; line-height: 1.55; }
.contact-task-list { max-height: min(620px, calc(100vh - 240px)); margin-top: 14px; overflow-y: auto; }
.contact-task { display: grid; grid-template-columns: 26px minmax(130px, .7fr) minmax(210px, 1.25fr) auto; gap: 12px; align-items: center; padding: 13px 4px; border-bottom: 1px solid var(--line); }
.contact-task:last-child { border-bottom: 0; }
.contact-task-select { width: 17px; height: 17px; accent-color: var(--blue); }
.contact-person strong, .contact-person span { display: block; }
.contact-person strong { margin-bottom: 4px; font-size: 13px; }
.contact-person span, .contact-detail small { color: var(--muted); font-size: 10px; }
.contact-detail code { display: block; margin: 3px 0; color: var(--ink); font-family: inherit; font-size: 12px; }
.contact-actions { display: flex; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.contact-actions button { border: 0; border-radius: 9px; padding: 7px 9px; color: var(--blue); background: var(--blue-soft); font-size: 10px; font-weight: 800; cursor: pointer; }
.contact-actions button.complete { color: #fff; background: var(--green); }
.task-error { grid-column: 1 / -1; padding: 8px; border-radius: 9px; color: var(--red); background: var(--red-soft); font-size: 10px; }
.batch-toolbar { display: grid; grid-template-columns: auto minmax(130px, 1fr) auto auto; gap: 10px; align-items: center; margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdfd; }
.batch-toolbar input[type="text"] { margin: 0; }
.batch-toolbar > span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.batch-confirmation { margin-top: 14px; padding: 15px; border: 1px solid #b9dce9; border-radius: 16px; background: linear-gradient(135deg, #f2fbff, #f8fcfd); }
.batch-confirmation[hidden] { display: none; }
.batch-confirmation-heading, .batch-confirmation-action { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.batch-confirmation-heading strong { display: block; font-size: 14px; }
.batch-confirmation-heading > span { padding: 5px 9px; border-radius: 999px; background: var(--blue-soft); color: #356b7d; font-size: 11px; font-weight: 700; }
.batch-confirmation-details { display: grid; gap: 8px; margin: 13px 0; }
.batch-confirmation-details > div { display: grid; grid-template-columns: 68px 1fr; gap: 8px; }
.batch-confirmation-details dt { color: var(--muted); font-size: 11px; }
.batch-confirmation-details dd { margin: 0; overflow-wrap: anywhere; font-size: 12px; line-height: 1.55; }
.batch-confirmation-action { justify-content: flex-start; flex-wrap: wrap; }
.batch-confirmation-action code { padding: 8px 10px; border-radius: 9px; background: #e8f4f8; color: #285a6c; }
.batch-progress button { display: block; margin-top: 6px; padding: 5px 8px; font-size: 10px; }
.selection-check { display: flex; align-items: center; gap: 7px; white-space: nowrap; cursor: pointer; }
.selection-check input { accent-color: var(--blue); }
.batch-history-heading { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.batch-history-heading strong { font-size: 13px; }
.batch-history-heading span { color: var(--muted); font-size: 10px; }
.contact-batch-list { max-height: 220px; overflow-y: auto; }
.contact-batch { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 11px 4px; border-bottom: 1px solid var(--line); }
.contact-batch strong, .contact-batch small { display: block; }
.contact-batch strong { margin-bottom: 4px; font-size: 12px; }
.contact-batch small { color: var(--muted); font-size: 10px; }
.batch-progress { color: var(--blue); font-size: 11px; font-weight: 800; text-align: right; }
.callback-event { align-items: center; }
.callback-match-controls { display: flex; align-items: center; gap: 6px; }
.callback-match-controls select { max-width: 180px; margin: 0; padding: 7px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 10px; }
.callback-match-controls button { border: 0; border-radius: 8px; padding: 8px 10px; color: #fff; background: var(--blue); font-size: 10px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.follow-up-task { display: grid; grid-template-columns: minmax(150px,.7fr) minmax(220px,1.2fr) auto; gap: 12px; align-items: center; padding: 13px 4px; border-bottom: 1px solid var(--line); }
.follow-up-task.overdue { border-left: 3px solid var(--red); padding-left: 10px; background: linear-gradient(90deg, var(--red-soft), transparent 35%); }
.follow-up-task strong, .follow-up-task span { display: block; }
.follow-up-task strong { margin-bottom: 4px; font-size: 12px; }
.follow-up-task span { color: var(--muted); font-size: 10px; }
.follow-up-actions { display: flex; gap: 6px; }
.follow-up-actions button { border: 0; border-radius: 9px; padding: 8px 10px; color: var(--blue); background: var(--blue-soft); font-size: 10px; font-weight: 800; cursor: pointer; }

@media (max-width: 1250px) {
  .overview { grid-template-columns: 1fr; }
  .workspace { grid-template-columns: minmax(280px, .75fr) minmax(430px, 1.25fr); }
  .review-panel { grid-column: 1 / -1; }
  .review-content { min-height: 0; max-height: none; }
  .conversation-list, .message-thread { max-height: 620px; }
}

@media (max-width: 780px) {
  .app-shell { padding: 0 12px 20px; }
  .topbar { min-height: 76px; }
  .brand { flex: 0 0 auto; }
  .brand-logo { width: 112px; }
  .brand-context { display: none; }
  .login-card { padding: 28px 24px; }
  .login-logo { width: min(250px, 86%); margin-bottom: 20px; }
  h1 { font-size: 17px; }
  .topbar-actions > .status-pill { display: none; }
  .program-switcher { display: block; padding: 11px; }
  .program-switcher-label { display: none; }
  .program-tabs { justify-content: flex-start; }
  .program-tab { padding: 8px 10px; }
  .toolbar-button { padding: 8px; font-size: 0; }
  #importButton::before { content: "导入"; font-size: 11px; }
  #contactTasksButton::before { content: "建联"; font-size: 11px; }
  .toolbar-button strong { font-size: 9px; margin-left: 3px; }
  .reviewer-chip small { display: none; }
  .overview { padding: 20px; }
  .overview-copy h2 { font-size: 25px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-card:last-child { grid-column: 1 / -1; }
  .workspace { grid-template-columns: 1fr; }
  .review-panel { grid-column: auto; }
  .conversation-list { min-height: 0; max-height: 420px; }
  .message-thread { height: auto; min-height: 440px; max-height: 560px; }
  .review-content { min-height: 0; }
  .field-grid { grid-template-columns: 1fr; }
  .message-bubble { max-width: 88%; }
  .contact-task { grid-template-columns: 1fr; }
  .follow-up-task { grid-template-columns: 1fr; }
  .contact-task-select { grid-row: 1; }
  .contact-actions { justify-content: flex-start; }
  .batch-toolbar { grid-template-columns: 1fr; }
  .batch-confirmation-heading, .batch-confirmation-action { align-items: flex-start; flex-direction: column; }
  .batch-history-heading { display: block; }
  .batch-history-heading span { display: block; margin-top: 4px; }
}
