.inbox-page { background: #f7f9fc; color: #142749; }
.inbox-page main { min-width: 0; max-width: 1620px; padding: clamp(22px,4.4vw,52px) clamp(16px,4vw,54px) 24px; }
.title-line, .toolbar, .list-footer, .drawer-head, .form-row, .assign-line, .drawer-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.title-line h1 { font-size: clamp(1.55rem,3vw,2rem); }
.refresh, .small-button { color: #29466b; background: #fff; border: 1px solid #c8d5e3; border-radius: 6px; min-height: 32px; padding: 5px 10px; font-size: .775rem; font-weight: var(--weight-medium); }
.refresh { display: inline-flex; align-items: center; gap: 6px; }
.refresh svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.small-button:disabled { cursor: default; opacity: .45; }
#status { margin: 10px 0; color: #52647a; }
#status:empty, .drawer-foot:not(:has(button:not([hidden]))):has(p:empty) { display: none; }
#workspace { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-top: 17px; overflow: hidden; }
.lead-filters, .lead-scopes { display: flex; align-items: center; }
.lead-filters { gap: 8px; flex-wrap: wrap; min-width: 0; }
.lead-scopes { gap: 2px; padding: 3px; border-radius: 8px; background: #f0f5f8; }
.lead-scopes a, #more-lead-filters { box-sizing: border-box; min-height: 34px; font: inherit; font-size: .8rem; }
.lead-scopes a { display: flex; align-items: center; justify-content: center; padding: 4px 11px; border-radius: 5px; color: #3e5571; text-decoration: none; }
.lead-scopes a[aria-current="page"] { color: #104da5; background: white; box-shadow: 0 1px 3px #23426626; font-weight: var(--weight-medium); }
.lead-scopes a:hover { color: var(--blue); }
#more-lead-filters { min-width: 0; max-width: 13rem; border: 1px solid #c8d5e3; padding: 3px 7px; border-radius: 6px; background: white; color: #344e69; }
#more-lead-filters:has(option[value=""]:checked) { width: 7rem; }
.lead-list-tools { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 14px; padding: 0 16px 12px; }
.lead-list-tools .queue-intro { display: flex; flex: 1; align-items: center; gap: 10px; }
.lead-list-tools .omni-tasks:not([open]) { margin: 0; padding: 2px 0; border: none; background: transparent; }
.lead-list-tools .omni-tasks[open] { flex-basis: 100%; margin: 0; }
#worklist-count { color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.toolbar { flex-wrap: wrap; padding: 14px 16px; }
.detail-receipt, .row-warning { font-size: .76rem; color: var(--muted); }
.row-warning { display: block; color: #89401f; }
.assign-link { color: var(--blue); border: 0; background: transparent; padding: 3px 0; font: inherit; font-weight: var(--weight-medium); }
.assign-link:hover { text-decoration: underline; }
#lookup { display: flex; align-items: center; gap: 4px; }
#lookup input { padding: 6px 9px; font-size: .8rem; width: 155px; }
.queue-grid table { width: 100%; table-layout: fixed; border-collapse: collapse; text-align: left; font-size: .8375rem; }
.queue-grid th { background: #f8fafc; color: #53657d; font-size: .72rem; font-weight: var(--weight-medium); border-block: 1px solid #e4ebf2; }
.queue-grid th, .queue-grid td { padding: 10px 15px; }
.queue-grid td { border-bottom: 1px solid #ecf0f5; overflow-wrap: anywhere; }
.queue-grid th:first-child { width: 38%; }
.queue-grid th:last-child { width: 26%; }
.queue-grid tr:hover td { background: #f8fbff; }
.open-lead { background: transparent; color: #124ba8; padding: 0; border: none; text-align: left; font-size: .85rem; font-weight: var(--weight-medium); overflow-wrap: anywhere; }
.open-lead:hover { text-decoration: underline; }
.reported-area { display: block; margin-top: 3px; color: #325966; font-size: .77rem; }
.subline { display: block; color: #586a7d; margin-top: 3px; font-size: .71rem; }
.stage, .sync { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: var(--weight-regular); }
.stage { color: #204b8e; background: #edf4fc; padding: 3px 7px; border-radius: 4px; }
.stage[data-tone="follow_up"] { color: #10675b; background: #e8f6f0; }
.stage[data-tone="closed"], .stage[data-tone="booked"] { color: #5c6675; background: #edf1f4; }
.sync { color: #53657a; }
.sync::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #91a2b2; }
.sync[data-tone="synced"]::before { background: #159277; }
.sync[data-tone="pending"]::before { background: #4892ca; }
.sync[data-tone="conflict"] { color: #8b4220; }
.sync[data-tone="conflict"]::before { background: #bd6733; }
.due { color: #923d24; font-weight: var(--weight-semibold); }
.notice { background: #fff8ec; color: #784414; border-bottom: 1px solid #eddec4; padding: 10px 16px; font-size: .8rem; }
.list-footer { padding: 12px 16px; font-size: .75rem; color: var(--muted); }
.list-footer > div { display: flex; gap: 6px; }
.empty-state { text-align: center; padding: 45px 16px; }
.empty-state h2 { margin-bottom: 4px; }
.empty-state p, .muted { color: var(--muted); }
#drawer { width: min(450px,100%); max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0 0 0 auto; padding: 0; border: 0; border-left: 1px solid #d4dfeb; border-radius: 0; overscroll-behavior: contain; }
#drawer[open] { animation: drawer-in .17s ease-out; }
@keyframes drawer-in { from { transform: translateX(22px); opacity: .6; } to { transform: translateX(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #drawer[open] { animation: none; } }
.drawer-head { padding: 20px 22px; border-bottom: 1px solid var(--line); background: #f5f8fc; }
.eyebrow { font-size: .74rem; font-weight: var(--weight-regular); color: #52657e; }
.drawer-head h2 { font-size: 1.25rem; overflow-wrap: anywhere; }
#drawer-body, .drawer-foot { padding-inline: 22px; }
#drawer-body > section { padding-block: 16px; border-top: 1px solid var(--line); }
#drawer-body h3 { font-size: .9rem; margin-bottom: 8px; }
#lead-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-block: 16px; }
#lead-meta .subline { flex-basis: 100%; }
#contact { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 9px; font-size: .84rem; overflow-wrap: anywhere; }
#contact a { color: var(--blue); text-underline-offset: 2px; }
.lead-history { padding: 14px 0; border-top: 1px solid var(--line); font-size: .82rem; }
.lead-history summary { cursor: pointer; color: #405975; }
.lead-history h3 { margin-top: 12px; }
#source-details { margin: 9px 0; }
#drawer select, #drawer input { width: 100%; min-height: 35px; padding: 6px 8px; font: inherit; font-size: .84rem; color: var(--ink); background: #fff; border: 1px solid #a9b9cb; border-radius: 5px; }
#drawer label { display: block; margin-bottom: 4px; font-size: .77rem; color: #435974; }
#handoff { margin-top: 10px; }
#outreach-fields { display: grid; gap: 12px; padding: 0; border: 0; margin: 0; }
#outreach-plan-details:not([hidden]) { display: grid; gap: 10px; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
#outreach-plan-notice { margin: 0; font-size: .78rem; }
@media (max-width: 420px) {
  #outreach-plan-details:not([hidden]) { grid-template-columns: minmax(0, 1fr); }
}
#outreach-fields .primary-button { justify-self: start; min-height: 36px; font-size: .8rem; }
.form-row > div { flex: 1; min-width: 0; }
#assignment { font-size: .84rem; }
#history { list-style: none; margin: 0; padding: 0; }
#history li { border-left: 2px solid #bbd9e6; padding: 2px 0 5px 10px; margin-bottom: 8px; font-size: .81rem; overflow-wrap: anywhere; }
.drawer-foot { position: sticky; bottom: 0; padding-block: 12px; border-top: 1px solid var(--line); background: #fff; }
.drawer-foot p { color: #264c68; font-size: .81rem; }
[data-error="true"] { color: #8a3326 !important; }
@media (max-width: 700px) {
  .queue-grid thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .queue-grid tbody, .queue-grid table { display: block; }
  .queue-grid tr { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 7px 12px; padding: 12px; border-top: 1px solid #e4ebf2; }
  .queue-grid td { padding: 0; border: 0; min-width: 0; }
  .queue-grid td:first-child { grid-column: 1 / -1; }
  .queue-grid .follow-up-cell::before, .queue-grid .owner-cell::before { display: block; color: var(--muted); font-size: .7rem; }
  .queue-grid .follow-up-cell::before { content: 'Follow-up'; }
  .queue-grid .owner-cell::before { content: 'Owner'; }
  .lead-list-tools { padding-inline: 10px; }
  .lead-scopes a { padding-inline: 8px; }
  #lookup { flex: 1; }
  #lookup input { flex: 1; }
  .toolbar { padding: 10px 8px; gap: 8px; }
  .inbox-page main { padding-inline: 12px; }
}
@media (pointer: coarse) { .small-button, #more-lead-filters, .lead-scopes a, .assign-link, .refresh, .open-lead { min-height: 44px; } }
.intake-fields { margin: 0; padding: 10px 12px; border-inline-start: 2px solid #67b7af; background: #f4f9fa; }
.intake-fields dt { color: #52657e; font-size: .73rem; }
.intake-fields dd { margin: 2px 0 9px; font-size: .86rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.intake-fields dd:last-child { margin-bottom: 0; }
#follow-up-summary {
  display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 12px;
  margin: 12px 0 0; border-top: 1px solid var(--line); padding-top: 11px;
  font-size: .81rem; line-height: 1.4;
}
#follow-up-summary dt { color: var(--muted); font-size: .76rem; }
#follow-up-summary dd { margin: 0; overflow-wrap: anywhere; }
#follow-up-summary .contact-summary-line { display: block; }
.intake-empty { color: #586a7d; font-size: .8rem; }
#previous-note { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .81rem; }
#start-next { flex: none; color: #fff; background: var(--blue); border-color: var(--blue); }
.work-reason, .work-task, .callback-date { display: block; font-size: .8rem; }
.work-reason { font-weight: var(--weight-medium); }
.work-task:not(:first-child), .callback-date:not(:first-child) { margin-top: 3px; }
.current-task { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border-inline-start: 3px solid #169e8c; background: #f1f9f8; font-size: .84rem; }
.current-task button { flex: none; }
.current-task .muted { margin-top: 3px; font-size: .75rem; }
#task-editor { margin: 7px 0 0; }
#task-editor summary { color: var(--blue); cursor: pointer; font-size: .8rem; font-weight: var(--weight-medium); }
#task-fields { display: grid; gap: 8px; border: 0; margin: 0; padding: 12px 0 0; min-width: 0; }
#task-fields button { justify-self: start; }
.outreach-buttons { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

.omni-tasks { margin: 0 16px 14px; padding: 10px 12px; border: 1px solid #ccdde8; background: #f6fbfc; border-radius: 7px; font-size: .82rem; }
.omni-tasks summary { cursor: pointer; color: #164d75; font-weight: var(--weight-medium); }
.omni-tasks p { margin: 8px 0; color: #485d70; }
.omni-tasks fieldset { min-width: 0; padding: 0; border: 0; margin: 0; }
.omni-task-controls { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,170px),1fr)); gap: 9px; }
.omni-tasks label { display: block; color: #384d64; font-size: .77rem; }
.omni-tasks input:not([type="checkbox"]), .omni-tasks select { display: block; width: 100%; box-sizing: border-box; background: white; margin: 3px 0; padding: 6px 8px; border: 1px solid #b9cbd8; border-radius: 5px; color: var(--ink); font: inherit; min-height: 35px; }
.omni-instruction { margin: 8px 0; }
.omni-instruction summary, .omni-task-footer { font-size: .76rem; }
.omni-instruction label { margin-top: 8px; }
.omni-task-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
#omni-plan { border-top: 1px solid #d2e2ea; margin-top: 10px; padding-top: 10px; }
#omni-plan h3 { font-size: .9rem; margin: 0; }
#omni-plan ul { padding-inline-start: 18px; }
#omni-plan li { margin: 6px 0; }
#omni-plan li span { display: block; color: #485d70; }
#omni-plan button + button { margin-left: 6px; }
#omni-confirm { background: #154da2; border-color: #154da2; color: #fff; }
#omni-feedback:empty { display: none; }
.omni-check { display: none; width: 17px; height: 17px; margin: 0 6px 0 0; vertical-align: middle; accent-color: #1555ab; }
#workspace:has(#omni-tasks[open]) .omni-check { display: inline-block; }
@media (max-width: 700px) {
  .omni-tasks { margin-inline: 8px; }
}
