/* JTrades Quant dashboard */
:root {
  --bg: #060a13;
  --bg-2: #0a1020;
  --panel: #0e1628;
  --panel-2: #131d33;
  --panel-3: #1a2540;
  --line: #1e2a45;
  --line-2: #2a3858;
  --text: #e7edf7;
  --muted: #8d9ab3;
  --dim: #5f6c86;
  --accent: #00e38c;
  --accent-ink: #022a1a;
  --accent-soft: rgba(0, 227, 140, .12);
  --accent-line: rgba(0, 227, 140, .35);
  --danger: #ff5470;
  --danger-soft: rgba(255, 84, 112, .12);
  --warn: #ffb547;
  --blurple: #5865f2;
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 16px;
  --font: "Inter", "SF Pro Text", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-discord: "gg sans", "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  --sidebar-w: 268px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.boot { min-height: 100vh; display: grid; place-items: center; }
.boot img { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .4; transform: scale(.94); } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text);
  font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--panel-3); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #2bf0a3; }
.btn-danger { background: transparent; border-color: rgba(255,84,112,.5); color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--panel-2); color: var(--text); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-icon { width: 32px; height: 32px; padding: 0; }
.btn-lg { height: 48px; padding: 0 26px; font-size: 16px; border-radius: var(--r); }
.btn.loading { pointer-events: none; opacity: .7; }
.btn.loading::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- switch ---------- */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line-2); transition: background .18s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #c9d2e3; transition: transform .18s, background .18s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); background: #fff; }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + span { opacity: .5; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: 60px;
  display: flex; align-items: center; gap: 14px; padding: 0 20px;
  background: rgba(6, 10, 19, .86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; letter-spacing: -.01em; font-size: 16px; }
.brand:hover { text-decoration: none; }
.brand b { color: var(--accent); font-weight: 700; }
.topbar .spacer { flex: 1; }
.menu-btn { display: none; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); position: relative; cursor: pointer; }
.user-chip img { width: 30px; height: 30px; border-radius: 50%; }
.user-chip .name { font-size: 14px; font-weight: 600; padding-right: 6px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 180px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--r); padding: 6px; box-shadow: 0 12px 40px rgba(0,0,0,.5); }
.user-menu button, .user-menu a { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: var(--r-sm); background: none; border: 0; color: var(--text); cursor: pointer; font-size: 14px; }
.user-menu button:hover, .user-menu a:hover { background: var(--panel-3); text-decoration: none; }

/* ---------- login ---------- */
.login {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; align-items: stretch;
}
.login-copy { padding: 8vh 6vw; display: flex; flex-direction: column; justify-content: center; gap: 22px; }
.login-copy h1 { font-size: clamp(34px, 5vw, 58px); line-height: 1.04; letter-spacing: -.035em; margin: 0; font-weight: 800; }
.login-copy h1 em { font-style: normal; color: var(--accent); }
.login-copy p { color: var(--muted); font-size: 18px; max-width: 34ch; margin: 0; }
.login-copy .note { font-size: 13px; color: var(--dim); }
.login-copy .alert { max-width: 420px; }
.login-art { position: relative; overflow: hidden; border-left: 1px solid var(--line); background:
  radial-gradient(1200px 600px at 120% 10%, rgba(0,227,140,.10), transparent 60%), var(--bg-2); }
.login-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.tape { position: absolute; left: 8%; right: 8%; bottom: 10%; display: grid; gap: 10px; }
.tape-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: rgba(14,22,40,.82); border: 1px solid var(--line); border-radius: var(--r); font-size: 14px; }
.tape-row .ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--panel-3); font-size: 18px; }
.tape-row .t { flex: 1; min-width: 0; }
.tape-row .t small { display: block; color: var(--muted); font-size: 12px; }
.tape-row .on { color: var(--accent); font-size: 12px; font-weight: 700; }

