:root {
  --bg: #070914;
  --bg-elevated: #0c1020;
  --sidebar: rgba(9, 12, 24, .9);
  --surface: rgba(17, 22, 40, .82);
  --surface-solid: #11172a;
  --surface-soft: #171e34;
  --surface-hover: #202945;
  --input: rgba(8, 12, 25, .78);
  --line: rgba(144, 163, 202, .14);
  --line-strong: rgba(144, 163, 202, .25);
  --text: #f5f7ff;
  --text-soft: #c5cce0;
  --muted: #8994ad;
  --accent: #7568ff;
  --accent-bright: #a39cff;
  --accent-soft: rgba(117, 104, 255, .16);
  --cyan: #52d9ff;
  --green: #4cdda0;
  --green-soft: rgba(76, 221, 160, .14);
  --amber: #f7c76a;
  --amber-soft: rgba(247, 199, 106, .14);
  --danger: #ff7088;
  --danger-soft: rgba(255, 112, 136, .13);
  --shadow: 0 22px 60px rgba(0, 0, 0, .28);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, .18);
  --radius-xl: 26px;
  --radius-lg: 18px;
  --radius-md: 13px;
  --sidebar-width: 288px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f2f4fa;
  --bg-elevated: #f8f9fc;
  --sidebar: rgba(255, 255, 255, .92);
  --surface: rgba(255, 255, 255, .9);
  --surface-solid: #fff;
  --surface-soft: #f5f6fb;
  --surface-hover: #eef0f8;
  --input: #f7f8fc;
  --line: rgba(44, 54, 82, .12);
  --line-strong: rgba(44, 54, 82, .2);
  --text: #161a27;
  --text-soft: #3e465d;
  --muted: #717b94;
  --accent-soft: rgba(92, 81, 240, .1);
  --green-soft: rgba(24, 163, 104, .1);
  --amber-soft: rgba(205, 139, 18, .1);
  --danger-soft: rgba(220, 52, 82, .09);
  --shadow: 0 22px 60px rgba(44, 54, 82, .12);
  --shadow-soft: 0 10px 30px rgba(44, 54, 82, .08);
  color-scheme: light;
}

* { box-sizing: border-box; }

html { min-width: 320px; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
body::before { content: ""; position: fixed; z-index: -3; inset: 0; background-image: linear-gradient(rgba(150,165,210,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(150,165,210,.025) 1px, transparent 1px); background-size: 38px 38px; mask-image: linear-gradient(to bottom, black, transparent 85%); pointer-events: none; }

button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid rgba(108, 99, 255, .28);
  outline-offset: 2px;
}

a { color: inherit; }
p, h1, h2, h3, h4 { margin-top: 0; }
p { color: var(--muted); }
code, pre, kbd { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
code { color: var(--cyan); }

.ambient {
  position: fixed;
  z-index: -2;
  width: 520px;
  height: 520px;
  border-radius: 999px;
  filter: blur(120px);
  opacity: .09;
  pointer-events: none;
}
.ambient-one { top: -230px; right: 3%; background: var(--accent); animation: ambient-drift 14s ease-in-out infinite alternate; }
.ambient-two { bottom: -300px; left: 24%; background: var(--cyan); opacity: .065; animation: ambient-drift 18s ease-in-out infinite alternate-reverse; }
@keyframes ambient-drift { to { transform: translate3d(50px, 35px, 0) scale(1.12); } }

.app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 22px 16px 18px;
  overflow-y: auto;
  border-right: 1px solid rgba(150, 165, 210, .12);
  background: var(--sidebar);
  backdrop-filter: blur(24px);
}
.sidebar::after { content: ""; position: absolute; top: 0; right: -1px; width: 1px; height: 28%; background: linear-gradient(transparent, var(--accent), transparent); opacity: .55; }

.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px 20px; }
.brand-mark {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 14px;
  background: linear-gradient(145deg, #756cff, #4f46d8);
  box-shadow: 0 10px 28px rgba(108, 99, 255, .3), inset 0 1px rgba(255, 255, 255, .2);
}
.brand-mark::after { content: ""; position: absolute; bottom: 9px; width: 17px; height: 5px; border-bottom: 2px solid white; border-radius: 50%; opacity: .9; }
.brand-eye { width: 4px; height: 5px; border-radius: 4px; background: white; transform: translateY(-3px); }
.brand-mark.has-logo { overflow: hidden; background: #080b14; }
.brand-mark.has-logo::after { display: none; }
.brand-mark.has-logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-copy { display: grid; line-height: 1.2; }
.brand-copy strong { font-size: 17px; letter-spacing: -.02em; }
.brand-copy span { margin-top: 4px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-soft);
  transition: .18s ease;
}
.icon-button:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface-hover); transform: translateY(-1px); }
.sidebar-close, .mobile-menu { display: none; }

.server-switcher {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.guild-avatar, .bot-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  overflow: hidden;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), #3f9cdd);
  color: white;
  font-weight: 800;
}
.guild-avatar img, .bot-avatar img { width: 100%; height: 100%; object-fit: cover; }
.server-select-wrap { display: grid; min-width: 0; flex: 1; }
.server-select-wrap > span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.server-select { width: 100%; min-width: 0; margin: 1px 0 0; padding: 0 22px 0 0; border: 0; background: transparent; color: var(--text); font-weight: 650; outline: 0; text-overflow: ellipsis; }
.server-select option { background: #f7f8fc; color: #17203a; font-weight: 650; }
.server-select option:checked { background: #91c5ff; color: #091a33; }

.nav { display: grid; gap: 18px; }
.nav-group { display: grid; gap: 4px; }
.nav-label { padding: 0 10px 6px; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .13em; }
.nav button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-weight: 550;
  transition: .16s ease;
}
.nav button:hover { color: var(--text-soft); background: var(--surface); transform: translateX(3px); }
.nav button.active { color: var(--text); border-color: rgba(117, 104, 255, .26); background: linear-gradient(90deg, rgba(117,104,255,.2), rgba(82,217,255,.035)); box-shadow: inset 3px 0 var(--accent), 0 8px 24px rgba(0,0,0,.1); }
.nav button.active .nav-icon { color: var(--accent-bright); filter: drop-shadow(0 0 8px rgba(117,104,255,.5)); }
.nav-icon { display: grid; place-items: center; width: 22px; color: inherit; font-size: 17px; }

.sidebar-footer { display: grid; gap: 12px; margin-top: auto; padding: 24px 5px 0; }
.official-site-link { display: flex; align-items: center; gap: 9px; width: fit-content; color: var(--muted); font-size: 11px; font-weight: 700; text-decoration: none; }
.official-site-link:hover { color: var(--accent); }
.bot-identity { display: flex; align-items: center; gap: 10px; }
.bot-avatar { position: relative; border-radius: 50%; }
.bot-avatar i { position: absolute; right: 0; bottom: 0; width: 10px; height: 10px; border: 2px solid var(--surface-solid); border-radius: 50%; background: var(--green); }
.bot-identity > div:last-child { display: grid; min-width: 0; }
.bot-identity strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.bot-identity span { color: var(--muted); font-size: 11px; }
.sidebar-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 103, 131, .22);
  border-radius: 11px;
  background: rgba(255, 92, 122, .07);
  color: #ff9daf;
  font-size: 12px;
  font-weight: 700;
  transition: .18s ease;
}
.sidebar-logout:hover { border-color: rgba(255, 103, 131, .48); background: rgba(255, 92, 122, .14); color: #ffd6de; transform: translateY(-1px); }
.sidebar-logout > span:first-child { font-size: 17px; line-height: 1; transform: rotate(180deg); }
.version-chip { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }

.logout-confirm-backdrop {
  position: fixed;
  z-index: 180;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 5, 13, .76);
  backdrop-filter: blur(12px);
  animation: fade-in .2s ease;
}
.logout-confirm-card {
  display: grid;
  justify-items: center;
  width: min(440px, 100%);
  padding: 34px;
  border: 1px solid rgba(255, 103, 131, .25);
  border-radius: 24px;
  background: var(--surface-solid);
  box-shadow: 0 36px 100px rgba(0, 0, 0, .52);
  text-align: center;
  animation: tour-in .3s cubic-bezier(.2, .8, .2, 1);
}
.logout-confirm-icon { display: grid; width: 58px; height: 58px; margin-bottom: 18px; place-items: center; border: 1px solid rgba(255, 103, 131, .3); border-radius: 18px; background: rgba(255, 92, 122, .1); color: #ff9daf; font-size: 27px; transform: rotate(180deg); }
.logout-confirm-card h2 { margin: 5px 0 10px; font-size: 25px; letter-spacing: -.025em; }
.logout-confirm-card p { max-width: 350px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.logout-confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; margin-top: 26px; }
.logout-confirm-actions button { min-height: 46px; }

.workspace { min-width: 0; padding: 0 34px 48px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 100px;
  margin-bottom: 10px;
  padding: 20px 0;
  background: linear-gradient(var(--bg) 76%, transparent);
}
.page-heading { display: flex; align-items: center; gap: 14px; min-width: 0; }
.eyebrow { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.eyebrow span:last-child { color: var(--accent-bright); }
h1 { margin-bottom: 4px; font-size: clamp(24px, 3vw, 32px); line-height: 1.12; letter-spacing: -.035em; }
.page-heading p { margin: 0; font-size: 13px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.quick-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(240px, 23vw);
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
}
.quick-search input { min-width: 0; flex: 1; padding: 0; border: 0; background: transparent; color: var(--text); outline: 0; }
.quick-search kbd { padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); font-size: 10px; }
.status-chip, .badge, .pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-soft);
  white-space: nowrap;
}
.status-chip { height: 40px; padding: 0 13px; font-size: 12px; font-weight: 650; }
.status-chip i, .status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
.status-chip.online i { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.status-chip.offline i { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }

.view { display: grid; gap: 16px; animation: view-in .35s cubic-bezier(.2,.8,.2,1); }
.view:focus { outline: 0; }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
.content-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: start; gap: 16px; }
.flow-grid { grid-auto-flow: row dense; grid-auto-rows: 6px; }
.flow-grid > * { min-width: 0; }
.flow-grid > .span-3,
.flow-grid > .span-4,
.flow-grid > .span-5,
.flow-grid > .span-6,
.flow-grid > .span-7,
.flow-grid > .span-8 { grid-column: span 6; }
.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-7 { grid-column: span 7; }
.span-6 { grid-column: span 6; }
.span-5 { grid-column: span 5; }
.span-4 { grid-column: span 4; }
.span-3 { grid-column: span 3; }

