/* ==========================================================================
   Anysite — admin stylesheet
   Paper, ink, one accent. Hard rules, small radii, no gradients.
   ========================================================================== */

:root {
  --paper: #f3f0e6;
  --paper-2: #ece8da;
  --panel: #fbf9f2;
  --panel-2: #f7f4ea;
  --ink: #17160f;
  --ink-2: #43412f;
  --muted: #6f6c5b;
  --line: #d9d2be;
  --line-2: #e7e2d3;
  --accent: #e8551f;
  --accent-soft: #fbe3d9;
  --ok: #2f6b3a;
  --ok-soft: #dfeadb;
  --danger: #a83318;
  --danger-soft: #f7ded6;
  --rail: 236px;
  --r: 3px;
  --shadow: 2px 2px 0 var(--ink);
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans: "Inter Tight", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .3, 1);
}

html[data-theme="ink"],
html[data-theme="console"],
html[data-theme="gallery-ink"],
html[data-theme="dark"] {
  --paper: #14140e;
  --paper-2: #191912;
  --panel: #1c1c14;
  --panel-2: #21211a;
  --ink: #f2eee0;
  --ink-2: #d3cebb;
  --muted: #918d79;
  --line: #36341f;
  --line-2: #2b2a1c;
  --accent-soft: #3a1d10;
  --ok-soft: #1d2e1c;
  --danger-soft: #3a1b14;
  --shadow: 2px 2px 0 #000;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* faint paper grain, never on top of content */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
html[data-theme="ink"] body::before,
html[data-theme="console"] body::before,
html[data-theme="gallery-ink"] body::before,
html[data-theme="dark"] body::before { opacity: .06; }

::selection { background: var(--accent); color: #fff; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

p { margin: 0 0 1em; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -.015em; }

code, .mono, pre { font-family: var(--font-mono); font-size: .86em; }

code {
  background: var(--line-2);
  padding: 1px 5px;
  border-radius: 2px;
  color: var(--ink-2);
}

hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

/* --------------------------------------------------------------- layout */

.app { display: flex; min-height: 100vh; position: relative; z-index: 1; }

.rail {
  width: var(--rail);
  flex: 0 0 var(--rail);
  border-right: 1.5px solid var(--ink);
  background: var(--panel-2);
  padding: 22px 0 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { display: flex; align-items: flex-start; gap: 10px; padding: 0 20px 22px; }
.brand__mark {
  font-family: var(--font-display);
  font-size: 26px;
  line-height: .8;
  font-weight: 600;
  letter-spacing: -.04em;
  color: var(--accent);
}
.brand__text { display: flex; flex-direction: column; gap: 2px; }
.brand__text strong { font-family: var(--font-display); font-weight: 500; font-size: 18px; letter-spacing: -.02em; }
.brand__text span {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}

.railnav { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.railnav__item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 11px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
  transition: background .15s var(--ease), color .15s var(--ease);
}
.railnav__item:hover { background: var(--panel); color: var(--ink); }
.railnav__item.is-active { background: var(--ink); color: var(--paper); }
.railnav__item.is-active .railnav__num { color: var(--accent); }
.railnav__num {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  color: var(--muted);
  min-width: 16px;
}

.rail__spacer { flex: 1; }
.rail__meta { padding: 0 20px 16px; }
.rail__label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 4px;
}
.rail__value { font-size: 11.5px; color: var(--ink-2); line-height: 1.55; margin: 0; }

.rail__foot {
  border-top: 1px solid var(--line);
  padding: 12px 20px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.iconbtn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink-2);
  width: 28px;
  height: 28px;
  border-radius: var(--r);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.iconbtn:hover { border-color: var(--ink); color: var(--ink); }
.who { display: flex; flex-direction: column; line-height: 1.2; margin-left: auto; text-align: right; }
.who__name { font-size: 12px; font-weight: 600; }
.who__link {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.linkish {
  background: none;
  border: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
}
.linkish:hover { color: var(--accent); }
.inline { display: inline; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 52px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  gap: 20px;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(6px);
}
.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.crumbs a:hover { color: var(--accent); }
.crumbs__sep { opacity: .5; }
.crumbs__here { color: var(--ink); }
.topbar__right { display: flex; align-items: center; gap: 16px; }
.topbar__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); display: inline-block; }

.page { padding: 34px; max-width: 1320px; width: 100%; }
.page--flush { padding: 0; max-width: none; flex: 1; display: flex; min-height: 0; }

/* ---------------------------------------------------------- typography */

.display { font-family: var(--font-display); font-weight: 400; letter-spacing: -.03em; line-height: 1.02; }
.display--xl { font-size: clamp(34px, 4.4vw, 56px); }
.display--mega { font-size: clamp(44px, 8vw, 108px); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}
.eyebrow--tight { margin-top: 18px; }
.eyebrow--light { color: rgba(255, 255, 255, .55); }

.lede { font-size: 15.5px; color: var(--ink-2); max-width: 62ch; line-height: 1.6; margin: 14px 0 0; }
.lede--big { font-size: 18px; max-width: 56ch; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.hint { font-size: 11.5px; color: var(--muted); line-height: 1.55; margin: 0; }
.path { background: none; padding: 0; color: var(--ink-2); }

/* ------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border: 1.5px solid var(--ink);
  background: var(--panel);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--r);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .08s var(--ease), box-shadow .08s var(--ease), background .15s var(--ease);
  white-space: nowrap;
  line-height: 1.2;
}
.btn:hover { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); color: var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: none; }
.btn--primary { background: var(--accent); color: #fff; border-color: var(--ink); }
.btn--primary:hover { color: #fff; }
.btn--ghost { background: transparent; box-shadow: none; border-color: var(--line); color: var(--ink-2); }
.btn--ghost:hover { border-color: var(--ink); transform: none; box-shadow: none; color: var(--ink); }
.btn--danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); box-shadow: 1.5px 1.5px 0 var(--danger); }
.btn--danger:hover { color: var(--danger); box-shadow: none; }
.btn--xs { padding: 5px 9px; font-size: 11.5px; box-shadow: none; border-width: 1px; }
.btn--lg { padding: 13px 22px; font-size: 14.5px; }
.btn--wide { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }

/* -------------------------------------------------------------- inputs */

.field { display: flex; flex-direction: column; gap: 6px; }
.field__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  display: flex;
  align-items: baseline;
  gap: 7px;
}
.field__label em {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-style: normal;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
}
.field__hint { font-size: 11px; color: var(--muted); line-height: 1.5; }

input[type="text"], input[type="email"], input[type="password"], input[type="url"],
input[type="number"], input[type="search"], select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13.5px;
  border-radius: var(--r);
  outline: none;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
input:focus, select:focus, textarea:focus { border-color: var(--ink); background: var(--panel); }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
textarea { resize: vertical; line-height: 1.6; }
.code { font-family: var(--font-mono); font-size: 12.5px; line-height: 1.65; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 32px; }

.check { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.check input { width: auto; margin-top: 2px; accent-color: var(--accent); }
.check--boxed { border: 1px solid var(--line); padding: 9px 11px; border-radius: var(--r); background: var(--panel); }

.colorfield { display: flex; gap: 8px; align-items: center; }
.colorfield input[type="color"] { width: 44px; height: 36px; padding: 2px; border: 1px solid var(--line); background: var(--panel); border-radius: var(--r); cursor: pointer; }

/* --------------------------------------------------------------- panels */

.panel {
  background: var(--panel);
  border: 1.5px solid var(--ink);
  border-radius: var(--r);
  padding: 20px;
  margin-bottom: 22px;
}
.panel--quiet { border: 1px solid var(--line); background: var(--panel-2); }
.panel--danger { border: 1px solid var(--danger); background: var(--danger-soft); }
.panel__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel__title { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.panel__hint { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.panel__summary { cursor: pointer; font-size: 14px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; }
.panel__summary::after { content: "+"; color: var(--muted); font-family: var(--font-mono); }
.panel details[open] > .panel__summary::after { content: "–"; }
.panel--danger .panel__title { color: var(--danger); }

.stack { display: flex; flex-direction: column; gap: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid2--gap { margin-top: 22px; }
.formfoot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 4px; }

.callout {
  border-left: 3px solid var(--accent);
  background: var(--panel-2);
  padding: 14px 18px;
  margin-bottom: 22px;
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.callout p { margin: 0; font-size: 13px; color: var(--ink-2); max-width: 64ch; }

.facts { margin: 0 0 14px; display: flex; flex-direction: column; gap: 8px; }
.facts > div { display: flex; justify-content: space-between; gap: 14px; border-bottom: 1px dotted var(--line); padding-bottom: 7px; }
.facts dt { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.facts dd { margin: 0; font-size: 12.5px; text-align: right; color: var(--ink-2); }
.facts--tight > div { padding-bottom: 5px; }

.list { margin: 0 0 14px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 9px; font-size: 12.5px; color: var(--ink-2); line-height: 1.55; }

/* --------------------------------------------------------------- header */

.pagehead { display: flex; gap: 28px; align-items: flex-end; justify-content: space-between; margin-bottom: 34px; flex-wrap: wrap; }
.pagehead__main { max-width: 68ch; }
.pagehead__actions { display: flex; gap: 10px; flex-wrap: wrap; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1.5px solid var(--ink);
  border-bottom: 1px solid var(--line);
  margin-bottom: 36px;
}
.stat { padding: 16px 18px 18px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat__label { display: block; font-family: var(--font-mono); font-size: 9px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.stat__value { font-family: var(--font-display); font-size: 30px; letter-spacing: -.02em; line-height: 1; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 38px; align-items: start; }
.split--sidebar { grid-template-columns: minmax(0, 1fr) 340px; }
.split__main { min-width: 0; }
.split__side { position: sticky; top: 76px; }

.sectionhead { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding-bottom: 10px; border-bottom: 1.5px solid var(--ink); margin-bottom: 20px; }
.sectionhead--sub { margin-top: 34px; border-bottom-color: var(--line); }
.sectionhead__title { font-family: var(--font-display); font-size: 22px; letter-spacing: -.02em; }
.sectionhead__link { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.sectionhead__link:hover { color: var(--accent); }
.sectionhead__hint { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; color: var(--muted); }

/* -------------------------------------------------------------- sitecard */

.sitegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.sitecard {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--r);
  min-height: 156px;
  transition: border-color .15s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.sitecard:hover { border-color: var(--ink); transform: translateY(-2px); box-shadow: 3px 3px 0 var(--ink); color: var(--ink); }
.sitecard__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: auto; }
.sitecard__when { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .08em; color: var(--muted); }
.sitecard__name { font-family: var(--font-display); font-size: 23px; letter-spacing: -.02em; margin-top: 14px; line-height: 1.1; }
.sitecard__url { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); margin: 0; word-break: break-all; }
.sitecard__go { font-size: 12px; font-weight: 600; color: var(--accent); margin-top: 8px; }

/* ----------------------------------------------------------------- chips */

.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--ink-2);
  background: var(--panel-2);
  white-space: nowrap;
}
.chip--ghost { background: transparent; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 20px; font-size: 10.5px; font-weight: 600; border: 1px solid var(--line); color: var(--ink-2); }
.pill--ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.pill--warn { background: var(--accent-soft); border-color: transparent; color: var(--danger); }

/* ----------------------------------------------------------------- table */

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
  padding: 0 10px 9px;
  border-bottom: 1.5px solid var(--ink);
  white-space: nowrap;
}
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--panel) 60%, transparent); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .right { text-align: right; }
.table--tight td { padding: 8px 8px; font-size: 12px; }
.table__title { font-weight: 600; display: block; }
.table__title:hover { color: var(--accent); }
.table__title--static { font-weight: 500; }
.table--files td:first-child { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.is-dir td { background: color-mix(in srgb, var(--panel-2) 70%, transparent); }
.filedir { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.rowactions { display: inline-flex; gap: 6px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }

.rowmenu { position: relative; display: inline-block; }
.rowmenu summary {
  list-style: none;
  cursor: pointer;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: var(--panel);
}
.rowmenu summary::-webkit-details-marker { display: none; }
.rowmenu[open] summary { border-color: var(--ink); color: var(--ink); }
.rowmenu__body {
  position: absolute;
  right: 0;
  top: 30px;
  z-index: 30;
  width: 240px;
  background: var(--panel);
  border: 1.5px solid var(--ink);
  border-radius: var(--r);
  padding: 10px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, .18);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rowmenu__body--wide { width: 300px; }
.rowmenu__body .stack { gap: 8px; }

/* ------------------------------------------------------------------ tabs */

.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 30px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -ms-overflow-style: none; }
.tabs::-webkit-scrollbar { display: none; height: 0; }
.tabs__item {
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tabs__item:hover { color: var(--ink); }
.tabs__item.is-active { color: var(--ink); border-bottom-color: var(--accent); }

.sitehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 22px; }
.sitehead .display { font-size: clamp(30px, 3.4vw, 44px); }
.sitehead__meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 0; }
.sitehead__meta .mono { font-size: 11.5px; color: var(--muted); }
.sitehead__actions { display: flex; gap: 9px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- import */

.import__tabs { display: flex; gap: 4px; margin-bottom: 14px; flex-wrap: wrap; }
.import__tab {
  border: 1px solid var(--line);
  background: transparent;
  padding: 5px 9px;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
}
.import__tab:hover { color: var(--ink); border-color: var(--ink); }
.import__tab.is-active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.import__panel { display: none; margin-bottom: 14px; }
.import__panel.is-active { display: block; }
.import .grid2 { margin-bottom: 14px; }

/* ----------------------------------------------------------------- media */

.mediagrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; margin-bottom: 24px; }
.mediacard { margin: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--panel); }
.mediacard__frame { aspect-ratio: 4 / 3; background: var(--paper-2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.mediacard__frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mediacard__meta { padding: 9px 11px 4px; display: flex; flex-direction: column; gap: 2px; }
.mediacard__name { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mediacard__actions { display: flex; gap: 4px; padding: 4px 8px 10px; flex-wrap: wrap; }
.mediacard__actions form { display: inline; }
.mediacard__actions .btn { padding: 4px 7px; font-size: 10.5px; }

/* ---------------------------------------------------------------- blocks */

.blocklist { display: flex; flex-direction: column; gap: 16px; margin-bottom: 22px; }
.blockcard { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); overflow: hidden; }
.blockcard__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.blockcard__head h3 { font-size: 14.5px; font-weight: 600; margin-bottom: 2px; }
.blockcard__preview { background: #fff; height: 180px; overflow: hidden; }
.blockcard__preview iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ------------------------------------------------------------------ feed */

.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.feed__item { display: flex; gap: 10px; align-items: flex-start; }
.feed__dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin-top: 7px; flex: 0 0 5px; }
.feed__body { min-width: 0; }
.feed__body p { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--ink-2); }
.feed__body em { font-style: normal; color: var(--muted); font-family: var(--font-mono); font-size: 10.5px; }
.feed__time { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .06em; color: var(--muted); }
.feed--tight { gap: 9px; }

/* ----------------------------------------------------------------- empty */

.empty { border: 1px dashed var(--line); border-radius: var(--r); padding: 32px; background: color-mix(in srgb, var(--panel) 55%, transparent); }
.empty--tight { padding: 22px; }
.empty h3 { font-family: var(--font-display); font-size: 24px; margin-bottom: 8px; }
.empty p { color: var(--ink-2); max-width: 54ch; font-size: 13px; }
.empty__actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.step span { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; color: var(--accent); display: block; margin-bottom: 5px; }
.step p { font-size: 12px; margin: 0; color: var(--muted); }

/* ----------------------------------------------------------------- flash */

.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--ok);
  background: var(--panel);
  border-radius: var(--r);
  margin-bottom: 18px;
  font-size: 13px;
}
.flash p { margin: 0; }
.flash--error { border-left-color: var(--danger); background: var(--danger-soft); }
.flash__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); flex: 0 0 6px; }
.flash--error .flash__dot { background: var(--danger); }
.flash__close { margin-left: auto; background: none; border: 0; font-size: 17px; line-height: 1; color: var(--muted); cursor: pointer; }

