/* =========================================================================
   ATLAS POC - application shell
   Layered on top of styles.css, which supplies the reset, the token set,
   the type scale, buttons, tags, tables and code blocks. This file adds
   only what a dense product surface needs.
   ========================================================================= */

body.app {
  min-height: 100dvh;
  font-size: 15px;
}
body.app::after { opacity: .022; }

/* ---------- shell ---------- */
.shell {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  min-height: 100dvh;
}

/* ---------- sidebar ---------- */
.side {
  position: sticky; top: 0; align-self: start;
  height: 100dvh;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--bg-2);
  overflow-y: auto;
}
.side__head { padding: 1.1rem 1.15rem; border-bottom: 1px solid var(--line); }
.side__sys { margin-top: .9rem; }
.side__sysname { font-size: .84rem; font-weight: 500; color: var(--text); line-height: 1.3; }
.side__sysmeta { font-family: var(--mono); font-size: .66rem; color: var(--text-3); margin-top: .3rem; letter-spacing: .04em; }

.side__nav { padding: .9rem .7rem; flex: 1; }
.side__group { font-family: var(--mono); font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); padding: .9rem .55rem .5rem; }
.side__link {
  display: flex; align-items: center; gap: .65rem;
  padding: .5rem .55rem;
  border-radius: var(--r-control);
  text-decoration: none;
  color: var(--text-2);
  font-size: .88rem;
  transition: color .15s var(--ease), background-color .15s var(--ease);
}
.side__link i { font-size: 1.05rem; opacity: .8; }
.side__link:hover { color: var(--text); background: var(--bg-3); }
.side__link.is-active { color: var(--text); background: var(--bg-3); }
.side__link.is-active i { color: var(--accent); opacity: 1; }
.side__count {
  margin-left: auto;
  font-family: var(--mono); font-size: .66rem;
  padding: .1rem .38rem; border-radius: var(--r-tag);
  background: var(--bg); border: 1px solid var(--line); color: var(--text-3);
}
.side__count[data-alert="true"] { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }

.side__foot { padding: .9rem 1.15rem 1.1rem; border-top: 1px solid var(--line); display: grid; gap: .6rem; }

/* ---------- topbar ---------- */
.top {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 1rem;
  height: 58px; padding: 0 1.5rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
}
@media (prefers-reduced-transparency: reduce) { .top { background: var(--bg); backdrop-filter: none; } }
.top__crumb { font-size: .9rem; color: var(--text); font-weight: 500; }
.top__sub { font-size: .82rem; color: var(--text-3); }
.top__actions { margin-left: auto; display: flex; align-items: center; gap: .55rem; }
.top__burger { display: none; }