.platform-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255,255,255,.035), rgba(117,104,255,.06));
  box-shadow: var(--shadow-soft);
}
.platform-tab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  min-height: 64px;
  padding: 12px 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(10, 14, 25, .45);
  color: var(--text-soft);
  font-weight: 850;
  letter-spacing: -.01em;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
}
.platform-tab::before {
  content: "";
  position: absolute;
  inset: auto 16px 0;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: var(--platform-colour);
  opacity: 0;
  transform: translateY(4px);
  transition: .18s ease;
}
.platform-tab:hover {
  border-color: color-mix(in srgb, var(--platform-colour) 42%, var(--line-strong));
  background: var(--surface-hover);
  color: var(--text);
  transform: translateY(-1px);
}
.platform-tab.active {
  border-color: color-mix(in srgb, var(--platform-colour) 55%, var(--line-strong));
  background: linear-gradient(135deg, color-mix(in srgb, var(--platform-colour) 20%, transparent), rgba(10, 14, 25, .62));
  color: var(--text);
  box-shadow: 0 12px 34px rgba(0,0,0,.22), 0 0 28px color-mix(in srgb, var(--platform-colour) 22%, transparent);
}
.platform-tab.active::before { opacity: 1; transform: translateY(0); }
.platform-tab img {
  width: 82px;
  max-width: 44%;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,.28));
}
.platform-tab span { font-size: 14px; }
.platform-panel { display: grid; min-width: 0; }
.platform-panel-grid { grid-column: 1 / -1; }
.brand-card-logo {
  display: block;
  width: 26px;
  height: 18px;
  object-fit: contain;
}
.subpage-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}
.subpage-tab {
  display: grid;
  gap: 3px;
  min-height: 58px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--muted);
  text-align: left;
  transition: .18s ease;
}
.subpage-tab:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  color: var(--text-soft);
  transform: translateY(-1px);
}
.subpage-tab.active {
  border-color: rgba(82, 217, 255, .36);
  background: linear-gradient(135deg, rgba(82,217,255,.12), rgba(117,104,255,.09));
  color: var(--text);
  box-shadow: inset 3px 0 var(--cyan), 0 12px 32px rgba(0,0,0,.16);
}
.subpage-tab strong { font-size: 12px; }
.subpage-tab span { font-size: 10px; line-height: 1.35; }

.panel, .card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}
.panel { padding: 20px; }
.card { padding: 18px; }
.card:hover { border-color: var(--line-strong); }
.card-header, .section-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
.card-title { display: flex; gap: 12px; }
.card-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-bright); font-size: 17px; }
.card h2, .panel h2 { margin-bottom: 4px; font-size: 16px; line-height: 1.25; letter-spacing: -.015em; }
.card h3 { margin-bottom: 4px; font-size: 13px; }
.card-header p, .section-header p { margin: 0; font-size: 12px; }
.section-header { margin: 4px 2px 0; }
.section-header h2 { margin-bottom: 4px; font-size: 19px; }
.section-kicker { display: inline-block; margin-bottom: 8px; color: var(--accent-bright); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .13em; }

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 172px;
  padding: 24px;
  background:
    radial-gradient(circle at 85% 20%, rgba(78, 216, 255, .12), transparent 34%),
    linear-gradient(135deg, rgba(108, 99, 255, .15), var(--surface));
}
.hero-copy { display: flex; align-items: center; gap: 18px; min-width: 0; }
.hero-avatar { display: grid; place-items: center; width: 76px; height: 76px; flex: 0 0 76px; overflow: hidden; border: 3px solid rgba(255, 255, 255, .12); border-radius: 23px; background: linear-gradient(135deg, var(--accent), #3f9cdd); color: white; font-size: 28px; font-weight: 800; box-shadow: 0 18px 45px rgba(59, 74, 170, .22); }
.hero-avatar img { width: 100%; height: 100%; object-fit: cover; }
.hero h2 { margin-bottom: 5px; font-size: 24px; }
.hero p { max-width: 580px; margin-bottom: 14px; }
.hero-actions, .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.hero-orbit { position: absolute; right: -50px; width: 210px; height: 210px; border: 1px solid rgba(108, 99, 255, .16); border-radius: 50%; }
.hero-orbit::after { content: ""; position: absolute; inset: 32px; border: 1px solid rgba(78, 216, 255, .12); border-radius: inherit; }

.button, button.primary, .button-secondary, .button-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), #5650dc);
  color: white;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(108, 99, 255, .18);
  transition: .18s ease;
}
.button:hover, button.primary:hover { transform: translateY(-1px); filter: brightness(1.08); }
.button-secondary { border-color: var(--line); background: var(--surface-soft); color: var(--text-soft); box-shadow: none; }
.button-secondary:hover { border-color: var(--line-strong); color: var(--text); background: var(--surface-hover); }
.button-danger { border-color: rgba(255, 112, 136, .18); background: var(--danger-soft); color: var(--danger); box-shadow: none; }
button:disabled { cursor: not-allowed; opacity: .55; transform: none !important; }
.button-sm { min-height: 32px; padding: 6px 10px; border-radius: 9px; font-size: 12px; }

.metric-card { min-height: 126px; }
.metric-top { display: flex; align-items: center; justify-content: space-between; }
.metric-label { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.metric-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-bright); }
.metric-value { margin: 13px 0 2px; font-size: 29px; font-weight: 800; line-height: 1; letter-spacing: -.04em; }
.metric-note { color: var(--muted); font-size: 11px; }
.trend { color: var(--green); }

