@font-face { font-family: "Inter"; src: url("vendor/fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("vendor/fonts/jetbrains-mono.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }
@font-face { font-family: "Symbols"; src: url("vendor/fonts/symbols.woff2") format("woff2"); unicode-range: U+E000-F8FF; font-display: block; }

/* Gruvbox when light, Catppuccin Mocha when dark. A project's colour comes in as --c; state colours
   mean one thing everywhere: yellow waits for you, red is broken, the accent is at work,
   and --git is a checkout not aligned with main. Yellow reads as a shape, and as words only in --wait-text. */
:root {
  --crust: #ebdbb2; --mantle: #f2e5bc; --base: #fbf1c7; --surface: #f9f5d7;
  --s0: #d5c4a1; --s1: #bdae93; --s2: #a89984; --o0: #928374; --o1: #7c6f64; --o2: #665c54;
  --sub: #504945; --text: #3c3836; --strong: #282828;
  --rosewater: #af3a03; --flamingo: #af3a03; --pink: #8f3f71; --mauve: #8f3f71; --red: #9d0006;
  --peach: #af3a03; --yellow: #b57614; --git: #076678; --sky: #076678; --sapphire: #427b58; --blue: #076678; --lavender: #8f3f71;
  --accent: var(--mauve); --wait: var(--yellow); --wait-text: #805210; --bad: var(--red); --work: #1e66f5;
  --line: color-mix(in srgb, var(--strong) 10%, transparent);
  --hover: color-mix(in srgb, var(--strong) 6%, transparent);
  --shadow: 0 1px 2px rgb(60 56 54 / 8%), 0 8px 24px rgb(60 56 54 / 8%);
  --glow: 16%; --glow2: 9%;
  --term: #fbf1c7;
  --radius: 14px;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --crust: #11111b; --mantle: #181825; --base: #1e1e2e; --surface: #24243a;
    --s0: #313244; --s1: #45475a; --s2: #585b70; --o0: #6c7086; --o1: #7f849c; --o2: #9399b2;
    --sub: #a6adc8; --text: #cdd6f4; --strong: #eceffc;
    --rosewater: #f5e0dc; --flamingo: #f2cdcd; --pink: #f5c2e7; --mauve: #cba6f7; --red: #f38ba8;
    --peach: #fab387; --yellow: #f9e2af; --wait-text: #f9e2af; --work: #89b4fa; --git: #89dceb; --sky: #89dceb; --sapphire: #74c7ec; --blue: #89b4fa; --lavender: #b4befe;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 12px 32px rgb(0 0 0 / 28%);
    --glow: 20%; --glow2: 11%;
    --term: #1e1e2e;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --crust: #11111b; --mantle: #181825; --base: #1e1e2e; --surface: #24243a;
  --s0: #313244; --s1: #45475a; --s2: #585b70; --o0: #6c7086; --o1: #7f849c; --o2: #9399b2;
  --sub: #a6adc8; --text: #cdd6f4; --strong: #eceffc;
  --rosewater: #f5e0dc; --flamingo: #f2cdcd; --pink: #f5c2e7; --mauve: #cba6f7; --red: #f38ba8;
  --peach: #fab387; --yellow: #f9e2af; --wait-text: #f9e2af; --work: #89b4fa; --git: #89dceb; --sky: #89dceb; --sapphire: #74c7ec; --blue: #89b4fa; --lavender: #b4befe;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 12px 32px rgb(0 0 0 / 28%);
  --glow: 20%; --glow2: 11%;
  --term: #1e1e2e;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; }
body {
  margin: 0; background: var(--crust); color: var(--text); font: 450 14.5px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss03";
  overflow: hidden;
}
h1, h2, p { margin: 0; }
h1, h2, b { color: var(--strong); font-weight: 620; letter-spacing: -.012em; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: default; opacity: .42; }
code { font: 450 13px/1 var(--mono); }
kbd { font: 500 11.5px/1 var(--mono); color: var(--o2); }
em { font-style: normal; }
:focus-visible { outline: 2px solid color-mix(in srgb, var(--c, var(--accent)) 70%, transparent); outline-offset: 2px; }
.icon { flex: none; display: block; }

/* View transitions: only the main panel moves, and fast */
.main { view-transition-name: main; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-old(main) { animation: fade-out 90ms ease both; }
::view-transition-new(main) { animation: rise-in 170ms var(--ease) both; }
::view-transition-group(*) { animation-duration: 190ms; animation-timing-function: var(--ease); }
@keyframes fade-out { to { opacity: 0; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(5px); } }

/* Shell */
.shell { display: grid; grid-template-columns: clamp(220px, var(--side), 60vw) minmax(0, 1fr); height: 100%; padding: 8px 8px 8px 0; }
.top-bar { display: none; }
.main { background: var(--base); border-radius: var(--radius); overflow: hidden; min-height: 0; box-shadow: 0 0 0 1px var(--line); }

/* Sidebar */
.side { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 12px 10px 8px 14px; gap: 3px; }
.side-top { flex: none; display: flex; align-items: flex-start; justify-content: space-between; }
.side-top .brand { flex: 1; min-width: 0; }
.side-grip { position: absolute; top: 8px; bottom: 8px; right: -5px; z-index: 3; width: 10px; cursor: col-resize; touch-action: none; outline: 0; }
.side-grip::after { content: ""; position: absolute; inset: 0 4px; border-radius: 1px; transition: background 120ms; }
.side-grip:hover::after, .side-grip:focus-visible::after, .resizing .side-grip::after { background: var(--accent); }
.resizing { cursor: col-resize; user-select: none; -webkit-user-select: none; }
.rail { display: none; flex-direction: column; align-items: center; gap: 8px; padding-top: 8px; }
.rail .count { margin: 0; }
.side-scrim { display: none; }
@media (min-width: 861px) {
  .shell.no-tree { grid-template-columns: 44px minmax(0, 1fr); }
  .shell.no-tree .side { display: none; }
  .shell.no-tree .rail { display: flex; }
}
.brand { display: flex; align-items: center; gap: 9px; padding: 4px 6px 12px; color: var(--strong); font-weight: 650; font-size: 16px; letter-spacing: -.02em; }
.brand-mark {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; color: var(--crust);
  background: linear-gradient(135deg, var(--mauve), var(--blue));
}
.find {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 36px; padding: 0 10px; margin-bottom: 8px;
  color: var(--o2); background: var(--mantle); border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); text-align: left;
  transition: color 120ms, box-shadow 120ms;
}
.find:hover { color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.find span { flex: 1; font-size: 13.5px; white-space: nowrap; }
.nav { display: grid; gap: 1px; }
.nav a {
  display: flex; align-items: center; gap: 9px; height: 35px; padding: 0 9px; border-radius: 9px; color: var(--sub);
  transition: background 110ms, color 110ms;
}
.nav a:hover { background: var(--hover); color: var(--text); }
.nav a.on { background: var(--hover); color: var(--strong); font-weight: 560; }
.count { margin-left: auto; min-width: 19px; padding: 2px 5px; border-radius: 9px; background: var(--wait); color: #11111b; font: 650 12px/1.2 var(--sans); text-align: center; }
.side-title { padding: 15px 9px 5px; color: var(--o1); font-size: 12px; font-weight: 560; letter-spacing: .02em; }
.side-switch { flex: none; display: flex; align-items: center; gap: 2px; padding: 11px 0 3px 9px; }
.side-switch .side-title { flex: 1; padding: 0; }
.side-scroll { flex: 1 1 0; min-height: 30px; overflow: auto; scrollbar-width: thin; }
.side-item {
  position: relative; display: flex; align-items: center; gap: 5px; height: 31px; padding: 0 4px 0 3px; border-radius: 8px; color: var(--text); font-size: 13.5px; font-weight: 580;
  transition: background 110ms, color 110ms;
}
.side-item:hover { background: var(--hover); }
.side-arrow { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: var(--o1); transition: transform 120ms var(--ease); }
.side-arrow:hover { color: var(--strong); }
.side-arrow.closed { transform: rotate(-90deg); }
.add-button { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: var(--o1); }
.add-button:hover:not(:disabled) { background: var(--hover); color: var(--strong); }
.add-button:disabled { opacity: .35; cursor: default; }
.side-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item.working .side-name, .side-tab.working span:not(.dot) { color: var(--accent); }
.side-state { display: flex; gap: 4px; align-items: center; color: var(--o1); font-size: 12px; font-weight: 450; white-space: nowrap; }
.side-tree { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; margin: 0 0 4px 13px; padding-left: 3px; border-left: 1px solid var(--line); }
/* On a repo's row the name and the state of its copy share the width, and the counters stay whole. */
.side-tree > .side-item .side-name { flex: 1 1 0; min-width: 48px; }
.side-tree > .side-item .git { flex: 0 1 auto; min-width: 0; overflow: hidden; }
.side-tree > .side-item .git > * { flex: none; }
.side-tree > .side-item .git .git-branch { flex: 0 1 auto; min-width: 0; }
.side-item .hint { display: none; }
.side-item .star { display: none; width: 25px; height: 25px; margin: 0 -3px 0 0; }
.side-item .star:focus-visible { display: grid; }
@media (hover: hover) {
  .side-item .hint { display: block; }     /* a shortcut means nothing with no keyboard */
  .side-item:hover .star { display: grid; }
}
.side-rest { margin-top: auto; flex: none; }
.side-tab { display: flex; align-items: center; gap: 8px; width: 100%; height: 28px; padding: 0 8px; border-radius: 7px; color: var(--sub); font-size: 13px; text-align: left; transition: background 110ms, color 110ms; }
.side-tab:hover { background: var(--hover); color: var(--text); }
.side-tab.on { background: var(--hover); color: var(--strong); }
.side-tab span:not(.dot) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.git { flex: none; display: inline-flex; align-items: center; gap: 5px; min-width: 0; color: var(--o2); font-size: 12px; font-style: normal; font-weight: 450; white-space: nowrap; }
.git i { color: var(--o1); font-style: normal; }
.git b { color: var(--git); font-weight: 560; }
.git .git-branch { max-width: 130px; overflow: hidden; text-overflow: ellipsis; color: inherit; font-weight: 450; }
.git .git-branch.off { color: var(--git); font-weight: 560; }
.git .git-clean { color: var(--o1); }
.card-git { display: flex; flex-wrap: wrap; gap: 3px 12px; min-height: 17px; }
.agent-mark { flex: none; vertical-align: -2px; color: var(--strong); }     /* Codex and Kimi are black or white, as their brands */
.agent-mark.claude { color: #d97757; }
.agent-mark.terminal, .agent-mark.conclave { color: var(--o2); }
.agent-mark.in-room { color: var(--accent); animation: talk 1.6s ease-in-out infinite; }
@keyframes talk { 50% { opacity: .55; transform: scale(1.22); } }
.limits { display: grid; grid-template-columns: 18px repeat(var(--windows), minmax(0, 1fr)); gap: 3px 8px; align-items: start; padding: 12px 9px 0; font-size: 13px; color: var(--sub); }
.limit-name { align-self: end; padding-bottom: 2px; color: var(--o1); font-size: 11.5px; }
.limit-agent { line-height: 18px; }
.limit { display: grid; gap: 2px; font-size: 12px; line-height: 16px; }
.limit b { color: var(--text); font-weight: 560; }
.limit small { color: var(--o1); font-size: 11px; line-height: 14px; }
.limit.none { color: var(--o1); }
.meter { display: block; height: 4px; border-radius: 3px; background: var(--s0); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 3px; background: var(--accent); transition: width 300ms var(--ease); }
.meter.wait i { background: var(--wait); }
.meter.bad i { background: var(--bad); }
.side-foot { display: flex; align-items: center; justify-content: space-between; padding: 9px 6px 2px 9px; }
.tag { color: var(--o1); font-size: 12px; }
.tag.bad { color: var(--bad); }
.side-foot span:last-child { display: flex; }
.icon-button { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: var(--o2); transition: background 110ms, color 110ms; }
.icon-button:hover { background: var(--hover); color: var(--strong); }

/* State */
.dot { flex: none; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--o0); }
.dot.idle, .dot.closed, .dot.gone { background: var(--o0); }
/* At work: a trail of light turning round the dot. It stays over the dot, so that nothing beside it moves. */
.dot.working, .dot.starting { position: relative; background: var(--work); }
.dot.working::before, .dot.starting::before {
  content: ""; position: absolute; inset: -6px; border-radius: 50%; will-change: transform; animation: swirl 1.1s linear infinite;
  background: conic-gradient(transparent 20%, color-mix(in srgb, var(--work) 30%, transparent) 60%, var(--work));
  -webkit-mask: radial-gradient(closest-side, transparent 63%, #000 73%, #000 80%, transparent 92%);
  mask: radial-gradient(closest-side, transparent 63%, #000 73%, #000 80%, transparent 92%);
}
.side-state .dot.working, .side-state .dot.starting { margin: 0 6px; }
.dot.count { display: inline-flex; align-items: center; justify-content: center; background: none; color: var(--work); font-size: 11px; font-weight: 650; line-height: 1; font-variant-numeric: tabular-nums; }
.dot.waiting { background: var(--wait); box-shadow: 0 0 0 3px color-mix(in srgb, var(--wait) 24%, transparent); animation: call 2.2s ease-in-out infinite; }
.dot.broken { background: var(--bad); }
@keyframes swirl { to { transform: rotate(360deg); } }
@keyframes call { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--wait) 12%, transparent); } }

/* Ring */
.ring { position: relative; flex: none; display: inline-grid; place-items: center; color: var(--c, var(--accent)); }
.ring svg { display: block; }
.ring-track { fill: none; stroke: var(--s0); }
.ring-value { fill: none; stroke: currentColor; transition: stroke-dashoffset 420ms var(--ease); }
.ring.wait { color: var(--wait); }
.ring.bad { color: var(--bad); }
.weight { flex: none; color: var(--o2); font: 560 12px/1 var(--sans); font-variant-numeric: tabular-nums; }
.weight.wait { color: var(--wait-text); }
.weight.bad { color: var(--bad); }
.ring-label { position: absolute; color: var(--strong); font: 620 11.5px/1 var(--sans); font-variant-numeric: tabular-nums; }

/* Tiles */
.tile {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--sub);
  background: var(--s0);
  font: 680 13px/1 var(--sans); letter-spacing: -.02em;
}
.tile.small { width: 22px; height: 22px; border-radius: 7px; font-size: 9.5px; }
.tile.working { color: var(--crust); background: var(--accent); }

/* Pages */
.page { height: 100%; overflow: auto; padding: 26px 30px 34px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.page-head h1 { font-size: 24px; letter-spacing: -.024em; }
.page-head p { margin-top: 2px; color: var(--o2); }
.page-tools { display: flex; align-items: center; gap: 10px; min-width: 0; }
.page-tools .filter { min-width: 0; }
.filter {
  display: flex; align-items: center; gap: 8px; width: 250px; height: 34px; padding: 0 11px; color: var(--o2);
  background: var(--mantle); border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line);
}
.filter:focus-within { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent); }
.filter input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); }

