/* Browser feedback refinements: queue clarity, actionable summaries and account context. */
:root {
  --prompt-ink: #8C3444;
  --prompt-text: #FFFFFF;
  --prompt-tint: #FFF0F1;
}

/* Let each evidence field keep its own line and use the available table width. */
@media (min-width: 801px) {
  .queue-table th:nth-child(1) { width: 26%; }
  .queue-table th:nth-child(2) { width: 31%; }
  .queue-table th:nth-child(3) { width: 22%; }
  .queue-table th:nth-child(4) { width: 21%; }
}
@media (min-width: 1251px) and (max-width: 1360px) {
  .queue-layout { grid-template-columns: minmax(0, 1fr) 248px; gap: 16px; }
}
.queue-evidence { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; min-width: 0; }
.queue-evidence .evidence-state { max-width: 100%; }
.queue-evidence .badge { border-radius: 6px; white-space: nowrap; margin: 0; padding: 4px 7px; }
.queue-freshness { display: block; color: var(--slate); font-size: 13px; line-height: 1.4; }
.queue-assessed { display: flex; flex-direction: column; gap: 2px; color: var(--slate); line-height: 1.35; }
.queue-assessed > span { font-size: 12px; }
.queue-assessed time { font: 12px/1.4 var(--font); font-variant-numeric: tabular-nums; white-space: nowrap; }
.queue-table td[data-label="Owner / next step"] .row-main { overflow-wrap: normal; }

/* A compact supporting note instead of a tall alert card. */
.queue-notice {
  display: flex; align-items: flex-start; gap: 9px; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--lilac);
}
.queue-notice > .icon { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.queue-notice p { margin: 0; font-size: 13px; line-height: 1.5; }
.queue-notice strong { display: inline; font-weight: 600; }
.queue-context-note { padding: 12px 4px; font-size: 13px; color: var(--slate); }
.queue-context-note summary { cursor: pointer; color: var(--ink); min-height: 28px; }
.queue-context-note p { margin: 8px 0; line-height: 1.55; }

/* Stronger emphasis for the existing prompt-review priority, without a new severity claim. */
.badge.priority-prompt { background: var(--prompt-ink); color: var(--prompt-text); border-color: var(--prompt-ink); }
.badge.priority-prompt .icon { stroke-width: 2; }
.queue-table tr[data-priority="prompt"] td:first-child { box-shadow: inset 4px 0 0 var(--prompt-ink); }
.queue-table tr[data-priority="prompt"] td:nth-child(2) { background: var(--prompt-tint); }
.queue-table tr[data-priority="prompt"] .concern-title { font-weight: 600; }
.priority-key.prompt { background: var(--prompt-ink); border-color: var(--prompt-ink); }

/* Summary cards are keyboard-accessible filters, with an explicit selected state. */
.metric-action { appearance: none; width: 100%; font: inherit; text-align: left; justify-content: space-between; }
.metric-summary { display: flex; gap: 12px; align-items: center; min-width: 0; }
.metric-summary > span { font-size: 14px; line-height: 1.4; }
.metric-action > .icon { width: 16px; height: 16px; color: var(--teal); opacity: .75; }
.metric-action:hover { background: var(--glass); }
.metric-action.active { border-color: var(--teal); box-shadow: inset 0 2px 0 var(--teal); }
.metric-action:active { transform: none; }
.queue-filter-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 12px; background: var(--glass); border: 1px solid var(--line); border-radius: 7px; font-size: 13px; }
.queue-filter-status .button { margin: 0; min-height: 30px; padding: 4px 7px; }
.task-scope-note { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px; border: 1px solid var(--line); border-left: 3px solid var(--teal); border-radius: 8px; background: var(--glass); }
.task-scope-note strong { font-size: 14px; }
.task-scope-note p { margin: 5px 0 0; font-size: 13px; color: var(--slate); }

