/* Tagging pages: read-only reports in ArrowSplit's dark palette, laid out for a phone first. The few
   view controls look compact; on touch screens an invisible margin keeps them easy to tap. */
.tagging-body { color-scheme: dark; }
.tagging { max-width: 1380px; margin: 0 auto; padding: 8px 10px 24px; }
.tagging .quiet, .tagging .tab { position: relative; min-height: 28px; padding: 2px 8px; font-size: 13px; line-height: 1.3; }
.tagging a { color: var(--green); }
/* A short header: small icon, and no space kept for a sign-in button that is not there, so every
   tab fits the narrow frame the console gives this page on a phone (about 307px). */
.tagging-body [data-platform-header] { min-height: 38px; gap: 6px; padding: 0 8px; }
.tagging-body [data-platform-brand] img { width: 18px; height: 18px; border-radius: 4px; }
.tagging-body [data-platform-nav] a { min-height: 36px; padding: 0 6px; font-size: 12px; }
.tagging-body [data-platform-auth-slot] { min-width: 0; min-height: 0; }

.tagging-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.graph-tabs { display: flex; gap: 4px; }
/* /interval-tagging only points to Excessive Code now. */
.tagging.moved p { font-size: 14px; line-height: 1.5; }
.open-work { display: inline-flex; align-items: center; min-height: 40px; font-weight: 600; }
.index-state { margin-left: auto; color: var(--muted); font-size: 11px; }
.index-state.busy { color: var(--blue); }
.banner { margin: 0 0 8px; padding: 8px 10px; border: 1px solid #7a3434; border-radius: 6px; background: #2a1616; color: #ffd3d3; font-size: 13px; user-select: text; }

.tagging-columns { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 10px; align-items: start; }
.note-pane, .trace-pane { min-width: 0; }
@media (min-width: 861px) {
  .note-pane, .trace-pane { max-height: calc(100vh - 190px); min-height: 420px; overflow-y: auto; padding-right: 2px; }
  .back { display: none; }
}

.note-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.note-card { width: 100%; display: grid; gap: 3px; justify-items: start; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); font-size: 13px; text-align: left; cursor: pointer; }
.note-card[aria-current="true"] { border-color: #59775f; background: #162019; }
.note-meta { color: var(--muted); font-size: 11px; margin: 0; }
.note-card > * { min-width: 0; max-width: 100%; }
.note-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }

.note-card .chip { padding-block: 0; }
.chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font-size: 11.5px; line-height: 1.4; overflow-wrap: anywhere; }
.chip.tagged { border-color: #34507a; color: var(--blue); }
.chip.good { border-color: #2f6b42; color: var(--green); }
.chip.bad { border-color: #7a3434; color: var(--red); }
.chip.running { color: var(--blue); }
.chip.new { border-style: dashed; }
/* Every node is drawn the same way: its chain, in the journal's project colours. */
.node-chain { display: inline-block; max-width: 100%; padding: 0 6px; border-radius: 6px; background: #4a2d12; color: #ffcb84; font-size: 11px; font-weight: 500; line-height: 1.45; text-align: left; overflow-wrap: anywhere; user-select: text; }
.chain-sep { opacity: .72; }
.note-nodes { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 6px; max-width: 100%; }
.no-node { color: var(--muted); font-size: 11.5px; font-style: italic; }
.chip.interval { border-style: dashed; border-color: #34507a; color: var(--blue); }
.from-interval { margin: 4px 0 8px; font-size: 13px; user-select: text; overflow-wrap: anywhere; }
.spin { display: inline-block; width: 10px; height: 10px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 3s; } }

.card { margin-bottom: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; }
.card-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.full-note { margin: 6px 0; font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; }
.full-note.clamped { max-height: 8.7em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.topic-title { margin: 6px 0 0; font-size: 14px; user-select: text; overflow-wrap: anywhere; }
.page-chip { margin: 4px 0 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.fold > summary { cursor: pointer; }
.fold-context > summary, [class*="fold-prompt"] > summary { margin-top: 6px; color: var(--muted); font-size: 12px; }
.context { margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-size: 12px; line-height: 1.4; user-select: text; }
.context li { margin-bottom: 4px; overflow-wrap: anywhere; }

.result-card { border-color: #2c3b4f; }
.no-node-head { margin: 2px 0; font-size: 13.5px; font-weight: 600; user-select: text; }
.picked + .picked { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line); }
.why, .missing { margin: 2px 0 0; color: #c6d0c8; font-size: 13px; line-height: 1.4; user-select: text; }
.missing { color: var(--amber); }
.spoken-check { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line); }
.spoken { margin: 2px 0 0; font-size: 13px; line-height: 1.6; user-select: text; overflow-wrap: anywhere; }
.progress { margin: 0; color: var(--blue); font-size: 14px; }

.steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.step { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.step.bad { border-color: #7a3434; }
.step.warn { border-color: #6d5a2c; }
.step-summary { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 12px; list-style: none; }
.step-summary::-webkit-details-marker { display: none; }
.step-summary::after { content: "▸"; color: var(--muted); font-size: 11px; }
details[open] > .step-summary::after { content: "▾"; }
.step-number { width: 20px; height: 20px; flex: none; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font-size: 11px; }
.step-name { font-size: 14px; font-weight: 600; }
.step-badge { margin-left: auto; font-size: 12px; color: var(--muted); text-align: right; }
.step-badge.good { color: var(--green); } .step-badge.bad { color: var(--red); }
.step-badge.warn { color: var(--amber); } .step-badge.running { color: var(--blue); }
.step-time { min-width: 30px; color: var(--muted); font: 11px "DM Mono", ui-monospace, monospace; text-align: right; }
.step-body { padding: 0 12px 10px; }
.subject { margin: 0 0 6px; font-size: 14px; line-height: 1.45; user-select: text; }
.phrases { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.phrases .chip { user-select: text; }
.warning { margin: 0 0 6px; color: var(--amber); font-size: 12px; }
.prompt { max-height: 40vh; margin: 6px 0 0; padding: 8px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; background: #0d100e; font: 11px/1.5 "DM Mono", ui-monospace, monospace; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; }

.candidates { margin: 4px 0 8px; padding: 0; list-style: none; }
.candidate { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 6px; padding: 8px 4px; border-top: 1px solid var(--line); }
.candidate.is-pick { background: #121a25; }
.candidate.is-wanted { box-shadow: inset 3px 0 0 var(--green); }
.rank { color: var(--muted); font: 11px "DM Mono", ui-monospace, monospace; text-align: right; padding-top: 2px; }
.candidate-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; line-height: 1.35; overflow-wrap: anywhere; }
.description { margin: 3px 0 0; color: #c3cdc5; font-size: 12.5px; line-height: 1.45; user-select: text; overflow-wrap: anywhere; }
.description .source { color: var(--muted); }
.description.flagged { padding-left: 6px; border-left: 2px solid var(--amber); }
.description.clamped { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.more { min-height: 32px; padding: 0 2px; border: 0; background: transparent; color: var(--green); font-size: 12px; cursor: pointer; }
.candidate-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 5px; }
.signals { color: var(--muted); font: 10.5px "DM Mono", ui-monospace, monospace; margin-right: auto; }
@media (pointer: coarse) { .tagging .quiet::after, .tagging .tab::after { content: ""; position: absolute; inset: -6px 0; } }

@media (max-width: 860px) {
  .tagging-columns { display: block; }
  .trace-pane, .back { display: none; }
  .tagging.show-trace .trace-pane { display: block; }
  .tagging.show-trace .back { display: inline-block; margin-bottom: 8px; }
  .tagging.show-trace .note-pane, .tagging.show-trace .tagging-top { display: none; }
  .index-state { width: 100%; margin-left: 0; }
}