.badge, .pill { padding: 5px 9px; font-size: 11px; font-weight: 700; }
.badge.success, .pill.success { border-color: rgba(76, 221, 160, .2); background: var(--green-soft); color: var(--green); }
.badge.warning, .pill.warning { border-color: rgba(247, 199, 106, .2); background: var(--amber-soft); color: var(--amber); }
.badge.danger, .pill.danger { border-color: rgba(255, 112, 136, .2); background: var(--danger-soft); color: var(--danger); }
.badge.accent, .pill.accent { border-color: rgba(108, 99, 255, .22); background: var(--accent-soft); color: var(--accent-bright); }

.progress-wrap { display: grid; gap: 8px; }
.progress-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.progress { height: 7px; overflow: hidden; border-radius: 999px; background: var(--surface-soft); }
.progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--cyan)); }

.setup-checklist { display: grid; gap: 14px; margin-top: 18px; }
.setup-checklist-summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.setup-checklist-summary > span { padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); color: var(--text-soft); font-size: 11px; }
.setup-checklist-summary > span strong { color: var(--text); }
.setup-checklist-summary small { margin-left: auto; color: var(--muted); font-size: 10px; }
.setup-requirement-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.setup-checklist.is-compact .setup-requirement-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.setup-requirement-column { display: grid; min-width: 0; gap: 14px; align-content: start; }
.setup-requirement-group { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: rgba(10, 14, 25, .18); }
.setup-requirement-group > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.setup-requirement-group > header div { min-width: 0; }
.setup-requirement-group > header strong, .setup-requirement-group > header span { display: block; }
.setup-requirement-group > header strong { font-size: 12px; }
.setup-requirement-group > header div > span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.setup-requirement-list { display: grid; }
.setup-requirement { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 9px 11px; border-bottom: 1px solid var(--line); }
.setup-requirement:last-child { border-bottom: 0; }
.setup-requirement > div { min-width: 0; flex: 1; }
.setup-requirement > div strong, .setup-requirement > div span { display: block; }
.setup-requirement > div strong { overflow: hidden; color: var(--text-soft); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.setup-requirement > div span { margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.setup-requirement > .badge { flex: 0 0 auto; }
.setup-requirement-icon { display: grid; place-items: center; width: 24px; height: 24px; flex: 0 0 24px; border-radius: 8px; background: var(--amber-soft); color: var(--amber); font-size: 12px; font-weight: 800; }
.setup-requirement.is-complete .setup-requirement-icon { background: var(--green-soft); color: var(--green); }
.setup-requirement.is-complete > div strong { color: var(--muted); }
.setup-checklist.is-compact .setup-requirement-grid { max-height: 390px; padding-right: 4px; overflow: auto; scrollbar-color: var(--line-strong) transparent; }

.module-list, .activity-list, .list { display: grid; gap: 9px; }
.module-row, .activity-item, .list-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(10, 14, 25, .22);
}
.module-row > div, .activity-item > div, .list-item > div { min-width: 0; flex: 1; }
.module-row strong, .activity-item strong, .list-item strong { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.module-row span:not(.badge), .activity-item span, .list-item span { color: var(--muted); font-size: 11px; }
.activity-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; border-radius: 9px; background: var(--surface-soft); color: var(--accent-bright); }
.activity-time { flex: 0 0 auto !important; }

.form { display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field, label.field { display: grid; gap: 7px; color: var(--text-soft); font-size: 12px; font-weight: 650; }
.field small { color: var(--muted); font-weight: 400; }
input, select, textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--input);
  color: var(--text);
  outline: 0;
  transition: border .16s, box-shadow .16s, background .16s;
}
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input:focus, select:focus, textarea:focus { border-color: rgba(108, 99, 255, .56); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 104px; resize: vertical; }
select[multiple] { min-height: 180px; }
input[type="color"] { min-height: 42px; padding: 5px; }
.field-row { display: flex; align-items: center; gap: 10px; }
.field-row > * { flex: 1; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
.check-row { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--input); color: var(--text-soft); font-size: 11px; font-weight: 600; cursor: pointer; }
.check-row:hover { border-color: var(--line-strong); background: var(--surface-hover); }
.check-row input { width: 16px; height: 16px; flex: 0 0 16px; accent-color: var(--accent); }
.check-row span { min-width: 0; line-height: 1.35; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding-top: 2px; }
.form-note { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); color: var(--muted); font-size: 11px; }

.emoji-field { position: relative; }
#reactionRoleForm { overflow: visible; z-index: 5; }
.emoji-picker-button {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--input);
  color: var(--text);
  text-align: left;
}
.emoji-picker-button:hover, .emoji-picker-button[aria-expanded="true"] { border-color: rgba(108, 99, 255, .56); }
.emoji-picker-button > span:nth-child(2) { display: grid; min-width: 0; }
.emoji-picker-button strong { font-size: 11px; }
.emoji-picker-button small { color: var(--muted); font-size: 9px; font-weight: 500; }
.emoji-picker-preview { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--surface-soft); font-size: 19px; }
.emoji-picker-preview img, .emoji-grid img, .activity-icon img { width: 23px; height: 23px; object-fit: contain; }
.emoji-picker-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 7px);
  left: 0;
  width: min(390px, calc(100vw - 48px));
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.emoji-search { position: relative; display: block; margin-bottom: 8px; }
.emoji-search > span { position: absolute; z-index: 1; top: 11px; left: 11px; color: var(--muted); }
.emoji-search input { min-height: 38px; padding-left: 31px; }
.emoji-group-tabs { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 2px; margin: 0 0 8px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.emoji-group-tabs button { display: grid; place-items: center; min-width: 0; min-height: 30px; padding: 3px; border: 0; border-radius: 7px; background: transparent; filter: grayscale(.45); font-size: 16px; opacity: .65; }
.emoji-group-tabs button:hover, .emoji-group-tabs button.active { background: var(--surface-hover); filter: none; opacity: 1; }
.emoji-scroll { max-height: 300px; overflow: auto; padding-right: 3px; }
.emoji-group + .emoji-group { margin-top: 10px; }
.emoji-group h4 { margin: 0 0 6px; color: var(--muted); font-size: 9px; letter-spacing: .07em; text-transform: uppercase; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 3px; }
.emoji-grid button {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-width: 0;
  padding: 3px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 20px;
}
.emoji-grid button:hover, .emoji-grid button:focus-visible, .emoji-grid button.selected { border-color: var(--line-strong); background: var(--surface-hover); }
.emoji-no-results { margin: 20px 8px; color: var(--muted); font-size: 11px; text-align: center; }
.reaction-bindings-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 3px; }
.reaction-bindings-header > div { display: grid; }
.reaction-bindings-header strong { color: var(--text-soft); font-size: 12px; }
.reaction-bindings-header span { color: var(--muted); font-size: 10px; }
.reaction-binding-rows { display: grid; gap: 10px; }
.reaction-binding-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 34px; gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.reaction-row-remove { margin-bottom: 4px; }

.switch-field { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--input); }
.switch-copy { min-width: 0; }
.switch-copy strong { display: block; font-size: 12px; }
.switch-copy span { color: var(--muted); font-size: 11px; }
.switch { position: relative; width: 40px; height: 22px; flex: 0 0 40px; }
.switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: #30384b; transition: .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: white; box-shadow: 0 2px 5px rgba(0,0,0,.24); transition: .2s; }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(18px); }

.segmented { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: var(--input); }
.segmented button { min-height: 32px; padding: 5px 11px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; }
.segmented button.active { background: var(--surface-hover); color: var(--text); box-shadow: var(--shadow-soft); }