/* ---------- pages ---------- */
.page { max-width: 1120px; margin: 0 auto; padding: 36px 24px 120px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 30px; letter-spacing: -.02em; line-height: 1.15; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.search { position: relative; }
.search input { width: 260px; max-width: 100%; }

/* server grid */
.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.server {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center;
  padding: 26px 18px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  color: var(--text); transition: border-color .15s, transform .15s, background .15s;
}
.server:hover { text-decoration: none; border-color: var(--accent-line); transform: translateY(-2px); background: var(--panel-2); }
.server .gicon { width: 76px; height: 76px; }
.server .gname { font-weight: 700; font-size: 16px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server .gmeta { color: var(--muted); font-size: 13px; margin-top: -10px; }
.server .btn { width: 100%; }
.server.no-bot { background: transparent; border-style: dashed; }
.server.no-bot .gicon { filter: grayscale(1); opacity: .55; }
.gicon { border-radius: 30%; background: var(--panel-3); display: grid; place-items: center; font-weight: 700; color: var(--muted); overflow: hidden; flex: none; }
.gicon img { width: 100%; height: 100%; object-fit: cover; }

.empty { padding: 48px 24px; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--r-lg); color: var(--muted); }
.empty h3 { color: var(--text); margin: 0 0 6px; }

/* ---------- guild layout ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: calc(100vh - 60px); }
.sidebar {
  position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto;
  border-right: 1px solid var(--line); background: var(--bg-2); padding: 16px 12px 40px;
}
.guild-switch { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); color: var(--text); margin-bottom: 16px; }
.guild-switch:hover { text-decoration: none; border-color: var(--line-2); }
.guild-switch .gicon { width: 36px; height: 36px; font-size: 14px; }
.guild-switch .n { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guild-switch .n small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.guild-switch .chev { color: var(--dim); }
.nav-group { margin-top: 18px; }
.nav-group h4 { margin: 0 10px 6px; font-size: 12px; font-weight: 600; color: var(--dim); }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-sm);
  color: var(--muted); font-size: 14px; font-weight: 500; position: relative;
}
.nav-link:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--panel-2); color: var(--text); }
.nav-link.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-link .ico { width: 22px; text-align: center; font-size: 16px; }
.nav-link .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); flex: none; }
.dot.on { background: var(--accent); box-shadow: 0 0 0 3px rgba(0,227,140,.15); }
.main { min-width: 0; padding: 32px 36px 140px; }
.main-inner { max-width: 940px; margin: 0 auto; }
.scrim { display: none; }

/* overview */
.hero-guild { display: flex; align-items: center; gap: 18px; margin-bottom: 30px; }
.hero-guild .gicon { width: 64px; height: 64px; font-size: 22px; }
.hero-guild h1 { margin: 0; font-size: 28px; letter-spacing: -.02em; }
.stats { display: flex; gap: 22px; color: var(--muted); font-size: 14px; flex-wrap: wrap; }
.stats b { color: var(--text); font-variant-numeric: tabular-nums; }
.cat-title { display: flex; align-items: baseline; gap: 10px; margin: 30px 0 12px; }
.cat-title h2 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.cat-title span { color: var(--dim); font-size: 13px; }
.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.mod-card {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); color: var(--text);
  transition: border-color .15s, background .15s;
}
.mod-card:hover { border-color: var(--line-2); background: var(--panel-2); }
.mod-card.on { border-color: rgba(0,227,140,.22); }
.mod-card .top { display: flex; align-items: center; gap: 12px; }
.mod-card .ico { width: 42px; height: 42px; display: grid; place-items: center; font-size: 22px; border-radius: 12px; background: var(--panel-3); flex: none; }
.mod-card.on .ico { background: var(--accent-soft); }
.mod-card h3 { margin: 0; font-size: 16px; flex: 1; min-width: 0; }
.mod-card p { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }
.mod-card .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mod-card .foot a { font-size: 13px; font-weight: 600; }
.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 99px; font-size: 11px; font-weight: 700; background: var(--panel-3); color: var(--muted); }
.badge.green { background: var(--accent-soft); color: var(--accent); }

