/* ether dashboard. The air avatar's palette: black, off white, cool grey. Lowercase, like floatstate's channels. */
:root {
  --night: #000000;
  --night-deep: #000000;
  --haze: #101113;
  --haze-up: #17181b;
  --line: #24262a;
  --ash: #8c9099;
  --bone: #edebe6;
  --frost: #edebe6;
  --frost-dim: #5d6168;
  --ember: #d07b86;
  --ember-bg: #2a1518;
  --calm: #edebe6;
  --serif: "Geist", system-ui, sans-serif;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --rail: 264px;
  --radius-s: 8px;
  --radius-m: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--night);
  color: var(--bone);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--frost); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--frost); outline-offset: 2px; }
.muted { color: var(--ash); }
.serif { font-family: var(--serif); font-weight: 600; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  border: 1px solid var(--line); background: var(--haze-up); color: var(--bone);
  padding: 9px 16px; border-radius: var(--radius-s); cursor: pointer; text-decoration: none;
  font-weight: 600; font-size: 14px; white-space: nowrap;
}
.btn:hover { border-color: var(--frost-dim); }
.btn.primary { background: var(--frost); color: var(--night-deep); border-color: var(--frost); }
.btn.primary:hover { background: #cdd8e6; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--ember); }
.btn.small { padding: 6px 11px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: default; }

/* ---------- landing ---------- */
.landing { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: 28px 48px; }
.landing nav { display: flex; justify-content: space-between; align-items: center; }
.landing nav a.quiet { color: var(--ash); text-decoration: none; font-size: 14px; }
.landing nav a.quiet:hover { color: var(--bone); }
.hero { flex: 1; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 64px; align-items: center; width: 100%; padding: 48px 0; }
.hero h1 { font-size: clamp(48px, 7.4vw, 104px); font-weight: 600; letter-spacing: -.055em; line-height: .92; margin: 0; }
.hero h1 span { display: block; color: var(--ash); }
.hero p { color: var(--ash); font-size: 17px; max-width: 34ch; margin: 28px 0 32px; }
.hero .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.landing .btn { border-radius: 4px; }
.landing .btn.primary { background: var(--bone); border-color: var(--bone); color: #000; }
.landing .note { margin-top: 18px; font-size: 13px; color: var(--frost-dim); max-width: none; }

/* a floatstate style channel list, showing what ether looks after */
.sidebar { border-left: 1px solid var(--line); padding: 8px 0 8px 28px; font-size: 15px; max-width: 420px; }
.sidebar .cat { color: var(--ash); font-size: 13px; padding: 14px 0 6px; }
.sidebar .cat:first-child { padding-top: 0; }
.sidebar .ch { display: flex; align-items: baseline; gap: 10px; padding: 7px 0; color: var(--bone); }
.sidebar .ch b { color: var(--frost-dim); font-weight: 400; width: 14px; text-align: center; flex: none; }
.sidebar .ch em { margin-left: auto; font-style: normal; font-size: 13px; color: var(--ash); white-space: nowrap; }
.sidebar .ch em.on::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--bone); margin-right: 7px; vertical-align: 2px; }
.landing footer { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--frost-dim); font-size: 13px; border-top: 1px solid var(--line); padding-top: 18px; }