.asking { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; margin-bottom: 18px; }
.ask {
  display: flex; align-items: center; gap: 11px; padding: 11px 13px; text-align: left; border-radius: 12px;
  background: color-mix(in srgb, var(--wait) 11%, var(--mantle)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--wait) 34%, transparent);
  transition: transform 140ms var(--ease), box-shadow 140ms;
}
.ask.broken { background: color-mix(in srgb, var(--bad) 10%, var(--mantle)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 34%, transparent); }
.ask:hover { transform: translateY(-1px); }
.ask-text { flex: 1; min-width: 0; display: grid; }
.ask-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--sub); font-size: 13.5px; }
.ask em { color: var(--o2); font-size: 13px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 13px; min-height: 148px; padding: 15px; overflow: hidden; border-radius: var(--radius);
  background:
    radial-gradient(440px 170px at 0 0, color-mix(in srgb, var(--c) var(--glow), transparent), transparent),
    radial-gradient(340px 150px at 100% 100%, color-mix(in srgb, var(--c2) var(--glow2), transparent), transparent), var(--mantle);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: transform 150ms var(--ease), box-shadow 150ms;
}
.card:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 42%, transparent), var(--shadow); }
.card-head { display: flex; align-items: center; gap: 11px; }
.cards-title { display: flex; align-items: center; gap: 7px; margin: 22px 0 10px; color: var(--sub); font-size: 15px; font-weight: 580; }
.cards-title:first-of-type { margin-top: 4px; }
.star { flex: none; display: grid; place-items: center; width: 30px; height: 30px; margin-left: auto; border-radius: 8px; color: var(--s2); transition: color 110ms, background 110ms, transform 110ms; }
.star:hover { color: var(--c, var(--accent)); background: var(--hover); }
.star:active { transform: scale(.88); }
.star.on { color: var(--c, var(--accent)); }
.star.on svg { fill: currentColor; }
.card-title { flex: 1; min-width: 0; }
.card-title h2 { font-size: 16px; }
.card-title p { color: var(--o2); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-agents { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; align-items: center; }
.card-off { color: var(--o1); font-size: 13.5px; }
.card-commit { display: flex; align-items: center; gap: 8px; margin-top: auto; color: var(--o2); font-size: 13px; }
.card-commit code { color: var(--o1); font-size: 12px; }
.card-commit span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-commit em { flex: none; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 9px; border-radius: 8px; color: var(--text); font-size: 13.5px; font-weight: 520;
  background: color-mix(in srgb, var(--strong) 5%, transparent); transition: background 110ms;
}
.chip:hover { background: color-mix(in srgb, var(--strong) 10%, transparent); }
.chip.waiting { background: color-mix(in srgb, var(--wait) 14%, transparent); }
.chip.broken { background: color-mix(in srgb, var(--bad) 13%, transparent); }
.chip-machine { color: var(--o2); font-weight: 450; font-size: 12.5px; }

/* Project: the terminal is the page, so what stands above it is small: the tabs, the project, the session. */
.project { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 6px 10px 8px; min-height: 0;
  background:
    radial-gradient(760px 260px at 0 -60px, color-mix(in srgb, var(--c) var(--glow), transparent), transparent),
    radial-gradient(620px 240px at 100% -70px, color-mix(in srgb, var(--c2) var(--glow2), transparent), transparent); }
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; min-height: 24px; }
.hero h1 { flex: none; display: flex; align-items: center; gap: 2px; font-size: 15px; line-height: 20px; white-space: nowrap; }
.hero h1 .star { width: 20px; height: 20px; margin-left: 0; border-radius: 6px; }
.hero-where { flex: 1 1 auto; display: flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; color: var(--o2); font-size: 12px; white-space: nowrap; }
.hero-where code { font-size: 12px; }
.hero-what { flex: 1 1 0; width: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sep { width: 3px; height: 3px; margin: 0 3px; border-radius: 50%; background: var(--o0); flex: none; }

.work { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.tabs { flex: none; display: flex; align-items: center; gap: 2px; min-width: 0; }
.tab-list { display: flex; align-items: center; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tab-list::-webkit-scrollbar { display: none; }
.tab {
  flex: none; display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 7px; border-radius: 7px; color: var(--sub); font-size: 12.5px; font-weight: 520;
  transition: background 110ms, color 110ms;
}
.tab:hover { background: var(--hover); color: var(--text); }
.tab.on { position: relative; color: var(--strong); background: color-mix(in srgb, var(--c) 16%, transparent); }
.tab.on::after { content: ""; position: absolute; left: 7px; right: 7px; bottom: 0; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--c), var(--c2)); }
.tab em { color: var(--o2); font-size: 12px; font-weight: 450; }
.tab-title { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.notice {
  display: flex; align-items: center; gap: 7px; padding: 3px 9px; border-radius: 7px; color: var(--strong); font-size: 12.5px;
  background: color-mix(in srgb, var(--wait) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--wait) 30%, transparent);
}
.notice .icon { color: var(--wait); }
.notice.broken { background: color-mix(in srgb, var(--bad) 13%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 30%, transparent); }
.notice.broken .icon { color: var(--bad); }
.notice button { margin-left: auto; color: var(--c, var(--bad)); font-weight: 600; }
.notice-lines { display: grid; gap: 1px; min-width: 0; overflow-wrap: anywhere; }
.notice-lines span { color: var(--text); font-size: 13px; }
.notice.unpulled { padding: 11px 13px; animation: alarm 1.1s ease-in-out infinite; }
.notice.unpulled button { flex: none; padding: 6px 13px; border-radius: 8px; color: var(--crust); background: var(--bad); }
.side-item.unpulled { animation: alarm 1.1s ease-in-out infinite; }
@keyframes alarm { 50% { background: color-mix(in srgb, var(--bad) 38%, transparent); box-shadow: inset 0 0 0 2px var(--bad); } }

.toolbar { container-type: inline-size; display: flex; align-items: center; gap: 7px; min-height: 28px; }
.toolbar .ring-label { font-size: 10px; letter-spacing: -.03em; }
.toolbar-info { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.toolbar-title { flex: 0 3 auto; min-width: 40px; color: var(--strong); font-size: 13px; font-weight: 580; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toolbar-meta { flex: 0 1 auto; display: flex; align-items: center; gap: 9px; min-width: 0; color: var(--o2); font-size: 12px; white-space: nowrap; overflow: hidden; }
.toolbar-meta > :last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.state { flex: none; display: inline-flex; align-items: center; gap: 5px; color: var(--sub); font-weight: 540; }
.state.waiting { height: 20px; padding: 0 7px; border-radius: 6px; color: var(--wait-text); background: color-mix(in srgb, var(--wait) 14%, transparent); }
.state.broken { color: var(--bad); }
.toolbar-actions { flex: none; display: flex; align-items: center; gap: 1px; }
.toolbar .button { height: 26px; padding: 0 7px; gap: 4px; border-radius: 7px; font-size: 12.5px; }
.toolbar .button .icon { width: 15px; height: 15px; }
.toolbar .button.primary { height: 22px; padding: 0 7px; gap: 3px; border-radius: 6px; font-size: 12px; }
.toolbar .button.primary .icon { width: 13px; height: 13px; }
.button {
  display: inline-flex; align-items: center; gap: 6px; height: 35px; padding: 0 11px; border-radius: 9px; color: var(--sub); font-size: 13.5px; font-weight: 540; white-space: nowrap;
  transition: background 110ms, color 110ms, transform 90ms;
}
.button:hover:not(:disabled) { background: var(--hover); color: var(--strong); }
.button:active:not(:disabled) { transform: scale(.97); }
.button.primary { color: var(--crust); background: linear-gradient(120deg, var(--c, var(--accent)), var(--c2, var(--blue))); margin-right: 4px; font-weight: 620; }
.button.primary:hover:not(:disabled) { color: var(--crust); background: linear-gradient(120deg, var(--c, var(--accent)), var(--c2, var(--blue))); filter: brightness(1.08); }
.button.primary.heavy-wait, .button.primary.heavy-wait:hover:not(:disabled) { color: #11111b; background: var(--wait); }
.button.primary.heavy-bad, .button.primary.heavy-bad:hover:not(:disabled) { color: var(--crust); background: var(--bad); }
.button.soft { color: var(--strong); background: color-mix(in srgb, var(--c) 16%, transparent); }
.button.soft:hover:not(:disabled) { background: color-mix(in srgb, var(--c) 26%, transparent); }
.button.quiet { color: var(--o2); }
@container (max-width: 1300px) { .toolbar-actions .button:not(.primary) span { display: none; } }

.term {
  position: relative; flex: 1; min-height: 0; padding: 7px 4px 5px 9px; overflow: hidden; border-radius: 9px; background: var(--term);
  box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow 220ms;
}
.term.working::before, .term.starting::before {
  content: ""; position: absolute; top: 0; left: 0; z-index: 2; width: 34%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--c), var(--c2), transparent); animation: sweep 2.4s ease-in-out infinite;
}
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.term.working { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 42%, transparent); }
.term.waiting { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--wait) 55%, transparent); }
.term.broken { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 50%, transparent); }
.term-host, .term-surface { width: 100%; height: 100%; }
@media (pointer: coarse) {
  .term-surface { touch-action: none; }
  .tab, .toolbar .button { height: 32px; }      /* a finger needs more than a pointer */
  .toolbar .button { min-width: 32px; justify-content: center; }
  .toolbar .button.primary { height: 26px; }
  .side-item, .nav a { height: 40px; }
  .side-tab { height: 38px; }
  .side-arrow, .add-button { width: 32px; height: 32px; }
  .side-grip { right: -10px; width: 20px; }
  .side-grip::after { inset: 0 9px; }
  .find kbd { display: none; }
  .select-box select, .dialog-input { height: 40px; font-size: 16px; }     /* below 16 px iOS zooms into a field */
}
.touch-input { flex: none; display: grid; gap: 6px; }
.touch-line { display: flex; align-items: stretch; gap: 6px; }
.touch-line textarea { flex: 1; min-width: 0; padding: 8px 10px; resize: none; border: 0; border-radius: 10px; font: 16px/1.3 var(--sans); color: var(--text); background: var(--mantle); box-shadow: inset 0 0 0 1px var(--line); }
.touch-line .button { height: auto; margin: 0; }
.touch-keys { display: flex; gap: 5px; overflow-x: auto; }
.touch-keys button { flex: 1; min-width: 52px; height: 36px; border-radius: 9px; color: var(--strong); font-size: 13.5px; font-weight: 540; background: var(--hover); box-shadow: inset 0 0 0 1px var(--line); }
.term-surface .xterm-viewport { background: transparent !important; }
.xterm .xterm-scrollable-element > .scrollbar > .slider { border-radius: 5px; }


