/* Protostar dashboard: deep field. Same palette as the homepage. */
:root {
  color-scheme: dark;
  --space: #05070C;
  --panel: #0B0F18;
  --field: #0E1320;
  --raised: #131A28;
  --line: rgba(166, 212, 255, 0.10);
  --line-soft: rgba(166, 212, 255, 0.06);
  --line-strong: rgba(166, 212, 255, 0.18);
  --text: #EEF3FB;
  --soft: #CBD3E2;
  --muted: #9AA4B8;
  --ice: #9AD1FF;
  --ice-ink: #04121F;
  --on: #63DBA6;
  --bad: #FF7A85;
  --display: "Michroma", "Eurostile", "Segoe UI", sans-serif;   /* titles only */
  --sans: "Work Sans", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--space); color: var(--text); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--ice); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ice); outline-offset: 2px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px;
  border-radius: 999px; border: 1px solid transparent; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s ease;
}
.btn-primary { background: var(--ice); color: var(--ice-ink); }
.btn-primary:hover { box-shadow: 0 8px 26px rgba(154, 209, 255, 0.28); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { background: rgba(154, 209, 255, 0.08); border-color: rgba(166, 212, 255, 0.34); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- landing, notices, server list ---------- */
body.plain { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.landing, .notice { max-width: 460px; text-align: center; }
.landing-logo { display: block; margin: 0 auto 18px; border-radius: 50%; box-shadow: 0 0 60px rgba(154, 209, 255, 0.18); }
.landing h1, .notice h1 { font: 400 26px/1.3 var(--display); margin-bottom: 14px; }
.landing p, .notice p { color: var(--muted); margin-bottom: 26px; }
.fine { font-size: 14px; color: var(--muted); margin-top: 22px; }
.login-form { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.keep { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--soft); cursor: pointer; }
.keep input { width: 18px; height: 18px; accent-color: var(--ice); cursor: pointer; }
.checks { list-style: none; padding: 0; margin: 0 0 24px; text-align: left; }
.checks li { padding: 12px 14px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); margin-bottom: 8px; }
.checks li strong { display: inline-block; min-width: 34px; }
.checks li.ok strong { color: var(--on); }
.checks li.bad strong { color: var(--bad); }
.checks li span { color: var(--muted); font-size: 14px; }

.servers { max-width: 720px; margin: 0 auto; padding: 44px 24px 80px; }
.servers h1 { font: 400 26px/1.3 var(--display); margin-bottom: 8px; }
.list-title { font-size: 14px; font-weight: 500; color: var(--muted); margin: 28px 0 6px; }
.server-list { list-style: none; margin: 0; padding: 0; }
.server-list li { display: flex; align-items: center; gap: 14px; min-height: 68px; border-bottom: 1px solid var(--line-soft); }
.server-icon { width: 44px; height: 44px; border-radius: 12px; overflow: hidden; flex: none; display: grid; place-items: center; background: #22304D; color: #CFE6FF; font-weight: 600; }
.server-icon img { width: 100%; height: 100%; object-fit: cover; }
.server-name { flex: 1; font-weight: 500; }
.empty-note { color: var(--muted); margin-top: 16px; }
.banner { margin-top: 18px; padding: 12px 16px; border-radius: 10px; background: rgba(255, 122, 133, 0.1); border: 1px solid rgba(255, 122, 133, 0.35); color: #FFD5D9; }

/* ---------- top bar ---------- */
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; min-height: 64px; padding: 10px 24px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 400 14px/1 var(--display); letter-spacing: 0.02em; }
.brand img { display: block; border-radius: 50%; }
.topbar-sep { width: 1px; height: 24px; background: var(--line-strong); }
.switcher { position: relative; }
.switcher summary {
  list-style: none; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px 0 6px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-weight: 500;
}
.switcher summary::-webkit-details-marker { display: none; }
.switcher summary:hover { border-color: var(--line-strong); }
.switcher summary img, .switcher-menu img, .guild-initial { width: 30px; height: 30px; border-radius: 8px; flex: none; }
.guild-initial { display: inline-grid; place-items: center; background: #22304D; color: #CFE6FF; font-weight: 600; font-size: 14px; }
.switcher summary svg { fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.switcher[open] summary svg { transform: rotate(180deg); }
.switcher-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher-menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 30; min-width: 260px; max-height: 60vh; overflow-y: auto; padding: 6px;
  border-radius: 12px; background: #111725; border: 1px solid var(--line-strong); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  animation: pop .16s ease-out;
}
.switcher-menu a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px; border-radius: 8px; color: var(--soft); text-decoration: none; }
.switcher-menu a:hover, .switcher-menu a[aria-current] { background: var(--raised); color: var(--text); }
.switcher-menu .switcher-all { justify-content: center; margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; color: var(--ice); }
.top-link { margin-left: auto; padding: 8px 10px; color: var(--muted); text-decoration: none; font-weight: 500; }
.top-link:hover { color: var(--text); }
.top-link + .who { margin-left: 4px; }
.top-link + .top-link { margin-left: 0; }
.top-donate { color: var(--ice); display: inline-flex; align-items: center; gap: 6px; }
.top-donate svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.top-donate:hover { color: var(--text); }
.guide-link { display: inline-block; margin-top: 10px; font-size: 14px; color: var(--ice); }
.who { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--soft); }
.who img { width: 30px; height: 30px; border-radius: 50%; }
.who-out { color: var(--muted); font-size: 14px; margin-left: 6px; }
.who-out:hover { color: var(--text); }

/* ---------- layout ---------- */
.layout { display: flex; align-items: flex-start; }
.side { flex: 0 0 248px; position: sticky; top: 0; align-self: flex-start; padding: 20px 14px; min-height: calc(100vh - 64px); border-right: 1px solid var(--line); }
#nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-weight: 500; transition: background-color .15s, color .15s;
}
.nav-item svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-item span { flex: 1; }
.nav-item:hover { background: #0E1320; color: var(--text); }
.nav-item[aria-current="page"] { background: var(--raised); color: var(--text); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #3A4359; flex: none !important; }
.dot.is-on { background: var(--on); animation: pulse 2.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(99, 219, 166, 0.45); } 50% { box-shadow: 0 0 0 4px rgba(99, 219, 166, 0); } }

#app { flex: 1; min-width: 0; padding: 32px 40px 140px; }
.page { max-width: 860px; animation: enter .28s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.loading { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--ice); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- section header ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.page-head h1 { font: 400 26px/1.3 var(--display); }
.page-head p { max-width: 560px; margin-top: 10px; color: var(--muted); }
.master { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 16px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line-strong); }
.master-label { font-weight: 500; }

/* ---------- panels and rows ---------- */
.panel { margin-bottom: 18px; padding: 6px 22px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.panel-head { display: flex; align-items: center; gap: 8px; padding: 14px 0 4px; }
.panel-head h2 { font-size: 14px; font-weight: 500; color: var(--muted); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 62px; padding: 9px 0; border-top: 1px solid var(--line-soft); }
.panel-head + .row { border-top: 0; }
.row[hidden] { display: none; }
.row-label { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row-label label, .row-label .label { font-weight: 500; }
.row-control { flex: none; display: flex; align-items: center; gap: 10px; }
.row.is-wide { flex-direction: column; align-items: stretch; gap: 12px; padding: 14px 0 18px; }
.row.is-wide .row-control { flex: 1; flex-direction: column; align-items: stretch; }

/* help bubbles */
.tip { position: relative; display: inline-flex; }
.tip-btn { width: 44px; height: 44px; margin: -12px -10px; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 0; padding: 0; cursor: help; }
.tip-dot { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(166, 212, 255, 0.3); color: #AEB7C9; font: 600 11px/16px var(--sans); text-align: center; transition: border-color .15s, color .15s, background-color .15s; }
.tip-btn:hover .tip-dot, .tip-btn:focus-visible .tip-dot, .tip.is-open .tip-dot { border-color: var(--ice); color: var(--ice); background: rgba(154, 209, 255, 0.08); }
.bubble {
  position: absolute; left: 50%; bottom: calc(100% + 12px); width: 270px; max-width: calc(100vw - 24px); padding: 10px 12px; border-radius: 10px;
  background: #151C2C; border: 1px solid rgba(166, 212, 255, 0.2); color: #DDE6F5; font: 400 13px/1.45 var(--sans); text-align: left;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5); z-index: 20; pointer-events: none;
  display: none; transform: translate(calc(-50% + var(--shift, 0px)), 0);
}
/* hidden bubbles take no space at all; an open one fades in and keeps itself on screen */
.tip:hover .bubble, .tip:focus-within .bubble, .tip.is-open .bubble { display: block; animation: tip-in .16s ease-out both; }
@keyframes tip-in { from { opacity: 0; transform: translate(calc(-50% + var(--shift, 0px)), 4px); } to { opacity: 1; transform: translate(calc(-50% + var(--shift, 0px)), 0); } }

/* switches */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.switch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.track { position: absolute; inset: 0; border-radius: 12px; background: #1A2233; border: 1px solid rgba(166, 212, 255, 0.14); transition: background-color .2s, border-color .2s; }
.track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #6B7590; transition: transform .2s cubic-bezier(.3, .7, .3, 1), background-color .2s; }
.switch input:checked + .track { background: rgba(154, 209, 255, 0.22); border-color: rgba(154, 209, 255, 0.6); }
.switch input:checked + .track::after { transform: translateX(18px); background: var(--ice); }
.switch input:focus-visible + .track { outline: 2px solid var(--ice); outline-offset: 2px; }

/* steppers */
.stepper { display: inline-flex; align-items: center; border-radius: 10px; border: 1px solid rgba(166, 212, 255, 0.14); background: var(--field); overflow: hidden; }
.stepper button { width: 44px; height: 40px; border: 0; background: transparent; color: var(--soft); font-size: 18px; line-height: 1; cursor: pointer; transition: background-color .15s, color .15s; }
.stepper button:hover:not(:disabled) { background: #161E2E; color: var(--text); }
.stepper button:disabled { color: #3A4359; cursor: not-allowed; }
.stepper output { min-width: 72px; text-align: center; font-weight: 500; font-variant-numeric: tabular-nums; }

/* selects, text */
.select { position: relative; display: inline-flex; min-width: 240px; }
.row:not(.is-wide) .row-control .select { width: 300px; }
.select select {
  appearance: none; -webkit-appearance: none; width: 100%; min-height: 44px; padding: 0 40px 0 14px; border-radius: 10px;
  border: 1px solid rgba(166, 212, 255, 0.14); background: var(--field); cursor: pointer;
}
.select::after { content: ""; position: absolute; right: 16px; top: 50%; width: 7px; height: 7px; margin-top: -6px; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(45deg); pointer-events: none; }
.select select:hover, .text-input:hover, textarea:hover { border-color: var(--line-strong); }
.select select option, .select select optgroup { background: #111725; color: var(--text); }
.text-input, textarea { width: 100%; min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid rgba(166, 212, 255, 0.14); background: var(--field); }
textarea { padding: 12px 14px; min-height: 92px; resize: vertical; line-height: 1.5; }
.color { display: inline-flex; align-items: center; gap: 10px; }
.color input { width: 44px; height: 44px; padding: 3px; border-radius: 10px; border: 1px solid rgba(166, 212, 255, 0.14); background: var(--field); cursor: pointer; }
.color span { font-variant-numeric: tabular-nums; color: var(--soft); }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 6px 0 12px; border-radius: 999px; background: var(--raised); border: 1px solid rgba(166, 212, 255, 0.12); font-size: 14px; animation: pop .16s ease-out; }
.chip .swatch { width: 9px; height: 9px; border-radius: 50%; }
.chip .hash { color: #6E7891; margin-right: -4px; }
.chip-x { width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; display: inline-grid; place-items: center; }
.chip-x:hover { background: #1F2838; color: var(--text); }
.chip-x svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.chips-empty { color: var(--muted); font-size: 14px; align-self: center; }
.chip-add { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.chip-add .text-input { flex: 1 1 220px; }
.chip-add .select { min-width: 220px; }

/* live message preview */
.msg-preview { display: flex; gap: 12px; margin-top: 12px; padding: 14px; border-radius: 12px; background: #080B13; border: 1px dashed rgba(166, 212, 255, 0.16); }
.msg-preview img { width: 36px; height: 36px; border-radius: 50%; flex: none; background: var(--space); }
.msg-preview .who { margin: 0; display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); font-size: 14px; }
.msg-preview .tag { font-size: 10px; font-weight: 600; line-height: 1; padding: 4px 6px; border-radius: 4px; background: rgba(154, 209, 255, 0.16); color: var(--ice); }
.msg-preview p { margin-top: 2px; color: var(--soft); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-preview .empty { color: var(--muted); font-style: italic; }
.mention { color: var(--ice); background: rgba(154, 209, 255, 0.1); border-radius: 4px; padding: 0 3px; }
.preview-label { font-size: 13px; color: var(--muted); margin-top: 12px; }

/* rewards */
.rewards { display: flex; flex-direction: column; gap: 8px; }
.reward { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; animation: pop .16s ease-out; }
.reward > span { color: var(--muted); }
.reward input[type=number] { width: 84px; min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid rgba(166, 212, 255, 0.14); background: var(--field); font-variant-numeric: tabular-nums; }
.reward .select { min-width: 200px; }
.link-btn { min-height: 44px; padding: 0 12px; border: 0; background: transparent; color: var(--muted); border-radius: 10px; cursor: pointer; }
.link-btn:hover { color: var(--text); background: #0E1320; }
.add-btn { align-self: flex-start; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px dashed rgba(166, 212, 255, 0.26); background: transparent; color: var(--soft); font-weight: 500; cursor: pointer; }
.add-btn:hover { background: rgba(154, 209, 255, 0.06); color: var(--text); }
.note { font-size: 13px; color: var(--muted); }

/* connections */
.connections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.conn-tile { min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 12px; background: var(--field); border: 1px solid var(--line); }
.conn-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.conn-note { font-size: 12px; color: var(--muted); }
.conn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 0; border-top: 1px solid var(--line-soft); animation: pop .16s ease-out; }
.conn-avatar { width: 30px; height: 30px; border-radius: 50%; flex: none; object-fit: cover; }
.conn-initial { display: inline-grid; place-items: center; background: #22304D; color: #CFE6FF; font-weight: 600; font-size: 13px; }
.conn-who { flex: 1; min-width: 0; flex-basis: 120px; display: flex; flex-direction: column; gap: 1px; }
.conn-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.conn-handle { display: block; max-width: 100%; font-size: 13px; color: var(--muted); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.conn-handle:hover { color: var(--ice); text-decoration: underline; }
.conn-avatar { background: #121826; }
.alert-who { display: flex; align-items: center; gap: 10px; }
.alert-avatar { width: 24px; height: 24px; border-radius: 50%; flex: none; object-fit: cover; font-size: 11px; }
.conn-name { font-weight: 500; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.verified, .needs-signin { flex: none; }
.needs-signin { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; color: #FFD38A; background: rgba(245, 165, 36, 0.12); border: 1px solid rgba(245, 165, 36, 0.4); text-decoration: none; }
a.needs-signin:hover { background: rgba(245, 165, 36, 0.2); }
.verified { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; color: var(--on); background: rgba(99, 219, 166, 0.12); border: 1px solid rgba(99, 219, 166, 0.35); }
.conn-row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px; margin-left: auto; min-width: 0; }
.conn-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 2px; }
.conn-add { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.conn-add .text-input { flex: 1 1 180px; }

/* live alerts */
.alerts { display: flex; flex-direction: column; gap: 10px; }
.alert-card { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px; background: var(--field); border: 1px solid var(--line); animation: pop .16s ease-out; }
.platform { display: inline-flex; align-items: center; gap: 8px; min-width: 96px; font-weight: 600; font-size: 14px; }
.platform i { width: 10px; height: 10px; border-radius: 50%; background: var(--pc); box-shadow: 0 0 10px var(--pc); }
.alert-main { flex: 1; min-width: 180px; }
.alert-account { font-weight: 500; overflow-wrap: anywhere; }
.alert-meta { font-size: 13px; color: var(--muted); white-space: pre-wrap; }
.alert-actions { display: flex; gap: 4px; }
.alert-form { padding: 16px; border-radius: 12px; background: #0A0E17; border: 1px solid var(--line-strong); animation: pop .16s ease-out; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; margin-bottom: 14px; }
.form-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-field > label { font-weight: 500; font-size: 14px; }
.form-field .select { min-width: 0; width: 100%; }
.form-error { color: var(--bad); font-size: 14px; margin-top: 10px; min-height: 1em; }
.form-actions { display: flex; gap: 8px; margin-top: 12px; }

/* ---------- save bar and toast ---------- */
.savebar {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 40;
  display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding: 10px 10px 10px 20px; border-radius: 999px;
  background: #111725; border: 1px solid rgba(154, 209, 255, 0.45);
  box-shadow: 0 0 34px rgba(154, 209, 255, 0.18), 0 16px 34px rgba(0, 0, 0, 0.5);
  animation: bar .28s cubic-bezier(.2, .7, .2, 1);
}
.savebar[hidden] { display: none; }
.savebar-actions { display: flex; gap: 8px; }
@keyframes bar { from { opacity: 0; transform: translate(-50%, 18px) scale(.98); } to { opacity: 1; transform: translate(-50%, 0); } }
.toast {
  position: fixed; right: 22px; top: 78px; z-index: 45; max-width: 380px; display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 16px; border-radius: 12px; background: #0F1A17; border: 1px solid rgba(99, 219, 166, 0.4); color: #CFF5E3;
  white-space: pre-line; animation: pop .2s ease-out;
}
.toast.is-bad { background: #1C0F12; border-color: rgba(255, 122, 133, 0.45); color: #FFD5D9; }
.toast[hidden] { display: none; }
.alert-form [hidden] { display: none !important; }

/* ---------- phones and small tablets ---------- */
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .side { position: static; min-height: 0; width: 100%; flex: none; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  #nav { flex-direction: row; }
  .nav-item { flex: none; }
  #app { padding: 24px 18px 150px; }
  .row { flex-wrap: wrap; }
  .select, .row:not(.is-wide) .row-control .select { min-width: 0; width: 100%; }
  .row-control { width: 100%; justify-content: flex-start; }
  .row:not(.is-wide) .row-control:has(.switch) { width: auto; }
  .savebar { left: 12px; right: 12px; transform: none; border-radius: 16px; justify-content: space-between; }
  @keyframes bar { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
  .who-name { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .connections { grid-template-columns: minmax(0, 1fr); }
  .bubble { width: 230px; }
}
@media (prefers-reduced-motion: reduce) {
  .page, .chip, .reward, .switcher-menu, .savebar, .toast { animation: none; }
  .dot.is-on { animation: none; }
  .track, .track::after { transition: none; }
  .tip:hover .bubble, .tip:focus-within .bubble, .tip.is-open .bubble { animation: none; }
  .btn-primary:hover { transform: none; }
}