/* module page */
.mod-head { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.mod-head .ico { width: 56px; height: 56px; display: grid; place-items: center; font-size: 28px; border-radius: 16px; background: var(--panel-2); border: 1px solid var(--line); flex: none; }
.mod-head h1 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.mod-head p { margin: 2px 0 0; color: var(--muted); }
.mod-head .grow { flex: 1; min-width: 0; }
.mod-head .state { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; color: var(--muted); }
.crumbs { font-size: 13px; color: var(--dim); margin-bottom: 18px; }
.crumbs a { color: var(--muted); }
.off-banner { display: flex; align-items: center; gap: 12px; justify-content: space-between; margin: 18px 0 0; padding: 12px 16px; border-radius: var(--r); background: rgba(255,181,71,.08); border: 1px solid rgba(255,181,71,.25); color: #ffd79a; font-size: 14px; flex-wrap: wrap; }

/* ---------- forms ---------- */
.form { margin-top: 24px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; margin-bottom: 16px; }
.panel > h2 { margin: 0 0 4px; font-size: 17px; letter-spacing: -.01em; }
.panel > .help { margin: 0 0 16px; }
.field { margin-bottom: 20px; position: relative; }
.field:last-child { margin-bottom: 0; }
.field > label, .field > .label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 7px; }
.help { color: var(--muted); font-size: 13px; margin-top: 6px; }
.field.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.field.row > .txt { flex: 1; min-width: 0; }
.field.row > .txt label { display: block; font-weight: 600; font-size: 14px; }
.field.row .help { margin-top: 2px; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.input, .select, .textarea {
  width: 100%; min-height: 40px; padding: 9px 12px; border-radius: var(--r-sm);
  background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text); font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder, .textarea::placeholder { color: var(--dim); }
.input:hover, .select:hover, .textarea:hover { border-color: #3a4b70; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,227,140,.15); }
.input.invalid { border-color: var(--danger); }
.textarea { resize: vertical; min-height: 84px; line-height: 1.45; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.counter { position: absolute; right: 0; top: 0; font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.num-wrap { display: flex; align-items: center; gap: 8px; max-width: 240px; }
.num-wrap .btn { flex: none; }
.num-wrap .input { text-align: center; font-variant-numeric: tabular-nums; }
.num-range { font-size: 12px; color: var(--dim); white-space: nowrap; }
.color-wrap { display: flex; align-items: center; gap: 10px; max-width: 240px; }
.color-wrap input[type=color] { width: 40px; height: 40px; padding: 0; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: none; cursor: pointer; flex: none; }
.color-wrap input[type=color]::-webkit-color-swatch-wrapper { padding: 3px; }
.color-wrap input[type=color]::-webkit-color-swatch { border: 0; border-radius: 4px; }
.color-wrap .input { font-family: var(--mono); text-transform: uppercase; }
.dur-wrap { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dur-wrap .input { width: 140px; font-variant-numeric: tabular-nums; }
.dur-wrap .dur-out { font-size: 13px; color: var(--muted); }
.dur-wrap .dur-out.bad { color: var(--danger); }

/* option chips (multiselect) */
.opt-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.opt-chip { height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 600; }
.opt-chip:hover { color: var(--text); }
.opt-chip[aria-pressed=true] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }

/* picker */
.picker { position: relative; }
.picker-box {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 40px; padding: 5px 34px 5px 6px;
  border-radius: var(--r-sm); background: var(--bg-2); border: 1px solid var(--line-2); cursor: pointer; position: relative; width: 100%; text-align: left;
}
.picker-box:hover { border-color: #3a4b70; }
.picker.open .picker-box { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,227,140,.15); }
.picker-box::after { content: ""; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: translateY(-70%) rotate(45deg); }
.picker-ph { color: var(--dim); font-size: 14px; padding-left: 6px; }
.picker-single { display: flex; align-items: center; gap: 8px; padding-left: 6px; font-size: 14px; min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 4px 0 9px; border-radius: 6px; background: var(--panel-3); font-size: 13px; font-weight: 500; max-width: 100%; }
.chip .x { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 4px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; }
.chip .x:hover { background: rgba(255,255,255,.08); color: var(--text); }
.chip .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.ch-hash { color: var(--dim); font-weight: 700; width: 14px; text-align: center; flex: none; }
.dropdown {
  position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 6px);
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--r);
  box-shadow: 0 18px 48px rgba(0,0,0,.55); overflow: hidden;
}
.dropdown.up { top: auto; bottom: calc(100% + 6px); }
.dropdown .dd-search { padding: 8px; border-bottom: 1px solid var(--line); }
.dropdown .dd-search .input { min-height: 34px; padding: 6px 10px; }
.dd-list { max-height: 280px; overflow-y: auto; padding: 6px; }
.dd-group { padding: 10px 8px 4px; font-size: 11px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .04em; }
.dd-opt { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: var(--r-sm); cursor: pointer; font-size: 14px; }
.dd-opt.hl { background: var(--panel-3); }
.dd-opt[aria-selected=true] { color: var(--accent); }
.dd-opt[aria-selected=true]::after { content: "✓"; margin-left: auto; font-weight: 700; }
.dd-opt .muted { color: var(--dim); font-size: 12px; margin-left: auto; }
.dd-empty { padding: 14px; color: var(--dim); font-size: 13px; text-align: center; }

/* tags */
.tags-box { display: flex; flex-wrap: wrap; gap: 6px; min-height: 40px; padding: 5px 6px; border-radius: var(--r-sm); background: var(--bg-2); border: 1px solid var(--line-2); cursor: text; }
.tags-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,227,140,.15); }
.tags-box input { flex: 1; min-width: 120px; border: 0; background: none; outline: none; padding: 4px 6px; font-size: 14px; }

/* message editor */
.msg-ed { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.msg-ed .col { display: grid; gap: 12px; min-width: 0; }
.ph-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ph-chip { height: 26px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--muted); font-family: var(--mono); font-size: 12px; cursor: pointer; }
.ph-chip:hover { color: var(--accent); border-color: var(--accent-line); }
.embed-ed { border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.embed-ed > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; background: var(--bg-2); font-weight: 600; font-size: 14px; }
.embed-ed > summary::-webkit-details-marker { display: none; }
.embed-ed > summary .caret { margin-left: auto; color: var(--dim); transition: transform .15s; }
.embed-ed[open] > summary .caret { transform: rotate(180deg); }
.embed-ed .body { padding: 12px; display: grid; gap: 12px; border-top: 1px solid var(--line); }
.embed-ed .body .field { margin: 0; }
.embed-ed .body label { font-size: 13px; }
.mini-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }

