/* command-deck — mission-control / приборная панель. Vanilla, без вебфонтов. */

:root {
  --bg:        #090a0e;
  --bg-elev:   #0f1117;
  --bg-card:   #13151d;
  --bg-card-2: #171a23;
  --line:      #232733;
  --line-soft: #1b1e27;

  --txt:       #e7e9f0;
  --txt-dim:   #98a0b0;
  --txt-faint: #5b6271;

  --stale:   #ff8a45;   /* залежалось — сигнальный янтарь */
  --cooling: #e7b94a;   /* остывает */
  --active:  #36d39a;   /* активно */
  --nogit:   #59616f;   /* без git */
  --accent:  #6ea8ff;   /* интерактив */

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;

  --r: 13px;
  --r-sm: 9px;
  --shadow: 0 12px 40px -18px rgba(0,0,0,.8);
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--txt);
  background:
    radial-gradient(1200px 620px at 78% -8%, #141a2b 0%, rgba(20,26,43,0) 60%),
    radial-gradient(900px 520px at 0% 0%, #131a17 0%, rgba(19,26,23,0) 55%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* грейн-оверлей */
.grain {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "brand stats controls" "filters filters filters";
  gap: 14px 22px;
  align-items: center;
  padding: 16px clamp(16px, 3vw, 34px) 14px;
  background: linear-gradient(180deg, rgba(9,10,14,.92) 0%, rgba(9,10,14,.7) 100%);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar::after {  /* тонкая инструментальная сетка под шапкой */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 56px 100%;
  mask-image: linear-gradient(180deg, #000 0, transparent 100%);
}
.topbar__brand { grid-area: brand; display: flex; align-items: center; gap: 13px; }
.mark { color: var(--active); font-size: 22px; line-height: 1; filter: drop-shadow(0 0 9px rgba(54,211,154,.5)); }
.brand__text h1 {
  margin: 0; font-family: var(--mono); font-size: 16px; font-weight: 650;
  letter-spacing: .14em; color: var(--txt);
}
.brand__text p { margin: 1px 0 0; font-size: 11.5px; color: var(--txt-faint); letter-spacing: .02em; }

.topbar__stats { grid-area: stats; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 12px; color: var(--txt-dim);
  padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg-card);
}
.pill b { color: var(--txt); font-weight: 600; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; }
.dot.stale { background: var(--stale); box-shadow: 0 0 8px var(--stale); }
.dot.cooling { background: var(--cooling); box-shadow: 0 0 8px var(--cooling); }
.dot.active { background: var(--active); box-shadow: 0 0 8px var(--active); }
.dot.nogit { background: var(--nogit); }

.topbar__controls { grid-area: controls; display: flex; align-items: center; gap: 10px; }
.search { position: relative; display: flex; align-items: center; }
.search svg { position: absolute; left: 11px; width: 15px; height: 15px; fill: none; stroke: var(--txt-faint); stroke-width: 2; }
.search input {
  width: clamp(180px, 22vw, 280px);
  font-family: var(--sans); font-size: 13px; color: var(--txt);
  padding: 9px 30px 9px 33px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--bg-card); outline: none; transition: border-color .15s, box-shadow .15s;
}
.search input::placeholder { color: var(--txt-faint); }
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(110,168,255,.12); }
.search kbd {
  position: absolute; right: 9px; font-family: var(--mono); font-size: 10.5px; color: var(--txt-faint);
  border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; background: var(--bg-elev);
}

.btn {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  font-family: var(--mono); font-size: 12px; letter-spacing: .03em; color: var(--txt-dim);
  padding: 9px 13px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--bg-card); transition: all .15s var(--ease);
}
.btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover { color: var(--txt); border-color: #2f3645; background: var(--bg-card-2); }
.btn--ghost:active { transform: translateY(1px); }
.btn.is-busy svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.topbar__filters { grid-area: filters; display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  cursor: pointer; font-family: var(--mono); font-size: 11.5px; color: var(--txt-dim);
  padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: transparent;
  display: inline-flex; align-items: center; gap: 7px; transition: all .14s var(--ease);
}
.chip:hover { color: var(--txt); border-color: #313846; }
.chip[aria-pressed="true"] { color: var(--txt); background: var(--bg-card-2); border-color: #39414f; }
.chip[data-status="stale"][aria-pressed="true"] { border-color: var(--stale); }
.chip[data-status="cooling"][aria-pressed="true"] { border-color: var(--cooling); }
.chip[data-status="active"][aria-pressed="true"] { border-color: var(--active); }

/* ---------- stage ---------- */
.stage { position: relative; z-index: 1; padding: 22px clamp(16px, 3vw, 34px) 80px; max-width: 1640px; margin: 0 auto; }

.panel {
  border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-card);
  box-shadow: var(--shadow);
}
.panel__head { display: flex; align-items: baseline; justify-content: space-between; padding: 14px 18px 0; }
.panel__head h2 { margin: 0; font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--txt-dim); }
.panel__meta { font-family: var(--mono); font-size: 11.5px; color: var(--txt-faint); }

/* heatmap */
.heatpanel { margin-bottom: 22px; }
.heatmap {
  display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr);
  gap: 3px; padding: 16px 18px 18px; overflow-x: auto;
}
.heatmap .cell {
  width: 13px; height: 13px; border-radius: 3px; background: #161922;
  outline: 1px solid rgba(255,255,255,.02);
}
.heatmap .cell.l1 { background: #12352b; }
.heatmap .cell.l2 { background: #1c5e45; }
.heatmap .cell.l3 { background: #28986a; }
.heatmap .cell.l4 { background: var(--active); box-shadow: 0 0 8px rgba(54,211,154,.45); }

/* ---------- grid + cards ---------- */
.grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
}
.card {
  position: relative; overflow: hidden; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r);
  background: linear-gradient(180deg, var(--bg-card) 0%, #111219 100%);
  padding: 15px 16px 14px 19px;
  transition: border-color .16s var(--ease), transform .16s var(--ease), box-shadow .16s var(--ease);
  opacity: 0; transform: translateY(8px);
  animation: rise .5s var(--ease) forwards;
}
@keyframes rise { to { opacity: 1; transform: none; } }
.card::before {  /* статус-рейка слева */
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--nogit);
}
.card.s-stale::before { background: var(--stale); box-shadow: 0 0 14px var(--stale); }
.card.s-cooling::before { background: var(--cooling); }
.card.s-active::before { background: var(--active); }
.card:hover { border-color: #323a49; transform: translateY(-2px); box-shadow: 0 18px 44px -22px rgba(0,0,0,.85); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card__name { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; word-break: break-word; }
.card__age { font-family: var(--mono); font-size: 11.5px; color: var(--txt-dim); white-space: nowrap; flex-shrink: 0; padding-top: 2px; }
.card__age.is-stale { color: var(--stale); }

.card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 9px 0 0; }
.tag {
  font-family: var(--mono); font-size: 10.5px; color: var(--txt-dim);
  padding: 2px 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg-elev);
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
}
.tag.branch { color: var(--txt-dim); }
.tag.branch svg { width: 11px; height: 11px; stroke: var(--txt-faint); fill: none; stroke-width: 2; }
.tag.warn { color: var(--stale); border-color: rgba(255,138,69,.32); background: rgba(255,138,69,.08); }
.tag.muted-tag { color: var(--txt-faint); }
.tag.done-tag { color: var(--active); border-color: rgba(54,211,154,.3); background: rgba(54,211,154,.08); }