/* The live display clock is distinct from the unchanged clinical scenario clock. */
.top-actions { gap: 12px; }
.header-clock { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; border-radius: 8px; padding: 4px; }
.header-clock:hover { background: var(--soft); }
.live-clock { display: inline-flex; width: 32px; height: 32px; flex: none; }
.live-clock-face { width: 32px; height: 32px; fill: none; stroke-linecap: round; }
.clock-dial { fill: var(--surface); stroke: var(--edge); stroke-width: 1; }
.clock-ticks { stroke: var(--slate); stroke-width: 1; }
.clock-hour, .clock-minute, .clock-second { transform-origin: 16px 16px; }
.clock-hour { stroke: var(--ink); stroke-width: 1.8; transform: rotate(var(--hour-angle, 0deg)); }
.clock-minute { stroke: var(--ink); stroke-width: 1.3; transform: rotate(var(--minute-angle, 0deg)); }
.clock-second { stroke: var(--prompt-ink); stroke-width: .9; animation: clock-sweep 60s linear infinite; animation-delay: var(--clock-phase, 0s); }
.clock-pin { fill: var(--ink); stroke: none; }
@keyframes clock-sweep { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.header-clock-copy { display: flex; flex-direction: column; gap: 3px; }
.header-clock-copy > span { display: flex; align-items: baseline; gap: 4px; }
.header-clock-copy time { font: 600 14px/1.2 var(--font); font-variant-numeric: tabular-nums; }
.live-clock-zone { font-size: 11px; color: var(--slate); }
.header-clock-copy > span > small { margin-left: 3px; font-size: 11px; color: var(--slate); }
.scenario-clock-label { font-size: 12px; line-height: 1.25; color: var(--slate); white-space: nowrap; }

/* A recognisable profile control leads to a real account/system view. */
.account-trigger { display: inline-flex; align-items: center; gap: 9px; padding: 5px 7px; color: var(--ink); text-decoration: none; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.account-trigger:hover { background: var(--soft); border-color: var(--edge); }
.account-avatar { display: inline-flex; justify-content: center; align-items: center; flex: none; border-radius: 50%; color: #0B2538; background: #E4F3EF; border: 1px solid #7CC4B4; font-weight: 600; }
.account-avatar.small { width: 32px; height: 32px; font-size: 12px; }
.account-avatar.large { width: 64px; height: 64px; font-size: 23px; }
.account-trigger-copy { display: flex; flex-direction: column; gap: 2px; }
.account-trigger-copy strong { font-size: 13px; line-height: 1.25; }
.account-trigger-copy small { font-size: 11px; line-height: 1.25; }
.account-trigger > .icon { width: 15px; height: 15px; color: var(--slate); }
.account-layout { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 20px; align-items: start; }
.profile-heading { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; }
.profile-heading h2 { margin: 0 0 5px; font-size: 25px; font-weight: 400; }
.profile-heading p { margin: 0; color: var(--slate); font-size: 14px; }
.profile-heading .account-kicker { font-size: 12px; color: var(--teal); margin-bottom: 7px; }
.account-facts { margin: 0; }
.account-facts > div { display: grid; grid-template-columns: minmax(110px, .85fr) minmax(0, 1.3fr); gap: 18px; padding: 13px 0; border-bottom: 1px solid var(--divider); }
.account-facts dt { font-size: 13px; color: var(--slate); }
.account-facts dd { margin: 0; font-size: 14px; line-height: 1.5; min-width: 0; overflow-wrap: anywhere; }
.account-facts .mono { font-size: 12px; }
.account-email { overflow-wrap: anywhere; }
.account-origin { font-family: var(--mono); font-size: 12px; }
.account-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 24px; }
.account-system .card-heading { align-items: center; }
.account-system .card-heading h2 { display: flex; gap: 9px; align-items: center; font-size: 19px; }
.account-system .card-heading .icon { color: var(--teal); width: 19px; height: 19px; }
.system-live-time { font-variant-numeric: tabular-nums; }
.system-live-time time { font: inherit; }
.account-role-note { padding: 12px; margin-top: 20px; border: 1px solid var(--line); background: var(--lilac); border-radius: 7px; font-size: 13px; line-height: 1.5; }
.account-boundary { display: flex; gap: 10px; padding: 0 4px; font-size: 13px; color: var(--slate); }
.account-boundary > .icon { flex: none; color: var(--teal); width: 18px; height: 18px; margin-top: 2px; }
.account-boundary p { margin: 0; }
.account-return { align-self: flex-start; }

body[data-theme="dark"] { --prompt-ink: #FFB5BB; --prompt-text: #0B2538; --prompt-tint: #4B2E3B; }
body[data-theme="dark"] .account-avatar { background: #1B4347; color: #EEF4F7; border-color: #7CC4B4; }
@media (max-width: 1250px) and (min-width: 761px) {
  .queue-inspector > .queue-notice { align-self: start; }
  .queue-inspector > .queue-context-note { align-self: start; }
}
@media (max-width: 1100px) {
  .top-actions { gap: 7px; }
  .header-clock-copy > span > small { display: none; }
  .account-trigger { gap: 6px; }
  .account-trigger-copy strong { font-size: 12px; }
  .account-trigger-copy small { font-size: 10px; }
  .account-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
  .account-facts > div { display: block; }
  .account-facts dt { margin-bottom: 5px; }
}
@media (max-width: 900px) {
  .account-layout { grid-template-columns: 1fr; }
  .account-facts > div { display: grid; grid-template-columns: 170px minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: 9px; }
  .top-actions { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 9px; align-items: center; }
  .top-actions > .sign-out-button { display: none; }
  .header-clock { padding: 0; gap: 6px; }
  .header-clock-copy time { font-size: 13px; }
  .header-clock-copy > span > small { display: none; }
  .scenario-clock-label { font-size: 11px; }
  .account-trigger { padding: 4px 6px; gap: 6px; }
  .account-trigger-copy strong { font-size: 12px; }
  .account-trigger-copy small { font-size: 10px; }
  .account-trigger > .icon { display: none; }
  .account-avatar.small { width: 30px; height: 30px; }
  .queue-table tr[data-priority="prompt"] { border-left: 4px solid var(--prompt-ink); }
  .queue-table tr[data-priority="prompt"] td:first-child { box-shadow: none; }
  .queue-table tr[data-priority="prompt"] td:nth-child(2) { background: transparent; }
  .queue-evidence { gap: 6px; }
  .queue-evidence .badge { font-size: 12px; }
  .queue-assessed { gap: 1px; }
  .metric-action { display: flex; gap: 6px; }
  .metric-summary { display: block; }
  .metric-summary > span { font-size: 12px; }
  .metric-summary > strong { display: block; margin: 0 0 5px; }
  .metric-action > .icon { width: 14px; height: 14px; }
  .queue-filter-status { flex-wrap: wrap; font-size: 12px; }
  .task-scope-note { flex-direction: column; align-items: flex-start; gap: 12px; }
  .profile-heading { gap: 14px; }
  .profile-heading h2 { font-size: 23px; }
  .account-facts > div { display: block; }
  .account-facts dt { margin-bottom: 5px; }
  .account-system .card-heading h2 { font-size: 18px; }
}
@media (max-width: 370px) {
  .account-trigger-copy small { display: none; }
  .account-trigger-copy strong { font-size: 11px; }
  .live-clock { width: 28px; height: 28px; }
  .live-clock-face { width: 28px; height: 28px; }
  .header-clock-copy time { font-size: 12px; }
  .scenario-clock-label { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .clock-second { animation: none !important; transform: rotate(var(--second-angle, 0deg)); display: none; }
}
@media (forced-colors: active) {
  .queue-notice, .metric-action, .account-trigger, .account-avatar { border: 1px solid CanvasText; }
  .metric-action.active { outline: 2px solid Highlight; box-shadow: none; }
  .badge.priority-prompt { background: Highlight; color: HighlightText; border-color: Highlight; }
  .queue-table tr[data-priority="prompt"] td:first-child { border-left: 4px solid Highlight; box-shadow: none; }
  .clock-dial { fill: Canvas; stroke: CanvasText; }
  .clock-hour, .clock-minute, .clock-second { stroke: CanvasText; }
  .clock-pin { fill: CanvasText; }
}