/* ================================================================= editor */

.is-fullbleed .main { height: 100vh; overflow: hidden; }
.is-fullbleed .page { min-height: 0; }

.editor { display: flex; flex-direction: column; height: 100vh; background: var(--paper); }
.editor__bar {
  height: 54px;
  flex: 0 0 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 14px;
  border-bottom: 1.5px solid var(--ink);
  background: var(--panel);
}
.editor__barleft, .editor__barright { display: flex; align-items: center; gap: 10px; min-width: 0; }
.editor__barmid { display: flex; align-items: center; gap: 18px; }
.editor__file { display: flex; align-items: center; gap: 8px; min-width: 0; }
.editor__filename {
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 30ch;
}
.editor__status {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.editor__status.is-dirty { color: var(--accent); }
.editor__status.is-saved { color: var(--ok); }

.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--panel-2); }
.segmented__btn {
  border: 0;
  background: transparent;
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
}
.segmented__btn.is-active { background: var(--ink); color: var(--paper); }
.segmented__btn[disabled] { opacity: .4; cursor: not-allowed; }

.devices { display: inline-flex; gap: 2px; }
.devices__btn {
  border: 1px solid transparent;
  background: transparent;
  padding: 5px 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  border-radius: 2px;
  cursor: pointer;
}
.devices__btn:hover { color: var(--ink); }
.devices__btn.is-active { border-color: var(--line); background: var(--panel-2); color: var(--ink); }

