
/* kosa8 Cloud wears kosa8 desk's design: warm paper, ink rules, one amber
   accent, square corners and offset shadows, Bricolage Grotesque for
   headings and JetBrains Mono for labels. Tokens match pkg/desk/ui/desk.css. */
@font-face { font-family: "Bricolage Grotesque"; src: url("/app/fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/app/fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800; font-display: swap; }

:root {
  color-scheme: light;
  --paper: #faf8f3; --paper-2: #f3efe6; --white: #fffefb;
  --text: #141414; --text-2: #46474b; --text-3: #7b7c80;
  --line: #e2ddd2; --line-2: #cfc8ba; --rule: #141414;
  --accent: #e8962f; --accent-2: #fbe7c8; --accent-ink: #8a5a14;
  --ink: #141414; --on-ink: #faf8f3;
  --ok: #17866a; --ok-2: #dcefe8; --warn: #c4512b; --warn-2: #f8e1d7; --plum: #8a3a6e;
  --shadow: #141414; --scrim: rgba(20, 20, 20, .38);
  --art: #141414; --art-2: #1f1d1a; --art-text: #f1ece2;
  --display: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --side: 244px; --rail: 64px;
  --i-cube: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2.8 20.5 7.5v9L12 21.2 3.5 16.5v-9z'/%3E%3Cpath d='M3.5 7.5 12 12.2l8.5-4.7M12 12.2v9'/%3E%3C/svg%3E");
  --i-fn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 3.5c-2 0-3 1-3 3v2.5c0 1.5-.8 2.5-2 3 1.2.5 2 1.5 2 3v2.5c0 2 1 3 3 3M16 3.5c2 0 3 1 3 3v2.5c0 1.5.8 2.5 2 3-1.2.5-2 1.5-2 3v2.5c0 2-1 3-3 3'/%3E%3C/svg%3E");
  --i-key: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='15' r='4.5'/%3E%3Cpath d='m11.2 11.8 9-9M16.5 6.5l2.5 2.5M14 9l2 2'/%3E%3C/svg%3E");
  --i-users: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2.5 20c0-3.6 2.9-6 6.5-6s6.5 2.4 6.5 6M15.5 4.6a3.5 3.5 0 0 1 0 6.8M18 14.3c2 .7 3.5 2.6 3.5 5.7'/%3E%3C/svg%3E");
  --i-server: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='4' width='17' height='7'/%3E%3Crect x='3.5' y='13' width='17' height='7'/%3E%3Cpath d='M7.5 7.5h.01M7.5 16.5h.01M11 7.5h6M11 16.5h6'/%3E%3C/svg%3E");
  --i-chart: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 20.5h17M6.5 17v-6M11 17V5.5M15.5 17v-8.5M20 17v-4'/%3E%3C/svg%3E");
  --i-sliders: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6.5h9M17 6.5h3M4 12h3M11 12h9M4 17.5h11M19 17.5h1'/%3E%3Ccircle cx='15' cy='6.5' r='2'/%3E%3Ccircle cx='9' cy='12' r='2'/%3E%3Ccircle cx='17' cy='17.5' r='2'/%3E%3C/svg%3E");
  --i-book: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 5h6a2.5 2.5 0 0 1 2.5 2.5V20a2 2 0 0 0-2-2H3.5zM20.5 5h-6A2.5 2.5 0 0 0 12 7.5V20a2 2 0 0 1 2-2h6.5z'/%3E%3C/svg%3E");
  --i-out: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4h6v16h-6M10 8l-4 4 4 4M6 12h10'/%3E%3C/svg%3E");
  --i-panel: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='4' width='17' height='16'/%3E%3Cpath d='M9.5 4v16M16 9.5 13.5 12l2.5 2.5'/%3E%3C/svg%3E");
  --i-menu: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16M4 12h16M4 17h10'/%3E%3C/svg%3E");
  --i-refresh: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 12a8 8 0 1 1-2.35-5.65M20 4v5h-5'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #151412; --paper-2: #1d1b18; --white: #1a1917;
    --text: #f1ece2; --text-2: #bdb6a9; --text-3: #8a847a;
    --line: #2e2b27; --line-2: #423e37; --rule: #5a554c;
    --accent: #eba14a; --accent-2: #3a2a14; --accent-ink: #f2b866;
    --ink: #f1ece2; --on-ink: #151412;
    --ok: #4fc29e; --ok-2: #14302a; --warn: #ec7a52; --warn-2: #3a1d14;
    --shadow: #eba14a; --scrim: rgba(0, 0, 0, .6);
    --art: #0e0d0c; --art-2: #1a1816;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--text); font: 14px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
::selection { background: var(--accent-2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--text); text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
h1 { font-size: 30px; letter-spacing: -.035em; margin: 0; }
h1 em, h2 em { font-style: normal; color: var(--on-ink); background: var(--ink); padding: 0 .14em; }
h2 { font-size: 17px; margin: 28px 0 10px; }
h2.sub { font-size: 22px; margin-top: 44px; padding-top: 28px; border-top: 1px solid var(--line-2); display: flex; gap: 10px; align-items: baseline; }
h2 .dim { font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
code, pre, kbd, .mono, td.mono { font-family: var(--mono); font-size: 12.5px; }
code { background: var(--paper-2); border: 1px solid var(--line); padding: 1px 5px; }
.muted, .dim { color: var(--text-3); } .small { font-size: 12.5px; }
.error { color: var(--warn); min-height: 1em; } .okmsg { color: var(--ok); }
.spacer { flex: 1; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; margin: 0 0 10px; font: 500 11.5px/1 var(--mono);
  letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.eyebrow::before { content: ""; width: 8px; height: 8px; background: var(--accent); }

/* ---- icons: one stroke drawing each, masked so they take the text color ---- */
.ic { display: inline-block; width: 17px; height: 17px; flex: none; background: currentColor;
  -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.ic-cube { --m: var(--i-cube); } .ic-fn { --m: var(--i-fn); } .ic-key { --m: var(--i-key); } .ic-users { --m: var(--i-users); } .ic-server { --m: var(--i-server); } .ic-chart { --m: var(--i-chart); } .ic-sliders { --m: var(--i-sliders); } .ic-book { --m: var(--i-book); } .ic-out { --m: var(--i-out); } .ic-panel { --m: var(--i-panel); } .ic-menu { --m: var(--i-menu); } .ic-refresh { --m: var(--i-refresh); }

/* ---- shell: sidebar + content --------------------------------------------- */
.shell { min-height: 100vh; }
body.authed .shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); transition: grid-template-columns .28s var(--ease); }
body.authed.rail .shell { grid-template-columns: var(--rail) minmax(0, 1fr); }
body:not(.authed) .side, body:not(.authed) .top, body:not(.authed) .scrim { display: none; }

.side { position: sticky; top: 0; height: 100vh; overflow: hidden auto; display: flex; flex-direction: column; gap: 4px;
  padding: 20px 12px 14px; background: var(--paper-2); border-right: 1px solid var(--line-2); z-index: 20; }
.lockup { display: flex; align-items: center; gap: 9px; padding: 2px 8px 18px; color: var(--text); text-decoration: none;
  font: 650 21px/1 var(--display); letter-spacing: -.02em; white-space: nowrap; }
.lockup .mark { width: 28px; height: 28px; flex: none; transition: transform .5s var(--ease); }
.lockup:hover .mark { transform: rotate(-8deg) scale(1.06); }
.lockup em { font-style: normal; font-weight: 500; color: var(--on-ink); background: var(--ink); padding: 3px 6px 4px; font-size: 14px; letter-spacing: 0; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-h { display: flex; align-items: center; gap: 8px; padding: 18px 10px 8px; white-space: nowrap;
  font: 500 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.nav-h::before { content: ""; width: 7px; height: 7px; flex: none; background: var(--accent); }
.nav-i { position: relative; display: flex; align-items: center; justify-content: flex-start; gap: 11px; width: 100%; min-height: 36px; padding: 8px 10px;
  border: 1px solid transparent; border-radius: 0; background: none; cursor: pointer; white-space: nowrap; text-decoration: none;
  font: 500 14px/1.2 var(--sans); color: var(--text-2); text-align: left;
  transition: background .18s, color .18s, border-color .18s, transform .18s var(--ease), box-shadow .18s; }
.nav-i:hover { color: var(--text); background: var(--white); border-color: var(--line); }
.nav-i.on { color: var(--text); background: var(--white); border-color: var(--rule); box-shadow: 3px 3px 0 var(--accent); transform: translate(-1px, -1px); }
.nav-i.on .ic { color: var(--accent-ink); }
.nav-i .n { margin-left: auto; font: 500 11px/1 var(--mono); color: var(--text-3); padding: 3px 6px; border: 1px solid var(--line-2); min-width: 22px; text-align: center; }
.nav-i .n:empty { display: none; }
.nav-i kbd { margin-left: auto; font-size: 10.5px; color: var(--text-3); border: 1px solid var(--line-2); padding: 1px 5px; }

.side-foot { margin-top: auto; padding-top: 12px; display: grid; gap: 4px; border-top: 1px solid var(--line); }
.who { display: flex; align-items: center; gap: 10px; padding: 10px 8px; margin: 4px 0; background: var(--white); border: 1px solid var(--line-2); min-width: 0; }
.av { width: 30px; height: 30px; flex: none; display: grid; place-items: center; background: var(--accent); color: #1a1206;
  font: 700 15px/1 var(--display); }
.whotext { display: grid; min-width: 0; line-height: 1.25; }
.whotext b { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whotext span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .iconbtn { margin-left: auto; }
.collapse .ic { transition: transform .28s var(--ease); }

/* The rail: icons only, labels as tooltips. */
body.rail .side { padding-inline: 10px; }
body.rail .lockup { padding: 2px 4px 18px; justify-content: center; }
body.rail .lockup span, body.rail .lockup em, body.rail .lbl, body.rail .nav-i kbd, body.rail .whotext, body.rail .who .iconbtn { display: none; }
body.rail .nav-h { padding: 14px 0 6px; justify-content: center; }
body.rail .nav-h span { display: none; }
body.rail .nav-h::before { width: 18px; height: 1px; background: var(--line-2); }
body.rail .nav-i { justify-content: center; padding: 9px 0; }
body.rail .nav-i .n { position: absolute; top: 2px; right: 2px; min-width: 0; padding: 2px 4px; font-size: 9.5px; background: var(--paper-2); }
body.rail .who { justify-content: center; padding: 6px 0; background: none; border-color: transparent; }
body.rail .collapse .ic { transform: scaleX(-1); }

.content { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; padding: 12px 32px;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(12px); backdrop-filter: saturate(140%) blur(12px); border-bottom: 1px solid var(--line); }
.crumb { display: flex; align-items: center; gap: 8px; min-width: 0; font: 500 12px/1 var(--mono); letter-spacing: .04em; color: var(--text-3); }
.crumb span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 26ch; }
.crumb i { font-style: normal; color: var(--line-2); }
.crumb b { color: var(--text); font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: 7px; font: 500 11.5px/1 var(--mono); border: 1px solid var(--line-2);
  padding: 6px 9px; color: var(--text-2); background: var(--white); text-transform: lowercase; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: pulse 2.4s ease-out infinite; }
.iconbtn { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; flex: none;
  border: 1px solid var(--line-2); background: var(--white); color: var(--text-2); cursor: pointer; min-height: 0; box-shadow: none; }
.iconbtn:hover { color: var(--text); border-color: var(--rule); transform: translate(-1px, -1px); box-shadow: 2px 2px 0 var(--accent); }
.who .iconbtn { width: 28px; height: 28px; border-color: transparent; background: none; }
.who .iconbtn .ic { width: 15px; height: 15px; }
#refresh.spin .ic { animation: spin .6s var(--ease); }
.menu { display: none; }
.scrim { display: none; }

main { width: 100%; max-width: 1180px; padding: 30px 32px 72px; }
body:not(.authed) main { max-width: none; padding: 0; }
.tab { animation: rise .35s var(--ease); }
.head { min-width: 0; }
.bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.tab > .head { margin-bottom: 18px; }
.tab > p.muted { max-width: 76ch; color: var(--text-2); }

/* ---- controls ------------------------------------------------------------ */
button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 34px; padding: 0 13px;
  font: 600 13px/1 var(--sans); color: var(--text); background: var(--white); border: 1px solid var(--rule); border-radius: 0; cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .18s, background .18s, color .18s; }
button:hover { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--shadow); }
button:active { transform: none; box-shadow: none; }
button.primary { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
button.primary:hover { box-shadow: 3px 3px 0 var(--accent); }
button.danger { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 55%, var(--line-2)); }
button.danger:hover { box-shadow: 3px 3px 0 var(--warn); border-color: var(--warn); }
button.link { min-height: 0; padding: 0; border: 0; background: none; font: inherit; color: var(--text);
  text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
button.link:hover { transform: none; box-shadow: none; color: var(--accent-ink); }
button:disabled { opacity: .4; cursor: default; transform: none; box-shadow: none; }
.nav-i:hover:not(.on) { transform: none; box-shadow: none; }
td button { min-height: 28px; padding: 0 10px; font-size: 12px; }
td button + button { margin-left: 6px; }

input, select, textarea { font: 14px/1.3 var(--sans); padding: 8px 10px; min-height: 36px; color: var(--text);
  background: var(--white); border: 1px solid var(--line-2); border-radius: 0; transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: var(--text-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--rule); box-shadow: 3px 3px 0 var(--accent-2); }
input[type=checkbox] { min-height: 0; width: 15px; height: 15px; accent-color: var(--accent); }
textarea { font-family: var(--mono); font-size: 12.5px; width: 100%; line-height: 1.5; }
form.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.inline input { min-width: 0; }
label { color: var(--text-2); font-size: 13px; }
label.check { display: flex; gap: 9px; align-items: center; color: var(--text); }
fieldset { border: 0; padding: 0; margin: 0; display: flex; gap: 8px; flex-wrap: wrap; }
fieldset label { display: inline-flex !important; gap: 7px; align-items: center; padding: 6px 10px; border: 1px solid var(--line-2);
  background: var(--paper); font: 500 12px/1 var(--mono); color: var(--text-2); cursor: pointer; }
fieldset label:has(input:checked) { border-color: var(--accent); background: var(--accent-2); color: var(--text); }
legend { font: 500 10.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin-bottom: 10px; padding: 0; }

/* ---- cards and tables ------------------------------------------------------ */
.card { position: relative; display: grid; gap: 14px; max-width: 680px; margin: 0 0 18px; padding: 20px 22px;
  background: var(--white); border: 1px solid var(--rule); transition: box-shadow .3s var(--ease); }
.card:hover { box-shadow: 6px 6px 0 var(--paper-2), 6px 6px 0 1px var(--line-2); }
.card.inline { display: flex; padding: 14px; }
.card.wide { max-width: none; }
.card.notice { max-width: none; border-color: var(--accent); background: var(--accent-2); box-shadow: 4px 4px 0 var(--accent); }
.card label { display: grid; gap: 6px; }
.card .muted.small, .card .muted { margin: 0; }
.secret { border-color: var(--ok); box-shadow: 6px 6px 0 var(--ok-2); }
.secret .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.secret code { padding: 8px 10px; word-break: break-all; background: var(--paper); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.envrow { display: flex; gap: 8px; width: 100%; } .envrow input { flex: 1; min-width: 0; }
pre { margin: 0; padding: 10px 12px; background: var(--paper); border: 1px solid var(--line-2); white-space: pre-wrap; word-break: break-word;
  max-height: 320px; overflow: auto; font-size: 12.5px; min-height: 2.4em; }

.tscroll { overflow-x: auto; margin: 0 0 14px; background: var(--white); border: 1px solid var(--rule); padding: 4px 18px 2px; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { text-align: left; padding: 12px 14px 10px 0; border-bottom: 1px solid var(--rule);
  font: 500 10.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
td { padding: 11px 14px 11px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: var(--paper); }
tr:last-child td { border-bottom: 0; }
td[colspan] { color: var(--text-3); padding: 26px 0; text-align: center; white-space: normal; }
p.muted.small { max-width: 80ch; }

.state { font: 500 12px/1 var(--mono); color: var(--text-2); }
.state::before { content: ""; display: inline-block; vertical-align: 1px; margin-right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.state.running::before, .state.ok::before { background: var(--ok); animation: pulse 2.4s ease-out infinite; }
.state.running, .state.ok { color: var(--ok); }
.state.creating::before, .state.paused::before, .state.sleeping::before, .state.asleep::before { background: var(--accent); }
.state.error::before, .state.host_lost::before { background: var(--warn); } .state.error { color: var(--warn); }
.state.deleted, .state.stopped { color: var(--text-3); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin: 18px 0; background: var(--white);
  border: 1px solid var(--rule); }
.stat { position: relative; padding: 18px 20px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); margin: 0 -1px -1px 0; overflow: hidden; }
.stat .label { font: 500 10.5px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.stat .value { margin-top: 8px; font: 600 30px/1 var(--display); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stat:first-child .value { color: var(--ok); }
.stat::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--accent); transition: width .5s var(--ease); }
.stat:hover::after { width: 100%; }
.planrow { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
#u_licform { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
#u_licform label { display: grid; gap: 6px; flex: 1 1 280px; }

/* ---- sign-in: the brand on the left, the forms on the right ------------------ */
.auth { display: grid; grid-template-columns: minmax(380px, 46%) minmax(0, 1fr); min-height: 100vh; }
.auth-art { position: sticky; top: 0; height: 100vh; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 28px;
  padding: 36px 48px; background: var(--art); color: var(--art-text); isolation: isolate; }
.auth-art .lockup { color: var(--art-text); padding: 0; }
.auth-art .lockup em { background: var(--accent); color: #1a1206; }
.lockup.big { font-size: 26px; gap: 12px; } .lockup.big .mark { width: 38px; height: 38px; }
.art-stage { position: relative; flex: 1; min-height: 340px; }
.art-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.art-cap { display: flex; justify-content: space-between; gap: 16px; margin: 0; padding-top: 14px; border-top: 1px solid #2e2b27;
  font: 500 11.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: #bdb6a9; }
#art_phase { display: inline-flex; align-items: center; gap: 9px; }
#art_phase::before { content: ""; width: 8px; height: 8px; background: var(--accent); }
#art_log { color: #8a847a; font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.art-foot { display: flex; gap: 18px; margin: 0; }
.art-foot a { color: #8a847a; text-decoration: none; } .art-foot a:hover { color: var(--art-text); }

.auth-form { width: 100%; max-width: 440px; margin: 0 auto; padding: 64px 28px; align-self: center; }
.auth-form h1 { font-size: 40px; margin-bottom: 10px; }
.auth-form > p, .auth-form #signin_rest > p { color: var(--text-2); }
.auth-form h2 { display: flex; align-items: center; gap: 12px; margin: 30px 0 12px; font: 500 10.5px/1 var(--mono);
  letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.auth-form h2::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
#pwform, #emailform, #loginform, #ssoform, #signupform { display: grid; gap: 10px; }
#pwform input, #emailform input, #loginform input, #ssoform input, #signupform input { width: 100%; min-height: 42px; font-size: 15px; }
#pwform button, #emailform button, #loginform button, #ssoform button, #signupform button { min-height: 42px; width: 100%; font-size: 14px; }
#desknote { max-width: none; }

@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes drawOn { to { stroke-dashoffset: 0; } }
@keyframes tileIn { from { transform: scale(.4) rotate(-20deg); opacity: 0; } to { transform: none; opacity: 1; } }
.mark.draw .m-stem, .mark.draw .m-bar, .mark.draw .m-prong { stroke-dasharray: 1; stroke-dashoffset: 1; animation: drawOn .38s var(--ease) forwards; }
.mark.draw .m-stem { animation-delay: .35s; } .mark.draw .m-bar { animation-delay: .65s; } .mark.draw .m-prong { animation-delay: .9s; }
.mark.draw .m-tile { transform-origin: 50% 50%; animation: tileIn .5s cubic-bezier(.2, 1.4, .4, 1); }

/* ---- small screens: the sidebar becomes a drawer ----------------------------- */
@media (max-width: 860px) {
  body.authed .shell, body.authed.rail .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: min(280px, 84vw); transform: translateX(-102%);
    transition: transform .28s var(--ease); box-shadow: 8px 0 0 var(--scrim); }
  body.drawer .side { transform: none; }
  body.rail .side { padding-inline: 12px; }
  body.rail .lockup span, body.rail .lockup em, body.rail .lbl, body.rail .whotext, body.rail .who .iconbtn { display: revert; }
  body.rail .nav-h span { display: inline; } body.rail .nav-i { justify-content: flex-start; padding: 8px 10px; }
  .collapse { display: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 15; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.drawer .scrim { opacity: 1; pointer-events: auto; }
  .menu { display: inline-grid; }
  .top { padding: 10px 16px; } #rolechip { display: none; }
  main { padding: 22px 16px 56px; }
  h1 { font-size: 25px; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 24px 20px; gap: 22px; }
  .art-stage, .art-cap, .art-foot { display: none; }
  .auth-form { padding: 32px 16px 56px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; }
  .mark.draw .m-stem, .mark.draw .m-bar, .mark.draw .m-prong { stroke-dashoffset: 0; } }