.card__next { margin: 11px 0 0; font-size: 13.5px; color: var(--txt); line-height: 1.45; }
.card__next .lead { color: var(--txt-faint); font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; display: block; margin-bottom: 3px; }
.card__next .guess { color: var(--cooling); font-size: 11px; font-family: var(--mono); }
.card__next.empty-next { color: var(--txt-faint); font-style: italic; }

.card__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 13px; }
.ops { display: flex; align-items: center; gap: 6px; min-height: 18px; }
.health {
  display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 10.5px;
  color: var(--txt-dim); padding: 2px 7px 2px 6px; border-radius: 999px; border: 1px solid var(--line);
}
.health .led { width: 7px; height: 7px; border-radius: 50%; background: var(--nogit); }
.health.up .led { background: var(--active); box-shadow: 0 0 7px var(--active); }
.health.down .led { background: var(--stale); box-shadow: 0 0 7px var(--stale); }
.health.warn .led { background: var(--cooling); }

.links { display: flex; align-items: center; gap: 4px; }
.iconlink {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  border: 1px solid var(--line); border-radius: 8px; color: var(--txt-dim); background: var(--bg-elev);
  transition: all .14s var(--ease);
}
.iconlink:hover { color: var(--txt); border-color: #343c4b; transform: translateY(-1px); }
.iconlink svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- drawer ---------- */
.drawer-overlay { position: fixed; inset: 0; z-index: 40; background: rgba(4,5,8,.6); backdrop-filter: blur(2px); animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: min(540px, 94vw);
  background: var(--bg-elev); border-left: 1px solid var(--line);
  box-shadow: -30px 0 80px -30px rgba(0,0,0,.9);
  transform: translateX(100%); transition: transform .32s var(--ease);
  overflow-y: auto; overscroll-behavior: contain;
}
.drawer.open { transform: none; }
.dw__head { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 20px 22px 16px; background: linear-gradient(180deg, var(--bg-elev) 70%, rgba(15,17,23,0)); }
.dw__title { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -.015em; }
.dw__sub { margin: 5px 0 0; font-family: var(--mono); font-size: 11.5px; color: var(--txt-dim); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dw__close { flex-shrink: 0; cursor: pointer; width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 9px; background: var(--bg-card); color: var(--txt-dim); }
.dw__close:hover { color: var(--txt); border-color: #343c4b; }
.dw__close svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; }

.dw__body { padding: 4px 22px 40px; }
.dw__section { margin-top: 22px; }
.dw__section > h3 { margin: 0 0 10px; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--txt-faint); }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 7px 14px; font-size: 13px; }
.kv dt { color: var(--txt-faint); font-family: var(--mono); font-size: 11.5px; }
.kv dd { margin: 0; color: var(--txt); font-family: var(--mono); font-size: 12px; word-break: break-word; }