/* ---------- top bar (server list) ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 24px; border-bottom: 1px solid var(--line);
}
.brand { font-weight: 600; font-size: 17px; letter-spacing: -.01em; text-decoration: none; color: var(--bone); line-height: 1; }
.brand::before { content: "✦ "; color: var(--ash); }
.me { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.me img { width: 32px; height: 32px; border-radius: 50%; }

.page { max-width: 1040px; margin: 0 auto; padding: 40px 24px 120px; }
.page h1 { font-weight: 600; font-size: 40px; letter-spacing: -.035em; margin: 0 0 6px; line-height: 1.1; }
.page > p { margin: 0 0 32px; color: var(--ash); }

.servers { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.server {
  display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--radius-m);
  background: var(--haze); border: 1px solid transparent; color: inherit; text-decoration: none;
}
.server:hover { border-color: var(--line); }
.server.away { opacity: .62; }
.server .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server .sub { font-size: 13px; color: var(--ash); }
.server .meta { min-width: 0; flex: 1; }
.gicon {
  width: 48px; height: 48px; border-radius: 14px; flex: none; object-fit: cover;
  display: grid; place-items: center; background: var(--haze-up); color: var(--frost);
  font-weight: 700; font-size: 16px;
}

/* ---------- server shell ---------- */
.shell { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 20px 14px 24px;
  border-right: 1px solid var(--line); background: rgba(13,16,24,.55);
}
.rail .brand { display: block; padding: 0 10px 18px; }
.rail .guild { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--radius-m); background: var(--haze); margin-bottom: 18px; }
.rail .guild .gicon { width: 40px; height: 40px; border-radius: 12px; }
.rail .guild .name { font-weight: 600; font-size: 14px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail .guild a { font-size: 12px; color: var(--ash); text-decoration: none; }
.rail .guild a:hover { color: var(--frost); }
.rail .group { font-size: 12px; color: var(--frost-dim); padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-s);
  color: var(--ash); text-decoration: none; font-weight: 500; font-size: 14px;
}
.nav a:hover { color: var(--bone); background: var(--haze); }
.nav a.on { color: var(--bone); background: var(--haze-up); }
.nav svg { width: 18px; height: 18px; flex: none; }
.nav .dot { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.nav .dot.live { background: var(--calm); }
.rail .foot { margin-top: 22px; padding: 0 10px; font-size: 13px; }
.rail .foot a { color: var(--ash); }

.mobilebar { display: none; }

.main { padding: 36px 40px 140px; max-width: 920px; width: 100%; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 8px; flex-wrap: wrap; }
.head h1 { font-weight: 600; font-size: 38px; letter-spacing: -.035em; line-height: 1.05; margin: 0; text-transform: lowercase; }
.intro { color: var(--ash); margin: 0 0 28px; max-width: 60ch; }

/* ---------- settings rows ---------- */
.band { border-top: 1px solid var(--line); padding: 24px 0 8px; }
.band > h2 { font-size: 16px; font-weight: 600; margin: 0 0 4px; }
.band > .hint { color: var(--ash); font-size: 14px; margin: 0 0 12px; max-width: 64ch; }
.row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 24px; align-items: center;
  padding: 14px 0; border-bottom: 1px solid rgba(42,49,64,.55);
}
.row:last-child { border-bottom: 0; }
.row.stack { grid-template-columns: 1fr; }
.row .label { font-weight: 500; }
.row .hint { color: var(--ash); font-size: 13.5px; margin-top: 2px; max-width: 60ch; }
.row.off { opacity: .45; pointer-events: none; }

.master {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 20px; border-radius: var(--radius-m); background: var(--haze); margin-bottom: 8px;
}
.master .label { font-weight: 600; font-size: 16px; }
.master .hint { color: var(--ash); font-size: 14px; }

/* switch */
.switch { position: relative; display: inline-block; vertical-align: middle; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: background .18s; }
.switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--ash); transition: transform .18s, background .18s;
}
.switch input:checked + span { background: var(--frost); }
.switch input:checked + span::after { transform: translateX(18px); background: var(--night-deep); }
.switch input:focus-visible + span { outline: 2px solid var(--frost); outline-offset: 2px; }

/* inputs */
.field, select.field, textarea.field {
  width: 100%; background: var(--night-deep); border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 9px 12px; color: var(--bone); min-height: 40px;
}
.field:focus { border-color: var(--frost-dim); outline: none; }
select.field { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238c9099' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
textarea.field { min-height: 96px; resize: vertical; line-height: 1.5; }
.num { display: flex; align-items: center; gap: 8px; }
.num input { width: 92px; text-align: right; }
.num .unit { color: var(--ash); font-size: 13.5px; min-width: 52px; }
.pick { width: 260px; max-width: 100%; }
.range { display: flex; align-items: center; gap: 12px; width: 260px; max-width: 100%; }
.range input { flex: 1; accent-color: var(--frost); }
.range output { width: 44px; text-align: right; color: var(--frost); font-variant-numeric: tabular-nums; }

/* chips for role and channel lists */
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 99px;
  background: var(--haze-up); border: 1px solid var(--line); font-size: 13.5px;
}
.chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--ash); }
.chip button { border: 0; background: none; color: var(--ash); cursor: pointer; padding: 0 4px; font-size: 16px; line-height: 1; }
.chip button:hover { color: var(--ember); }
.chips select.field { width: auto; min-width: 150px; min-height: 32px; padding-top: 4px; padding-bottom: 4px; border-radius: 99px; font-size: 13.5px; }