.select-label { color: var(--o2); font-size: 13px; white-space: nowrap; }
.session-menu {
  position: fixed; z-index: 40; display: grid; gap: 2px; padding: 6px; border-radius: 13px; background: var(--surface);
  box-shadow: 0 0 0 1px var(--line), 0 16px 44px rgb(0 0 0 / 32%); animation: lift 130ms var(--ease) backwards;
}
.session-menu { min-width: 220px; }
/* A right click selects the word under it: not on what opens a menu. */
.tab, .side-item, .card, .chip, .board-item, .ask { -webkit-user-select: none; user-select: none; }
.session-menu button { display: flex; align-items: center; gap: 9px; height: 36px; padding: 0 11px; border-radius: 9px; text-align: left; color: var(--text); font-weight: 520; transition: background 90ms; }
.session-menu button:hover, .session-menu button:focus-visible { background: var(--hover); outline: 0; }
.session-menu span { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-menu em { margin-left: auto; padding-left: 14px; color: var(--o2); font-size: 12.5px; font-weight: 450; font-style: normal; }

.launch { display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; gap: 11px; flex: 1; width: min(560px, 100%); margin: 0 auto; }
.launch h2 { font-size: 21px; letter-spacing: -.02em; }
.launch p { margin-top: -6px; color: var(--o2); }
.recent { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; margin-top: 8px; }
.recent-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 0 5px 10px; }
.recent-head h3 { flex: none; color: var(--o2); font-size: 13px; font-weight: 540; }
.recent-head .filter { flex: 1; max-width: 240px; }
.recent-none { padding: 6px 10px; color: var(--o2); font-size: 13.5px; }
.recent-item { display: flex; align-items: center; gap: 12px; min-height: 36px; padding: 0 10px; border-radius: 9px; text-align: left; color: var(--sub); transition: background 110ms, color 110ms; }
.recent-item:hover, .recent-item:focus-visible { background: var(--hover); color: var(--strong); outline: 0; }
.recent-item b { flex: 1; min-width: 0; font-weight: 520; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-item span { flex: none; color: var(--o2); font-size: 12.5px; }
.launch-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.launch-actions { display: flex; align-items: center; justify-content: space-between; }
.launch-actions .button.primary { justify-content: center; min-width: 130px; height: 39px; margin-right: 0; }

/* Board */
.page.wide { display: flex; flex-direction: column; }
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); grid-auto-flow: dense; grid-auto-rows: 196px; gap: 10px; }
.board-empty { color: var(--o2); }
.board-limits { display: none; margin-bottom: 14px; }
.board-item {
  display: flex; flex-direction: column; min-height: 0; padding: 10px 12px; overflow: hidden; text-align: left; border-radius: 12px; background: var(--term);
  box-shadow: inset 0 0 0 1px var(--line); transition: transform 180ms var(--ease), box-shadow 150ms;
}
.board-item:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 45%, transparent), var(--shadow); }
.board-item.waiting { grid-column: span 2; grid-row: span 2; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--wait) 60%, transparent), 0 0 34px color-mix(in srgb, var(--wait) 10%, transparent); }
.board-item.broken { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 50%, transparent); }
.board-head { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; }
.board-head span:not(.tile):not(.ring):not(.ring-label) { flex: 1; min-width: 0; color: var(--o2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-item pre { flex: 1; min-height: 0; margin: 0; overflow: hidden; color: var(--sub); font: 450 12px/1.42 var(--mono); white-space: pre-wrap; }
.board-item.waiting pre { font-size: 13.5px; color: var(--text); }

/* Dialogs */
.backdrop {
  position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px;
  background: color-mix(in srgb, var(--crust) 62%, transparent); backdrop-filter: blur(6px) saturate(1.2);
  animation: appear 120ms ease both;
}
.backdrop.top { place-items: start center; padding-top: 13vh; }
@keyframes appear { from { opacity: 0; } }
@keyframes lift { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.dialog {
  display: flex; flex-direction: column; width: min(560px, 100%); max-height: 86vh; border-radius: 16px; overflow: hidden;
  background: var(--base); box-shadow: 0 0 0 1px var(--line), 0 24px 64px rgb(0 0 0 / 34%); animation: lift 170ms var(--ease) backwards;
}
.dialog header { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 8px 18px; }
.dialog header h2 { font-size: 17px; }
.dialog-body { display: grid; grid-auto-rows: max-content; gap: 9px; padding: 6px 18px 16px; overflow: auto; }
.dialog footer { display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 11px 14px; background: var(--mantle); box-shadow: inset 0 1px 0 var(--line); }
.foot-note { flex: 1; display: flex; align-items: center; gap: 6px; color: var(--o2); font-size: 13.5px; }
.dialog-note { display: flex; align-items: flex-start; gap: 7px; color: var(--sub); }
.dialog-note .icon { margin-top: 3px; }
.dialog-note.warn { color: var(--wait-text); }
.dialog-input { width: 100%; height: 38px; padding: 0 11px; border: 0; border-radius: 9px; outline: 0; background: var(--mantle); color: var(--text); font: inherit; box-shadow: inset 0 0 0 1px var(--line); }
.dialog-input:focus { box-shadow: inset 0 0 0 1.5px var(--accent); }
textarea:disabled { color: var(--o2); }

.choice {
  display: flex; gap: 11px; padding: 11px 12px; border-radius: 11px; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow 120ms, background 120ms;
}
.choice:hover { background: var(--hover); }
.choice.on { background: color-mix(in srgb, var(--c, var(--accent)) 10%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c, var(--accent)) 60%, transparent); }
.radio { flex: none; width: 16px; height: 16px; margin-top: 2px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--s2); transition: box-shadow 120ms; }
.choice.on .radio { box-shadow: inset 0 0 0 5px var(--c, var(--accent)); }
.choice-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.choice-text span { color: var(--sub); font-size: 13.5px; }
.choice-text textarea, .choice-text .pills { margin-top: 8px; }
textarea, .field input {
  width: 100%; padding: 9px 11px; resize: vertical; border: 0; border-radius: 9px; outline: 0; background: var(--mantle); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; line-height: 1.5;
}
textarea:focus, .field input:focus { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 60%, transparent); }
.pills { display: flex; flex-wrap: wrap; gap: 5px; }
.pill { height: 32px; padding: 0 10px; border-radius: 8px; color: var(--sub); font-size: 13.5px; font-weight: 520; box-shadow: inset 0 0 0 1px var(--line); transition: background 110ms, color 110ms; }
.pill:hover { background: var(--hover); color: var(--strong); }
.pill.on { color: var(--crust); background: var(--c, var(--accent)); box-shadow: none; font-weight: 600; }
.pill:disabled { opacity: .4; cursor: default; }
.pill.mark { display: inline-grid; place-items: center; width: 44px; padding: 0; }
.pill.mark.on { background: color-mix(in srgb, var(--c, var(--accent)) 18%, transparent); box-shadow: inset 0 0 0 1.5px var(--c, var(--accent)); }     /* a logo keeps its colours */
.pill.add-all { display: inline-flex; align-items: center; margin-left: auto; box-shadow: none; color: var(--o2); }
.choices { display: grid; gap: 5px; }
.select-box { position: relative; display: block; max-width: 300px; }
.select-box select {
  width: 100%; height: 36px; padding: 0 30px 0 11px; border: 0; border-radius: 9px; outline: 0; -webkit-appearance: none; appearance: none;
  background: var(--mantle); color: var(--text); font: 500 13.5px/1.2 var(--sans); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer;
}
.select-box select:focus-visible { box-shadow: inset 0 0 0 1.5px var(--accent); }
.select-box select:disabled { color: var(--o2); cursor: default; }
.select-box .icon { position: absolute; top: 50%; right: 9px; color: var(--o1); transform: translateY(-50%); pointer-events: none; }
.add-kinds { display: flex; gap: 6px; margin-bottom: 4px; }
.add-kind { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; height: 46px; border-radius: 11px; color: var(--sub); font-size: 15px; font-weight: 580; box-shadow: inset 0 0 0 1px var(--line); transition: background 110ms, color 110ms; }
.add-kind:hover { background: var(--hover); color: var(--strong); }
.add-kind.on { color: var(--strong); background: color-mix(in srgb, var(--accent) 15%, transparent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.add-filter { width: 100%; box-sizing: border-box; }
.add-projects { display: grid; gap: 1px; max-height: 196px; overflow: auto; }
.add-project { display: flex; align-items: baseline; gap: 10px; min-width: 0; padding: 7px 10px; border-radius: 8px; color: var(--sub); text-align: left; }
.add-project:hover:not(:disabled) { background: var(--hover); color: var(--strong); }
.add-project:disabled { opacity: .45; cursor: default; }
.add-project.on { color: var(--strong); background: color-mix(in srgb, var(--accent) 15%, transparent); }
.add-project b { flex: none; font-weight: 560; }
.add-project span { min-width: 0; overflow: hidden; color: var(--o2); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.field { display: grid; gap: 7px; }
.field label { color: var(--o2); font-size: 13px; font-weight: 540; }
.room-members { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.room-ask { display: grid; gap: 8px; margin-bottom: 12px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--wait) 11%, var(--mantle)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--wait) 35%, transparent); }
.room-ask p { color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.room-actions { display: flex; gap: 6px; justify-content: flex-end; }
.room-feed { display: grid; gap: 10px; margin: 0 0 14px; padding: 0; list-style: none; }
.room-feed li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 2px 12px; color: var(--text); }
.room-feed li b { font-weight: 580; overflow: hidden; text-overflow: ellipsis; }
.room-feed li em { grid-column: 2; color: var(--accent); font-size: 12px; font-style: normal; font-weight: 580; }
.room-feed li span { grid-column: 2; white-space: pre-wrap; overflow-wrap: anywhere; }
.room-feed li.quiet { color: var(--o2); font-size: 13px; }
.room-feed li.quiet b { font-weight: 450; }
.room-say { display: flex; gap: 8px; align-items: stretch; }
.room-say textarea { flex: 1; min-width: 0; }
.room-say .button { height: auto; }
.room-report { padding: 14px 16px; border-radius: 12px; background: var(--mantle); color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.55 var(--mono); }
.move-route { display: flex; align-items: center; gap: 10px; color: var(--o2); }
.move-from { color: var(--strong); font-weight: 600; }
.steps { display: grid; gap: 7px; margin: 5px 0 0; padding: 0; list-style: none; color: var(--sub); font-size: 13.5px; }
.steps li { display: flex; align-items: center; gap: 9px; transition: color 150ms; }
.step-mark { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; background: var(--s0); color: var(--sub); font: 620 12px/1 var(--sans); transition: background 160ms, color 160ms; }
.steps li.now { color: var(--strong); }
.steps li.now .step-mark { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.list { display: grid; gap: 4px; }
.list-item { display: grid; gap: 1px; padding: 9px 11px; text-align: left; border-radius: 10px; transition: background 110ms; }
.list-item:hover { background: var(--hover); }
.list-item span { color: var(--sub); font-size: 13.5px; }
.list-item.chat { width: 100%; }
.list-item.chat b { overflow: hidden; font-weight: 560; text-overflow: ellipsis; white-space: nowrap; }
.list-item.chat small { overflow: hidden; color: var(--sub); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.list-item.chat code { color: var(--o1); font-size: 12px; user-select: text; }
.open-tag { color: var(--c, var(--accent)); font-weight: 600; }
.dialog.wide { width: min(780px, 100%); height: min(720px, 86vh); }
.history-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.history-head .filter { width: auto; height: 42px; border-radius: 11px; }
.history-count { color: var(--o2); font-size: 13px; }

/* Palette */
.palette { width: min(590px, 100%); border-radius: 15px; overflow: hidden; background: var(--base); box-shadow: 0 0 0 1px var(--line), 0 24px 64px rgb(0 0 0 / 34%); animation: lift 150ms var(--ease) both; }
.palette-input { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 16px; color: var(--o2); box-shadow: inset 0 -1px 0 var(--line); }
.palette-input input { flex: 1; background: none; border: 0; outline: 0; color: var(--strong); font-size: 16px; }
.palette-list { max-height: 380px; padding: 6px; overflow: auto; }
.palette-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 38px; padding: 0 10px; border-radius: 9px; text-align: left; }
.palette-item.on { background: var(--hover); }
.palette-item b { font-weight: 560; }
.palette-item span:last-child { min-width: 0; overflow: hidden; color: var(--o2); font-size: 13.5px; text-overflow: ellipsis; white-space: nowrap; }
.palette-icon { display: grid; place-items: center; width: 22px; height: 22px; color: var(--sub); }
.palette-empty { padding: 16px; color: var(--o2); text-align: center; }

/* Toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 30; display: grid; gap: 7px; }
.toast { padding: 10px 14px; border-radius: 11px; color: var(--strong); background: var(--surface); box-shadow: 0 0 0 1px var(--line), var(--shadow); animation: lift 170ms var(--ease) both; }
.toast.bad { color: var(--bad); }

@media (max-width: 860px) {
  .shell {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
    padding: env(safe-area-inset-top, 0px) max(6px, env(safe-area-inset-right, 0px)) max(6px, env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px));
  }
  .side {
    position: fixed; z-index: 15; inset: 0 auto 0 0; width: min(88vw, 340px); background: var(--crust); box-shadow: 0 0 0 1px var(--line), 0 24px 64px rgb(0 0 0 / 34%);
    padding: calc(10px + env(safe-area-inset-top, 0px)) 10px calc(8px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
    transform: translateX(-102%); visibility: hidden; transition: transform 200ms var(--ease), visibility 200ms;
  }
  .shell.drawer .side { transform: none; visibility: visible; }
  .side-grip { display: none; }
  .side-scrim { display: block; position: fixed; inset: 0; z-index: 14; background: color-mix(in srgb, var(--crust) 62%, transparent); backdrop-filter: blur(3px); animation: appear 120ms ease both; }
  .board-limits { display: block; }
  .recent-head { flex-direction: column; align-items: stretch; gap: 6px; padding-left: 0; }
  .recent-head h3 { padding-left: 10px; }
  .recent-head .filter { flex: none; width: 100%; max-width: none; }
  .top-bar { display: flex; align-items: center; gap: 4px; height: 40px; padding: 0 2px; }
  .top-bar .brand { margin-right: auto; padding: 0 0 0 4px; }
  .top-bar .icon-button { position: relative; }
  .top-bar .count { position: absolute; top: -3px; right: -5px; min-width: 16px; margin: 0; padding: 1px 4px; font-size: 10.5px; }
  .page { padding: 18px 16px; }
  .project { height: auto; min-height: 100%; padding: 6px 8px 8px; overflow: auto; }
  .main { overflow: auto; }
  .term { flex: 1 0 56svh; }     /* the height left by the browser's bars: 56vh would push the keys off the screen */
  .filter { width: 100%; }
  .page-head { flex-direction: column; align-items: stretch; }
  .launch-row { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 600px) {
  .toolbar { flex-wrap: wrap; }
  .toolbar-info { flex: 1 1 calc(100% - 31px); flex-wrap: wrap; gap: 0 9px; }
  .toolbar.plain { flex-wrap: nowrap; }
  .toolbar.plain .toolbar-info { flex: 1 1 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
