/* symbiomind: the console's layout.
 *
 * The centred card, labels, inputs, submit button and error box are weft-chat's
 * (web/css/app.css, "Centred single-card layouts"), so the two sign-in pages read as one
 * family. The weft donuts stay weft's.
 */

/* weft's theme pins the body for its full-screen chat; the console scrolls. */
body{height:auto; min-height:100dvh; overflow:auto}

.centre{
  min-height:100dvh;
  display:flex; align-items:center; justify-content:center;
  padding:24px 16px;
}

.card{
  width:100%; max-width:380px;
  display:flex; flex-direction:column; gap:10px;
  padding:28px 24px;
  border-radius:18px;
  background:color-mix(in srgb, var(--panel) 50%, transparent);
  border:1px solid var(--edge);
}
.card.wide{max-width:520px}

.card h1{font-size:1.15rem; font-weight:600; margin-bottom:2px}
.card h2{font-size:.78rem; letter-spacing:.04em; text-transform:uppercase; color:var(--dim); margin-top:14px; font-weight:600}

.card label, .form label{
  font-size:.78rem; letter-spacing:.04em; text-transform:uppercase;
  color:var(--dim); margin-top:8px;
}

.card input[type=text], .form input[type=text],
.card input[type=email], .form input[type=email],
.card input[type=password], .form input[type=password],
.card input[type=number], .form input[type=number]{
  width:100%; padding:11px 13px;
  font:inherit; color:var(--text);
  background:var(--in); border:1px solid var(--inedge); border-radius:11px;
  /* 16px minimum, or iOS Safari zooms the viewport on focus and never zooms back. */
  font-size:16px;
}
.card input:focus-visible, .form input:focus-visible{outline:2px solid var(--fern); outline-offset:1px; border-color:var(--fern)}

.card button[type=submit], .card button.primary, button.primary{
  margin-top:14px; padding:12px 16px;
  font:inherit; font-weight:600; color:#12141a;
  background:var(--fern); border:0; border-radius:11px; cursor:pointer;
}
.card button[type=submit]:hover, button.primary:hover{filter:brightness(1.06)}
.card button[type=submit]:disabled, button.primary:disabled{opacity:.6; cursor:default; filter:none}

/* Secondary actions. A button, because it acts; not a link. */
.linkish{
  align-self:flex-start;
  margin-top:4px; padding:4px 0;
  font:inherit; font-size:.85rem;
  color:var(--dim); background:none; border:0; cursor:pointer;
  text-decoration:underline; text-underline-offset:3px;
}
.linkish:hover{color:var(--text)}
/* In a row (next to a button, or in a line of text) it lines up with its neighbours:
   the flex-start and top margin above are for when it stands alone under a form, and
   in a row they pinned it to the top and pushed it below the line. */
.actions .linkish, .model-status .linkish, .setting .linkish{align-self:auto; margin:0; padding:0}

.hint{font-size:.8rem; color:var(--dim)}