.empty-state { min-height: 0; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; background: var(--surface-soft); }
.empty-state > div { display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; column-gap: 12px; text-align: left; }
.empty-icon { display: grid; grid-row: 1 / span 2; place-items: center; width: 40px; height: 40px; margin: 0; border-radius: 11px; background: var(--accent-soft); color: var(--muted); font-size: 18px; }
.empty-state h3 { grid-column: 2; margin: 0 0 3px; }
.empty-state p { grid-column: 2; max-width: none; margin: 0; font-size: 11px; }
.view > .empty-state { display: grid; place-items: center; min-height: 240px; padding: 24px; border: 0; background: transparent; }
.view > .empty-state > div { display: block; text-align: center; }
.view > .empty-state .empty-icon { width: 48px; height: 48px; margin: 0 auto 12px; font-size: 22px; }

.server-onboarding {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, .82fr) minmax(420px, 1.18fr);
  align-items: center;
  min-height: min(690px, calc(var(--app-height, 100vh) - 160px));
  overflow: hidden;
  border: 1px solid rgba(137, 124, 255, .24);
  border-radius: 28px;
  background: radial-gradient(circle at 20% 45%, rgba(91, 218, 255, .1), transparent 28%), linear-gradient(135deg, rgba(19, 24, 48, .94), rgba(9, 14, 28, .91));
  box-shadow: 0 28px 90px rgba(0, 0, 0, .27), inset 0 1px rgba(255, 255, 255, .05);
}
.onboarding-glow { position: absolute; right: -100px; bottom: -180px; width: 520px; height: 520px; border: 1px solid rgba(123, 107, 255, .1); border-radius: 50%; box-shadow: 0 0 120px rgba(123, 107, 255, .08); }
.onboarding-visual { position: relative; display: grid; place-items: center; min-height: 100%; isolation: isolate; }
.onboarding-mark { position: relative; display: flex; align-items: center; justify-content: center; gap: 15px; width: 132px; height: 132px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 38px; background: linear-gradient(145deg, #8c7bff, #5b52dc 60%, #4aaad2); box-shadow: 0 32px 70px rgba(66, 54, 200, .38), inset 0 1px rgba(255, 255, 255, .28); animation: onboarding-float 5s ease-in-out infinite; }
.onboarding-mark span { width: 14px; height: 20px; border-radius: 999px; background: white; box-shadow: 0 0 18px rgba(255,255,255,.45); }
.onboarding-orbit { position: absolute; z-index: -1; border: 1px solid rgba(151, 139, 255, .18); border-radius: 50%; }
.onboarding-orbit.orbit-a { width: 300px; height: 300px; animation: orbit-soft 20s linear infinite; }
.onboarding-orbit.orbit-b { width: 440px; height: 440px; border-color: rgba(90, 220, 246, .09); animation: orbit-soft 28s linear infinite reverse; }
.onboarding-node { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 20px var(--cyan); }
.onboarding-node.node-a { top: 25%; left: 23%; }.onboarding-node.node-b { right: 17%; bottom: 30%; width: 5px; height: 5px; }.onboarding-node.node-c { right: 28%; top: 20%; width: 4px; height: 4px; background: var(--accent-bright); }
.onboarding-copy { position: relative; z-index: 2; max-width: 660px; padding: 64px 70px 64px 20px; }
.onboarding-copy h2 { max-width: 600px; margin: 10px 0 14px; font-size: clamp(32px, 4vw, 52px); line-height: 1.03; letter-spacing: -.045em; text-wrap: balance; }
.onboarding-copy > p { max-width: 570px; margin: 0; color: var(--text-soft); font-size: 15px; line-height: 1.65; }
.onboarding-steps { display: grid; gap: 12px; margin: 30px 0; }
.onboarding-steps > span { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 13px; }
.onboarding-steps b { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid rgba(151,139,255,.22); border-radius: 11px; background: rgba(120,104,255,.11); color: var(--accent-bright); }
.onboarding-steps span span { display: grid; gap: 2px; }.onboarding-steps strong { font-size: 13px; }.onboarding-steps small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.onboarding-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.onboarding-actions .button, .onboarding-actions .button-secondary { min-height: 48px; padding-inline: 18px; }
.onboarding-actions .is-disabled { opacity: .55; pointer-events: none; }
.onboarding-note { display: flex; align-items: center; gap: 7px; margin-top: 17px !important; color: var(--muted) !important; font-size: 11px !important; }
html.no-guilds .nav button, html.no-guilds .mobile-dock button[data-view], html.no-guilds .quick-search { opacity: .34; pointer-events: none; }
@keyframes onboarding-float { 50% { transform: translateY(-9px) rotate(1deg); } }
:root[data-theme="light"] .server-onboarding { background: radial-gradient(circle at 20% 45%, rgba(90,220,246,.14), transparent 30%), linear-gradient(135deg, rgba(241,239,255,.98), rgba(255,255,255,.94)); }

.embed-preview { border-left: 4px solid var(--accent); border-radius: 4px 12px 12px 4px; background: #111520; padding: 16px; color: #e8ebf4; box-shadow: 0 10px 30px rgba(0,0,0,.22); }
.embed-preview .preview-content { margin-bottom: 12px; color: #c9cfdf; white-space: pre-wrap; }
.embed-preview h3 { margin-bottom: 7px; font-size: 15px; }
.embed-preview p { margin-bottom: 14px; color: #c5ccdc; white-space: pre-wrap; }
.embed-preview footer { color: #858fa6; font-size: 11px; }

.tag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.tag-card { display: grid; gap: 9px; min-height: 130px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--input); }
.tag-card header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tag-card code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-card p { display: -webkit-box; margin: 0; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; font-size: 12px; }

.audit-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-bottom: 14px; }
.audit-toolbar input { max-width: 360px; }
.audit-toolbar .field { margin: 0; }
.field.compact { gap: 5px; min-width: 170px; }
.field.compact select { min-height: 38px; }
.audit-entry { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.audit-entry:last-child { border-bottom: 0; }
.audit-entry strong { display: block; margin-bottom: 3px; }
.audit-entry pre, .data-code { max-height: 280px; margin: 9px 0 0; padding: 12px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--input); color: var(--text-soft); font-size: 11px; white-space: pre-wrap; word-break: break-word; }
.audit-entry time { color: var(--muted); font-size: 10px; white-space: nowrap; }
.audit-entry summary { cursor: pointer; color: var(--muted); font-size: 11px; }

.data-panel details { border-top: 1px solid var(--line); }
.data-panel details:first-of-type { border-top: 0; }
.data-panel summary { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; cursor: pointer; font-weight: 700; }
.data-code { max-height: 520px; margin-bottom: 14px; }

.auth-screen { display: grid; min-height: calc(100vh - 150px); place-items: center; }
.auth-card { display: grid; grid-template-columns: .9fr 1.1fr; width: min(850px, 100%); min-height: 520px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow); }
.auth-visual { position: relative; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 50% 50%, rgba(108, 99, 255, .28), transparent 45%), linear-gradient(145deg, #13172c, #0a0d17); }
.auth-logo { z-index: 2; display: flex; align-items: center; justify-content: center; gap: 12px; width: 104px; height: 104px; border: 1px solid rgba(255,255,255,.16); border-radius: 32px; background: linear-gradient(145deg, #756cff, #4f46d8); box-shadow: 0 25px 70px rgba(108,99,255,.36); }
.auth-logo span { width: 9px; height: 12px; border-radius: 8px; background: white; }
.auth-orbit { position: absolute; border: 1px solid rgba(141,134,255,.22); border-radius: 50%; }
.orbit-one { width: 260px; height: 260px; }
.orbit-two { width: 390px; height: 390px; opacity: .5; }
.auth-copy { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 48px; }
.auth-copy h2 { margin-bottom: 10px; font-size: 27px; letter-spacing: -.03em; }
.auth-copy > p { margin-bottom: 22px; }
.auth-copy label { display: grid; gap: 7px; margin-bottom: 11px; color: var(--text-soft); font-size: 12px; font-weight: 650; }
.discord-button { width: 100%; }
.auth-note { margin: 13px 0 0 !important; font-size: 10px; text-align: center; }
.owner-access { position: absolute; right: 14px; bottom: 10px; z-index: 4; text-align: right; }
.owner-access summary { display: inline-grid; place-items: center; width: 26px; height: 20px; padding: 0; cursor: pointer; list-style: none; border-radius: 7px; color: var(--muted); font-size: 11px; letter-spacing: 1px; opacity: .28; transition: color .18s ease, background .18s ease, opacity .18s ease; }
.owner-access summary::-webkit-details-marker { display: none; }
.owner-access summary:hover, .owner-access summary:focus-visible, .owner-access[open] summary { background: var(--surface-soft); color: var(--text-soft); opacity: .78; }
.owner-access-panel { position: absolute; right: 0; bottom: 28px; width: min(310px, calc(100vw - 56px)); padding: 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-solid); box-shadow: var(--shadow); text-align: left; }
.owner-access-panel .button-secondary { width: 100%; }
.owner-access-panel .auth-note { color: var(--muted); line-height: 1.45; }

.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 100; display: grid; gap: 9px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-solid); box-shadow: var(--shadow); animation: toast-in .22s ease; pointer-events: auto; }
.toast.success { border-color: rgba(76, 221, 160, .25); }
.toast.error { border-color: rgba(255, 112, 136, .28); }
.toast-icon { color: var(--green); }
.toast.error .toast-icon { color: var(--danger); }
.toast strong { display: block; font-size: 12px; }
.toast span { color: var(--muted); font-size: 11px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.loading-bar { position: fixed; top: 0; right: 0; left: var(--sidebar-width); z-index: 80; height: 3px; overflow: hidden; background: var(--accent-soft); }
.loading-bar span { display: block; width: 35%; height: 100%; background: linear-gradient(90deg, transparent, var(--accent), var(--cyan), transparent); animation: loading 1.1s infinite ease-in-out; }
@keyframes loading { from { transform: translateX(-110%); } to { transform: translateX(400%); } }

.skeleton { overflow: hidden; position: relative; min-height: 100px; background: var(--surface); }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.05), transparent); animation: shimmer 1.5s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.success-text { color: var(--green); }
.warning-text { color: var(--amber); }
.danger-text { color: var(--danger); }
.mono { font-family: "SFMono-Regular", Consolas, monospace; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.preset-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.preset-card { display: flex; flex-direction: column; align-items: flex-start; min-height: 230px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-soft); }
.preset-card.featured { border-color: rgba(108, 99, 255, .42); background: linear-gradient(145deg, var(--accent-soft), var(--surface-soft)); }
.preset-card h3 { margin: 16px 0 6px; font-size: 16px; }
.preset-card p { flex: 1; }
.preset-card button { width: 100%; }
.blueprint-lifecycle { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 28px; overflow: hidden; padding: 24px; border: 1px solid rgba(255, 184, 77, .25); border-radius: var(--radius-lg); background: radial-gradient(circle at 8% 30%, rgba(255, 184, 77, .08), transparent 30%), var(--surface); box-shadow: var(--shadow-soft); }
.blueprint-lifecycle-footer { margin-top: 16px; }
.blueprint-lifecycle::after { content: ""; position: absolute; right: -60px; bottom: -90px; width: 190px; height: 190px; border: 1px solid rgba(255, 184, 77, .1); border-radius: 50%; pointer-events: none; }
.blueprint-lifecycle-copy { min-width: 0; }.blueprint-lifecycle-copy h2 { margin: 7px 0 5px; }.blueprint-lifecycle-copy p { margin: 0; }
.blueprint-counts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 17px; }
.blueprint-counts span { display: inline-flex; align-items: baseline; gap: 5px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); color: var(--muted); font-size: 11px; }.blueprint-counts b { color: var(--text); font-size: 14px; }
.blueprint-lifecycle-action { position: relative; z-index: 1; display: grid; justify-items: stretch; gap: 9px; min-width: 210px; }.blueprint-lifecycle-action small { max-width: 220px; color: var(--muted); font-size: 10px; line-height: 1.4; text-align: center; }
.blueprint-global-notice { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; padding: 14px 16px; border: 1px solid rgba(255, 184, 77, .24); border-radius: var(--radius-lg); background: rgba(255, 184, 77, .07); box-shadow: var(--shadow-soft); }
.blueprint-global-notice > div { display: grid; gap: 4px; min-width: 0; }
.blueprint-global-notice strong { font-size: 13px; }
.blueprint-global-notice small { color: var(--muted); font-size: 10px; }
.setup-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.setup-step { display: flex; gap: 11px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-soft); }
.setup-step > span { display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 28px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-bright); font-weight: 800; }
.setup-step p { margin: 3px 0 0; font-size: 11px; }
.settings-intro { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.settings-intro p { max-width: 700px; margin: 0; }
.settings-search { display: flex; width: min(320px, 100%); flex: 0 0 auto; }
.settings-sections { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: start; gap: 16px; }
.settings-section { display: grid; grid-column: span 6; align-content: start; align-self: start; min-width: 0; }
.settings-section .form-grid { align-items: start; }
.settings-section .field,
.settings-section .switch-field,
.settings-section .map-editor { align-self: start; }
.settings-section textarea.mono { min-height: 150px; font-size: 11px; }
.layout-editor-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 220px) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(82, 217, 255, .24);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(82,217,255,.08), rgba(117,104,255,.08)), var(--surface);
  box-shadow: var(--shadow-soft);
}
.layout-editor-bar > div { display: grid; gap: 3px; min-width: 0; }
.layout-editor-bar strong { font-size: 13px; }
.layout-editor-bar small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.layout-editor-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.field.compact { gap: 5px; }
.field.compact select { min-height: 38px; }
.layout-edit-panel {
  position: relative;
  overflow: visible;
  outline: 1px dashed rgba(82, 217, 255, .28);
  outline-offset: 4px;
  transition: transform .28s cubic-bezier(.22,1,.36,1), outline-color .2s ease, box-shadow .2s ease, opacity .2s ease;
  will-change: transform;
}
.layout-edit-panel.is-dragging {
  opacity: .58;
  outline-color: rgba(255, 184, 77, .7);
  transform: scale(.992);
}
.layout-edit-panel.is-resizing {
  outline-color: rgba(255, 184, 77, .72);
  box-shadow: 0 0 0 1px rgba(255, 184, 77, .18), 0 18px 42px rgba(0,0,0,.24);
}
.layout-edit-panel.layout-drop-before,
.layout-edit-panel.layout-drop-after {
  outline-color: rgba(82, 217, 255, .72);
  box-shadow: 0 0 0 1px rgba(82, 217, 255, .18), 0 16px 34px rgba(0,0,0,.22);
}
.layout-edit-panel.layout-drop-before { transform: translateY(-4px); }
.layout-edit-panel.layout-drop-after { transform: translateY(4px); }
.layout-drag-handle,
.layout-resize-handle {
  position: absolute;
  z-index: 8;
  right: 9px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(82,217,255,.36);
  border-radius: 10px;
  background: rgba(9, 15, 31, .94);
  color: var(--cyan);
  box-shadow: 0 10px 24px rgba(0,0,0,.24);
}
.layout-drag-handle {
  top: 9px;
  cursor: grab;
}
.layout-drag-handle:active { cursor: grabbing; }
.layout-resize-handle {
  right: 8px;
  bottom: 8px;
  color: var(--amber);
  cursor: nwse-resize;
  touch-action: none;
}
.layout-resize-handle:active { cursor: nwse-resize; }
.layout-editor-active .layout-edit-container { outline: 1px dashed rgba(117,104,255,.2); outline-offset: 8px; }
.map-editor { grid-column: 1 / -1; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--input); }
.map-editor > span { font-weight: 700; }
.map-rows { display: grid; gap: 8px; margin: 10px 0; }
.map-row { display: grid; grid-template-columns: minmax(120px, .8fr) minmax(160px, 1.2fr) 38px; align-items: end; gap: 8px; }
.map-entry-field { display: grid; gap: 5px; min-width: 0; }
.map-entry-field > small { color: var(--text-soft); font-size: 10px; font-weight: 700; }
.map-row input, .map-row select { width: 100%; }
.role-colour { width: 13px; height: 36px; flex: 0 0 13px; border-radius: 8px; box-shadow: 0 0 18px currentColor; }
.list { max-width: 100%; }
.list-item .actions { flex: 0 0 auto; }
.role-inventory-list { max-height: 720px; overflow-y: auto; padding-right: 4px; }
.member-search-results { display: grid; gap: 8px; margin-top: -6px; }
.member-search-results button {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--text);
  text-align: left;
  box-shadow: none;
}
.member-search-results button:hover { border-color: var(--line-strong); background: var(--surface-hover); }
.member-search-results strong { font-size: 13px; }
.member-search-results span, .member-search-results small { color: var(--muted); font-size: 11px; }

