:root {
  color-scheme: dark;
  --bg: #0d0f12;
  --bg-raised: #12151a;
  --surface: #161a20;
  --surface-2: #1c2128;
  --surface-3: #232933;
  --border: #262c36;
  --border-strong: #343b48;
  --text: #e8eaef;
  --muted: #959cab;
  --faint: #687082;
  --accent: #5bd17d;
  --accent-hover: #74dc92;
  --accent-ink: #052611;
  --accent-soft: rgba(91, 209, 125, 0.12);
  --warn: #f4c25b;
  --warn-soft: rgba(244, 194, 91, 0.12);
  --danger: #f06a6a;
  --danger-hover: #f48585;
  --danger-soft: rgba(240, 106, 106, 0.12);
  --info: #6aa8ff;
  --info-soft: rgba(106, 168, 255, 0.12);
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "Cascadia Mono", "SF Mono", Consolas, monospace;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--sans);
  display: flex;
  flex-direction: column;
}

main { flex: 1; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
code, kbd, .mono { font-family: var(--mono); font-size: 0.92em; }
code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 0.05em 0.4em; }
kbd { font-size: 0.75em; opacity: 0.7; margin-left: 0.4em; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.offscreen { position: fixed; left: -9999px; top: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------------------------------------------------------------- top bar */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--border);
  background: rgba(13, 15, 18, 0.85);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 17px; }
.brand:hover { text-decoration: none; }
.brand-wrap { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.brand-sponsor { padding-left: 36px; font-size: 12px; color: var(--faint); white-space: nowrap; }
.brand-sponsor b { color: var(--muted); font-weight: 600; }
.brand-sponsor:hover { text-decoration: none; }
.brand-sponsor:hover b { color: var(--accent); }
.topnav { display: flex; align-items: center; gap: 20px; }
.topnav a:not(.btn) { color: var(--muted); font-size: 14px; }
.topnav a:not(.btn):hover { color: var(--text); text-decoration: none; }

/* ---------------------------------------------------------------- buttons and inputs */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  font: 600 14px/1 var(--sans);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #2a0606; }
.btn-danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); }
.btn-danger-ghost { background: transparent; border-color: rgba(240, 106, 106, 0.45); color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { min-height: 52px; padding: 0 28px; font-size: 16px; border-radius: 12px; }
.btn.busy { cursor: progress; }
.btn.busy::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.input {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-raised);
  color: var(--text);
  font: 14px var(--sans);
}
.input.mono { font-family: var(--mono); font-size: 13px; }
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.input:disabled { opacity: 0.5; }
select.input { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }

.inline-form { display: flex; gap: 10px; flex-wrap: wrap; }
.inline-form .input { flex: 1 1 220px; width: auto; }

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  max-width: 1160px;
  margin: 0 auto;
  padding: clamp(40px, 8vw, 96px) clamp(16px, 4vw, 40px) clamp(40px, 6vw, 72px);
  position: relative;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -40px 0 0;
  z-index: -1;
  background:
    radial-gradient(600px 300px at 20% 20%, rgba(91, 209, 125, 0.13), transparent 70%),
    linear-gradient(var(--border) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, var(--border) 1px, transparent 1px) 0 0 / 40px 40px;
  mask-image: radial-gradient(ellipse at 40% 30%, #000 20%, transparent 70%);
  opacity: 0.55;
}
.eyebrow { color: var(--accent); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 14px; }
.hero h1 { font-size: clamp(34px, 5.2vw, 56px); letter-spacing: -0.025em; margin-bottom: 18px; }
.lede { font-size: clamp(16px, 1.6vw, 18px); color: var(--muted); max-width: 34em; margin-bottom: 28px; }
.create-box { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.captcha:empty { display: none; }
.fine { color: var(--faint); font-size: 13px; margin: 0; }
.fine a { color: var(--muted); text-decoration: underline; }
.form-error { color: var(--danger); background: var(--danger-soft); border: 1px solid rgba(240, 106, 106, 0.3); border-radius: var(--radius-sm); padding: 8px 12px; margin: 0; font-size: 14px; }
.capacity { margin-top: 18px; font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.capacity::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.capacity.full::before { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }
.create-form { width: 100%; max-width: 540px; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.create-form > .field, .create-form > .setup { width: 100%; }
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
.field { display: grid; gap: 6px; }
.field-label { font-size: 14px; font-weight: 600; padding: 0; }
.field-label small { color: var(--faint); font-weight: 400; font-size: 12px; margin-left: 6px; }
.loc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.loc { position: relative; display: grid; gap: 2px; padding: 11px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.loc:hover { border-color: var(--muted); }
.loc input { position: absolute; opacity: 0; pointer-events: none; }
.loc:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.loc:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.loc.is-full { opacity: 0.5; cursor: not-allowed; }
.loc-name { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.loc-badge { font-size: 11px; font-weight: 700; color: var(--accent-ink); background: var(--accent); border-radius: 999px; padding: 1px 7px; }
.loc-meta { font-size: 13px; color: var(--muted); }
.setup { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); padding: 0; }
.setup summary { padding: 12px 14px; align-items: center; flex-wrap: wrap; gap: 4px 12px; }
.setup summary .field-label { flex: none; }
.setup-summary { flex: 1; font-size: 13px; color: var(--muted); font-weight: 400; }
.setup[open] summary { border-bottom: 1px solid var(--border); }
.setup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 14px; }
.setup-wide { grid-column: 1 / -1; }
.setup > .fine { padding: 0 14px 14px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.upsell { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.upsell a { font-weight: 600; }
.upsell a::after { content: " →"; }

.hero-art { display: flex; flex-direction: column; gap: 16px; }
.term { background: #090b0d; border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.term-bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; border-bottom: 1px solid var(--border); background: var(--surface); }
.term-bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-3); }
.term-bar b { margin-left: auto; font: 500 12px var(--mono); color: var(--faint); }
.term-body { padding: 16px 18px; font: 13px/1.75 var(--mono); color: #c9cdd6; overflow: hidden; }
.term-body p { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.term-body i { font-style: normal; }
.t-dim { color: var(--faint); }
.t-ok { color: var(--accent); }
.t-gold { color: var(--warn); }
.term-prompt { color: var(--accent); }
.caret { display: inline-block; width: 8px; height: 15px; vertical-align: -2px; background: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.spec-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.spec-chips span { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--muted); }

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px) 24px;
}
.tour { max-width: 1080px; margin: 0 auto; padding: 24px clamp(16px, 4vw, 40px) 40px; }
.tour-head { text-align: center; max-width: 620px; margin: 0 auto 22px; }
.tour-head h2 { font-size: clamp(22px, 3vw, 28px); margin-bottom: 8px; }
.tour-head p { margin: 0; }
.tour-video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #0d0f12; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.feature h3 { font-size: 16px; margin-bottom: 6px; }
.feature p { color: var(--muted); margin: 0; font-size: 14px; }

.section { max-width: 820px; margin: 0 auto; padding: 56px clamp(16px, 4vw, 40px) 8px; }
.section h2 { font-size: 26px; margin-bottom: 14px; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps li { counter-increment: step; display: flex; gap: 14px; align-items: baseline; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; color: var(--muted); }
.steps li::before { content: counter(step); flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px; }
.steps b, .rules b { color: var(--text); }
.rules { margin: 0; padding-left: 20px; color: var(--muted); display: grid; gap: 8px; }
details { border-bottom: 1px solid var(--border); padding: 14px 0; }
summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--muted); font-size: 18px; line-height: 1; }
details[open] summary::after { content: "−"; }
details p { color: var(--muted); margin: 10px 0 0; }
.restore { padding-bottom: 72px; }
.cta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.cta { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.cta h2 { font-size: 20px; margin: 0; }
.cta p { color: var(--muted); margin: 0; flex: 1; }
.cta-paid { border-color: var(--accent); background: linear-gradient(180deg, var(--accent-soft), var(--surface) 70%); }

.footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 22px clamp(16px, 4vw, 40px);
  border-top: 1px solid var(--border);
  color: var(--faint);
  font-size: 13px;
}
.footer a { color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }

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

.panel { width: 100%; max-width: 1160px; margin: 0 auto; padding: 24px clamp(16px, 3vw, 32px) 64px; display: flex; flex-direction: column; gap: 16px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 120px 0; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card h2 { font-size: 17px; margin-bottom: 6px; }
.card h2.card-subhead { margin-top: 22px; }
.card > .muted { font-size: 14px; }
.empty-card { max-width: 560px; margin: 64px auto; text-align: center; padding: 36px clamp(20px, 4vw, 40px); }
.empty-card h1 { font-size: 24px; }
.empty-card .inline-form { margin: 20px 0; }

.server-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.server-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.server-title h1 { font-size: 22px; margin: 0; overflow-wrap: anywhere; }
.loc-tag { padding: 4px 11px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 1px solid var(--border-strong); color: var(--muted); }
.address { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.address-label { color: var(--faint); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.address code { font-size: 15px; padding: 4px 10px; color: var(--text); }
.power { display: flex; gap: 8px; flex-wrap: wrap; }
.power .btn { min-width: 84px; }

.pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--surface-3); color: var(--muted); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill[data-state="running"] { background: var(--accent-soft); color: var(--accent); }
.pill[data-state="starting"],
.pill[data-state="stopping"] { background: var(--warn-soft); color: var(--warn); }
.pill[data-state="starting"]::before,
.pill[data-state="stopping"]::before,
.pill[data-state="installing"]::before { animation: pulse 1.2s ease-in-out infinite; }
.pill[data-state="installing"] { background: var(--info-soft); color: var(--info); }
@keyframes pulse { 50% { opacity: 0.3; } }

.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; border: 1px solid; }
.banner-info { background: var(--info-soft); border-color: rgba(106, 168, 255, 0.3); color: #c8dcff; }
.banner-danger { background: var(--danger-soft); border-color: rgba(240, 106, 106, 0.3); color: #ffd0d0; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat-label { color: var(--faint); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.stat-value { font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-note { color: var(--faint); font-size: 12px; }
.meter { height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width 0.4s ease; }
.meter.hot i { background: var(--warn); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font: 600 14px var(--sans); padding: 10px 14px; cursor: pointer; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }

/* ---------------------------------------------------------------- console */

.console-wrap { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.console-status { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.dot[data-kind="ok"] { background: var(--accent); }
.dot[data-kind="error"] { background: var(--danger); }
.console {
  height: min(62vh, 560px);
  min-height: 280px;
  overflow-y: auto;
  padding: 12px 16px;
  background: #090b0d;
  font: 13px/1.6 var(--mono);
  color: #cfd3db;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.line { min-height: 1.6em; }
.line-cmd { color: var(--accent); }
.line-error { color: var(--danger); }
.line-panel { color: var(--info); }
.line-install { color: var(--muted); }
.console-input { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-top: 1px solid var(--border); background: var(--bg-raised); }
.console-input .prompt { color: var(--accent); font-family: var(--mono); }
.console-input input { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--text); font: 14px var(--mono); padding: 8px 0; }
.console-input input:focus { outline: none; }
.console-input input:disabled { opacity: 0.5; }

/* ---------------------------------------------------------------- files */

.files-card { padding: 0; overflow: hidden; position: relative; }
.files-card.dragging::after { content: "Drop to upload here"; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(13, 15, 18, 0.85); border: 2px dashed var(--accent); border-radius: var(--radius); color: var(--accent); font-weight: 700; font-size: 16px; }
.files-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; font-family: var(--mono); font-size: 13px; min-width: 0; }
.crumb { background: none; border: 0; color: var(--text); font: inherit; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.crumb:hover { background: var(--surface-2); }
.crumb:last-child { color: var(--accent); }
.crumb-sep { color: var(--faint); }
.files-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.upload-progress { display: flex; flex-direction: column; gap: 4px; padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.file-list { min-height: 120px; transition: opacity 0.15s; }
.file-list.is-loading { opacity: 0.5; pointer-events: none; }
.file-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) 90px 140px 36px; align-items: center; gap: 12px; padding: 4px 10px 4px 16px; border-bottom: 1px solid var(--border); min-height: 44px; }
.file-row:hover { background: var(--bg-raised); }
.file-row.is-up { grid-template-columns: 22px minmax(0, 1fr); }
.file-icon { display: grid; place-items: center; color: var(--muted); }
.file-icon svg { width: 18px; height: 18px; fill: currentColor; }
.file-icon .fold { fill: none; stroke: var(--surface); stroke-width: 1.6; }
.file-icon .stroke { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.is-folder .file-icon { color: var(--warn); }
.is-archive .file-icon { color: var(--info); }
.file-name { background: none; border: 0; padding: 6px 0; color: var(--text); font: 14px var(--sans); text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-name:hover { color: var(--accent); }
.file-size, .file-date { color: var(--faint); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.file-size { text-align: right; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; fill: currentColor; }
.empty { color: var(--faint); text-align: center; padding: 36px 16px; margin: 0; }
.drop-hint { color: var(--faint); font-size: 12px; padding: 10px 16px; margin: 0; }

.menu { position: absolute; z-index: 50; min-width: 200px; padding: 6px; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.menu-item { background: none; border: 0; color: var(--text); text-align: left; font: 14px var(--sans); padding: 8px 12px; border-radius: 7px; cursor: pointer; }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-3); outline: none; }
.menu-item.danger { color: var(--danger); }

/* ---------------------------------------------------------------- settings */

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.settings-grid > .card:nth-child(2) { grid-row: span 3; }
.card-danger { border-color: rgba(240, 106, 106, 0.3); grid-column: 1 / -1; }
.danger-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 16px; align-items: center; margin: 0; }
.kv dt { color: var(--faint); font-size: 13px; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.props-form { display: flex; flex-direction: column; gap: 16px; }
.props-fields { display: grid; gap: 14px; }
.prop { display: grid; gap: 6px; }
.prop-label { font-size: 14px; font-weight: 600; }
.prop-label small { display: block; color: var(--faint); font-weight: 400; font-size: 12px; margin-top: 2px; }
.prop-bool { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-raised); cursor: pointer; }

/* ---------------------------------------------------------------- dialogs */

.modal { padding: 0; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); width: min(480px, calc(100vw - 32px)); box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(5, 6, 8, 0.7); backdrop-filter: blur(3px); }
.modal-body { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.modal-body h2 { font-size: 18px; margin: 0; }
.modal-body p { margin: 0; font-size: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.secret-row { display: flex; gap: 8px; }
.secret-row .input { flex: 1; min-width: 0; }

.modal-editor { width: min(1100px, calc(100vw - 32px)); height: min(820px, calc(100vh - 48px)); }
.modal-editor .modal-body { height: 100%; }
.editor-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.editor-head h2 { font-family: var(--mono); font-size: 14px; overflow-wrap: anywhere; }
.editor-head .muted { font-size: 13px; white-space: nowrap; }
#editor-text { flex: 1; width: 100%; resize: none; background: #090b0d; color: #dfe2e8; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; font: 13px/1.6 var(--mono); tab-size: 2; }
#editor-text:focus { outline: none; border-color: var(--border-strong); }

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { max-width: min(420px, calc(100vw - 32px)); padding: 11px 16px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--border-strong); box-shadow: var(--shadow); font-size: 14px; animation: toast-in 0.2s ease; transition: opacity 0.25s, transform 0.25s; }
.toast-success { border-color: rgba(91, 209, 125, 0.45); }
.toast-error { border-color: rgba(240, 106, 106, 0.55); color: #ffd6d6; }
.toast.leaving { opacity: 0; transform: translateY(6px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------------------------------------------------------------- small screens */

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .settings-grid > .card:nth-child(2) { grid-row: auto; }
}

@media (max-width: 600px) {
  .topnav a:not(.btn) { display: none; }
  .features { grid-template-columns: minmax(0, 1fr); }
  .btn-lg { width: 100%; }
  .create-form { align-items: stretch; }
  .setup-grid { grid-template-columns: minmax(0, 1fr); }
  .create-box { align-items: stretch; }
  .file-row { grid-template-columns: 22px minmax(0, 1fr) 36px; }
  .file-size, .file-date { display: none; }
  .server-head { flex-direction: column; align-items: stretch; }
  .power .btn { flex: 1; min-width: 0; }
  .console { height: 55vh; }
}

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