/* Inkore AI Team · dark "command" look, on top of ../shared/base.css (body.command tokens). */
body.command {
  /* left and right edge of the content: the header and the banner line up with the cards below */
  --content: 1544px;
  --edge: max(28px, calc((100% - var(--content)) / 2)); /* % of the page width, in padding and margin */
  --ag-chief: #5fc4cf;
  --ag-assistant: #82b6ea;
  --ag-content: #c4a3ec;
  --ag-research: #5fd6ba;
  --ag-sales: #f1b56c;
  --ag-operations: #a6cf7c;
  --ag-analytics: #f3939e;
  --bad: #ff9a8f;
  --ok: #7fdcb0;
  --line-strong: rgba(120, 200, 210, 0.26);
  --card: rgba(13, 30, 35, 0.86);
  --card-hi: rgba(18, 40, 46, 0.92);
  --inset: rgba(3, 12, 14, 0.55);
  --glow: 0 0 0 1px color-mix(in srgb, var(--ag, var(--accent)) 55%, transparent), 0 10px 40px -12px color-mix(in srgb, var(--ag, var(--accent)) 55%, transparent);
  min-height: 100vh;
  background:
    radial-gradient(1100px 620px at 64% -12%, rgba(95, 196, 207, 0.14), transparent 62%),
    radial-gradient(800px 600px at -10% 105%, rgba(95, 196, 207, 0.07), transparent 60%),
    var(--page);
  background-attachment: fixed;
}
body.command::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: linear-gradient(rgba(120, 200, 210, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(120, 200, 210, 0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 62% 28%, #000 10%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 62% 28%, #000 10%, transparent 75%);
}
body > * { position: relative; z-index: 1; }
[hidden] { display: none !important; }
body:not(.ready) main { visibility: hidden; }

/* ---------- basics */
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button { display: inline-flex; align-items: center; justify-content: center; gap: .45em; color: var(--ink); transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast) var(--ease), box-shadow var(--fast) var(--ease); }
button:hover:not(:disabled) { border-color: var(--line-strong); background: var(--hover); }
button.primary { font-weight: 600; }
button.primary:hover:not(:disabled) { background: var(--accent-hover); }
button.ghost { background: transparent; }
button.small { font-size: 13px; padding: .38em .85em; }
button.link { background: none; border: 0; padding: .2em .1em; color: var(--accent); border-radius: 6px; font-weight: 500; }
button.link:hover:not(:disabled) { background: none; color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
button.link.small { font-size: 13px; }
.icon-btn { width: 36px; height: 36px; padding: 0; background: transparent; }
input, textarea, select { background: var(--inset); color: var(--ink); border-color: var(--line); }
input:focus, textarea:focus, select:focus { border-color: color-mix(in srgb, var(--accent) 60%, transparent); outline: none; box-shadow: 0 0 0 3px rgba(95, 196, 207, 0.18); }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { resize: vertical; line-height: 1.5; }
::placeholder { color: var(--muted); opacity: .85; }
.muted { color: var(--muted); }
.hint { font-size: 13px; color: var(--muted); margin: .45em 0 0; }
.hint.warn { color: #f3d9a4; }
.remember { display: flex; align-items: center; gap: 8px; margin: .6em 0 0; font-size: 13.5px; color: var(--ink); cursor: pointer; }
.remember input { width: 18px; height: 18px; margin: 0; padding: 0; flex: none; accent-color: var(--accent); }
.hint.ok { color: var(--ok); min-height: 1.2em; }
.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin: 14px 0 6px; letter-spacing: .01em; }
.card { background: var(--card); border-color: var(--line); border-radius: 22px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.card-head h2, .sheet-head h2 { font-size: 15px; letter-spacing: .02em; margin: 0; display: flex; align-items: center; gap: 10px; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 50; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: 10px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 10px; }
.dots { display: inline-flex; gap: 4px; vertical-align: middle; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--ag, var(--accent)); animation: dot 1.1s var(--ease) infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* ---------- header */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px var(--edge); background: rgba(6, 17, 20, 0.78); border-bottom: 1px solid var(--line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-name { font-weight: 650; color: var(--ink); font-size: 16px; letter-spacing: .01em; white-space: nowrap; }
.mark { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: radial-gradient(circle at 50% 50%, rgba(95, 196, 207, .35), rgba(95, 196, 207, .05) 70%); border: 1px solid var(--line-strong); }
.mark span { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.top-actions .ghost { border-color: transparent; font-size: 14px; color: var(--text); }
.top-actions .ghost:hover:not(:disabled) { color: var(--ink); }
.lang .short { display: none; }
.mode-pill { font-size: 13px; padding: .4em .9em; background: var(--inset); color: var(--ink); white-space: nowrap; flex: none; }
.mode-pill .mode-short { display: none; }
.mode-pill .mode-k { color: var(--muted); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; font-size: 11px; }
.mode-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: #f3d9a4; box-shadow: 0 0 10px rgba(243, 217, 164, .7); }
.mode-pill[data-mode="own"] .dot { background: var(--ok); box-shadow: 0 0 10px rgba(127, 220, 176, .7); }
.mode-pill[data-mode="inkore"] .dot { background: var(--accent); box-shadow: 0 0 10px rgba(95, 196, 207, .7); }

.banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 16px var(--edge) 0; padding: 10px 12px 10px 16px; border: 1px solid rgba(243, 217, 164, .22); background: rgba(243, 217, 164, .06); border-radius: 16px; }
.banner p { margin: 0; color: var(--ink); font-size: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.banner-actions { display: flex; align-items: center; gap: 8px; }

/* ---------- layout */
main { display: grid; grid-template-columns: minmax(330px, 380px) minmax(0, 1fr); gap: 20px; padding: 20px 28px 32px; max-width: 1600px; margin: 0 auto; align-items: start; }
.col-a, .col-b { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 28px 32px; max-width: 1600px; margin: 0 auto; color: var(--muted); font-size: 13px; }

/* ---------- composer */
.composer textarea { min-height: 128px; font-size: 15px; }
.composer-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.composer-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
button.run { padding: .7em 1.3em; font-size: 15px; box-shadow: 0 10px 30px -12px rgba(95, 196, 207, .8); }
.run-glyph { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; position: relative; }
.run-glyph::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; background: currentColor; }
button.run.working { opacity: 1; background: rgba(95, 196, 207, .16); color: var(--ink); border-color: var(--line-strong); box-shadow: none; }
button.run.working .run-glyph { border-color: rgba(95, 196, 207, .3); border-top-color: var(--accent); animation: spin .9s linear infinite; }
button.run.working .run-glyph::after { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.notice { margin-top: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 154, 143, .08); border: 1px solid rgba(255, 154, 143, .28); color: var(--ink); font-size: 14px; }
.notice p { margin: 0; }
.notice-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
#restore-text { margin-left: 6px; }
.card-head .link { font-size: 13px; }

/* ---------- board */
.elapsed { font: 500 13px/1 var(--mono); color: var(--muted); }
.progress { height: 6px; border-radius: 99px; background: var(--inset); overflow: hidden; border: 1px solid var(--line); }
.progress span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #3aa6b2, var(--accent)); box-shadow: 0 0 12px rgba(95, 196, 207, .7); transition: width var(--normal) var(--ease); }
.progress.live span { background-image: linear-gradient(90deg, #3aa6b2, var(--accent), #bff3f7, var(--accent)); background-size: 200% 100%; animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.status-line { margin: 10px 0 0; font-size: 14px; color: var(--ink); min-height: 1.5em; }
.error-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.board { display: grid; gap: 12px; margin-top: 14px; }
.bcol h3 { display: flex; align-items: center; justify-content: space-between; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.bcol .n { font: 600 11px/1 var(--mono); color: var(--muted); background: var(--inset); border: 1px solid var(--line); border-radius: 99px; padding: .3em .6em; }
.bcol[data-col="working"] h3 { color: var(--accent); }
.bcol ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bcol .none { margin: 0; font-size: 13px; color: var(--muted); padding: 8px 10px; border: 1px dashed var(--line); border-radius: 12px; }
.bchip { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--inset); border: 1px solid var(--line); min-width: 0; }
.bchip .ico { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; color: var(--ag); background: color-mix(in srgb, var(--ag) 14%, transparent); flex: none; }
.bchip .ico svg { width: 16px; height: 16px; }
.bchip .bt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.bchip strong { font-size: 13px; color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.bchip .bt span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bchip .time { font: 500 11px/1 var(--mono); color: var(--muted); }
.bchip .tag { font-size: 11px; padding: .2em .55em; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.bchip .tag.bad { color: var(--bad); border-color: rgba(255, 154, 143, .4); }
.bchip[data-status="working"] { border-color: color-mix(in srgb, var(--ag) 60%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--ag) 25%, transparent), 0 6px 24px -10px var(--ag); background: color-mix(in srgb, var(--ag) 8%, var(--inset)); }
.bchip[data-status="working"] .ico { animation: breathe 1.4s var(--ease) infinite; }
.bchip[data-status="error"] { border-color: rgba(255, 154, 143, .45); }
.bchip[data-status="done"] .ico { color: var(--ag); }
.bchip[data-status="skipped"] { opacity: .6; }
@keyframes breathe { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--ag) 18%, transparent); } }

/* ---------- plan */
.plan-summary { margin: 0 0 12px; color: var(--ink); font-size: 14px; }
.plan-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.plan-steps li { display: grid; grid-template-columns: 22px 30px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px; border-radius: 14px; background: var(--inset); border: 1px solid var(--line); }
.plan-steps .pnum { font: 600 12px/30px var(--mono); color: var(--muted); text-align: center; }
.plan-steps .ico { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; color: var(--ag); background: color-mix(in srgb, var(--ag) 14%, transparent); }
.plan-steps li > div { min-width: 0; }
.plan-steps strong { color: var(--ink); font-size: 14px; overflow-wrap: anywhere; }
.plan-steps p { overflow-wrap: anywhere; }
.plan-steps p { margin: 2px 0 0; font-size: 13px; color: var(--text); }
.plan-steps .why { color: var(--muted); }
.plan-steps .why span { font-weight: 600; margin-right: 4px; }
.plan-steps li[data-status="working"] { border-color: color-mix(in srgb, var(--ag) 55%, transparent); }
.plan-steps li[data-status="done"] .pnum { color: var(--ok); }
.warns { margin: 12px 0 0; padding: 10px 12px 10px 28px; border-radius: 12px; background: rgba(243, 217, 164, .06); border: 1px solid rgba(243, 217, 164, .2); font-size: 13px; color: #f3d9a4; }
.plan-wait { display: flex; align-items: center; gap: 10px; }

/* ---------- team map */
.map-wrap { container-type: inline-size; container-name: map; }
.map { position: relative; --wires: 0; }
.wires { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 0; }
.wires .w-base { fill: none; stroke: var(--line-strong); stroke-width: 1.3; transition: stroke var(--normal) var(--ease); }
.wires .w-flow { fill: none; stroke: var(--ag); stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 14 220; opacity: 0; }
.wires .w-end { fill: var(--page); stroke: var(--line-strong); stroke-width: 1.3; }
.wires g[data-status="planned"] .w-base { stroke: color-mix(in srgb, var(--ag) 50%, transparent); stroke-dasharray: 4 6; }
.wires g[data-status="working"] .w-base { stroke: color-mix(in srgb, var(--ag) 45%, transparent); }
.wires g[data-status="working"] .w-flow { opacity: 1; animation: flow 1.3s linear infinite; filter: drop-shadow(0 0 5px var(--ag)); }
.wires g[data-status="working"] .w-end, .wires g[data-status="done"] .w-end { fill: var(--ag); stroke: var(--ag); }
.wires g[data-status="done"] .w-base { stroke: color-mix(in srgb, var(--ag) 65%, transparent); stroke-width: 1.6; }
.wires g[data-status="off"] .w-base, .wires g[data-status="unused"] .w-base { stroke: rgba(120, 200, 210, .08); }
@keyframes flow { from { stroke-dashoffset: 234; } to { stroke-dashoffset: 0; } }

.chief { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center; }
.orbit { position: relative; width: 168px; aspect-ratio: 1; display: grid; place-items: center; }
.orbit-lines, .node { display: none; }
.core { position: relative; width: 100%; aspect-ratio: 1; display: grid; place-items: center; }
.core .ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(95, 196, 207, .22); }
.core .r1 { inset: 0; border-style: dashed; border-color: rgba(95, 196, 207, .28); animation: spin 38s linear infinite; }
.core .r2 { inset: 14%; border-color: rgba(95, 196, 207, .35); }
.core .r3 { inset: 28%; border: 0; background: radial-gradient(circle at 42% 38%, #d6fbfd 0%, #8fe3ea 18%, #3fb1bd 46%, #0e4b52 78%, rgba(8, 20, 23, 0) 100%); box-shadow: 0 0 46px rgba(95, 196, 207, .55), inset 0 0 18px rgba(255, 255, 255, .25); }
.core-glow { position: absolute; inset: 10%; border-radius: 50%; background: radial-gradient(circle, rgba(95, 196, 207, .28), transparent 65%); }
.core-ico { position: relative; color: #032024; display: grid; place-items: center; }
.core-ico svg { width: 30px; height: 30px; stroke-width: 1.9; }
.chief[data-status="planning"] .r3, .chief[data-status="final"] .r3 { animation: pulse 1.25s var(--ease) infinite; }
.chief[data-status="planning"] .core-glow, .chief[data-status="final"] .core-glow { animation: halo 1.25s var(--ease) infinite; }
.chief[data-status="planning"] .r1, .chief[data-status="final"] .r1, .chief[data-status="running"] .r1 { animation-duration: 6s; border-color: rgba(95, 196, 207, .55); }
.chief[data-status="running"] .r2 { border-color: rgba(95, 196, 207, .55); }
@keyframes pulse { 50% { transform: scale(1.07); box-shadow: 0 0 70px rgba(95, 196, 207, .85), inset 0 0 22px rgba(255, 255, 255, .35); } }
@keyframes halo { 50% { transform: scale(1.35); opacity: .55; } }
.chief-text { margin-top: 12px; max-width: 240px; }
.chief-text h3 { font-size: 17px; margin: 0 0 4px; overflow-wrap: anywhere; }
.chief-text .job { margin: 0; font-size: 13px; color: var(--muted); }
.chief-status { display: inline-flex; align-items: center; gap: 8px; margin: 12px 0 8px; font-size: 13px; color: var(--ink); padding: .35em .85em; border-radius: 99px; background: var(--inset); border: 1px solid var(--line); }
.chief-status .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.chief[data-status="planning"] .pulse, .chief[data-status="final"] .pulse, .chief[data-status="running"] .pulse { background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: blink 1s ease-in-out infinite; }
.chief[data-status="done"] .pulse { background: var(--ok); }
.chief[data-status="error"] .pulse { background: var(--bad); }
.chief .calls { margin: 0 0 8px; font: 500 12px/1.4 var(--mono); color: var(--muted); }
@keyframes blink { 50% { opacity: .35; } }

.agent { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 7px; min-width: 0; padding: 13px 14px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; transition: border-color var(--normal) var(--ease), box-shadow var(--normal) var(--ease), opacity var(--normal) var(--ease), background var(--normal) var(--ease); }
.agent::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, transparent, var(--ag), transparent); opacity: .35; }
.agent .scan { position: absolute; top: 0; left: -40%; width: 40%; height: 2px; background: linear-gradient(90deg, transparent, #fff, transparent); opacity: 0; }
.agent[data-status="working"] { border-color: color-mix(in srgb, var(--ag) 65%, transparent); box-shadow: var(--glow); background: linear-gradient(180deg, color-mix(in srgb, var(--ag) 9%, var(--card)), var(--card) 60%); }
.agent[data-status="working"] .scan { opacity: .9; animation: scan 1.6s var(--ease) infinite; }
.agent[data-status="working"]::before { opacity: 1; }
.agent[data-status="done"] { border-color: color-mix(in srgb, var(--ag) 32%, transparent); }
.agent[data-status="done"]::before { opacity: .8; }
.agent[data-status="error"] { border-color: rgba(255, 154, 143, .55); }
.agent[data-status="off"] { opacity: .5; filter: saturate(.3); }
.agent[data-status="unused"] { opacity: .72; }
@keyframes scan { to { left: 100%; } }
.agent-head { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.agent-ico { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; color: var(--ag); background: color-mix(in srgb, var(--ag) 14%, transparent); border: 1px solid color-mix(in srgb, var(--ag) 30%, transparent); }
.agent-ico svg { width: 20px; height: 20px; }
.agent[data-status="working"] .agent-ico { animation: breathe 1.4s var(--ease) infinite; }
.agent-title { min-width: 0; }
.agent-title h3 { font-size: 15px; margin: 1px 0 2px; overflow-wrap: anywhere; }
.agent-title .job { margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.agent-status { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; }
.agent-status .state { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); font-weight: 600; padding: .25em .7em .25em .55em; border-radius: 99px; background: var(--inset); border: 1px solid var(--line); }
.led { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.agent[data-status="planned"] .led { background: transparent; border: 1.5px solid var(--ag); }
.agent[data-status="working"] .led { background: var(--ag); box-shadow: 0 0 10px var(--ag); animation: blink .9s ease-in-out infinite; }
.agent[data-status="done"] .led { background: var(--ok); }
.agent[data-status="error"] .led { background: var(--bad); }
.agent[data-status="working"] .state { border-color: color-mix(in srgb, var(--ag) 50%, transparent); }
.stepno { font: 500 11px/1 var(--mono); color: var(--muted); padding: .35em .5em; border-radius: 6px; border: 1px solid var(--line); }
.agent-status .time { margin-left: auto; font: 500 11px/1 var(--mono); color: var(--muted); }
.deliv { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--text); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.deliv span { color: var(--muted); font-weight: 600; margin-right: 3px; }
.deliv.empty { min-height: 0; display: none; }
.preview { position: relative; display: block; width: 100%; text-align: left; font-size: 13px; line-height: 1.45; color: var(--ink); background: var(--inset); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px 22px; min-height: calc(3 * 1.45em + 32px); }
button.preview { cursor: pointer; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0; }
button.preview:hover { border-color: color-mix(in srgb, var(--ag) 45%, transparent); background: color-mix(in srgb, var(--ag) 6%, var(--inset)); }
.preview .clamp { margin: 0; overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.read-hint { position: absolute; right: 10px; bottom: 5px; font-size: 12px; font-weight: 600; color: var(--accent); }
.agent-tools { display: flex; align-items: center; gap: 4px; }
.agent-tools .edit { width: 30px; height: 30px; border-color: transparent; color: var(--muted); }
.agent-tools .edit svg { width: 16px; height: 16px; }
.agent-tools .edit:hover:not(:disabled) { color: var(--ink); }
.preview.muted { color: var(--muted); }
.preview.working { display: flex; align-items: center; }
.agent-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }

.switch { position: relative; display: inline-flex; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span { width: 34px; height: 20px; border-radius: 99px; background: rgba(147, 174, 180, .22); border: 1px solid var(--line); position: relative; transition: background var(--fast) var(--ease); }
.switch span::after { content: ""; position: absolute; width: 14px; height: 14px; top: 2px; left: 2px; border-radius: 50%; background: var(--muted); transition: transform var(--fast) var(--ease), background var(--fast) var(--ease); }
.switch input:checked + span { background: color-mix(in srgb, var(--ag) 40%, transparent); border-color: color-mix(in srgb, var(--ag) 60%, transparent); }
.switch input:checked + span::after { transform: translateX(14px); background: #fff; }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled { cursor: default; }
.switch input:disabled + span { opacity: .55; }

/* wide map: three cards left, the chief in the middle, three cards right */
@container map (min-width: 820px) {
  .map { --wires: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 236px) minmax(0, 1fr); grid-template-rows: repeat(3, auto); column-gap: 64px; row-gap: 12px; padding: 0; }
  .chief { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
  .chief-text { background: rgba(9, 23, 27, 0.9); border: 1px solid var(--line); border-radius: 18px; padding: 14px 14px 12px; box-shadow: var(--shadow); }
  .agent[data-slot="0"] { grid-column: 1; grid-row: 1; }
  .agent[data-slot="1"] { grid-column: 1; grid-row: 2; }
  .agent[data-slot="2"] { grid-column: 1; grid-row: 3; }
  .agent[data-slot="3"] { grid-column: 3; grid-row: 1; }
  .agent[data-slot="4"] { grid-column: 3; grid-row: 2; }
  .agent[data-slot="5"] { grid-column: 3; grid-row: 3; }
}
/* narrow map: the chief inside a hexagon of its six specialists, cards below */
@container map (max-width: 819.98px) {
  .map { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .chief { grid-column: 1 / -1; padding: 6px 0 10px; }
  .orbit { width: min(100%, 440px); aspect-ratio: 10 / 9; }
  .orbit .core { width: 31%; }
  .orbit-lines { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
  .orbit-lines line { stroke: var(--line-strong); stroke-width: .35; vector-effect: non-scaling-stroke; stroke-width: 1.2; }
  .orbit-lines line[data-status="planned"] { stroke: color-mix(in srgb, var(--ag) 50%, transparent); stroke-dasharray: 3 5; }
  .orbit-lines line[data-status="working"] { stroke: var(--ag); stroke-width: 2.2; stroke-dasharray: 8 10; animation: flowline 0.9s linear infinite; filter: drop-shadow(0 0 4px var(--ag)); }
  .orbit-lines line[data-status="done"] { stroke: color-mix(in srgb, var(--ag) 70%, transparent); stroke-width: 1.6; }
  .orbit-lines line[data-status="off"], .orbit-lines line[data-status="unused"] { stroke: rgba(120, 200, 210, .08); }
  .node { display: flex; flex-direction: column; align-items: center; gap: 6px; position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); width: 25%; }
  .node-ico { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: var(--ag); background: color-mix(in srgb, var(--ag) 12%, #0b1c20); border: 1.5px solid color-mix(in srgb, var(--ag) 35%, transparent); transition: box-shadow var(--normal) var(--ease), border-color var(--normal) var(--ease), transform var(--normal) var(--ease); }
  .node-ico svg { width: 22px; height: 22px; }
  .node-name { font-size: 11.5px; font-weight: 600; color: var(--ink); text-align: center; line-height: 1.2; max-width: 100%; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .node[data-status="working"] .node-ico { border-color: var(--ag); box-shadow: 0 0 0 5px color-mix(in srgb, var(--ag) 18%, transparent), 0 0 26px var(--ag); transform: scale(1.08); }
  .node[data-status="done"] .node-ico { border-color: color-mix(in srgb, var(--ag) 80%, transparent); background: color-mix(in srgb, var(--ag) 24%, #0b1c20); }
  .node[data-status="done"] .node-ico::after { content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%; background: var(--ok); border: 2px solid var(--page); transform: translate(18px, -18px); }
  .node[data-status="off"], .node[data-status="unused"] { opacity: .45; }
  .chief-text { max-width: 460px; margin-top: 4px; }
}
@container map (max-width: 560px) {
  .map { grid-template-columns: minmax(0, 1fr); }
  .node-ico { width: 48px; height: 48px; }
  .node-ico svg { width: 20px; height: 20px; }
}
@keyframes flowline { to { stroke-dashoffset: -18; } }

/* ---------- result */
.result { padding: 22px; }
.result-head { align-items: flex-start; flex-wrap: wrap; }
.result-head h2 { font-size: 18px; }
.result .meta { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.result .meta.by { margin-top: 2px; }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.result-body { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 28px; margin-top: 12px; }
.who h3 { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 6px 0 10px; }
.who ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.who li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--inset); border: 1px solid var(--line); }
.who .ico { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; color: var(--ag); background: color-mix(in srgb, var(--ag) 14%, transparent); }
.who .ico svg { width: 15px; height: 15px; }
.who strong { display: block; font-size: 13px; color: var(--ink); overflow-wrap: anywhere; }
.who span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who div { min-width: 0; }
#result:focus { outline: none; }
#result, .map-wrap, .composer { scroll-margin-top: 76px; }
#result:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- markdown */
.md { color: var(--text); font-size: 15px; line-height: 1.62; max-width: 76ch; }
.md > * { transition: opacity .4s var(--ease), transform .4s var(--ease); }
.md > .pending { opacity: 0; transform: translateY(8px); }
.md h2 { font-size: 22px; margin: 0 0 .6em; letter-spacing: -.01em; }
.md h3 { font-size: 16px; margin: 1.4em 0 .5em; color: var(--ink); }
.md h4, .md h5 { font-size: 14px; margin: 1.2em 0 .4em; color: var(--ink); }
.md p { margin: 0 0 .8em; }
.md strong { color: var(--ink); font-weight: 650; }
.md em { color: var(--ink); }
.md ul, .md ol { margin: 0 0 .9em; padding-left: 1.3em; }
.md li { margin: .2em 0; }
.md li::marker { color: var(--accent); }
.md blockquote { margin: 0 0 .9em; padding: 8px 14px; border-left: 3px solid #f3d9a4; background: rgba(243, 217, 164, .05); border-radius: 0 12px 12px 0; color: var(--text); }
.md blockquote p { margin: 0; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1.2em 0; }
.md code { font: 13px var(--mono); background: var(--inset); padding: .1em .35em; border-radius: 6px; }
.md pre { background: var(--inset); padding: 12px; border-radius: 12px; overflow: auto; }
.md a { color: var(--accent); }
.md-table { overflow-x: auto; margin: 0 0 1em; border: 1px solid var(--line); border-radius: 12px; }
.md table { border-collapse: collapse; width: 100%; font-size: 14px; }
.md th, .md td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.md th { color: var(--ink); font-weight: 600; background: rgba(95, 196, 207, .06); font-size: 13px; }
.md tr:last-child td { border-bottom: 0; }
.result-md.empty { color: var(--muted); }

/* ---------- dialogs */
dialog { color: var(--text); background: transparent; border: 0; padding: 0; max-width: none; max-height: none; }
dialog::backdrop { background: rgba(2, 8, 10, .62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.sheet { margin: 0 0 0 auto; height: 100dvh; width: min(460px, 100vw); }
.sheet-inner { height: 100%; overflow-y: auto; padding: 20px 22px 28px; background: #0b1b1f; border-left: 1px solid var(--line-strong); box-shadow: -30px 0 80px -30px rgba(0, 0, 0, .8); }
.sheet[open] .sheet-inner { animation: slidein var(--normal) var(--ease); }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.sheet-head h2 { font-size: 18px; min-width: 0; overflow-wrap: anywhere; }
/* the role editor's title wraps as one sentence ("Edit role · Executive Assistant") */
#role-h { display: block; }
.head-actions { display: flex; align-items: center; gap: 8px; }
.group { border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin: 14px 0 0; background: rgba(255, 255, 255, .015); }
.group legend { padding: 0 6px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; background: var(--inset); border: 1px solid var(--line); border-radius: 999px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: block; text-align: center; padding: .45em .8em; border-radius: 999px; font-size: 14px; color: var(--text); }
.seg input:checked + span { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); margin-top: 8px; cursor: pointer; background: var(--inset); }
.choice input { width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--accent); }
.choice strong { display: block; color: var(--ink); font-size: 14px; }
.choice small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.45; margin-top: 2px; }
.choice:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: rgba(95, 196, 207, .07); }
.choice:has(input:disabled) { cursor: default; opacity: .7; }
.sub { margin-top: 6px; padding: 2px 2px 0; }
.with-btn { display: flex; gap: 8px; }
.with-btn input { flex: 1; }
.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.btn-grid button { font-size: 14px; }
.restore { margin-top: 6px; }
.restore select { flex: 1; min-width: 0; }
.history-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.history-list .empty { color: var(--muted); padding: 18px; border: 1px dashed var(--line); border-radius: 14px; text-align: center; }
.h-item { border: 1px solid var(--line); border-radius: 16px; background: var(--inset); overflow: hidden; }
.h-item.current { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.h-open { display: block; width: 100%; text-align: left; border: 0; border-radius: 0; background: transparent; padding: 12px 14px 6px; }
.h-open:hover:not(:disabled) { background: var(--hover); }
.h-task { overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; color: var(--ink); font-size: 14px; line-height: 1.45; }
.h-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 8px; font-size: 12px; color: var(--muted); }
.h-st { color: var(--text); }
.h-item[data-status="done"] .h-st { color: var(--ok); }
.h-cur { color: var(--accent); }
.h-actions { display: flex; justify-content: space-between; gap: 8px; padding: 4px 10px 10px; }
.h-removed { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-style: dashed; color: var(--muted); font-size: 14px; }
.data-confirm { margin-top: 12px; padding: 12px; border-radius: 14px; background: rgba(243, 217, 164, .07); border: 1px solid rgba(243, 217, 164, .3); color: var(--ink); font-size: 14px; }
.data-confirm p { margin: 0; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.modal { margin: auto; width: min(600px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); }
.modal.wide { width: min(820px, calc(100vw - 24px)); }
.modal-inner { max-height: calc(100dvh - 24px); overflow-y: auto; padding: 20px 22px 22px; background: #0b1b1f; border: 1px solid var(--line-strong); border-radius: 22px; box-shadow: 0 30px 90px -30px rgba(0, 0, 0, .9); border-top: 2px solid var(--ag, var(--accent)); }
.modal[open] .modal-inner { animation: popin var(--normal) var(--ease); }
@keyframes popin { from { transform: translateY(10px) scale(.985); opacity: 0; } }
.modal-actions { display: flex; align-items: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.spacer { flex: 1; }
.check { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 14px; color: var(--ink); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.asked { margin: 0 0 14px; font-size: 13px; color: var(--text); padding: 10px 12px; border-radius: 12px; background: var(--inset); border: 1px solid var(--line); }
.asked span { color: var(--muted); font-weight: 600; margin-right: 4px; }
#reader .md { max-width: none; }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 14px; background: #10272c; border: 1px solid var(--line-strong); color: var(--ink); font-size: 14px; box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .8); max-width: calc(100vw - 32px); }
.toast[hidden] { display: none; }

/* ---------- busy state */


/* ---------- responsive */
@media (max-width: 1180px) {
  body.command { --content: 924px; }
  main { grid-template-columns: minmax(0, 1fr); max-width: 980px; }
  .foot { max-width: 980px; }
  .col-a, .col-b { display: contents; }
  .composer { order: 1; }
  .board-card { order: 2; }
  .map-wrap { order: 3; }
  .plan-card { order: 4; }
  .result { order: 5; }
  .board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  body.command { --edge: 14px; }
  .top { padding: 10px 14px; gap: 8px; }
  .mode-pill .mode-long { display: none; }
  .mode-pill .mode-short { display: inline; }
  .top-actions { gap: 2px; }
  .top-actions .ghost span:not(.short) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .top-actions .ghost { padding: .5em .6em; }
  .lang .short { display: inline; font-weight: 600; font-size: 13px; }
  .brand-name { font-size: 15px; }
  .banner { margin: 12px var(--edge) 0; }
  main { padding: 14px 14px 24px; gap: 14px; }
  .card { padding: 16px; border-radius: 18px; }
  .board { grid-template-columns: minmax(0, 1fr); }
  .result-body { grid-template-columns: minmax(0, 1fr); }
  .result { padding: 16px; }
  .md h2 { font-size: 19px; }
  .foot { padding: 14px 14px 28px; }
  .composer-actions { width: 100%; }
  .composer-actions .run { flex: 1; }
}
@media (max-width: 420px) {
  .brand .mark { width: 26px; height: 26px; }
  .brand-name .b1 { display: none; }
  .top { padding: 10px 10px; }
  .mode-pill .mode-k { display: none; }
  .btn-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .md > .pending { opacity: 1; transform: none; }
}