.commits { list-style: none; margin: 0; padding: 0; }
.commits li { position: relative; padding: 0 0 12px 18px; font-size: 12.5px; color: var(--txt-dim); }
.commits li::before { content: ""; position: absolute; left: 3px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: #2b3240; border: 2px solid var(--bg-elev); }
.commits li:not(:last-child)::after { content: ""; position: absolute; left: 6px; top: 13px; bottom: 0; width: 1px; background: var(--line); }
.commits li b { color: var(--txt); font-weight: 500; }
.commits li .when { font-family: var(--mono); font-size: 10.5px; color: var(--txt-faint); }

.memo {
  font-family: var(--mono); font-size: 11.5px; line-height: 1.6; color: var(--txt-dim);
  white-space: pre-wrap; word-break: break-word; background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 13px 14px; max-height: 320px; overflow-y: auto;
}
.memo .file { color: var(--accent); }
.redacted { color: var(--stale); }

.dw__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.dw__actions .btn { background: var(--bg-card); }
.dw__links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.dw__links a { font-family: var(--mono); font-size: 12px; }

.confnote { font-family: var(--mono); font-size: 10.5px; color: var(--cooling); }

/* ops list (drawer) */
.oplist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.op { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 11.5px; color: var(--txt-dim);
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 11px; background: var(--bg-card); }
.op .led { width: 8px; height: 8px; border-radius: 50%; background: var(--nogit); }
.op.up .led { background: var(--active); box-shadow: 0 0 7px var(--active); }
.op.down .led { background: var(--stale); box-shadow: 0 0 7px var(--stale); }
.op.warn .led { background: var(--cooling); }
.op__name { color: var(--txt); }
.op__kind { color: var(--txt-faint); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.op__detail { text-align: right; color: var(--txt-faint); }
.op.down .op__detail { color: var(--stale); }

/* ---------- misc ---------- */
.empty { text-align: center; color: var(--txt-faint); font-family: var(--mono); padding: 60px 0; }
.skeleton { opacity: .5; }
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(10px);
  z-index: 60; font-family: var(--mono); font-size: 12.5px; color: var(--txt);
  background: var(--bg-card-2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 16px;
  box-shadow: var(--shadow); opacity: 0; transition: all .25s var(--ease); pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- tabs ---------- */
.tabs { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-card); }
.tab { cursor: pointer; font-family: var(--mono); font-size: 12px; color: var(--txt-dim); padding: 6px 13px;
  border: none; border-radius: 6px; background: transparent; transition: all .14s var(--ease); }
.tab:hover { color: var(--txt); }
.tab[aria-pressed="true"] { color: var(--txt); background: var(--bg-card-2); box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- cost chart (sessions) ---------- */
.notional { font-family: var(--mono); font-size: 10px; color: var(--txt-faint); text-transform: none; letter-spacing: 0; font-weight: 400; }
.costchart { display: flex; align-items: flex-end; gap: 3px; height: 90px; padding: 16px 18px 14px; overflow-x: auto; }
.costchart .bar { flex: 1; min-width: 5px; background: linear-gradient(180deg, var(--accent), #2b5fa8); border-radius: 3px 3px 0 0; opacity: .85; transition: opacity .14s; }
.costchart .bar:hover { opacity: 1; }

.card.sess .card__name { font-size: 14px; }
.sess-cost { font-family: var(--mono); font-size: 12px; color: var(--cooling); }

/* ---------- transcript (session drawer) ---------- */
.turns { display: flex; flex-direction: column; gap: 12px; }
.turn { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; background: var(--bg-card); }
.turn--user { border-left: 2px solid var(--accent); }
.turn--assistant { border-left: 2px solid var(--active); }
.turn__role { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--txt-faint); margin-bottom: 6px; }
.turn__text { font-size: 12.5px; line-height: 1.5; color: var(--txt); white-space: pre-wrap; word-break: break-word; }
.turn__tools { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.turn__tools span { font-family: var(--mono); font-size: 10px; color: var(--accent); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; background: var(--bg-elev); }

/* ---------- console (exec) ---------- */
.con-gate { padding: 40px 28px; max-width: 460px; margin: 0 auto; text-align: center; }
.con-gate h2 { margin: 0 0 10px; font-size: 17px; }
.con-gate .con-warn { color: var(--stale); font-size: 12.5px; margin: 0 0 20px; line-height: 1.5; }
.con-gate input { width: 100%; font-size: 14px; color: var(--txt); padding: 11px 13px; margin-bottom: 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-elev); outline: none; }
.con-gate input:focus { border-color: var(--accent); }
.con-gate code { font-family: var(--mono); color: var(--cooling); }

.con-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 13px 14px; border-bottom: 1px solid var(--line); }
.con-sel { font-family: var(--mono); font-size: 12px; color: var(--txt); background: var(--bg-elev);
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 7px 9px; outline: none; }
.con-stabs { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.con-stab { cursor: pointer; font-family: var(--mono); font-size: 11.5px; color: var(--txt-dim);
  border: 1px solid var(--line); border-radius: 999px; background: var(--bg-card); padding: 5px 11px; }
.con-stab.act { color: var(--txt); border-color: var(--active); background: rgba(54,211,154,.08); }
.con-lock { color: var(--txt-dim); }

.con-log { height: min(58vh, 620px); overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 11px;
  font-size: 13px; line-height: 1.5; }
.cl { word-break: break-word; white-space: pre-wrap; }
.cl-who { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--txt-faint); margin-bottom: 3px; }
.cl-user { border-left: 2px solid var(--accent); padding: 8px 12px; background: var(--bg-card); border-radius: var(--r-sm); }
.cl-asst { border-left: 2px solid var(--active); padding: 8px 12px; background: var(--bg-card); border-radius: var(--r-sm); }
.cl-tool { font-family: var(--mono); font-size: 11.5px; color: var(--accent); padding-left: 4px; }
.cl-tool b { color: var(--txt); }
.cl-sys { font-family: var(--mono); font-size: 11px; color: var(--txt-faint); text-align: center; }
.cl-result { font-family: var(--mono); font-size: 11px; color: var(--active); }
.cl-warn { font-family: var(--mono); font-size: 11.5px; color: var(--cooling); }
.cl-err { font-family: var(--mono); font-size: 11.5px; color: var(--stale); }

.con-input { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); align-items: flex-end; }
.con-input textarea { flex: 1; resize: vertical; min-height: 40px; max-height: 200px; font-family: var(--sans); font-size: 13.5px;
  color: var(--txt); background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; outline: none; }
.con-input textarea:focus { border-color: var(--accent); }
.con-input .login__btn { width: 48px; margin: 0; flex-shrink: 0; }

/* ---------- overview (attention) ---------- */
.attnpanel { margin-bottom: 22px; }
.attnlist { display: flex; flex-direction: column; padding: 8px; }
.attn { display: grid; grid-template-columns: 150px 200px 1fr; align-items: center; gap: 16px;
  width: 100%; text-align: left; cursor: pointer; border: none; border-left: 3px solid var(--nogit);
  background: transparent; padding: 13px 14px; border-radius: 8px; color: var(--txt);
  transition: background .14s var(--ease); opacity: 0; transform: translateY(6px); animation: rise .45s var(--ease) forwards; }
.attn:hover { background: var(--bg-card); }
.attn + .attn { margin-top: 2px; }
.attn--crit { border-left-color: var(--stale); }
.attn--warn { border-left-color: var(--stale); }
.attn--stale { border-left-color: var(--stale); }
.attn--cool { border-left-color: var(--cooling); }
.attn--live { border-left-color: var(--active); }
.attn__lead { font-family: var(--mono); font-size: 11.5px; color: var(--txt-dim); white-space: nowrap; }
.attn--crit .attn__lead, .attn--warn .attn__lead, .attn--stale .attn__lead { color: var(--stale); }
.attn--cool .attn__lead { color: var(--cooling); }
.attn--live .attn__lead { color: var(--active); }
.attn__title { font-size: 14px; font-weight: 600; }
.attn__detail { font-size: 12.5px; color: var(--txt-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attn-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.attn-dot.crit, .attn-dot.warn, .attn-dot.stale { background: var(--stale); box-shadow: 0 0 7px var(--stale); }
.attn-dot.cool { background: var(--cooling); }
.attn-dot.live { background: var(--active); box-shadow: 0 0 7px var(--active); }
@media (max-width: 720px) {
  .attn { grid-template-columns: 1fr; gap: 4px; }
  .attn__detail { white-space: normal; }
}

/* ---------- live / session-project links ---------- */
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.livedot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--active);
  box-shadow: 0 0 8px var(--active); margin-right: 6px; vertical-align: middle; animation: pulse 1.6s infinite; }
.live-now { font-family: var(--mono); font-size: 10.5px; color: var(--active); letter-spacing: .04em;
  border: 1px solid rgba(54,211,154,.35); border-radius: 5px; padding: 1px 6px; }
.card.sess-live { border-color: rgba(54,211,154,.4); box-shadow: 0 0 0 1px rgba(54,211,154,.15), 0 14px 40px -24px rgba(0,0,0,.8); }
.card.sess-live::before { background: var(--active); box-shadow: 0 0 14px var(--active); }

.chip.chip--warn[aria-pressed="true"] { border-color: var(--stale); color: var(--stale); background: rgba(255,138,69,.07); }

.sess-snip { margin: 9px 0 0; font-size: 12px; line-height: 1.5; color: var(--txt-dim);
  border-left: 2px solid var(--line); padding-left: 9px; max-height: 56px; overflow: hidden; }
.sess-snip mark { background: rgba(231,185,74,.28); color: var(--txt); border-radius: 2px; padding: 0 1px; }
.sess-snip__n { font-family: var(--mono); font-size: 10px; color: var(--cooling); }

.tag.sess-tag { color: var(--txt-dim); }
.tag.live-tag { color: var(--active); border-color: rgba(54,211,154,.3); background: rgba(54,211,154,.07); }
.tag-proj { cursor: pointer; font-family: var(--mono); }
.tag-proj:hover { color: var(--txt); border-color: #39414f; }

.sessfilters { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.chip__n { color: var(--txt-faint); font-size: 10px; }
.chip[aria-pressed="true"] .chip__n { color: var(--txt-dim); }

.projsess { display: flex; flex-direction: column; gap: 6px; }
.projsess__item { cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 3px;
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 11px; background: var(--bg-card); transition: border-color .14s; }
.projsess__item:hover { border-color: #343c4b; }
.projsess__t { font-size: 12.5px; color: var(--txt); }
.projsess__m { font-family: var(--mono); font-size: 10.5px; color: var(--txt-faint); }

/* ---------- devices ---------- */
.devlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.dev { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 11px 13px; background: var(--bg-card); }
.dev--cur { border-color: rgba(54,211,154,.35); background: rgba(54,211,154,.06); }
.dev__label { font-size: 13.5px; color: var(--txt); }
.dev__cur { font-family: var(--mono); font-size: 10px; color: var(--active); border: 1px solid rgba(54,211,154,.3); border-radius: 5px; padding: 1px 6px; margin-left: 6px; }
.dev__meta { font-family: var(--mono); font-size: 11px; color: var(--txt-faint); margin-top: 4px; }
.dev__revoke { flex-shrink: 0; color: var(--stale); border-color: rgba(255,138,69,.3); }
.dev__revoke:hover { border-color: var(--stale); color: var(--stale); }

/* ---------- login ---------- */
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.login { position: relative; z-index: 1; text-align: center; width: 100%; max-width: 400px; }
.login__card { border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-card);
  padding: 38px 32px 30px; box-shadow: var(--shadow); }
.login__brand { display: flex; align-items: center; justify-content: center; gap: 11px; }
.login__brand h1 { margin: 0; font-family: var(--mono); font-size: 16px; letter-spacing: .15em; }
.login__sub { margin: 7px 0 26px; font-size: 12px; color: var(--txt-faint); font-family: var(--mono); }
.login__field { display: block; text-align: left; }
.login__field span { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--txt-faint); margin-bottom: 7px; }
.login__field input { width: 100%; font-size: 14px; color: var(--txt); padding: 11px 13px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-elev); outline: none;
  transition: border-color .15s, box-shadow .15s; }
.login__field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(110,168,255,.12); }
.login__btn { width: 100%; margin-top: 18px; cursor: pointer; font-family: var(--mono); font-size: 13px;
  letter-spacing: .06em; color: #07120d; background: var(--active); border: none; border-radius: var(--r-sm);
  padding: 12px; font-weight: 650; transition: filter .15s, transform .1s; }
.login__btn:hover { filter: brightness(1.08); }
.login__btn:active { transform: translateY(1px); }
.login__btn:disabled { opacity: .6; cursor: default; }
.login__err { margin: 14px 0 0; font-family: var(--mono); font-size: 12px; color: var(--stale); }
.login__foot { margin-top: 18px; font-family: var(--mono); font-size: 10.5px; color: var(--txt-faint); }

/* ---------- hygiene ---------- */
.pill.hygiene-pill { cursor: pointer; color: var(--stale); border-color: rgba(255,138,69,.3); background: rgba(255,138,69,.07); }
.pill.hygiene-pill:hover { border-color: var(--stale); }
.hyg { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.hyg li { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px 12px; background: var(--bg-card); }
.hyg .f { font-family: var(--mono); font-size: 12px; color: var(--txt); }
.hyg .k { font-family: var(--mono); font-size: 10px; color: var(--stale); text-align: right; }

@media (max-width: 720px) {
  .topbar { grid-template-columns: 1fr; grid-template-areas: "brand" "controls" "stats" "filters"; }
  .topbar__stats { justify-content: flex-start; }
  .search input { width: 100%; }
  .topbar__controls { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
