/* HELIS shared interface: approved sidebar layout, with the existing routes,
   access checks and form controls retained. Registration has its own styles. */
body.helis-shell {
  --bg: #0c0e16;
  --bg-2: #10121c;
  --panel: #141721;
  --panel-2: #1b1e2b;
  --border: #272b39;
  --text: #eeedf5;
  --muted: #a0a5b6;
  --accent: #8370ed;
  --accent-2: #b8aaff;
  --accent-3: #9a87fa;
  --accent-glow: rgba(131,112,237,.22);
  --grad-accent: linear-gradient(135deg, #8370ed, #7560df);
  --grad-accent-soft: rgba(131,112,237,.12);
  --shadow: 0 8px 24px rgba(0,0,0,.12);
  --radius: 14px;
  --sidebar-width: 238px;
  --header-height: 76px;
  color-scheme: dark;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
.helis-shell::before { display: none; }
.helis-shell > .topbar {
  height: var(--header-height); min-height: var(--header-height); padding: 16px 26px;
  background: var(--bg-2); border-bottom: 1px solid var(--border);
  box-shadow: none; backdrop-filter: none; animation: none; gap: 24px;
}
.helis-shell > .topbar::before, .helis-shell > .topbar::after { display: none; }
.helis-shell .brand { min-width: 186px; gap: 11px; }
.helis-shell .brand-logo { width: 38px; height: 38px; box-shadow: none !important; border: 1px solid var(--border); }
.helis-shell .brand-name { font-size: 23px; letter-spacing: .12em; text-shadow: none; }
.helis-shell .brand-sub { font: 8px var(--font-body); letter-spacing: .14em; color: var(--muted) !important; text-shadow: none; }
.app-header-caption { color: var(--muted); font-size: 12px; margin-right: auto; }
.helis-shell .user-area { margin-left: auto; gap: 12px; }
.helis-shell .user-chip, .helis-shell .news-button, .helis-shell .lang-switch { background: transparent; border-color: var(--border); box-shadow: none; }
.helis-shell .user-chip { max-width: 260px; font-size: 12px; }
.helis-shell .user-chip > span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.helis-shell .lang-switch a { font-size: 10px; padding: 6px 8px; }
.helis-shell .lang-switch a.active { background: var(--panel-2); color: var(--text); box-shadow: none; }
.helis-shell .bot-status-pill { font-size: 10px; box-shadow: none; background: transparent; }
.app-sidebar { position: fixed; z-index: 40; top: var(--header-height); left: 0; bottom: 0; width: var(--sidebar-width); margin: 0; background: var(--bg-2); border-right: 1px solid var(--border); }
.sidebar-toggle { display: none; }
.sidebar-content { height: calc(100dvh - var(--header-height)); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--border) transparent; padding: 23px 15px; display: flex; flex-direction: column; }
.sidebar-server { display: flex; align-items: center; gap: 11px; padding: 0 9px 20px; min-width: 0; }
.sidebar-server > span:last-child { min-width: 0; }
.sidebar-server strong { display: block; font-size: 13px; font-weight: 550; overflow-wrap: anywhere; }
.sidebar-server small { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.sidebar-server-icon { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); color: var(--accent-2); }
.sidebar-caption { padding: 18px 11px 10px; color: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: .12em; }
.sidebar-links { display: flex; flex-direction: column; gap: 3px; }
.sidebar-links a, .sidebar-bottom a { display: flex; align-items: center; gap: 11px; min-height: 40px; padding: 10px 12px; border-radius: 8px; border: 1px solid transparent; color: var(--muted); font-size: 12px; line-height: 1.4; transition: background .15s, color .15s; }
.sidebar-links a:hover, .sidebar-bottom a:hover { color: var(--text); background: var(--panel-2); }
.sidebar-links a.active, .sidebar-links a[aria-current="page"], .sidebar-bottom a[aria-current="page"] { color: var(--accent-2); background: var(--grad-accent-soft); }
.sidebar-links .ico, .sidebar-links .nav-ico .ico { color: currentColor; font-size: 17px; flex-shrink: 0; }
.sidebar-links .nav-ico { display: inline-flex; width: auto; height: auto; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.sidebar-links a.locked { color: var(--muted); opacity: .7; }
.sidebar-links a.locked:hover { opacity: 1; }
.app-sidebar:has(.tour-highlight) { z-index: 9001; }
.helis-shell #my-servers { scroll-margin-top: 100px; }
.sidebar-bottom { margin-top: auto; padding-top: 24px; }
.sidebar-bottom > span { display: flex; align-items: center; gap: 10px; margin-top: 17px; padding: 18px 12px 0; border-top: 1px solid var(--border); font-size: 10px; color: var(--muted); }
.helis-shell.has-sidebar > .container { margin-left: var(--sidebar-width); width: calc(100% - var(--sidebar-width)); max-width: none; padding: 30px 36px 40px; animation: none; min-width: 0; }
.helis-shell.has-sidebar > .footer { margin-left: var(--sidebar-width); width: calc(100% - var(--sidebar-width)); max-width: none; padding: 20px 36px; border-color: var(--border); font-size: 11px; }
.helis-shell .container > * { min-width: 0; }
.helis-shell h1, .helis-shell h2, .helis-shell h3 { color: var(--text); font-family: var(--font-body); font-weight: 600; }
.helis-shell h1 { font-size: 28px; letter-spacing: -.04em; }
.helis-shell h2 { font-size: 18px; letter-spacing: -.025em; }
.helis-shell .subtitle { font-size: 13px; line-height: 1.7; }
.helis-shell .card, .helis-shell .guild-card, .helis-shell .table-wrap, .helis-shell .profile-mini-card, .helis-shell .calm-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: none; animation: none; }
.helis-shell .card::before, .helis-shell .card::after { display: none; }
.helis-shell .card-link:hover { transform: translateY(-2px); box-shadow: none; border-color: var(--accent); }
.helis-shell .card { padding: 22px; }
.helis-shell .btn { border-radius: 8px; border-color: var(--border); background: var(--panel-2); font-weight: 550; box-shadow: none; font-size: 13px; letter-spacing: 0; }
.helis-shell .btn::before { display: none; }
.helis-shell .btn:hover { transform: none; box-shadow: none; filter: none; border-color: var(--accent); }
.helis-shell .btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.helis-shell .btn-primary:hover { background: #907cf4; }
.helis-shell .btn-ghost { background: transparent; }
.helis-shell .btn-danger { background: rgba(248,81,73,.06); border-color: rgba(248,81,73,.35); color: var(--red); }
.helis-shell .btn-ok { background: rgba(63,185,80,.14); border-color: rgba(63,185,80,.35); color: #85d997; }
.helis-shell .btn-accent { background: rgba(224,168,58,.14); color: #edc976; border-color: rgba(224,168,58,.35); }
.helis-shell .pill, .helis-shell .badge, .helis-shell .lux-pill { box-shadow: none; font-weight: 500; font-size: 11px; }
.helis-shell .stat .num { font: 600 30px/1.2 var(--font-body); letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.helis-shell .stat .label { font-size: 12px; }
.helis-shell .table-wrap { overflow-x: auto; }
.helis-shell table { background: transparent; font-size: 13px; }
.helis-shell th { color: var(--muted); background: var(--bg-2); font-size: 11px; font-weight: 500; letter-spacing: .025em; text-transform: none; border-bottom-color: var(--border); }
.helis-shell td { border-bottom-color: var(--border); padding-top: 15px; padding-bottom: 15px; }
.helis-shell tbody tr:nth-child(even) td { background: transparent; }
.helis-shell tbody tr:hover td { background: rgba(131,112,237,.05); }
.helis-shell input, .helis-shell select, .helis-shell textarea, .helis-shell .rs-trigger { background: var(--bg-2); border-color: var(--border); border-radius: 8px; box-shadow: none; color: var(--text); }
.helis-shell input:focus, .helis-shell select:focus, .helis-shell textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.helis-shell .tabs { box-shadow: none; background: var(--panel); border-color: var(--border); }
.helis-shell .tabs a { font-size: 12px; font-weight: 500; }
.helis-shell .tabs a.active { background: var(--grad-accent-soft); color: var(--accent-2); box-shadow: none; }
.family-page-head { align-items: center; margin-bottom: 24px; }
.family-page-head .subtitle { font-size: 10px; margin: 6px 0 0; color: var(--muted); }
.family-page-head .btn { font-size: 11px; padding: 8px 12px; }
.family-breadcrumb, .family-breadcrumb-current, .family-breadcrumb-separator { font-size: 11px; color: var(--muted); }
.family-breadcrumb-current { color: var(--text); }
.family-breadcrumb-separator { padding: 0 11px; }
.feature-heading { margin-bottom: 26px; }
.feature-heading h1 { margin-bottom: 8px; }
.feature-heading .subtitle { margin-bottom: 0; }
.helis-welcome { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 28px 32px; margin-bottom: 24px; border-radius: var(--radius); background: #242039; border: 1px solid #3b3157; overflow: hidden; }
.helis-welcome .welcome-eyebrow { display: block; font-size: 10px; letter-spacing: .16em; color: var(--accent-2); margin-bottom: 12px; }
.helis-welcome h2 { font-size: clamp(24px, 2.6vw, 36px); font-weight: 600; letter-spacing: -.04em; margin: 0 0 12px; line-height: 1.2; }
.helis-welcome p { color: #b9b2cb; font-size: 13px; margin: 0; max-width: 500px; }
.helis-welcome .btn { margin-top: 22px; }
.welcome-emblem { font: italic 800 128px/.85 var(--font-display); color: #7765b5; opacity: .6; padding: 0 20px; transform: rotate(-8deg); user-select: none; }
.welcome-emblem small { display: block; font: 500 9px/1.5 var(--font-body); letter-spacing: .18em; margin-top: 20px; white-space: nowrap; }
.helis-shell .server-command-grid { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 18px; margin-bottom: 22px; }
.helis-shell .server-profile-panel, .helis-shell .sync-panel { border: 1px solid var(--border); background: var(--panel); box-shadow: none; border-radius: var(--radius); padding: 18px 20px; }
.helis-shell .server-profile-panel h2 { font-size: 17px; margin: 5px 0 8px; }
.helis-shell .server-profile-panel .mono { font-size: 11px; }
.helis-shell .sync-panel strong { font-size: 12px; }
.helis-shell .sync-panel p, .helis-shell .sync-panel .muted { font-size: 11px; }
.helis-shell .attention-grid { margin-bottom: 22px; }
.helis-shell .family-overview-stats { grid-template-columns: repeat(3,minmax(0,1fr)); margin-bottom: 24px; }
.helis-shell .section-title h2 { font-size: 16px; }
.helis-shell .attention-item { background: transparent; border-color: var(--border); box-shadow: none; }
.helis-shell .audit-item { border-color: var(--border); }
.helis-shell .audit-item strong { font-size: 12px; }
.helis-shell .audit-item small, .helis-shell .audit-item time { font-size: 11px; }
.helis-shell .guild-card { overflow: hidden; }
.helis-shell .guild-cover-empty { background: #252038; }
.helis-shell .guild-title { color: var(--text); font-size: 17px; }
.helis-shell .tile-ico { background: var(--grad-accent-soft); box-shadow: none; border-color: var(--border); }
.helis-shell .tile .tile-title { font-size: 16px; color: var(--text); }
.helis-shell .tile .tile-sub { font-size: 12px; }
.helis-shell :is(a, button, summary):focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }
@media (min-width: 1600px) { .helis-shell.has-sidebar > .container { padding-left: 54px; padding-right: 54px; } }
@media (max-width: 1200px) {
  .app-header-caption { display: none; }
  .helis-shell.has-sidebar > .container { padding: 26px 24px; }
  .helis-shell .grid-4 { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .helis-shell .server-command-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1000px) {
  .helis-shell > .topbar { position: relative; height: auto; min-height: 70px; padding: 15px 20px; flex-wrap: wrap; gap: 16px; }
  .helis-shell .brand { min-width: 0; }
  .app-sidebar { position: relative; inset: auto; width: 100%; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar-toggle { display: flex; align-items: center; gap: 10px; padding: 14px 22px; color: var(--text); font-size: 13px; cursor: pointer; list-style: none; }
  .sidebar-toggle::-webkit-details-marker { display: none; }
  .sidebar-toggle > span { margin-left: auto; }
  .app-sidebar[open] .sidebar-toggle > span { transform: rotate(180deg); }
  .sidebar-content { max-height: 65svh; height: auto; padding: 12px 18px 24px; }
  .sidebar-links { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .sidebar-server { padding-bottom: 8px; }
  .sidebar-bottom { padding-top: 12px; }
  .helis-shell.has-sidebar > .container { margin: 0; width: 100%; padding: 24px; }
  .helis-shell.has-sidebar > .footer { margin: 0; width: 100%; padding: 20px 24px; }
}
@media (max-width: 600px) {
  .helis-shell > .topbar { padding: 14px 16px; gap: 12px; }
  .helis-shell .brand-logo { width: 32px; height: 32px; }
  .helis-shell .brand-name { font-size: 20px; }
  .helis-shell .brand-sub { font-size: 6px; }
  .helis-shell .user-area { width: 100%; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
  .helis-shell .user-chip { max-width: 150px; padding: 5px; }
  .helis-shell .user-chip .badge { display: none; }
  .helis-shell .user-area > .btn { padding: 9px; font-size: 11px; }
  .helis-shell .bot-status-pill { display: none; }
  .helis-shell.has-sidebar > .container { padding: 22px 16px; }
  .helis-shell .card { padding: 18px; }
  .helis-shell .grid-4, .helis-shell .grid-3, .helis-shell .grid-2 { grid-template-columns: minmax(0,1fr); }
  .helis-shell .server-command-grid { grid-template-columns: minmax(0,1fr); }
  .helis-shell h1 { font-size: 24px; }
  .family-page-head { margin-bottom: 20px; gap: 10px; }
  .family-page-head .subtitle { overflow-wrap: anywhere; }
  .helis-welcome { padding: 24px 20px; }
  .helis-welcome h2 { font-size: 27px; }
  .welcome-emblem { display: none; }
  .sidebar-links a { padding: 11px 9px; font-size: 12px; }
  .helis-shell .btn { min-height: 40px; }
  .helis-shell .footer { flex-wrap: wrap; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .helis-shell *, .helis-shell *::before, .helis-shell *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
