/* The console shell on the brand tokens (brand/tokens.css): five areas, the map behind everything, the helper drawer.
   Loaded after admin.html's own <style>, so what is written here wins on equal specificity. Component CSS stays in
   admin.html until each screen is rebuilt; this file restyles the frame and the shared controls. */

/* ---------- frame ---------- */
html { background: var(--color-bg); }
body { font: var(--weight-regular) var(--text-ui)/var(--leading-body) var(--font-sans); background: var(--color-bg); color: var(--color-text); -webkit-font-smoothing: antialiased; min-height: 100vh; }
#mapCanvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
#mapLayer { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
#mapCanvas.docked, #mapLayer.docked { position: absolute; }   /* phone + Sources: inside the stage card, scrolls with it */
header, main, #login, #toast, #helper { position: relative; z-index: 1; }
main#app { padding: 0; max-width: none; }
main#app > section { padding: 18px clamp(16px, 2.4vw, 28px) 48px; max-width: 1500px; }
@media (min-width: 901px) { body.helper-on main#app > section, body.helper-on .areabar { padding-right: calc(392px + clamp(16px, 2.4vw, 28px)); } }

/* ---------- header: logo · areas · progress · account ---------- */
header { display: flex; align-items: center; gap: 14px; padding: 10px clamp(16px, 2.4vw, 28px); border-bottom: 1px solid var(--color-line); background: var(--color-glass); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 5; flex-wrap: nowrap; }
header h1 { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: var(--weight-semibold); letter-spacing: -.02em; margin: 0; white-space: nowrap; }
header h1 svg { width: 18px; height: auto; flex: none; }
header h1 b { color: var(--color-text); font-weight: var(--weight-semibold); }
header h1 span { color: var(--color-text-3); font-weight: var(--weight-medium); }
nav#nav { display: flex; gap: 2px; margin-left: 6px; flex-wrap: nowrap; }
nav#nav button { font: var(--weight-medium) 13px/1 var(--font-sans); color: var(--color-text-3); padding: 8px 12px; border-radius: var(--radius-pill); border: 0; background: transparent; cursor: pointer; transition: color .2s, background .2s; min-height: 34px; }
nav#nav button svg { display: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
nav#nav button:hover { color: var(--color-text); }
nav#nav button.on { color: var(--color-text); background: var(--color-surface-hover); }
nav#nav button .n { display: inline-block; min-width: 16px; margin-left: 6px; padding: 0 5px; border-radius: var(--radius-pill); background: var(--color-accent); color: var(--color-on-accent); font-size: 10.5px; font-weight: var(--weight-semibold); line-height: 16px; text-align: center; }
header .sp { flex: 1; }
#who { margin-left: 0; color: var(--color-text-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 34vw; }
#signout, #installBtn { padding: 6px 12px; font-size: 12px; }
.ingest { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 8px; border-radius: var(--radius-pill); border: 1px solid var(--color-line); background: transparent; color: var(--color-text-2); font: var(--weight-regular) 12.5px/1 var(--font-sans); cursor: pointer; overflow: hidden; transition: border-color .3s; white-space: nowrap; }
.ingest:hover { border-color: var(--color-accent); color: var(--color-text); }
.ingest i { width: 7px; height: 7px; border-radius: 50%; background: var(--color-accent); animation: shellpulse 1.2s infinite; flex: none; }
.ingest b { font-weight: var(--weight-semibold); color: var(--color-text); font-variant-numeric: tabular-nums; }
.ingest em { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: linear-gradient(90deg, var(--color-accent), var(--color-warn)); transition: width .4s var(--ease-standard); }
.ingest.done i { background: var(--color-ok); animation: none; } .ingest.done em { background: var(--color-ok); }
.ingest.bad i { background: var(--color-bad); animation: none; }
/* the model pill: which model is thinking right now; the list on click */
#modelPill { display: inline-flex; align-items: center; padding: 7px 12px; border-radius: var(--radius-pill); border: 1px solid var(--color-line); background: transparent; color: var(--color-text-2); font: var(--weight-regular) 12.5px/1 var(--font-sans); cursor: pointer; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; transition: border-color .2s, color .2s; }
#modelPill:hover, #modelPill[aria-expanded="true"] { border-color: var(--color-accent); color: var(--color-text); }
#modelPill[hidden] { display: none !important; }
#modelPill .short { display: none; }
#modelsPop { position: fixed; top: calc(var(--hdr, 57px) + 8px); right: clamp(16px, 2.4vw, 28px); z-index: 7; width: min(400px, calc(100vw - 32px)); padding: 12px 14px 10px; background: var(--color-glass); backdrop-filter: blur(14px); }
#modelsPop[hidden] { display: none; }
#modelsPop .mhead { font-size: 11.5px; font-weight: var(--weight-semibold); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--color-text-3); margin: 0 0 6px; }
#modelsPop .mrow { display: grid; grid-template-columns: 96px 1fr; gap: 2px 10px; padding: 7px 0; border-top: 1px solid var(--color-line); font-size: 12.5px; }
#modelsPop .mrow b { font-weight: var(--weight-semibold); font-size: 12.5px; letter-spacing: 0; color: var(--color-text); grid-row: span 2; align-self: start; padding-top: 1px; } /* .card b is the 26px stat-tile size */
#modelsPop .mrow span { color: var(--color-text); overflow-wrap: anywhere; }
#modelsPop .mrow span em { font-style: normal; color: var(--color-text-2); }
#modelsPop .mrow small { color: var(--color-text-3); font-size: 11.5px; }
#modelsPop .mfoot { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--color-line); font-size: 11.5px; color: var(--color-text-3); }
#modelsPop .mfoot a { color: var(--color-text-2); }
@media (max-width: 1000px) { #modelPill .long { display: none; } #modelPill .short { display: inline; } #modelPill { padding: 7px 10px; } }
/* Setup: the field a link just opened */
.flash { animation: setupflash 2.4s ease-out; border-radius: var(--radius-lg); }
@keyframes setupflash { 0% { box-shadow: 0 0 0 0 var(--color-accent); background: color-mix(in srgb, var(--color-accent) 14%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; background: transparent; } }
.keylink { color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; }
.keylink:hover { color: var(--color-text); }
@keyframes shellpulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
#helpBtn { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: var(--radius-pill); border: 1px solid var(--color-line-strong); background: transparent; color: var(--color-text); font: var(--weight-semibold) 12.5px/1 var(--font-sans); cursor: pointer; transition: border-color .2s; white-space: nowrap; }
#helpBtn:hover { border-color: var(--color-accent); }
#helpBtn i { width: 8px; height: 8px; border-radius: 50%; background: var(--color-accent); box-shadow: 0 0 12px var(--color-accent); }
body.helper-on #helpBtn { display: none; }

/* second row: the tabs of the current area */
.areabar { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 8px clamp(16px, 2.4vw, 28px) 0; }
.areabar button { font: var(--weight-semibold) 12.5px/1 var(--font-sans); color: var(--color-text-2); padding: 7px 12px; border-radius: var(--radius-pill); border: 1px solid transparent; background: transparent; cursor: pointer; min-height: 32px; transition: color .2s, border-color .2s, background .2s; }
.areabar button:hover { color: var(--color-text); border-color: var(--color-line); }
.areabar button.on { color: var(--button-fg); background: var(--button-bg); border-color: var(--button-bg); }
.areabar:empty { display: none; }

@media (max-width: 1000px) { header h1 span { display: none; } #who { max-width: 18vw; } .ingest span, #helpBtn span { display: none; } #signout { white-space: nowrap; } nav#nav button { padding: 8px 9px; } }

/* ---------- phones (spec §9 Mobile, 2026-11-15): areas as a bottom tab bar, header = logo · progress · account ---------- */
@media (max-width: 760px) {
  :root { --tabbar: calc(58px + env(safe-area-inset-bottom, 0px)); }
  body { overflow-x: hidden; }
  /* no blur on the phone header: backdrop-filter would make it the containing block of the fixed tab bar inside it */
  header { gap: 8px; padding: 8px 12px; backdrop-filter: none; background: var(--color-bg); }
  nav#nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; margin: 0; gap: 0; padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 0px)); background: var(--color-glass); backdrop-filter: blur(14px); border-top: 1px solid var(--color-line); justify-content: space-around; }
  nav#nav button { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 5px 2px 4px; min-height: 50px; font-size: 10.5px; border-radius: var(--radius-lg); }
  nav#nav button svg { display: block; }
  nav#nav button.on { background: transparent; color: var(--color-text); }
  nav#nav button.on svg { color: var(--color-accent); }
  #who { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--color-surface-hover); border: 1px solid var(--color-line); font-size: 0; max-width: none; overflow: visible; cursor: pointer; flex: none; }
  #who::before { content: attr(data-initial); font-size: 12.5px; font-weight: var(--weight-semibold); color: var(--color-text); }
  #signout, #installBtn { display: none; min-height: 34px; }
  body.acct-open #signout, body.acct-open #installBtn:not([hidden]) { display: inline-block; }
  .ingest span { display: none; }
  .ingest { padding: 8px 10px 9px; min-height: 34px; }
  #modelPill { min-height: 34px; max-width: 120px; }
  #modelsPop { top: calc(var(--hdr, 57px) + 6px); right: 12px; left: 12px; width: auto; }
  #helpBtn span { display: none; }
  #helpBtn { width: 44px; height: 44px; justify-content: center; padding: 0; }
  #helper .compose .att { min-width: 44px; min-height: 44px; display: grid; place-items: center; padding: 0; }
  .areabar { padding: 8px 12px 0; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .areabar::-webkit-scrollbar { display: none; }
  .areabar button { white-space: nowrap; min-height: 40px; }
  main#app > section { padding: 14px 12px calc(var(--tabbar) + 20px); }
  #toast { left: 12px; right: 12px; bottom: calc(var(--tabbar) + 10px); max-width: none; }
  #login { margin: 24px 12px; }
  /* rule 5: 44 px targets, nothing scrolls the page sideways */
  button.act, .subnav button, select, input:not([type=checkbox]):not([type=radio]):not([type=file]), #helper .vhead button, #helper .hchips button, #chat .head button, label.act { min-height: 44px; }
  .subnav { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; padding-bottom: 2px; }
  .subnav::-webkit-scrollbar { display: none; }
  .subnav button { white-space: nowrap; }
  table { display: block; overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
  th { position: static; }
  .row input, .row select { width: auto !important; flex: 1 1 140px; max-width: 100%; }
  .row textarea { width: 100% !important; }
  .sechead { flex-wrap: wrap; }
  .sechead .tools { margin-left: 0; width: 100%; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card b { font-size: 22px; }
  .catalog { grid-template-columns: 1fr; }
  #graph .two { grid-template-columns: 1fr !important; }
  #gCanvas { height: 58vh !important; }
}

/* ---------- shared controls on the brand ---------- */
section .sechead h2 { font-weight: var(--weight-medium); font-size: 24px; letter-spacing: var(--tracking-title); line-height: 1.1; margin: 0 0 4px; }
section .sechead .help, .help { color: var(--color-text-3); font-size: 13.5px; }
h3 { font-weight: var(--weight-medium); font-size: 17px; letter-spacing: var(--tracking-title); }
h4 { font-weight: var(--weight-semibold); font-size: 13px; }
button.act { background: var(--button-bg); color: var(--button-fg); border: 0; padding: 8px 15px; border-radius: var(--radius-pill); font: var(--weight-semibold) 13px/1.2 var(--font-sans); cursor: pointer; transition: transform .15s, box-shadow .15s, opacity .15s; }
button.act:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--shadow-button-hover); }
button.act.secondary { background: transparent; color: var(--color-text); box-shadow: inset 0 0 0 1.5px var(--button-ghost-ring); }
button.act.secondary:hover:not(:disabled) { box-shadow: inset 0 0 0 1.5px var(--button-ghost-ring), var(--shadow-button-hover); }
button.act.danger { background: transparent; color: var(--color-bad); box-shadow: inset 0 0 0 1.5px var(--color-bad-line); }
button.act:disabled { opacity: .45; cursor: default; transform: none; box-shadow: none; }
button.act.secondary:disabled { box-shadow: inset 0 0 0 1.5px var(--color-line); }
label.act { border-radius: var(--radius-pill); }
input, select, textarea { background: var(--color-surface-flat); border: 1px solid var(--color-line); color: var(--color-text); padding: 8px 11px; border-radius: var(--radius-md); font: var(--weight-regular) 13.5px/1.4 var(--font-sans); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--color-accent-line); box-shadow: var(--focus-ring); }
input::placeholder, textarea::placeholder { color: var(--color-text-4); }
textarea { font-family: var(--font-mono); font-size: 12.5px; }
table { font-size: 13px; }
th { color: var(--color-text-3); font-weight: var(--weight-semibold); font-size: 11px; letter-spacing: var(--tracking-caps); text-transform: uppercase; background: var(--color-bg); }
th, td { border-bottom-color: var(--color-line); }
tr:hover td { background: var(--color-surface-flat); }
.pill { border-radius: var(--radius-pill); background: var(--color-surface-flat); border: 1px solid var(--color-line); color: var(--color-text-2); font-size: 11.5px; padding: 1px 8px; }
.cards { gap: 12px; }
.card { background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius-xl); padding: 16px 18px; box-shadow: var(--shadow-card); }
.card b { font-weight: var(--weight-medium); font-size: 26px; letter-spacing: var(--tracking-title); font-variant-numeric: tabular-nums; }
.card span { color: var(--color-text-3); font-size: 12px; }
.subnav { border-bottom: 0; gap: 6px; margin: 2px 0 14px; }
.subnav button { padding: 6px 11px; border-radius: var(--radius-pill); border: 1px solid var(--color-line); margin: 0; color: var(--color-text-2); font-weight: var(--weight-semibold); font-size: 12.5px; }
.subnav button:hover { color: var(--color-text); border-color: var(--color-line-strong); }
.subnav button.on { color: var(--button-fg); background: var(--button-bg); border-color: var(--button-bg); }
.subnav button b { color: inherit; opacity: .7; }
details.form { border-radius: var(--radius-lg); background: var(--color-surface-flat); }
details.form summary::before { color: var(--color-accent); }
.dropzone { border-radius: var(--radius-lg); border-color: var(--color-line-strong); }
.dropzone:hover, .dropzone.drag { border-color: var(--color-accent); background: var(--color-accent-wash); }
pre.page { border-radius: var(--radius-lg); background: var(--color-surface-flat); font-family: var(--font-mono); }
code { background: var(--color-surface-flat); border-radius: var(--radius-xs); font-family: var(--font-mono); }
#toast { border-radius: var(--radius-lg); background: var(--color-bg-raised); border-color: var(--color-line-strong); box-shadow: var(--shadow-float); }
#login { border-radius: var(--radius-2xl); background: var(--color-surface); border-color: var(--color-line); box-shadow: var(--shadow-card); }
a { color: var(--color-accent); }
.ok { color: var(--color-ok); } .warn { color: var(--color-warn); } .bad { color: var(--color-bad); } .muted { color: var(--color-text-3); }
/* the old chat tab's hard-coded night tones follow the theme */
#chat .m.me, .chat .msg.me { background: var(--color-secondary-soft); }
#chat .m.bot pre, #chat .m.bot code, #chat .trace .step .io, .chat pre, .chat code { background: var(--color-surface-flat); }
#chat .m.me .chip { background: var(--color-surface-flat); }
#chat .composer { border-radius: var(--radius-xl); background: var(--color-glass); backdrop-filter: blur(12px); }
#chat .composer:focus-within { border-color: var(--color-line-strong); }
#chat .composer textarea:focus { box-shadow: none; border-color: transparent; }
main#app > section#chat { padding-bottom: 12px; }
#chat .phonebar, #chat .sidebg, #chat .side .sideclose { display: none; }
@media (max-width: 900px) {
  #chat .phonebar { display: flex; gap: 8px; padding: 0 0 8px; }
  #chat .phonebar .act { min-height: 40px; }
  #chat .side { display: flex; position: fixed; top: var(--hdr, 57px); left: 0; bottom: 0; width: min(86vw, 360px); z-index: 7; padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--color-bg-raised); border-right: 1px solid var(--color-line); transform: translateX(-104%); transition: transform .3s var(--ease-standard); box-shadow: var(--shadow-float); }
  body.chatside-on #chat .side { transform: none; }
  #chat .sidebg { display: block; position: fixed; inset: 0; z-index: 6; background: rgba(0, 0, 0, .4); opacity: 0; pointer-events: none; transition: opacity .3s; }
  body.chatside-on #chat .sidebg { opacity: 1; pointer-events: auto; }
  #chat .side .sideclose { display: inline-block; align-self: flex-end; }
  #chat .side .item { min-height: 44px; }
  #chat .side .item .x, #chat .side .item .pin { opacity: 1; padding: 8px 6px; }
  #chat .head { flex-wrap: wrap; }
  #chat .head b { flex-basis: 100%; }
  #chat .wrap { height: calc(100vh - var(--hdr, 57px) - 14px); height: calc(100dvh - var(--hdr, 57px) - 14px); min-height: 0; }
}
@media (max-width: 760px) {
  main#app > section#chat { padding: 8px 10px 0; }
  #chat .wrap { height: calc(100vh - var(--hdr, 57px) - var(--tabbar) - 8px); height: calc(100dvh - var(--hdr, 57px) - var(--tabbar) - 8px); }
  #chat .composer { padding: 6px 6px 6px 12px; }
  #chat .composer .act { min-height: 40px; }
  #chat .m.bot { max-width: none; }
}
#chat .side .item.on, #chat .side .item:hover, #chat .side .hit:hover { background: var(--color-surface-hover); }
#chat .chips button { border-radius: var(--radius-pill); background: transparent; border-color: var(--color-line); }
#chat .chips button:hover { border-color: var(--color-accent); }
#chat .empty h3 { font-size: 22px; font-weight: var(--weight-medium); letter-spacing: var(--tracking-title); }
#chat .wrap { height: calc(100vh - var(--hdr, 49px) - 60px); }
#gCanvas { border-radius: var(--radius-xl) !important; background: var(--color-surface-flat) !important; }

/* ---------- the Sources map ---------- */
.mapstage { position: relative; height: clamp(420px, 64vh, 720px); border-radius: var(--radius-2xl); border: 1px solid var(--color-line); margin: 4px 0 18px; overflow: hidden; }
.mapstage .hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; color: var(--color-text-3); font-size: 13px; pointer-events: none; max-width: 260px; transition: opacity .6s; }
.mapstage .hint b { display: block; color: var(--color-text-2); font-weight: var(--weight-medium); }
.mapstage .feed { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 18px; flex-wrap: wrap; align-items: center; padding: 10px 16px; font-size: 12px; color: var(--color-text-3); pointer-events: none; }
.mapstage .feed b { color: var(--color-text); font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; }
.mapstage .legend { position: absolute; left: 16px; top: 14px; display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--color-text-3); pointer-events: none; }
.mapstage .legend i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: middle; background: var(--color-accent); }
.mapstage .legend i.off { background: transparent; box-shadow: inset 0 0 0 1px var(--color-text-3); }
.mapstage .legend i.needs { background: var(--color-warn); }
.mapstage .legend i.build { background: var(--color-planned); }
@media (max-width: 760px) { .mapstage { height: 300px; min-height: 0; margin: 0 0 10px; } .mapstage .legend, .mapstage .feed { display: none; } #mapNote { display: none; } }
/* the phone list under the hero (rule 2); display: none above 760px */
.srclist { display: none; margin: 0 0 8px; }
.srclist .feed { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--color-text-3); padding: 0 2px 6px; }
.srclist .feed b { color: var(--color-text); font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; }
.srclist h4 { margin: 14px 2px 6px; font-size: 11px; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--color-text-3); font-weight: var(--weight-semibold); }
.srclist h4 span { color: var(--color-text-4); margin-left: 6px; }
.srow { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px; min-height: 56px; border: 1px solid var(--color-line); background: var(--color-surface); color: var(--color-text); border-radius: var(--radius-lg); margin-bottom: 6px; cursor: pointer; font: inherit; }
.srow i { width: 10px; height: 10px; border-radius: 50%; background: var(--color-accent); flex: none; font-style: normal; }
.srow.needs i { background: var(--color-warn); }
.srow.ghost i, .srow.later i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--color-text-3); }
.srow.later { opacity: .6; }
.srow.add i { width: 24px; height: 24px; border: 1.5px dashed var(--color-line-strong); background: transparent; box-shadow: none; display: grid; place-items: center; color: var(--color-text-3); font-size: 16px; line-height: 1; }
.srow span { flex: 1; min-width: 0; display: grid; gap: 1px; }
.srow b { font-weight: var(--weight-semibold); font-size: 14px; }
.srow small { color: var(--color-text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow em { color: var(--color-text-4); font-style: normal; font-size: 20px; line-height: 1; }
@media (max-width: 760px) { .srclist { display: block; } }
/* HTML labels over the canvas (positioned by map.js, viewport coordinates) */
.mapnode { position: absolute; left: 0; top: 0; width: 0; height: 0; border: 0; padding: 0; background: transparent; cursor: pointer; color: var(--color-text); will-change: transform, opacity; --r: 26px; transition: opacity .6s; pointer-events: auto; font: inherit; }
.mapnode .hit { position: absolute; left: calc(-1 * var(--r)); top: calc(-1 * var(--r)); width: calc(2 * var(--r)); height: calc(2 * var(--r)); border-radius: 50%; transition: box-shadow .25s; }
.mapnode:hover .hit, .mapnode:focus-visible .hit, .mapnode.sel .hit { box-shadow: inset 0 0 0 1.5px var(--button-ghost-ring); }
.mapnode.sel .hit { box-shadow: inset 0 0 0 1.5px var(--color-accent); }
.mapnode:focus-visible { outline: none; }
.mapnode .lbl { position: absolute; top: calc(var(--r) + 9px + var(--lift, 0px)); left: 0; transform: translateX(-50%); white-space: nowrap; font-size: 12px; font-weight: var(--weight-medium); color: var(--color-text-2); line-height: 1.3; text-align: center; }
.mapnode .nm { display: block; }
.mapnode .sub { display: block; font-weight: var(--weight-regular); font-size: 11px; color: var(--color-text-3); max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
/* wide screens: radial labels (map.js sets --lx/--ly and data-side) */
.mapnode[data-side] .lbl { left: var(--lx); top: var(--ly); }
.mapnode[data-side="r"] .lbl { transform: translate(0, -50%); text-align: left; }
.mapnode[data-side="l"] .lbl { transform: translate(-100%, -50%); text-align: right; }
.mapnode[data-side="t"] .lbl { transform: translate(-50%, -100%); }
.mapnode[data-side="b"] .lbl { transform: translate(-50%, 0); }
.mapnode.ghost .lbl, .mapnode.later .lbl { color: var(--color-text-3); }
.mapnode.later { opacity: .6; }
.mapnode.add .hit { border: 1.5px dashed var(--color-line-strong); color: var(--color-text-3); font-size: 22px; display: grid; place-items: center; transition: color .2s, border-color .2s; }
.mapnode.add:hover .hit { color: var(--color-text); border-color: var(--button-ghost-ring); box-shadow: none; }
.mapnode.off { opacity: 0 !important; pointer-events: none; }
@media (pointer: coarse) { .mapnode .hit { min-width: 44px; min-height: 44px; } }
@media (max-width: 900px) { .mapnode .lbl { white-space: normal; width: 104px; margin-left: -52px; transform: none; font-size: 11.5px; } .mapnode .sub { font-size: 10.5px; } }
@media (max-width: 760px) { .mapnode .lbl { display: block; width: auto; margin-left: 0; transform: translateX(-50%); white-space: nowrap; font-size: 10.5px; top: calc(var(--r) + 6px + var(--lift, 0px)); } .mapnode .sub { display: none; } }

/* ---------- the helper drawer ---------- */
#helper { position: fixed; top: var(--hdr, 57px); right: 0; bottom: 0; width: 392px; z-index: 6; border-left: 1px solid var(--color-line); display: flex; flex-direction: column; min-height: 0; background: var(--color-glass); backdrop-filter: blur(12px); transition: opacity .35s, transform .45s var(--ease-standard); }
#helper.off { opacity: 0; transform: translateX(24px); pointer-events: none; }
#helper .vhead { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--color-line); font-size: 11.5px; font-weight: var(--weight-semibold); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--color-text-3); }
#helper .vhead i { width: 8px; height: 8px; border-radius: 50%; background: var(--color-accent); box-shadow: 0 0 12px var(--color-accent); flex: none; }
#helper .vhead .sp { flex: 1; }
#helper .vhead button { background: transparent; border: 0; color: var(--color-text-3); cursor: pointer; font: var(--weight-semibold) 12px/1 var(--font-sans); padding: 6px 8px; border-radius: var(--radius-pill); letter-spacing: 0; text-transform: none; }
#helper .vhead button:hover { color: var(--color-text); background: var(--color-surface-hover); }
#helper .hctx { padding: 10px 16px 0; font-size: 12px; color: var(--color-text-3); }
#helper .hctx:empty { display: none; }
#helper .hcard { margin: 10px 16px 0; }
#helper .hcard:empty { display: none; }
#helper .hchips { padding: 10px 16px 0; display: flex; flex-wrap: wrap; gap: 6px; }
#helper .hchips button { padding: 7px 12px; border-radius: var(--radius-pill); border: 1px solid var(--color-line); background: transparent; color: var(--color-text-2); font: var(--weight-semibold) 12px/1 var(--font-sans); cursor: pointer; }
#helper .hchips button:hover { color: var(--color-text); border-color: var(--color-accent); }
#helper .chat { flex: 1; min-height: 0; border: 0; border-radius: 0; background: transparent; max-height: none; padding: 12px 16px; }
#helper .chat .msg.bot { background: var(--color-surface-hover); border: 0; border-radius: 14px 14px 14px 4px; color: var(--color-text-2); }
#helper .chat .msg.me { background: var(--color-secondary-soft); border-radius: 14px 14px 4px 14px; }
#helper .compose { display: flex; gap: 8px; align-items: flex-end; padding: 10px 16px max(12px, env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--color-line); }
#helper .compose textarea { flex: 1; min-width: 0; min-height: 40px; max-height: 160px; border-radius: var(--radius-lg); font: var(--weight-regular) 13.5px/1.4 var(--font-sans); padding: 9px 12px; resize: none; }
#helper .compose .act { padding: 9px 13px; }
#helper .compose .att { background: transparent; border: 0; color: var(--color-text-3); cursor: pointer; font-size: 17px; padding: 6px 4px; line-height: 1; }
#helper .compose .att:hover { color: var(--color-text); }
@media (max-width: 900px) { #helper { top: var(--hdr, 57px); width: 100%; z-index: 8; border-left: 0; border-top: 1px solid var(--color-line); border-radius: var(--radius-2xl) var(--radius-2xl) 0 0; background: var(--color-bg-raised); } #helper.off { transform: translateY(24px); } }

/* the inspect card the helper shows for a selected source */
.hcard .card, .srccard { padding: 14px 16px; }
.srccard .status { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: var(--weight-semibold); letter-spacing: var(--tracking-caps); text-transform: uppercase; padding: 4px 9px; border-radius: var(--radius-pill); border: 1px solid var(--color-line); color: var(--color-text-2); }
.srccard .status i { width: 7px; height: 7px; border-radius: 50%; background: var(--color-accent); }
.srccard .status.ok i { background: var(--color-ok); } .srccard .status.warn i { background: var(--color-warn); } .srccard .status.off i { background: var(--color-text-3); } .srccard .status.build i { background: var(--color-planned); }
.srccard h4 { margin: 10px 0 4px; font-size: 17px; font-weight: var(--weight-medium); letter-spacing: var(--tracking-title); line-height: 1.2; }
.srccard p { margin: 0; font-size: 13px; color: var(--color-text-2); line-height: 1.5; }
.srccard .kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 12.5px; color: var(--color-text-3); margin-top: 8px; }
.srccard .kv b { color: var(--color-text); font-weight: var(--weight-medium); font-variant-numeric: tabular-nums; font-size: 12.5px; letter-spacing: 0; line-height: 1.4; }
.srccard .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.srccard .acts select { padding: 6px 9px; font-size: 12.5px; }
.srccard .acts .act { padding: 7px 12px; font-size: 12px; }

/* a built connector's card: setting fields, test sample, the describe form */
.srccard .bfield { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--color-line); }
.srccard .bfield label { display: block; font-weight: var(--weight-semibold); font-size: 12.5px; }
.srccard .bfield small { display: block; color: var(--color-text-3); font-size: 12px; margin-top: 2px; }
.srccard .bfield details { font-size: 12px; color: var(--color-text-3); margin-top: 4px; }
.srccard .bfield ol { margin: 4px 0 0 18px; }
.srccard .bfield input { min-width: 0; }
.srccard .sample { margin: 10px 0 0; padding: 8px 10px; border-radius: var(--radius-md); background: var(--color-surface-flat); font-size: 12.5px; color: var(--color-text-2); }
.srccard .sample ul { margin: 4px 0 0 16px; padding: 0; } .srccard .sample li { margin: 2px 0; }
.srccard .sample.bad { color: var(--color-bad); }
.srccard .build { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--color-line); }
.srccard .build h4 { margin: 0 0 4px; font-size: 14px; }
.srccard .build textarea { width: 100%; min-height: 84px; margin-top: 8px; font-family: var(--font-sans); font-size: 13px; resize: vertical; }
.srccard .status.build i { background: var(--color-planned); }
.srccard h4 .pill { font-size: 10.5px; vertical-align: middle; margin-left: 6px; }
/* catalogue of sources that can be added */
.catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 8px 0 4px; }
.catalog button { text-align: left; padding: 12px 14px; border-radius: var(--radius-lg); border: 1px solid var(--color-line); background: var(--color-surface); color: var(--color-text); cursor: pointer; font: inherit; display: grid; gap: 2px; }
.catalog button:hover { border-color: var(--color-accent); }
.catalog button b { font-weight: var(--weight-semibold); font-size: 13.5px; }
.catalog button span { color: var(--color-text-3); font-size: 12px; }
.catalog button i { font-style: normal; color: var(--color-accent); font-size: 11px; font-weight: var(--weight-semibold); letter-spacing: var(--tracking-caps); text-transform: uppercase; }

