/* A2A Mission Control. Visual language borrowed from Execubot: a dark stage, glass panes,
   colour is state only (cyan = traffic, red = blocked or failed, green = done, amber = rogue). */
@font-face { font-family: "Big Shoulders Display"; font-weight: 100 900; font-display: swap; src: url("fonts/big-shoulders-display.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 100 900; font-display: swap; src: url("fonts/archivo.woff2") format("woff2"); }
@font-face { font-family: "Doto"; font-weight: 800; font-display: swap; src: url("fonts/doto.woff2") format("woff2"); }
:root {
  --void: #0c1124; --line: rgba(170, 190, 255, .16); --glass: rgba(150, 170, 255, .07);
  --text: #e9ecf8; --dim: #8d96ba; --red: #ff3347; --cyan: #74d7ff; --ok: #45e0b4; --amber: #ffb547;
  --violet: #a98bff;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; color: var(--text); font: 400 15px/1.5 Archivo, system-ui, sans-serif; min-height: 100vh;
  background: radial-gradient(1200px 760px at 62% -10%, #1a2350 0%, var(--void) 62%) fixed, var(--void); }
button, textarea, input { font: inherit; color: inherit; }
button:focus-visible, textarea:focus-visible, input:focus-visible, .pane:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
code { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: .92em; }

/* ---- header ---- */
.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 12px 28px; background: rgba(12, 17, 36, .86); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.brand svg { width: 24px; height: 24px; align-self: center; color: var(--cyan); flex: none; }
.brand-name { font-family: "Big Shoulders Display"; font-weight: 800; font-size: 28px; line-height: 1; letter-spacing: .04em; margin: 0; }
.brand-sub { font-size: 13px; color: var(--dim); }
.top-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pill { font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--dim); white-space: nowrap; }
.pill.ok { color: var(--ok); border-color: rgba(69, 224, 180, .35); }
.pill.bad { color: #fff; background: var(--red); border-color: var(--red); }

.btn { border: 1px solid var(--line); background: var(--glass); padding: 8px 16px; border-radius: 999px; cursor: pointer; font-size: 14px; }
.btn:hover { border-color: var(--cyan); }
.btn:disabled { opacity: .4; cursor: default; }
.btn-primary { background: var(--cyan); border-color: var(--cyan); color: #06101f; font-weight: 600; }
.btn-primary:hover { background: #a4e6ff; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 4px 12px; font-size: 13px; }

/* ---- layout ---- */
.deck { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 24px; padding: 22px 28px 60px; align-items: start; }
.side { position: sticky; top: 74px; max-height: calc(100vh - 90px); overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-right: 4px; }
.h { font-family: Doto, monospace; font-weight: 800; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--cyan); margin: 6px 0 0; }
.h-sub { font-family: Archivo, sans-serif; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--dim); font-size: 12px; margin-left: 6px; }
.sc { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--glass); display: flex; flex-direction: column; gap: 8px; transition: border-color .3s, box-shadow .3s; }
.sc.active { border-color: var(--cyan); box-shadow: 0 0 0 1px rgba(116, 215, 255, .25), 0 10px 40px rgba(116, 215, 255, .08); }
.sc-k { margin: 0; font-family: "Big Shoulders Display"; font-weight: 800; font-size: 21px; line-height: 1.05; }
.sc-t { margin: 0; color: #c3c9e4; font-size: 14px; }
.sc-t b { color: var(--text); }
.sc textarea { width: 100%; resize: vertical; border: 1px solid var(--line); background: rgba(6, 9, 22, .5); border-radius: 10px; padding: 8px 10px; font-size: 13px; line-height: 1.45; color: #d6dbf2; }
.sc .btn { align-self: flex-start; }

.matrix { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-size: 12px; }
.matrix th { font-weight: 400; color: var(--dim); text-align: center; padding: 0 2px; }
.matrix th.k { text-align: left; color: var(--text); font-weight: 600; white-space: nowrap; }
.matrix th.k small { display: block; font-weight: 400; color: var(--dim); }
.matrix th.a { font-size: 11px; writing-mode: vertical-rl; transform: rotate(180deg); height: 70px; vertical-align: bottom; }
.matrix td { text-align: center; }
.cell { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--line); transition: background .4s, border-color .4s, box-shadow .4s; }
.cell.on { background: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 10px rgba(116, 215, 255, .5); }
.cell.on.rogue { background: var(--amber); border-color: var(--amber); box-shadow: 0 0 10px rgba(255, 181, 71, .5); }
.cell.flash { animation: flash 1.2s ease-out 3; }
@keyframes flash { 0% { box-shadow: 0 0 0 0 rgba(255, 51, 71, .9); border-color: var(--red); } 100% { box-shadow: 0 0 0 12px rgba(255, 51, 71, 0); } }
.m-note { margin: 0; font-size: 12px; color: var(--dim); min-height: 18px; }
.m-note.alert { color: #ffd0d5; }

/* ---- stage ---- */
.main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.stage-wrap { position: relative; border-radius: 18px; border: 1px solid var(--line); background: radial-gradient(500px 300px at 46% 52%, rgba(116, 215, 255, .09), transparent 70%), rgba(10, 14, 32, .55); overflow: hidden; }
.stage { display: block; width: 100%; height: auto; }
.grid line { stroke: rgba(170, 190, 255, .05); }
.wire { fill: none; stroke: var(--line); stroke-width: 1.5; transition: stroke .4s, opacity .4s; }
.wire.hot { stroke: rgba(116, 215, 255, .7); stroke-width: 2; stroke-dasharray: 6 8; animation: march 1s linear infinite; }
.wire.off { opacity: .15; }
.wire.bypass { stroke: var(--red); stroke-width: 2; stroke-dasharray: 3 7; opacity: .9; animation: march .7s linear infinite; }
@keyframes march { to { stroke-dashoffset: -28; } }
.packet { filter: drop-shadow(0 0 6px currentColor); }
.packet.cyan { color: var(--cyan); fill: var(--cyan); }
.packet.green { color: var(--ok); fill: var(--ok); }
.packet.red { color: var(--red); fill: var(--red); }
.packet.amber { color: var(--amber); fill: var(--amber); }

.node .ring { fill: rgba(12, 17, 36, .92); stroke: var(--cyan); stroke-width: 2; transition: stroke .3s, fill .3s; }
.node .icon { fill: none; stroke: var(--cyan); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.node .name { font-family: "Big Shoulders Display"; font-weight: 800; font-size: 19px; fill: var(--text); letter-spacing: .02em; }
.node .sub { font-size: 11px; fill: var(--dim); }
.node .say { font-size: 11.5px; fill: #c9d0ea; }
.node .halo { fill: none; stroke: var(--cyan); stroke-width: 2; opacity: 0; }
.node.busy .halo { animation: halo 1.3s ease-out infinite; }
@keyframes halo { 0% { opacity: .8; r: 34; } 100% { opacity: 0; r: 56; } }
.node.done .ring { fill: rgba(69, 224, 180, .14); stroke: var(--ok); }
.node.done .icon { stroke: var(--ok); }
.node.failed .ring, .node.denied .ring { fill: rgba(255, 51, 71, .16); stroke: var(--red); }
.node.failed .icon, .node.denied .icon { stroke: var(--red); }
.node.off { opacity: .28; }
.node.off .name { text-decoration: line-through; }
.node.rogue .ring { stroke: var(--amber); }
.node.rogue .icon { stroke: var(--amber); }
.node.rogue .halo { stroke: var(--amber); }
.node.outsider .ring { stroke: rgba(255, 51, 71, .6); }
.node.outsider .icon { stroke: rgba(255, 51, 71, .8); }
.shield { fill: rgba(12, 17, 36, .9); stroke: var(--dim); stroke-width: 1.2; }
.shield.hit { stroke: var(--red); fill: rgba(255, 51, 71, .25); }
.gw .ring { stroke-width: 2.5; fill: rgba(18, 26, 60, .95); }
.gw .core { fill: url(#gw-glow); }
.gw .name { font-size: 24px; }
.gw.busy .spin { animation: spin 6s linear infinite; transform-origin: center; transform-box: fill-box; }
.spin { fill: none; stroke: rgba(116, 215, 255, .35); stroke-width: 1.5; stroke-dasharray: 3 9; }
@keyframes spin { to { transform: rotate(360deg); } }
.gw.deny .ring { stroke: var(--red); }
.zap { font-family: "Big Shoulders Display"; font-weight: 800; font-size: 22px; fill: var(--red); }
.zap.ok { fill: var(--ok); }
.caption { font-size: 11px; fill: var(--dim); letter-spacing: .06em; text-transform: uppercase; }

.banner { position: absolute; left: 16px; right: 16px; bottom: 14px; padding: 10px 16px; border-radius: 12px; font-size: 14px; background: rgba(18, 24, 50, .92); border: 1px solid var(--line); backdrop-filter: blur(10px); animation: rise .4s both; }
.banner.ok { border-color: rgba(69, 224, 180, .5); color: #c8fbe9; }
.banner.bad { border-color: rgba(255, 51, 71, .55); color: #ffd0d5; }
.banner[hidden] { display: none; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---- the log (Execubot rows) ---- */
.log-head { display: flex; align-items: center; justify-content: space-between; }
.log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.empty { text-align: center; color: var(--dim); padding: 30px 0; }
.empty p { margin: 0; }
.empty-title { font-family: "Big Shoulders Display"; font-weight: 800; font-size: 34px; color: var(--text); }
.ask { margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--line); animation: fade .4s both; }
.ask:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.ask-who { margin: 0; font-size: 12px; color: var(--dim); font-family: Doto, monospace; font-weight: 800; letter-spacing: .08em; }
.ask-text { margin: 2px 0 0; font-weight: 300; font-size: clamp(17px, 1.6vw, 22px); line-height: 1.35; }
.row { display: grid; grid-template-columns: 54px 22px 210px minmax(0, 1fr); align-items: center; gap: 12px; animation: fade .4s both; }
.t { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; text-align: right; }
.dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--cyan); background: var(--void); justify-self: center; }
.row.reply .dot { background: var(--cyan); }
.row.final .dot { background: var(--ok); border-color: var(--ok); }
.row.bad .dot { background: var(--red); border-color: var(--red); border-radius: 4px; }
.row.rogue .dot { border-color: var(--amber); background: var(--amber); }
.row.note .dot { border-color: var(--dim); width: 8px; height: 8px; }
.route { min-width: 0; }
.verb { font-family: "Big Shoulders Display"; font-weight: 700; font-size: 20px; line-height: 1; margin: 0; }
.row.bad .verb { color: var(--red); }
.row.final .verb { color: var(--ok); }
.row.rogue .verb { color: var(--amber); }
.path { font-size: 12px; color: var(--dim); }
.path b { color: #cfd5ee; font-weight: 600; }
.pane { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass); cursor: pointer; transition: border-color .2s; min-width: 0; }
.pane:hover { border-color: var(--cyan); }
.pane.plain { cursor: default; }
.pane.plain:hover { border-color: var(--line); }
.row.bad .pane { border-color: rgba(255, 51, 71, .45); }
.row.rogue .pane { border-color: rgba(255, 181, 71, .45); }
.p-sub { display: block; font-size: 14px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.p-meta { display: block; margin-top: 2px; font-size: 12px; color: var(--dim); }
.status-line { grid-column: 3 / -1; margin: -4px 0 0; font-size: 13px; color: var(--dim); }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

/* ---- reader ---- */
.veil { position: fixed; inset: 0; background: rgba(6, 9, 22, .6); backdrop-filter: blur(6px); display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity .3s; z-index: 10; }
.veil.on { opacity: 1; pointer-events: auto; }
.letter { position: relative; width: min(720px, 92vw); max-height: 86vh; overflow-y: auto; padding: 28px 32px; border-radius: 18px; border: 1px solid var(--line); background: rgba(22, 29, 60, .97); transform: translateY(12px); transition: transform .3s; }
.veil.on .letter { transform: none; }
.x { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 18px; }
.l-sub { font-family: "Big Shoulders Display"; font-weight: 800; font-size: 32px; line-height: 1.05; margin: 0 40px 8px 0; }
.l-meta { color: var(--dim); font-size: 13px; margin: 0 0 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.l-meta div + div { margin-top: 2px; }
.l-text { font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; }
.l-text h1, .l-text h2, .l-text h3 { font-family: "Big Shoulders Display"; font-weight: 800; letter-spacing: .02em; margin: 18px 0 6px; }
.l-text h2 { font-size: 24px; } .l-text h3 { font-size: 20px; color: var(--cyan); }
.l-text p { margin: 0 0 10px; }
.l-text ul { margin: 0 0 10px; padding-left: 20px; }
.l-text pre { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; background: rgba(6, 9, 22, .5); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.l-text.danger { color: #ffe1c2; }

/* ---- sign-in ---- */
body.gate { display: grid; place-items: center; }
.gate-card { width: min(380px, 92vw); padding: 34px 30px; border-radius: 20px; border: 1px solid var(--line); background: rgba(18, 24, 50, .9); display: flex; flex-direction: column; gap: 10px; }
.gate-card svg { width: 34px; height: 34px; color: var(--cyan); }
.gate-card label { margin-top: 14px; font-size: 13px; color: var(--dim); }
.gate-card input { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(6, 9, 22, .5); font-size: 16px; }
.gate-card .btn { margin-top: 6px; align-self: stretch; padding: 10px; }

@media (max-width: 1100px) {
  .deck { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .side { position: static; max-height: none; }
  .top { padding: 10px 16px; flex-wrap: wrap; }
  .brand-sub { display: none; }
}
@media (max-width: 640px) {
  .row { grid-template-columns: 44px 16px minmax(0, 1fr); }
  .row .pane { grid-column: 3; }
  .status-line { grid-column: 3; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