/* Guided experience and interaction polish */
.page-guide {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 17px;
  overflow: hidden;
  padding: 17px 19px;
  border: 1px solid rgba(117, 104, 255, .25);
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, rgba(117,104,255,.15), rgba(17,22,40,.76) 48%, rgba(82,217,255,.07));
  box-shadow: 0 14px 40px rgba(0,0,0,.14), inset 0 1px rgba(255,255,255,.035);
}
.page-guide::after { content: ""; position: absolute; right: -55px; width: 180px; height: 180px; border: 1px solid rgba(82,217,255,.12); border-radius: 50%; pointer-events: none; }
.guide-icon { display: grid; place-items: center; width: 54px; height: 54px; border: 1px solid rgba(163,156,255,.28); border-radius: 17px; background: linear-gradient(145deg, rgba(117,104,255,.3), rgba(82,217,255,.1)); color: white; font-size: 23px; box-shadow: 0 12px 30px rgba(68,57,200,.2); }
.guide-copy { min-width: 0; }
.guide-copy .section-kicker { margin-bottom: 3px; }
.guide-copy h2 { margin: 0 0 3px; font-size: 16px; letter-spacing: -.015em; }
.guide-copy p { margin: 0; font-size: 11px; }
.guide-tips { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 9px; }
.guide-tips span { display: inline-flex; align-items: center; gap: 5px; color: var(--text-soft); font-size: 10px; }
.guide-tips i { color: var(--green); font-style: normal; }
.guide-action { z-index: 1; display: grid; justify-items: end; gap: 8px; }
.guide-action small { color: var(--muted); font-size: 9px; }
.guide-action button span { transition: transform .18s ease; }
.guide-action button:hover span { transform: translateX(3px); }