@media (prefers-reduced-motion: reduce) { .ingest i, #helper, .mapnode { animation: none; transition: none; } button.act:hover:not(:disabled) { transform: none; } }

/* discovery (2026-11-15): a tool the archive says the team uses */
.srccard .status.disc { color: var(--color-accent); border-color: var(--color-accent); }
.srccard .status.disc i { background: var(--color-accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--color-accent) 22%, transparent); }
.srow.disc i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--color-accent); }
.evid { margin: 8px 0 0; }
.evid summary { cursor: pointer; font-size: 12.5px; color: var(--color-text-2); }
.evid ul { margin: 6px 0 0; padding-left: 16px; font-size: 12.5px; color: var(--color-text-2); display: grid; gap: 6px; }
.evid li b { font-size: 12px; }
.disc { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--color-line); }
.disc h4 { margin: 0 0 4px; font-size: 14px; }
.disc p { font-size: 12.5px; color: var(--color-text-2); margin: 0 0 8px; }
.disc ul.aside { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; font-size: 12.5px; }
.disc ul.aside b { font-size: 13px; font-weight: var(--weight-semibold); }
.disc .lnk { background: none; border: 0; color: var(--color-accent); cursor: pointer; font: inherit; font-size: 12.5px; padding: 0 4px; min-height: 0; }
/* connector library under "+" */
.lib { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--color-line); }
.lib h4 { margin: 0 0 4px; font-size: 14px; }
.lib p { font-size: 12.5px; color: var(--color-text-2); margin: 0 0 8px; }
.lib .catalog button small { display: block; margin-top: 3px; font-size: 11px; color: var(--color-text-3); }

