:root {
  --bg: #ffffff; --side: #f8f9fb; --panel: #ffffff; --soft: #f3f4f6; --code: #f6f8fa;
  --line: #e6e8eb; --line-strong: #d4d7dc;
  --fg: #1f2328; --dim: #6b7280; --faint: #9ca3af;
  --accent: #2563eb; --accent-soft: #eff4ff;
  --green: #15803d; --green-soft: #ecfdf3; --red: #dc2626; --red-soft: #fef2f2;
  --yellow: #b45309; --yellow-soft: #fffbeb; --violet: #7c3aed; --violet-soft: #f5f3ff;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.12), 0 2px 6px rgba(16, 24, 40, 0.06);
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "SF Mono", "Noto Sans Mono", "DejaVu Sans Mono", monospace;
}
* { box-sizing: border-box; }
/* No blue box over what's tapped on a phone: buttons and rows have their own states. */
* { -webkit-tap-highlight-color: transparent; }
.menu-toggle { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; outline: none; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--fg); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: #dbe6ff; }

button, input, select, textarea {
  font: inherit; color: inherit; background: var(--panel);
  border: 1px solid var(--line-strong); border-radius: 6px; padding: 6px 12px;
  transition: border-color .12s, box-shadow .12s, background .12s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }
button { cursor: pointer; font-weight: 500; box-shadow: var(--shadow); }
button:hover { background: var(--soft); }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button.primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
button.danger { color: var(--red); }
button.danger:hover { background: var(--red-soft); border-color: #fca5a5; }
pre, code { font-family: var(--mono); font-size: 12.5px; }
pre { margin: 0; white-space: pre-wrap; word-break: break-word; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d9dce1; border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b8bdc5; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* Frame */
.app { position: relative; display: flex; flex-direction: column; height: var(--app-height, 100dvh); overflow: hidden; }
.page .page h2 { font-size: 20px; letter-spacing: -0.01em; margin: 0 0 16px; }
.page { flex: 1; min-height: 0; overflow: auto; padding: 32px max(24px, calc((100% - 960px) / 2)); }
.statusbar { display: flex; gap: 16px; align-items: center; padding: 6px 16px; border-top: 1px solid var(--line); background: var(--side); font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; }
.statusbar .name { color: var(--fg); font-weight: 600; }
.entry.command .meta button.kill { padding: 0 8px; font-size: 11px; line-height: 18px; border-radius: 999px; color: var(--red, #dc2626); border-color: var(--red, #dc2626); background: transparent; cursor: pointer; }
.entry.command .meta button.kill:hover { background: var(--red, #dc2626); color: #fff; }
.entry.command .meta button.kill.force { background: var(--red, #dc2626); color: #fff; font-weight: 600; }
.statusbar .backend { padding: 1px 8px; border-radius: 999px; background: var(--soft); flex: none; }
/* The bar's menus: as wide as their longest option, so they keep their width, with a
   small chevron of their own in place of the browser's roomy arrow. */
.statusbar select { padding: 1px 15px 1px 4px; font-size: 12px; border-radius: 5px; appearance: none; -webkit-appearance: none; background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M1 1l3 3 3-3' fill='none' stroke='%236b7280' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 5px center; }
/* Claude Code's own mode: Claude's mark sits inside its menu, on the left. */
.statusbar .claude-mode, .statusbar .gatekeeper-menu { position: relative; display: inline-flex; align-items: center; flex: none; }
.statusbar .claude-mode .claude-logo, .statusbar .gatekeeper-menu .gate-logo { position: absolute; left: 5px; pointer-events: none; }
.statusbar .claude-mode select, .statusbar .gatekeeper-menu select { padding-left: 18px; }
.statusbar .status { padding: 1px 8px; border-radius: 999px; background: var(--soft); margin-left: auto; order: 2; }
.statusbar .status.wait { color: var(--yellow); background: var(--yellow-soft); }
.statusbar .status.work { color: var(--violet); background: var(--violet-soft); }
.statusbar .status.err { color: var(--red, #dc2626); background: var(--red-soft, rgba(220,38,38,.12)); }
.statusbar .bypass { color: var(--yellow); flex: none; cursor: help; }
.statusbar .hints { margin-left: auto; overflow: hidden; text-overflow: ellipsis; color: var(--faint); }
/* The agent's status ends the bar, its hints just before it (pushed right). */
.statusbar .status ~ .hints { order: 1; }
.statusbar .status { margin-left: 0; }
.toasts { position: fixed; right: 16px; bottom: 44px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toasts .toast { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--dim); padding: 9px 14px; border-radius: var(--radius); cursor: pointer; box-shadow: var(--shadow-lg); max-width: 420px; font-size: 13px; }
.toasts .toast .title { font-weight: 550; }
.toasts .toast .detail { color: var(--dim); font-size: 12.5px; margin-top: 2px; }
.toasts .toast.error { border-color: #fecaca; border-left-color: var(--red); }
.toasts .toast.error .title { color: var(--red); }
.toasts .toast.connection { border-left-color: #f59e0b; }

/* The bell in the menu's foot, and the notices it opens. */
.notice-panel { position: absolute; left: calc(100% + 14px); bottom: 0; z-index: 50; width: 380px; max-width: calc(100vw - 16px); max-height: 70vh; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 13px; }
.notice-panel .notice-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 12px 8px 14px; border-bottom: 1px solid var(--line); }
.notice-panel .notice-head .title { flex: 1; font-weight: 650; }
.notice-panel .notice-head .link { padding: 0; font-size: 12.5px; }
.notice-panel .notice-head .close { width: 24px; height: 24px; padding: 0; border: none; box-shadow: none; background: transparent; color: var(--dim); }
.notice-panel .notice-none { padding: 14px; font-size: 12.5px; }
.notice-panel .notice-list { overflow-y: auto; min-height: 0; }
.notice-panel .notice { display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px 9px 14px; border-bottom: 1px solid var(--line); }
.notice-panel .notice:last-child { border-bottom: none; }
.notice-panel .notice.link { cursor: pointer; }
.notice-panel .notice.link:hover { background: var(--soft); }
.notice-panel .notice .mark { flex: none; width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--dim); }
.notice-panel .notice.needs .mark { background: #f59e0b; }
.notice-panel .notice.error .mark { background: var(--red, #dc2626); }
.notice-panel .notice.done .mark { background: #22c55e; }
.notice-panel .notice.connection .mark { background: #f59e0b; }
.notice-panel .notice .what { flex: 1; min-width: 0; }
.notice-panel .notice .title { font-weight: 550; overflow-wrap: anywhere; }
.notice-panel .notice .detail { font-size: 12px; margin-top: 1px; overflow-wrap: anywhere; }
.notice-panel .notice.seen .title { font-weight: 400; color: var(--dim); }
.notice-panel .notice.seen .mark { opacity: .35; }
.notice-panel .notice .dismiss { flex: none; width: 22px; height: 22px; padding: 0; border: none; box-shadow: none; background: transparent; color: var(--faint); font-size: 15px; line-height: 1; border-radius: 5px; }
.notice-panel .notice .dismiss:hover { color: var(--fg); background: var(--soft); }
@media (max-width: 760px) {
  .notice-panel { width: calc(100vw - 96px); }
  .sidebar .rail.wide { width: 170px; }
}

/* Generic pieces */
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: none; }
th { color: var(--dim); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; background: #d1d5db; vertical-align: 1px; }
.dot.on { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15); }
.dim { color: var(--dim); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin-bottom: 12px; box-shadow: var(--shadow); }
.card table { margin-top: 8px; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush table { margin: 0; }
.card.flush th { background: var(--side); }
.card td:first-child, .card th:first-child { padding-left: 16px; }

/* Shell: the menu on the left of every page, the page on the right */
.shell { display: grid; grid-template-columns: auto 1fr; height: 100%; min-height: 0; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.sidebar { display: flex; flex-direction: row; min-height: 0; background: var(--side); border-right: 1px solid var(--line); font-size: 13px; }
/* The open room's column, beside the rail. */
.sidebar .sidebar-col { flex: none; width: 260px; min-width: 0; display: flex; flex-direction: column; min-height: 0; padding: 14px 10px 10px; }
/* The rail, as Discord has it: home, a tile per room, a new room. A tile's square
   rounds less on a hover and for the room open, which also has a pill at the edge.
   Widened, each is named beside its tile. The rooms scroll; the foot (the admin
   area, the notices, the display settings) stays at the bottom. */
.sidebar .rail { flex: none; width: 64px; display: flex; flex-direction: column; gap: 8px; padding: 12px 0 10px; background: var(--soft); border-right: 1px solid var(--line); min-height: 0; transition: width .15s ease; }
.sidebar .rail.wide { width: 240px; }
/* Widened, a room's whole name: over two lines when it needs them. */
.sidebar .rail.wide .rail-item .rail-label { white-space: normal; overflow-wrap: anywhere; line-height: 1.2; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.sidebar .rail .rail-rooms { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; display: flex; flex-direction: column; gap: 8px; }
.sidebar .rail .rail-rooms::-webkit-scrollbar { display: none; }
.sidebar .rail .rail-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; font-size: 13.5px; }
.sidebar .rail:not(.wide) .rail-label { display: none; }
.sidebar .rail .sep { flex: none; align-self: center; width: 30px; height: 2px; border-radius: 1px; background: var(--line); }
.sidebar .rail.wide .sep { width: calc(100% - 22px); }
.sidebar .rail .rail-item { position: relative; flex: none; min-height: 42px; padding: 0 11px; display: flex; align-items: center; gap: 10px; border: none; border-radius: 0; box-shadow: none; background: transparent; color: var(--fg); font: inherit; text-decoration: none; cursor: pointer; }
.sidebar .rail .rail-item:hover { text-decoration: none; background: transparent; }
.sidebar .rail .rail-item::before { content: ""; position: absolute; left: 0; top: 50%; width: 4px; height: 0; border-radius: 0 4px 4px 0; background: var(--fg); transform: translateY(-50%); transition: height .15s ease; }
.sidebar .rail .rail-item:hover::before { height: 18px; }
.sidebar .rail .rail-item.current::before { height: 34px; }
.sidebar .rail .rail-item.current .rail-label { font-weight: 600; }
.sidebar .rail .tile { position: relative; flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: var(--panel); color: var(--fg); font-size: 13.5px; font-weight: 650; letter-spacing: -0.01em; transition: border-radius .15s ease, background .15s ease, color .15s ease; }
.sidebar .rail .rail-item:hover .tile, .sidebar .rail .rail-item.current .tile { border-radius: 14px; background: var(--accent); color: #fff; }
.sidebar .rail .rail-item.home:hover .tile, .sidebar .rail .rail-item.home.current .tile { background: var(--accent-soft); color: var(--accent); }
.sidebar .rail .rail-item.add .tile { color: #16a34a; font-size: 22px; font-weight: 400; }
.sidebar .rail .rail-item.add:hover .tile { background: #16a34a; color: #fff; }
.sidebar .rail .tile .initials { pointer-events: none; }
/* A room's pill and tile, in the room's color when it has one (--tile). */
.sidebar .rail .rail-item.room::before { display: none; }
.sidebar .rail .rail-item .pill { position: absolute; left: 0; top: 50%; width: 4px; height: 0; border-radius: 0 4px 4px 0; background: var(--tile, var(--fg)); transform: translateY(-50%); transition: height .15s ease; }
.sidebar .rail .rail-item:hover .pill { height: 18px; }
.sidebar .rail .rail-item.current .pill { height: 34px; }
.sidebar .rail .tile.colored, .sidebar .rail .rail-item:hover .tile.colored, .sidebar .rail .rail-item.current .tile.colored { background: var(--tile); color: #fff; }
.row-menu .menu-label { padding: 4px 12px 2px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); }
.row-menu .swatches { display: grid; grid-template-columns: repeat(6, 22px); gap: 6px; padding: 4px 12px 8px; }
.row-menu button.swatch { width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--tile); box-shadow: none; cursor: pointer; }
.row-menu button.swatch:hover { background: var(--tile); transform: scale(1.12); }
.row-menu button.swatch.none, .row-menu button.swatch.none:hover { background: linear-gradient(135deg, var(--panel) 45%, var(--red, #dc2626) 45%, var(--red, #dc2626) 55%, var(--panel) 55%); }
.row-menu button.swatch.on { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--fg); }
/* A tile's name, beside it while it is hovered, as Discord shows a server's. */
.rail-tip { position: fixed; z-index: 70; transform: translateY(-50%); pointer-events: none; width: max-content; max-width: 320px; padding: 7px 11px; border-radius: 7px; background: #111827; color: #fff; font-size: 13px; font-weight: 600; line-height: 1.3; box-shadow: var(--shadow-lg); }
.rail-tip::before { content: ""; position: absolute; left: -4px; top: 50%; width: 9px; height: 9px; background: #111827; transform: translateY(-50%) rotate(45deg); }
.sidebar .rail .tile .badge { position: absolute; right: -4px; bottom: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; font-size: 10.5px; font-weight: 700; line-height: 18px; text-align: center; color: #fff; box-shadow: 0 0 0 3px var(--soft); }
.sidebar .rail .tile .badge.wait { background: #f59e0b; }
.sidebar .rail .tile .badge.err { background: var(--red, #dc2626); }
.sidebar .rail .tile .badge.live { min-width: 10px; width: 10px; height: 10px; padding: 0; right: -1px; bottom: -1px; background: #22c55e; }
.sidebar .rail .rail-foot { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0 12px; padding-top: 10px; border-top: 2px solid var(--line); }
.sidebar .rail.wide .rail-foot { align-items: stretch; }
.sidebar .rail .bell-wrap { position: relative; display: flex; flex-direction: column; }
.sidebar .rail .foot-icon { position: relative; flex: none; width: 36px; height: 36px; padding: 0; display: flex; align-items: center; justify-content: center; gap: 10px; border: none; border-radius: 10px; box-shadow: none; background: transparent; color: var(--dim); font: inherit; text-decoration: none; }
.sidebar .rail.wide .foot-icon { width: auto; justify-content: flex-start; padding: 0 9px; }
.sidebar .rail .foot-icon svg { flex: none; }
.sidebar .rail .foot-icon:hover, .sidebar .rail .foot-icon.active { background: var(--panel); color: var(--fg); text-decoration: none; }
.sidebar .rail .foot-icon.admin-icon.active { background: var(--violet); color: #fff; }
.sidebar .rail .rail-label .rail-count { margin-left: 6px; font-size: 11.5px; color: var(--faint); }
/* Oneself at the rail's foot: initials in a circle, the connection a dot on it. */
.sidebar .rail .foot-icon.me-icon { margin-top: 2px; }
.sidebar .rail .me-avatar { position: relative; flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; font-weight: 650; }
.sidebar .rail .me-avatar::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 9px; height: 9px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 2px var(--soft); }
.sidebar .rail .me-avatar.off::after { background: var(--red); }
.sidebar .rail .foot-icon.me-icon.active .me-avatar { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--accent); }
.sidebar .rail .bell.lit { color: var(--fg); }
.sidebar .rail .bell .badge { position: absolute; top: -3px; left: 22px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; font-size: 10px; font-weight: 700; line-height: 17px; text-align: center; color: #fff; background: var(--accent); box-shadow: 0 0 0 2px var(--soft); }
.sidebar .rail .bell .badge.urgent { background: #f59e0b; }
.sidebar .pick-room { padding: 6px 10px; font-size: 12.5px; flex: 1; }
.sidebar .brand { position: relative; }
.sidebar .brand .room-name { flex: 0 1 auto; font-weight: 650; line-height: 1.25; white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
/* A room's name over two lines keeps its ⋯ and the gear by its first line. */
.sidebar .brand:has(.room-name) { align-items: flex-start; }
.sidebar .brand:has(.room-name) .room-menu-button { margin-top: -2px; }
.sidebar .brand .rename-inline { flex: 1; min-width: 0; font: inherit; font-size: 14px; padding: 2px 6px; border: 1px solid var(--accent); border-radius: 5px; background: var(--panel); color: var(--fg); }
.sidebar .brand .room-menu-button { flex: none; margin-left: auto; width: 24px; height: 24px; padding: 0; border: none; border-radius: 6px; box-shadow: none; background: transparent; color: var(--dim); font-size: 15px; line-height: 1; }
.sidebar .brand .room-menu-button:hover, .sidebar .brand .room-menu-button.open { background: var(--soft); color: var(--fg); }
.sidebar .brand .room-menu { position: absolute; top: 34px; right: 8px; left: auto; font-size: 13px; font-weight: 400; letter-spacing: 0; }
.sidebar .brand { font-weight: 650; font-size: 16px; letter-spacing: -0.01em; padding: 2px 10px 16px; display: flex; align-items: center; gap: 8px; }
.sidebar .empty { color: var(--faint); padding: 6px 10px; }
.sidebar .item { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 6px; color: var(--fg); cursor: pointer; text-decoration: none; }
.sidebar a.item:hover { background: #eceef1; text-decoration: none; }
/* The current room and the active page: the same soft accent fill as the agent on
   screen, so the menu reads as one. */
.sidebar .item.active, .sidebar .item.current { background: var(--accent-soft); color: var(--accent); font-weight: 550; }
.sidebar .item.current .count { color: var(--accent); background: transparent; }
.sidebar .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .count { font-size: 11px; color: var(--dim); background: #eceef1; border-radius: 999px; padding: 0 7px; font-variant-numeric: tabular-nums; }
/* Sections: the open room's agents take the height they can; the rooms list is
   capped below them, or takes the height itself when no room is open. */
.sidebar .pane { display: flex; flex-direction: column; min-height: 0; }
.sidebar .agents-pane { flex: 1 1 auto; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.sidebar .pane-head { display: flex; align-items: center; gap: 6px; padding: 4px 10px 6px; color: var(--faint); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.sidebar .pane-head a { color: inherit; text-decoration: none; }
.sidebar .pane-head a:hover, .sidebar .pane-head a.active { color: var(--fg); }
.sidebar .pane-head .add { margin-left: auto; width: 22px; height: 22px; padding: 0; border-radius: 6px; font-size: 15px; line-height: 1; box-shadow: none; color: var(--dim); background: transparent; border-color: transparent; }
.sidebar .pane-head .add:hover { background: #eceef1; color: var(--accent); }
.sidebar .pane-list { flex: 1 1 auto; min-height: 0; overflow: auto; margin: 0 -4px; padding: 0 4px 2px; }
.sidebar .agent, .sidebar .asset { display: flex; align-items: center; gap: 0; padding: 6px 10px; border-radius: 6px; cursor: pointer; color: var(--fg); background: var(--side); }
/* The name, taking the room its row leaves. */
.sidebar .named { flex: 1; min-width: 0; display: flex; align-items: center; }
.sidebar .named .rename-inline { flex: 1; min-width: 0; width: 100%; font: inherit; font-size: 13px; padding: 1px 5px; border: 1px solid var(--accent); border-radius: 5px; background: var(--panel); color: var(--fg); }
.sidebar .named .label { flex: 0 1 auto; }
/* An agent row swiped left on a phone, over the strip that says what letting go does. */
.sidebar .swipe { position: relative; border-radius: 6px; }
.sidebar .swipe-under { position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end; padding-right: 14px; border-radius: 6px; background: #fca5a5; color: #fff; font-size: 12px; font-weight: 600; }
.sidebar .swipe-under.armed { background: var(--red); }
.sidebar .swipe-under.right { justify-content: flex-start; padding: 0 0 0 14px; background: #93b4f5; }
.sidebar .swipe-under.right.armed { background: var(--accent); }
/* A row swiped right turned into its menu, in its place (an agent row is a little taller, for its dot). */
.sidebar .agents-pane .swipe-confirm { min-height: 32px; box-sizing: border-box; }
.sidebar .swipe > :not(.swipe-under, .row-menu, .sheet-backdrop) { position: relative; touch-action: pan-y; transition: transform .18s ease; }
.sidebar .swipe > .dragging { transition: none; }
/* A row that is a link: a long press opens its sheet, not the phone's link preview. */
.sidebar .swipe > a { -webkit-touch-callout: none; }
/* The drop-down a mouse opens on a row: a small panel under it, its entries one per
   line, the removal last and in red. The row it belongs to stays highlighted. */
.row-menu { position: fixed; z-index: 50; min-width: 150px; padding: 4px; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-lg); }
.row-menu button { height: 30px; padding: 0 10px; border: none; border-radius: 5px; box-shadow: none; background: transparent; color: var(--fg); font-size: 13px; font-weight: 400; text-align: left; }
.row-menu button:hover { background: var(--soft); }
.row-menu .separator { height: 1px; margin: 4px 2px; background: var(--line); }
.row-menu .danger { color: var(--red); }
.row-menu .danger:hover { background: var(--red-soft); }
/* The sheet a finger opens on a row: it slides up from the bottom over a dimmed page,
   the row's name on top, an entry per line, the removal in red, and Cancel apart. */
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; justify-content: flex-end; background: rgba(17, 24, 39, 0.32); animation: sheet-fade .18s ease; }
.sheet { display: flex; flex-direction: column; gap: 8px; padding: 0 8px calc(8px + env(safe-area-inset-bottom)); animation: sheet-up .22s cubic-bezier(.2, .8, .3, 1); }
.sheet-group { display: flex; flex-direction: column; background: var(--panel); border-radius: 14px; overflow: hidden; }
.sheet-title { padding: 12px 16px 10px; text-align: center; font-size: 13px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-bottom: 1px solid var(--line); }
.sheet button { height: 52px; border: none; border-radius: 0; box-shadow: none; background: var(--panel); color: var(--accent); font-size: 17px; font-weight: 400; -webkit-tap-highlight-color: transparent; }
.sheet-group button + button { border-top: 1px solid var(--line); }
.sheet button:active { background: var(--soft); }
.sheet .danger { color: var(--red); }
.sheet .sheet-cancel { border-radius: 14px; font-weight: 600; }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-fade { from { background: transparent; } }
.sidebar .agent.menu-open, .sidebar .asset.menu-open, .sidebar .item.menu-open { background: var(--soft); }
.sidebar .agent.menu-open .more, .sidebar .asset.menu-open .more, .sidebar .item.menu-open .more { display: grid; place-items: center; }
@media (hover: hover) {
  .sidebar .agent.menu-open .status, .sidebar .asset.menu-open .status, .sidebar .item.menu-open .count { display: none; }
}
.sidebar .swipe > .item:not(.current) { background: var(--side); }
.sidebar .swipe > .item.current { background: var(--accent-soft); }
.sidebar .swipe > .item.current .more { color: var(--accent); }
/* A swiped row turned into its confirmation, in its place. */
.sidebar .swipe-confirm { display: flex; align-items: center; gap: 6px; padding: 6px 4px 6px 10px; border-radius: 6px; background: var(--red-soft); color: var(--red); }
.sidebar .swipe-confirm .question { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .swipe-confirm button { flex: none; margin: -3px 0; padding: 3px 10px; font-size: 12px; border-radius: 6px; box-shadow: none; }
.sidebar .swipe-confirm .cancel { background: var(--panel); color: var(--fg); border: 1px solid var(--line); }
.sidebar .swipe-confirm .confirm { background: var(--red); color: #fff; border: 1px solid var(--red); }
.sidebar .agent:hover { background: #eceef1; }
.sidebar .agent.selected { background: var(--accent-soft); color: var(--accent); font-weight: 550; }
/* An asset's row in the room's menu looks and marks as an agent's: open in place of
   the chat, it is the one selected. */
.sidebar .asset:hover { background: #eceef1; }
.sidebar .asset.selected { background: var(--accent-soft); color: var(--accent); font-weight: 550; }
.sidebar .asset .status { font-size: 11px; color: var(--faint); margin-left: 6px; white-space: nowrap; font-weight: 400; }
.sidebar .asset:hover .more { display: grid; place-items: center; }
.sidebar a.asset, .sidebar a.asset:hover { text-decoration: none; }
.sidebar .agent.fresh .label { font-weight: 650; color: var(--fg); }
.sidebar .agent .status { font-size: 11px; color: var(--faint); margin-left: 6px; white-space: nowrap; font-weight: 400; }
.sidebar .agent .status.wait { color: var(--yellow); }
.sidebar .agent .status.err { color: var(--red, #dc2626); }
/* The ⋯ button opens a row's options with a mouse, as a right swipe does on a phone;
   it shows on hover. 20px, it takes 18: the row mustn't grow as it shows. */
.sidebar .more { display: none; order: 1; margin: -1px 0 -1px 4px; width: 20px; height: 20px; padding: 0; border: none; border-radius: 5px; box-shadow: none; background: transparent; color: var(--faint); font-size: 15px; line-height: 1; flex: none; }
.sidebar .agent:hover .more, .sidebar .item:hover .more { display: grid; place-items: center; }
/* Hovered with a mouse, a row trades what it shows on the right (an agent's state,
   a room's agent count) for its ⋯ button. */
@media (hover: hover) {
  .sidebar .agent:hover .status, .sidebar .asset:hover .status, .sidebar .item:hover .count { display: none; }
}
.sidebar .more:hover { background: var(--accent-soft); color: var(--accent); }
.claude-logo, .charles-logo, .gate-logo { flex: none; display: inline-block; vertical-align: -1px; }
/* An agent row's logo leads the row where its status dot was, and shows the state
   as a small dot on its lower right corner: green while online, amber while waiting
   for the user; offline, the logo is greyed and has none. The dot is ringed in the
   row's own background, so it reads apart from the logo. */
.sidebar .agent { --row-bg: var(--side); }
.sidebar .agent:hover { --row-bg: #eceef1; }
.sidebar .agent.selected { --row-bg: var(--accent-soft); }
.sidebar .agent.menu-open { --row-bg: var(--soft); }
.sidebar .agent > .mark { position: relative; margin-right: 8px; display: inline-flex; flex: none; }
/* An agent's dot, as the rail's: green for new activity (a turn done, not seen),
   amber waiting on someone, red failed; none when nothing is new. */
.sidebar .agent > .mark.fresh::after, .sidebar .agent > .mark.wait::after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 6px; height: 6px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 1.5px var(--row-bg); }
.sidebar .agent > .mark.wait::after { background: #f59e0b; }
.sidebar .agent > .mark.err::after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 6px; height: 6px; border-radius: 50%; background: var(--red, #dc2626); box-shadow: 0 0 0 1.5px var(--row-bg); }
.sidebar .agent > .mark.off { opacity: .4; filter: grayscale(1); }
.sidebar .foot { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.sidebar .item.static { cursor: default; color: var(--dim); font-size: 12px; }
/* The foot's last line: the connection, and the admin button at its right. */
.sidebar .foot-bar { display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.sidebar .foot-bar .item.static { flex: 1; min-width: 0; }
.sidebar .admin-button { flex: none; display: inline-flex; align-items: center; gap: 5px; margin-right: 4px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--dim); font-size: 12px; font-weight: 550; text-decoration: none; }
.sidebar .admin-button:hover { color: var(--violet); border-color: var(--violet); }
.sidebar .admin-button.active { color: #fff; background: var(--violet); border-color: var(--violet); }
.sidebar .admin-button.active:hover { color: #fff; opacity: .9; }
.sidebar .conn::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #22c55e; }
.sidebar .conn.off { color: var(--red); }
.sidebar .conn.off::before { background: var(--red); }

/* Room */
.chatpane { display: flex; flex-direction: column; flex: 1; min-height: 0; background: var(--bg); }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.empty-state h2 { margin: 0 0 4px; }
/* Something on its way: the spiral, turning, shown only once it takes a moment. */
.loading { display: grid; place-items: center; }
.loading .spinner { display: grid; opacity: 0; animation: loading-in .3s ease .25s forwards, loading-turn 1.4s linear infinite; }
@keyframes loading-in { to { opacity: .85; } }
@keyframes loading-turn { to { transform: rotate(-360deg); } }
@media (prefers-reduced-motion: reduce) {
  .loading .spinner { animation: loading-in .3s ease .25s forwards, loading-pulse 1.6s ease-in-out .55s infinite alternate; }
  @keyframes loading-pulse { from { opacity: .85; } to { opacity: .35; } }
}
.chatwrap { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat { flex: 1; overflow: auto; padding: 72px 28px 14px; display: flex; flex-direction: column; }
/* A short conversation sits at the bottom, by the prompt; a long one scrolls as before. */
.chat-log { margin-top: auto; }
/* The chat holds its view itself while scrolled up (see chat.rs): the browser's own
   anchoring would move it twice. */
.chat { overflow-anchor: none; }
/* What ends the chat sits just above the prompt, its spacing for what follows dropped. */
.chat-log > .entry:last-child { margin-bottom: 0; }
.stats { position: absolute; top: 10px; right: 18px; z-index: 1; text-align: right; font-family: var(--mono); font-size: 11.5px; color: var(--dim); background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(6px); border: 1px solid var(--line); padding: 6px 10px; border-radius: var(--radius); box-shadow: var(--shadow); }
.stats .live { color: var(--violet); }
.stats { cursor: pointer; user-select: none; }
.stats.folded { padding: 3px 10px; }
.stats.folded.live { color: var(--violet); }
.to-prompt { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); z-index: 2; display: flex; flex-direction: column; gap: 8px; }
/* Dimmed but while the chat scrolls, or while they're touched or dragged. */
.to-prompt { opacity: 0.3; transition: opacity .4s; }
.to-prompt.scrolling, .to-prompt:active, .to-prompt:has(.dragging) { opacity: 1; transition: opacity .1s; }
.to-prompt button { width: 36px; height: 36px; padding: 0; border-radius: 50%; font-size: 17px; font-weight: 700; -webkit-text-stroke: 0.6px currentColor; line-height: 1; display: grid; place-items: center; background: var(--panel); color: var(--dim); box-shadow: var(--shadow-lg); }
/* Only where there is a real hover: a tapped button counts as hovered until the next
   tap elsewhere, and would stay lit and blue. */
@media (hover: hover) {
  .to-prompt:hover { opacity: 1; transition: opacity .1s; }
  .to-prompt button:hover { color: var(--accent); background: var(--panel); }
}
.to-prompt button:hover { background: var(--panel); }
/* Touched and dragged, not selected: no tap highlight, text selection or focus ring. */
.to-prompt button, .touch-bar button { -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; outline: none; }
/* The down button stretches downward as it's dragged, over a track as long as the drag
   that reaches the latest output; it keeps its place in the column. */
.to-prompt .pull-slot { position: relative; width: 36px; height: 36px; }
.to-prompt .pull { position: absolute; top: 0; left: 0; border-radius: 18px; touch-action: none; align-items: end; padding-bottom: 9px; }
/* While dragged: a quiet outline for the track, no lift on the button. */
.to-prompt .pull.dragging { box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08); transition: none; }
.to-prompt .track { position: absolute; top: 0; left: 0; width: 36px; border-radius: 18px; border: 1.5px dashed var(--line-strong); background: rgba(229, 231, 235, 0.75); }
/* The up button grows upward. */
.to-prompt .pull-slot.up .pull, .to-prompt .pull-slot.up .track { top: auto; bottom: 0; }
.to-prompt .pull-slot.up .pull { align-items: start; padding: 9px 0 0; }
.footer { position: relative; padding: 0; background: var(--bg); border-top: 1px solid var(--line); }
/* The prompt's command menu, just above it: a row per matching command, the picked
   one tinted, what each does in a column on the right. */
.command-menu { position: absolute; left: 16px; right: 16px; bottom: calc(100% + 6px); z-index: 5; max-width: 520px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-lg); font-size: 13px; }
.command-menu .cmd { display: flex; align-items: baseline; gap: 16px; padding: 6px 10px; border-radius: 5px; cursor: pointer; }
.command-menu .cmd.picked { background: var(--accent-soft); }
.command-menu .name { flex: none; min-width: 130px; font-family: var(--mono); font-size: 12.5px; color: var(--fg); }
.command-menu .name b { font-weight: 700; }
.command-menu .arg { color: var(--faint); }
.command-menu .about { color: var(--dim); }
.command-menu .command-error { padding: 6px 10px; color: var(--red); }
.footer.dim { padding: 12px 28px; text-align: center; }
.footer.offline { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 12px 28px; color: var(--dim); flex-wrap: wrap; }
.prompt-line { display: flex; align-items: flex-start; gap: 10px; padding: 12px 28px; font-family: var(--sans); font-size: 12.5px; line-height: 1.6; cursor: text; }
.prompt-line:focus-within { background: var(--side); }
.prompt-line .ps1 { display: flex; gap: 8px; white-space: nowrap; user-select: none; }
/* ❯ comes from a fallback font whose middle sits a pixel under the text's: raised to meet it. */
.prompt-line .caret { color: var(--green); font-weight: 700; position: relative; top: -1px; }
.prompt-line textarea { flex: 1; min-width: 0; border: none; background: transparent; box-shadow: none; padding: 0; margin: 0; border-radius: 0; resize: none; font: inherit; line-height: inherit; color: var(--fg); caret-color: var(--fg); }
.prompt-line textarea:focus { box-shadow: none; }
.prompt-line textarea::placeholder { color: var(--faint); }
.footer.asking { border-top: 2px solid #f59e0b; background: var(--yellow-soft); }
.footer.asking .ask { padding: 10px 28px 0; font-weight: 600; color: var(--yellow); }
.footer.asking .prompt-line, .footer.asking .prompt-line:focus-within { background: transparent; }
.footer.asking .caret { color: #f59e0b; }
.prompt-line .actions { display: flex; gap: 14px; align-self: center; }
button.link.approve { color: var(--green); font-weight: 600; }
button.link.deny { color: var(--red); }
/* 22px, but taking only the 20px of a line: the prompt mustn't grow as it shows. */
.prompt-line .clear { flex: none; width: 22px; height: 22px; margin: -1px 0; padding: 0; border: none; border-radius: 6px; box-shadow: none; background: transparent; color: var(--faint); font: 17px/1 var(--sans); display: grid; place-items: center; }
.prompt-line .clear:hover { background: var(--soft); color: var(--fg); }
button.link { border: none; background: none; box-shadow: none; padding: 0; font: 12px var(--sans); color: var(--accent); white-space: nowrap; }
button.link:hover { background: none; text-decoration: underline; }
.footer .hint { color: var(--faint); font-size: 12px; margin-top: 6px; }

/* Chat entries */
.entry { margin: 8px 0; }
/* A prompt's ❯ stands in a gutter of its own, so every line of it starts where the
   first one does. */
.text.user, .text.queued { position: relative; white-space: pre-wrap; font-family: var(--sans); font-size: 13px; background: var(--side); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px 8px 30px; margin: 20px 0 12px; }
.text.user::before, .text.queued::before { content: "❯"; position: absolute; left: 12px; top: 7px; color: var(--green); font-weight: 700; }
.text.queued { color: var(--dim); background: transparent; border: 1px dashed var(--line-strong); padding-right: 34px; }
.text.queued button.cancel { position: absolute; right: 6px; top: 5px; width: 22px; height: 22px; padding: 0; border: none; box-shadow: none; background: transparent; color: var(--dim); font-size: 15px; line-height: 1; border-radius: 5px; cursor: pointer; }
.text.queued button.cancel:hover { background: var(--soft); color: var(--red, #dc2626); }
/* "✕ 2 queued" on the prompt line: as compact as Pause and Stop beside it. */
.prompt-line button.cancel-queued { flex: none; align-self: flex-start; margin: -2px 0; height: 24px; padding: 0 10px; display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 6px; box-shadow: none; background: transparent; color: var(--dim); font: 600 12px/1 var(--sans); white-space: nowrap; }
.prompt-line button.cancel-queued:hover { color: var(--red, #dc2626); border-color: #fecaca; background: var(--red-soft); }
.text.error { color: var(--red); background: var(--red-soft); border-radius: 6px; padding: 8px 12px; }
.text.info { color: var(--dim); font-size: 13px; }
.reply { line-height: 1.65; }
.reply p { margin: 8px 0; }
.reply h1, .reply h2, .reply h3 { line-height: 1.3; margin: 18px 0 8px; letter-spacing: -0.01em; }
.reply h1 { font-size: 20px; } .reply h2 { font-size: 17px; } .reply h3 { font-size: 15px; }
.reply ul, .reply ol { padding-left: 22px; }
.reply blockquote { margin: 8px 0; padding-left: 12px; border-left: 3px solid var(--line-strong); color: var(--dim); }
.reply pre { background: var(--code); border: 1px solid var(--line); padding: 10px 12px; border-radius: var(--radius); overflow: auto; }
.reply code { background: var(--soft); padding: 1px 5px; border-radius: 4px; font-size: 0.9em; }
.reply pre code { padding: 0; background: none; font-size: inherit; }
.reply table { margin: 8px 0; }
.reply table td, .reply table th { border: 1px solid var(--line); }
.thinking { color: var(--dim); font-size: 13px; }
.thinking summary { cursor: pointer; width: fit-content; user-select: none; }
.thinking summary:hover { color: var(--fg); }
.thinking[open] .reply { border-left: 2px solid var(--line); padding-left: 12px; margin-top: 4px; }
.round { color: var(--faint); font-size: 12px; margin: 14px 0 4px; }
.turn { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; color: var(--faint); font-size: 12px; margin: 10px 0 24px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
/* Not a turn's end: no rule under it, and its raw prompt sits below it as a round's does. */
.turn.system-line { margin: 0 0 4px; padding-bottom: 0; border-bottom: none; }
.turn.system-line + .raw { margin-top: 2px; margin-bottom: 16px; }
.turn-actions { display: inline-flex; gap: 12px; margin-left: auto; }
.turn-actions button.link { color: var(--dim); font-size: 12px; }
.turn-actions button.link:hover { color: var(--accent); text-decoration: none; }
.command { border: 1px solid var(--line); border-radius: var(--radius); margin: 10px 0; overflow: hidden; background: var(--panel); box-shadow: var(--shadow); }
.command .cmd { padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 2px 12px; align-items: baseline; background: var(--side); }
/* The command keeps the line; where there's no room left, its time and status go under it, on the right. */
.command .cmd pre { color: var(--fg); flex: 1 1 22em; min-width: 0; }
.command .cmd .meta { display: inline-flex; gap: 12px; align-items: baseline; margin-left: auto; white-space: nowrap; }
.command .cmd .badge { font-size: 11.5px; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.command .cmd .meta > span { white-space: nowrap; font-size: 12px; }
.command.pending { border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18), var(--shadow); }
.command.pending .cmd { background: var(--yellow-soft); }
.command.pending .cmd pre { font-weight: 600; }
.badge.waiting { color: #fff; background: #f59e0b; font-weight: 600; }
.command .cmd .running { color: var(--violet); }
.badge.auto { color: var(--green); background: var(--green-soft); }
.badge.denied { color: var(--red); background: var(--red-soft); }
.badge.rule { color: var(--violet); background: var(--violet-soft); }
.command .output { padding: 8px 12px; border-top: 1px solid var(--line); color: #374151; max-height: 320px; overflow: auto; }
.command .output.long summary { cursor: pointer; color: var(--dim); font-family: var(--sans); font-size: 12px; }
/* The rest of a long output or thinking block, which a load leaves out and this fetches. */
button.more { display: block; margin: 4px 0 6px; font-size: 12px; }
.command .output button.more { margin: 0 0 6px; }
.diff { border-top: 1px solid var(--line); padding: 6px 0; max-height: 420px; overflow: auto; }
.diff > div { padding: 0 12px; }
.diff .add { color: #116329; background: #e6ffec; }
.diff .del { color: #a40e26; background: #ffebe9; }
.diff .hunk { color: var(--accent); background: var(--accent-soft); }
.usage { color: var(--faint); font-size: 12px; }

.raw { margin: 2px 0 10px; font-size: 12px; }
.raw summary { cursor: pointer; color: var(--faint); width: fit-content; user-select: none; }
.raw summary:hover { color: var(--fg); }
.raw .fields { margin-top: 6px; }
.raw pre { margin-top: 6px; padding: 10px 12px; background: var(--side); border: 1px solid var(--line); border-radius: var(--radius); max-height: 480px; overflow: auto; font-size: 11.5px; color: #374151; }
.turn + .raw { margin-top: -18px; margin-bottom: 24px; }

/* On a touch screen with the keyboard closed: buttons in place of the prompt, which
   stays in the page, out of sight, to take the focus. */
/* The same box as the prompt line, so swapping one for the other moves nothing: the
   prompt button reads like the empty prompt, the others are small links. */
.touch-bar { display: flex; align-items: flex-start; gap: 14px; padding: 12px 28px; font-family: var(--sans); font-size: 12.5px; line-height: 1.6; }
.touch-bar button { padding: 0; border: none; border-radius: 0; background: none; box-shadow: none; font: inherit; line-height: inherit; white-space: nowrap; }
.touch-bar button:hover { background: none; }
.touch-bar .write { flex: 1; min-width: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; color: var(--faint); }
.touch-bar .write .caret { color: var(--green); font-weight: 700; margin-right: 10px; position: relative; top: -1px; }
.touch-bar button:not(.write) { font: 12px var(--sans); line-height: inherit; color: var(--dim); }
/* The slash button opens the prompt's command menu. */
.touch-bar button.slash, .touch-bar button.slash:hover { flex: none; align-self: center; width: 34px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); box-shadow: var(--shadow); font: 600 16px/1 var(--mono); color: var(--fg); }
.touch-bar button.slash:active { background: var(--soft); }
/* Stowed, the prompt stays a real (if all but invisible) element under the buttons:
   iOS won't open the keyboard for a zero-size, fully transparent one. */
.prompt-line.stowed { position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; padding: 0; overflow: hidden; opacity: 0.01; pointer-events: none; }
/* Nothing in the chat makes it scroll sideways: long words and paths wrap, a wide
   table scrolls in its own box, images fit. */
.chat { overflow-x: hidden; overflow-wrap: anywhere; }
.chat .entry { min-width: 0; max-width: 100%; }
/* Entries out of sight are skipped in layout and paint, so a long chat stays quick;
   each keeps the height it last had (a guess until it has shown once). */
.chat-log > * { content-visibility: auto; contain-intrinsic-size: auto 80px; }
.reply table { display: block; max-width: 100%; overflow-x: auto; }
.reply img { max-width: 100%; height: auto; }

/* Settings */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.page-head h2 { margin: 0; }
button.close { border: none; box-shadow: none; background: none; color: var(--dim); font-size: 16px; line-height: 1; padding: 6px 8px; border-radius: 6px; }
button.close:hover { background: var(--soft); color: var(--fg); }
.modal .card.settings { width: 560px; max-width: calc(100vw - 32px); padding: 20px 8px 8px; }
.settings .page-head, .settings > p { padding: 0 14px; }
.settings > p { margin: 0 0 8px; }
.setting { display: flex; align-items: center; gap: 24px; padding: 14px; border-top: 1px solid var(--line); cursor: pointer; }
.setting:first-child { border-top: none; }
.modal label.setting { display: flex; margin: 0; color: var(--fg); font-size: 14px; }
.modal .setting .dim { font-size: 13px; }
.setting > div { flex: 1; }
.setting .name { font-weight: 550; }
.setting .dim { font-size: 13px; }
.switch, .modal input.switch { appearance: none; width: 36px; height: 20px; border-radius: 999px; background: #d1d5db; position: relative; cursor: pointer; padding: 0; border: none; flex: none; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch:checked, .modal input.switch:checked { background: var(--accent); }
.switch:checked::after, .modal input.switch:checked::after { transform: translateX(16px); }
.switch:focus { box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }

/* Shift+tab agent picker */
.picker { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 15; pointer-events: none; }
.picker .card { width: 340px; padding: 10px; box-shadow: var(--shadow-lg); border-radius: 12px; }
.picker .title { color: var(--faint); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; padding: 4px 8px 8px; }
.picker .pick { display: flex; align-items: center; padding: 7px 10px; border-radius: 6px; }
.picker .pick.selected { background: var(--accent-soft); color: var(--accent); font-weight: 550; }
.picker .label { flex: 1; }
.picker .status { font-size: 12px; color: var(--faint); }
.picker .status.wait { color: var(--yellow); }
.picker .dot.wait { background: #f59e0b; }
.picker .hint { color: var(--faint); font-size: 11.5px; padding: 8px 8px 2px; border-top: 1px solid var(--line); margin-top: 6px; }

/* New agent dialog */
.modal { position: fixed; inset: 0; background: rgba(17, 24, 39, 0.28); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; z-index: 40; }
.modal .card { width: 540px; max-height: 80vh; overflow: auto; padding: 22px 24px; box-shadow: var(--shadow-lg); border-radius: 12px; }
.modal label { display: block; margin: 14px 0 6px; color: var(--dim); font-size: 12px; font-weight: 500; }
.modal input, .modal select { width: 100%; }
.dirs { max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); margin-top: 8px; padding: 4px; }
.dirs div { padding: 5px 10px; cursor: pointer; border-radius: 5px; font-family: var(--mono); font-size: 12.5px; }
.dirs div:hover { background: var(--soft); }

/* Gatekeepers: a row each, what state it is in, and a way to put the agent on
   screen on one or to start another. */
.modal .card.gatekeepers { width: 760px; max-width: calc(100vw - 32px); }
.modal .card.gatekeepers > p { margin: 0; font-size: 13px; }
/* The table's box is a card inside the window's: it takes the window's width, not
   a dialog's own. */
.modal .card.keepers-table { width: auto; max-height: none; padding: 0; margin-top: 14px; box-shadow: none; overflow: hidden; }
.keepers-table table { font-size: 13px; }
.keepers-table th, .keepers-table td { padding: 6px 8px; }
.keepers-table .keeper-name .name { font-weight: 550; }
.keepers-table .keeper-name { display: flex; align-items: center; gap: 7px; }
.keepers-table tr.current .keeper-name .name { color: var(--accent); }
.keepers-table tr.offline .keeper-name { opacity: .6; }
.keepers-table td.row-actions { text-align: right; white-space: nowrap; }
/* On a phone the window fits its width: the table's columns share it, and the
   explanation is smaller. */
@media (max-width: 760px) {
  .modal .card.gatekeepers { padding: 16px; overflow-x: hidden; }
  .modal .card.gatekeepers > p { font-size: 12px; }
  .keepers-table table { width: 100%; table-layout: fixed; }
  .keepers-table th:first-child, .keepers-table td.keeper-name { width: 50%; }
  .keepers-table .keeper-name .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .keepers-table td.row-actions { width: 3.5em; }
}
/* The shield, in the sidebar's mark and the status bar's selector. */
.gate-logo { flex: none; display: inline-block; vertical-align: -1px; }

.footer.asking { border-top: 2px solid #f59e0b; background: var(--yellow-soft); }
.footer.asking .ask { padding: 10px 28px 0; font-weight: 600; color: var(--yellow); }
.footer.asking .prompt-line, .footer.asking .prompt-line:focus-within { background: transparent; }
.footer.asking .caret { color: #f59e0b; }
/* The approval box's main button: Approve, or Decline once a reason is typed, the
   other choice a small link beside it. */
.footer.asking .actions { align-items: center; }
.footer.asking button.decide { padding: 5px 16px; border: none; border-radius: 6px; font-weight: 600; color: #fff; box-shadow: var(--shadow); }
.footer.asking button.decide.approve { background: var(--green, #16a34a); }
.footer.asking button.decide.approve:hover { filter: brightness(0.95); }
.footer.asking button.decide.decline { background: var(--red); }
.footer.asking button.decide.decline:hover { filter: brightness(0.95); }
.footer.asking .actions button.link { font-size: 12px; color: var(--dim); }
/* Declining: the box turns red, as what is typed is the refusal's reason. */
.footer.asking.declining { border-top-color: var(--red); background: var(--red-soft); }
.footer.asking.declining .ask, .footer.asking.declining .caret { color: var(--red); }
/* An approval that came while the user was typing: a bar above the prompt, opened
   when they choose to. */
.approval-waiting { display: flex; align-items: center; gap: 12px; padding: 8px 28px; border-top: 2px solid #f59e0b; background: var(--yellow-soft); color: var(--yellow); font-weight: 600; font-size: 13px; }
.approval-waiting span { flex: 1; min-width: 0; }
.approval-waiting button.decide { padding: 4px 14px; border: none; border-radius: 6px; background: #f59e0b; color: #fff; font-weight: 600; }
@media (max-width: 760px) {
  .approval-waiting { padding: 8px 14px; }
}
.prompt-line .actions { display: flex; gap: 14px; align-self: center; }
button.link.approve { color: var(--green); font-weight: 600; }
button.link.deny { color: var(--red); }
/* 22px, but taking only the 20px of a line: the prompt mustn't grow as it shows. */
.prompt-line .clear { flex: none; width: 22px; height: 22px; margin: -1px 0; padding: 0; border: none; border-radius: 6px; box-shadow: none; background: transparent; color: var(--faint); font: 17px/1 var(--sans); display: grid; place-items: center; }
.prompt-line .clear:hover { background: var(--soft); color: var(--fg); }
button.link { border: none; background: none; box-shadow: none; padding: 0; font: 12px var(--sans); color: var(--accent); white-space: nowrap; }
button.link:hover { background: none; text-decoration: underline; }
.footer .hint { color: var(--faint); font-size: 12px; margin-top: 6px; }

/* Chat entries */
.entry { margin: 8px 0; }
.text.error { color: var(--red); background: var(--red-soft); border-radius: 6px; padding: 8px 12px; }
.text.info { color: var(--dim); font-size: 13px; }
.reply { line-height: 1.65; }
.reply p { margin: 8px 0; }
.reply h1, .reply h2, .reply h3 { line-height: 1.3; margin: 18px 0 8px; letter-spacing: -0.01em; }
.reply h1 { font-size: 20px; } .reply h2 { font-size: 17px; } .reply h3 { font-size: 15px; }
.reply ul, .reply ol { padding-left: 22px; }
.reply blockquote { margin: 8px 0; padding-left: 12px; border-left: 3px solid var(--line-strong); color: var(--dim); }
.reply pre { background: var(--code); border: 1px solid var(--line); padding: 10px 12px; border-radius: var(--radius); overflow: auto; }
.reply code { background: var(--soft); padding: 1px 5px; border-radius: 4px; font-size: 0.9em; }
.reply pre code { padding: 0; background: none; font-size: inherit; }
.reply table { margin: 8px 0; }
.reply table td, .reply table th { border: 1px solid var(--line); }
.thinking { color: var(--dim); font-size: 13px; }
.thinking summary { cursor: pointer; width: fit-content; user-select: none; }
.thinking summary:hover { color: var(--fg); }
.thinking[open] .reply { border-left: 2px solid var(--line); padding-left: 12px; margin-top: 4px; }
.round { color: var(--faint); font-size: 12px; margin: 14px 0 4px; }
.turn { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; color: var(--faint); font-size: 12px; margin: 10px 0 24px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
/* Not a turn's end: no rule under it, and its raw prompt sits below it as a round's does. */
.turn.system-line { margin: 0 0 4px; padding-bottom: 0; border-bottom: none; }
.turn.system-line + .raw { margin-top: 2px; margin-bottom: 16px; }
.turn-actions { display: inline-flex; gap: 12px; margin-left: auto; }
.turn-actions button.link { color: var(--dim); font-size: 12px; }
.turn-actions button.link:hover { color: var(--accent); text-decoration: none; }
.command { border: 1px solid var(--line); border-radius: var(--radius); margin: 10px 0; overflow: hidden; background: var(--panel); box-shadow: var(--shadow); }
.command .cmd { padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 2px 12px; align-items: baseline; background: var(--side); }
/* The command keeps the line; where there's no room left, its time and status go under it, on the right. */
.command .cmd pre { color: var(--fg); flex: 1 1 22em; min-width: 0; }
.command .cmd .meta { display: inline-flex; gap: 12px; align-items: baseline; margin-left: auto; white-space: nowrap; }
.command .cmd .badge { font-size: 11.5px; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.command .cmd .meta > span { white-space: nowrap; font-size: 12px; }
.command.pending { border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18), var(--shadow); }
.command.pending .cmd { background: var(--yellow-soft); }
.command.pending .cmd pre { font-weight: 600; }
.badge.waiting { color: #fff; background: #f59e0b; font-weight: 600; }
.command .cmd .running { color: var(--violet); }
/* A command's time, counting while it runs: its digits all one width, and room kept
   for it, so its changing never moves the command beside it (which would wrap again,
   and move everything below). */
.command .cmd .took { display: inline-block; min-width: 8.5em; text-align: right; font-variant-numeric: tabular-nums; }
.round, .turn, .stats { font-variant-numeric: tabular-nums; }
.badge.auto { color: var(--green); background: var(--green-soft); }
.badge.denied { color: var(--red); background: var(--red-soft); }
.badge.rule { color: var(--violet); background: var(--violet-soft); }
.command .output { padding: 8px 12px; border-top: 1px solid var(--line); color: #374151; max-height: 320px; overflow: auto; }
.command .output.long summary { cursor: pointer; color: var(--dim); font-family: var(--sans); font-size: 12px; }
.diff { border-top: 1px solid var(--line); padding: 6px 0; max-height: 420px; overflow: auto; }
.diff > div { padding: 0 12px; }
.diff .add { color: #116329; background: #e6ffec; }
.diff .del { color: #a40e26; background: #ffebe9; }
.diff .hunk { color: var(--accent); background: var(--accent-soft); }
.usage { color: var(--faint); font-size: 12px; }

.raw { margin: 2px 0 10px; font-size: 12px; }
.raw summary { cursor: pointer; color: var(--faint); width: fit-content; user-select: none; }
.raw summary:hover { color: var(--fg); }
.raw .fields { margin-top: 6px; }
.raw pre { margin-top: 6px; padding: 10px 12px; background: var(--side); border: 1px solid var(--line); border-radius: var(--radius); max-height: 480px; overflow: auto; font-size: 11.5px; color: #374151; }
.turn + .raw { margin-top: -18px; margin-bottom: 24px; }

/* On a touch screen with the keyboard closed: buttons in place of the prompt, which
   stays in the page, out of sight, to take the focus. */
/* The same box as the prompt line, so swapping one for the other moves nothing: the
   prompt button reads like the empty prompt, the others are small links. */
.touch-bar { display: flex; align-items: flex-start; gap: 14px; padding: 12px 28px; font-family: var(--sans); font-size: 12.5px; line-height: 1.6; }
.touch-bar button { padding: 0; border: none; border-radius: 0; background: none; box-shadow: none; font: inherit; line-height: inherit; white-space: nowrap; }
.touch-bar button:hover { background: none; }
.touch-bar .write { flex: 1; min-width: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; color: var(--faint); }
.touch-bar .write .caret { color: var(--green); font-weight: 700; margin-right: 10px; position: relative; top: -1px; }
.touch-bar button:not(.write) { font: 12px var(--sans); line-height: inherit; color: var(--dim); }
/* The slash button opens the prompt's command menu. */
.touch-bar button.slash, .touch-bar button.slash:hover { flex: none; align-self: center; width: 34px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); box-shadow: var(--shadow); font: 600 16px/1 var(--mono); color: var(--fg); }
.touch-bar button.slash:active { background: var(--soft); }
/* The stop button, while the agent works: in the prompt line, and beside the slash on
   a phone. */
/* The prompt's Pause (Resume once paused) and Stop: a pair of one size, a drawn icon
   and a word; amber for pausing, red for stopping. */
/* As the turn's "⑂ fork" is: a quiet link, the accent on a hover. */
.entry.round button.fork-now { margin-left: 10px; padding: 0; border: none; background: none; box-shadow: none; font: 12px var(--sans); color: var(--dim); white-space: nowrap; cursor: pointer; }
.entry.round button.fork-now:hover { color: var(--accent); background: none; text-decoration: none; }
.prompt-line button.fork-now { flex: none; align-self: flex-start; margin: -2px 0; height: 24px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 6px; box-shadow: none; font: 600 12px/1 var(--sans); white-space: nowrap; color: var(--dim); background: transparent; }
.prompt-line button.fork-now:hover { color: var(--fg); background: var(--soft); }
.prompt-line button.pause, .prompt-line button.stop { flex: none; align-self: flex-start; margin: -2px 0; height: 24px; padding: 0 10px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid; border-radius: 6px; box-shadow: none; font: 600 12px/1 var(--sans); white-space: nowrap; }
.prompt-line button.pause { color: var(--yellow); border-color: #fde68a; background: transparent; }
.prompt-line button.pause:hover { background: var(--yellow-soft); }
.prompt-line button.pause.on { border-color: #fcd34d; background: var(--yellow-soft); }
.prompt-line button.stop { color: var(--red); border-color: #fecaca; background: var(--red-soft); }
.prompt-line button.stop:hover { background: #fee2e2; }
.prompt-line button .icon, .touch-bar button .icon { flex: none; display: block; }
/* On a phone: tiles, as the / beside them is. */
.touch-bar button.pause, .touch-bar button.pause:hover, .touch-bar button.stop, .touch-bar button.stop:hover { flex: none; align-self: center; width: 34px; height: 30px; padding: 0; display: grid; place-items: center; border: 1px solid; border-radius: 8px; box-shadow: none; }
.touch-bar button.pause, .touch-bar button.pause:hover { color: var(--yellow); border-color: #fde68a; background: var(--panel); }
.touch-bar button.pause.on { border-color: #fcd34d; background: var(--yellow-soft); }
.touch-bar button.stop, .touch-bar button.stop:hover { color: var(--red); border-color: #fecaca; background: var(--red-soft); }
/* Stowed, the prompt stays a real (if all but invisible) element under the buttons:
   iOS won't open the keyboard for a zero-size, fully transparent one. */
.prompt-line.stowed { position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; padding: 0; overflow: hidden; opacity: 0.01; pointer-events: none; }
/* Nothing in the chat makes it scroll sideways: long words and paths wrap, a wide
   table scrolls in its own box, images fit. */
.chat { overflow-x: hidden; overflow-wrap: anywhere; }
.chat .entry { min-width: 0; max-width: 100%; }
/* Entries out of sight are skipped in layout and paint, so a long chat stays quick;
   each keeps the height it last had (a guess until it has shown once). */
.chat-log > * { content-visibility: auto; contain-intrinsic-size: auto 80px; }
.reply table { display: block; max-width: 100%; overflow-x: auto; }
.reply img { max-width: 100%; height: auto; }

/* Settings */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.page-head h2 { margin: 0; }
button.close { border: none; box-shadow: none; background: none; color: var(--dim); font-size: 16px; line-height: 1; padding: 6px 8px; border-radius: 6px; }
button.close:hover { background: var(--soft); color: var(--fg); }
.modal .card.settings { width: 560px; max-width: calc(100vw - 32px); padding: 20px 8px 8px; }
.settings .page-head, .settings > p { padding: 0 14px; }
.settings > p { margin: 0 0 8px; }
.setting { display: flex; align-items: center; gap: 24px; padding: 14px; border-top: 1px solid var(--line); cursor: pointer; }
.setting:first-child { border-top: none; }
.modal label.setting { display: flex; margin: 0; color: var(--fg); font-size: 14px; }
.modal .setting .dim { font-size: 13px; }
.setting > div { flex: 1; }
.setting .name { font-weight: 550; }
.setting .dim { font-size: 13px; }
.switch, .modal input.switch { appearance: none; width: 36px; height: 20px; border-radius: 999px; background: #d1d5db; position: relative; cursor: pointer; padding: 0; border: none; flex: none; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch:checked, .modal input.switch:checked { background: var(--accent); }
.switch:checked::after, .modal input.switch:checked::after { transform: translateX(16px); }
.switch:focus { box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }

/* Shift+tab agent picker */
.picker { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 15; pointer-events: none; }
.picker .card { width: 340px; padding: 10px; box-shadow: var(--shadow-lg); border-radius: 12px; }
.picker .title { color: var(--faint); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; padding: 4px 8px 8px; }
.picker .pick { display: flex; align-items: center; padding: 7px 10px; border-radius: 6px; }
.picker .pick.selected { background: var(--accent-soft); color: var(--accent); font-weight: 550; }
.picker .label { flex: 1; }
.picker .status { font-size: 12px; color: var(--faint); }
.picker .status.wait { color: var(--yellow); }
.picker .dot.wait { background: #f59e0b; }
.picker .hint { color: var(--faint); font-size: 11.5px; padding: 8px 8px 2px; border-top: 1px solid var(--line); margin-top: 6px; }

/* New agent dialog */
.modal { position: fixed; inset: 0; background: rgba(17, 24, 39, 0.28); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; z-index: 40; }
.modal .card { width: 540px; max-height: 80vh; overflow: auto; padding: 22px 24px; box-shadow: var(--shadow-lg); border-radius: 12px; }
.modal label { display: block; margin: 14px 0 6px; color: var(--dim); font-size: 12px; font-weight: 500; }
.modal input, .modal select { width: 100%; }
/* A new agent's setup, in its page where its chat will be: its choices in sections
   down a column that scrolls, and the buttons kept at the bottom, where the prompt
   will be. */
.agent-setup { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--side); }
.agent-setup .setup { flex: 1; min-height: 0; overflow: auto; padding: 24px 24px 16px; }
.agent-setup .setup > * { max-width: 600px; margin-left: auto; margin-right: auto; }
.agent-setup header { margin-bottom: 12px; }
.agent-setup header h2 { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: -0.01em; }
.agent-setup header p { margin: 2px 0 0; font-size: 13px; }
.agent-setup section { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 14px; margin-bottom: 8px; box-shadow: var(--shadow); }
.agent-setup section.none { text-align: center; padding: 28px 18px; }
.agent-setup section.none p { margin: 0; }
.agent-setup h4 { margin: 0 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.agent-setup label { display: flex; align-items: baseline; gap: 8px; margin: 10px 0 4px; color: var(--dim); font-size: 12.5px; font-weight: 500; }
.agent-setup h4 + label, .agent-setup h4 + .pair label:first-child { margin-top: 0; }
.agent-setup .pair > div > label:first-child { margin-top: 0; }
.agent-setup .on-server { margin-left: auto; color: var(--faint); font-weight: 400; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.agent-setup input, .agent-setup select { width: 100%; height: 34px; }
.agent-setup .pair { display: grid; grid-template-columns: 3fr 2fr; gap: 10px; }

/* What kind of agent: a box each, side by side, the one picked outlined. */
.agent-setup .kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.agent-setup .kind { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 9px 12px; text-align: left; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--panel); color: var(--fg); cursor: pointer; box-shadow: none; }
.agent-setup .kind:hover { background: var(--soft); }
.agent-setup .kind.picked { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; background: var(--accent-soft); }
.agent-setup .kind.picked::after { content: "✓"; position: absolute; top: 50%; margin-top: -9px; right: 10px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; line-height: 18px; font-weight: 700; }
.agent-setup .kind > svg { grid-row: 1 / 3; }
.agent-setup .kind .name { font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.agent-setup .kind .dim { font-size: 11.5px; line-height: 1.3; }

/* The folder: its path with Browse in one field, its folders opening under it. */
.agent-setup .folder-field { border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); transition: border-color .12s, box-shadow .12s; }
.agent-setup .folder-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }
.agent-setup .folder-field .path { display: flex; align-items: center; gap: 6px; padding: 2px 2px 2px 10px; }
.agent-setup .folder { flex: none; color: #8aa4d6; }
.agent-setup .folder-field input { border: none; box-shadow: none; padding: 0 4px; height: 28px; font-family: var(--mono); font-size: 13px; background: none; }
.agent-setup .folder-field input:focus { box-shadow: none; }
.agent-setup .folder-field button { flex: none; height: 28px; padding: 0 10px; box-shadow: none; font-size: 13px; }
.agent-setup button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.agent-setup .dirs { margin: 0; border: none; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; max-height: 260px; padding: 4px; }
.agent-setup .dirs div { display: flex; align-items: center; gap: 8px; padding: 4px 10px; }
.agent-setup .dirs div span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-setup .dirs .up { color: var(--dim); }
.agent-setup .dirs .empty { color: var(--faint); cursor: default; font-family: var(--sans); }
.agent-setup .dirs .empty:hover { background: none; }

/* Chrome, a switch on its own line under the mode. */
.agent-setup label.setting { display: flex; align-items: center; margin: 10px -14px -14px; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--fg); font-size: 14px; }
.agent-setup input.switch { width: 36px; height: 20px; }
.agent-setup input.switch:checked { background: var(--accent); }

/* Cancel and Start, at the bottom where the prompt will be. */
.agent-setup footer { flex: none; position: relative; z-index: 1; border-top: 1px solid var(--line); background: var(--panel); padding: 8px 24px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
.agent-setup .actions { max-width: 600px; margin: 0 auto; display: flex; justify-content: flex-end; gap: 8px; }
.agent-setup .actions button { height: 34px; padding: 0 16px; }
.agent-setup .actions button.primary { padding: 0 20px; }
.agent-setup .actions button:disabled { opacity: .55; cursor: default; }
@media (max-width: 760px) {
  .agent-setup .setup { padding: 60px 10px 12px; }
  .agent-setup header { padding: 0 4px; }
  .agent-setup section { padding: 10px 12px 12px; }
  .agent-setup label.setting { margin: 10px -12px -12px; padding: 10px 12px; }
  .agent-setup .pair { grid-template-columns: 1fr; gap: 0; }
  .agent-setup .pair > div + div > label:first-child { margin-top: 10px; }
  .agent-setup footer { padding: 8px 10px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .agent-setup .actions button { flex: 1; height: 40px; }
}
.dirs { max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); margin-top: 8px; padding: 4px; }
.dirs div { padding: 5px 10px; cursor: pointer; border-radius: 5px; font-family: var(--mono); font-size: 12.5px; }
.dirs div:hover { background: var(--soft); }

/* Model picker: type to filter, then a reasoning-effort step */
.modal .card.model-picker { width: 620px; max-width: calc(100vw - 32px); padding: 12px; display: flex; flex-direction: column; overflow: hidden; }
.model-picker .title { color: var(--faint); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; padding: 4px 8px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-picker input { font-family: var(--mono); margin-bottom: 6px; }
.model-picker select.backend { margin-bottom: 6px; font-size: 13px; }
.backend-form label.retries { flex-direction: row; align-items: center; gap: 8px; flex-wrap: wrap; }
.backend-form label.retries input { width: 4em; text-align: center; }
.backend-form textarea { font-family: var(--mono); font-size: 13px; width: 100%; resize: vertical; }
.backends td.actions button { margin-left: 6px; }
/* A backend's models, a row each, with their JSON settings under an Edit. */
.backend-form .models .label { font-size: 12px; color: var(--dim); }
.backend-form table.models-table { width: 100%; margin: 4px 0; }
.backend-form table.models-table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--dim); padding: 0 10px 2px 0; }
.backend-form table.models-table td input { width: 100%; font-size: 13px; font-family: var(--mono); }
.backend-form table.models-table td.actions { white-space: nowrap; width: 1%; }
.backend-form table.models-table td.actions button.set { font-weight: 600; }
.backend-form tr.model-json td { padding-bottom: 8px; }
.backend-form .name { font-size: 13px; font-weight: 550; margin-top: 4px; }
.backend-form .form-error { color: var(--red); font-size: 12px; margin-top: 2px; }
.backend-form .how-to p { margin: 0 0 6px; }
.backend-form .how-to code { font-size: 12px; }
@media (max-width: 640px) {
  .backend-form table.models-table thead { display: none; }
  .backend-form table.models-table tr { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
  .backend-form table.models-table td { flex: 1 1 30%; padding: 0; }
  .backend-form table.models-table td.actions, .backend-form table.models-table td[colspan] { flex-basis: 100%; }
}
/* Still focused, for the keys, while the effort step shows. */
.model-picker input.stowed { position: absolute; opacity: 0; height: 0; padding: 0; border: 0; margin: 0; }
.model-picker .models { overflow: auto; min-height: 0; flex: 1; }
/* The list takes what's left: the title, filter and hint keep their height. */
.model-picker .title, .model-picker input, .model-picker .hint { flex: none; }
.model-picker .pick { display: flex; align-items: baseline; gap: 10px; padding: 6px 10px; border-radius: 6px; cursor: pointer; font-family: var(--mono); font-size: 12.5px; }
.model-picker .pick:hover { background: var(--soft); }
.model-picker .pick.selected { background: var(--accent-soft); color: var(--accent); font-weight: 550; }
.model-picker .id { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-picker .current { color: var(--faint); font-family: inherit; font-size: 11.5px; font-weight: 400; }
.model-picker .price, .model-picker .context { color: var(--dim); white-space: nowrap; font-variant-numeric: tabular-nums; }
.model-picker .context { width: 4.5em; text-align: right; }
.model-picker .hint { color: var(--faint); font-size: 11.5px; padding: 8px 8px 2px; border-top: 1px solid var(--line); margin-top: 6px; }
.model-picker .hint.error { color: var(--red, #dc2626); }
.model-picker .id .name { color: var(--dim); font-family: var(--sans); font-weight: 400; margin-left: 10px; }
.model-picker .version { color: var(--faint); white-space: nowrap; }
.model-picker .pick.disabled { opacity: 0.5; cursor: default; }
.provider-picker:focus { outline: none; }
.provider-picker .quant { color: var(--dim); width: 5em; }
.provider-picker .uptime { color: var(--dim); width: 4.5em; text-align: right; font-variant-numeric: tabular-nums; }

/* Phone: the menu becomes a drawer */
.menu-toggle, .scrim { display: none; }
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .statusbar .cwd { display: none; }
  /* A swipe opens a row's options here (right), or removes it (left). */
  .sidebar .agent .more, .sidebar .asset .more, .sidebar .item .more { display: none !important; }
  .sidebar { position: absolute; inset: 0 auto 0 0; width: 92vw; max-width: 380px; z-index: 30; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  /* The room's column takes the drawer's width beside the rail. */
  .sidebar .sidebar-col { flex: 1; width: auto; }
  /* Sliding in, it takes no touch: the tap that opened it lands on the tab or the
     scrim, which let it pass, not on a button sliding under the finger. */
  .sidebar.opening, .sidebar.opening * { pointer-events: none; }
  .scrim { display: block; position: absolute; inset: 0; background: rgba(17, 24, 39, 0.28); z-index: 25; }
  /* A tab on the left edge, at the top, that pulls the menu out. */
  .menu-toggle { display: grid; place-items: center; position: absolute; top: 8px; left: 0; z-index: 20; width: 22px; height: 52px; padding: 0 0 2px; border-left: none; border-radius: 0 10px 10px 0; font-size: 20px; font-weight: 700; line-height: 1; color: var(--dim); background: var(--panel); }
  .page { padding: 56px 16px 24px; }
  .chat { padding: 56px 14px 12px; }
  .stats { top: 8px; right: 8px; font-size: 10.5px; max-width: calc(100% - 70px); }
  .prompt-line, .touch-bar { padding: 10px 14px; font-size: 14px; }
  .footer.asking .ask { padding: 10px 14px 0; }
  /* Approve and deny share the line with the prompt's text. */
  .footer.asking .actions { gap: 10px; }
  .statusbar { padding: 6px 12px; }
  .statusbar .hints { display: none; }
  .statusbar .status { margin-left: auto; }
  /* Typing in a prompt: the status line gives its room to the keyboard. Only for a
     text field: a tapped button takes the focus too, and the footer moving under the
     finger mid-tap would send the click elsewhere. */
  .footer:has(textarea:focus, input:focus) + .statusbar { display: none; }
  .rooms-head { flex-wrap: wrap; }
  .card { overflow-x: auto; }
  .text.user, .text.queued { font-size: 14px; }
}

/* Touch screens: 16px in the prompt, or iOS zooms in when it takes the focus. */
@media (pointer: coarse) {
  .prompt-line, .touch-bar { font-size: 16px; }
}

/* Servers page: the registry, a token just made, and the settings. */
.servers-page h3 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--dim); margin: 24px 0 8px; }
.servers-page .section-head { margin: 20px 0 8px; }
.servers-page .section-head h3 { margin: 0; }
/* A section's add button: a small round + at the right of its heading, as in the sidebar. */
.servers-page .section-head .add { margin-left: auto; width: 22px; height: 22px; padding: 0; border-radius: 999px; font-size: 15px; line-height: 1; box-shadow: none; color: var(--dim); background: transparent; border: 1px dashed var(--line); }
.servers-page .section-head .add:hover { background: var(--soft); color: var(--accent); border-color: var(--accent); }
.servers-page .badge { margin-left: 8px; padding: 0 7px; border-radius: 999px; font-size: 11px; font-weight: 550; color: var(--yellow); background: var(--yellow-soft); cursor: help; }
.servers-page td.actions { text-align: right; white-space: nowrap; }
.servers-page td.actions button { padding: 2px 10px; font-size: 13px; margin-left: 4px; }
/* The same buttons in the same places on every row, whichever the token one says. */
.servers-page td.actions button.token { min-width: 96px; }
.servers-page tr.editing td { background: var(--side); }
.server-form { display: flex; flex-direction: column; gap: 10px; }
.server-form label { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; font-size: 12px; color: var(--dim); }
.server-form label input, .server-form label select { font-size: 14px; color: var(--fg); width: 100%; }
.server-form .pair { display: flex; gap: 10px; }
/* Under the list: a server to add, or the token just made, which is what it shows
   first; the command that launches the server comes after, smaller. */
.servers-page .add-server-button { width: 100%; margin-top: 10px; padding: 9px; border-style: dashed; background: none; box-shadow: none; color: var(--dim); }
.servers-page .add-server-button:hover { background: var(--soft); color: var(--fg); }
.servers-page .add-server, .token-card { margin-top: 10px; }
.servers-page .add-server .title, .token-card .title { font-weight: 600; margin-bottom: 10px; }
.token-card { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.token-card .title { margin-bottom: 2px; }
.token-card p { margin: 0 0 10px; font-size: 13px; }
.token-card .token-line { display: flex; gap: 8px; align-items: stretch; }
.token-card code.token { flex: 1; min-width: 0; padding: 9px 12px; font-size: 15px; font-weight: 550; letter-spacing: .02em; background: var(--side); border: 1px solid var(--line); border-radius: 6px; user-select: all; overflow-x: auto; white-space: nowrap; }
.token-card .launch { display: flex; align-items: baseline; gap: 10px; margin: 14px 0 4px; font-size: 12.5px; }
.token-card pre.command { padding: 8px 10px; margin: 0 0 10px; font-size: 12px; color: var(--dim); background: var(--side); border: 1px solid var(--line); border-radius: 6px; user-select: all; overflow-x: auto; white-space: pre; }
@media (max-width: 760px) {
  .token-card code.token { font-size: 13.5px; letter-spacing: 0; padding: 8px 10px; white-space: normal; overflow-wrap: anywhere; }
  .token-card pre.command { white-space: pre-wrap; overflow-wrap: anywhere; }
}
.api-key { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-bottom: 14px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.api-key > div:first-child { flex: 1; min-width: 200px; }
.api-key .name { font-weight: 550; }
.api-key .dim { font-size: 13px; }
.api-key input { width: 220px; max-width: 100%; }
.servers-page label.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.servers-page label.check input { margin-top: 4px; }
.servers-page td.name { white-space: nowrap; }
/* On a phone a server is a block of its own: name and agents, then its model, then
   what can be done with it. */
@media (max-width: 760px) {
  .servers-page .wide, .servers-page table.servers thead { display: none; }
  .servers-page table.servers tr { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .servers-page table.servers tr:last-child { border-bottom: none; }
  .servers-page table.servers td { border: none; padding: 2px 8px; }
  .servers-page table.servers td:first-child { padding-left: 16px; }
  .servers-page table.servers td.name { flex: 1; min-width: 0; white-space: normal; padding-right: 44px; }
  .servers-page table.servers td.model { flex-basis: 100%; padding-left: 40px; }
  .server-form label.check { font-size: 13px; }
  /* The row's actions are only the ⋯ menu: anchor it at the block's top-right rather
     than let it fall onto a full-width line of its own. */
  .servers-page table.servers td.actions { position: absolute; top: 4px; right: 8px; flex-basis: auto; width: auto; padding: 0; text-align: right; }
  .servers-page table.servers td.actions button { margin: 0; }
  .servers-page td.actions { text-align: left; white-space: normal; }
  .servers-page table.servers tr.editing td { flex-basis: 100%; padding: 8px 16px; }
  .server-form .pair { flex-direction: column; }
}

/* Users page: oneself, the users, and the token setting. The table and forms are
   the Servers page's. */
.users-page .badge.you { color: var(--accent); background: var(--accent-soft); cursor: default; }
.users-page .badge.off { color: var(--dim); background: var(--soft); cursor: default; }
.users-page tr.disabled td.name, .users-page tr.disabled td.dim { opacity: .6; }
.users-page .me .who { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.users-page .me .who > div:first-child { flex: 1; min-width: 220px; }
.users-page .me .name { font-weight: 550; }
.users-page .me .dim { font-size: 13px; }
.users-page .me .token-card { margin-top: 14px; }
.users-page .role-what { font-size: 12.5px; margin-top: -4px; }
.users-page td code, .users-page .me code { font-size: 12px; }
.footer.readonly { padding: 10px 16px; font-size: 13px; }
@media (max-width: 760px) {
  .users-page table.users td.actions { flex-basis: 100%; padding-left: 40px; }
}

/* A room's members panel, under its row on the Rooms page. */
.members-panel { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; }
.members-panel table { margin-top: 6px; }
.members-panel td { padding: 3px 8px 3px 0; }
.members-panel button.link { padding: 0; font-size: 12.5px; }
/* A room on the Rooms page: its name and, under it, whose it is and when it moved;
   what can be done with it on the right. */
.room-card .head { align-items: flex-start; margin-bottom: 6px; }
.room-card .titles { flex: 1; min-width: 0; }
.room-card .title { font-weight: 600; font-size: 15px; color: var(--fg); text-decoration: none; }
.room-card .title:hover { color: var(--accent); }
.room-card .meta { display: flex; gap: 6px; flex-wrap: wrap; font-size: 12.5px; margin-top: 2px; }
.room-card .actions { display: flex; gap: 6px; flex-shrink: 0; }
.room-card .actions button { padding: 3px 10px; font-size: 13px; }
@media (max-width: 760px) {
  .room-card .head { flex-wrap: wrap; }
  .room-card .actions { flex-basis: 100%; margin-top: 6px; }
}
.members-page .members-panel { border-top: none; padding-top: 0; margin-top: 0; }

/* Admin area: sections as tabs under the heading. */
.admin-tabs { display: flex; gap: 4px; margin: 4px 0 16px; border-bottom: 1px solid var(--line); }
.admin-tabs .tab { padding: 8px 14px; margin-bottom: -1px; color: var(--dim); text-decoration: none; border-bottom: 2px solid transparent; font-weight: 500; }
.admin-tabs .tab:hover { color: var(--fg); }
.admin-tabs .tab.active { color: var(--fg); border-bottom-color: var(--accent); }
.admin-page .settings-list { display: flex; flex-direction: column; gap: 14px; }
.admin-page table.audit td.when { white-space: nowrap; font-size: 12.5px; }
.admin-page table.audit td.who { white-space: nowrap; font-weight: 500; }
.admin-page table.audit td.detail { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-page table.audit code { font-size: 12px; }
@media (max-width: 760px) {
  .admin-tabs { overflow-x: auto; }
  .admin-page table.audit td.detail { white-space: normal; }
}

/* An empty room's welcome: the two things to do with it. */
.welcome .choices { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 18px; max-width: 640px; }
.welcome .choice { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: 280px; padding: 16px 18px; text-align: left; background: var(--card, var(--side)); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.welcome .choice:hover:not(:disabled) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.welcome .choice:disabled { opacity: .7; cursor: default; }
.welcome .choice .what { font-weight: 600; font-size: 15px; }
.welcome .choice .dim { font-size: 13px; line-height: 1.35; white-space: normal; }

/* Members: the table, and the add box under it. */
.members-panel table.members td { padding: 5px 10px 5px 0; vertical-align: middle; }
.members-panel table.members td.name { font-weight: 500; }
.members-panel table.members tr.owner td.name { font-weight: 600; }
.members-panel select.level { padding: 2px 6px; font-size: 12.5px; }
.members-panel td.actions { text-align: right; white-space: nowrap; }
.members-panel td.actions button.link { padding: 0 6px; font-size: 12.5px; }
.members-panel td.actions button.link.danger { color: var(--red); }
.members-panel .add-member { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.members-panel .add-member .title { font-weight: 600; margin-bottom: 8px; }
.members-panel .add-member select { max-width: 260px; }
.members-panel .add-member .what { font-size: 12.5px; margin-top: 6px; }
/* A room's invitation links: a line to make one, the one just made, and the list. */
.members-page .card + .card { margin-top: 12px; }
.invites-panel { font-size: 13px; }
.invites-panel > .title { font-weight: 600; margin-bottom: 4px; }
.invites-panel .what { font-size: 12.5px; margin: 0 0 10px; }
.invites-panel .make-invite { flex-wrap: wrap; gap: 8px; }
.invites-panel .make-invite select { width: auto; }
/* The link just made, shown once: its title and Done, the link and Copy on a line. */
.invites-panel .new-invite { margin-top: 12px; padding: 10px 12px; border: 1px solid #bfd3fb; border-radius: 8px; background: var(--accent-soft); display: flex; flex-direction: column; gap: 8px; }
.invites-panel .new-invite-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.invites-panel .new-invite-head .title { font-weight: 600; }
.invites-panel .new-invite-head button.link { padding: 0; font-size: 12.5px; }
.invites-panel .new-invite-line { display: flex; align-items: center; gap: 8px; }
.invites-panel .new-invite-line code.link-text { flex: 1; min-width: 0; height: 32px; line-height: 30px; padding: 0 10px; font: 12.5px/30px var(--mono); background: var(--panel); border: 1px solid var(--line-strong); border-radius: 6px; user-select: all; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.invites-panel .new-invite-line button { flex: none; height: 32px; padding: 0 14px; }
.invites-panel .new-invite p { margin: 0; font-size: 12px; }
.invites-panel table.invites { margin-top: 12px; border-collapse: collapse; }
.invites-panel table.invites td { padding: 5px 12px 5px 0; vertical-align: middle; }
.invites-panel table.invites td.name { font-weight: 500; }
.invites-panel table.invites td.actions { text-align: right; white-space: nowrap; }
.invites-panel table.invites button.link.danger { padding: 0; font-size: 12.5px; color: var(--red); }
.invites-panel table.invites tr.closed td { opacity: .5; }
.invites-panel table.invites tr.closed td.actions { opacity: 1; }
@media (max-width: 760px) {
  .invites-panel table.invites tr { display: flex; flex-wrap: wrap; padding: 4px 0; border-top: 1px solid var(--line); }
}
/* An invitation's page: as the login page, with a new account's token shown once. */
/* A room's servers: adding one, or a new one. */
.add-to-room .title { font-weight: 600; margin-bottom: 8px; }
.add-to-room select { max-width: 320px; }
.add-to-room .or { display: flex; align-items: center; gap: 10px; margin: 12px 0 2px; font-size: 12px; }
.add-to-room .or::before, .add-to-room .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.add-to-room .add-server-button { margin-top: 8px; }
/* API keys: a list and a line to add one. */
.server-page .page-head h2 .dot { margin-right: 10px; vertical-align: 3px; }
.server-page dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; font-size: 13.5px; }
.server-page dl.facts dt { color: var(--dim); }
.server-page table.drops td { vertical-align: top; }
.server-page dl.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.server-page .card .row { gap: 8px; align-items: center; }
.servers-page .server-keys { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
/* A room's Servers page: one's servers, each to share with the room. */
.add-to-room .share-list { display: flex; flex-direction: column; margin-top: 6px; }
.add-to-room .share-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.add-to-room .share-row:last-child { border-bottom: none; }
.add-to-room .share-row .dot { margin-right: 0; flex: none; }
.add-to-room .share-name { font-weight: 550; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.add-to-room .share-row .dim { font-size: 12.5px; white-space: nowrap; }
.add-to-room .share-row button { padding: 3px 12px; font-size: 13px; flex: none; }
/* The servers, one row each, to their own page. */
.server-list { display: flex; flex-direction: column; }
.server-list .server-row { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--line); color: var(--fg); text-decoration: none; min-width: 0; }
.server-list .server-row:last-child { border-bottom: none; }
.server-list .server-row:hover { background: var(--soft); }
.server-list .server-row .dot { margin-right: 0; flex: none; }
.server-list .server-name { font-weight: 550; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-list .whose { font-size: 12.5px; white-space: nowrap; }
.server-list .in-rooms { font-size: 12.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-list .standing { margin-left: auto; font-size: 12.5px; white-space: nowrap; }
.api-keys .name { font-weight: 550; }
.api-keys .dim { font-size: 13px; }
.api-keys .none { margin: 8px 0; }
.api-keys table.keys { margin: 8px 0 4px; }
.api-keys table.keys td { padding: 4px 10px 4px 0; }
.api-keys td.key-name { font-weight: 500; }
.api-keys td.actions button { padding: 2px 10px; font-size: 13px; }
.api-keys .add-key { margin-top: 8px; flex-wrap: wrap; }
.api-keys .add-key input { width: 200px; max-width: 100%; }
.api-keys .add-key input.url { width: 280px; }
/* Renaming oneself. */
.users-page .rename-me input { width: 220px; }
.users-page .me .name button.link { margin-left: 8px; font-size: 12.5px; padding: 0; }
.welcome .choices { max-width: 920px; }

/* Adding a member: a name typed, the matches under it, the one picked as a chip. */
.members-panel .add-member .row { align-items: flex-start; }
.members-panel .add-member .search { position: relative; width: 260px; max-width: 100%; }
.members-panel .add-member .search input { width: 100%; }
.members-panel .add-member .results { position: absolute; left: 0; right: 0; top: 100%; z-index: 5; margin-top: 4px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.members-panel .add-member .result { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; border: none; border-radius: 5px; box-shadow: none; background: transparent; color: var(--fg); text-align: left; font-size: 13px; }
.members-panel .add-member .result:hover { background: var(--soft); }
.members-panel .add-member .result .who { font-weight: 500; }
.members-panel .add-member .results .none { padding: 6px 10px; font-size: 13px; }
.members-panel .add-member .chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 6px 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--accent-soft); font-size: 13px; }
.members-panel .add-member .chip button.link { padding: 0 4px; font-size: 12px; color: var(--dim); }

/* The display settings, as a gear by the brand. */
.sidebar .brand .gear { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: none; border-radius: 6px; box-shadow: none; background: transparent; color: var(--dim); }
.sidebar .brand .gear:hover, .sidebar .brand .gear.active { background: var(--soft); color: var(--fg); }

/* Admin mode: the sections where the rooms were. */
.sidebar .admin-pane.grow { flex: 1 1 auto; }
.sidebar .admin-pane .item.current .count { color: var(--accent); }
/* The open room's servers, under its agents. */
.sidebar .servers-pane { flex: 0 1 auto; max-height: 28%; }
.sidebar .servers-pane .item.server { text-decoration: none; }
.sidebar .servers-pane .item.server .status { margin-left: auto; font-size: 11.5px; color: var(--dim); white-space: nowrap; }
.sidebar .servers-pane .item.server .dot { flex: none; }

/* Admin tables fit the page: never a sideways scroll. Long cells wrap or end in an
   ellipsis, and the columns of least use go first as the window narrows. */
.admin-page .card.flush, .admin-page .card { overflow-x: visible; }
.admin-page table.servers { width: 100%; table-layout: auto; }
.admin-page table.servers td { overflow-wrap: anywhere; }
.admin-page table.rooms td.name a, .admin-page table.rooms td.name { overflow-wrap: anywhere; }
.admin-page table.rooms td.name code { display: block; font-size: 11px; }
.admin-page td.actions { white-space: nowrap; width: 1%; }
@media (max-width: 1100px) {
  .admin-page table .wide, .admin-page table th.wide { display: none; }
}

/* The open room's members, under its agents: who is here (green) and their level. */
.sidebar .members-pane { flex: 0 1 auto; max-height: 28%; }
.sidebar .members-pane .item.member { text-decoration: none; }
.sidebar .members-pane .item.member .status { margin-left: auto; font-size: 11.5px; color: var(--dim); white-space: nowrap; }
.sidebar .members-pane .item.member .dot { flex: none; }

/* Admin mode looks like somewhere else: the menu and the page take a violet cast,
   the brand carries an ADMIN tag, and the current section is violet too. */
.sidebar.admin { background: #f3f0fb; border-right-color: #ddd6f3; }
.sidebar.admin + .main { background: #fbfaff; }
.sidebar.admin .brand .mode-tag { margin-left: 8px; padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; color: #fff; background: var(--violet); }
.sidebar.admin .pane-head .label.active { color: var(--violet); }
.sidebar.admin .item.current, .sidebar.admin .item.active { background: var(--violet-soft); color: var(--violet); }
.sidebar.admin .item.current .count, .sidebar.admin .admin-pane .item.current .count { color: var(--violet); }
.sidebar.admin .foot { border-top-color: #ddd6f3; }
.sidebar.admin + .main .admin-page .page-head h2 { color: var(--violet); }
.sidebar.admin + .main .statusbar .name { color: var(--violet); }

/* Admin › Rooms: a row's actions behind its ⋯. */
.servers-page td.actions .menu-button, .admin-page td.actions .menu-button { width: 30px; height: 26px; padding: 0; font-size: 16px; line-height: 1; color: var(--dim); }
.servers-page td.actions .menu-button:hover, .servers-page td.actions .menu-button.open, .admin-page td.actions .menu-button:hover, .admin-page td.actions .menu-button.open { color: var(--fg); background: var(--soft); }
.menu-backdrop { position: fixed; inset: 0; z-index: 49; }
.admin-room-menu { text-align: left; white-space: nowrap; }

/* The login page's providers, above the token. */
/* Admin › Sign-in. */
.admin-page .redirect-uri { display: flex; align-items: center; gap: 10px; }
.admin-page .redirect-uri code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.provider-form .row input { flex: 1; }
.provider-form button.link { align-self: flex-start; padding: 0; font-size: 12.5px; }
.provider-form .discover-result { font-size: 12.5px; margin-top: -4px; }
/* Profile › Linked accounts. */
.linked .dim { font-size: 13px; }
.linked .none { margin: 8px 0; }
.linked table.keys { margin: 8px 0 4px; }
.linked table.keys td { padding: 4px 10px 4px 0; }
.linked .link-buttons { margin-top: 10px; gap: 8px; flex-wrap: wrap; }

/* A checkbox in a form sits beside its words. */
.server-form label.check { flex-direction: row; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--fg); }
.server-form label.check input { width: auto; margin-top: 3px; }
.provider-form .row.secret { gap: 6px; }
.provider-form .row.secret button.show { flex: none; min-width: 56px; }

/* Who wrote a message: a small tag at its box's top right, out of the text's way (an
   entry paints nothing outside its box, so not above it); who approved a command, on
   its badge. */
.entry.text .by { float: right; max-width: 40%; margin: 1px 0 0 16px; padding: 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 600; line-height: 18px; }
.entry.text.queued .by { color: var(--dim); background: var(--soft); }
.badge.by { color: var(--accent); background: var(--accent-soft); }

/* A command's images (a screenshot taken, a picture read): small under its output,
   whole over the page when clicked. */
.command .images { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line); }
.image-thumb { display: block; flex: none; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--side); box-shadow: none; overflow: hidden; line-height: 0; cursor: zoom-in; }
.image-thumb:hover { border-color: var(--line-strong); background: var(--side); }
/* Sized against the window, not the button around it, which takes the image's size. */
.image-thumb img { display: block; width: auto; height: auto; max-width: min(320px, calc(100vw - 80px)); max-height: 240px; }
.image-thumb.missing { padding: 8px 12px; font-size: 12px; line-height: 1.4; color: var(--dim); cursor: default; }
.image-view { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: rgba(15, 17, 21, .78); cursor: zoom-out; }
.image-view img { max-width: 100%; max-height: calc(100vh - 48px); border-radius: 6px; background: #fff; box-shadow: var(--shadow-lg); }

/* After a failed request: try again, under the chat and above the prompt. */
.footer .retry-line { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 12px; font-size: 13px; border-top: 1px solid var(--line); }

/* Usage stays one plain line: a cost past what is dear for it is a shade darker, and
   the cached input, which costs a fraction, a shade fainter. */
.spend .cost.dear { color: var(--dim); font-weight: 600; }
.spend .cached { opacity: .7; }
/* A tooltip card (see chat::Tip), as the menus are: the panel's white, a thin line
   and a soft shadow; its rows a label and a value. */
.tip { position: fixed; z-index: 200; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--fg); box-shadow: var(--shadow-lg); font: 12px/1.5 var(--sans); white-space: nowrap; pointer-events: none; }
.tip .rows { display: grid; grid-template-columns: auto auto; gap: 1px 16px; }
.tip .what { color: var(--dim); }
.tip .what.under { padding-left: 10px; color: var(--faint); }
.tip .n { text-align: right; font-variant-numeric: tabular-nums; }
/* A usage, which a click opens into its receipt: plain text, underlined on hover. */
button.receipt-toggle { display: inline; transition: none; padding: 0; margin: 0; border: none; border-radius: 0; background: none; box-shadow: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
button.receipt-toggle:hover, button.receipt-toggle.open { background: none; text-decoration: underline dotted; text-underline-offset: 3px; }
/* The receipt, under its line, as plain as the line itself: what, how many, at what price, what it came to; a
   rule, then the sum and what was billed. */
.receipt-card { display: block; width: max-content; max-width: calc(100% - 20px); overflow-x: auto; margin: 6px 0 6px 20px; padding: 0; color: var(--fg); font: 12px/1.5 var(--sans); white-space: nowrap; }
.receipt { display: grid; grid-template-columns: auto auto auto auto; gap: 1px 12px; align-items: baseline; }
.receipt .what { color: var(--dim); }
.receipt .what.under { padding-left: 10px; color: var(--faint); }
.receipt .n { text-align: right; font-variant-numeric: tabular-nums; }
.receipt .whose { grid-column: 1 / -1; margin-bottom: 2px; font-size: 11px; color: var(--faint); }
.receipt .rate { color: var(--faint); font-variant-numeric: tabular-nums; }
.receipt .rule { grid-column: 1 / -1; height: 0; margin: 3px 0; border-top: 1px dashed var(--line-strong); }
.receipt .sum { grid-column: 4; }
.receipt .strong { color: var(--fg); font-weight: 600; }
.stats .live .spend .cost.dear { color: inherit; }

/* A pending approval: a question, not an alarm. The box is the page's own white, set
   off by a thin amber line and a small label; the command it is about carries the same
   amber at its left edge. Declining turns both red. */
.footer.asking { border-top: 2px solid #f59e0b; background: var(--panel); box-shadow: 0 -8px 24px rgba(16, 24, 40, 0.06); }
.footer.asking .ask { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; padding: 12px 28px 0; font-weight: 400; font-size: 13px; color: var(--fg); }
.footer.asking .ask .tag, .approval-waiting .tag { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #b45309; }
.footer.asking .ask .tag::before, .approval-waiting .tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2); margin-left: 2px; }
.footer.asking .caret { color: #f59e0b; }
/* Approve and Decline sit on the prompt's first line, taller than it without making
   it taller. */
.footer.asking .actions:has(.decide) { align-self: flex-start; margin: -5px 0; }
.footer.asking button.decide { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 14px; border-radius: 7px; }
.footer.asking button.decide kbd { font: 600 11px var(--sans); padding: 0 5px; border-radius: 4px; background: rgba(255, 255, 255, 0.22); }
.footer.asking.declining { border-top-color: var(--red); background: var(--panel); }
.footer.asking.declining .ask { color: var(--fg); }
.footer.asking.declining .ask .tag { color: var(--red); }
.footer.asking.declining .ask .tag::before { background: var(--red); box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15); }
.footer.asking.declining .caret { color: var(--red); }
.command.pending { border-color: #f5c87a; border-left: 3px solid #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12), var(--shadow); }
.command.pending .cmd { background: #fffaf0; }
.badge.waiting { display: inline-flex; align-items: center; gap: 6px; color: #92400e; background: #fdecc8; font-weight: 600; }
.badge.waiting::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #f59e0b; }
/* The same when the approval came while the user was typing: the bar above the prompt. */
.approval-waiting { background: var(--panel); color: var(--fg); font-weight: 400; box-shadow: 0 -8px 24px rgba(16, 24, 40, 0.06); }
.approval-waiting .tag { flex: none; }
.approval-waiting .what { flex: 1; min-width: 0; }
.approval-waiting button.decide { border: 1px solid #f59e0b; background: var(--panel); color: #b45309; }
.approval-waiting button.decide:hover { background: #fffaf0; }
@media (max-width: 760px) {
  /* No Enter key to point at on a touch screen. */
  .footer.asking button.decide kbd { display: none; }
  .footer.asking .ask { padding: 10px 14px 0; }
  .approval-waiting { flex-wrap: wrap; gap: 4px 10px; }
}

/* An asset's card (an agent's publish_asset), in the chat and on the room's Assets
   page: its title and actions, what it is, and the asset as fits its kind. A page or
   a PDF is framed only when previewed, bounded in height; an image fits a box. */
.asset-card { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 10px 12px; box-shadow: var(--shadow); min-width: 0; }
.asset-card .asset-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.asset-card .asset-title { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.asset-card .asset-actions { display: flex; gap: 6px; flex: none; }
.asset-card .asset-actions button, .asset-card .asset-actions a.button { padding: 2px 10px; font-size: 12px; line-height: 20px; border-radius: 6px; }
.asset-card .asset-actions a.button { display: inline-block; border: 1px solid var(--line-strong); color: var(--fg); background: var(--panel); text-decoration: none; box-shadow: var(--shadow); }
.asset-card .asset-actions a.button:hover { background: var(--soft); }
.asset-card .asset-actions button.preview.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.asset-card .asset-description { margin-top: 4px; }
.asset-card .asset-meta { margin-top: 2px; font-size: 12px; }
.asset-card .asset-frame { display: block; width: 100%; height: min(560px, 70vh); margin-top: 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.asset-card .asset-image { display: inline-block; margin-top: 8px; line-height: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--side); cursor: zoom-in; }
.asset-card .asset-image img { display: block; max-width: 100%; max-height: 360px; width: auto; height: auto; }
.asset-card .asset-text { margin-top: 8px; max-height: 420px; overflow: auto; border-top: 1px solid var(--line); padding-top: 6px; }
.asset-card .asset-text pre { margin: 0; font: 12.5px/1.45 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.assets-page .asset-list { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.asset-card a.asset-title { color: var(--fg); text-decoration: none; }
.asset-card a.asset-title:hover { text-decoration: underline; }
.asset-card .asset-wait { margin-top: 8px; font-size: 12.5px; }
.asset-page button.version { margin: 0 2px; padding: 0 6px; }
.asset-page button.version.on { font-weight: 600; color: var(--fg); cursor: default; }
.sidebar .assets-pane .item.asset .status { text-transform: none; }
.asset-card .asset-actions a.button { line-height: 20px; }
/* An asset in its room, in place of the chat: one thin bar, and the asset filling the
   rest of the pane edge to edge. */
.asset-viewer { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--bg); }
.asset-viewer .asset-bar { flex: none; display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px; border-bottom: 1px solid var(--line); background: var(--side); font-size: 13px; }
.asset-viewer .asset-bar-title { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-viewer .asset-bar-meta { flex: none; font-size: 12px; white-space: nowrap; }
.asset-viewer .asset-bar .spacer { flex: 1; }
.asset-viewer select.asset-version { flex: none; padding: 1px 6px; font-size: 12px; }
.asset-viewer a.asset-bar-open { flex: none; font-size: 12px; white-space: nowrap; }
.asset-viewer .asset-body { flex: 1; min-height: 0; display: flex; }
.asset-viewer .asset-fill { flex: 1; min-width: 0; min-height: 0; border: none; display: block; background: #fff; }
.asset-viewer .asset-fill.image { display: flex; align-items: center; justify-content: center; overflow: auto; background: var(--side); }
.asset-viewer .asset-fill.image img { max-width: 100%; max-height: 100%; object-fit: contain; }
.asset-viewer .asset-fill.text { overflow: auto; padding: 12px 16px; background: var(--bg); }
.asset-viewer .asset-fill.text .asset-text { margin: 0; border: none; padding: 0; max-height: none; }
@media (max-width: 640px) { .asset-viewer .asset-bar-meta { display: none; } }
.asset-card.deleted { opacity: .65; box-shadow: none; }

/* A link in a reply: plainly one. A path an agent names (not a link: see markdown.rs)
   reads as code does, its whole address on a hover. */
.reply a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 25%, transparent); }
.reply a:hover { color: var(--accent); text-decoration-color: currentColor; }
.reply .md-path { font-family: var(--mono); font-size: 0.9em; background: var(--soft); padding: 1px 5px; border-radius: 4px; cursor: help; }
/* Every version of an asset, on the room's Assets page: a row each, the latest on top,
   the whole row opening it, the one this card shows marked. */
.asset-card .asset-versions { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line); font-size: 12.5px; display: flex; flex-direction: column; gap: 1px; }
.asset-card .versions-head { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); padding: 2px 6px 4px; }
.asset-card a.version-row { display: flex; align-items: center; gap: 10px; padding: 4px 6px; border-radius: 6px; color: var(--fg); text-decoration: none; min-width: 0; }
.asset-card a.version-row:hover { background: var(--soft); text-decoration: none; }
.asset-card a.version-row.shown { background: var(--accent-soft); }
.asset-card .version-tag { flex: none; min-width: 30px; padding: 0 6px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); font: 600 11.5px/18px var(--mono); text-align: center; color: var(--dim); }
.asset-card a.version-row.shown .version-tag { background: var(--accent); border-color: var(--accent); color: #fff; }
.asset-card .version-what { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; overflow: hidden; white-space: nowrap; }
.asset-card .version-what .latest { flex: none; padding: 0 6px; border-radius: 999px; background: #dcfce7; color: #15803d; font-size: 11px; font-weight: 600; line-height: 17px; }
.asset-card .version-when { flex: none; font-variant-numeric: tabular-nums; }
.asset-card .version-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.asset-card .version-size { flex: none; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 640px) { .asset-card .version-size { display: none; } }

/* Signing in: the login page, an invitation's page and setup. A card centred on the
   page's background, under the logo and the name; its ways in are sections, each
   under a thin rule with a small label. */
.auth-page { flex: 1; min-height: 100%; overflow: auto; display: flex; justify-content: center; align-items: flex-start; padding: max(32px, 10vh) 16px 32px; background: var(--side); }
.auth { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 14px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 6px; font-size: 22px; font-weight: 650; letter-spacing: -0.01em; color: var(--fg); }
.auth-banner { padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); text-align: center; font-size: 14px; }
.auth-banner p { margin: 0; }
.auth-banner p + p, .auth-banner p + a { margin-top: 4px; display: block; }
.auth-banner .invited-kicker { font-size: 12px; color: var(--dim); }
.auth-banner .invited-room { margin: 2px 0; font-size: 19px; font-weight: 650; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.auth-banner .invited-by { font-size: 13px; color: var(--dim); }
.auth-banner .invited-by strong { color: var(--fg); font-weight: 600; }
.auth.invite .auth-banner:has(.closed) { background: var(--yellow-soft); border-color: #fde68a; }
.auth-card { padding: 20px 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow-lg); }
.auth-card > .auth-section:first-child { padding-top: 0; }
.auth-card > .auth-section:last-child { padding-bottom: 0; }
.auth-heading { margin: 0 0 14px; font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
/* The ways in, as a segmented bar: the one chosen raised. */
.auth-tabs { display: flex; gap: 2px; padding: 3px; margin-bottom: 14px; border-radius: 8px; background: var(--soft); }
.auth-tabs button.auth-tab { flex: 1; min-width: 0; padding: 5px 10px; border: none; border-radius: 6px; box-shadow: none; background: transparent; color: var(--dim); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auth-tabs button.auth-tab:hover { color: var(--fg); background: transparent; }
.auth-tabs button.auth-tab.on { background: var(--panel); color: var(--fg); font-weight: 600; box-shadow: var(--shadow); }
.auth-tab-body { display: flex; flex-direction: column; gap: 8px; }
.auth-tab-body p { margin: 0; }
/* Between signing in and creating an account: a band of its own. */
.auth-or { display: flex; align-items: center; gap: 12px; margin: 4px 0; color: var(--faint); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
.auth-card.auth-create { box-shadow: var(--shadow); }
.auth-card.inactive form { opacity: .55; }
.auth-section { padding: 18px 0; display: flex; flex-direction: column; gap: 8px; }
.auth-section + .auth-section { border-top: 1px solid var(--line); }
.auth-section p { margin: 0; }
.auth-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.auth-help { font-size: 12.5px; color: var(--dim); }
.auth-error { font-size: 12.5px; color: var(--red); }
.auth .providers { display: flex; flex-direction: column; gap: 8px; }
.auth a.provider.button { display: block; padding: 8px 12px; text-align: center; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--panel); color: var(--fg); font-weight: 550; text-decoration: none; box-shadow: var(--shadow); }
.auth a.provider.button:hover { background: var(--soft); text-decoration: none; }
.auth form.auth-line { display: flex; gap: 8px; margin: 0; }
.auth form.auth-line input { flex: 1; min-width: 0; }
.auth form.auth-line button { flex: none; }
.auth button.auth-wide { width: 100%; padding: 8px 12px; }
.auth .auth-buttons { display: flex; gap: 8px; }
.auth .auth-buttons button { flex: 1; padding: 8px 12px; }
.auth .token-line { display: flex; gap: 8px; }
.auth code.token { flex: 1; min-width: 0; padding: 8px 12px; font: 550 13px/1.4 var(--mono); background: var(--code); border: 1px solid var(--line); border-radius: 6px; user-select: all; overflow-wrap: anywhere; }
.auth .token-line button { flex: none; }
@media (max-width: 760px) {
  .auth-page { padding-top: 32px; }
  .auth-card { padding: 18px 16px; }
}