.content-grid > .card, .content-grid > .panel, .content-grid > form, .content-grid > .section-header { animation: card-arrive .42s both cubic-bezier(.2,.8,.2,1); }
.content-grid > :nth-child(2) { animation-delay: 35ms; }
.content-grid > :nth-child(3) { animation-delay: 70ms; }
.content-grid > :nth-child(4) { animation-delay: 105ms; }
.content-grid > :nth-child(5) { animation-delay: 140ms; }
.content-grid > :nth-child(n+6) { animation-delay: 175ms; }
@keyframes card-arrive { from { opacity: 0; transform: translateY(12px) scale(.992); } to { opacity: 1; transform: none; } }

.panel, .card { transition: border-color .22s ease, box-shadow .22s ease, transform .22s ease, background .22s ease; }
.card:hover { border-color: rgba(163,156,255,.26); box-shadow: 0 16px 42px rgba(0,0,0,.2); }
.metric-card:hover { transform: translateY(-3px); }
.metric-card:hover .metric-icon, .card:hover .card-icon { transform: rotate(-3deg) scale(1.05); }
.metric-icon, .card-icon { transition: transform .22s cubic-bezier(.2,.8,.2,1), background .22s; }
.hero { border-color: rgba(117,104,255,.24); }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.025) 48%, transparent 65%); transform: translateX(-100%); animation: hero-sheen 8s ease-in-out infinite; pointer-events: none; }
@keyframes hero-sheen { 0%, 70% { transform: translateX(-100%); } 90%, 100% { transform: translateX(100%); } }

form.form-dirty { border-color: rgba(247,199,106,.35); box-shadow: 0 0 0 1px rgba(247,199,106,.08), var(--shadow-soft); }
form.form-dirty::after { content: "Unsaved changes"; position: absolute; top: 12px; right: 14px; padding: 4px 8px; border: 1px solid rgba(247,199,106,.22); border-radius: 999px; background: var(--amber-soft); color: var(--amber); font-size: 9px; font-weight: 800; letter-spacing: .03em; }
form.form-dirty .card-header { padding-right: 108px; }
.is-busy > span:first-child { display: inline-block; animation: busy-spin .8s linear infinite; }
@keyframes busy-spin { to { transform: rotate(360deg); } }

.quick-search { position: relative; transition: width .22s ease, border-color .18s, box-shadow .18s; }
.quick-search:focus-within { width: min(310px, 30vw); border-color: rgba(117,104,255,.48); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-soft); }
.quick-search-results { position: absolute; z-index: 90; top: calc(100% + 9px); right: 0; display: grid; width: min(430px, calc(100vw - 30px)); padding: 7px; border: 1px solid var(--line-strong); border-radius: 15px; background: var(--surface-solid); box-shadow: var(--shadow); animation: palette-in .18s ease; }
.quick-search-results button { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--text-soft); text-align: left; }
.quick-search-results button:hover { background: var(--surface-hover); color: var(--text); }
.quick-search-results button > span:nth-child(2) { display: grid; min-width: 0; }
.quick-search-results strong { font-size: 11px; }
.quick-search-results small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.quick-search-results button > i { color: var(--accent-bright); font-style: normal; }
.quick-search-results p { margin: 8px; font-size: 11px; }
@keyframes palette-in { from { opacity: 0; transform: translateY(-5px) scale(.98); } }

.drawer-backdrop { position: fixed; z-index: 110; inset: 0; background: rgba(3,5,13,.6); backdrop-filter: blur(5px); animation: fade-in .2s ease; }
.help-drawer { position: fixed; z-index: 120; top: 0; right: 0; display: grid; grid-template-rows: auto 1fr auto; width: min(420px, 100vw); height: 100vh; padding: 24px; border-left: 1px solid var(--line-strong); background: rgba(12,16,31,.97); box-shadow: -30px 0 80px rgba(0,0,0,.35); transform: translateX(105%); transition: transform .32s cubic-bezier(.2,.8,.2,1); }
:root[data-theme="light"] .help-drawer { background: rgba(255,255,255,.98); }
.help-drawer.open { transform: none; }
.help-drawer > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 19px; border-bottom: 1px solid var(--line); }
.help-drawer h2 { margin: 2px 0 0; font-size: 22px; }
.help-content { display: grid; align-content: start; gap: 21px; overflow-y: auto; padding: 22px 2px; }
.help-content section:not(.help-current) > h3 { margin-bottom: 10px; color: var(--text-soft); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.help-current { display: flex; gap: 13px; padding: 14px; border: 1px solid rgba(117,104,255,.22); border-radius: 15px; background: var(--accent-soft); }
.help-page-icon { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; background: rgba(117,104,255,.18); color: var(--accent-bright); font-size: 20px; }
.help-current > div > span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.help-current h3 { margin: 1px 0 4px; font-size: 16px; }
.help-current p { margin: 0; font-size: 11px; }
.help-checklist { display: grid; gap: 8px; }
.help-checklist span { display: flex; align-items: center; gap: 8px; color: var(--text-soft); font-size: 11px; }
.help-checklist i { display: grid; place-items: center; width: 19px; height: 19px; border-radius: 6px; background: var(--green-soft); color: var(--green); font-style: normal; }
.help-next { display: flex; align-items: center; justify-content: space-between; gap: 15px; width: 100%; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); color: var(--text); text-align: left; }
.help-next:hover { border-color: rgba(117,104,255,.35); background: var(--surface-hover); }
.help-next > span { display: grid; }
.help-next small { color: var(--muted); font-size: 9px; }
.help-next > i { color: var(--accent-bright); font-style: normal; font-size: 18px; }
.help-safety { display: flex; gap: 11px; padding: 13px; border: 1px solid rgba(76,221,160,.18); border-radius: 13px; background: var(--green-soft); }
.help-safety > span { color: var(--green); }
.help-safety p { margin: 3px 0 0; font-size: 10px; }
.help-drawer > footer { padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.help-drawer > footer > span { display: block; margin-bottom: 7px; text-transform: uppercase; letter-spacing: .08em; }
.help-drawer footer kbd { margin: 0 3px 0 7px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-soft); }

