.context-gauge { display:flex; flex-wrap:wrap; align-items:center; gap:6px 14px; padding:7px 16px; border-bottom:1px solid var(--stroke); color:var(--text-muted); font-size:12px; line-height:1.5; font-variant-numeric:tabular-nums; flex-shrink:0; }
.context-gauge span { overflow-wrap:anywhere; min-width:0; }
.context-gauge meter { width:92px; height:12px; flex-shrink:0; }
.context-gauge [data-context-total] { color:var(--text); }
.context-gauge [data-operative-countdown] { margin-left:auto; text-align:right; color:var(--text); }
.context-gauge [data-operative-countdown][hidden] { display:none; }

/* "Why did this fail?" panel on a failed turn (partials/_failure_panel.html). */
.chat-failure-panel { margin-top: .75rem; border: 1px solid color-mix(in srgb, var(--danger, #d14343) 45%, transparent); border-radius: .6rem; background: color-mix(in srgb, var(--danger, #d14343) 7%, transparent); }
.chat-failure-summary { display: flex; gap: .5rem; align-items: baseline; padding: .55rem .8rem; cursor: pointer; list-style: none; }
.chat-failure-summary::-webkit-details-marker { display: none; }
.chat-failure-title { font-weight: 600; font-size: .875rem; }
.chat-failure-hint { margin-left: auto; font-size: .75rem; color: var(--text-faint); }
.chat-failure-body { padding: 0 .8rem .75rem; font-size: .8125rem; }
.chat-failure-action { margin: 0 0 .5rem; }
.chat-failure-facts { display: grid; grid-template-columns: max-content 1fr; gap: .2rem .9rem; margin: 0 0 .6rem; }
.chat-failure-facts dt { color: var(--text-faint); }
.chat-failure-facts dd { margin: 0; overflow-wrap: anywhere; font-family: var(--font-mono, ui-monospace, monospace); font-size: .75rem; }
.chat-failure-links { display: flex; flex-wrap: wrap; gap: .4rem; }
.chat-failure-raw { margin-top: .5rem; }
.chat-failure-raw pre { white-space: pre-wrap; max-height: 14rem; overflow: auto; font-size: .72rem; }
select.is-attention { outline: 2px solid var(--accent, #6b8afd); outline-offset: 2px; }
[data-context-compact], [data-context-credits] { display: block; font-size: .72rem; color: var(--text-faint); }

/* Per-chat context settings dialog and the context coordinator panel
   (chat-context-settings.js, partials/_context_coordinator_panel.html). */
.chat-context-dialog fieldset { border: 1px solid var(--stroke); border-radius: 8px; padding: 10px 12px; margin: 0; display: grid; gap: 8px; min-width: 0; }
.chat-context-dialog legend { padding: 0 6px; font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.chat-context-mode { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.chat-context-mode input { margin-top: 4px; flex: none; }
.chat-context-mode span { display: grid; gap: 2px; min-width: 0; }
.chat-context-mode small { color: var(--text-muted); font-size: 12px; line-height: 1.45; }
.chat-context-disabled { opacity: 0.5; }
.chat-context-coordinator-pickers { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.chat-context-coordinator-pickers[hidden] { display: none; }
.chat-context-coordinator-pickers label { display: grid; gap: 4px; font-size: 12px; color: var(--text-muted); }
.chat-coordinator-panel { margin-top: 8px; border-color: color-mix(in srgb, var(--accent) 35%, var(--stroke)); }
.chat-coordinator-failed { border-color: color-mix(in srgb, #d97706 45%, var(--stroke)); }
.chat-coordinator-meta { color: var(--text-muted); font-size: 12px; font-weight: 400; }
.chat-coordinator-body { display: grid; gap: 8px; font-size: 13px; }
.chat-coordinator-notes { white-space: pre-wrap; margin: 0; }
.chat-coordinator-hint { margin: 0; color: var(--text-muted); font-size: 12px; overflow-wrap: anywhere; }
.chat-coordinator-live, .chat-coordinator-context pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; max-height: 320px; overflow: auto; margin: 6px 0 0; }
.chat-coordinator-live { color: var(--text-muted); max-height: 160px; }
.chat-coordinator-live-answer { color: var(--text); }
.chat-coordinator-context summary { cursor: pointer; color: var(--accent); }