/* live-tour fixes (2026-11-15) */
#ingest[hidden] { display: none !important; }
#helper { overflow: hidden; }
#helper .hcard { flex: none; max-height: 52vh; overflow: auto; }
#helper .hchips { flex: none; }
#helper .compose { flex: none; }

/* a crowded ring folds into "N more" (2026-11-15) */
.mapstage .mapback { position: absolute; right: 14px; top: 10px; z-index: 3; }
.srclist.in-card { display: block; margin: 8px 0 4px; }
.srclist.in-card .srow { min-height: 44px; padding: 6px 10px; margin-bottom: 4px; }
@media (max-width: 760px) { .mapstage .mapback { top: auto; bottom: 10px; right: 10px; } }
@media (max-width: 760px) { #pages .row > label.adm { display: none; } }   /* "View as" has no room next to Find; the select speaks for itself */
@media (max-width: 760px) { .two > * { min-width: 0; } }   /* a grid item defaults to min-width:auto and grows to its table's width — the page then scrolls sideways (Slack channels table) */

/* ---- Tasks board (Brain → Tasks): people / lane chips, three status columns, cards, the facts card ---- */
.tbbar { align-items: center; gap: 8px; flex-wrap: wrap; }
/* Agents panel */
.agdesc textarea { width: 100%; box-sizing: border-box; }
.agentlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin: 10px 0 14px; }
.agcard { background: var(--color-surface-flat); border: 1px solid var(--color-line); border-radius: var(--radius-lg); padding: 12px 14px; cursor: pointer; display: grid; gap: 4px; transition: border-color .15s; }
.agcard:hover, .agcard.on { border-color: var(--color-accent); }
.agcard .agh { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.agcard .agh b { font-weight: var(--weight-semibold); font-size: 14px; }
.agcard .agsum { font-size: 13px; }
.agcard .agm { font-size: 12px; }
.agform { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px 16px; align-items: start; margin: 6px 0 12px; }
.agform .agfield { display: grid; gap: 4px; min-width: 0; }
.agform .agfield label { font-size: 12px; color: var(--color-text-2); }
.agform textarea, .agform input[type=text], .agform input[type=number], .agform select { width: 100%; box-sizing: border-box; }
.agform .agfield:has(textarea) { grid-column: 1 / -1; }
.agtoggle { display: inline-flex; gap: 8px; align-items: center; min-height: 34px; }
.agrun { padding: 6px 0; border-top: 1px solid var(--color-line); font-size: 13px; }
.agrun ul { margin: 6px 0 0 18px; padding: 0; }
.agspec { font-size: 11.5px; white-space: pre-wrap; max-height: 360px; overflow: auto; }
.tbchips { display: flex; gap: 6px; flex-wrap: wrap; }
.tbchips button { padding: 6px 11px; border-radius: var(--radius-pill); border: 1px solid var(--color-line); background: transparent; color: var(--color-text-2); font: var(--weight-semibold) 12.5px/1 var(--font-sans); cursor: pointer; min-height: 32px; }
.tbchips button:hover { color: var(--color-text); border-color: var(--color-line-strong); }
.tbchips button.on { color: var(--button-fg); background: var(--button-bg); border-color: var(--button-bg); }
.tbchips button:disabled { opacity: .45; cursor: default; }
.tbchips button b { font-weight: var(--weight-regular); opacity: .7; margin-left: 4px; }
/* the board uses the whole width: the 1500px section cap would otherwise include the panel padding */
main#app > section#tasks { max-width: none; }
/* seven columns in one row; when the board is narrower than that it scrolls sideways instead of wrapping */
.kanban { display: grid; grid-template-columns: repeat(7, minmax(180px, 1fr)); gap: 12px; align-items: start; overflow-x: auto; padding-bottom: 6px; }
.kcol.nodrop { border-style: dashed; }
.kcard.hid { opacity: .65; }
.kcol { background: var(--color-surface-flat); border: 1px solid var(--color-line); border-radius: var(--radius-lg); padding: 10px; min-height: 160px; transition: border-color .15s, background .15s; }
.kcol.over { border-color: var(--color-accent); background: var(--color-surface); }
.kcol h4 { margin: 2px 4px 8px; font-size: 11.5px; color: var(--color-text-2); text-transform: uppercase; letter-spacing: .05em; }
.kcol h4 b { font-weight: var(--weight-regular); opacity: .7; margin-left: 4px; }
.kcard { background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius-md); padding: 10px 12px; margin: 0 0 8px; cursor: grab; transition: border-color .15s; }
.kcard:hover { border-color: var(--color-line-strong); }
.kcard.on { border-color: var(--color-accent); }
.kcard:active { cursor: grabbing; }
.kcard .kt { font-size: 13.5px; line-height: 1.35; overflow-wrap: anywhere; }
.kcard .km { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.kcard .kf { color: var(--color-text-3); font-size: 11.5px; margin-top: 6px; }
.pill.bad { color: var(--color-bad, #ff5c7a); border-color: currentColor; }
/* task detail = a fixed side panel that takes the helper's slot while a card is open; the board gets padding so no column hides under it */
#tbDetail { position: fixed; top: var(--hdr, 57px); right: 0; bottom: 0; width: min(440px, 100vw); overflow-y: auto; z-index: 7; margin: 0; border-radius: 0; border-width: 0 0 0 1px; background: var(--color-bg-raised); }
@media (min-width: 1101px) {
  section#tasks.detail-open, body.helper-on section#tasks.detail-open { padding-right: calc(440px + clamp(16px, 2.4vw, 28px)); }
}
/* up to 1100px (tablets, small laptops with the helper open) the card is a bottom sheet, so the board keeps its width */
@media (max-width: 1100px) { #tbDetail { top: auto; left: 0; width: 100%; max-height: 70vh; border-width: 1px 0 0; border-radius: var(--radius-2xl) var(--radius-2xl) 0 0; z-index: 7; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); } }
#tbDetail .tbhead { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
#tbDetail h3 { margin: 0 0 4px; }
#tbDetail .tbsum { white-space: pre-wrap; font-size: 13px; color: var(--color-text-2); }
#tbDetail .tbfact { padding: 6px 0; border-bottom: 1px solid var(--color-line); font-size: 13px; overflow-wrap: anywhere; }
#tbDetail .tbfact.old { opacity: .55; }
#tbDetail .tools button.on { border-color: var(--color-accent); color: var(--color-text); }
@media (max-width: 760px) { .kanban { grid-template-columns: 1fr; overflow-x: visible; } .tbchips#tbLanes { margin-left: 0; } }