.tour-backdrop { position: fixed; z-index: 150; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(3,5,13,.72); backdrop-filter: blur(10px); animation: fade-in .28s ease; }
.tour-card { display: grid; grid-template-columns: .72fr 1.28fr; width: min(880px, 100%); max-height: calc(100vh - 40px); overflow: auto; border: 1px solid rgba(163,156,255,.28); border-radius: 28px; background: var(--surface-solid); box-shadow: 0 40px 120px rgba(0,0,0,.5); animation: tour-in .42s cubic-bezier(.2,.8,.2,1); }
.tour-visual { position: relative; display: grid; min-height: 520px; place-items: center; overflow: hidden; background: radial-gradient(circle at center, rgba(117,104,255,.36), transparent 38%), linear-gradient(145deg,#151a38,#080b17); }
.tour-mark { z-index: 2; width: 90px; height: 90px; border-radius: 28px; transform: scale(1.2); animation: tour-float 3s ease-in-out infinite; }
.tour-orbit { position: absolute; width: 280px; height: 280px; border: 1px solid rgba(163,156,255,.2); border-radius: 50%; box-shadow: 0 0 0 55px rgba(117,104,255,.035), 0 0 0 110px rgba(82,217,255,.02); animation: orbit-spin 14s linear infinite; }
.tour-orbit::after { content: ""; position: absolute; top: 22px; left: 37px; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 18px var(--cyan); }
.tour-copy { padding: 44px; }
.tour-copy h2 { margin: 5px 0 12px; font-size: clamp(25px,3vw,34px); line-height: 1.1; letter-spacing: -.035em; }
.tour-copy > p { font-size: 13px; }
.tour-points { display: grid; gap: 11px; margin: 24px 0; }
.tour-points > span { display: flex; gap: 11px; padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.tour-points b { display: grid; place-items: center; width: 27px; height: 27px; flex: 0 0 27px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-bright); }
.tour-points span span { display: grid; }
.tour-points small { color: var(--muted); font-size: 10px; }
.tour-actions { display: flex; justify-content: flex-end; gap: 9px; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes tour-in { from { opacity: 0; transform: translateY(22px) scale(.97); } }
@keyframes tour-float { 50% { transform: scale(1.2) translateY(-8px); } }
@keyframes orbit-spin { to { transform: rotate(360deg); } }

/* Device-aware application shells */
.mobile-dock { display: none; }

html[data-layout="desktop"] .workspace {
  width: min(100%, 1680px);
  margin-inline: auto;
}
html[data-layout="desktop"] .topbar {
  min-height: 76px;
  margin: 14px 0 24px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-solid) 78%, transparent);
  box-shadow: 0 12px 42px rgba(0,0,0,.14), inset 0 1px rgba(255,255,255,.035);
  backdrop-filter: blur(22px) saturate(140%);
}
html[data-layout="desktop"] .topbar::before {
  content: "";
  position: absolute;
  inset: -1px auto -1px -1px;
  width: 3px;
  border-radius: 18px 0 0 18px;
  background: linear-gradient(var(--accent-bright), var(--cyan));
  box-shadow: 0 0 18px rgba(117,104,255,.45);
}
html[data-layout="desktop"] .panel,
html[data-layout="desktop"] .card {
  background-image: linear-gradient(145deg, rgba(255,255,255,.025), transparent 42%);
}
html[data-layout="desktop"] .card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 55px rgba(0,0,0,.23), 0 0 0 1px rgba(117,104,255,.08);
}

html[data-layout="mobile"] body {
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
  overscroll-behavior-y: contain;
}
html[data-layout="mobile"] .app-shell { grid-template-columns: 1fr; min-height: var(--app-height, 100dvh); }
html[data-layout="mobile"] .workspace {
  width: 100%;
  max-width: 100vw;
  padding: 0 14px 28px;
  overflow-x: clip;
}
html[data-layout="mobile"] .sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(330px, calc(100vw - 42px));
  height: var(--app-height, 100dvh);
  transform: translateX(-104%);
  box-shadow: 24px 0 80px rgba(0,0,0,.45);
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
html[data-layout="mobile"] .sidebar.open { transform: translateX(0); }
html[data-layout="mobile"] .sidebar-close,
html[data-layout="mobile"] .mobile-menu { display: grid; }
html[data-layout="mobile"] .mobile-backdrop {
  position: fixed;
  z-index: 25;
  inset: 0;
  background: rgba(3,5,13,.72);
  backdrop-filter: blur(8px);
  animation: fade-in .2s ease;
}
html[data-layout="mobile"] .topbar {
  min-height: 74px;
  margin: 8px 0 14px;
  padding: 10px 2px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
}
html[data-layout="mobile"] .topbar-actions { gap: 6px; }
html[data-layout="mobile"] .quick-search,
html[data-layout="mobile"] #refreshButton,
html[data-layout="mobile"] .status-chip { display: none; }
html[data-layout="mobile"] .view { width: 100%; max-width: 100%; gap: 13px; }
html[data-layout="mobile"] .content-grid { gap: 12px; }
html[data-layout="mobile"] .flow-grid,
html[data-layout-editor-mode="mobile"] .flow-grid {
  grid-auto-flow: row;
  grid-auto-rows: auto;
}
html[data-layout="mobile"] .flow-grid > *,
html[data-layout-editor-mode="mobile"] .flow-grid > * { grid-row: auto !important; }
html[data-layout="mobile"] .span-3,
html[data-layout="mobile"] .span-4,
html[data-layout="mobile"] .span-5,
html[data-layout="mobile"] .span-6,
html[data-layout="mobile"] .span-7,
html[data-layout="mobile"] .span-8,
html[data-layout-editor-mode="mobile"] .span-3,
html[data-layout-editor-mode="mobile"] .span-4,
html[data-layout-editor-mode="mobile"] .span-5,
html[data-layout-editor-mode="mobile"] .span-6,
html[data-layout-editor-mode="mobile"] .span-7,
html[data-layout-editor-mode="mobile"] .span-8 { grid-column: span 12; }
html[data-layout="mobile"] .panel,
html[data-layout="mobile"] .card {
  border-radius: 18px;
  box-shadow: 0 12px 34px rgba(0,0,0,.16);
}
html[data-layout="mobile"] .button,
html[data-layout="mobile"] button.primary,
html[data-layout="mobile"] .button-secondary,
html[data-layout="mobile"] .button-danger { min-height: 44px; }
html[data-layout="mobile"] .logout-confirm-card { padding: 28px 20px; border-radius: 21px; }
html[data-layout="mobile"] input,
html[data-layout="mobile"] select { min-height: 46px; }
html[data-layout="mobile"] .map-row { grid-template-columns: minmax(0, 1fr) 38px; }
html[data-layout="mobile"] .map-row .map-entry-field:first-child { grid-column: 1 / -1; }
html[data-layout="mobile"] .loading-bar { left: 0; }
html[data-layout="mobile"] .mobile-dock {
  position: fixed;
  z-index: 45;
  right: 10px;
  bottom: max(10px, env(safe-area-inset-bottom));
  left: 10px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0,1fr));
  min-height: 68px;
  padding: 7px;
  border: 1px solid rgba(163,156,255,.2);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface-solid) 91%, transparent);
  box-shadow: 0 18px 55px rgba(0,0,0,.42), inset 0 1px rgba(255,255,255,.07);
  backdrop-filter: blur(24px) saturate(150%);
}
html[data-layout="mobile"] .mobile-dock button {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  min-width: 0;
  min-height: 52px;
  padding: 4px 2px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  transition: color .2s ease, background .2s ease, transform .2s ease;
}
html[data-layout="mobile"] .mobile-dock button > span { font-size: 19px; line-height: 1; }
html[data-layout="mobile"] .mobile-dock button small { overflow: hidden; font-size: 9px; font-weight: 750; text-overflow: ellipsis; }
html[data-layout="mobile"] .mobile-dock button.active {
  background: linear-gradient(145deg, rgba(117,104,255,.26), rgba(82,217,255,.09));
  color: var(--text);
  transform: translateY(-2px);
}
html[data-layout="mobile"] .mobile-dock button.active::after {
  content: "";
  position: absolute;
  bottom: 3px;
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: var(--cyan);
  box-shadow: 0 0 9px var(--cyan);
}

