﻿/* Comfortable reading at normal browser zoom, including small phones. */
.country-flag {display:inline-block;flex:0 0 24px;width:24px;height:16px;object-fit:contain;border-radius:2px;vertical-align:middle;}
#queue {
  --queue-text:#172033;
  --queue-secondary:#475569;
  --queue-divider:#dce3ed;
  font-family:"Segoe UI",Arial,sans-serif;
  font-size:16px;
  line-height:1.6;
}
:root[data-theme="dark"] #queue {
  --queue-text:#f1f5f9;
  --queue-secondary:#cbd5e1;
  --queue-divider:#344256;
}
#queue .section-head h2 {font-size:24px;line-height:1.4;}
#queue .section-head p,#queue .filter-summary,#queue .filter-field label {font-size:16px;color:var(--queue-secondary);}
#queue .filters {gap:14px;}
#queue .filters .control,#queue .btn,#queue .control {min-height:44px;font-size:16px;}
#queue .search-wrap .control {padding-top:10px;padding-bottom:10px;}
#queue .search-wrap .icon {top:13px;}
#queue .filter-summary {flex-wrap:wrap;gap:12px;margin-bottom:18px;}

/* Time choices and heat filtering stay readable alongside the records. */
#queue .queue-time-panel {margin:0 0 22px;padding:20px;border:1px solid var(--queue-divider);border-radius:14px;background:var(--soft);}
#queue .queue-time-header {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;margin-bottom:18px;}
#queue .queue-time-kicker {display:block;color:var(--queue-secondary);font-size:16px;font-weight:650;letter-spacing:.04em;}
#queue .queue-time-heading {margin:3px 0 0;color:var(--queue-text);font-size:22px;line-height:1.4;font-weight:750;}
#queue .queue-time-day {display:inline-flex;align-items:center;gap:8px;padding:8px 12px;border:1px solid var(--queue-divider);border-radius:8px;background:var(--panel);color:var(--queue-secondary);font-size:16px;font-weight:650;}
#queue .queue-time-day::before {content:"";width:8px;height:8px;flex:none;border-radius:50%;background:var(--green);}
#queue .queue-time-tools {display:flex;align-items:center;flex-wrap:wrap;gap:16px;}
#queue .queue-time-pills {display:flex;flex:1 1 540px;flex-wrap:wrap;gap:10px;min-width:0;}
#queue .queue-time-pill {flex:1 1 96px;min-width:0;min-height:46px;padding:10px 14px;border:1px solid var(--queue-divider);border-radius:9px;background:var(--panel);color:var(--queue-secondary);font:650 16px/1.5 "Segoe UI",Arial,sans-serif;}
#queue .queue-time-pill:hover {border-color:var(--brand);color:var(--brand);}
#queue .queue-time-pill[aria-pressed="true"] {border-color:#4f46e5;color:#fff;background:#4f46e5;box-shadow:0 3px 9px #4f46e51c;}
#queue .queue-time-pill:focus-visible {outline:3px solid var(--brand);outline-offset:3px;}
#queue .queue-time-summary {margin:16px 0 0;color:var(--queue-secondary);font-size:16px;line-height:1.6;overflow-wrap:anywhere;}
#queue .queue-hot-filter {display:flex;align-items:center;flex-wrap:wrap;gap:10px;color:var(--queue-secondary);font-size:16px;font-weight:650;}
#queue .queue-hot-filter .control {width:auto;min-width:170px;font-size:16px;}

