:root {
  --bg: #ffffff;
  --bg-subtle: #fafafa;
  --bg-muted: #f4f4f5;
  --fg: #09090b;
  --fg-muted: #71717a;
  --fg-faint: #a1a1aa;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --accent: #09090b;
  --accent-fg: #ffffff;
  --ring: #2563eb33;
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --blue: #2563eb;
  --radius: 8px;
  --shadow: 0 1px 2px #0000000d;
  --shadow-lg: 0 24px 48px -12px #00000029, 0 0 0 1px #0000000a;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #09090b; --bg-subtle: #0f0f11; --bg-muted: #18181b; --fg: #fafafa; --fg-muted: #a1a1aa; --fg-faint: #71717a;
    --border: #27272a; --border-strong: #3f3f46; --accent: #fafafa; --accent-fg: #09090b; --ring: #3b82f655;
    --shadow: none; --shadow-lg: 0 24px 48px -12px #000000aa, 0 0 0 1px #ffffff14; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.5 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; }

/* Shell */
.shell { display: grid; grid-template-columns: 208px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 16px 12px; background: var(--bg-subtle); border-right: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 8px; padding: 6px 8px 18px; font-weight: 600; letter-spacing: -.2px; text-decoration: none; }
.brand-mark { width: 20px; height: 20px; border-radius: 6px; background: var(--accent); color: var(--accent-fg); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.pool-switcher { padding: 0 8px 16px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.pool-switcher .btn { margin-top: 6px; }
.pool-switcher .hint { margin: 4px 0 0; font-size: 12px; }
.directory-entry { display:flex; flex-direction:column; gap:8px; padding:20px 8px; margin-top:16px; border-top:1px solid var(--border); }
.directory-entry .btn { justify-content:space-between; }
.directory-dialog { width:min(1040px,calc(100vw - 32px)); max-width:1040px; }
.directory-dialog .dialog-body { min-height:400px; }
.directory-tools { display:grid; grid-template-columns:1fr 200px; gap:12px; margin-bottom:16px; }
.directory-tools input { height:40px; }
.directory-tools select { height:40px; }
.directory-row { display:grid; grid-template-columns:24px minmax(180px,1fr) minmax(140px,.65fr) 110px; gap:16px; align-items:center; padding:14px 18px; border-bottom:1px solid var(--border); cursor:pointer; }
.directory-row:last-child { border-bottom:0; }
.directory-row:hover { background:var(--bg-subtle); }
.directory-row:has(input:checked) { background:var(--bg-muted); }
.directory-row input[type=checkbox] { width:16px; height:16px; accent-color:var(--accent); box-shadow:none; }
.directory-labels { color:var(--fg-muted); font-size:12px; background:var(--bg-subtle); }
.directory-identity { display:flex; align-items:center; gap:12px; min-width:0; }
.directory-identity > div { min-width:0; overflow-wrap:anywhere; }
.directory-pagination { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:16px; }
.directory-bulk { background:var(--bg-subtle); flex-wrap:wrap; }
.directory-bulk > strong { margin-right:auto; }
.directory-bulk select { width:200px; }
@media(max-width:650px) { .directory-tools { grid-template-columns:1fr; } .directory-row { grid-template-columns:20px 1fr; gap:8px; } .directory-row > .chips,.directory-row > .small { grid-column:2; } .directory-labels > span:nth-last-child(-n+2) { display:none; } .directory-bulk select { width:100%; } .directory-pagination { flex-wrap:wrap; } }
.side-nav button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: 6px; background: none; color: var(--fg-muted); cursor: pointer; text-align: left; font-weight: 500; }
.side-nav button:hover { background: var(--bg-muted); color: var(--fg); }
.side-nav button[aria-selected="true"] { background: var(--bg-muted); color: var(--fg); }
.side-nav svg { width: 16px; height: 16px; flex: none; }
.side-nav .count { margin-left: auto; font-size: 12px; color: var(--fg-faint); font-variant-numeric: tabular-nums; }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 8px; border-top: 1px solid var(--border); padding-top: 14px; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--bg-muted); border: 1px solid var(--border); display: grid; place-items: center; font-size: 11px; font-weight: 600; flex: none; }
.side-foot .who { min-width: 0; flex: 1; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { min-width: 0; padding: 28px 32px 64px; }
.page { max-width: 1040px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.4px; }
.page-head p { margin: 4px 0 0; color: var(--fg-muted); }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar select { width: auto; max-width: 260px; }
.row > .badge, .row .chips, .model-head > .badge { justify-self: start; }
.provider .actions { align-items: center; }
.gate { max-width: 420px; margin: 18vh auto 0; text-align: center; color: var(--fg-muted); }
.gate a { color: var(--fg); font-weight: 500; }
.gate .error { color: var(--red); }
h2 { font-size: 14px; font-weight: 600; margin: 0; }
h3 { font-size: 13px; font-weight: 600; margin: 0; }
.muted { color: var(--fg-muted); }
.faint { color: var(--fg-faint); }
.small { font-size: 12.5px; }
.section { margin-top: 36px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }

/* Controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg); color: var(--fg); font-weight: 500; font-size: 13px; cursor: pointer; white-space: nowrap; text-decoration: none; box-shadow: var(--shadow); transition: background .12s, border-color .12s; }
.btn:hover { background: var(--bg-muted); }
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn.primary:hover { opacity: .88; }
.btn.ghost { border-color: transparent; background: none; box-shadow: none; color: var(--fg-muted); }
.btn.ghost:hover { background: var(--bg-muted); color: var(--fg); }
.btn.danger { color: var(--red); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.busy { cursor: progress; }
.icon-btn { width: 32px; padding: 0; }
input, select, textarea { height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); outline: none; font-size: 13px; width: 100%; box-shadow: var(--shadow); }
select { padding-right: 28px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2371717a' stroke-width='1.5'%3E%3Cpath d='m5 6.5 3 3 3-3'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 6px center; }
textarea { height: auto; padding: 8px 10px; resize: vertical; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--ring); }
input:disabled { background: var(--bg-muted); color: var(--fg-muted); }
input.inline { width: auto; min-width: 8ch; max-width: 100%; field-sizing: content; border-color: transparent; box-shadow: none; background: none; padding: 0 6px; margin-left: -7px; font-weight: 500; }
input.inline:hover { border-color: var(--border); }
input.inline:focus { border-color: var(--blue); background: var(--bg); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--fg-muted); }
.search { position: relative; width: 240px; }
.search input { padding-left: 30px; }
.search svg { position: absolute; left: 9px; top: 8px; width: 16px; height: 16px; color: var(--fg-faint); }
.segmented { display: inline-flex; padding: 2px; border-radius: var(--radius); background: var(--bg-muted); border: 1px solid var(--border); }
.segmented button { height: 26px; padding: 0 10px; border: 0; border-radius: 6px; background: none; color: var(--fg-muted); font-size: 12.5px; font-weight: 500; cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--bg); color: var(--fg); box-shadow: 0 1px 2px #0000001a; }
.switch { position: relative; display: inline-flex; width: 32px; height: 18px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; z-index: 1; box-shadow: none; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--border-strong); transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px #0003; transition: transform .15s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(14px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--ring); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.check input { width: 14px; height: 14px; box-shadow: none; accent-color: var(--accent); }

/* Status */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--border); font-size: 12px; font-weight: 500; color: var(--fg-muted); white-space: nowrap; background: var(--bg); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--fg-faint); flex: none; }
.ok .dot, .dot.ok { background: var(--green); box-shadow: 0 0 0 3px #16a34a22; }
.warn .dot, .dot.warn { background: var(--amber); box-shadow: 0 0 0 3px #d9770622; }
.bad .dot, .dot.bad { background: var(--red); box-shadow: 0 0 0 3px #dc262622; }
.badge.solid { background: var(--bg-muted); border-color: transparent; color: var(--fg); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* Lists & tables */
.card { border: 1px solid var(--border); border-radius: 10px; background: var(--bg); box-shadow: var(--shadow); overflow: hidden; }
.rows > * + * { border-top: 1px solid var(--border); }
.row { display: grid; align-items: center; gap: 16px; padding: 12px 16px; min-height: 56px; }
.row.clickable { cursor: pointer; transition: background .1s; }
.row.clickable:hover { background: var(--bg-subtle); }
.env-row { grid-template-columns: minmax(180px, 1.2fr) minmax(160px, 1fr) auto 16px; }
.env-row .chev { color: var(--fg-faint); display: flex; }
.cell-title { font-weight: 500; display: flex; align-items: center; gap: 8px; min-width: 0; }
.cell-sub { font-size: 12.5px; color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { padding: 48px 24px; text-align: center; color: var(--fg-muted); }
.empty strong { display: block; color: var(--fg); font-weight: 600; margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 500; font-size: 12px; color: var(--fg-muted); padding: 9px 16px; background: var(--bg-subtle); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 10px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 28px; }
.stat { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; box-shadow: var(--shadow); }
.stat span { display: block; font-size: 12.5px; color: var(--fg-muted); }
.stat strong { display: block; font-size: 24px; font-weight: 600; letter-spacing: -.5px; margin-top: 2px; font-variant-numeric: tabular-nums; }

/* Models */
.model-head { display: grid; grid-template-columns: 40px minmax(0, 1.4fr) minmax(0, 1fr) 120px 36px; gap: 12px; align-items: center; padding: 10px 16px; }
.model-row > .model-head { min-height: 52px; }
.model-browser { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; align-items: start; }
.model-environments { padding: 12px; position: sticky; top: 20px; }
#model-environments { max-height: 60vh; overflow-y: auto; }
.model-environment { width: 100%; height: auto; min-height: 68px; display: flex; flex: 0 0 auto; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; margin-top: 6px; padding: 12px; text-align: left; overflow-wrap: anywhere; white-space: normal; line-height: 1.4; }
.model-environment .hint { margin: 0; }
.model-environment[aria-pressed="true"] { background: var(--bg-muted); color: var(--fg); }
.provider-count { margin-left: 6px; color: var(--fg-faint); font-variant-numeric: tabular-nums; }
.model-catalog { min-width: 0; }
.quota-summary { padding: 12px 16px; margin: 12px 0 16px; display: flex; flex-direction: column; gap: 8px; }
.quota-summary-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; }
.quota-summary-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.model-quota-cell { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.model-quota-group { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font-size: 12px; }
.model-quota-cell .quota-caption { flex-basis: 100%; }
.quota-caption { color: var(--fg-faint); font-size: 11px; }
.quota-window { color: var(--fg-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.quota-window.exhausted { color: var(--red); }
.quota-additional summary { cursor: pointer; }
.quota-additional .model-quota-group { margin-top: 8px; }
.model-catalog > .field { margin-bottom: 16px; }
@media (max-width: 900px) { .model-browser { grid-template-columns: 1fr; } .model-environments { position: static; } #model-environments { max-height: 180px; } }
@media (max-width: 860px) {
  .model-table .model-head { grid-template-columns: 32px minmax(0, 1fr); }
  .model-table .model-head > .model-quota-cell { display: flex; grid-column: 2; }
  .model-table .model-head.labels > :nth-child(n+3) { display: none; }
}
.model-head.labels { font-size: 12px; font-weight: 500; color: var(--fg-muted); background: var(--bg-subtle); border-bottom: 1px solid var(--border); padding-top: 9px; padding-bottom: 9px; }
.model-row[open] > .model-head { background: var(--bg-subtle); }
.publish-bar { position: sticky; bottom: 20px; margin: 20px auto 0; width: fit-content; display: flex; align-items: center; gap: 16px; padding: 8px 8px 8px 16px; border-radius: 12px; background: var(--fg); color: var(--bg); box-shadow: var(--shadow-lg); font-size: 13px; }
.publish-bar .btn { border-color: transparent; }
.publish-bar .btn.ghost { color: var(--bg); opacity: .7; }
.publish-bar .btn.ghost:hover { background: #ffffff1a; opacity: 1; }
.publish-bar .btn.primary { background: var(--bg); color: var(--fg); }

/* Members */
.member-row { grid-template-columns: minmax(200px, 1.4fr) minmax(0, 1fr) 132px; }
.member-row .actions { display: flex; flex-direction: column; gap: 8px; }
.member-row .actions > * { width: 100%; }
#model-grants-dialog .meta { gap: 10px; }
#model-grants-dialog .provider { grid-template-columns: minmax(0, 1fr); }
#model-grants-dialog summary { cursor: pointer; }
#model-grants-dialog details .check { margin-top: 10px; }
#model-grants-dialog .grant-environment { padding: 16px; border-bottom: 1px solid var(--border); }
#model-grants-dialog .grant-environment:last-child { border-bottom: 0; }
#model-grants-dialog .grant-environment > h3 { font-size: 13px; overflow-wrap: anywhere; }
#model-grants-dialog .grant-environment .provider { padding: 16px 0 0; }
#model-grants-dialog .grant-environment .hint { margin: 10px 0; }
.pool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.pool { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.pool header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.pool footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--fg-muted); }
.pool .check { color: var(--fg); font-weight: 500; }
.pool.new { border-style: dashed; box-shadow: none; justify-content: center; }
.pool.new form { display: flex; gap: 8px; }
.picker { max-height: 320px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.picker label { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; }
.picker label + label { border-top: 1px solid var(--border); }
.picker label:hover { background: var(--bg-subtle); }
.picker input { width: 14px; height: 14px; box-shadow: none; accent-color: var(--accent); }

/* Dialogs & sheet */
dialog { padding: 0; border: 0; border-radius: 14px; background: var(--bg); color: var(--fg); box-shadow: var(--shadow-lg); width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }
dialog::backdrop { background: #09090b66; backdrop-filter: blur(2px); }
dialog.sheet { margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(560px, 100vw); border-radius: 0; border-left: 1px solid var(--border); display: flex; flex-direction: column; }
dialog.sheet:not([open]) { display: none; }
dialog.wide { width: min(760px, calc(100vw - 32px)); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 24px 0; }
.dialog-head h2 { font-size: 16px; letter-spacing: -.2px; }
.dialog-head p { margin: 4px 0 0; color: var(--fg-muted); font-size: 13px; }
.dialog-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; overflow: auto; }
.sheet .dialog-body { flex: 1; gap: 28px; }
.dialog-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 14px 24px; border-top: 1px solid var(--border); background: var(--bg-subtle); }
.dialog-foot .grow { margin-right: auto; }
.group { display: flex; flex-direction: column; gap: 10px; }
#save-environment-name { align-self: flex-start; }
.group-title { font-size: 12px; font-weight: 500; color: var(--fg-muted); text-transform: uppercase; letter-spacing: .4px; }
.provider { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; }
.provider .meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.provider .name { font-weight: 500; display: flex; align-items: center; gap: 8px; }
.provider .actions { display: flex; gap: 6px; }
.meter { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--fg-muted); }
.meter b { color: var(--fg); font-weight: 500; font-variant-numeric: tabular-nums; }
.route { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.route .hop { padding: 3px 8px; border-radius: 6px; background: var(--bg-muted); font-weight: 500; }
.route .arrow { color: var(--fg-faint); }
.callout { padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-subtle); font-size: 13px; color: var(--fg-muted); display: flex; align-items: center; gap: 10px; }
.callout.warn { border-color: #d9770644; background: #d977060f; color: var(--fg); }
.callout.bad { border-color: #dc262644; background: #dc26260d; color: var(--red); }
.callout .btn { margin-left: auto; }
.code-box { padding: 14px; border-radius: var(--radius); background: var(--bg-muted); text-align: center; font: 600 24px/1.2 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 4px; }
.notice:empty { display: none; }
.notice { font-size: 13px; color: var(--fg-muted); }
.notice.error { color: var(--red); }

/* Network dialog */
.hop-pick { display: grid; grid-template-columns: 1fr 24px 1fr 24px auto; align-items: end; gap: 8px; }
.hop-pick .arrow { text-align: center; color: var(--fg-faint); padding-bottom: 6px; }
.hop-pick .dest { padding-bottom: 6px; font-size: 13px; color: var(--fg-muted); white-space: nowrap; }
.nodes { display: grid; gap: 12px; }
.node { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.node header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.node-grid { display: grid; grid-template-columns: 1fr 2fr 96px; gap: 10px; }
.health { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--fg-muted); }
.health b { color: var(--fg); font-weight: 500; }
details > summary { cursor: pointer; font-size: 12.5px; font-weight: 500; color: var(--fg-muted); list-style: none; display: inline-flex; align-items: center; gap: 4px; user-select: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "›"; display: inline-block; transition: transform .15s; font-size: 14px; }
details[open] > summary::before { transform: rotate(90deg); }
details > summary:hover { color: var(--fg); }
details .details-body { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.hint { font-size: 12px; color: var(--fg-faint); margin: 0; }
.log { margin: 0; max-height: 180px; overflow: auto; padding: 10px 12px; border-radius: var(--radius); background: var(--bg-muted); font: 12px/1.6 ui-monospace, "SF Mono", Menlo, monospace; white-space: pre-wrap; color: var(--fg-muted); }

/* Toast */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 50; pointer-events: none; }
.toast { pointer-events: auto; min-width: 260px; max-width: 420px; padding: 11px 14px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-size: 13px; display: flex; gap: 10px; align-items: flex-start; animation: toast-in .18s ease-out; }
.toast.error { border-color: #dc262655; }
.toast.error .dot { background: var(--red); margin-top: 7px; }
.toast .dot { background: var(--green); margin-top: 7px; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--border); overflow-x: auto; }
  .brand { padding: 0 8px 0 0; }
  .side-nav { flex-direction: row; }
  .side-nav .count, .side-foot .who { display: none; }
  .side-foot { margin: 0 0 0 auto; border: 0; padding: 0; }
  .main { padding: 24px 16px 64px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .env-row { grid-template-columns: 1fr auto; }
  .env-row .route-cell, .env-row .chev { display: none; }
  .member-row { grid-template-columns: 1fr 120px; }
  .member-row .pools-cell { display: none; }
  .model-head { grid-template-columns: 40px 1fr 36px; }
  .model-head > :nth-child(3), .model-head > :nth-child(4) { display: none; }
  .node-grid, .hop-pick { grid-template-columns: 1fr; }
  .hop-pick .arrow { display: none; }
  .search { width: 100%; }
}