.form-error{
  margin-top:8px; padding:9px 12px;
  font-size:.88rem; color:#ffb4a8;
  background:color-mix(in srgb, #c62828 22%, transparent);
  border:1px solid color-mix(in srgb, #c62828 45%, transparent);
  border-radius:9px;
}
@media (prefers-color-scheme: light){
  :root:not([data-theme=dark]) .form-error{color:#8e1c12}
}

/* The wordmark, login-sized. Weft lifts its e (the weft: the letter that travels).
   Here it's the o: where symbi- and -mind meet, the knot in the middle. */
.wordmark-lg{font-size:2.1rem; font-weight:700; letter-spacing:-.02em; line-height:1}
.wordmark-lg em{font-style:normal; color:var(--fern)}
.card .slogan{font-size:.85rem; color:var(--dim); margin-bottom:6px}

/* ---- lists, chips and actions: used on the cards and in the console ---- */
.who{display:flex; align-items:center; gap:8px; flex-wrap:wrap; color:var(--dim); font-size:.9rem}
.who b{color:var(--text); font-weight:600; overflow-wrap:anywhere}
.chip{
  display:inline-block; padding:1px 8px; border-radius:999px; font-size:.75rem;
  border:1px solid var(--inedge); color:var(--dim);
}
.chip.fern{color:var(--fern); border-color:color-mix(in srgb, var(--fern) 50%, transparent)}

.rows{display:flex; flex-direction:column; border:1px solid var(--edge); border-radius:12px; overflow:hidden}
.rows > div{display:flex; align-items:center; gap:10px; padding:10px 12px; font-size:.92rem}
.rows > div + div{border-top:1px solid var(--edge)}
/* A ticked loom's groups in the invite form: stacked under it, set in. */
.rows > div.indent{flex-direction:column; align-items:stretch; gap:4px; padding-left:34px}
.rows > div.indent[hidden]{display:none}
.rows > div.indent label.pick{display:flex; align-items:center; gap:10px}
.rows .grow{flex:1; min-width:0; overflow-wrap:anywhere}
.rows .sub{display:block; color:var(--dim); font-size:.8rem}
.member-row .aka{color:var(--dim)}

.actions{display:flex; gap:16px; flex-wrap:wrap; align-items:center; margin-top:6px}

/* A refused or failed event in the activity list: the same red as .form-error. */
.chip.warn{color:#ffb4a8; border-color:color-mix(in srgb, #c62828 55%, transparent)}
@media (prefers-color-scheme: light){
  :root:not([data-theme=dark]) .chip.warn{color:#8e1c12}
}
:root[data-theme=light] .chip.warn{color:#8e1c12}
.rows .more{justify-content:center}

/* Our own dialogs (web/js/dialog.js): confirmations and the password. */
dialog.confirm{margin:auto; max-width:360px; width:calc(100% - 32px); color:var(--text); background:var(--panel)}
dialog.confirm::backdrop{background:color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter:blur(2px)}
dialog.confirm form{display:flex; flex-direction:column; gap:8px}
dialog.confirm .actions{align-items:center}
dialog.confirm .confirm-items{margin:0; padding-left:20px; color:var(--text)}
dialog.confirm .confirm-items li{overflow-wrap:anywhere}

/* A loom's colours (js/views/loom-colours.js): weft's two pickers, and a Pick pill. */
.colour-pill{flex:0 0 auto; margin:6px 0 4px}
.colour-pill-inner{display:flex; align-items:center; gap:10px; min-width:0; padding:7px 12px;
  font-size:15px; font-weight:600; color:var(--text)}
.colour-pill-inner .led{width:14px; height:14px; box-shadow:0 0 8px 1px var(--sp-a)}
.colour-pill-inner span:last-child{overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.colour-pickers{display:flex; flex-direction:column; gap:8px; margin:4px 0}
dialog.confirm label.colour-pick, .colour-pick{display:flex; align-items:center; gap:10px; font-size:.88rem; color:var(--text);
  text-transform:none; letter-spacing:normal; font-weight:400; cursor:pointer}
.colour-pick input[type=color]{width:44px; height:32px; padding:0; flex:0 0 auto; cursor:pointer;
  background:none; border:1px solid var(--inedge); border-radius:8px}
.colour-pick input[type=color]::-webkit-color-swatch-wrapper{padding:3px}
.colour-pick input[type=color]::-webkit-color-swatch{border:0; border-radius:5px}
.colour-pick input[type=color]::-moz-color-swatch{border:0; border-radius:5px}
dialog.confirm form > button.small{align-self:flex-start}
button.primary.danger{background:#c62828; color:#fff}

/* A link shown once, for copying. */
.once{display:flex; flex-direction:column; gap:6px; padding:10px 12px; border:1px dashed var(--fern); border-radius:12px}
.once code{font-size:.8rem; overflow-wrap:anywhere; user-select:all}
.card .inline{display:grid; grid-template-columns:1fr; gap:6px}

/* Loom picker rows on the invite page: the whole row toggles the box. */
.rows > label.pick{display:flex; align-items:center; gap:10px; padding:10px 12px; font-size:.92rem; cursor:pointer}
.rows > label.pick + label.pick{border-top:1px solid var(--edge)}
.rows > label.pick input{width:18px; height:18px; accent-color:var(--fern); margin:0}
.card select, .form select{padding:6px 10px; border-radius:9px; border:1px solid var(--inedge); background:var(--in); color:var(--text); font:inherit}
.inline-label{color:var(--dim); font-size:.85rem; margin-left:auto}
.card form.row{display:flex; gap:8px}
.card form.row input{flex:1; min-width:0}
.card label.pick, .card label.inline-label, .form label.pick, .form label.inline-label{text-transform:none; letter-spacing:normal; margin-top:0}
.card label.pick, .form label.pick{color:var(--text)}
.card form.row button{margin-top:0}

/* ==========================================================================
   The signed-in console (js/views/shell.js).

   weft-chat's top bar (the Pick in the middle, the hamburger on the right, the drawer
   with the wordmark in its foot) over the console mockup's left rail, which becomes a
   bottom bar on a phone. weft's palette throughout; the mockup's cascade colours come
   with the pipeline.
   ========================================================================== */

:root{--top-h:58px; --rail-w:216px; --bottom-h:64px}
:root[data-theme=light] .form-error{color:#8e1c12}

/* Forms outside the sign-in card: the same field language, no card. */
.form{display:flex; flex-direction:column; gap:10px}
.form h3{font-size:1rem}
.form h2{font-size:.78rem; letter-spacing:.04em; text-transform:uppercase; color:var(--dim); margin-top:14px; font-weight:600}
/* Columns of blocks never squash a block: a list clipped to one row by flex-shrink
   (with .rows' overflow:hidden) looks like a list with one row. */
.wrap > *, .panel-body > *, .form > *{flex-shrink:0}
.form.row-form{flex-direction:row; gap:8px; align-items:stretch; flex-wrap:wrap}
.form.row-form input{flex:1 1 200px; min-width:0}
.form.row-form button{margin-top:0}
button.primary.wide-btn{align-self:flex-start; margin-top:0}

.ic{width:18px; height:18px; flex:0 0 auto; fill:none; stroke:currentColor;
  stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round}

body.shell{background:var(--bg)}

/* ---- the top bar ---- */
#topbar{
  position:fixed; top:0; left:0; right:0; z-index:3; min-height:var(--top-h);
  display:grid; gap:12px; align-items:center;
  grid-template-columns:minmax(max-content,1fr) minmax(0,560px) minmax(max-content,1fr);
  padding:8px 14px; padding-top:calc(8px + env(safe-area-inset-top,0px));
  background:color-mix(in srgb, var(--panel) 60%, transparent);
  backdrop-filter:blur(8px);
  border-bottom:1px solid var(--edge);
}
#topbar .brand{display:flex; align-items:center; justify-self:start; text-decoration:none; border-radius:8px}
#topbar .brand:focus-visible{outline:2px solid var(--fern); outline-offset:3px}
.wordmark{font-size:17px; font-weight:700; letter-spacing:-.01em; color:var(--text)}
.wordmark em{font-style:normal; color:var(--fern)}

/* ---- the status light (js/health.js, painted by shell.js) ----
   One colour, two shapes: the wordmark's o on a desktop, weft's 14px LED on a phone.
   fern: there · amber, pulsing: up but its database or cache isn't · red: not there ·
   blue: something in front of it wants you to sign in again. The words go in the strip
   below the bar, because a phone can't hover. The light-theme shades are for the o,
   which is text and needs the contrast; the LED glows either way. */
:root{--st-up:var(--fern); --st-degraded:#f0a832; --st-down:#e05555; --st-gated:#4da3ff;
  --st-degraded-text:#f0a832; --st-down-text:#ff7a6e; --st-gated-text:#6db4ff}
:root[data-theme=light]{--st-degraded-text:#8a5300; --st-down-text:#b3261e; --st-gated-text:#1d5fae}
@media (prefers-color-scheme: light){ :root:not([data-theme=dark]){
  --st-degraded-text:#8a5300; --st-down-text:#b3261e; --st-gated-text:#1d5fae} }

.brand{--st:var(--st-up); --st-text:var(--st-up)}
.brand[data-health=degraded]{--st:var(--st-degraded); --st-text:var(--st-degraded-text)}
.brand[data-health=down]{--st:var(--st-down); --st-text:var(--st-down-text)}
.brand[data-health=gated]{--st:var(--st-gated); --st-text:var(--st-gated-text)}
.brand .wordmark em{color:var(--st-text); transition:color .4s}
.brand-mark{display:none; width:14px; height:14px; margin:8px; border-radius:50%; flex-shrink:0;
  background:var(--st); box-shadow:0 0 8px 1px var(--st); transition:background .4s, box-shadow .4s}
.brand[data-health=degraded] .wordmark em, .brand[data-health=degraded] .brand-mark,
.brand[data-health=gated] .brand-mark{animation:ledpulse 1s ease-in-out infinite}
.brand[data-health=down] .wordmark em{text-shadow:0 0 8px color-mix(in srgb, var(--st-down) 55%, transparent)}
@keyframes ledpulse{0%,100%{opacity:.45}50%{opacity:1}}
@media (prefers-reduced-motion: reduce){ .brand .wordmark em, .brand .brand-mark{animation:none !important} }

/* The strip: the light's words, a row of the (fixed) top bar, so it lies over the page
   without moving it. Only there while the light isn't fern. */
#status-strip{grid-column:1 / -1; display:flex; align-items:center; justify-content:center;
  flex-wrap:wrap; gap:6px 12px; margin:2px -14px -8px; padding:7px 16px;
  font-size:.86rem; text-align:center; color:var(--text);
  border-top:1px solid color-mix(in srgb, var(--st, var(--st-down)) 45%, transparent);
  background:color-mix(in srgb, var(--st, var(--st-down)) 16%, var(--panel))}
#status-strip[hidden]{display:none}
#status-strip[data-health=degraded]{--st:var(--st-degraded)}
#status-strip[data-health=down]{--st:var(--st-down)}
#status-strip[data-health=gated]{--st:var(--st-gated)}
#status-strip button.small{margin:0}
#topbar-right{display:flex; justify-content:flex-end; align-items:center; gap:10px}

#burger{background:none; border:0; cursor:pointer; padding:8px 6px; border-radius:8px;
  display:flex; flex-direction:column; gap:4px}
#burger div{width:20px; height:2px; background:var(--dim); border-radius:2px}
#burger:hover div{background:var(--text)}
#burger:focus-visible{outline:2px solid var(--fern); outline-offset:1px}

/* ---- the Pick: which loom you're in. weft's pill, dressed in the loom's pair. ---- */
#pick{--sp-a:var(--fern); --sp-b:var(--twilight);
  position:relative; min-width:0; display:flex; justify-content:center}
.pick-bar{
  flex:1; min-width:0; display:flex; align-items:center;
  border:2px solid transparent; border-radius:999px;
  background:
    linear-gradient(color-mix(in srgb, var(--sp-a) 12%, var(--in)),
                    color-mix(in srgb, var(--sp-a) 12%, var(--in))) padding-box,
    linear-gradient(90deg, var(--sp-a), var(--sp-b)) border-box;
  box-shadow:0 0 14px -4px var(--sp-a);
}
#pick-button{
  flex:1; min-width:0; display:flex; align-items:center; gap:10px;
  padding:7px 10px 7px 12px; border:0; border-radius:999px;
  background:none; color:var(--dim); font:inherit; font-size:15px; font-weight:600; cursor:pointer;
}
#pick-button:disabled{cursor:default}
#pick-button.chosen{color:var(--text)}
#pick-button:focus-visible{outline:2px solid var(--text); outline-offset:-2px}
.led{width:12px; height:12px; flex:0 0 auto; border-radius:50%;
  background:radial-gradient(circle at 30% 30%, var(--sp-a), var(--sp-b))}
#pick-button .led{width:14px; height:14px; box-shadow:0 0 8px 1px var(--sp-a)}
#pick-button .pick-name{flex:1; min-width:0; text-align:left; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
#pick-button .chev{display:flex; color:var(--dim); transition:transform .2s ease}
#pick-button:disabled .chev{display:none}
#pick-button .chev .ic{width:16px; height:16px}
#pick-button[aria-expanded=true] .chev{transform:rotate(180deg)}
.pick-level{flex:0 0 auto; padding:0 14px 0 10px; font-size:.75rem; color:var(--dim);
  border-left:1px solid color-mix(in srgb, var(--dim) 35%, transparent)}

#pick-menu{
  position:absolute; top:calc(100% + 6px); left:0; right:0; z-index:4;
  max-height:60dvh; overflow-y:auto; list-style:none; margin:0; padding:6px;
  background:var(--panel); border:1px solid var(--edge); border-radius:16px;
  box-shadow:0 10px 28px rgba(0,0,0,.32);
}
.pick-group{padding:8px 12px 4px; font-size:.7rem; letter-spacing:.06em; text-transform:uppercase; color:var(--dim)}
.pick-item button, .pick-item a{ text-decoration:none;
  width:100%; display:flex; align-items:center; gap:10px;
  padding:10px 12px; border-radius:8px; background:none; border:0;
  color:var(--text); font:inherit; font-size:14px; text-align:left; cursor:pointer;
}
.pick-item :is(button,a):hover, .pick-item :is(button,a):focus-visible{background:var(--in); outline:none}
.pick-item .pick-name{flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.pick-item .pick-sub{color:var(--dim); font-size:.8rem; white-space:nowrap}
/* The picked one glows rather than changing colour: its colour is who it is. */
.pick-item.on .led{box-shadow:0 0 6px 1px var(--sp-a)}
.pick-item.on > :is(button,a){background:color-mix(in srgb, var(--sp-a) 14%, transparent)}
.pick-new{border-top:1px solid var(--edge); margin-top:6px; padding-top:6px}
.pick-new a{color:var(--dim)}
.pick-new a:hover{color:var(--text)}

/* ---- the rail and the main column ---- */
.app{padding-top:calc(var(--top-h) + env(safe-area-inset-top,0px))}
body[data-nav] .app{display:grid; grid-template-columns:var(--rail-w) minmax(0,1fr)}
.rail{
  position:sticky; top:calc(var(--top-h) + env(safe-area-inset-top,0px));
  height:calc(100dvh - var(--top-h) - env(safe-area-inset-top,0px));
  padding:14px 10px; display:flex; flex-direction:column; gap:2px;
  border-right:1px solid var(--edge);
  background:color-mix(in srgb, var(--panel) 40%, transparent);
}
.rail[hidden], .bottombar[hidden]{display:none}
.rail-sep{margin:14px 10px 6px; font-size:.7rem; letter-spacing:.06em; text-transform:uppercase; color:var(--dim)}
.rail-item{
  text-decoration:none;
  display:flex; align-items:center; gap:10px; padding:9px 10px; border-radius:9px;
  background:none; border:0; color:var(--text); font:inherit; font-size:14px; text-align:left; cursor:pointer;
}
.rail-item:hover{background:var(--in)}
.rail-item:focus-visible{outline:2px solid var(--fern); outline-offset:-2px}
.rail-item[aria-current=page]{color:var(--fern); font-weight:600;
  background:color-mix(in srgb, var(--fern) 14%, transparent)}

.main{min-width:0; padding:24px 28px 80px}
.wrap{max-width:820px; margin:0 auto; display:flex; flex-direction:column; gap:12px}

.sec-head{margin-bottom:6px}
.sec-head h1{font-size:1.5rem; font-weight:700; letter-spacing:-.01em; overflow-wrap:anywhere}
.sec-sub{color:var(--dim); font-size:.9rem}
.section-h{font-size:.78rem; letter-spacing:.06em; text-transform:uppercase; color:var(--dim); font-weight:600; margin-top:14px}

/* ---- the page header (web/js/views/page.js): title left, actions right, tabs under ---- */
.page-top{display:flex; align-items:flex-start; gap:12px}
.page-top .grow{min-width:0; flex:1}
.page-actions{display:flex; align-items:center; gap:8px; flex-shrink:0; padding-top:4px}
button.head-btn{display:inline-flex; align-items:center; gap:6px; padding:8px 12px; font-size:.86rem; font-weight:600}
button.head-btn .ic{width:15px; height:15px}
.more{position:relative}
button.more-btn{padding:6px 10px; font-size:1.05rem; line-height:1}
.more-list{
  position:absolute; right:0; top:calc(100% + 6px); z-index:4; min-width:190px;
  display:flex; flex-direction:column; padding:6px; border-radius:12px;
  background:var(--panel); border:1px solid var(--edge); box-shadow:0 10px 30px rgba(0,0,0,.25);
}
.more-list[hidden], form[hidden]{display:none}
.more-item{
  display:flex; justify-content:space-between; align-items:center; gap:12px;
  padding:9px 10px; border:0; border-radius:8px; background:none; color:var(--text);
  font:inherit; font-size:.9rem; text-align:left; cursor:pointer;
}
.more-item:hover:not([disabled]), .more-item:focus-visible{background:var(--in); outline:none}
.more-item.danger{color:#ffb4a8}
:root[data-theme=light] .more-item.danger{color:#8e1c12}
@media (prefers-color-scheme: light){ :root:not([data-theme=dark]) .more-item.danger{color:#8e1c12} }
.more-item[disabled]{opacity:.55; cursor:default}
.more-note{font-size:.75rem; color:var(--dim)}

/* The rule under the tabs is an inset shadow, not a border the active tab overlaps with
   a negative margin: that 1px overhang made the row overflow, which (with overflow-x)
   drew a vertical scrollbar and nudged the underline as the page scrolled. Every tab
   carries the same 2px underline, transparent until it's the current one. */
.tabs{
  display:flex; gap:4px; margin-top:12px; box-shadow:inset 0 -1px 0 var(--edge);
  overflow-x:auto; overflow-y:hidden; scrollbar-width:none;
}
.tabs::-webkit-scrollbar{display:none}
.tab{
  text-decoration:none; color:var(--dim); font-size:.9rem; font-weight:600;
  padding:8px 12px; border-bottom:2px solid transparent; white-space:nowrap;
}
.tab:hover{color:var(--text)}
.tab:focus-visible{outline:2px solid var(--fern); outline-offset:-2px; border-radius:6px}
.tab[aria-current=page]{color:var(--fern); border-bottom-color:var(--fern)}

.known-as{
  display:flex; align-items:flex-start; gap:10px; padding:12px 14px; border-radius:12px;
  border:1px solid color-mix(in srgb, var(--fern) 35%, transparent);
  background:color-mix(in srgb, var(--fern) 8%, transparent);
}
.known-as .ic{width:18px; height:18px; margin-top:2px; color:var(--fern); flex-shrink:0}
.known-as .sub{display:block; color:var(--dim); font-size:.82rem; margin-top:2px}

.rows > div > .ic{color:var(--dim)}
.rows{background:color-mix(in srgb, var(--panel) 45%, transparent)}

/* At-a-glance tiles. A tile is a button: it takes you to its section. */
.tiles{display:grid; grid-template-columns:repeat(auto-fit, minmax(150px, 1fr)); gap:10px}
.tile{display:flex; flex-direction:column; gap:2px; padding:14px; text-align:left; cursor:pointer;
  border-radius:14px; border:1px solid var(--edge); color:var(--text); font:inherit;
  background:color-mix(in srgb, var(--panel) 55%, transparent)}
.tile:hover{border-color:var(--inedge); background:var(--panel)}
.tile:focus-visible{outline:2px solid var(--fern); outline-offset:1px}
.tile-label{font-size:.75rem; letter-spacing:.05em; text-transform:uppercase; color:var(--dim)}
.tile-value{font-size:1.7rem; font-weight:700; line-height:1.2}
.tile-note{font-size:.8rem; color:var(--dim)}

/* An empty section: what it's for, and (when it's coming) that it's coming. */
.empty-state{display:flex; flex-direction:column; gap:10px; align-items:flex-start;
  padding:22px 20px; border-radius:16px; border:1px dashed var(--inedge);
  background:color-mix(in srgb, var(--panel) 35%, transparent)}
.empty-state h3{font-size:1.05rem}
.empty-state p{color:var(--dim); font-size:.92rem; max-width:62ch}
.empty-state > div{align-self:stretch}

.hint.ok{color:var(--fern)}

button.small{
  background:var(--in); color:var(--text); border:1px solid var(--inedge);
  border-radius:9px; padding:6px 12px; font:inherit; font-size:.82rem; cursor:pointer; white-space:nowrap;
}
button.small:hover{border-color:var(--fern)}
button.small.danger{color:#ffb4a8}
button.small.danger:hover{border-color:#c62828}
:root[data-theme=light] button.small.danger{color:#8e1c12}
@media (prefers-color-scheme: light){ :root:not([data-theme=dark]) button.small.danger{color:#8e1c12} }

/* ---- the drawer (weft's): you, not the loom ---- */
#scrim{position:fixed; inset:0; z-index:4; background:rgba(0,0,0,.35); display:none}
#scrim.show{display:block}
#drawer{
  position:fixed; top:0; right:0; height:100%; width:calc(100vw - 36px); max-width:420px; z-index:5;
  background:color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter:blur(14px);
  border-left:1px solid var(--edge);
  transform:translateX(100%); transition:transform .28s ease;
  display:flex; flex-direction:column; overflow-y:auto;
}
#drawer.open{transform:none; box-shadow:-8px 0 24px rgba(0,0,0,.25)}
#drawer-head{
  position:sticky; top:0; z-index:1; flex-shrink:0;
  padding:16px 18px; padding-top:calc(16px + env(safe-area-inset-top,0px));
  display:flex; align-items:center; gap:10px;
  background:var(--panel); border-bottom:1px solid var(--edge);
}
#drawer-head h2{font-size:16px; font-weight:700; flex:1}
#drawer-close{background:none; border:0; cursor:pointer; color:var(--dim); padding:8px; border-radius:8px; display:flex}
#drawer-close .ic{width:20px; height:20px}
#drawer-close:hover{color:var(--text); background:var(--in)}
#drawer-body{flex:1; display:flex; flex-direction:column; gap:10px; padding:14px 18px}
#drawer-foot{
  margin-top:auto; flex-shrink:0; padding:14px 18px;
  padding-bottom:calc(14px + env(safe-area-inset-bottom,0px));
  border-top:1px solid var(--edge);
}
#drawer-foot .wordmark{font-size:15px}
#drawer-foot .slogan{font-size:11px; color:var(--dim); margin-top:2px}

.seg{display:flex; background:var(--in); border:1px solid var(--inedge); border-radius:10px; padding:3px; gap:2px}
.seg-btn{background:none; border:0; color:var(--dim); font:inherit; font-size:.78rem; padding:6px 10px; border-radius:8px; cursor:pointer}
.seg-btn:hover{color:var(--text)}
.seg-btn[aria-pressed=true]{background:var(--panel); color:var(--text); box-shadow:0 1px 3px rgba(0,0,0,.35)}
.seg-btn:focus-visible{outline:2px solid var(--fern); outline-offset:-2px}

.acct{display:flex; gap:12px; align-items:center; padding:12px;
  border:1px solid var(--edge); border-radius:12px; background:color-mix(in srgb, var(--in) 60%, transparent)}
.acct-avatar{width:36px; height:36px; flex:0 0 auto; border-radius:50%;
  background:var(--fern); color:#12141a; font-weight:700; font-size:.95rem;
  display:flex; align-items:center; justify-content:center}
.acct-avatar.sm{width:28px; height:28px; font-size:.8rem}
.acct-id{flex:1; min-width:0}
.acct-name{font-weight:700; font-size:.95rem; overflow-wrap:anywhere}
.acct-badge{font-size:.62rem; font-weight:700; letter-spacing:.06em; text-transform:uppercase;
  color:var(--fern); border:1px solid color-mix(in srgb, var(--fern) 55%, transparent);
  padding:1px 6px; border-radius:99px; margin-left:6px; vertical-align:1px}
.acct-sub{font-size:.8rem; color:var(--dim); display:flex; align-items:center; gap:6px; overflow-wrap:anywhere}
.dot-ok{width:7px; height:7px; border-radius:50%; background:var(--fern); flex:0 0 auto}
.signout-mini{padding:7px 14px; flex:0 0 auto; background:none; border:1px solid var(--edge); border-radius:8px;
  cursor:pointer; font:inherit; font-size:.8rem; color:var(--dim)}
.signout-mini:hover{color:#ff9d8f; background:color-mix(in srgb, #c62828 12%, transparent)}

.chunk{width:100%; display:flex; text-decoration:none; padding:12px 14px; border-radius:12px; border:1px solid var(--edge);
  background:var(--in); color:var(--text); font:inherit; cursor:pointer; text-align:left}
.chunk:hover{border-color:var(--inedge); background:color-mix(in srgb, var(--in) 70%, var(--panel))}
.chunk:focus-visible{outline:2px solid var(--fern); outline-offset:1px}
.chunk.big{position:relative; padding:14px 36px 14px 14px; flex-direction:column; align-items:flex-start; gap:3px}
.chunk.big span{display:flex; align-items:center; gap:8px; font-size:1rem; font-weight:700}
.chunk.big span .ic{color:var(--fern)}
.chunk.big em{font-style:normal; font-size:.78rem; color:var(--dim)}
.chunk.big::after{content:'\203A'; position:absolute; right:14px; top:50%; transform:translateY(-50%); color:var(--dim); font-size:1.2em}

/* ---- panels (weft's): full-screen screens opened from the menu ---- */
#panel-host{position:fixed; inset:0; z-index:6}
.panel{position:absolute; inset:0; display:flex; flex-direction:column; background:var(--bg)}
.panel[hidden]{display:none}
.panel-head{
  flex-shrink:0; display:flex; align-items:center; gap:10px;
  padding:14px 12px; padding-top:calc(14px + env(safe-area-inset-top,0px));
  background:var(--panel); border-bottom:1px solid var(--edge);
}
.panel-titles{flex:1; min-width:0; display:flex; flex-direction:column; gap:2px}
.panel-title{font-size:1.05rem; font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.panel-subtitle{font-size:.78rem; color:var(--dim); overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.panel-subtitle:empty{display:none}
.panel-back, .panel-close{
  flex:0 0 auto; background:none; border:0; color:var(--dim); cursor:pointer;
  width:40px; height:40px; border-radius:10px; display:flex; align-items:center; justify-content:center;
}
.panel-back .ic{width:24px; height:24px}
.panel-close .ic{width:20px; height:20px}
.panel-back:hover, .panel-close:hover{color:var(--text); background:var(--in)}
.panel-back:focus-visible, .panel-close:focus-visible{outline:2px solid var(--fern); outline-offset:-2px}
.panel-body{
  flex:1; min-height:0; overflow-y:auto;
  padding:16px; padding-bottom:calc(28px + env(safe-area-inset-bottom,0px));
  padding-inline:max(16px, calc((100% - 640px) / 2 + 16px));
  display:flex; flex-direction:column; gap:12px;
}

/* ---- phone: the rail becomes a bottom bar; the brand shrinks to its o ---- */
.bottombar{display:none}
@media (max-width:760px){
  body[data-nav] .app{grid-template-columns:1fr}
  .rail{display:none}
  .main{padding:16px 16px calc(var(--bottom-h) + 24px + env(safe-area-inset-bottom,0px))}
  #topbar{grid-template-columns:auto minmax(0,1fr) auto; padding-inline:12px}
  #topbar .wordmark{display:none}
  .brand-mark{display:block}
  #status-strip{margin-inline:-12px}
  #pick{position:static}
  #pick-menu{left:8px; right:8px; top:calc(100% + 4px)}
  body[data-nav] .bottombar{
    display:flex; position:fixed; left:0; right:0; bottom:0; z-index:3;
    background:color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter:blur(8px);
    border-top:1px solid var(--edge);
    padding:6px 4px max(6px, env(safe-area-inset-bottom));
  }
  .bottombar[hidden]{display:none !important}
  .bottom-item{text-decoration:none; flex:1; display:flex; flex-direction:column; align-items:center; gap:2px; padding:4px 0;
    background:none; border:0; color:var(--dim); font:inherit; font-size:11px; cursor:pointer}
  .bottom-item .ic{width:22px; height:22px}
  .bottom-item[aria-current=page]{color:var(--fern)}
  .bottom-item:focus-visible{outline:2px solid var(--fern); outline-offset:-2px; border-radius:8px}
  .sec-head h1{font-size:1.3rem}
}

/* ---- warps and keys (Forgejo issue 4) ---- */
.warp-list{display:flex; flex-direction:column; gap:10px}
.warp-card{display:flex; flex-direction:column; gap:10px; padding:14px 16px; border-radius:14px;
  border:1px solid var(--edge); background:color-mix(in srgb, var(--panel) 55%, transparent)}
.warp-card h3{font-size:1rem}
.warp-top{display:flex; align-items:flex-start; gap:12px}
.warp-top .grow{flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; overflow-wrap:anywhere}
.warp-top .sub{color:var(--dim); font-size:.82rem}
.warp-top code.chip{font-size:.85rem; padding:2px 10px}
.warp-form h2{margin-top:10px}
.field{display:flex; flex-direction:column; gap:4px}
.field .hint{font-size:.8rem}
.form textarea{width:100%; padding:11px 13px; font:inherit; font-size:16px; color:var(--text); resize:vertical;
  background:var(--in); border:1px solid var(--inedge); border-radius:11px; font-family:ui-monospace, monospace}
.form textarea:focus-visible{outline:2px solid var(--fern); outline-offset:1px; border-color:var(--fern)}
.zone-pick{display:flex; flex-direction:column; gap:6px}
.zone-selects{display:flex; gap:8px; flex-wrap:wrap}
.zone-selects select{padding:8px 10px; border-radius:9px; border:1px solid var(--inedge); background:var(--in);
  color:var(--text); font:inherit; font-size:16px; max-width:100%}
.zone-pick .actions{margin-top:0; gap:8px}
.once-row{display:flex; align-items:center; justify-content:space-between; gap:10px}
pre.code{margin-top:8px; padding:10px 12px; border-radius:10px; background:var(--in); border:1px solid var(--inedge);
  font-size:.78rem; white-space:pre-wrap; overflow-wrap:anywhere; user-select:all}
.use-it details summary{cursor:pointer; color:var(--dim); font-size:.88rem}
.rows > div.member-row{flex-wrap:wrap}
.member-row .form-error{margin-top:4px}
.member-row form.grow{flex:1 1 100%}

/* ---- groups and grants (Forgejo issue 4) ---- */
.grants{display:flex; flex-direction:column; gap:8px; padding-top:10px; border-top:1px solid var(--edge)}
.grants h4{font-size:.9rem; color:var(--dim); font-weight:600}
.grants .rows > div{flex-wrap:wrap}
.warn-text{color:#ffb4a8}
:root[data-theme=light] .warn-text{color:#8e1c12}
@media (prefers-color-scheme: light){ :root:not([data-theme=dark]) .warn-text{color:#8e1c12} }
.group-box{flex:1 1 100%}
.group-box .rows{margin-top:6px}
.groups-card{display:flex; flex-direction:column; gap:8px}
.groups-card .rows > div{flex-wrap:wrap}
/* On a phone the chips and buttons wrap under the name, not squeeze it to one letter wide. */
.rows > div.member-row > .grow, .grants .rows > div > .grow, .groups-card .rows > div > .grow{flex:1 1 13rem}

/* ---- the cascade's colours (the console mockup's): who set a value ----------------- */
:root{--c-role:#6f9bff; --c-identity:#b28cf0; --c-server:#9aa3b2}
:root[data-theme=light]{--c-role:#2f6fed; --c-identity:#8a4fd8; --c-server:#6b7280}
@media (prefers-color-scheme: light){ :root:not([data-theme=dark]){--c-role:#2f6fed; --c-identity:#8a4fd8; --c-server:#6b7280} }

/* ---- the warps list: rows, each a link to the warp's own page ---------------------- */
.warp-rows{display:flex; flex-direction:column; border:1px solid var(--edge); border-radius:14px; overflow:hidden}
.warp-row{
  display:flex; align-items:center; gap:10px; padding:12px 14px; text-decoration:none; color:var(--text);
  background:var(--panel); border-top:1px solid var(--edge);
}
.warp-row:first-child{border-top:0}
.warp-row:hover{background:color-mix(in srgb, var(--panel) 70%, var(--in))}
.warp-row:focus-visible{outline:2px solid var(--fern); outline-offset:-2px}
.warp-row .grow{flex:1; min-width:0; display:flex; flex-direction:column; gap:2px}
.warp-row-name{display:flex; align-items:center; gap:8px; flex-wrap:wrap}
.warp-row .sub{color:var(--dim); font-size:.82rem; overflow-wrap:anywhere}
.warp-row .chip{flex-shrink:0}
.warp-row-go{width:16px; height:16px; color:var(--dim); flex-shrink:0}
/* Renaming a session in its row: input, then save and cancel beside it, like any row form.
   Not .grow, which is a column and would stretch the input 200px tall. */
.warp-row .session-rename{flex:1; min-width:0; align-items:center}
/* Another warp named on this one's page (a bridge's session, a session's writer): it reads as
   the warp, like a row in Warps, not as a browser-blue link. */
.warp-link{display:inline-flex; align-items:center; gap:6px; flex-wrap:wrap; color:var(--text); text-decoration:none}
.warp-link:hover strong{text-decoration:underline}
.warp-link:focus-visible{outline:2px solid var(--fern); outline-offset:2px; border-radius:6px}
.warp-link-go{width:14px; height:14px; color:var(--dim)}

/* ---- one warp's page: a back link, then folding sections ---------------------------- */
.page-back{display:inline-flex; align-items:center; gap:4px; margin-bottom:6px; color:var(--dim); font-size:.86rem; text-decoration:none}
.page-back:hover{color:var(--text)}
.page-back .ic{width:15px; height:15px}
.warp-page{display:flex; flex-direction:column; gap:10px}
.fold{border:1px solid var(--edge); border-radius:14px; background:var(--panel)}
.fold > summary{
  list-style:none; display:flex; align-items:center; gap:10px; padding:13px 16px; cursor:pointer; border-radius:14px;
}
.fold > summary::-webkit-details-marker{display:none}
.fold > summary:focus-visible{outline:2px solid var(--fern); outline-offset:-2px}
.fold-title{font-weight:600; flex:1 1 auto; min-width:6rem; overflow-wrap:anywhere}
.fold-chev{width:16px; height:16px; color:var(--dim); flex-shrink:0; transition:transform .15s}
.fold[open] > summary .fold-chev{transform:rotate(180deg)}
.fold-body{display:flex; flex-direction:column; gap:10px; padding:0 16px 14px}
.fold-note{color:var(--dim); font-size:.8rem; text-align:right; flex:0 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.fold-list{display:flex; flex-direction:column; gap:8px}
.fold-list .fold{background:color-mix(in srgb, var(--panel) 60%, var(--bg))}
.fold-list .fold > summary{padding:11px 14px}
.fold-stack{display:flex; flex-direction:column; gap:8px}
.fold .curl summary{cursor:pointer; color:var(--dim); font-size:.88rem}

.setting{display:flex; align-items:baseline; flex-wrap:wrap; gap:4px 10px; padding:6px 0; border-bottom:1px solid var(--edge)}
.setting-name{color:var(--dim); font-size:.82rem; min-width:7.5rem}
.setting-value{flex:1; min-width:8rem; overflow-wrap:anywhere}
.setting-value code{font-size:.85rem}
.setting-note{padding:0 0 .4rem; margin-top:-.2rem}
.setting-note .sub{display:flex; flex-wrap:wrap; gap:.3rem .6rem; align-items:baseline; color:var(--dim); font-size:.8rem}
.setting .hint{font-size:.78rem}
.origin{font-size:.72rem; font-weight:600; padding:1px 8px; border-radius:999px; border:1px solid currentColor; white-space:nowrap}
.o-warp{color:var(--c-role)}
.o-group{color:var(--c-identity)}
.o-none{color:var(--c-server)}
/* A locked Default (Forgejo issue 28): the server grey, dashed, as it isn't a choice. */
.o-lock{color:var(--c-server); border-style:dashed}
.setting .linkish.reset{font-size:.78rem}
.fold-chips{display:inline-flex; align-items:center; gap:6px; flex:0 1 auto; min-width:0; flex-wrap:wrap; justify-content:flex-end}
/* Keys: which key opens each warp (Forgejo issue 9). A warp's own key is an
   override of the loom key, so it wears the override purple. */
.warp-keys{display:flex; flex-direction:column}
.warp-key{display:flex; flex-direction:column; gap:6px; padding:12px 0; border-top:1px solid var(--edge)}
.warp-key:first-child{border-top:0; padding-top:2px}
.warp-key-top{display:flex; align-items:center; gap:8px; flex-wrap:wrap}
.warp-key .actions{margin-top:0; gap:8px}
.chip.key-own{color:var(--c-identity); border-color:color-mix(in srgb, var(--c-identity) 50%, transparent)}
.chip .chip-ic{width:13px; height:13px; vertical-align:-2px; margin-right:4px}
/* The Keys item in the nav, when a warp you're let into needs a key you haven't made. */
.ic-warned{position:relative; display:inline-flex; flex:0 0 auto}
.ic-warned::after{content:""; position:absolute; right:-3px; top:-2px; width:8px; height:8px; border-radius:50%;
  background:#d84315; box-shadow:0 0 0 2px var(--bg)}

/* The kind picker "new warp" opens (Forgejo issue 17). */
.kind-picker{display:flex; flex-direction:column; gap:10px}
.kind-cards{display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap:10px}
.kind-card{display:flex; flex-direction:column; gap:6px; align-items:stretch; text-align:left; padding:12px 14px;
  border-radius:12px; border:1px solid var(--edge); background:var(--panel); color:var(--text); font:inherit; cursor:pointer}
.kind-card:hover:not([disabled]){border-color:var(--fern)}
.kind-card:focus-visible{outline:2px solid var(--fern); outline-offset:1px}
.kind-card[disabled]{cursor:default; opacity:.62}
.kind-card-top{display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap}
.kind-card-brief{color:var(--dim); font-size:.86rem; line-height:1.4}
.kind-card-what{color:var(--dim); font-size:.78rem; font-style:italic}
/* A passthru's protocol: the same cards, one of them chosen. */
.protocol-cards .kind-card[aria-checked="true"]{border-color:var(--fern); box-shadow:inset 0 0 0 1px var(--fern)}
/* A field's "pinned" box, under its input. */
.form .field label.check{display:flex; align-items:center; gap:6px; font-weight:normal; font-size:.86rem; color:var(--dim);
  text-transform:none; letter-spacing:normal; margin-top:2px}
.field label.check input{width:18px; height:18px; margin:0; accent-color:var(--fern); flex-shrink:0}
.warp-row-chips{display:flex; flex-wrap:wrap; gap:4px 6px; margin-top:4px}
/* The model chooser (web/js/views/warps.js modelField), after weft-chat's. */
.model-field{display:flex; flex-direction:column; gap:6px}
.model-input{display:flex; gap:8px; align-items:stretch}
.model-input input{flex:1; min-width:0}
.model-input button{flex-shrink:0}
.model-drop{
  padding:10px; display:flex; flex-direction:column; gap:8px;
  background:color-mix(in srgb, var(--in, var(--panel)) 45%, transparent);
  border:1px solid var(--edge); border-radius:12px;
}
.model-drop[hidden]{display:none}
.model-status{display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 10px}
.model-status .hint{margin:0}
.model-status .linkish{font-size:.8rem}
.model-rows{display:flex; flex-direction:column; max-height:min(50dvh, 420px); overflow-y:auto;
  border:1px solid var(--edge); border-radius:10px; scrollbar-width:thin; scrollbar-color:var(--edge) transparent}
.model-rows:empty{display:none}
.model-row{
  display:flex; flex-direction:column; align-items:flex-start; gap:1px; text-align:left;
  padding:8px 12px; background:none; border:0; border-radius:0; color:var(--text); font:inherit; cursor:pointer;
}
.model-row + .model-row{border-top:1px solid var(--edge)}
.model-row[hidden]{display:none}
.model-row:hover, .model-row:focus-visible{background:color-mix(in srgb, var(--fern) 10%, transparent); outline:none}
.model-row.on{box-shadow:inset 3px 0 0 var(--fern)}
.model-row-id{font-family:var(--mono, ui-monospace, monospace); font-size:.85rem; overflow-wrap:anywhere}
.model-row-sub{color:var(--dim); font-size:.75rem}
button.small.primary-small{background:var(--fern); color:#12141a; border-color:var(--fern); font-weight:600}

/* ---- the shared list (web/js/views/list.js): a pinned bar, then the rows ---------------- */
.list{display:flex; flex-direction:column; gap:8px}
.list-bar{
  position:sticky; top:calc(var(--top-h) + env(safe-area-inset-top,0px)); z-index:2;
  display:flex; align-items:center; gap:8px; flex-wrap:wrap; padding:8px 0;
  /* The bar is pinned, so rows scroll under it: it wears whatever it sits on (the page,
     a panel, a dialog), never a band of its own. */
  background:var(--list-bg, var(--bg));
}
.fold{--list-bg:var(--panel)}
.fold-list .fold{--list-bg:color-mix(in srgb, var(--panel) 60%, var(--bg))}
dialog.confirm{--list-bg:var(--panel)}
dialog .list-bar{top:0}
/* While selecting, "all" lines up with the rows' own boxes (row padding + border). */
.list--rows.is-selecting > .list-bar{padding-left:13px; padding-right:13px}
.list--warp-rows.is-selecting > .list-bar{padding-left:15px; padding-right:15px}
.list-bar[hidden]{display:none}
.list-bar .grow{flex:1}
input.list-filter{
  flex:1 1 12rem; min-width:0; padding:7px 12px; border-radius:9px; font:inherit; font-size:.88rem;
  background:var(--in); color:var(--text); border:1px solid var(--inedge);
}
input.list-filter:focus-visible{outline:2px solid var(--fern); outline-offset:1px; border-color:var(--fern)}
.list-all{display:inline-flex; align-items:center; gap:6px; font-size:.86rem; cursor:pointer; text-transform:none; letter-spacing:normal; color:var(--text); margin:0}
.list-count{color:var(--dim); font-size:.86rem}
.list-bar input[type=checkbox], .list-tick{width:18px; height:18px; accent-color:var(--fern); margin:0; flex-shrink:0}
.is-selecting .selecting{cursor:pointer}
.is-selecting .selecting.ticked{background:color-mix(in srgb, var(--fern) 12%, var(--panel))}
/* While selecting, a row's own buttons step aside: a tap there means "tick", not "act". */
.is-selecting .selecting button, .is-selecting .selecting .group-box{display:none}
.list-none{padding:4px 2px}
button.small:disabled{opacity:.5; cursor:default}

/* ---- a group's page: people in it, and the picker for adding more ------------------- */
.person-row .aka{color:var(--dim)}
.picker-box{display:flex; flex-direction:column; gap:6px; padding:10px 12px; border-radius:12px;
  border:1px dashed var(--inedge); background:color-mix(in srgb, var(--fern) 5%, transparent)}
.selecting.blocked, label.pick.blocked{opacity:.6; cursor:not-allowed}
.list-why{flex-basis:100%; color:var(--dim); font-size:.78rem; padding-left:28px}
.rows > div.selecting.blocked{flex-wrap:wrap}

/* A dialog holding a list (web/js/dialog.js panelDialog): wider, and it scrolls itself. */
dialog.confirm.wide{max-width:560px; max-height:min(85dvh, 760px); overflow:auto; padding-top:0}
.panel-dialog{display:flex; flex-direction:column; gap:8px}
.panel-dialog-head{display:flex; align-items:center; gap:10px; position:sticky; top:0; z-index:3;
  padding:16px 0 6px; background:var(--panel)}
.panel-dialog-head h1{flex:1; font-size:1.1rem}
dialog.wide .list-bar{top:52px}
dialog label.as-typed{text-transform:none; letter-spacing:normal; font-size:.86rem}
dialog label.as-typed strong{color:var(--text)}

/* ---- managers-only, as a member sees it: there, with a padlock (Forgejo issue 7) ---- */
.sr-only{position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0}
/* A lock about half the icon's size, on its bottom-right corner. Its body is solid so
   it reads at phone size; the ring in the bar's colour lifts it off the icon's lines. */
.ic-locked{position:relative; display:inline-flex; flex:0 0 auto}
.ic-locked .ic-lock{
  position:absolute; right:-4px; bottom:-3px; width:55%; height:55%;
  stroke-width:3; fill:none; border-radius:4px;
  background:var(--bg); padding:1px; box-sizing:content-box;
}
.ic-locked .ic-lock rect{fill:currentColor}
.rail-item.locked, .bottom-item.locked{color:var(--dim)}
.rail-item.locked[aria-current=page], .bottom-item.locked[aria-current=page]{color:var(--fern)}
.tab.locked{display:inline-flex; align-items:center; gap:5px}
.tab-lock{width:12px; height:12px; stroke-width:2.6}
.tab-lock rect{fill:currentColor}
.rows > div.locked{color:var(--dim)}
.wall-h{display:flex; align-items:center; gap:8px}
.wall-h .ic{color:var(--dim)}
.wall-h .ic rect{fill:currentColor}
/* 16px, or iOS Safari zooms in on focus and stays zoomed. */
.model-drop input.list-filter{font-size:16px; flex:0 0 auto}

/* ---- the playground (web/js/views/playground.js, Forgejo issue 10) --------------------
   A chat in a dialog: the whole screen on a phone, a tall panel on a desktop. */
dialog.playground{
  margin:auto; padding:0; gap:0; width:min(720px, calc(100% - 16px)); max-width:none; height:min(92dvh, 900px); max-height:none;
  color:var(--text); background:var(--panel); display:flex; flex-direction:column; overflow:hidden;
}
dialog.playground:not([open]){display:none}
dialog.playground::backdrop{background:color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter:blur(2px)}
@media (max-width:560px){
  dialog.playground{width:100%; height:100dvh; max-width:none; border-radius:0; border:0}
}
.pg-head{display:flex; align-items:flex-start; gap:10px; padding:14px 16px 6px}
.pg-title{flex:1; min-width:0; display:flex; flex-direction:column; gap:2px}
.pg-title strong{overflow-wrap:anywhere}
.pg-close{flex-shrink:0; background:none; border:0; padding:6px; color:var(--dim); cursor:pointer; border-radius:8px}
.pg-close:hover, .pg-close:focus-visible{color:var(--text); background:color-mix(in srgb, var(--text) 8%, transparent)}
.pg-close .ic{width:18px; height:18px}
.pg-note{margin:0; padding:0 16px 8px; font-size:.78rem; color:var(--dim); border-bottom:1px solid var(--edge)}
.pg-log{flex:1; min-height:0; overflow-y:auto; padding:14px 16px; display:flex; flex-direction:column; gap:12px}
.pg-empty{margin:auto 0; text-align:center}
.pg-turn{display:flex; flex-direction:column; gap:4px; max-width:88%; padding:10px 12px; border-radius:14px;
  border:1px solid var(--edge)}
.pg-user{align-self:flex-end; background:color-mix(in srgb, var(--fern) 12%, var(--panel))}
.pg-assistant{align-self:flex-start; background:var(--in)}
.pg-turn.pg-failed{opacity:.6}
.pg-who{font-size:.7rem; letter-spacing:.04em; text-transform:uppercase; color:var(--dim)}
.pg-text{margin:0; white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.45}
.pg-dim{color:var(--dim); font-size:.9rem}
.pg-more{border-top:1px solid var(--edge); padding-top:6px; margin-top:4px}
.pg-more summary{cursor:pointer; color:var(--dim); font-size:.8rem}
.pg-more[open] summary{margin-bottom:6px}
.pg-block{margin:6px 0 0; max-height:40dvh; overflow:auto; font-size:.78rem; white-space:pre-wrap; overflow-wrap:anywhere}
.pg-facts{display:grid; grid-template-columns:auto 1fr; gap:3px 12px; margin:0; font-size:.85rem}
.pg-facts dt{color:var(--dim)}
.pg-facts dd{margin:0; overflow-wrap:anywhere}
.pg-wait{margin:0; align-self:flex-start}
.pg-error{margin:0; align-self:stretch}
.pg-compose{display:flex; gap:8px; align-items:flex-end; padding:10px 16px calc(12px + env(safe-area-inset-bottom,0px));
  border-top:1px solid var(--edge)}
.pg-input{flex:1; min-width:0; resize:none; max-height:30dvh; padding:10px 12px; border-radius:11px;
  border:1px solid var(--inedge); background:var(--in); color:var(--text); font:inherit; font-size:16px}
.pg-input:focus-visible{outline:2px solid var(--fern); outline-offset:1px; border-color:var(--fern)}
.pg-compose button{flex-shrink:0; align-self:stretch}