@media (max-width: 1180px) {
  .span-3 { grid-column: span 6; }
  .span-4, .span-5, .span-7, .span-8 { grid-column: span 6; }
  .form-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-search { display: none; }
  .setup-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .platform-tabs { grid-template-columns: 1fr; }
  .platform-tab { justify-content: flex-start; }
  .platform-tab img { max-width: 96px; }
  .settings-section { grid-column: span 12; }
  .layout-editor-bar { grid-template-columns: 1fr; align-items: stretch; }
  .layout-editor-bar .badge { width: max-content; }
  .layout-editor-actions { justify-content: flex-start; }
}

@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; transform: translateX(-102%); width: min(var(--sidebar-width), calc(100vw - 54px)); box-shadow: var(--shadow); transition: transform .24s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: grid; margin-left: auto; }
  .mobile-menu { display: grid; }
  .mobile-backdrop { position: fixed; inset: 0; z-index: 25; background: rgba(3, 5, 11, .68); backdrop-filter: blur(4px); }
  .workspace { padding: 0 18px 36px; }
  .loading-bar { left: 0; }
  .topbar { min-height: 98px; }
  .status-chip { display: none; }
  .span-3, .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 12; }
  .flow-grid { grid-auto-flow: row; grid-auto-rows: auto; }
  .flow-grid > * { grid-row: auto !important; }
  .flow-grid > .span-3,
  .flow-grid > .span-4,
  .flow-grid > .span-5,
  .flow-grid > .span-6,
  .flow-grid > .span-7,
  .flow-grid > .span-8 { grid-column: span 12; }
  .hero { align-items: flex-start; padding: 22px; }
  .hero-copy { align-items: flex-start; }
  .hero-avatar { width: 58px; height: 58px; flex-basis: 58px; border-radius: 18px; }
  .hero-orbit { opacity: .5; }
  .auth-card { grid-template-columns: 1fr; }
  .auth-visual { min-height: 190px; }
  .auth-logo { width: 78px; height: 78px; border-radius: 24px; }
  .auth-copy { padding: 32px; }
  .preset-grid { grid-template-columns: 1fr; }
  .settings-section { grid-column: span 12; }
  .setup-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-intro { align-items: flex-start; flex-direction: column; }
  .page-guide { grid-template-columns: 46px minmax(0,1fr); }
  .guide-icon { width: 46px; height: 46px; border-radius: 14px; }
  .guide-action { grid-column: 2; justify-items: start; }
  .guide-action small { display: none; }
  .tour-card { grid-template-columns: 1fr; width: min(560px,100%); }
  .tour-visual { min-height: 150px; }
  .tour-orbit { width: 190px; height: 190px; }
  .tour-mark { transform: scale(.82); animation-name: none; }
  .server-onboarding { grid-template-columns: 1fr; min-height: auto; }
  .onboarding-visual { min-height: 240px; }
  .onboarding-copy { max-width: none; padding: 10px 38px 48px; }
  .onboarding-orbit.orbit-b { width: 350px; height: 350px; }
  .blueprint-lifecycle { grid-template-columns: 1fr; }.blueprint-lifecycle-action { justify-items: start; min-width: 0; }.blueprint-lifecycle-action small { text-align: left; }
  .setup-requirement-grid { grid-template-columns: 1fr; }
  .setup-requirement-column { display: contents; }
  .setup-requirement-configuration { order: 1; }
  .setup-requirement-channels { order: 2; }
  .setup-requirement-features { order: 3; }
  .setup-checklist.is-compact .setup-requirement-grid { max-height: 480px; }
}

@media (max-width: 590px) {
  .workspace { width: 100vw; max-width: 100vw; padding-inline: 13px; overflow-x: clip; }
  .view { width: 100%; max-width: calc(100vw - 26px); }
  .page-guide, .panel, .card, .guide-copy, .hero-copy > div { min-width: 0; }
  .guide-copy p, .hero-copy p { overflow-wrap: anywhere; }
  .topbar { align-items: flex-start; gap: 10px; }
  .page-heading p, .eyebrow { display: none; }
  h1 { font-size: 24px; }
  .topbar-actions { gap: 5px; }
  .topbar-actions .icon-button { width: 37px; height: 37px; }
  .topbar-actions #refreshButton { display: none; }
  .content-grid { gap: 12px; }
  .panel, .card { padding: 15px; border-radius: 14px; }
  .hero { min-height: auto; }
  .hero-copy { display: grid; }
  .hero h2 { font-size: 20px; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .platform-tabs { gap: 8px; padding: 6px; border-radius: 16px; }
  .platform-tab { min-height: 54px; padding: 10px 12px; border-radius: 13px; }
  .platform-tab img { width: 72px; height: 24px; }
  .subpage-tabs { grid-template-columns: 1fr; }
  .check-grid { grid-template-columns: 1fr; }
  .reaction-binding-row { grid-template-columns: 1fr 34px; }
  .reaction-binding-row .emoji-field { grid-column: 1 / -1; }
  .card-header, .section-header { display: grid; }
  .card-header > .badge, .card-header > .pill { width: max-content; justify-self: start; }
  .form-actions { justify-content: stretch; }
  .form-actions > * { flex: 1; }
  .audit-entry { grid-template-columns: 34px minmax(0, 1fr); }
  .audit-entry time { grid-column: 2; }
  .auth-copy { padding: 25px 20px; }
  .auth-copy h2 { font-size: 23px; }
  .setup-steps { grid-template-columns: 1fr; }
  .setup-checklist-summary { align-items: stretch; }
  .setup-checklist-summary > span { flex: 1; text-align: center; }
  .setup-checklist-summary small { width: 100%; margin-left: 0; }
  .setup-requirement { align-items: flex-start; flex-wrap: wrap; }
  .setup-requirement .button-sm,
  .setup-requirement > .badge { width: calc(100% - 34px); margin-left: 34px; justify-content: center; }
  .list-item { align-items: flex-start; flex-wrap: wrap; }
  .list-item .actions { width: 100%; padding-left: 46px; }
  .page-guide { grid-template-columns: 1fr; padding: 15px; }
  .guide-icon { display: none; }
  .guide-action { grid-column: 1; }
  .guide-tips { display: grid; gap: 5px; }
  .blueprint-global-notice { align-items: stretch; flex-direction: column; gap: 12px; }
  .blueprint-global-notice button { width: 100%; }
  .quick-search-results { position: fixed; top: 86px; right: 12px; left: 12px; width: auto; }
  .tour-copy { padding: 27px 22px; }
  .tour-copy h2 { font-size: 25px; }
  .tour-visual { min-height: 112px; }
  .tour-mark { transform: scale(.65); }
  .tour-points { margin: 18px 0; }
  .tour-actions { display: grid; }
  form.form-dirty::after { top: 10px; right: 10px; }
  form.form-dirty .card-header { padding-right: 0; padding-top: 24px; }
  .server-onboarding { border-radius: 21px; }
  .onboarding-visual { min-height: 180px; }
  .onboarding-mark { width: 88px; height: 88px; border-radius: 27px; gap: 10px; }
  .onboarding-mark span { width: 10px; height: 15px; }
  .onboarding-orbit.orbit-a { width: 205px; height: 205px; }
  .onboarding-orbit.orbit-b { width: 280px; height: 280px; }
  .onboarding-copy { padding: 6px 20px 30px; }
  .onboarding-copy h2 { font-size: 30px; }
  .onboarding-actions { display: grid; }
  .onboarding-note { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