.editor__body { flex: 1; display: flex; min-height: 0; }
.editor__canvas { flex: 1; min-width: 0; position: relative; overflow: hidden; background: var(--paper-2); display: flex; flex-direction: column; }
.editor__stage { flex: 1; display: flex; justify-content: flex-start; padding: 0; overflow: auto; background: color-mix(in srgb, var(--paper-2) 90%, #000 10%); }
.editor__frame { width: 100%; height: 100%; border: 0; background: #fff; display: block; transition: width .2s var(--ease); }
.editor__stage.is-device .editor__frame { box-shadow: 0 0 0 1px var(--line), 0 18px 50px rgba(0, 0, 0, .18); }

.editor__code { flex: 1; display: flex; min-height: 0; background: #15140e; color: #efe9d8; }
.editor__code[hidden] { display: none; }
.code__lines {
  flex: 0 0 46px;
  padding: 16px 8px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.65;
  color: #6f6a52;
  background: #100f0a;
  overflow: hidden;
  user-select: none;
  white-space: pre;
}
.code__area,
.code__area:focus {
  flex: 1;
  border: 0;
  background: transparent;
  color: #efe9d8;
  caret-color: #e8551f;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.65;
  padding: 16px;
  resize: none;
  outline: none;
  tab-size: 2;
  white-space: pre;
  overflow: auto;
  border-radius: 0;
}
.code__area::selection { background: #3d3a22; }

.editor__notice { position: static; flex: 0 0 auto; padding: 14px 18px; background: var(--panel); border-top: 1.5px solid var(--ink); font-size: 12.5px; }
.editor__notice .eyebrow { margin-bottom: 4px; }
.editor__notice p:last-child { margin: 0; color: var(--ink-2); max-width: 70ch; }
.editor__notice[hidden] { display: none; }

.editor__side { width: 344px; flex: 0 0 344px; border-left: 1.5px solid var(--ink); background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
.side__tabs { display: flex; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.side__tabs button {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 11px 4px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.side__tabs button.is-active { color: var(--ink); border-bottom-color: var(--accent); }
.side__panels { flex: 1; overflow-y: auto; padding: 18px; min-height: 0; }
.side__panel { display: none; }
.side__panel.is-active { display: block; }
.side__empty p { font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.tiplist { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; color: var(--muted); }
kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 3px;
  padding: 1px 5px;
  background: var(--panel-2);
  color: var(--ink-2);
}

.inspect { display: flex; flex-direction: column; gap: 13px; }
.inspect[hidden] { display: none; }
.inspect__head { display: flex; align-items: center; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.tagchip {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .06em;
  padding: 3px 7px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 2px;
  text-transform: lowercase;
}
.inspect__path { font-family: var(--font-mono); font-size: 9.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inspect__actions { display: flex; gap: 8px; }
.inspect__struct { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.inspect__struct .btn { justify-content: flex-start; }

.side__group { margin-bottom: 16px; }
.side__grouphead { font-family: var(--font-mono); font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; font-weight: 400; }
.blockbtn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  margin-bottom: 5px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: var(--r);
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
  text-align: left;
}
.blockbtn:hover { border-color: var(--ink); color: var(--ink); background: var(--panel); }
.blockbtn__plus { font-family: var(--font-mono); color: var(--accent); }

.filelist { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.filelist__item { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: 2px; font-family: var(--font-mono); font-size: 11px; color: var(--ink-2); }
.filelist__item:hover { background: var(--panel-2); color: var(--ink); }
.filelist__item.is-current { background: var(--ink); color: var(--paper); }
.filelist__item.is-current .filelist__kind { color: var(--accent); }
.filelist__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filelist__kind { font-size: 9px; letter-spacing: .1em; color: var(--muted); flex: 0 0 auto; }
.side__sep { height: 1px; background: var(--line); margin: 18px 0; }

/* injected into the preview iframe by editor.js */
.anysite-hover { outline: 1px dashed var(--accent) !important; outline-offset: 1px !important; cursor: pointer !important; }
.anysite-selected { outline: 2px solid var(--accent) !important; outline-offset: 2px !important; }

/* ---------------------------------------------------------------- auth */

.authpage { background: var(--paper); }
.authpage__grid { display: grid; grid-template-columns: 1.05fr .95fr; min-height: 100vh; }
.authpage__aside {
  background: #15140e;
  color: #f4f0e2;
  padding: 42px 48px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.authpage__brand { font-family: var(--font-display); font-size: 21px; letter-spacing: -.02em; display: flex; align-items: center; gap: 9px; }
.authpage__brand .brand__mark { color: var(--accent); font-size: 24px; }
.authpage__pitch { margin-top: auto; }
.authpage__pitch h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(38px, 4.6vw, 60px); line-height: 1.02; letter-spacing: -.03em; margin-bottom: 18px; }
.authpage__pitch p { color: rgba(244, 240, 226, .64); max-width: 38ch; font-size: 14.5px; line-height: 1.65; }
.authpage__list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; border-top: 1px solid rgba(244, 240, 226, .16); padding-top: 24px; }
.authpage__list li { color: rgba(244, 240, 226, .72); font-size: 13px; display: flex; gap: 12px; align-items: baseline; }
.authpage__list span { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .14em; color: var(--accent); }
.authpage__main { display: flex; align-items: center; justify-content: center; padding: 42px 32px; }
.authform { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 15px; }
.authform h1 { font-size: 36px; margin-bottom: 2px; }
.authform__lede { font-size: 13.5px; color: var(--muted); margin: 0 0 8px; line-height: 1.6; }
.authform__hint { font-size: 11px; color: var(--muted); line-height: 1.6; margin: 4px 0 0; }

/* --------------------------------------------------------------- landing */

.landing { background: var(--paper); }
.landing__top { display: flex; align-items: center; justify-content: space-between; padding: 20px 40px; border-bottom: 1.5px solid var(--ink); gap: 20px; flex-wrap: wrap; }
.landing__nav { display: flex; align-items: center; gap: 22px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.landing__nav a:hover { color: var(--ink); }
.landing__main { max-width: 1160px; margin: 0 auto; padding: 0 40px 90px; }
.landing__hero { padding: 90px 0 56px; border-bottom: 1.5px solid var(--ink); }
.landing__hero h1 { margin: 0 0 22px; }
.landing__actions { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.landing__rule {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 44px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.landing__sites { padding: 56px 0 20px; }
.landing__how { padding: 50px 0; border-top: 1.5px solid var(--ink); margin-top: 40px; }
.how { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 34px; }
.how__item h3 { font-family: var(--font-display); font-size: 26px; margin-bottom: 10px; letter-spacing: -.02em; }
.how__item p { font-size: 13.5px; line-height: 1.7; color: var(--ink-2); }
.landing__foot {
  border-top: 1px solid var(--line);
  padding: 22px 40px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  flex-wrap: wrap;
}
.landing--404 .landing__main { padding-top: 80px; }

/* ------------------------------------------------------------ responsive */

@media (max-width: 1180px) {
  .split, .split--sidebar { grid-template-columns: 1fr; }
  .split__side { position: static; }
  .editor__side { width: 300px; flex-basis: 300px; }
}

@media (max-width: 900px) {
  .app { flex-direction: column; }
  .rail {
    width: auto;
    flex: none;
    height: auto;
    position: sticky;
    top: 0;
    z-index: 20;
    border-right: 0;
    border-bottom: 1.5px solid var(--ink);
    padding: 12px 16px;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    overflow-x: auto;
  }
  .brand { padding: 0; flex: 0 0 auto; }
  .brand__text span { display: none; }
  .railnav { flex-direction: row; border: 0; gap: 2px; }
  .railnav__item { border: 0; padding: 6px 8px; font-size: 12px; border-radius: 2px; }
  .railnav__num { display: none; }
  .rail__meta { display: none; }
  .rail__spacer { display: none; }
  .rail__foot { border: 0; padding: 0; margin-left: auto; flex-wrap: nowrap; }
  .who__link { display: none; }
  .topbar { padding: 0 18px; }
  .page { padding: 22px 18px 60px; }
  .is-fullbleed .main { height: calc(100vh - 56px); }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(1), .stat:nth-child(2) { border-bottom: 1px solid var(--line); }
  .editor__side { position: absolute; right: 0; top: 54px; bottom: 0; width: min(344px, 92vw); z-index: 15; box-shadow: -8px 0 24px rgba(0,0,0,.14); }
  .editor__barmid .devices { display: none; }
  .authpage__grid { grid-template-columns: 1fr; }
  .authpage__aside { padding: 28px 24px; gap: 24px; }
  .authpage__pitch h2 { font-size: 34px; }
  .landing__main { padding: 0 22px 60px; }
  .landing__top { padding: 16px 22px; }
  .landing__hero { padding: 54px 0 38px; }
  .grid2 { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .editor__filename { max-width: 16ch; }
  .pagehead { margin-bottom: 24px; }
  .sitegrid { grid-template-columns: 1fr; }
  .stat__value { font-size: 24px; }
  .table th:nth-child(4), .table td:nth-child(4) { display: none; }
}

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

/* ================================================== v1.1 additions === */

/* --- rail: tools, badges, account block -------------------------------- */
.railnav__label {
  margin: 14px 0 0;
  padding: 0 20px 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}
.railnav__item--small { font-size: 12.5px; padding: 8px 20px; border-bottom: 0; gap: 6px; }
.railnav__item--small.is-active { background: var(--ink); color: var(--paper); }
.railnav__badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 18px;
  text-align: center;
}

.rail__foot {
  border-top: 1.5px solid var(--ink);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.who { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; text-decoration: none; color: inherit; }
.who:hover .who__name { color: var(--accent); }
.who__avatar {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 14px;
  line-height: 28px;
  text-align: center;
}
.who__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.who__name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who__role { font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.rail__foot .iconbtn { flex: 0 0 auto; }
.iconbtn--out { border-color: var(--ink); background: var(--panel); }
.iconbtn--out:hover { background: var(--ink); color: var(--paper); }
.iconbtn--sm { width: 26px; height: 26px; font-size: 11px; }
.rail__foot form { display: flex; }

.impersonate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 8px 16px;
  background: #191810;
  color: #f6f3ea;
  font-size: 12.5px;
}
.impersonate__btn {
  border: 1px solid rgba(255,255,255,.4);
  background: transparent;
  color: inherit;
  padding: 3px 10px;
  border-radius: 2px;
  cursor: pointer;
  font: inherit;
}
.impersonate__btn:hover { background: rgba(255,255,255,.12); }
.impersonate form { display: inline; }

.topbar__status { text-decoration: none; color: var(--muted); }
.topbar__status:hover { color: var(--ink); }

/* --- small shared bits ------------------------------------------------- */
.stackstack { display: flex; flex-direction: column; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.empty--tight { padding: 26px 22px; }
.inlineform { display: flex; align-items: flex-end; gap: 10px; margin-top: 10px; }
.inlineform .field { flex: 1; margin: 0; }
.hide-sm { display: table-cell; }
.block { display: block; }
.table--tight td, .table--tight th { padding: 7px 10px; font-size: 12px; }
.minimsg {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}
.minimsg:last-child { border-bottom: 0; }
.minimsg strong { font-size: 12.5px; font-weight: 600; }
.pagehead__actions form { display: inline-flex; }
.panel--danger { border-color: var(--accent); }

/* --- notices ----------------------------------------------------------- */
.note {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--panel);
  padding: 14px 16px;
  margin: 16px 0;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.65;
}
.note p:last-child { margin: 0; }

/* --- chart ------------------------------------------------------------- */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 150px; padding: 12px 4px 0; }
.bars__col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; }
.bars__bar { width: 100%; max-width: 34px; background: var(--accent); border-radius: 1px 1px 0 0; min-height: 2px; }
.bars__value { font-family: var(--font-mono); font-size: 9px; color: var(--muted); }
.bars__label { font-family: var(--font-mono); font-size: 8.5px; color: var(--muted); white-space: nowrap; transform: rotate(-45deg); margin-top: 4px; }

/* --- announcements & messages ----------------------------------------- */
.announcement__head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.announcement__when { margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: var(--muted); }
.announcement__title { font-family: var(--font-display); font-size: 19px; margin: 0 0 6px; }
.announcement__body { font-size: 13px; line-height: 1.6; color: var(--ink-2); margin: 0 0 12px; }
.announcement__actions { display: flex; gap: 6px; flex-wrap: wrap; }
.announcement__actions form { display: inline-flex; }
.message--unread { border-left: 3px solid var(--accent); }
.message__head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.message__subject { font-family: var(--font-display); font-size: 18px; margin: 0; }
.message__body { font-size: 13px; line-height: 1.65; color: var(--ink-2); margin: 0 0 8px; }
.pill--warn { background: #f4e0c8; color: #7a3f0a; }

/* --- editor: layout, splitter, device grips --------------------------- */
.editor__body { align-items: stretch; }
.editor__stage {
  justify-content: center;
  align-items: stretch;
  position: relative;
  padding: 0 10px;
}
.editor__frame { margin: 0 auto; min-width: 280px; max-width: 100%; height: 100%; }
.editor__stage.is-device .editor__frame { box-shadow: 0 0 0 1px var(--line), 0 22px 60px rgba(0, 0, 0, .22); }
.editor__canvas { min-width: 0; }

.resize {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 10px;
  z-index: 12;
  cursor: ew-resize;
  background: transparent;
  touch-action: none;
}
.resize::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 3px;
  height: 44px;
  border-radius: 2px;
  background: var(--line);
}
.resize:hover::after, .resize.is-active::after { background: var(--accent); height: 78px; }
.grip--left { left: 0; }
.grip--right { right: 0; }
.devices__size {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .08em;
  color: var(--muted);
  padding: 0 4px;
  align-self: center;
  min-width: 34px;
  text-align: right;
}

.editor__split {
  flex: 0 0 7px;
  width: 7px;
  cursor: col-resize;
  background: var(--paper-2);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  position: relative;
  touch-action: none;
}
.editor__split::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 34px;
  background: var(--line);
  border-radius: 2px;
}
.editor__split:hover::after, .editor__split.is-active::after { background: var(--accent); }
.editor__side { border-left: 0; }
.is-resizing { user-select: none; cursor: col-resize; }
.editor__code { min-width: 0; }

/* --- rich text editor -------------------------------------------------- */
.field__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.textmode { display: inline-flex; border: 1px solid var(--line); border-radius: 2px; overflow: hidden; }
.textmode__btn {
  border: 0;
  background: transparent;
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
}
.textmode__btn.is-active { background: var(--ink); color: var(--paper); }
.richbox {
  min-height: 108px;
  max-height: 300px;
  overflow-y: auto;
  padding: 10px 12px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--panel-2);
  font-family: var(--font-ui);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink);
  outline: none;
}
.richbox:focus { box-shadow: 2px 2px 0 var(--accent); }
.richbox[hidden] { display: none; }
.richbox a { color: var(--accent); }
.richbox__raw { min-height: 108px; }
.richtools { display: flex; gap: 4px; flex-wrap: wrap; }
.richtools[hidden] { display: none; }

/* --- styles panel ------------------------------------------------------ */
.styletarget { font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.stylegrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin-bottom: 10px; }
.field--tight { margin: 0; gap: 3px; }
.field--tight .field__label { font-size: 9.5px; }
.selector {
  font-family: var(--font-mono);
  font-size: 10.5px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  padding: 3px 6px;
  border-radius: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 150px;
}

/* --- fx library -------------------------------------------------------- */
.fxtabs { display: flex; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; }
.fxtabs button {
  border: 1px solid var(--line);
  background: var(--panel-2);
  padding: 4px 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
}
.fxtabs button.is-active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.fxlist { display: none; grid-template-columns: 1fr 1fr; gap: 5px; }
.fxlist.is-active { display: grid; }
.fxbtn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--panel-2);
  cursor: pointer;
  text-align: left;
}
.fxbtn:hover { border-color: var(--accent); }
.fxbtn__name { font-size: 12px; font-weight: 600; color: var(--ink); }
.fxbtn__group { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.fxbtn--font .fxbtn__group { font-size: 12px; }
.fxapplied { display: flex; flex-wrap: wrap; gap: 5px; }
.chip--removable {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink-2);
  padding: 3px 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  cursor: pointer;
}
.chip--removable:hover { border-color: var(--accent); color: var(--accent); }

/* --- site CSS page ----------------------------------------------------- */
.csseditor { display: flex; gap: 16px; align-items: flex-start; }
.csseditor__form { flex: 1 1 auto; min-width: 0; border: 1.5px solid var(--ink); border-radius: var(--r); background: var(--panel); padding: 16px; }
.csseditor__area {
  width: 100%;
  min-height: 60vh;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #15140e;
  color: #efe9d8;
  caret-color: var(--accent);
  resize: vertical;
  tab-size: 2;
}
.csseditor__foot { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.csseditor__side { flex: 0 0 268px; display: flex; flex-direction: column; gap: 12px; }
.presets { display: flex; flex-wrap: wrap; gap: 5px; }

/* --- docs -------------------------------------------------------------- */
.doc { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; align-items: start; }
.doc__toc { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 3px; border-left: 1px solid var(--line); padding-left: 12px; }
.doc__toc a { font-size: 12px; color: var(--muted); padding: 3px 0; text-decoration: none; }
.doc__toc a:hover { color: var(--accent); }
.doc__body { max-width: 78ch; }
.doc__body section { padding: 8px 0 22px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.doc__body section:last-child { border-bottom: 0; }
.doc__body h2 { font-family: var(--font-display); font-size: 26px; letter-spacing: -.02em; margin: 2px 0 12px; }
.doc__body h3 { font-family: var(--font-display); font-size: 18px; margin: 22px 0 8px; }
.doc__body p, .doc__body li, .doc__body dd { font-size: 14px; line-height: 1.72; color: var(--ink-2); }
.doc__body code { font-family: var(--font-mono); font-size: .86em; background: var(--panel-2); border: 1px solid var(--line); padding: 1px 4px; border-radius: 2px; }
.doc__body a { color: var(--accent); }
.doclist { padding-left: 18px; margin: 10px 0; }
.doclist li { margin-bottom: 6px; }
.doclist dt { font-weight: 600; color: var(--ink); margin-top: 12px; }
.doclist dd { margin: 2px 0 0; }
.codeblock {
  background: #15140e;
  color: #efe9d8;
  padding: 14px 16px;
  border-radius: 3px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  margin: 10px 0;
}

/* --- legal, credits, public pages ------------------------------------- */
.prose h2 { font-family: var(--font-display); font-size: 22px; margin: 26px 0 8px; letter-spacing: -.01em; }
.prose h3 { font-family: var(--font-display); font-size: 17px; margin: 18px 0 6px; }
.prose p, .prose li { font-size: 14px; line-height: 1.75; color: var(--ink-2); }
.prose ul { padding-left: 20px; }
.prose a { color: var(--accent); }
.legal { max-width: 78ch; }
.legal__meta { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.public .landing__top { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 1.5px solid var(--ink); }
.public__main { max-width: 1100px; margin: 0 auto; padding: 40px 28px 64px; }
.public__head { margin-bottom: 26px; }
.public__footlinks { display: inline-flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.public__footlinks a { color: var(--ink-2); }
.public__footlinks a:hover { color: var(--accent); }
.credits { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 36px; align-items: start; }
.credits__author { font-size: 14px; margin: 16px 0; }
.credits__links { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 26px; }
.credits__side { border: 1px solid var(--line); background: var(--panel); padding: 16px; }

/* --- landing additions ------------------------------------------------- */
.landing__news { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 0 auto 34px; max-width: 1100px; padding: 0 28px; }
.landing__note { border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--panel); padding: 14px 16px; }
.landing__note--warning { border-left-color: #b8451a; }
.landing__note h3 { font-family: var(--font-display); font-size: 18px; margin: 2px 0 6px; }
.landing__note p { font-size: 13px; line-height: 1.6; color: var(--ink-2); margin: 0; }

/* --- responsive -------------------------------------------------------- */
@media (max-width: 1100px) {
  .doc { grid-template-columns: 1fr; }
  .doc__toc { position: static; flex-direction: row; flex-wrap: wrap; gap: 8px 14px; border-left: 0; border-bottom: 1px solid var(--line); padding: 0 0 10px; }
  .credits { grid-template-columns: 1fr; }
  .csseditor { flex-direction: column; }
  .csseditor__side { flex: 1 1 auto; width: 100%; }
}
@media (max-width: 860px) {
  .grid3 { grid-template-columns: 1fr; }
  .stylegrid { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .editor__split { display: none; }
  .richbox { max-height: 200px; }
}

.deploy__actions { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.deploy__actions form { display: inline-flex; }

@media (max-width: 980px) {
  .editor__bar { flex-wrap: wrap; height: auto; padding: 6px 10px; gap: 6px; row-gap: 4px; }
  .editor__barleft, .editor__barmid, .editor__barright { flex-wrap: wrap; min-width: 0; }
  .editor__barright { gap: 4px; }
  .editor__barmid { gap: 6px; }
  .editor__status { display: none; }
  .devices__size { display: none; }
  .editor__filename { max-width: 44vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .richbox { min-height: 86px; }
}

/* Fill the full-bleed page: the editor is a flex item, not a shrink-wrapped box. */
.is-fullbleed .page > .editor,
.page--flush > .editor {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  max-width: none;
}
.editor > .editor__body { width: 100%; }

/* The stage must give the frame a definite height, or short pages leave a gap. */
.editor__canvas { min-height: 0; }
.editor__stage { height: 100%; min-height: 0; }
.editor__stage > .editor__frame { height: 100%; align-self: stretch; }
.who { flex-direction: row; }
.is-resizing .editor__frame { pointer-events: none; }
.is-resizing { cursor: col-resize; }

.panel--quiet code.path { display: block; margin-top: 3px; word-break: break-all; }

/* ------------------------------------------------- multi-tenant additions */
.stats--wide { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.cell--actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.cell--actions form { margin: 0; }
.input--tiny { width: 62px; padding: 4px 6px; font-size: 12px; }
.inlineform--tight { margin: 0; gap: 6px; }
.inlineform--tight .field { flex: 0 0 auto; }
.field--group { border: 1px solid var(--line); border-radius: 4px; padding: 14px 16px; display: grid; gap: 10px; }
.field--group .field__label { margin: 0 0 2px; }
.check--radio { align-items: flex-start; }
.check--radio input { margin-top: 4px; }
.itemlist { list-style: none; margin: 12px 0; padding: 0; border-top: 1px solid var(--line-2); }
.itemlist__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.itemlist__row form { margin: 0; }
.landing__empty { border: 1px dashed var(--line); padding: 26px 24px; display: grid; gap: 14px; justify-items: start; }
.handbook { max-width: 760px; }
.handbook h2 { font-family: var(--font-display); font-size: 26px; margin: 34px 0 10px; font-weight: 500; }
.handbook h3 { font-size: 14px; letter-spacing: .06em; text-transform: uppercase; margin: 22px 0 6px; color: var(--ink-2); }
.handbook p, .handbook li { font-size: 14px; line-height: 1.7; color: var(--ink-2); }
.handbook code { font-size: 12px; }
.handbook ul { padding-left: 18px; }
.handbook .callout { border-left: 3px solid var(--accent); background: var(--panel); padding: 12px 16px; margin: 16px 0; }

/* ---------------------------------------------- editor history & fx extras */
.historybtns { display: inline-flex; gap: 2px; border-left: 1px solid var(--line); padding-left: 8px; margin-left: 6px; }
.historybtns .iconbtn[disabled] { opacity: .3; cursor: not-allowed; }
.fxrow { display: flex; align-items: stretch; gap: 4px; }
.fxrow .fxbtn { flex: 1; }
.fxrow form { margin: 0; display: flex; }
.fxrow .iconbtn { align-self: center; }
.fxnew { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
.fxnew summary { cursor: pointer; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
.fxnew .stack { margin-top: 10px; }
.revlist { display: grid; gap: 12px; }
.rev { border: 1px solid var(--line); background: var(--panel); }
.rev__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 12px 14px; flex-wrap: wrap; }
.rev__when { font-size: 12px; margin: 0; font-variant-numeric: tabular-nums; }
.rev__what { margin: 2px 0 0; font-size: 14px; font-weight: 500; }
.rev__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rev__meta form { margin: 0; }
.rev__diff { border-top: 1px solid var(--line-2); }
.rev__diff summary { padding: 8px 14px; cursor: pointer; font-size: 12px; color: var(--ink-2); }
.rev__diff summary:hover { color: var(--accent); }
.rev__diff .hint { padding: 0 14px 10px; margin: 0; }
.diff { margin: 0; padding: 0 0 12px; font-size: 12px; line-height: 1.6; overflow-x: auto; background: transparent; }
.diff__line { display: block; padding: 0 14px; white-space: pre; }
.diff__line--add { background: rgba(47,107,58,.12); color: #22532c; }
.diff__line--del { background: rgba(184,69,26,.1); color: #7a2b12; }
.diff__line--same { color: var(--ink-2); }
.licensebar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 14px; border: 1px solid #b8451a; border-left: 4px solid #b8451a; background: color-mix(in srgb, #b8451a 8%, var(--panel)); }
.licensebar__label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #b8451a; font-weight: 600; }
.licensebar p { margin: 0; font-size: 13px; flex: 1; min-width: 220px; }

/* ==========================================================================
   Themes
   Paper / Ink      — editorial, left rail (original)
   Studio / Console — top navigation (Studio) and a compact icon rail (Console)
   Gallery          — top navigation, narrow serif canvas
   ========================================================================== */

html[data-theme="studio"] {
  --paper: #f2f5f0;
  --paper-2: #e9efe7;
  --panel: #ffffff;
  --panel-2: #f6f9f4;
  --ink: #141a13;
  --ink-2: #3d463a;
  --muted: #687163;
  --line: #d3dccf;
  --line-2: #e3eae0;
  --accent-soft: #fbe3d9;
  --shadow: none;
  --font-display: "Inter Tight", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

html[data-theme="gallery"] {
  --paper: #f8f2e4;
  --paper-2: #f1e9d7;
  --panel: #fffdf7;
  --panel-2: #f6efdf;
  --ink: #1d1a12;
  --ink-2: #4a4433;
  --muted: #7a7159;
  --line: #d9cfb6;
  --line-2: #e9e1cd;
  --shadow: none;
}

html[data-theme="gallery-ink"] {
  --paper: #16140f;
  --paper-2: #1c1912;
  --panel: #211d15;
  --panel-2: #272218;
  --ink: #f3ecda;
  --ink-2: #d6cdb6;
  --muted: #9a8f76;
  --line: #3b3524;
  --line-2: #2e291c;
  --accent-soft: #3a1d10;
  --ok-soft: #1d2e1c;
  --danger-soft: #3a1b14;
  --shadow: none;
}

html[data-theme="console"] {
  --paper: #10110c;
  --paper-2: #15160f;
  --panel: #1a1b13;
  --panel-2: #1e1f16;
  --line: #34351f;
  --line-2: #292a1a;
  --rail: 96px;
  --r: 2px;
}

/* --- top navigation: Studio, Gallery ------------------------------------ */
html[data-theme="studio"] .app,
html[data-theme="gallery"] .app,
html[data-theme="gallery-ink"] .app { display: block; }

html[data-theme="studio"] .rail,
html[data-theme="gallery"] .rail,
html[data-theme="gallery-ink"] .rail {
  position: sticky;
  top: 0;
  width: 100%;
  height: auto;
  flex: none;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding: 10px 26px;
  border-right: 0;
  border-bottom: 1.5px solid var(--ink);
  background: var(--panel-2);
  z-index: 30;
}
html[data-theme="studio"] .brand,
html[data-theme="gallery"] .brand,
html[data-theme="gallery-ink"] .brand { padding: 0; align-items: center; flex: 0 0 auto; }
html[data-theme="studio"] .brand__text span,
html[data-theme="gallery"] .brand__text span,
html[data-theme="gallery-ink"] .brand__text span { display: none; }
html[data-theme="studio"] .railnav,
html[data-theme="gallery"] .railnav,
html[data-theme="gallery-ink"] .railnav {
  flex: 1 1 auto;
  flex-direction: row;
  flex-wrap: wrap;
  border-top: 0;
  gap: 2px;
  min-width: 0;
}
html[data-theme="studio"] .railnav__label,
html[data-theme="gallery"] .railnav__label,
html[data-theme="gallery-ink"] .railnav__label { display: none; }
html[data-theme="studio"] .railnav__item,
html[data-theme="gallery"] .railnav__item,
html[data-theme="gallery-ink"] .railnav__item {
  border-bottom: 0;
  padding: 7px 9px;
  font-size: 12.5px;
  white-space: nowrap;
}
html[data-theme="studio"] .railnav__num,
html[data-theme="gallery"] .railnav__num,
html[data-theme="gallery-ink"] .railnav__num { display: none; }
html[data-theme="studio"] .rail__spacer,
html[data-theme="gallery"] .rail__spacer,
html[data-theme="gallery-ink"] .rail__spacer { display: none; }
html[data-theme="studio"] .rail__meta,
html[data-theme="gallery"] .rail__meta,
html[data-theme="gallery-ink"] .rail__meta { display: none; }
html[data-theme="studio"] .rail__foot,
html[data-theme="gallery"] .rail__foot,
html[data-theme="gallery-ink"] .rail__foot {
  margin-left: auto;
  border-top: 0;
  padding: 0;
  flex-wrap: nowrap;
  width: auto;
}
html[data-theme="studio"] .who,
html[data-theme="gallery"] .who,
html[data-theme="gallery-ink"] .who { margin: 0; text-align: left; }
html[data-theme="studio"] .topbar,
html[data-theme="gallery"] .topbar,
html[data-theme="gallery-ink"] .topbar { display: none; }
html[data-theme="studio"] .main,
html[data-theme="gallery"] .main,
html[data-theme="gallery-ink"] .main { width: 100%; }

html[data-theme="studio"] .page { max-width: 1240px; margin: 0 auto; padding: 46px 36px; }
html[data-theme="gallery"] .page,
html[data-theme="gallery-ink"] .page { max-width: 920px; margin: 0 auto; padding: 58px 34px; }

html[data-theme="gallery"] .display,
html[data-theme="gallery-ink"] .display { font-family: var(--font-display); }
html[data-theme="gallery"] .panel,
html[data-theme="gallery-ink"] .panel {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  padding-left: 0;
  padding-right: 0;
}
html[data-theme="gallery"] .panel + .panel,
html[data-theme="gallery-ink"] .panel + .panel { margin-top: 28px; }
html[data-theme="gallery"] .panel__head,
html[data-theme="gallery-ink"] .panel__head { border-bottom: 0; }
html[data-theme="studio"] .panel { border-radius: 10px; box-shadow: none; }

/* --- compact icon rail: Console ----------------------------------------- */
html[data-theme="console"] .rail { width: 96px; flex: 0 0 96px; padding: 16px 0 12px; }
html[data-theme="console"] .brand { padding: 0 6px 16px; justify-content: center; align-items: center; }
html[data-theme="console"] .brand__text { display: none; }
html[data-theme="console"] .railnav__label { display: none; }
html[data-theme="console"] .railnav__item {
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 9px 6px;
  font-size: 10px;
  line-height: 1.25;
  text-align: center;
}
html[data-theme="console"] .railnav__num { display: none; }
html[data-theme="console"] .rail__meta { display: none; }
html[data-theme="console"] .rail__foot { flex-direction: column; padding: 12px 6px 0; gap: 8px; }
html[data-theme="console"] .who { display: none; }
html[data-theme="console"] .topbar { padding: 0 24px; }
html[data-theme="console"] .page { max-width: 1500px; padding: 26px 24px; }

@media (max-width: 926px) {
  html[data-theme="studio"] .rail,
  html[data-theme="gallery"] .rail,
  html[data-theme="gallery-ink"] .rail { padding: 10px 16px; gap: 8px; }
  html[data-theme="studio"] .page,
  html[data-theme="gallery"] .page,
  html[data-theme="gallery-ink"] .page { padding: 28px 18px; }
  html[data-theme="console"] .rail {
    width: 100%;
    flex: none;
    padding: 10px 12px;
    flex-direction: row;
    align-items: center;
    gap: 6px;
  }
  html[data-theme="console"] .brand { padding: 0; }
  html[data-theme="console"] .railnav { flex-direction: row; flex-wrap: wrap; flex: 1; }
  html[data-theme="console"] .rail__foot { flex-direction: row; margin-left: auto; padding: 0; }
}

/* --- dialog ------------------------------------------------------------- */
.dialog {
  border: 1.5px solid var(--ink);
  border-radius: var(--r);
  background: var(--panel);
  color: var(--ink);
  padding: 0;
  width: min(430px, 92vw);
  box-shadow: 6px 6px 0 var(--ink);
}
.dialog::backdrop { background: rgba(18, 16, 8, .48); backdrop-filter: blur(2px); }
.dialog__body { padding: 26px 26px 10px; }
.dialog__title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -.02em;
  margin: 0 0 8px;
}
.dialog__msg { margin: 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.55; }
.dialog__actions { display: flex; justify-content: flex-end; gap: 8px; padding: 18px 26px 24px; }

/* --- Aurora Glass -------------------------------------------------------
   A full glassmorphism shell: gradient canvas, floating frosted rail,
   translucent cards, pill navigation and soft depth. Layout changes too.
   ---------------------------------------------------------------------- */
html[data-theme="glass"] {
  --paper: #070b18;
  --paper-2: rgba(255, 255, 255, .05);
  --panel: rgba(255, 255, 255, .075);
  --panel-2: rgba(255, 255, 255, .05);
  --ink: #f6f8ff;
  --ink-2: #cbd5ea;
  --muted: #96a2bf;
  --line: rgba(255, 255, 255, .16);
  --line-2: rgba(255, 255, 255, .10);
  --accent-soft: rgba(124, 92, 255, .22);
  --ok: #58e0a5;
  --ok-soft: rgba(88, 224, 165, .14);
  --danger: #ff7a8a;
  --danger-soft: rgba(255, 122, 138, .14);
  --rail: 250px;
  --r: 16px;
  --shadow: 0 24px 60px rgba(0, 0, 0, .35);
  --font-display: "Inter Tight", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

html[data-theme="glass"] body {
  background:
    radial-gradient(1100px 720px at 6% -12%, rgba(124, 92, 255, .55), transparent 62%),
    radial-gradient(920px 620px at 102% 4%, rgba(34, 211, 238, .30), transparent 58%),
    radial-gradient(820px 700px at 48% 112%, rgba(236, 72, 153, .22), transparent 62%),
    #070b18;
  background-attachment: fixed;
}
html[data-theme="glass"] body::before { opacity: .05; }

html[data-theme="glass"] .app { gap: 20px; padding: 18px; align-items: flex-start; }

html[data-theme="glass"] .rail {
  position: sticky;
  top: 18px;
  width: 250px;
  flex: 0 0 250px;
  height: calc(100vh - 36px);
  padding: 22px 14px 16px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-right: 1px solid rgba(255, 255, 255, .14);
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .035));
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .18);
}
html[data-theme="glass"] .brand { padding: 0 10px 20px; }
html[data-theme="glass"] .brand__mark { color: #c9bcff; text-shadow: 0 0 26px rgba(124, 92, 255, .75); }
html[data-theme="glass"] .brand__text strong { font-family: var(--font-display); }
html[data-theme="glass"] .railnav { border-top: 1px solid rgba(255, 255, 255, .10); padding-top: 10px; gap: 4px; }
html[data-theme="glass"] .railnav__label { padding: 14px 12px 6px; }
html[data-theme="glass"] .railnav__item {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--ink-2);
}
html[data-theme="glass"] .railnav__item:hover {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .10);
  color: #fff;
}
html[data-theme="glass"] .railnav__item.is-active {
  background: linear-gradient(120deg, rgba(124, 92, 255, .48), rgba(56, 189, 248, .22));
  border-color: rgba(255, 255, 255, .22);
  color: #fff;
  box-shadow: 0 8px 24px rgba(80, 60, 200, .30), inset 0 1px 0 rgba(255, 255, 255, .22);
}
html[data-theme="glass"] .railnav__item.is-active .railnav__num { color: #fff; }
html[data-theme="glass"] .rail__foot {
  margin: 12px 4px 0;
  padding: 12px 6px 0;
  border-top: 1px solid rgba(255, 255, 255, .12);
}
html[data-theme="glass"] .iconbtn {
  border-radius: 10px;
  border-color: rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .06);
  color: var(--ink-2);
}
html[data-theme="glass"] .iconbtn:hover { border-color: rgba(255, 255, 255, .35); color: #fff; }

html[data-theme="glass"] .main { gap: 18px; }
html[data-theme="glass"] .topbar {
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 16px;
  background: rgba(255, 255, 255, .06);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .14);
  top: 18px;
}
html[data-theme="glass"] .page { padding: 6px 4px 42px; max-width: 1400px; }

html[data-theme="glass"] .panel {
  background: linear-gradient(160deg, rgba(255, 255, 255, .105), rgba(255, 255, 255, .045));
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 20px;
  backdrop-filter: blur(20px) saturate(130%);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .16);
}
html[data-theme="glass"] .panel--quiet { background: rgba(255, 255, 255, .045); }
html[data-theme="glass"] .panel__head { border-bottom-color: rgba(255, 255, 255, .10); }

html[data-theme="glass"] .btn {
  border-radius: 12px;
  border-color: rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .07);
  box-shadow: none;
  color: var(--ink);
}
html[data-theme="glass"] .btn:hover { border-color: rgba(255, 255, 255, .38); color: #fff; }
html[data-theme="glass"] .btn--primary {
  background: linear-gradient(120deg, #7c5cff, #4f8bff);
  border-color: rgba(255, 255, 255, .25);
  box-shadow: 0 10px 26px rgba(90, 70, 255, .35);
  color: #fff;
}
html[data-theme="glass"] .btn--primary:hover { color: #fff; filter: brightness(1.06); }
html[data-theme="glass"] .btn--danger {
  background: rgba(255, 122, 138, .16);
  color: #ffb3bd;
  border-color: rgba(255, 122, 138, .40);
  box-shadow: none;
}
html[data-theme="glass"] .chip {
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .16);
  color: var(--ink-2);
}
html[data-theme="glass"] .chip--ok { background: rgba(88, 224, 165, .14); border-color: rgba(88, 224, 165, .35); color: #9ff0cb; }
html[data-theme="glass"] .chip--warn { background: rgba(255, 196, 92, .12); border-color: rgba(255, 196, 92, .32); color: #ffd79a; }

html[data-theme="glass"] input[type="text"],
html[data-theme="glass"] input[type="email"],
html[data-theme="glass"] input[type="password"],
html[data-theme="glass"] input[type="url"],
html[data-theme="glass"] input[type="number"],
html[data-theme="glass"] input[type="search"],
html[data-theme="glass"] textarea,
html[data-theme="glass"] select {
  background: rgba(4, 8, 20, .45);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 10px;
  color: var(--ink);
}
html[data-theme="glass"] input:focus,
html[data-theme="glass"] textarea:focus,
html[data-theme="glass"] select:focus {
  border-color: rgba(147, 130, 255, .75);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, .20);
  outline: none;
}
html[data-theme="glass"] code { background: rgba(255, 255, 255, .08); color: #dbe3ff; }
html[data-theme="glass"] pre,
html[data-theme="glass"] .codeblock {
  background: rgba(2, 5, 14, .55);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
}
html[data-theme="glass"] .flash {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .08);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .22);
}
html[data-theme="glass"] .licensebar,
html[data-theme="glass"] .impersonate {
  border-radius: 14px;
  border: 1px solid rgba(255, 196, 92, .35);
  background: rgba(255, 196, 92, .12);
  backdrop-filter: blur(16px);
}
html[data-theme="glass"] hr { border-top-color: rgba(255, 255, 255, .12); }
html[data-theme="glass"] ::selection { background: rgba(124, 92, 255, .65); color: #fff; }

@media (max-width: 926px) {
  html[data-theme="glass"] .app { padding: 12px; gap: 12px; }
  html[data-theme="glass"] .rail {
    position: static;
    width: 100%;
    flex: none;
    height: auto;
    border-radius: 18px;
  }
  html[data-theme="glass"] .main { gap: 12px; }
  html[data-theme="glass"] .page { padding: 4px 0 28px; }
  html[data-theme="glass"] .topbar { top: 0; }
}

/* --- Aurora Glass, reference pass ---------------------------------------
   Bright blue glass, window controls, profile, search, icon rows and a
   collapsible rail. Only the glass theme shows these extras.
   ---------------------------------------------------------------------- */
.rail-lights, .rail-profile, .rail-search, .navicon { display: none; }

html[data-theme="glass"] {
  --paper: #04164a;
  --paper-2: rgba(7, 32, 96, .55);
  --panel: rgba(10, 40, 120, .34);
  --panel-2: rgba(7, 28, 88, .46);
  --ink: #f4f8ff;
  --ink-2: #c6d8ff;
  --muted: #91acec;
  --line: rgba(160, 200, 255, .24);
  --line-2: rgba(160, 200, 255, .13);
  --accent-soft: rgba(60, 130, 255, .25);
}

html[data-theme="glass"] body {
  background:
    radial-gradient(120% 90% at 14% -4%, #2a78ff 0%, rgba(42, 120, 255, 0) 55%),
    radial-gradient(90% 80% at 92% 6%, #00c8ff 0%, rgba(0, 200, 255, 0) 48%),
    radial-gradient(110% 100% at 50% 112%, #001a5c 0%, rgba(0, 26, 92, 0) 62%),
    linear-gradient(160deg, #0a3ac2 0%, #0757e8 46%, #041a63 100%);
  background-attachment: fixed;
}
html[data-theme="glass"] body::after {
  content: "";
  position: fixed;
  inset: -15%;
  z-index: 0;
  pointer-events: none;
  opacity: .42;
  background:
    repeating-radial-gradient(ellipse 60% 45% at 20% 30%, transparent 0 38px, rgba(140, 220, 255, .20) 40px 44px, transparent 46px 82px),
    repeating-radial-gradient(ellipse 55% 40% at 85% 72%, transparent 0 46px, rgba(170, 230, 255, .13) 48px 52px, transparent 54px 98px);
  filter: blur(4px);
  transform: rotate(-9deg) scale(1.08);
}
html[data-theme="glass"] .app { position: relative; z-index: 1; }

html[data-theme="glass"] .rail {
  width: 272px;
  flex: 0 0 272px;
  padding: 14px 12px 12px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(4, 20, 64, .94), rgba(10, 44, 140, .80));
  border-color: rgba(170, 210, 255, .22);
  box-shadow: 0 30px 70px rgba(0, 12, 50, .55), inset 0 1px 0 rgba(255, 255, 255, .16);
}
html[data-theme="glass"] .brand { display: none; }

html[data-theme="glass"] .rail-lights {
  display: flex;
  gap: 7px;
  padding: 2px 6px 14px;
}
html[data-theme="glass"] .rail-lights span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18);
}
html[data-theme="glass"] .rail-lights span:nth-child(1) { background: #ff5f57; }
html[data-theme="glass"] .rail-lights span:nth-child(2) { background: #febc2e; }
html[data-theme="glass"] .rail-lights span:nth-child(3) { background: #28c840; }

html[data-theme="glass"] .rail-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px 16px;
  border-bottom: 1px solid rgba(160, 200, 255, .16);
}
html[data-theme="glass"] .rail-profile__avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #7fb4ff, #1e5bff 65%, #0b2fa8);
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  box-shadow: 0 0 0 2px rgba(160, 210, 255, .45), 0 6px 18px rgba(0, 30, 120, .55);
}
html[data-theme="glass"] .rail-profile__text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
html[data-theme="glass"] .rail-profile__hi { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: #9fbcf7; }
html[data-theme="glass"] .rail-profile__text strong { font-size: 19px; font-weight: 600; letter-spacing: -.01em; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html[data-theme="glass"] .rail-profile__collapse {
  margin-left: auto;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(170, 210, 255, .30);
  border-radius: 8px;
  background: rgba(255, 255, 255, .07);
  color: #dbe7ff;
  cursor: pointer;
}
html[data-theme="glass"] .rail-profile__collapse svg { width: 14px; height: 14px; }
html[data-theme="glass"] .rail-profile__collapse:hover { background: rgba(255, 255, 255, .16); }

html[data-theme="glass"] .rail-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 4px 16px;
  padding: 8px 10px;
  border: 1px solid rgba(160, 200, 255, .20);
  border-radius: 11px;
  background: rgba(2, 14, 48, .46);
}
html[data-theme="glass"] .rail-search svg { width: 16px; height: 16px; flex: 0 0 16px; color: #a9c2f5; }
html[data-theme="glass"] .rail-search input {
  flex: 1;
  min-width: 0;
  border: 0 !important;
  background: transparent !important;
  padding: 0;
  color: #fff;
  font-size: 13px;
  box-shadow: none !important;
}
html[data-theme="glass"] .rail-search input::placeholder { color: #8ca7df; }
html[data-theme="glass"] .rail-search kbd {
  font-family: var(--font-mono);
  font-size: 9px;
  color: #b9ccf7;
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 5px;
  padding: 2px 5px;
}

html[data-theme="glass"] .railnav {
  border-top: 0;
  padding-top: 0;
  gap: 3px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(160, 200, 255, .30) transparent;
}
html[data-theme="glass"] .rail__spacer { display: none; }
html[data-theme="glass"] .railnav__label {
  padding: 14px 10px 5px;
  color: #8fa9e2;
  font-size: 8.5px;
  letter-spacing: .2em;
}
html[data-theme="glass"] .railnav__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #d9e5ff;
  font-size: 13.5px;
  font-weight: 500;
}
html[data-theme="glass"] .railnav__item:hover {
  background: rgba(255, 255, 255, .10);
  border-color: rgba(170, 210, 255, .16);
  color: #fff;
}
html[data-theme="glass"] .railnav__item.is-active {
  background: linear-gradient(90deg, #1668ff, #2f7dff);
  border-color: rgba(180, 215, 255, .40);
  color: #fff;
  box-shadow: 0 10px 26px rgba(0, 70, 230, .48), inset 3px 0 0 #ffffff, inset 0 1px 0 rgba(255, 255, 255, .30);
}
html[data-theme="glass"] .navicon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  color: currentColor;
  opacity: .92;
}
html[data-theme="glass"] .navicon svg { width: 19px; height: 19px; }
html[data-theme="glass"] .railnav__num { display: none; }
html[data-theme="glass"] .railnav__text { flex: 1; }
html[data-theme="glass"] .railnav__badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ff4d4f;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(255, 40, 40, .45);
}
html[data-theme="glass"] .railnav__badge--count { background: rgba(255, 255, 255, .16); color: #eaf2ff; box-shadow: none; }

html[data-theme="glass"] .rail__foot {
  margin: 12px 0 0;
  padding: 10px 4px 0;
  border-top: 1px solid rgba(160, 200, 255, .16);
  justify-content: space-between;
}
html[data-theme="glass"] .rail__foot .who { display: none; }
html[data-theme="glass"] .rail__meta { display: none; }

html[data-theme="glass"] .btn--primary {
  background: linear-gradient(90deg, #1668ff, #2f8dff);
  box-shadow: 0 10px 24px rgba(0, 80, 240, .40);
}
html[data-theme="glass"] .topbar { border-color: rgba(170, 210, 255, .20); background: rgba(8, 32, 98, .40); }
html[data-theme="glass"] .panel {
  background: linear-gradient(160deg, rgba(16, 48, 132, .46), rgba(8, 26, 82, .40));
  border-color: rgba(170, 210, 255, .20);
}
html[data-theme="glass"] .panel--quiet { background: rgba(8, 30, 92, .34); }

/* collapsed rail */
html[data-theme="glass"].is-rail-collapsed .rail {
  width: 92px;
  flex: 0 0 92px;
  padding: 14px 8px 12px;
}
html[data-theme="glass"].is-rail-collapsed .rail-lights,
html[data-theme="glass"].is-rail-collapsed .rail-search,
html[data-theme="glass"].is-rail-collapsed .rail-profile__text,
html[data-theme="glass"].is-rail-collapsed .railnav__label,
html[data-theme="glass"].is-rail-collapsed .railnav__text { display: none; }
html[data-theme="glass"].is-rail-collapsed .rail-profile__collapse {
  position: absolute;
  top: 12px;
  right: 8px;
  margin: 0;
  width: 22px;
  height: 22px;
  transform: rotate(180deg);
}
html[data-theme="glass"].is-rail-collapsed .rail-profile { justify-content: center; padding: 4px 0 14px; }
html[data-theme="glass"].is-rail-collapsed .rail-profile__avatar { width: 38px; height: 38px; flex-basis: 38px; }
html[data-theme="glass"].is-rail-collapsed .railnav { margin-top: 12px; }
html[data-theme="glass"].is-rail-collapsed .railnav__item { justify-content: center; padding: 12px 0; }
html[data-theme="glass"].is-rail-collapsed .railnav__badge {
  position: absolute;
  top: 3px;
  right: 5px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  font-size: 8px;
}
html[data-theme="glass"].is-rail-collapsed .rail__foot { flex-direction: column; gap: 8px; align-items: center; }
html[data-theme="glass"].is-rail-collapsed .rail__foot .iconbtn { width: 32px; height: 32px; }

/* glass scrollbars */
html[data-theme="glass"] .railnav { scrollbar-width: none; }
html[data-theme="glass"] .railnav::-webkit-scrollbar { width: 0; height: 0; }

/* glass on narrow screens: icon rail in a single row */
@media (max-width: 926px) {
  html[data-theme="glass"] .app { padding: 10px; gap: 12px; }
  html[data-theme="glass"] .rail {
    position: sticky;
    top: 8px;
    width: 100%;
    flex: none;
    height: auto;
    padding: 8px 10px;
    border-radius: 16px;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    overflow: hidden;
  }
  html[data-theme="glass"] .rail-lights,
  html[data-theme="glass"] .rail-search,
  html[data-theme="glass"] .rail-profile__text,
  html[data-theme="glass"] .rail-profile__collapse,
  html[data-theme="glass"] .railnav__label,
  html[data-theme="glass"] .railnav__text { display: none; }
  html[data-theme="glass"] .rail-profile { padding: 0; border: 0; gap: 0; flex: 0 0 auto; }
  html[data-theme="glass"] .rail-profile__avatar { width: 34px; height: 34px; flex-basis: 34px; font-size: 14px; }
  html[data-theme="glass"] .railnav {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    flex: 1 1 auto;
    gap: 2px;
    min-width: 0;
    margin: 0;
    padding: 0;
  }
  html[data-theme="glass"] .railnav__item {
    flex: 0 0 auto;
    padding: 9px;
    border-radius: 9px;
  }
  html[data-theme="glass"] .railnav__item.is-active { box-shadow: 0 6px 16px rgba(0, 70, 230, .45), inset 0 1px 0 rgba(255, 255, 255, .30); }
  html[data-theme="glass"] .railnav__badge {
    position: absolute;
    top: 1px;
    right: 1px;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    font-size: 8px;
  }
  html[data-theme="glass"] .rail__foot {
    flex-direction: row;
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
    border: 0;
    gap: 4px;
  }
  html[data-theme="glass"] .rail__foot .iconbtn { width: 30px; height: 30px; }
  html[data-theme="glass"] .page { padding: 2px 0 24px; }
  html[data-theme="glass"] .topbar { position: static; }
}