/* ---------- view ---------- */
.view { padding: 1.75rem 1.5rem 4rem; max-width: 1500px; }
.view__head { display: flex; align-items: flex-start; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.view__title { font-size: 1.5rem; font-weight: 500; letter-spacing: -0.02em; }
.view__lede { margin-top: .45rem; font-size: .92rem; color: var(--text-2); max-width: 74ch; }
.view__side { margin-left: auto; display: flex; gap: .5rem; align-items: center; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.split { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; }

/* ---------- panel ---------- */
.panel {
  border: 1px solid var(--line);
  border-radius: var(--r-surface);
  background: var(--bg-2);
  overflow: hidden;
}
.panel__h {
  display: flex; align-items: center; gap: .75rem;
  padding: .8rem 1.05rem;
  border-bottom: 1px solid var(--line);
}
.panel__t { font-size: .84rem; font-weight: 500; color: var(--text); }
.panel__meta { margin-left: auto; font-family: var(--mono); font-size: .68rem; color: var(--text-3); letter-spacing: .06em; }
.panel__b { padding: 1.05rem; }
.panel__b--flush { padding: 0; }
.panel__f { padding: .8rem 1.05rem; border-top: 1px solid var(--line); font-size: .82rem; color: var(--text-3); }

/* ---------- metric ---------- */
.metric { padding: 1.05rem 1.15rem; }
.metric__l { font-family: var(--mono); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.metric__v { font-size: 1.9rem; letter-spacing: -0.03em; margin-top: .5rem; line-height: 1; font-weight: 400; }
.metric__v[data-tone="alert"] { color: var(--sig-blocked); }
.metric__v[data-tone="accent"] { color: var(--accent); }
.metric__v[data-tone="clear"] { color: var(--sig-clear); }
.metric__n { margin-top: .5rem; font-size: .8rem; color: var(--text-3); }

/* ---------- rows ---------- */
.rows { display: grid; }
.row {
  display: grid; align-items: center; gap: 1rem;
  padding: .8rem 1.05rem;
  border-top: 1px solid var(--line);
  text-decoration: none;
  transition: background-color .15s var(--ease);
}
.rows > .row:first-child { border-top: 0; }
a.row:hover, button.row:hover { background: var(--bg-3); }
button.row { width: 100%; text-align: left; border-left: 0; border-right: 0; border-bottom: 0; background: none; cursor: pointer; font: inherit; color: inherit; }
.row__t { display: block; font-size: .89rem; color: var(--text); }
.row__s { display: block; font-size: .8rem; color: var(--text-3); margin-top: .18rem; }
.row__r { text-align: right; font-family: var(--mono); font-size: .74rem; color: var(--text-3); white-space: nowrap; }

/* depth meter */
.meter { display: grid; grid-template-columns: 68px 1fr 42px; gap: .6rem; align-items: center; }
.meter + .meter { margin-top: .55rem; }
.meter__l { font-family: var(--mono); font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.meter__t { display: block; width: 100%; height: 6px; border-radius: 3px; background: var(--bg-inset); border: 1px solid var(--line); overflow: hidden; }
.meter__f { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.meter__f[data-low="true"] { background: var(--sig-blocked); }
.meter__v { font-family: var(--mono); font-size: .7rem; color: var(--text-2); text-align: right; }

/* ---------- board ---------- */
.board-app { display: grid; grid-template-columns: repeat(5, minmax(210px, 1fr)); gap: 12px; align-items: start; }
.bcol { border: 1px solid var(--line); border-radius: var(--r-surface); background: var(--bg-2); min-height: 180px; }
.bcol__h { padding: .75rem .85rem; border-bottom: 1px solid var(--line); }
.bcol__n { display: flex; align-items: baseline; gap: .5rem; }
.bcol__name { font-size: .84rem; font-weight: 500; }
.bcol__c { font-family: var(--mono); font-size: .72rem; color: var(--text-3); margin-left: auto; }
.bcol__gate { margin-top: .5rem; font-size: .7rem; color: var(--text-3); line-height: 1.45; }
.bcol__gate b { color: var(--accent); font-weight: 500; font-family: var(--mono); font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; display: block; margin-bottom: .2rem; }
.bcol__b { padding: .6rem; display: grid; gap: .6rem; }

.card {
  display: block; width: 100%; text-align: left;
  border: 1px solid var(--line); border-radius: var(--r-control);
  background: var(--bg); padding: .7rem .75rem;
  cursor: pointer; font: inherit; color: inherit;
  transition: border-color .15s var(--ease), transform .12s var(--ease);
}
.card:hover { border-color: var(--line-strong); }
.card:active { transform: scale(.99); }
.card[data-blocked="true"] { border-left: 2px solid var(--sig-blocked); }
.card__id { display: block; font-family: var(--mono); font-size: .68rem; color: var(--text-3); }
.card__t { display: block; font-size: .83rem; color: var(--text); margin-top: .3rem; line-height: 1.35; }
.card__f { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .55rem; align-items: center; }

.mini {
  font-family: var(--mono); font-size: .6rem; letter-spacing: .08em; text-transform: uppercase;
  padding: .16rem .4rem; border-radius: 3px;
  border: 1px solid var(--line); color: var(--text-3); background: var(--bg-2);
}
.mini--blocked { color: var(--sig-blocked); border-color: color-mix(in srgb, var(--sig-blocked) 40%, transparent); background: color-mix(in srgb, var(--sig-blocked) 10%, transparent); }
.mini--clear { color: var(--sig-clear); border-color: color-mix(in srgb, var(--sig-clear) 40%, transparent); background: color-mix(in srgb, var(--sig-clear) 10%, transparent); }
.mini--accent { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }

/* ---------- refusal / notice ---------- */
.notice {
  border: 1px solid var(--line); border-left: 2px solid var(--accent);
  border-radius: 0 var(--r-control) var(--r-control) 0;
  padding: .9rem 1.05rem; background: var(--bg-2);
  font-size: .87rem; color: var(--text-2);
}
.notice b { color: var(--text); font-weight: 500; }
.notice--stop { border-left-color: var(--sig-blocked); }
.notice--ok { border-left-color: var(--sig-clear); }

/* ---------- key value list ---------- */
.kvlist { display: grid; }
.kvrow { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 1rem; padding: .62rem 0; border-top: 1px solid var(--line); font-size: .85rem; }
.kvlist > .kvrow:first-child { border-top: 0; padding-top: 0; }
.kvrow dt { font-family: var(--mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); padding-top: .18rem; }
.kvrow dd { margin: 0; color: var(--text-2); }
.kvrow dd .mono { color: var(--text); }

/* ---------- option buttons (questions, decisions) ---------- */
.opts { display: grid; gap: .5rem; }
.opt {
  display: flex; align-items: flex-start; gap: .8rem;
  width: 100%; text-align: left;
  padding: .8rem .95rem;
  border: 1px solid var(--line); border-radius: var(--r-control);
  background: var(--bg); color: var(--text); font: inherit; font-size: .88rem;
  cursor: pointer;
  transition: border-color .15s var(--ease), background-color .15s var(--ease);
}
.opt:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.opt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.opt__k { font-family: var(--mono); font-size: .68rem; color: var(--text-3); padding-top: .15rem; flex-shrink: 0; }
.opt__n { display: block; color: var(--text-3); font-size: .78rem; margin-top: .2rem; }
.opt__rec { margin-left: auto; flex-shrink: 0; }

/* ---------- run log ---------- */
.log { font-family: var(--mono); font-size: .76rem; line-height: 1.7; }
.logline { display: grid; grid-template-columns: 52px 1fr; gap: .9rem; padding: .3rem 0; color: var(--text-2); }
.logline span:first-child { color: var(--text-3); }
.logline[data-kind="violation"] { color: var(--accent); }
.logline[data-kind="blocked"] { color: var(--sig-blocked); }

/* ---------- toast ---------- */
.toasts { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 120; display: grid; gap: .6rem; max-width: 380px; }
.toast {
  border: 1px solid var(--accent-line); border-radius: var(--r-control);
  background: var(--bg-2); box-shadow: var(--shadow);
  padding: .8rem 1rem; font-size: .85rem; color: var(--text);
  animation: toast-in .35s var(--ease);
}
.toast b { display: block; font-weight: 500; margin-bottom: .2rem; }
.toast span { color: var(--text-2); font-size: .82rem; }
.toast[data-kind="stop"] { border-color: color-mix(in srgb, var(--sig-blocked) 50%, transparent); }
.toast[data-kind="ok"] { border-color: color-mix(in srgb, var(--sig-clear) 50%, transparent); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* ---------- modal ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 110;
  background: color-mix(in srgb, var(--bg-inset) 78%, transparent);
  backdrop-filter: blur(3px);
  display: grid; place-items: center;
  padding: 1.5rem;
}
.modal {
  width: min(560px, 100%);
  border: 1px solid var(--line-strong); border-radius: var(--r-surface);
  background: var(--bg-2); box-shadow: var(--shadow);
  max-height: 86dvh; overflow-y: auto;
}
.modal__h { padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--line); }
.modal__t { font-size: 1.02rem; font-weight: 500; letter-spacing: -0.015em; }
.modal__b { padding: 1.25rem; display: grid; gap: 1rem; }
.modal__f { padding: 1rem 1.25rem; border-top: 1px solid var(--line); display: flex; gap: .6rem; justify-content: flex-end; }

/* ---------- empty ---------- */
.empty { padding: 3rem 1.5rem; text-align: center; }
.empty i { font-size: 1.7rem; color: var(--text-3); }
.empty p { margin-top: .8rem; font-size: .88rem; color: var(--text-3); }

/* ---------- lineage ---------- */
.lineage { display: grid; gap: .35rem; font-family: var(--mono); font-size: .75rem; }
.lineage div { display: flex; gap: .6rem; align-items: center; color: var(--text-2); }
.lineage b { color: var(--text); font-weight: 400; }
.lineage em { color: var(--text-3); font-style: normal; margin-left: auto; }

/* =========================================================================
   PROJECT SELECTION
   The platform is multi-system, so selection is the entry point.
   ========================================================================= */
body.is-bare .side, body.is-bare .top { display: none; }
body.is-bare .shell { grid-template-columns: 1fr; }
body.is-bare .view { padding: 0; max-width: none; }

.pick { max-width: 1180px; margin-inline: auto; padding: clamp(2.5rem, 7vw, 5rem) clamp(1.25rem, 4vw, 2.5rem) 4rem; }
.pick__head { max-width: 62ch; }
.pick__t { font-size: clamp(1.9rem, 4vw, 2.9rem); font-weight: 500; letter-spacing: -0.03em; margin-top: 2.2rem; }
.pick__l { margin-top: .9rem; font-size: 1rem; color: var(--text-2); line-height: 1.55; }
.pick__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 2.5rem; }
.pick__foot { margin-top: 2rem; font-size: .82rem; color: var(--text-3); }

.proj {
  display: block; width: 100%; text-align: left;
  border: 1px solid var(--line); border-radius: var(--r-surface);
  background: var(--bg-2); padding: 1.35rem 1.4rem 1.15rem;
  font: inherit; color: inherit; cursor: pointer;
  transition: border-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}
.proj:hover { border-color: var(--accent-line); transform: translateY(-2px); box-shadow: var(--shadow); }
.proj--wait { cursor: default; background: var(--bg); }
.proj--wait:hover { transform: none; border-color: var(--line); box-shadow: none; }
.proj__top { display: flex; gap: .4rem; flex-wrap: wrap; }
.proj__n { font-size: 1.15rem; font-weight: 500; letter-spacing: -0.02em; margin-top: 1rem; }
.proj__s { margin-top: .4rem; font-size: .85rem; color: var(--text-3); line-height: 1.5; }
.proj__m { display: flex; flex-wrap: wrap; gap: 1.35rem; margin-top: 1.15rem; }
.proj__m span { display: grid; font-size: .74rem; color: var(--text-3); }
.proj__m b { font-family: var(--mono); font-size: 1.05rem; font-weight: 400; color: var(--text); }
.proj__bar { margin-top: 1.3rem; height: 5px; border-radius: 3px; background: var(--bg-3); overflow: hidden; }
.proj__bar span { display: block; height: 100%; background: var(--accent); opacity: .55; }
.proj__pctl { margin-top: .45rem; font-family: var(--mono); font-size: .7rem; color: var(--text-3); }
.proj__note { margin-top: 1.05rem; font-size: .84rem; color: var(--text-2); line-height: 1.6; }
.proj__foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.3rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.proj__go { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; font-weight: 500; color: var(--accent); }

/* switcher in the sidebar head */
.side__sys {
  display: grid; gap: .18rem; width: 100%; text-align: left;
  margin-top: .9rem; padding: .5rem .55rem; border-radius: var(--r-control);
  background: none; border: 1px solid transparent; cursor: pointer; font: inherit;
  transition: background-color .15s var(--ease), border-color .15s var(--ease);
}
.side__sys:hover { background: var(--bg-3); border-color: var(--line); }
.side__switch { font-size: .7rem; color: var(--text-3); display: flex; align-items: center; gap: .25rem; margin-top: .25rem; }

/* =========================================================================
   DATABASE REALITY
   ========================================================================= */
.tbl { border-top: 1px solid var(--line); }
.rows > .tbl:first-child, .panel__b--flush > .tbl:first-child { border-top: 0; }
.tbl__h { display: flex; align-items: center; gap: .6rem; padding: .9rem 1.05rem .5rem; flex-wrap: wrap; }
.tbl__n { font-size: .88rem; color: var(--text); }
.tbl__h .row__r { margin-left: auto; }
.tbl__note { padding: 0 1.05rem .8rem; font-size: .82rem; color: var(--text-2); max-width: 90ch; }

/* =========================================================================
   EXPORT TABS
   ========================================================================= */
.xtabs { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.xtab {
  padding: .55rem .85rem; background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--text-3); font: inherit; font-size: .78rem; cursor: pointer; white-space: nowrap;
}
.xtab:hover { color: var(--text); }
.xtab.is-on { color: var(--text); border-bottom-color: var(--accent); }

/* =========================================================================
   GUIDED (NO CODE) MODE
   ========================================================================= */
.guide { padding: clamp(1.25rem, 3vw, 2rem); max-width: 860px; }
.guide__t { font-size: 1.15rem; font-weight: 500; letter-spacing: -0.02em; }
.guide__l { margin-top: .45rem; font-size: .85rem; color: var(--text-3); }
.guide__goal { margin-top: 1.4rem; }
.guide__goal textarea { font-size: .9rem; }
.guide__plan { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; gap: 1px; border: 1px solid var(--line); border-radius: var(--r-surface); overflow: hidden; background: var(--line); }
.gstep { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: .8rem; align-items: center; padding: .8rem 1rem; background: var(--bg-2); }
.gstep__i {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: .68rem;
  border: 1px solid var(--line-strong); color: var(--text-3);
}
.gstep__t { font-size: .88rem; color: var(--text-2); }
.gstep__s { font-family: var(--mono); font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.gstep[data-state="done"] .gstep__i { background: var(--sig-clear); border-color: var(--sig-clear); color: #fff; }
.gstep[data-state="done"] .gstep__t { color: var(--text); }
.gstep[data-state="run"] .gstep__i,
.gstep[data-state="next"] .gstep__i { border-color: var(--accent); color: var(--accent); }
.gstep[data-state="run"] .gstep__t,
.gstep[data-state="next"] .gstep__t { color: var(--text); }
.gstep[data-state="ask"] { background: var(--accent-soft); }
.gstep[data-state="ask"] .gstep__i { border-color: var(--accent); background: var(--accent); color: #fff; }
.gstep[data-state="ask"] .gstep__t { color: var(--text); }
.gstep[data-state="ask"] .gstep__s { color: var(--accent); }
.guide__diff { margin-top: 1.6rem; border: 1px solid var(--line); border-radius: var(--r-surface); overflow: hidden; }
.guide__dh { padding: .6rem .9rem; border-bottom: 1px solid var(--line); background: var(--bg-2); font-size: .8rem; color: var(--text); }
.guide__ctl { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; margin-top: 1.6rem; }

@media (max-width: 820px) { .pick__grid { grid-template-columns: 1fr; } }

/* =========================================================================
   BOARD DRAG STATE
   ========================================================================= */
.card[draggable] { cursor: grab; }
.card.is-dragging { opacity: .45; cursor: grabbing; }
.bcol.is-over { border-color: var(--accent-line); background: color-mix(in srgb, var(--accent) 6%, var(--bg-2)); }

/* =========================================================================
   CLOUD WORKSPACE
   The editor chrome is deliberately conventional. The parts that are not
   conventional are the task context rail and the agent column.
   ========================================================================= */
body.is-workspace .view { padding: 0; max-width: none; }

.ws {
  display: grid;
  grid-template-columns: 48px 250px minmax(0, 1fr) 360px;
  grid-template-rows: minmax(0, 1fr) 26px;
  grid-template-areas: "act fs main agent" "status status status status";
  height: calc(100dvh - 58px);
  background: var(--bg);
  font-size: 13px;
}

/* activity bar */
.ws__act {
  grid-area: act;
  border-right: 1px solid var(--line);
  background: var(--bg-2);
  display: flex; flex-direction: column; align-items: center;
  padding-top: .5rem; gap: .15rem;
}
.ws__ic {
  width: 40px; height: 40px; display: grid; place-items: center;
  color: var(--text-3); text-decoration: none; border-radius: var(--r-control);
  border-left: 2px solid transparent;
  transition: color .15s var(--ease);
}
.ws__ic i { font-size: 1.2rem; }
.ws__ic:hover { color: var(--text); }
.ws__ic.is-on { color: var(--accent); }

/* explorer */
.ws__fs { grid-area: fs; border-right: 1px solid var(--line); background: var(--bg-2); overflow-y: auto; }
.ws__fsh {
  padding: .7rem .85rem .5rem;
  font-family: var(--mono); font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3);
}
/* open sessions: the workspace is global, so this list is never empty
   just because you navigated somewhere else */
.sess { padding: 0 .35rem .6rem; display: grid; gap: 1px; }
.sess__i {
  display: flex; align-items: center; gap: .5rem;
  padding: .42rem .5rem; border-radius: var(--r-control);
  text-decoration: none; color: var(--text-2); font-size: .8rem;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.sess__i i { font-size: .95rem; opacity: .7; }
.sess__i span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sess__i:hover { background: var(--bg-3); color: var(--text); }
.sess__i.is-on { background: var(--bg-3); color: var(--text); }
.sess__i.is-on i { color: var(--accent); opacity: 1; }
.sess__i b {
  font-family: var(--mono); font-size: .58rem; font-weight: 400;
  color: var(--accent); border: 1px solid var(--accent-line);
  background: var(--accent-soft); border-radius: 3px; padding: 0 .22rem;
}
.sess__x {
  margin-left: auto; border: 0; background: none; cursor: pointer;
  color: var(--text-3); font-size: 1rem; line-height: 1; padding: 0 .15rem;
  opacity: 0; transition: opacity .15s var(--ease), color .15s var(--ease);
}
.sess__i:hover .sess__x, .sess__i.is-on .sess__x { opacity: 1; }
.sess__x:hover { color: var(--sig-blocked); }
.sess__i--new { color: var(--text-3); }
.sess__i--new:hover { color: var(--accent); }

.fs { padding: 0 .35rem .6rem; display: grid; gap: 1px; }
.fs__f {
  display: grid; grid-template-columns: auto 1fr; column-gap: .5rem;
  width: 100%; text-align: left; padding: .4rem .5rem;
  background: none; border: 0; border-radius: var(--r-control);
  color: var(--text-2); font: inherit; cursor: pointer;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.fs__f:hover { background: var(--bg-3); color: var(--text); }
.fs__f.is-open { background: var(--bg-3); color: var(--text); }
.fs__f i { font-size: .95rem; opacity: .7; grid-row: 1; }
.fs__n { font-size: .8rem; grid-row: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs__p { grid-column: 2; font-family: var(--mono); font-size: .62rem; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs__b {
  grid-column: 2; justify-self: start;
  font-family: var(--mono); font-size: .56rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-3); border: 1px solid var(--line); border-radius: 3px; padding: 0 .25rem; margin-top: .2rem;
}
.fs__b--out { color: var(--sig-blocked); border-color: color-mix(in srgb, var(--sig-blocked) 40%, transparent); }

.ctx { padding: .2rem .85rem 1rem; display: grid; gap: .55rem; }
.ctx__r { display: grid; gap: .1rem; }
.ctx__r span { font-family: var(--mono); font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.ctx__r b { font-weight: 400; font-size: .76rem; color: var(--text-2); word-break: break-word; }

/* main column */
.ws__main { grid-area: main; display: grid; grid-template-rows: 36px minmax(0, 1fr) 210px; min-width: 0; }
.ws__tabs { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.ws__tab {
  display: flex; align-items: center; gap: .45rem;
  padding: 0 .95rem; background: none; border: 0; border-right: 1px solid var(--line);
  color: var(--text-3); font: inherit; font-size: .78rem; cursor: pointer;
  border-top: 2px solid transparent;
}
.ws__tab.is-on { color: var(--text); background: var(--bg); border-top-color: var(--accent); }
.ws__tabsp { flex: 1; }
.ws__branch {
  display: flex; align-items: center; gap: .4rem; padding: 0 .95rem;
  font-family: var(--mono); font-size: .68rem; color: var(--text-3);
}

.ws__ed { overflow: auto; background: var(--bg); }

/* Editable buffer: a transparent textarea sits exactly on a highlighted
   layer. Both must share font, size, line-height and padding to the pixel. */
.edx {
  --edx-font: var(--mono);
  --edx-size: .76rem;
  --edx-lh: 1.75;
  display: grid; grid-template-columns: 52px minmax(0, 1fr);
  min-height: 100%;
}
.edx__g {
  font-family: var(--edx-font); font-size: var(--edx-size); line-height: var(--edx-lh);
  padding: .6rem .9rem .6rem 0;
  text-align: right; color: var(--text-3);
  background: var(--bg-2); border-right: 1px solid var(--line);
  user-select: none; overflow: hidden;
}
.edx__g div.is-marked { color: var(--accent); font-weight: 500; background: color-mix(in srgb, var(--accent) 12%, transparent); }
.edx__s { position: relative; min-width: 0; }
.edx__hl, .edx__in {
  font-family: var(--edx-font); font-size: var(--edx-size); line-height: var(--edx-lh);
  padding: .6rem 1rem;
  margin: 0; border: 0;
  white-space: pre; tab-size: 4;
  overflow: auto;
}
.edx__hl {
  position: absolute; inset: 0;
  pointer-events: none;
  color: var(--text-2);
}
.edx__in {
  position: relative;
  display: block; width: 100%; height: 100%; min-height: 260px;
  background: transparent;
  color: transparent;
  caret-color: var(--accent);
  resize: none; outline: none;
}
.edx__in::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); color: transparent; }

.ed__note {
  margin: .8rem 1rem 1rem 52px;
  border-left: 2px solid var(--accent); background: var(--bg-2);
  padding: .7rem .9rem; font-size: .78rem; color: var(--text-2); line-height: 1.6;
  border-radius: 0 var(--r-control) var(--r-control) 0;
}
.ed__g {
  display: inline-block; margin-left: .35rem;
  font-family: var(--mono); font-size: .6rem; letter-spacing: .1em;
  padding: .12rem .45rem; border-radius: 3px;
  border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--accent);
  cursor: pointer;
}
.ws__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); display: inline-block; margin-left: .1rem;
}
.ed__note {
  margin: .8rem 1rem 1rem 46px;
  border-left: 2px solid var(--accent); background: var(--bg-2);
  padding: .7rem .9rem; font-size: .78rem; color: var(--text-2); line-height: 1.6;
  border-radius: 0 var(--r-control) var(--r-control) 0;
}
.ed__note b { color: var(--text); font-weight: 500; }
.ed__note--out { border-left-color: var(--sig-blocked); }

.tk-k { color: var(--accent); }
.tk-s { color: var(--sig-clear); }
.tk-c { color: var(--text-3); font-style: italic; }
.tk-n { color: var(--text); }
.tk-a { color: var(--sig-blocked); }

/* diff */
.diff { font-family: var(--mono); font-size: .76rem; line-height: 1.75; padding: .6rem 0; }
.diff__h { padding: .5rem 1rem; color: var(--text); background: var(--bg-3); border-block: 1px solid var(--line); font-size: .72rem; }
.diff__r { padding: .2rem 1rem; color: var(--text-3); }
.diff__x { height: .8rem; }
.diff__l { display: grid; grid-template-columns: 26px minmax(0, 1fr); }
.diff__l span { text-align: center; opacity: .7; }
.diff__l code { white-space: pre; }
.diff__l--a { background: color-mix(in srgb, var(--sig-clear) 13%, transparent); color: var(--text); }
.diff__l--a span { color: var(--sig-clear); }
.diff__l--d { background: color-mix(in srgb, var(--sig-blocked) 13%, transparent); color: var(--text-2); }
.diff__l--d span { color: var(--sig-blocked); }

/* bottom panel */
.ws__panel { border-top: 1px solid var(--line); background: var(--bg-2); display: grid; grid-template-rows: 32px minmax(0, 1fr); }
.ws__ptabs { display: flex; border-bottom: 1px solid var(--line); }
.ws__ptab {
  padding: 0 .9rem; background: none; border: 0; color: var(--text-3);
  font: inherit; font-size: .72rem; letter-spacing: .04em; cursor: pointer;
  border-bottom: 2px solid transparent;
}
.ws__ptab.is-on { color: var(--text); border-bottom-color: var(--accent); }
.ws__pbody { overflow-y: auto; }

.term {
  font-family: var(--mono); font-size: .74rem; line-height: 1.7;
  padding: .7rem .9rem; color: var(--text-2);
  white-space: pre-wrap; word-break: break-word;
  background: var(--bg-inset); min-height: 100%;
  cursor: text;
}
.term__c { color: var(--accent); }
.term__e { color: var(--sig-blocked); }
.term__p { display: flex; gap: .5rem; align-items: baseline; margin-top: .2rem; }
.term__ps { color: var(--sig-clear); white-space: nowrap; }
.term__in {
  flex: 1; min-width: 0;
  background: transparent; border: 0; outline: none;
  font-family: var(--mono); font-size: .74rem; line-height: 1.7;
  color: var(--text); caret-color: var(--accent);
  padding: 0;
}

.tests { padding: .5rem 0; }
.tests__sum { display: flex; flex-wrap: wrap; gap: .35rem; padding: .3rem .9rem .6rem; }
.tests__r { display: flex; gap: .55rem; align-items: baseline; padding: .28rem .9rem; font-family: var(--mono); font-size: .72rem; color: var(--text-2); }
.tests__r i { color: var(--sig-clear); font-size: .85rem; }
.tests__r i.ph-warning { color: var(--sig-blocked); }

/* agent column */
.ws__agent { grid-area: agent; border-left: 1px solid var(--line); background: var(--bg-2); display: grid; grid-template-rows: 36px minmax(0, 1fr) auto; min-height: 0; }
.ws__ah {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 .9rem; border-bottom: 1px solid var(--line);
  font-size: .8rem; color: var(--text);
}
.ws__ah .mono { font-size: .62rem; color: var(--text-3); letter-spacing: .1em; text-transform: uppercase; }
.ws__chat { overflow-y: auto; padding: .9rem; display: grid; gap: .8rem; align-content: start; }
.ws__ctrl { border-top: 1px solid var(--line); }

.msg { border-radius: var(--r-control); }
.msg__h { font-family: var(--mono); font-size: .6rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); margin-bottom: .3rem; }
.msg__b { font-size: .8rem; line-height: 1.6; color: var(--text-2); }
.msg--you .msg__b { color: var(--text); background: var(--bg-3); padding: .55rem .75rem; border-radius: var(--r-control); }
.msg--you .msg__h { color: var(--accent); }
.msg--system .msg__b { color: var(--text-3); font-size: .76rem; }
.msg--ask .msg__b { color: var(--text); border-left: 2px solid var(--accent); padding-left: .75rem; }

/* status bar */
.ws__status {
  grid-area: status;
  display: flex; align-items: center; gap: 1.1rem;
  padding: 0 .9rem;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  font-family: var(--mono); font-size: .62rem; letter-spacing: .06em; color: var(--text-3);
}
.ws__status i { font-size: .8rem; }
.ws__sp { flex: 1; }

@media (max-width: 1280px) {
  .ws { grid-template-columns: 48px 210px minmax(0, 1fr) 300px; }
}
@media (max-width: 1080px) {
  .ws {
    grid-template-columns: 48px minmax(0, 1fr);
    grid-template-rows: minmax(320px, 1fr) 320px 26px;
    grid-template-areas: "act main" "agent agent" "status status";
    height: auto;
  }
  .ws__fs { display: none; }
  .ws__agent { border-left: 0; border-top: 1px solid var(--line); }
  .ws__main { grid-template-rows: 36px minmax(280px, 1fr) 190px; }
}

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .board-app { grid-template-columns: repeat(3, minmax(210px, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    position: fixed; inset: 0 auto 0 0; z-index: 100; width: 252px;
    transform: translateX(-100%);
    transition: transform .25s var(--ease);
  }
  .side.is-open { transform: none; }
  .top__burger { display: grid; }
  .board-app { grid-template-columns: repeat(2, minmax(200px, 1fr)); }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .view { padding: 1.25rem 1rem 3rem; }
  .board-app { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
  .kvrow { grid-template-columns: 1fr; gap: .2rem; }
}
@media (prefers-reduced-motion: reduce) {
  .side { transition: none; }
}
