/* Astral control panel. Colours come from the logo: black sky, violet nebula, chrome. */
:root {
  --void: #07050c;
  --bg: #0c0916;
  --surface: #120e20;
  --surface-2: #1a1430;
  --line: #2a2146;
  --line-soft: #221b3a;
  --text: #ece8f7;
  --muted: #a49bbf;
  --accent: #9b5cf6;
  --accent-strong: #7c3aed;
  --lilac: #cdb8ff;
  --ok: #57d68d;
  --warn: #f5a623;
  --danger: #ff5d73;
  --chrome: linear-gradient(180deg, #ffffff 0%, #ece7fb 36%, #ab9bd0 53%, #fbf9ff 61%, #bcaae6 100%);
  --serif: Cinzel, "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 12px;
}

* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: #3b2d66 transparent; }
html { color-scheme: dark; }
body {
  margin: 0; color: var(--text); font: 14.5px/1.5 var(--sans);
  /* A faint sky behind every page. */
  background:
    radial-gradient(1px 1px at 22% 14%, #ffffff73 50%, transparent 51%),
    radial-gradient(1px 1px at 78% 8%, #cdb8ff80 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 91% 46%, #ffffff59 50%, transparent 51%),
    radial-gradient(1px 1px at 54% 72%, #cdb8ff59 50%, transparent 51%),
    radial-gradient(1px 1px at 39% 38%, #ffffff40 50%, transparent 51%),
    radial-gradient(900px 460px at 88% -140px, #5b21b63d, transparent 70%),
    var(--void);
  background-attachment: fixed;
}
a { color: var(--lilac); }
img { max-width: 100%; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.boot { padding: 40px; text-align: center; color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.chrome {
  font-family: var(--serif); font-weight: 700; letter-spacing: .015em; line-height: 1.15;
  background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 12px #9b5cf655);
}

/* ---------------------------------------------------------------- sign in */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; }
.login canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.login::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(640px 420px at 50% 28%, #5b21b655, transparent 70%),
              radial-gradient(900px 400px at 50% 110%, #4c1d9544, transparent 70%);
}
.login-card {
  position: relative; width: min(380px, 100%); text-align: center; padding: 34px 30px 30px;
  background: #100b1ee0; border: 1px solid var(--line); border-radius: 18px; backdrop-filter: blur(10px);
}
.login-card img { width: 132px; height: 132px; border-radius: 50%; box-shadow: 0 0 54px -6px #9b5cf6aa; }
.login-card h1 { font-size: 27px; margin: 18px 0 4px; }
.login-card form { display: grid; gap: 12px; margin-top: 22px; text-align: left; }
.error-text { color: var(--danger); min-height: 1.4em; }

/* ---------------------------------------------------------------- shell */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 16px 10px 24px;
  background: linear-gradient(180deg, #100b20, #090713); border-right: 1px solid var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 6px; text-decoration: none; color: inherit; }
.brand img { width: 44px; height: 44px; border-radius: 50%; box-shadow: 0 0 20px -4px #9b5cf6aa; }
.brand span { font-size: 17px; }
.nav-group { color: var(--muted); font-size: 12px; margin: 16px 10px 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.nav a:hover { background: #ffffff0a; }
.nav a[aria-current="page"] { background: linear-gradient(90deg, #9b5cf640, #9b5cf60d); box-shadow: inset 3px 0 0 var(--accent); }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav a:hover .icon, .nav a[aria-current="page"] .icon { stroke: var(--lilac); }
.top.compact { justify-content: flex-end; margin-bottom: 10px; }
.top.compact .top-title { display: none; }
.sidebar .menu-toggle { display: none; }
main { min-width: 0; padding: 22px 28px 110px; max-width: 1280px; width: 100%; }
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.top h1 { font-size: 30px; }
.top p { color: var(--muted); margin-top: 2px; max-width: 70ch; }
.top-side { display: flex; align-items: center; gap: 10px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; }
.pill img { width: 20px; height: 20px; border-radius: 50%; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot.warn { background: var(--warn); }
.banner-note { border: 1px solid #f5a62366; background: #f5a62312; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; }

/* ---------------------------------------------------------------- layout */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 440px); gap: 20px; align-items: start; }
.preview-col { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
.preview-col > h2 { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.panel { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.panel h2 { font-family: var(--serif); font-size: 18px; font-weight: 700; }
.panel > .hint { color: var(--muted); margin-top: 2px; max-width: 75ch; }
.panel-body { margin-top: 8px; }
.field { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 6px 18px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.panel-body > .field:first-child { border-top: 0; }
.field > .label { padding-top: 8px; }
.field > .label span { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.4; margin-top: 2px; }
.field.stack { grid-template-columns: 1fr; }
.field.stack > .label { padding-top: 0; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline > .grow { flex: 1; min-width: 160px; }
.inline > select { width: auto; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }

/* ---------------------------------------------------------------- controls */
input[type="text"], input[type="password"], input[type="number"], input[type="url"], input[type="search"], textarea, select {
  width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 11px; font: inherit;
}
input:hover, textarea:hover, select:hover { border-color: #43346c; }
textarea { resize: vertical; min-height: 76px; }
input[type="number"] { max-width: 140px; }
input.short { max-width: 190px; }
input[type="color"] { width: 46px; height: 38px; padding: 2px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.suffix { color: var(--muted); }
.counter { text-align: right; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.counter.over { color: var(--danger); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 8px;
  padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; color: #fff; text-decoration: none; white-space: nowrap;
  background: linear-gradient(180deg, #9d63f7, #7435de);
}
.btn:hover { filter: brightness(1.1); }
.btn:disabled { opacity: .5; cursor: default; filter: none; }
.btn.secondary { background: var(--surface-2); border-color: var(--line); color: var(--text); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--lilac); padding: 6px 8px; }
.btn.danger { background: #8e2336; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.icon { padding: 4px 9px; min-width: 32px; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; padding: 6px 0; }
.switch input { appearance: none; width: 40px; height: 22px; border-radius: 999px; background: #332a52; position: relative; cursor: pointer; margin: 0; flex: none; transition: background .15s; }
.switch input::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: transform .15s; }
.field .switch { margin-right: 18px; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(18px); }
@media (prefers-reduced-motion: reduce) { .switch input, .switch input::after { transition: none; } }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; }
.chip i { width: 9px; height: 9px; border-radius: 50%; background: #99aab5; }
.chip button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 4px; }
.chip button:hover { color: var(--danger); }
.chip.bad { border-color: #ff5d7388; }
.warning-line { color: var(--warn); font-size: 12.5px; margin-top: 4px; }

.icon-grid { display: flex; flex-wrap: wrap; gap: 4px; }
.icon-grid button { width: 36px; height: 36px; padding: 5px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.icon-grid button[aria-pressed="true"] { border-color: var(--accent); background: #9b5cf630; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font: inherit; font-weight: 600; padding: 9px 14px; cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }

.item { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; background: var(--bg); }
.item > header { display: flex; align-items: center; gap: 8px; padding: 8px 10px; }
.item > header .toggle-open { flex: 1; display: flex; align-items: center; gap: 10px; background: none; border: 0; color: var(--text); font: inherit; font-weight: 600; text-align: left; cursor: pointer; padding: 4px; min-width: 0; }
.item > header .toggle-open img { width: 22px; height: 22px; }
.item > header .toggle-open small { color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item > header .caret { color: var(--muted); width: 12px; }
.item > .item-body { padding: 4px 14px 12px; border-top: 1px solid var(--line-soft); }
.item.off > header .toggle-open { opacity: .55; }

/* ---------------------------------------------------------------- data */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 13px 16px; }
.tile .name { color: var(--muted); font-size: 13px; }
.tile .value { font-size: 30px; font-weight: 600; line-height: 1.2; margin-top: 2px; }
.tile .note { color: var(--muted); font-size: 12px; }

.checklist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 0 22px; }
.checklist li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line-soft); }
.checklist li span:nth-child(2) { flex: 1; }
.check { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #4a3d73; display: grid; place-items: center; font-size: 12px; flex: none; }
.checklist li.done .check { background: var(--ok); border-color: var(--ok); color: #062915; font-weight: 800; }
.checklist li.done span:nth-child(2) { color: var(--muted); }
.progress { height: 6px; border-radius: 3px; background: var(--surface-2); margin-top: 10px; overflow: hidden; }
.progress div { height: 100%; background: linear-gradient(90deg, var(--accent-strong), var(--lilac)); }

.table-wrap { overflow-x: auto; margin-top: 6px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
td.actions { text-align: right; white-space: nowrap; }
td.wrap { max-width: 360px; overflow-wrap: anywhere; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.tag.open { border-color: #57d68d88; color: var(--ok); }
.tag.closed { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 26px 10px; }
.feed { list-style: none; margin: 8px 0 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 92px 120px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-top: 1px solid var(--line-soft); font-size: 13.5px; }
.feed li span:last-child { overflow-wrap: anywhere; }
.person { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line-soft); color: var(--text); font: inherit; padding: 9px 6px; cursor: pointer; }
.person:hover, .person[aria-pressed="true"] { background: #9b5cf61c; }
.person img { width: 36px; height: 36px; border-radius: 50%; }
.person div { flex: 1; min-width: 0; }

/* ---------------------------------------------------------------- overview */
.hero {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px; overflow: hidden;
  min-height: 196px; padding: 26px 30px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface) url("/art/sky.webp") center / cover no-repeat;
}
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #07050cf0 0%, #07050cb0 45%, #07050c20 100%); }
.hero-text { position: relative; min-width: 0; }
.hero h1 { font-size: clamp(28px, 3.4vw, 42px); }
.hero-status, .hero-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-status { margin: 10px 0 18px; }
.hero-status .pill { background: #0c0916b8; backdrop-filter: blur(6px); }
.hero-actions .btn.secondary { background: #150f28cc; }
.hero-crest { position: relative; flex: none; width: 158px; height: 158px; margin-right: 26px; display: grid; place-items: center; }
.hero-crest img { width: 136px; height: 136px; border-radius: 50%; box-shadow: 0 0 46px -4px var(--accent); }
.hero-crest::after { content: ""; position: absolute; left: -30px; right: -30px; top: 50px; bottom: 50px; border: 1px solid #ece9f5b0; border-radius: 50%; transform: rotate(-16deg); box-shadow: 0 0 14px #9b5cf6aa; pointer-events: none; }

a.tile { display: block; color: inherit; text-decoration: none; transition: border-color .15s, background .15s; }
a.tile:hover { border-color: #6d4bb8; background: var(--surface-2); }
.tile .name { display: flex; align-items: center; gap: 8px; }
.tile .name img { width: 18px; height: 18px; }

.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.chart { margin-bottom: 8px; }
.chart-total { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.chart-total strong { font-size: 28px; font-weight: 600; line-height: 1.2; }
.chart-total span, .chart-peak, .axis { color: var(--muted); font-size: 12px; }
.chart-peak { text-align: right; margin-top: 6px; border-bottom: 1px dashed var(--line-soft); padding-bottom: 2px; }
.bars { display: flex; align-items: stretch; gap: 2px; height: 104px; border-bottom: 1px solid #4a3d73; }
.bar-slot { position: relative; flex: 1; display: flex; align-items: flex-end; justify-content: center; border-radius: 4px 4px 0 0; }
.bar-slot:hover, .bar-slot:focus-visible { background: #ffffff0d; }
.bar { width: 100%; max-width: 24px; border-radius: 4px 4px 0 0; background: var(--accent); }
.bar-slot:hover .bar, .bar-slot:focus-visible .bar { background: var(--lilac); }
.bar-tip { display: none; position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 6; padding: 6px 10px; border-radius: 8px; background: #221a3f; border: 1px solid #6d4bb8; white-space: nowrap; font-size: 12.5px; pointer-events: none; }
.bar-tip.left { left: auto; right: 0; }
.bar-tip span { display: block; color: var(--muted); }
.bar-slot:hover .bar-tip, .bar-slot:focus-visible .bar-tip { display: block; }
.bars:hover .bar-slot:not(:hover) .bar-tip { display: none; }
.axis { display: flex; justify-content: space-between; margin-top: 4px; }
.numbers { margin: 0 0 14px; }
.numbers summary { cursor: pointer; color: var(--lilac); font-size: 13px; width: fit-content; }
.numbers .table-wrap { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); }

.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; align-items: start; }
.rows { list-style: none; margin: 8px 0; padding: 0; }
.rows li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line-soft); }
.rows li > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.mark { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--accent); }
.mark.members, .mark.verification { background: var(--ok); }
.mark.moderation { background: var(--danger); }
.mark.roles, .mark.server, .mark.profiles { background: var(--warn); }
.mark.messages, .mark.voice { background: #5aa9ff; }

/* ---------------------------------------------------------------- Discord preview */
.discord { background: #1a1a1e; border-radius: 12px; padding: 14px; color: #dbdee1; font-size: 14px; border: 1px solid #2b2b31; }
.d-msg { display: flex; gap: 12px; }
.d-msg > img { width: 38px; height: 38px; border-radius: 50%; flex: none; }
.d-msg > div { min-width: 0; flex: 1; }
.d-who { display: flex; align-items: center; gap: 6px; font-weight: 600; color: #fff; margin-bottom: 4px; }
.d-app { font-size: 10.5px; background: #5865f2; border-radius: 4px; padding: 0 5px; line-height: 16px; }
.d-container { background: #242429; border: 1px solid #34343b; border-left: 4px solid var(--d-accent, var(--accent)); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 9px; margin-top: 4px; }
.d-embed { background: #242429; border-left: 4px solid var(--d-accent, var(--accent)); border-radius: 6px; padding: 10px 12px; display: flex; gap: 12px; margin-top: 4px; }
.d-embed > .d-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.d-container img.d-banner, .d-embed img.d-banner { width: 100%; border-radius: 8px; display: block; }
.d-thumb { width: 66px; height: 66px; border-radius: 8px; object-fit: cover; flex: none; }
.d-author { display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: 13px; }
.d-author img { width: 22px; height: 22px; border-radius: 50%; }
.d-title { font-weight: 700; }
.d-fields { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.d-fields > div { flex: 1 1 100%; } .d-fields > div.inline-field { flex: 1 1 110px; }
.d-footer { font-size: 12px; color: #9b9ca3; }
.d-sep { border-top: 1px solid #3a3a42; }
.d-section { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.d-section > div { min-width: 0; }
.d-section > :last-child:not(:first-child) { flex: none; }
.d-row { display: flex; flex-wrap: wrap; gap: 8px; }
.d-btn { display: inline-flex; align-items: center; gap: 6px; border-radius: 8px; background: #3a3a42; color: #fff; padding: 5px 13px; font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.d-btn.primary { background: #5865f2; } .d-btn.success { background: #00863a; } .d-btn.danger { background: #d22d39; }
.d-btn img { width: 17px; height: 17px; }
.d-select { border: 1px solid #3a3a42; background: #1f1f23; border-radius: 8px; padding: 8px 12px; color: #9b9ca3; width: 100%; }
.md { overflow-wrap: anywhere; }
.md div { white-space: pre-wrap; min-height: 1.35em; }
.md .h1 { font-size: 21px; font-weight: 700; } .md .h2 { font-size: 18px; font-weight: 700; } .md .h3 { font-size: 15.5px; font-weight: 700; }
.md .sub { font-size: 12px; color: #9b9ca3; }
.md .quote { border-left: 4px solid #4e5058; padding-left: 10px; }
.md code { background: #111114; border-radius: 4px; padding: 0 4px; font-family: Consolas, monospace; font-size: .9em; }
.md pre { background: #111114; border-radius: 6px; padding: 8px 10px; margin: 4px 0; white-space: pre-wrap; font-family: Consolas, monospace; font-size: 13px; }
.md .mention { background: #5865f24d; border-radius: 3px; padding: 0 2px; color: #c9cdfb; }
.md img.emoji { width: 1.3em; height: 1.3em; vertical-align: -.28em; }
.art { width: 100%; border-radius: 10px; display: block; background: var(--surface-2); min-height: 60px; }

/* ---------------------------------------------------------------- overlays */
.savebar {
  position: fixed; left: calc(236px + 28px); right: 28px; bottom: 16px; max-width: 760px; margin: 0 auto; z-index: 20;
  display: flex; align-items: center; gap: 12px; padding: 11px 14px 11px 18px; border-radius: 12px;
  background: #1e1638f2; border: 1px solid #6d4bb8; box-shadow: 0 12px 40px #000a;
}
.savebar span { flex: 1; font-weight: 600; }
.toasts { position: fixed; right: 18px; top: 16px; z-index: 40; display: grid; gap: 8px; width: min(380px, calc(100vw - 36px)); }
.toast { padding: 11px 14px; border-radius: 10px; background: #1c1533; border: 1px solid var(--line); box-shadow: 0 10px 30px #0009; overflow-wrap: anywhere; }
.toast.ok { border-color: #57d68d99; } .toast.error { border-color: #ff5d73; } .toast.warn { border-color: var(--warn); }
.toast a { margin-left: 6px; }
dialog { background: var(--surface); color: var(--text); border: 1px solid #5a4296; border-radius: 14px; padding: 20px 22px; width: min(440px, calc(100vw - 32px)); }
dialog::backdrop { background: #04020acc; }
dialog h2 { font-family: var(--serif); font-size: 19px; margin-bottom: 8px; }
dialog .inline { justify-content: flex-end; margin-top: 18px; }
dialog input, dialog textarea { margin-top: 10px; }

/* ---------------------------------------------------------------- small screens */
@media (max-width: 1100px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .preview-col { position: static; max-height: none; }
}
@media (max-width: 820px) {
  .app { display: block; }
  .sidebar { position: sticky; top: 0; z-index: 30; height: auto; max-height: 100vh; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-head { display: flex; justify-content: space-between; align-items: center; }
  .sidebar .menu-toggle { display: inline-flex; }
  .nav { display: none; }
  .sidebar.open .nav { display: block; }
  main { padding: 16px 14px 120px; }
  .field { grid-template-columns: 1fr; }
  .field > .label { padding-top: 0; }
  .savebar { left: 12px; right: 12px; bottom: 10px; flex-wrap: wrap; }
  .feed li { grid-template-columns: 84px minmax(0, 1fr); }
  .feed li span:nth-child(2) { display: none; }
  .top h1 { font-size: 25px; }
  .hero { padding: 20px 18px; }
  .hero-crest { display: none; }
  .columns { grid-template-columns: minmax(0, 1fr); }
}