.tokens { font-size: 13px; color: var(--ash); margin-top: 6px; }
.tokens code { color: var(--frost); background: var(--night-deep); padding: 1px 6px; border-radius: 5px; }

/* overview */
.figures { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border-radius: var(--radius-m); overflow: hidden; margin: 8px 0 28px; }
.figure { background: var(--haze); padding: 18px 20px; }
.figure b { display: block; font-weight: 500; font-size: 34px; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.figure span { color: var(--ash); font-size: 13.5px; }
.modules .row .label { display: flex; align-items: center; gap: 10px; }
.modules .row a { font-size: 13.5px; color: var(--ash); }
.notice { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-m); background: var(--ember-bg); color: #f0c9ce; font-size: 14px; margin-bottom: 20px; }
.playing { padding: 14px 16px; border-radius: var(--radius-m); border: 1px dashed var(--line); color: var(--ash); font-size: 14px; margin-bottom: 24px; }
.playing b { color: var(--bone); font-weight: 600; }

/* records */
.records { width: 100%; border-collapse: collapse; font-size: 14px; }
.records th { text-align: left; font-weight: 500; color: var(--ash); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.records td { padding: 10px; border-bottom: 1px solid rgba(42,49,64,.55); vertical-align: top; }
.records .who { display: flex; align-items: center; gap: 10px; }
.records .who img { width: 26px; height: 26px; border-radius: 50%; }
.kind { font-size: 12.5px; padding: 2px 8px; border-radius: 99px; background: var(--haze-up); color: var(--frost); white-space: nowrap; }
.kind.timeout, .kind.auto_timeout { background: var(--ember-bg); color: #f0c9ce; }
.empty { padding: 28px; text-align: center; color: var(--ash); border: 1px dashed var(--line); border-radius: var(--radius-m); }

/* rules editor */
.rule { background: var(--haze); border-radius: var(--radius-m); padding: 16px; margin-bottom: 12px; border-left: 3px solid var(--frost-dim); }
.rule.strict { border-left-color: var(--ember); }
.rule .top { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.rule .top .field { font-weight: 600; }
.rule .tools { display: flex; gap: 6px; align-items: center; justify-content: space-between; margin-top: 10px; flex-wrap: wrap; }
.rule .tools label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ash); }
.iconbtn { border: 1px solid var(--line); background: transparent; color: var(--ash); border-radius: var(--radius-s); width: 34px; height: 34px; cursor: pointer; display: grid; place-items: center; flex: none; }
.iconbtn:hover { color: var(--bone); border-color: var(--frost-dim); }
.iconbtn.danger:hover { color: var(--ember); }
.postbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* welcome card editor and its Discord style preview */
.cardgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.preview-wrap { position: sticky; top: 24px; }
.preview-wrap .hint { color: var(--ash); font-size: 13px; margin: 14px 0 8px; }
.colour { display: flex; align-items: center; gap: 10px; color: var(--ash); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.colour input { width: 44px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; cursor: pointer; }
.imgpick { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.imgpick .field { flex: 1 1 220px; }

#preview { background: #313338; border-radius: 8px; padding: 16px 16px 18px; font-family: "gg sans", "Noto Sans", system-ui, sans-serif; }
.dmsg { display: flex; gap: 14px; color: #dbdee1; font-size: 15px; line-height: 1.375; }
.dav { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.dname { color: #f2f3f5; font-weight: 500; margin-bottom: 2px; }
.dtag { background: #5865f2; color: #fff; font-size: 10px; font-weight: 600; padding: 1px 5px; border-radius: 3px; vertical-align: 2px; }
.dtext { margin-bottom: 4px; overflow-wrap: anywhere; }
.dmention { background: rgba(88,101,242,.3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; font-weight: 500; }
.dembed { display: flex; gap: 16px; background: #2b2d31; border-left: 4px solid #8c9099; border-radius: 4px; padding: 12px 16px 14px 12px; max-width: 432px; margin-top: 4px; }
.dbody { min-width: 0; flex: 1; }
.dauthor { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: #f2f3f5; margin-bottom: 8px; }
.dauthor img { width: 24px; height: 24px; border-radius: 50%; }
.dtitle { font-weight: 600; color: #f2f3f5; margin-bottom: 8px; font-size: 16px; }
.ddesc { font-size: 14px; color: #dbdee1; overflow-wrap: anywhere; }
.dimage { display: block; width: 100%; border-radius: 4px; margin-top: 16px; max-height: 300px; object-fit: cover; }
.dfoot { font-size: 12px; color: #dbdee1; margin-top: 8px; font-weight: 500; }
.dthumb { width: 80px; height: 80px; border-radius: 4px; object-fit: cover; flex: none; }

/* role panels */
.panel { border-top: 1px solid var(--line); padding: 8px 0 24px; margin-top: 16px; }
.rrow { display: grid; grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1fr) 34px; gap: 8px; align-items: center; margin-bottom: 8px; }
.rrow .field.emoji { text-align: center; padding-left: 6px; padding-right: 6px; }
.rrow:has(> :nth-child(3):last-child) { grid-template-columns: 64px minmax(0, 1fr) 34px; }
.dbuttons, .dreacts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dbutton { display: inline-flex; align-items: center; gap: 6px; background: #4e5058; color: #fff; font-size: 14px; font-weight: 500; padding: 0 16px; height: 32px; border-radius: 8px; }
.dreact { display: inline-flex; align-items: center; gap: 6px; background: #2b2d31; border: 1px solid #3f4147; color: #dbdee1; font-size: 13px; padding: 2px 8px; border-radius: 8px; }
.demoji { width: 20px; height: 20px; vertical-align: -4px; }

/* save bar */
.savebar {
  position: fixed; left: calc(var(--rail) + 24px); right: 24px; bottom: 20px; z-index: 20;
  max-width: 860px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 12px 12px 20px; border-radius: var(--radius-m);
  background: #0a0c12; border: 1px solid var(--line); box-shadow: 0 18px 40px rgba(0,0,0,.45);
  transform: translateY(140%); visibility: hidden; transition: transform .22s ease, visibility 0s .22s;
}
.savebar.show { transform: none; visibility: visible; transition: transform .22s ease; }
.savebar .btns { display: flex; gap: 8px; }

#toast {
  position: fixed; left: 50%; top: 18px; transform: translate(-50%, -160%); z-index: 50;
  background: var(--bone); color: var(--night-deep); padding: 10px 16px; border-radius: 99px;
  font-weight: 600; font-size: 14px; transition: transform .2s ease, visibility 0s .2s; max-width: calc(100% - 32px);
  visibility: hidden;
}
#toast.show { transform: translate(-50%, 0); visibility: visible; transition: transform .2s ease; }
#toast.bad { background: var(--ember); color: #1b0f12; }

.loading { min-height: 60vh; display: grid; place-items: center; color: var(--ash); font-size: 15px; }

/* ---------- phones and tablets ---------- */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .rail {
    position: fixed; inset: 0 auto 0 0; width: min(86vw, 300px); z-index: 40; background: var(--night-deep);
    transform: translateX(-100%); transition: transform .22s ease;
  }
  .rail.open { transform: none; box-shadow: 20px 0 60px rgba(0,0,0,.5); }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 30; }
  .mobilebar {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px; position: sticky; top: 0; z-index: 10;
    background: rgba(18,22,32,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  }
  .mobilebar .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .main { padding: 24px 16px 140px; }
  .head h1 { font-size: 34px; }
  .savebar { left: 16px; right: 16px; bottom: 16px; }
  .figures { grid-template-columns: repeat(2, 1fr); }
  .topbar { padding: 12px 16px; }
  .cardgrid { grid-template-columns: 1fr; gap: 8px; }
  .preview-wrap { position: static; }
  .landing { padding: 20px 16px; }
  .hero { grid-template-columns: 1fr; gap: 40px; padding: 40px 0 32px; }
  .sidebar { border-left: 0; border-top: 1px solid var(--line); padding: 20px 0 0; }
  .page { padding: 28px 16px 100px; }
  .page h1 { font-size: 36px; }
}
@media (max-width: 560px) {
  .row { grid-template-columns: 1fr; }
  .row.tog { grid-template-columns: minmax(0, 1fr) auto; }
  .pick, .range { width: 100%; }
  .records .hide-s { display: none; }
  .savebar { flex-direction: column; align-items: stretch; padding: 14px; }
  .savebar .btns > * { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}