/* discord preview */
.dc-preview { background: #313338; border-radius: var(--r); padding: 14px 14px 16px 12px; font-family: var(--font-discord); color: #dbdee1; font-size: 15px; line-height: 1.375; position: sticky; top: 76px; }
.dc-label { font-family: var(--font); font-size: 11px; font-weight: 700; color: #949ba4; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; }
.dc-msg { display: flex; gap: 14px; }
.dc-av { width: 40px; height: 40px; border-radius: 50%; flex: none; background: var(--accent) url("/static/logo.svg") center/cover; }
.dc-body { min-width: 0; flex: 1; }
.dc-head { display: flex; align-items: center; gap: 6px; }
.dc-name { color: #f2f3f5; font-weight: 600; }
.dc-bot { background: var(--blurple); color: #fff; font-size: 10px; font-weight: 600; padding: 1px 5px; border-radius: 3px; line-height: 15px; }
.dc-time { color: #949ba4; font-size: 12px; }
.dc-content { white-space: pre-wrap; word-wrap: break-word; }
.dc-content:empty { display: none; }
.dc-mention { background: rgba(88,101,242,.3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; font-weight: 500; }
.dc-content code, .dc-embed code { background: #2b2d31; border-radius: 3px; padding: 0 3px; font-family: var(--mono); font-size: 85%; }
.dc-content pre, .dc-embed pre { background: #2b2d31; border: 1px solid #1e1f22; border-radius: 4px; padding: 7px; margin: 4px 0; white-space: pre-wrap; font-family: var(--mono); font-size: 13px; }
.dc-content a, .dc-embed a { color: #00a8fc; }
.dc-embed { margin-top: 6px; max-width: 432px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px 16px; background: #2b2d31; border-left: 4px solid var(--accent); border-radius: 4px; padding: 8px 16px 16px 12px; font-size: 14px; }
.dc-embed .e-author { grid-column: 1; font-weight: 600; font-size: 14px; color: #f2f3f5; margin-top: 8px; }
.dc-embed .e-title { grid-column: 1; font-weight: 600; font-size: 16px; color: #f2f3f5; margin-top: 8px; }
.dc-embed .e-title a { color: #00a8fc; }
.dc-embed .e-desc { grid-column: 1; white-space: pre-wrap; word-wrap: break-word; }
.dc-embed .e-thumb { grid-column: 2; grid-row: 1 / span 3; width: 80px; height: 80px; margin-top: 8px; border-radius: 4px; object-fit: cover; background: #1e1f22; }
.dc-embed .e-img { grid-column: 1 / -1; max-width: 100%; border-radius: 4px; margin-top: 8px; background: #1e1f22; max-height: 240px; object-fit: cover; }
.dc-embed .e-foot { grid-column: 1 / -1; font-size: 12px; color: #b5bac1; margin-top: 4px; }
.dc-embed > :first-child { margin-top: 8px; }
.dc-empty { color: #949ba4; font-style: italic; font-size: 14px; }

/* list editor */
.list-items { display: grid; gap: 10px; }
.l-item { border: 1px solid var(--line-2); border-radius: var(--r); background: var(--bg-2); }
.l-item > .l-head { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; cursor: pointer; user-select: none; }
.l-head .l-num { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; background: var(--panel-3); color: var(--muted); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; flex: none; }
.l-head .l-title { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.l-head .l-title.untitled { color: var(--dim); font-weight: 500; }
.l-head .caret { color: var(--dim); transition: transform .15s; padding: 0 4px; }
.l-item.open > .l-head .caret { transform: rotate(180deg); }
.l-item > .l-body { display: none; padding: 14px; border-top: 1px solid var(--line); }
.l-item.open > .l-body { display: block; }
.l-tools { display: flex; gap: 2px; }
.list-foot { display: flex; align-items: center; gap: 12px; margin-top: 10px; color: var(--dim); font-size: 13px; }
.list-empty { padding: 18px; text-align: center; color: var(--dim); border: 1px dashed var(--line-2); border-radius: var(--r); font-size: 14px; }

/* action */
.action-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.action-row .help { margin: 0; flex: 1; min-width: 200px; }

/* unsaved bar */
.savebar {
  position: fixed; left: 50%; bottom: 20px; z-index: 50; transform: translate(-50%, 140%);
  width: min(720px, calc(100vw - 32px)); display: flex; align-items: center; gap: 12px;
  padding: 10px 10px 10px 18px; border-radius: var(--r); background: #0b1222; border: 1px solid var(--accent-line);
  box-shadow: 0 18px 50px rgba(0,0,0,.6), 0 0 0 1px rgba(0,0,0,.4); transition: transform .25s cubic-bezier(.2,.9,.3,1.2);
}
.savebar.show { transform: translate(-50%, 0); }
.savebar.shake { animation: shake .4s; background: #2a0f18; border-color: var(--danger); }
@keyframes shake { 20%, 60% { transform: translate(calc(-50% - 8px), 0); } 40%, 80% { transform: translate(calc(-50% + 8px), 0); } }
.savebar .msg { flex: 1; font-weight: 600; font-size: 14px; }
.savebar .msg small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }

/* toasts */
#toasts { position: fixed; top: 72px; right: 20px; z-index: 60; display: grid; gap: 8px; width: min(360px, calc(100vw - 40px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--panel-2); border: 1px solid var(--line-2); box-shadow: 0 12px 30px rgba(0,0,0,.5); font-size: 14px; animation: tin .2s ease-out; }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--accent); flex: none; }
.toast.error { border-color: rgba(255,84,112,.45); }
.toast.error::before { background: var(--danger); }
.toast.out { opacity: 0; transform: translateX(16px); transition: .2s; }
@keyframes tin { from { opacity: 0; transform: translateY(-6px); } }

.alert { padding: 12px 14px; border-radius: var(--r); background: var(--danger-soft); border: 1px solid rgba(255,84,112,.35); color: #ffc2cc; font-size: 14px; }
.skeleton { background: linear-gradient(90deg, var(--panel) 0%, var(--panel-2) 50%, var(--panel) 100%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--r-lg); }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .msg-ed { grid-template-columns: 1fr; }
  .dc-preview { position: static; }
}
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login-art { min-height: 340px; border-left: 0; border-top: 1px solid var(--line); }
  .shell { grid-template-columns: 1fr; }
  .menu-btn { display: inline-flex; }
  .sidebar { position: fixed; top: 60px; left: 0; bottom: 0; height: auto; width: min(300px, 86vw); z-index: 45; transform: translateX(-100%); transition: transform .22s; }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open .scrim { display: block; position: fixed; inset: 60px 0 0; background: rgba(0,0,0,.55); z-index: 44; }
  .main { padding: 24px 16px 140px; }
}
@media (max-width: 560px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .user-chip .name { display: none; }
  .page { padding: 24px 16px 120px; }
  .page-head h1 { font-size: 24px; }
  .search input { width: 100%; }
  .page-head .search { width: 100%; }
  .field-pair { grid-template-columns: 1fr; }
  .panel { padding: 16px; }
  .mod-head { flex-wrap: wrap; }
  .mod-head .ico { width: 46px; height: 46px; font-size: 24px; }
  .mod-head h1 { font-size: 22px; }
  .savebar { flex-wrap: wrap; padding: 12px; }
  .savebar .msg { flex-basis: 100%; }
  .savebar .btn { flex: 1; }
  .server-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .server { padding: 18px 10px 12px; }
  .server .gicon { width: 56px; height: 56px; }
  .tape { left: 16px; right: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- subscription ---------- */
.badge.warn { background: rgba(255,181,71,.12); color: var(--warn); }
.dot.warn { background: var(--warn); }
.server .gsub { min-height: 20px; margin-top: -6px; }
.paywall {
  display: flex; align-items: center; gap: 16px; margin: 0 0 24px; padding: 16px 18px; flex-wrap: wrap;
  border-radius: var(--r-lg); border: 1px solid var(--accent-line);
  background: linear-gradient(100deg, rgba(0,227,140,.12), rgba(0,227,140,.03) 60%), var(--panel);
}
.mod-head + .paywall { margin-top: 18px; margin-bottom: 0; }
.paywall .pw-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); font-size: 20px; flex: none; }
.paywall .pw-txt { flex: 1; min-width: 220px; display: grid; gap: 2px; }
.paywall .pw-txt b { font-size: 16px; }
.paywall .pw-txt span { color: var(--muted); font-size: 14px; }
.paywall .pw-act { display: flex; gap: 8px; }
.sub-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -10px 0 24px; padding: 10px 14px; border-radius: var(--r); background: var(--accent-soft); border: 1px solid rgba(0,227,140,.22); font-size: 14px; flex-wrap: wrap; }
.sub-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); gap: 16px; margin-top: 24px; align-items: start; }
.sub-status { display: grid; gap: 4px; padding: 14px 16px; border-radius: var(--r); margin: 12px 0 18px; border: 1px solid var(--line-2); background: var(--bg-2); }
.sub-status b { font-size: 18px; letter-spacing: -.01em; }
.sub-status span { color: var(--muted); font-size: 14px; }
.sub-status.ok { border-color: rgba(0,227,140,.3); } .sub-status.ok b { color: var(--accent); }
.sub-status.off { border-color: rgba(255,84,112,.3); } .sub-status.off b { color: #ff8da0; }
.sub-status.wait { border-color: rgba(255,181,71,.35); } .sub-status.wait b { color: var(--warn); }
.sub-status.wait b::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 10px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.sub-actions { margin-bottom: 18px; }
.sub-notes { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; display: grid; gap: 6px; }
.sub-grid + .alert, .alert + .sub-grid { margin-top: 16px; }

.price-card {
  position: relative; max-width: 440px; margin: 0 auto; padding: 30px 28px; border-radius: 20px;
  background: radial-gradient(500px 220px at 50% -10%, rgba(0,227,140,.16), transparent 70%), var(--panel);
  border: 1px solid var(--accent-line); box-shadow: 0 30px 80px rgba(0,0,0,.45);
}
.price-card.small { padding: 22px; max-width: none; box-shadow: none; }
.price-card .pc-name { font-weight: 700; color: var(--accent); font-size: 14px; letter-spacing: .02em; text-transform: uppercase; }
.price-card .pc-price { display: flex; align-items: baseline; gap: 4px; margin: 8px 0 4px; }
.price-card .pc-price b { font-size: 52px; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.price-card.small .pc-price b { font-size: 38px; }
.price-card .pc-price > span { color: var(--muted); font-weight: 600; }
.price-card .pc-sub { color: var(--muted); margin: 0 0 18px; font-size: 14px; }
.price-card ul { list-style: none; padding: 0; margin: 14px 0 22px; display: grid; gap: 10px; }
.price-card li { display: flex; gap: 10px; font-size: 15px; }
.price-card li::before { content: "✓"; color: var(--accent); font-weight: 800; flex: none; }
.price-card .pc-btn { width: 100%; }
.price-card .pc-fine { text-align: center; color: var(--dim); font-size: 12px; margin: 12px 0 0; }

/* ---------- landing ---------- */
.land-top .land-nav { display: flex; gap: 22px; margin-left: 26px; }
.land-top .land-nav a { color: var(--muted); font-size: 14px; font-weight: 600; }
.land-top .land-nav a:hover { color: var(--text); text-decoration: none; }
html { scroll-behavior: smooth; }
.landing section[id] { scroll-margin-top: 80px; }
.l-hero { display: grid; grid-template-columns: 1.1fr 1fr; min-height: calc(100vh - 60px); border-bottom: 1px solid var(--line); }
.l-hero-copy { padding: 9vh 6vw; display: flex; flex-direction: column; justify-content: center; gap: 22px; }
.eyebrow { display: inline-flex; align-self: flex-start; padding: 4px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.l-hero h1 { font-size: clamp(36px, 5.2vw, 64px); line-height: 1.02; letter-spacing: -.04em; margin: 0; font-weight: 800; max-width: 14ch; }
.l-hero h1 em { font-style: normal; color: var(--accent); }
.l-hero .lead { color: var(--muted); font-size: 18px; max-width: 46ch; margin: 0; }
.l-hero .alert { max-width: 460px; }
.l-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.l-cta .btn-ghost { color: var(--text); }
.l-ticks { list-style: none; padding: 0; margin: 0; display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.l-ticks li::before { content: "✓ "; color: var(--accent); font-weight: 800; }
.l-hero-art { position: relative; overflow: hidden; border-left: 1px solid var(--line); background: radial-gradient(1200px 600px at 120% 10%, rgba(0,227,140,.10), transparent 60%), var(--bg-2); }
.l-hero-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.l-section { max-width: 1120px; margin: 0 auto; padding: 90px 24px 10px; }
.l-head { text-align: center; margin-bottom: 36px; }
.l-head h2 { font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -.03em; margin: 0 0 8px; }
.l-head p { color: var(--muted); margin: 0; font-size: 17px; }
.feat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.feat { padding: 20px; border-radius: var(--r-lg); background: var(--panel); border: 1px solid var(--line); transition: border-color .15s, transform .15s; }
.feat:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.feat .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 21px; background: var(--accent-soft); margin-bottom: 12px; }
.feat h3 { margin: 0 0 6px; font-size: 16px; }
.feat p { margin: 0; color: var(--muted); font-size: 14px; }
.faq { max-width: 760px; margin: 0 auto; display: grid; gap: 10px; }
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.faq summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 16px 18px; cursor: pointer; font-weight: 600; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .caret { margin-left: auto; color: var(--dim); transition: transform .15s; }
.faq details[open] summary .caret { transform: rotate(180deg); }
.faq details p { margin: 0; padding: 0 18px 16px; color: var(--muted); }
.l-final { text-align: center; padding: 100px 24px; display: grid; justify-items: center; gap: 20px; }
.l-final h2 { margin: 0; font-size: clamp(26px, 3vw, 36px); letter-spacing: -.03em; }
.l-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 22px 24px; border-top: 1px solid var(--line); color: var(--dim); font-size: 13px; }

@media (max-width: 900px) {
  .l-hero { grid-template-columns: 1fr; min-height: 0; }
  .l-hero-art { min-height: 340px; border-left: 0; border-top: 1px solid var(--line); }
  .land-top .land-nav { display: none; }
  .sub-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .l-hero-copy { padding: 40px 16px; }
  .l-section { padding: 64px 16px 0; }
  .price-card { padding: 24px 18px; }
  .paywall .pw-act { width: 100%; }
  .paywall .pw-act .btn { flex: 1; }
}

/* secret (API key) field */
.secret-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.secret-row .input { flex: 1; min-width: 200px; }
.section-links a { color: var(--accent); }
.byok-note { margin: 22px auto 0; max-width: 760px; text-align: center; color: var(--muted); font-size: 15px; }
.byok-note b, .price-card .pc-byok b { color: var(--text); }
.price-card .pc-byok { color: var(--muted); margin: -8px 0 18px; font-size: 13px; }