/* One comfortable column on laptops; two only when the workspace is wide. */
:is(#workItems,#centralQueueItems).queue-grid {grid-template-columns:minmax(0,1fr);align-items:start;gap:36px 24px;padding-top:20px;}
:is(#workItems,#centralQueueItems).queue-grid .work-card {
  --card-gold:#b4995a;
  --card-gold-ink:#75571d;
  --card-divider:var(--queue-divider);
  min-width:0;padding-top:22px;border:1px solid var(--card-gold);border-radius:16px;
  background:var(--panel);color:var(--queue-text);font-size:16px;line-height:1.6;
  box-shadow:0 4px 18px #17203309;
}
:is(#workItems,#centralQueueItems).queue-grid .work-card:hover,:is(#workItems,#centralQueueItems).queue-grid .work-card:focus-within {box-shadow:0 5px 22px #17203312;}
:is(#workItems,#centralQueueItems).queue-grid .work-card[data-hot="true"] {--card-gold:#b98032;box-shadow:0 5px 20px #b9803218;}
:is(#workItems,#centralQueueItems).queue-grid .work-card>.work-country-badge {min-height:36px;padding:5px 18px;border-radius:8px;color:var(--card-gold-ink);background:var(--panel);font-size:16px;line-height:1.5;letter-spacing:.04em;}
:is(#workItems,#centralQueueItems).queue-grid .work-card>.work-country-badge::before,:is(#workItems,#centralQueueItems).queue-grid .work-card>.work-country-badge::after {width:4px;height:4px;}

/* Ticket, name and call status each have room of their own. */
.work-card .ticket-number.copy-number {justify-self:start;width:fit-content;max-width:100%;gap:8px;min-height:44px;padding:6px 11px;border:1px solid #c5d0e2;border-radius:8px;color:#344b71;background:#f0f4fa;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:18px;font-weight:750;line-height:1.5;letter-spacing:.02em;}
.work-card .ticket-number.copy-number svg {width:18px;height:18px;flex:none;}
.work-card .ticket-number.copy-number:hover,.work-card .ticket-number.copy-number:focus-visible {border-color:var(--brand);color:var(--brand);}
:is(#workItems,#centralQueueItems).queue-grid .work-card .work-card-header {display:flex;align-items:flex-start;flex-wrap:wrap;gap:18px;padding:16px 22px 18px;border:0;border-radius:15px 15px 0 0;}
:is(#workItems,#centralQueueItems).queue-grid .work-card-header .identity {flex:1 1 240px;align-items:flex-start;gap:14px;min-width:0;}
:is(#workItems,#centralQueueItems).queue-grid .work-card-header .identity>div {display:grid;justify-items:start;gap:8px;min-width:0;}
:is(#workItems,#centralQueueItems).queue-grid .work-card-header .identity b {display:block;max-width:100%;overflow:visible;text-overflow:clip;white-space:normal;overflow-wrap:anywhere;-webkit-line-clamp:unset;font-size:26px;font-weight:750;line-height:1.4;letter-spacing:0;color:var(--queue-text);}
:is(#workItems,#centralQueueItems).queue-grid .work-card-header .record-photo,:is(#workItems,#centralQueueItems).queue-grid .work-contact-avatar {display:grid;place-items:center;flex:0 0 48px;width:48px;height:48px;border:1px solid #cbbc94;border-radius:12px;color:#75571d;background:#f7f2e7;font-size:20px;font-weight:750;}
:is(#workItems,#centralQueueItems).queue-grid .work-card-state {display:flex;flex:0 1 auto;flex-direction:column-reverse;align-items:flex-end;gap:8px;max-width:100%;}
:is(#workItems,#centralQueueItems).queue-grid .work-card-header .pill {max-width:100%;min-height:38px;padding:6px 12px;border-radius:9px;font-size:16px;font-weight:750;line-height:1.5;white-space:normal;overflow-wrap:anywhere;}
:is(#workItems,#centralQueueItems).queue-grid .work-select {display:inline-flex;align-items:center;gap:9px;min-height:44px;color:var(--queue-secondary);font-size:16px;font-weight:600;}
:is(#workItems,#centralQueueItems).queue-grid .work-select input {width:20px;height:20px;margin:0;}

/* Names of the responsible people are real information, not microcopy. */
:is(#workItems,#centralQueueItems).queue-grid .work-card-meta {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:0 22px;padding-bottom:20px;color:var(--queue-secondary);font-size:16px;line-height:1.6;}
:is(#workItems,#centralQueueItems).queue-grid .work-assignee-meta,:is(#workItems,#centralQueueItems).queue-grid .work-collector-meta {display:grid;gap:3px;min-width:0;max-width:100%;padding:0;border:0;background:transparent;overflow-wrap:anywhere;}
:is(#workItems,#centralQueueItems).queue-grid .work-card-meta span,:is(#workItems,#centralQueueItems).queue-grid .work-card-meta strong {font-size:16px;line-height:1.6;}
:is(#workItems,#centralQueueItems).queue-grid .work-card-meta strong {color:var(--queue-text);font-weight:750;}

/* Phone gets a full row. Vehicle and plate no longer compete with it. */
:is(#workItems,#centralQueueItems).queue-grid .work-card .work-card-glance {display:grid;grid-template-columns:minmax(0,1fr);gap:5px;min-width:0;margin:0 22px;padding:18px 0;border-top:1px solid var(--card-divider);border-bottom:0;}
:is(#workItems,#centralQueueItems).queue-grid .work-card-glance-label {grid-column:1;grid-row:auto;color:var(--queue-secondary);font-size:16px;font-weight:600;letter-spacing:0;text-transform:none;}
:is(#workItems,#centralQueueItems).queue-grid .work-card .work-card-glance .copy-number {grid-column:1;grid-row:auto;justify-self:start;max-width:100%;min-width:0;min-height:44px;gap:12px;margin:0;padding:2px 0;color:var(--queue-text);font-size:28px;font-weight:750;line-height:1.5;letter-spacing:0;font-variant-numeric:tabular-nums;}
:is(#workItems,#centralQueueItems).queue-grid .work-card-glance .copy-number>span {min-width:0;max-width:100%;overflow:visible;text-overflow:clip;white-space:normal;overflow-wrap:anywhere;}
:is(#workItems,#centralQueueItems).queue-grid .work-card-glance .copy-number svg {width:20px;height:20px;flex:none;color:var(--queue-secondary);}
:is(#workItems,#centralQueueItems).queue-grid .work-card-glance-vehicle {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-column:1;grid-row:auto;gap:16px;min-width:0;margin:14px 0 0;padding:16px 0 0;border:0;border-top:1px solid var(--card-divider);color:var(--queue-secondary);font-size:16px;line-height:1.6;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;}
:is(#workItems,#centralQueueItems).queue-grid .work-vehicle-field,:is(#workItems,#centralQueueItems).queue-grid .work-plate-field {display:grid;gap:3px;min-width:0;}
:is(#workItems,#centralQueueItems).queue-grid .work-card-glance-vehicle span,:is(#workItems,#centralQueueItems).queue-grid .work-card-glance-vehicle strong {color:var(--queue-secondary);font-size:16px;line-height:1.6;}
:is(#workItems,#centralQueueItems).queue-grid .work-card-glance-vehicle strong {color:var(--queue-text);font-weight:750;}

:is(#workItems,#centralQueueItems).queue-grid .work-received-strip {display:flex;align-items:flex-start;justify-content:space-between;flex-wrap:wrap;gap:10px 20px;min-width:0;margin:0 22px;padding:0 0 20px;color:var(--queue-secondary);font-size:16px;line-height:1.6;font-variant-numeric:tabular-nums;}
:is(#workItems,#centralQueueItems).queue-grid .work-received-age {display:inline-flex;align-items:center;gap:8px;color:var(--queue-text);font-size:16px;font-weight:750;}
:is(#workItems,#centralQueueItems).queue-grid .work-received-age::before {content:"";width:7px;height:7px;flex:none;border-radius:50%;background:var(--blue);}
:is(#workItems,#centralQueueItems).queue-grid .work-received-time {min-width:0;max-width:100%;margin:0;color:var(--queue-secondary);font-size:16px;text-align:left;white-space:normal;overflow:visible;overflow-wrap:anywhere;}

:is(#workItems,#centralQueueItems).queue-grid .work-record-labels {gap:12px;min-height:66px;padding:10px 22px;border-top:1px solid var(--card-divider);border-bottom:1px solid var(--card-divider);background:var(--soft);}
:is(#workItems,#centralQueueItems).queue-grid .record-type-badge,:is(#workItems,#centralQueueItems).queue-grid .record-hot-toggle,:is(#workItems,#centralQueueItems).queue-grid .record-hot-badge {min-height:44px;padding:8px 13px;border-radius:8px;font-size:16px;font-weight:700;line-height:1.5;}
:is(#workItems,#centralQueueItems).queue-grid .record-type-badge {color:#175b43;background:#eaf8f2;border-color:#96c9b6;}
:is(#workItems,#centralQueueItems).queue-grid .record-hot-toggle {color:var(--queue-secondary);background:var(--panel);border-color:var(--queue-divider);}
:is(#workItems,#centralQueueItems).queue-grid .record-hot-toggle[aria-pressed="true"],:is(#workItems,#centralQueueItems).queue-grid .record-hot-badge {color:#943914;background:#fff4e7;border-color:#dba56d;}
:is(#workItems,#centralQueueItems).queue-grid .record-hot-toggle:hover:not(:disabled) {border-color:var(--brand);}

/* All working controls have normal-size text and generous click targets. */
:is(#workItems,#centralQueueItems).queue-grid .work-card .btn,:is(#workItems,#centralQueueItems).queue-grid .work-card .control {min-height:44px;font-size:16px;}
:is(#workItems,#centralQueueItems).queue-grid .work-card .work-card-quick {grid-template-columns:minmax(0,1fr) auto;gap:12px;padding:18px 22px;border-bottom:1px solid var(--card-divider);}
:is(#workItems,#centralQueueItems).queue-grid .work-card-quick .control,:is(#workItems,#centralQueueItems).queue-grid .work-card-quick .btn {min-height:46px;padding:10px 12px;font-size:16px;line-height:1.5;}
:is(#workItems,#centralQueueItems).queue-grid .work-card-quick .control {color:var(--queue-text);}
:is(#workItems,#centralQueueItems).queue-grid .work-card-quick .call-save-state {display:flex;grid-column:1/-1;align-items:center;gap:7px;max-width:none;color:var(--queue-secondary);font-size:16px;font-weight:600;line-height:1.5;overflow:visible;text-overflow:clip;white-space:normal;}
:is(#workItems,#centralQueueItems).queue-grid .work-card-quick .call-save-state::before {content:"";width:7px;height:7px;flex:none;border-radius:50%;background:var(--green);}
:is(#workItems,#centralQueueItems).queue-grid .work-card .work-card-details>summary {min-height:52px;padding:15px 22px;color:var(--queue-secondary);font-size:16px;font-weight:650;line-height:1.5;}
:is(#workItems,#centralQueueItems).queue-grid .work-card-details>summary::after {display:grid;place-items:center;flex:0 0 28px;width:28px;height:28px;border:1px solid var(--card-divider);border-radius:6px;background:var(--soft);color:var(--queue-text);font-size:20px;line-height:1;}
:is(#workItems,#centralQueueItems).queue-grid .work-card-details[open]>summary {border-bottom:1px solid var(--card-divider);}
:is(#workItems,#centralQueueItems).queue-grid .work-card .work-card-body {grid-template-columns:minmax(0,1fr);gap:12px;padding:18px 22px;}
:is(#workItems,#centralQueueItems).queue-grid .work-card-body .detail {min-width:0;padding:12px;border-color:var(--card-divider);background:var(--soft);}
:is(#workItems,#centralQueueItems).queue-grid .work-card-body .detail label,:is(#workItems,#centralQueueItems).queue-grid .work-card-body .detail span {color:var(--queue-secondary);font-size:16px;line-height:1.6;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;}
:is(#workItems,#centralQueueItems).queue-grid .work-card-body .detail span {color:var(--queue-text);}
:is(#workItems,#centralQueueItems).queue-grid .work-card .work-card-form {grid-template-columns:minmax(0,1fr);gap:16px;padding:18px 22px;border-color:var(--card-divider);}
:is(#workItems,#centralQueueItems).queue-grid .work-card-form .field>span {color:var(--queue-secondary);font-size:16px;line-height:1.5;}
:is(#workItems,#centralQueueItems).queue-grid .work-card-form .control {min-height:46px;padding:10px 12px;font-size:16px;line-height:1.5;}
:is(#workItems,#centralQueueItems).queue-grid .work-card-form .notes-field {grid-column:1/-1;}
:is(#workItems,#centralQueueItems).queue-grid .work-card-form textarea.control {min-height:120px;max-height:none;font-size:16px;}
:is(#workItems,#centralQueueItems).queue-grid .work-card .transfer-row {flex-wrap:wrap;gap:12px;margin:0 22px 18px;}
:is(#workItems,#centralQueueItems).queue-grid .transfer-row .control {flex:1 1 220px;max-width:none;min-width:0;min-height:46px;font-size:16px;}
:is(#workItems,#centralQueueItems).queue-grid .transfer-row .btn {min-height:46px;font-size:16px;}
:is(#workItems,#centralQueueItems).queue-grid .work-card .work-history,:is(#workItems,#centralQueueItems).queue-grid .work-card .employee-update {margin:0 22px 18px;}
:is(#workItems,#centralQueueItems).queue-grid .work-history summary,:is(#workItems,#centralQueueItems).queue-grid .employee-update summary {min-height:44px;padding:8px 0;color:var(--queue-secondary);font-size:16px;line-height:1.6;}
:is(#workItems,#centralQueueItems).queue-grid .history-entry,:is(#workItems,#centralQueueItems).queue-grid .history-detail,:is(#workItems,#centralQueueItems).queue-grid .employee-update-state {font-size:16px;line-height:1.6;color:var(--queue-secondary);}
:is(#workItems,#centralQueueItems).queue-grid .code-request-list {margin:0 22px 18px;}
:is(#workItems,#centralQueueItems).queue-grid .code-request-list>summary,:is(#workItems,#centralQueueItems).queue-grid .code-request-list>b,:is(#workItems,#centralQueueItems).queue-grid .code-request,:is(#workItems,#centralQueueItems).queue-grid .code-request small,:is(#workItems,#centralQueueItems).queue-grid .code-request .muted {font-size:16px;line-height:1.6;color:var(--queue-secondary);}
:is(#workItems,#centralQueueItems).queue-grid .code-request-form {display:flex;flex-wrap:wrap;gap:12px;}
:is(#workItems,#centralQueueItems).queue-grid .code-request-form .control {flex:1 1 180px;min-width:0;}
:is(#workItems,#centralQueueItems).queue-grid .employee-update>b {display:block;margin-bottom:12px;color:var(--queue-secondary);font-size:16px;line-height:1.6;}
:is(#workItems,#centralQueueItems).queue-grid .employee-update-form {grid-template-columns:minmax(0,1fr);gap:12px;}
:is(#workItems,#centralQueueItems).queue-grid .employee-update-form>div {flex-wrap:wrap;gap:12px;}
:is(#workItems,#centralQueueItems).queue-grid .employee-update-form textarea.control {min-height:100px;max-height:none;padding:12px;font-size:16px;line-height:1.6;}
:is(#workItems,#centralQueueItems).queue-grid .code-request {grid-template-columns:minmax(0,1fr);gap:12px;padding:12px;}
:is(#workItems,#centralQueueItems).queue-grid .code-request>div:first-child b,:is(#workItems,#centralQueueItems).queue-grid .code-request>div:first-child small {font-size:16px;line-height:1.6;}
:is(#workItems,#centralQueueItems).queue-grid .code-request .raw-message pre {max-height:260px;padding:10px;font-size:16px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere;}
:is(#workItems,#centralQueueItems).queue-grid .code-request-items {max-height:360px;gap:12px;}
:is(#workItems,#centralQueueItems).queue-grid .code-request-list>summary {min-height:44px;padding:10px 0;}
:is(#workItems,#centralQueueItems).queue-grid .code-request-list>summary small {min-width:28px;min-height:28px;font-size:16px;line-height:1.5;}

#queue #workBulkBar {gap:12px;padding:14px;font-size:16px;}
#queue #workBulkBar .control,#queue #workBulkBar .btn,#queue #workBulkBar label,#queue #workBulkBar strong {font-size:16px;}
#queue #workBulkBar .control,#queue #workBulkBar .btn {min-height:44px;}
#queue #workBulkBar .select-visible-work {display:flex;align-items:center;gap:9px;min-height:44px;}
#queue #workBulkBar .select-visible-work input {width:20px;height:20px;}
#queue #workBulkBar[data-has-selection="false"] {flex-direction:row;align-items:center;justify-content:space-between;flex-wrap:wrap;}
#queue #workBulkBar[data-has-selection="false"]>select,#queue #workBulkBar[data-has-selection="false"]>button {display:none;}
#queue #workBulkBar[data-has-selection="false"] .select-visible-work,#queue #workBulkBar[data-has-selection="false"] .bulk-count {width:auto;margin:0;}

:root[data-theme="dark"] .work-card .ticket-number.copy-number {color:#d5e1ff;background:#1a263b;border-color:#52647f;}
:root[data-theme="dark"] :is(#workItems,#centralQueueItems).queue-grid .work-card {--card-gold:#a88b4f;--card-gold-ink:#efd698;}
:root[data-theme="dark"] :is(#workItems,#centralQueueItems).queue-grid .work-contact-avatar {color:#efd698;background:#332c1c;border-color:#a88b4f;}
:root[data-theme="dark"] :is(#workItems,#centralQueueItems).queue-grid .record-type-badge {color:#a4ebce;background:#17392f;border-color:#417c67;}
:root[data-theme="dark"] :is(#workItems,#centralQueueItems).queue-grid .record-hot-toggle[aria-pressed="true"],:root[data-theme="dark"] :is(#workItems,#centralQueueItems).queue-grid .record-hot-badge {color:#ffcf9d;background:#38261b;border-color:#b57b49;}

@media (min-width:640px) {
  :is(#workItems,#centralQueueItems).queue-grid .work-card .work-card-body,:is(#workItems,#centralQueueItems).queue-grid .work-card .work-card-form {grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media (min-width:1600px) {:is(#workItems,#centralQueueItems).queue-grid {grid-template-columns:repeat(2,minmax(0,1fr));}}
@media (max-width:700px) {
  #queue .queue-time-panel {padding:16px;}
  #queue .queue-time-pills {flex-basis:100%;}
  #queue .queue-hot-filter {width:100%;justify-content:space-between;}
  :is(#workItems,#centralQueueItems).queue-grid .work-card-header .identity b {font-size:24px;}
  :is(#workItems,#centralQueueItems).queue-grid .work-card .work-card-glance .copy-number {font-size:24px;}
  :is(#workItems,#centralQueueItems).queue-grid .work-card .work-card-header {padding:14px 16px 18px;}
  :is(#workItems,#centralQueueItems).queue-grid .work-card-meta,:is(#workItems,#centralQueueItems).queue-grid .work-card .work-card-glance,:is(#workItems,#centralQueueItems).queue-grid .work-received-strip {margin-right:16px;margin-left:16px;}
  :is(#workItems,#centralQueueItems).queue-grid .work-record-labels,:is(#workItems,#centralQueueItems).queue-grid .work-card .work-card-quick,:is(#workItems,#centralQueueItems).queue-grid .work-card .work-card-details>summary,:is(#workItems,#centralQueueItems).queue-grid .work-card .work-card-body,:is(#workItems,#centralQueueItems).queue-grid .work-card .work-card-form {padding-right:16px;padding-left:16px;}
  :is(#workItems,#centralQueueItems).queue-grid .work-card .transfer-row,:is(#workItems,#centralQueueItems).queue-grid .work-card .work-history,:is(#workItems,#centralQueueItems).queue-grid .work-card .employee-update,:is(#workItems,#centralQueueItems).queue-grid .code-request-list {margin-right:16px;margin-left:16px;}
}
@media (max-width:480px) {
  #queue>.panel {padding:16px;}
  :is(#workItems,#centralQueueItems).queue-grid .work-card-header .identity {flex-basis:100%;}
  :is(#workItems,#centralQueueItems).queue-grid .work-card-state {width:100%;flex-direction:row-reverse;justify-content:space-between;align-items:center;}
  :is(#workItems,#centralQueueItems).queue-grid .work-card-meta {grid-template-columns:minmax(0,1fr);gap:12px;}
  :is(#workItems,#centralQueueItems).queue-grid .work-received-strip {flex-direction:column;gap:8px;}
  :is(#workItems,#centralQueueItems).queue-grid .work-card .work-card-quick {grid-template-columns:minmax(0,1fr);}
  :is(#workItems,#centralQueueItems).queue-grid .work-card-quick .btn {width:100%;}
  #queue .queue-hot-filter .control {min-width:0;width:100%;}
}
@media (prefers-reduced-motion:reduce) {#queue .queue-time-pill,:is(#workItems,#centralQueueItems).queue-grid .work-card {transition:none;}}

/* Balanced card density: keep readable text, remove repeated rows and padding. */
:is(#workItems,#centralQueueItems).queue-grid {gap:28px 22px;}
:is(#workItems,#centralQueueItems).queue-grid .work-card {padding-top:18px;}
:is(#workItems,#centralQueueItems).queue-grid .work-card .work-card-header {align-items:center;gap:10px;padding:10px 16px;}
:is(#workItems,#centralQueueItems).queue-grid .work-card-header .identity {flex-basis:200px;align-items:center;gap:10px;}
:is(#workItems,#centralQueueItems).queue-grid .work-card-header .identity>div {display:block;min-width:0;}
:is(#workItems,#centralQueueItems).queue-grid .work-card-header .work-contact-title {display:flex;align-items:center;flex-wrap:wrap;gap:4px 10px;min-width:0;}
:is(#workItems,#centralQueueItems).queue-grid .work-card-header .identity b {font-size:20px;line-height:1.35;}
:is(#workItems,#centralQueueItems).queue-grid .work-card-header .ticket-number {min-height:36px;padding:4px 8px;font-size:16px;}
:is(#workItems,#centralQueueItems).queue-grid .work-card-header .record-photo,:is(#workItems,#centralQueueItems).queue-grid .work-contact-avatar {flex-basis:36px;width:36px;height:36px;border-radius:9px;font-size:16px;}
:is(#workItems,#centralQueueItems).queue-grid .work-card-meta {gap:8px 18px;margin:0 16px;padding-bottom:10px;}
:is(#workItems,#centralQueueItems).queue-grid .work-assignee-meta,:is(#workItems,#centralQueueItems).queue-grid .work-collector-meta {display:flex;align-items:baseline;flex-wrap:wrap;gap:3px 7px;}
:is(#workItems,#centralQueueItems).queue-grid .work-card .work-card-glance {gap:2px;margin:0 16px;padding:10px 0;}
:is(#workItems,#centralQueueItems).queue-grid .work-card .work-card-glance .copy-number {min-height:40px;font-size:22px;line-height:1.4;}
:is(#workItems,#centralQueueItems).queue-grid .work-card-glance-vehicle {gap:10px;margin-top:6px;padding-top:8px;}
:is(#workItems,#centralQueueItems).queue-grid .work-vehicle-field,:is(#workItems,#centralQueueItems).queue-grid .work-plate-field {display:flex;align-items:baseline;flex-wrap:wrap;gap:2px 7px;}
:is(#workItems,#centralQueueItems).queue-grid .work-received-strip {gap:4px 14px;margin:0 16px;padding-bottom:10px;}
:is(#workItems,#centralQueueItems).queue-grid .work-record-labels {min-height:54px;padding:5px 16px;}
:is(#workItems,#centralQueueItems).queue-grid .work-card .work-card-quick {grid-template-columns:minmax(0,1fr) auto;gap:7px 10px;padding:10px 16px;}
:is(#workItems,#centralQueueItems).queue-grid .work-card-quick .btn {width:auto;}
:is(#workItems,#centralQueueItems).queue-grid .work-card-quick .call-save-state {grid-column:1/-1;}
:is(#workItems,#centralQueueItems).queue-grid .work-card .work-card-details>summary {min-height:48px;padding:10px 16px;}
:is(#workItems,#centralQueueItems).queue-grid .work-card .work-card-form {gap:12px;padding:14px 16px;}
:is(#workItems,#centralQueueItems).queue-grid .work-card-form textarea.control {min-height:86px;}
:is(#workItems,#centralQueueItems).queue-grid .employee-update-form textarea.control {min-height:76px;}
:is(#workItems,#centralQueueItems).queue-grid .work-card .employee-update,:is(#workItems,#centralQueueItems).queue-grid .code-request-list {margin:0 16px 14px;}
:is(#workItems,#centralQueueItems).queue-grid .work-card-details:not([open]) .work-card-expanded {display:none;}
@media (max-width:480px) {
  :is(#workItems,#centralQueueItems).queue-grid .work-card-header .identity {flex-basis:100%;}
  :is(#workItems,#centralQueueItems).queue-grid .work-card-state {gap:4px;}
  :is(#workItems,#centralQueueItems).queue-grid .work-card-header .pill {min-height:32px;padding:3px 9px;}
  :is(#workItems,#centralQueueItems).queue-grid .work-received-strip {gap:2px;}
  :is(#workItems,#centralQueueItems).queue-grid .work-card-glance-vehicle {grid-template-columns:minmax(0,1fr);gap:2px;}
}

/* Active calls keep their place; warm color and a flame identify the whole card. */
:is(#workItems,#centralQueueItems).queue-grid .work-card[data-in-call="true"] {
  --card-gold:#d58a28;
  --card-gold-ink:#87520e;
  --call-flame-core:#fff2c6;
  border-color:var(--card-gold);
  background:linear-gradient(150deg,#fff5dfb3,transparent 50%),var(--panel);
  box-shadow:inset 0 0 0 1px #e9ac4a80,0 0 0 3px #e9ac4a16,0 8px 24px #b875191c;
}
:is(#workItems,#centralQueueItems).queue-grid .work-card[data-in-call="true"]:hover,
:is(#workItems,#centralQueueItems).queue-grid .work-card[data-in-call="true"]:focus-within {
  box-shadow:inset 0 0 0 1px #e9ac4a99,0 0 0 3px #e9ac4a20,0 8px 26px #b8751926;
}
:is(#workItems,#centralQueueItems).queue-grid .work-card[data-in-call="true"]>.work-country-badge {border-color:#d58a28;background:#fff7e7;color:#87520e;}
:is(#workItems,#centralQueueItems).queue-grid .work-card .queue-active-call {
  display:inline-flex;align-items:center;gap:7px;min-width:100px;justify-content:center;
  color:#8c4b0f;background:#fff0d4;border:1px solid #e8b66a;animation:none;
}
:is(#workItems,#centralQueueItems).queue-grid .queue-active-call::before {display:none;}
:is(#workItems,#centralQueueItems).queue-grid .queue-call-flame {display:block;flex:0 0 21px;width:21px;height:24px;color:#dd791a;filter:drop-shadow(0 1px 3px #eea43938);}
:is(#workItems,#centralQueueItems).queue-grid .work-card[data-in-call="true"] .in-call-button {border-color:#995415;color:#fff;background:#995415;}
:is(#workItems,#centralQueueItems).queue-grid .work-card[data-in-call="true"] .in-call-button:hover {background:#7d420d;}
:root[data-theme="dark"] :is(#workItems,#centralQueueItems).queue-grid .work-card[data-in-call="true"] {
  --card-gold:#cc994b;--card-gold-ink:#f3cd8f;
  background:linear-gradient(150deg,#9a591c20,transparent 60%),var(--panel);
  box-shadow:inset 0 0 0 1px #d6a25355,0 0 0 3px #d6a25312,0 8px 26px #0003;
}
:root[data-theme="dark"] :is(#workItems,#centralQueueItems).queue-grid .work-card[data-in-call="true"]>.work-country-badge {border-color:#cc994b;color:#f3cd8f;background:#30271d;}
:root[data-theme="dark"] :is(#workItems,#centralQueueItems).queue-grid .work-card .queue-active-call {color:#ffdaa0;background:#49321c;border-color:#a8783f;}
:root[data-theme="dark"] :is(#workItems,#centralQueueItems).queue-grid .queue-call-flame {color:#f3ac4c;}
:root[data-theme="dark"] :is(#workItems,#centralQueueItems).queue-grid .work-card[data-in-call="true"] .in-call-button {border-color:#dcad68;background:#dcad68;color:#21180e;}
:root[data-theme="dark"] :is(#workItems,#centralQueueItems).queue-grid .work-card[data-in-call="true"] .in-call-button:hover {background:#ecc38b;}

/* Fire follows the full perimeter without moving or covering the card content. */
@property --call-fire-turn {syntax:"<angle>";inherits:false;initial-value:0deg;}
:is(#workItems,#centralQueueItems).queue-grid .work-card[data-in-call="true"] {isolation:isolate;}
:is(#workItems,#centralQueueItems).queue-grid .work-card[data-in-call="true"]::before,
:is(#workItems,#centralQueueItems).queue-grid .work-card[data-in-call="true"]::after {
  content:"";position:absolute;pointer-events:none;z-index:2;
  -webkit-mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);
  -webkit-mask-composite:xor;
  mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);
  mask-composite:exclude;
}
:is(#workItems,#centralQueueItems).queue-grid .work-card[data-in-call="true"]::before {
  inset:-2px;padding:3px;border-radius:18px;
  background:conic-gradient(from var(--call-fire-turn),#ec5b16,#ff9b25 8%,#fff0a4 14%,#ff9c22 20%,#db4312 28%,#ffd564 36%,#fff2b0 41%,#f97819 48%,#e34c12 56%,#ffb338 63%,#fff2b0 69%,#f57c18 77%,#db4312 85%,#ffd565 93%,#ec5b16);
  animation:call-fire-orbit 4.8s linear infinite;
}
:is(#workItems,#centralQueueItems).queue-grid .work-card[data-in-call="true"]::after {
  inset:-6px;padding:10px;border-radius:22px;opacity:.8;filter:blur(1.2px);
  background:
    radial-gradient(ellipse at 50% 100%,#ffe99a 8%,#ff9b26cc 28%,#ee5a184d 48%,transparent 70%) 0 0/25px 12px repeat-x,
    radial-gradient(ellipse at 50% 0%,#ffe99a 8%,#ff9b26cc 28%,#ee5a184d 48%,transparent 70%) 12px 100%/25px 12px repeat-x,
    radial-gradient(ellipse at 100% 50%,#ffe99a 8%,#ff9b26cc 28%,#ee5a184d 48%,transparent 70%) 0 0/12px 25px repeat-y,
    radial-gradient(ellipse at 0% 50%,#ffe99a 8%,#ff9b26cc 28%,#ee5a184d 48%,transparent 70%) 100% 12px/12px 25px repeat-y;
  animation:call-fire-embers 2.4s linear infinite;
}
:is(#workItems,#centralQueueItems).queue-grid .work-card[data-in-call="true"]>.work-country-badge {z-index:3;}
@keyframes call-fire-orbit {to {--call-fire-turn:360deg;}}
@keyframes call-fire-embers {
  to {background-position:50px 0,-38px 100%,0 -50px,100% 62px;}
}
@media(prefers-reduced-motion:reduce) {
  :is(#workItems,#centralQueueItems).queue-grid .work-card[data-in-call="true"]::before,
  :is(#workItems,#centralQueueItems).queue-grid .work-card[data-in-call="true"]::after {animation:none;}
}

/* The current card belongs to the signed-in user and survives queue updates. */
#workItems.queue-grid .work-card.queue-current-card,
#workItems.queue-grid .work-card.queue-current-card:hover,
#workItems.queue-grid .work-card.queue-current-card:focus-within {
  border-color:#3078d5;
  outline:3px solid #3078d5;
  outline-offset:2px;
  box-shadow:0 0 0 6px #3078d529,0 8px 28px #175fa526;
}
:root[data-theme="dark"] #workItems.queue-grid .work-card.queue-current-card,
:root[data-theme="dark"] #workItems.queue-grid .work-card.queue-current-card:hover,
:root[data-theme="dark"] #workItems.queue-grid .work-card.queue-current-card:focus-within {
  border-color:#7ab4ff;
  outline-color:#7ab4ff;
  box-shadow:0 0 0 6px #7ab4ff30,0 8px 28px #0006;
}
