/* 관제 보드(watch-board-integration.html)와 같은 무채색 문법. 색은 상태와 지표에만 쓴다. */
:root {
  color-scheme: dark;
  --bg: #09090b; --panel: #18181b; --card: #27272a; --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.14);
  --text: #f4f4f5; --muted: #a1a1aa; --dim: #71717a; --ui: #e4e4e7;
  --red: #f87171; --orange: #fb923c; --amber: #fbbf24; --green: #34d399; --blue: #60a5fa; --sky: #38bdf8; --cyan: #0ea5e9;
  --top: 56px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 "Noto Sans KR", system-ui, sans-serif; word-break: keep-all; display: flex; flex-direction: column; }
a { color: inherit; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* 상단 바 */
.op-top { position: sticky; top: 0; z-index: 50; height: var(--top); flex: 0 0 var(--top); display: flex; align-items: center; gap: 22px;
  padding: 0 max(18px, env(safe-area-inset-right, 0px)) 0 max(18px, env(safe-area-inset-left, 0px)); background: var(--bg); border-bottom: 1px solid var(--line); }
.op-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ui); flex: none; }
.op-brand b { display: block; font-size: 16px; color: var(--text); }
.op-brand small { display: block; font-size: 11px; color: var(--dim); }
.op-tabs { display: flex; height: 100%; gap: 2px; }
.op-tabs a { display: flex; align-items: center; gap: 6px; padding: 0 14px; text-decoration: none; color: var(--muted); font-weight: 700; font-size: 14px; border-bottom: 2px solid transparent; white-space: nowrap; }
.op-tabs a small { color: var(--dim); font-size: 11px; font-weight: 600; }
.op-tabs a:hover { color: var(--text); }
.op-tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--ui); }
.op-status { margin-left: auto; display: flex; gap: 8px; align-items: center; min-width: 0; }
.op-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--ui); white-space: nowrap; }
.op-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.op-pill.hot { border-color: rgba(251,146,60,.6); color: #fdba74; } .op-pill.hot i { background: var(--orange); }
.op-pill.replay { border-color: rgba(251,191,36,.6); color: var(--amber); } .op-pill.replay i { background: var(--amber); }
.op-pill.off { border-color: rgba(248,113,113,.5); color: var(--red); } .op-pill.off i { background: var(--red); }

/* 본문 */
.op-view { flex: 1; min-height: 0; overflow: auto; }
.op-watch { flex: 1; min-height: 0; display: flex; }
.op-watch iframe { flex: 1; border: 0; width: 100%; height: 100%; background: var(--bg); }
.op-page { max-width: 1480px; margin: 0 auto; padding: 26px max(16px, env(safe-area-inset-right, 0px)) 48px max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 28px; }
@media (min-width: 900px) { .op-page { padding-left: 40px; padding-right: 40px; } }
.op-eyebrow { margin: 0 0 6px; color: var(--muted); font-size: 12.5px; font-weight: 700; letter-spacing: .4px; }
.op-h1 { margin: 0; font-size: 30px; letter-spacing: -.6px; line-height: 1.25; text-wrap: balance; }
.op-lead { margin: 10px 0 0; max-width: 72ch; color: #d4d4d8; font-size: 15px; line-height: 1.7; }
.op-sec { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.op-sec-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.op-sec-head h2 { margin: 0; font-size: 17px; }
.op-sec-head span { color: var(--dim); font-size: 12.5px; }
.op-sec-head .op-go { margin-left: auto; }
.op-card { min-width: 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); display: flex; flex-direction: column; gap: 10px; }
.op-card h3 { margin: 0; font-size: 15px; }
.op-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.op-card-head small { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; }
.op-go { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border: 1px solid var(--line-2); border-radius: 8px; font-size: 12px; font-weight: 700; text-decoration: none; color: var(--ui); white-space: nowrap; background: none; cursor: pointer; }
.op-go:hover { border-color: var(--ui); }
.op-note { margin: 0; color: var(--dim); font-size: 12px; line-height: 1.6; }
.op-limits { margin: 0; padding-left: 18px; color: var(--dim); font-size: 12px; line-height: 1.6; }
.op-wait { color: var(--dim); font-size: 13px; }
.op-err { padding: 10px 14px; border: 1px solid rgba(248,113,113,.4); border-radius: 10px; color: var(--red); font-size: 13px; }
.op-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.op-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.op-num { font-variant-numeric: tabular-nums; }
.op-early { color: var(--green); } .op-late { color: var(--red); }
.op-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 11.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.op-chip[data-tone="ok"] { border-color: rgba(52,211,153,.5); color: var(--green); }
.op-chip[data-tone="wait"] { border-color: rgba(251,191,36,.5); color: var(--amber); }
.op-chip[data-tone="bad"] { border-color: rgba(248,113,113,.5); color: var(--red); }

/* 기준 → 선행 → 대가: 일찍 알렸다는 숫자는 이 세 칸과 함께만 보인다 */
.op-why { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.op-why > div { padding: 14px 16px; min-width: 0; }
.op-why > div + div { border-left: 1px solid var(--line); }
.op-why dt { color: var(--muted); font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.op-why dt b { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--card); color: var(--ui); font-size: 11px; }
.op-why dd { margin: 6px 0 0; font-size: 14px; line-height: 1.55; }
.op-why dd strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.op-why dd small { display: block; margin-top: 4px; color: var(--dim); font-size: 12px; }

/* 홈 */
.op-hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(320px, 1fr); gap: 32px; align-items: center; }
.op-hero h1 { margin: 0; font-size: clamp(28px, 2.6vw, 38px); line-height: 1.22; letter-spacing: -.8px; text-wrap: balance; }
.op-cycle { margin: 0; }
.op-cycle svg { display: block; width: 100%; max-width: 480px; height: auto; margin: 0 auto; }
.op-cycle .edge { fill: none; stroke: #52525b; stroke-width: 1.6; }
.op-cycle .edge.back { stroke-dasharray: 4 5; }
.op-cycle a { cursor: pointer; outline: none; }
.op-cycle .node rect.card { fill: var(--panel); stroke: #3f3f46; stroke-width: 1.2; transition: fill .2s, stroke .2s, filter .2s;
  animation: op-node-glow 4.5s ease-in-out infinite; animation-delay: calc(var(--i) * 1.5s); }
.op-cycle .node rect.ring { fill: none; stroke: var(--green); stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center;
  animation: op-node-ring 4.5s ease-out infinite; animation-delay: calc(var(--i) * 1.5s); pointer-events: none; }
.op-cycle .node .go { fill: var(--green); font-size: 11px; font-weight: 800; opacity: 0; transition: opacity .2s; }
.op-cycle a:hover .node rect.card, .op-cycle a:focus-visible .node rect.card { fill: #1f2a26; stroke: var(--green); stroke-width: 2; filter: drop-shadow(0 0 10px rgba(52,211,153,.45)); animation: none; }
.op-cycle a:hover .node .go, .op-cycle a:focus-visible .node .go { opacity: 1; }
.op-cycle a:hover .node .title, .op-cycle a:focus-visible .node .title { fill: #fff; }
.op-cycle .edge.flow { stroke-dasharray: 6 6; animation: op-edge-flow 1.2s linear infinite; }
.op-cycle .edge.back.flow { stroke-dasharray: 4 5; }
@keyframes op-node-glow {
  0%, 22%, 100% { stroke: #3f3f46; filter: none; }
  8% { stroke: var(--green); filter: drop-shadow(0 0 8px rgba(52,211,153,.55)); }
}
@keyframes op-node-ring {
  0% { opacity: .9; transform: scale(1); }
  20% { opacity: 0; transform: scale(1.12); }
  100% { opacity: 0; transform: scale(1.12); }
}
@keyframes op-edge-flow { to { stroke-dashoffset: -12; } }
@media (prefers-reduced-motion: reduce) {
  .op-cycle .node rect.card, .op-cycle .node rect.ring, .op-cycle .edge.flow { animation: none; }
}
.op-cycle .season { fill: var(--muted); font-size: 12px; font-weight: 700; }
.op-cycle .title { fill: var(--text); font-size: 19px; font-weight: 800; }
.op-cycle .sub { fill: var(--dim); font-size: 12px; }
.op-cycle .backlabel { fill: var(--dim); font-size: 12px; font-weight: 600; }
.op-cycle figcaption { text-align: center; color: var(--dim); font-size: 12px; }

/* 주요 수치: 상자 대신 숫자 아래 같은 색의 작은 그림 */
.op-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.op-kpi { --c: var(--ui); min-width: 0; padding: 4px 20px 2px; display: flex; flex-direction: column; gap: 3px; }
.op-kpi + .op-kpi { border-left: 1px solid var(--line); }
.op-kpi:first-child { padding-left: 0; }
.op-kpi-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.op-kpi-label i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.op-kpi strong { color: var(--c); font-size: 28px; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.op-kpi strong small { margin-left: 3px; color: var(--muted); font-size: 13px; font-weight: 600; }
.op-kpi svg { display: block; width: 100%; height: 34px; margin-top: 4px; overflow: visible; }
.op-kpi-cap { color: var(--dim); font-size: 11.5px; line-height: 1.4; }

.op-doors { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.op-door { min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.op-door { transition: border-color .2s, transform .2s, box-shadow .2s; }
.op-door:has(.op-door-head:hover), .op-door:has(.op-door-shot:hover) { border-color: var(--green); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.op-door-shot { position: relative; display: block; overflow: hidden; border-radius: 8px; border: 1px solid var(--line); aspect-ratio: 16 / 10; background: #0b0b0e; }
.op-door-shot svg { display: block; width: 100%; height: 100%; transition: transform .35s ease, filter .35s; filter: saturate(.9) brightness(.9); }
.op-door-shot svg .pulse { transform-box: fill-box; transform-origin: center; animation: op-dot-pulse 1.8s ease-in-out infinite; }
@keyframes op-dot-pulse { 50% { transform: scale(1.8); opacity: .55; } }
.op-door-shot span { position: absolute; right: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 2px; padding: 1px 7px; border-radius: 999px;
  background: rgba(9,9,11,.7); border: 1px solid rgba(52,211,153,.35); color: var(--green); font-size: 10.5px; font-weight: 600; line-height: 1.5; opacity: 0; transform: translateY(3px); transition: opacity .2s, transform .2s; }
.op-door-shot span svg { width: 10px; height: 10px; }
.op-door:hover .op-door-shot svg { transform: scale(1.04); filter: none; }
.op-door:hover .op-door-shot span { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .op-door, .op-door-shot svg { transition: none; } .op-door:hover .op-door-shot svg { transform: none; } .op-door-shot svg .pulse { animation: none; } }
.op-door-head { display: flex; flex-direction: column; gap: 3px; text-decoration: none; }
.op-door-head .op-chip { align-self: flex-start; }
.op-door-head b { font-size: 17px; display: flex; align-items: center; justify-content: space-between; }
.op-door-head em { font-style: normal; color: #d4d4d8; font-size: 13px; }
.op-door ul { margin: 0; padding-left: 16px; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.op-door-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.op-mini-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 5px 8px; border-radius: 8px; background: rgba(255,255,255,.03); font-size: 12px; }
.op-mini-row b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.op-mini-row span { color: var(--dim); }
.op-mini-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 6px 9px; border-radius: 8px; background: rgba(255,255,255,.03); text-decoration: none; font-size: 12.5px; }
.op-mini-link:hover { background: rgba(255,255,255,.07); }
.op-mini-link small { grid-row: 2; color: var(--dim); font-size: 11.5px; }

/* 수위 곡선 */
.op-hydro svg { display: block; width: 100%; height: auto; }
.op-hydro .grid { stroke: rgba(255,255,255,.06); }
.op-hydro .axis { fill: var(--dim); font-size: 11px; }
.op-hydro .lvl { stroke-dasharray: 4 4; stroke-width: 1; }
.op-hydro .lvl-label { font-size: 11px; font-weight: 700; }
.op-hydro .line { fill: none; stroke: var(--sky); stroke-width: 2; }
.op-hydro .area { fill: rgba(56,189,248,.08); }
.op-hydro .gap { fill: rgba(52,211,153,.12); }
.op-hydro .mark { stroke-width: 1.2; }
.op-hydro .mark-label { font-size: 11px; font-weight: 700; }
.op-hydro .dot { stroke: var(--bg); stroke-width: 2; }
.op-hydro-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.op-hydro-legend i { display: inline-block; width: 10px; height: 3px; margin-right: 6px; vertical-align: middle; border-radius: 2px; }
.op-card > .op-chip { align-self: flex-start; }

/* 신호 행 */
.op-sig { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.op-sig li { display: grid; grid-template-columns: 94px minmax(0, 1fr) 44px minmax(70px, .7fr) 70px; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 8px; background: rgba(255,255,255,.03); font-size: 12.5px; }
.op-sig .tier { color: var(--dim); font-size: 11px; font-weight: 700; }
.op-sig .name { min-width: 0; }
.op-sig .name b { display: block; font-weight: 600; color: var(--ui); }
.op-sig .name small { display: block; color: var(--dim); font-size: 11.5px; line-height: 1.4; }
.op-sig .at { color: var(--dim); font-variant-numeric: tabular-nums; }
.op-sig .lead { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.op-bar { position: relative; height: 8px; border-radius: 4px; background: rgba(255,255,255,.05); }
.op-bar::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: #52525b; }
.op-bar i { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.op-bar i.e { background: var(--green); } .op-bar i.l { background: var(--red); }
.op-select { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: rgba(255,255,255,.03); font-size: 12.5px; color: var(--muted); }
.op-select .track { flex: 1; height: 6px; border-radius: 3px; background: rgba(255,255,255,.06); overflow: hidden; display: flex; }
.op-select .track i { display: block; height: 100%; }

/* 표 */
.op-table-wrap { overflow-x: auto; }
.op-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.op-table th { text-align: left; color: var(--dim); font-size: 12px; font-weight: 700; padding: 6px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.op-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.op-table tr.cur td { background: rgba(255,255,255,.04); }
.op-table tr.cur td:first-child { box-shadow: inset 2px 0 0 var(--ui); }
.op-cellbar { display: flex; align-items: center; gap: 8px; }
.op-cellbar i { display: block; height: 6px; border-radius: 3px; background: var(--green); }
.op-cellbar i.cost { background: var(--orange); }

/* 하위 탭 */
.op-subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.op-subtabs a { padding: 8px 14px; text-decoration: none; color: var(--muted); font-weight: 700; font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.op-subtabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--ui); }
.op-frame { width: 100%; height: calc(100dvh - var(--top) - 190px); min-height: 560px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }

/* 시설 등록 */
.op-gates { display: flex; flex-wrap: wrap; gap: 4px; }
.op-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.op-kv div { padding: 7px 9px; border-radius: 8px; background: rgba(255,255,255,.03); min-width: 0; }
.op-kv span { display: block; color: var(--dim); font-size: 11px; }
.op-kv b { display: block; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 사례 */
.op-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.op-steps li { display: grid; grid-template-columns: 56px 12px minmax(0, 1fr); gap: 10px; align-items: start; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.op-steps li:hover { background: rgba(255,255,255,.04); }
.op-steps li.on { background: rgba(255,255,255,.07); }
.op-steps time { color: var(--dim); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.op-steps i { width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; border: 2px solid #52525b; }
.op-steps li.on i, .op-steps li.past i { border-color: var(--red); background: var(--red); }
.op-steps b { display: block; font-size: 13px; }
.op-steps small { display: block; color: var(--dim); font-size: 11.5px; }
.op-case-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 14px; }
.op-map { position: relative; height: 560px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #0b0b0e; }
.op-map .maplibregl-ctrl-attrib { background: rgba(9,9,11,.7) !important; color: var(--dim) !important; font-size: 11px; }
.op-map-legend { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 12px; padding: 6px 10px; border-radius: 8px; background: rgba(9,9,11,.85); font-size: 11.5px; color: var(--muted); }
.op-map-legend i { display: inline-block; width: 10px; height: 10px; margin-right: 5px; border-radius: 2px; vertical-align: -1px; }
.op-map-wait { position: absolute; inset: 0; display: grid; place-items: center; color: var(--dim); font-size: 13px; }
/* 사건 재생 막대(예전 사건 콘솔과 같은 구성) */
.op-replay { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.op-replay-label { display: flex; flex-direction: column; min-width: 190px; }
.op-replay-label span { color: var(--dim); font-size: 11px; font-weight: 700; }
.op-replay-label strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.op-replay button { min-width: 34px; height: 34px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; background: rgba(255,255,255,.04); font-size: 15px; font-weight: 700; cursor: pointer; }
.op-replay button.primary { min-width: 104px; font-size: 13px; background: var(--ui); color: var(--bg); border-color: var(--ui); }
.op-replay button:disabled { opacity: .35; cursor: default; }
.op-replay-track { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding-left: 6px; }
.op-replay-track input { width: 100%; accent-color: var(--red); }
.op-replay-ticks { display: flex; justify-content: space-between; color: var(--dim); font-size: 11px; font-variant-numeric: tabular-nums; }
.op-lead-chart svg { display: block; width: 100%; height: auto; }

/* 에이전트 패널: 관제 보드 서랍과 같은 대화 문법(질문 오른쪽, 답 왼쪽, [n] 근거, 제한, 후속 질문) */
.op-ag-fab { position: fixed; right: 20px; bottom: 20px; z-index: 40; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 1px solid rgba(52,211,153,.5);
  border-radius: 999px; background: #0f1a16; color: var(--green); font-size: 13px; font-weight: 800; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.45); }
.op-ag-fab:hover { background: #13241d; border-color: var(--green); }
.op-ag { position: fixed; top: calc(var(--top) + 10px); right: 10px; bottom: 10px; z-index: 45; width: min(440px, calc(100vw - 20px)); display: flex; flex-direction: column;
  border: 1px solid var(--line-2); border-radius: 14px; background: var(--panel); box-shadow: 0 16px 48px rgba(0,0,0,.55); transform: translateX(calc(100% + 20px)); visibility: hidden;
  transition: transform .25s ease, visibility 0s linear .25s; }
.op-ag.on { transform: none; visibility: visible; transition: transform .25s ease; }
@media (prefers-reduced-motion: reduce) { .op-ag, .op-ag.on { transition: none; } }
@media (min-width: 1280px) { .op-view.op-ag-push .op-page { padding-right: 480px; } }
.op-ag-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.op-ag-head div { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.op-ag-head h2 { margin: 0; font-size: 15px; }
.op-ag-close { width: 30px; height: 30px; border: 1px solid var(--line-2); border-radius: 8px; background: none; font-size: 18px; line-height: 1; cursor: pointer; color: var(--muted); }
.op-ag-close:hover { color: var(--text); border-color: var(--ui); }
.op-ag-av { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(52,211,153,.14); color: var(--green); font-size: 11px; font-weight: 900; }
.op-ag-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.op-ag-intro { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.op-ag-sugs { display: flex; flex-direction: column; gap: 5px; }
.op-ag-sugs button { display: grid; gap: 1px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.03); text-align: left; cursor: pointer; }
.op-ag-sugs button b { font-size: 11.5px; color: var(--muted); }
.op-ag-sugs button span { font-size: 13px; color: #d4d4d8; }
.op-ag-sugs button:hover:not(:disabled) { border-color: var(--line-2); background: rgba(255,255,255,.06); }
.op-ag-gated { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid rgba(251,191,36,.4); border-radius: 10px; background: rgba(251,191,36,.06); font-size: 13px; line-height: 1.6; }
.op-ag-gated p { margin: 0; }
.op-ag-gated .op-gates { margin-top: 2px; }
.op-ag-gated a { color: var(--green); }
.op-ag-thread { display: flex; flex-direction: column; gap: 10px; }
.op-ag-thread:empty { display: none; }
.op-ag-me { align-self: flex-end; max-width: 85%; padding: 8px 12px; border-radius: 12px 12px 3px 12px; background: rgba(255,255,255,.1); font-size: 13.5px; }
.op-ag-ai { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; }
.op-ag-ai-body { min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 3px 12px 12px 12px; background: rgba(255,255,255,.04); }
.op-ag-ai[data-s="NEEDS_DATA"] .op-ag-ai-body { border-color: rgba(251,191,36,.4); }
.op-ag-ai[data-s="UNAVAILABLE"] .op-ag-ai-body { border-color: rgba(248,113,113,.4); }
.op-ag-state { display: inline-block; margin-bottom: 6px; padding: 0 7px; border-radius: 5px; font-size: 11px; font-weight: 800; background: rgba(251,191,36,.15); color: var(--amber); }
.op-ag-state[data-s="UNAVAILABLE"] { background: rgba(248,113,113,.15); color: var(--red); }
.op-ag-answer { margin: 0; font-size: 13.5px; line-height: 1.65; white-space: pre-wrap; color: #d4d4d8; }
.op-ag-cite { display: inline-block; padding: 0 4px; border-radius: 4px; background: rgba(255,255,255,.1); color: var(--ui); font-size: 11px; font-weight: 800; }
.op-ag-tools { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.op-ag-tools em { font-style: normal; padding: 1px 7px; border-radius: 5px; background: rgba(255,255,255,.07); font-size: 11px; font-weight: 700; color: var(--muted); font-family: ui-monospace, Consolas, monospace; }
.op-ag-evi { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.op-ag-evi summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.op-ag-evi small { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); word-break: break-all; }
.op-ag-evi pre { margin: 6px 0 0; max-height: 200px; overflow: auto; padding: 8px; border-radius: 6px; background: var(--bg); font-size: 11px; color: var(--muted); }
.op-ag-limit { display: block; margin-top: 6px; font-size: 12px; color: var(--dim); }
.op-ag-follow { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.op-ag-follow button { padding: 5px 10px; border: 1px solid var(--line-2); border-radius: 999px; background: transparent; color: var(--ui); font-size: 12px; font-weight: 600; text-align: left; cursor: pointer; }
.op-ag-follow button:hover:not(:disabled) { border-color: var(--ui); }
.op-ag button:disabled { opacity: .45; cursor: default; }
.op-ag-foot { display: flex; flex-direction: column; gap: 6px; padding: 10px 14px 12px; border-top: 1px solid var(--line); }
.op-ag-ask { display: flex; gap: 6px; }
.op-ag-ask input { flex: 1; min-width: 0; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; font-size: 13.5px; }
.op-ag-ask input:focus { outline: none; border-color: var(--ui); }
.op-ag-ask button { padding: 0 14px; border: 1px solid var(--ui); border-radius: 8px; background: var(--ui); color: var(--bg); font-size: 13px; font-weight: 800; cursor: pointer; }
.op-ag-status { color: var(--muted); font-size: 12px; }
.op-ag-status.busy::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; border: 2px solid var(--ui); border-right-color: transparent; vertical-align: -1px; animation: op-ag-spin .8s linear infinite; }
@keyframes op-ag-spin { to { transform: rotate(360deg); } }
.op-ag-error { margin: 0; padding: 8px 10px; border-radius: 6px; background: rgba(248,113,113,.12); color: var(--red); font-size: 12px; }

@media (max-width: 1200px) {
  .op-doors, .op-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .op-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 18px; }
  .op-kpi:nth-child(4) { padding-left: 0; border-left: 0; }
  .op-hero, .op-case-layout { grid-template-columns: 1fr; }
  .op-tabs a small { display: none; }
}
@media (max-width: 760px) {
  .op-replay { flex-wrap: wrap; } .op-replay-label { min-width: 0; width: 100%; } .op-replay-ticks { display: none; }
  .op-top { gap: 10px; }
  .op-brand span, .op-status { display: none; }
  .op-tabs { overflow-x: auto; }
  .op-tabs a { padding: 0 9px; font-size: 13px; }
  .op-doors, .op-grid-2, .op-grid-4, .op-why { grid-template-columns: 1fr; }
  .op-why > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .op-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .op-kpi, .op-kpi:first-child { padding-left: 0; border-left: 0 !important; }
  .op-sig li { grid-template-columns: minmax(0, 1fr) 44px 62px; }
  .op-sig .tier, .op-sig .op-bar { display: none; }
}
