/* Horizon website + dashboard.
   Brand: #ffc100 (amber) -> #ff7e00 (orange) -> #ff5800 (flame). Light and dark follow the system setting.
   Bright brand colours are used for fills and gradients; text-on-background uses darker/lighter
   tints of the same hues so it stays readable. */
:root {
  --amber: #ffc100;
  --orange: #ff7e00;
  --flame: #ff5800;
  --grad: linear-gradient(135deg, var(--amber) 0%, var(--orange) 55%, var(--flame) 100%);
  --grad-soft: linear-gradient(135deg, rgb(255 193 0 / 16%), rgb(255 88 0 / 12%));

  --bg: #fffaf4;
  --bg-glow: rgb(255 126 0 / 10%);
  --surface: #ffffff;
  --surface-2: #fff3e6;
  --border: #f1e3d2;
  --border-strong: #e6cfb5;
  --text: #22180f;
  --muted: #6e6152;
  --link: #b8430a;            /* readable orange on light surfaces */
  --on-accent: #1d1206;       /* dark text on the bright gradient */
  --accent-soft: rgb(255 126 0 / 12%);
  --good: #18864b;
  --bad: #d23a2a;
  --warn: #a86400;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgb(60 30 0 / 5%), 0 8px 24px -8px rgb(120 60 0 / 12%);
  --shadow-lift: 0 2px 4px rgb(60 30 0 / 6%), 0 18px 40px -12px rgb(255 88 0 / 25%);
  --ring: 0 0 0 3px rgb(255 126 0 / 35%);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0b08;
    --bg-glow: rgb(255 126 0 / 14%);
    --surface: #17120d;
    --surface-2: #211912;
    --border: #2e241a;
    --border-strong: #3d3022;
    --text: #f7efe6;
    --muted: #ab9d8c;
    --link: #ffb22e;
    --accent-soft: rgb(255 126 0 / 14%);
    --good: #4cc887;
    --bad: #ff6b5b;
    --warn: #ffb547;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 10px 30px -10px rgb(0 0 0 / 60%);
    --shadow-lift: 0 2px 6px rgb(0 0 0 / 45%), 0 20px 44px -14px rgb(255 88 0 / 30%);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text);
  background:
    radial-gradient(900px 500px at 85% -10%, var(--bg-glow), transparent 70%),
    radial-gradient(700px 420px at -10% 10%, rgb(255 193 0 / 7%), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  font: 15px/1.6 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; }
[hidden] { display: none !important; }
::selection { background: rgb(255 126 0 / 30%); }
code { font-family: ui-monospace, "Cascadia Code", "JetBrains Mono", Consolas, monospace; font-size: 0.88em;
  background: var(--surface-2); border: 1px solid var(--border); padding: 0.1em 0.4em; border-radius: 6px; }
h1, h2, h3 { letter-spacing: -0.015em; line-height: 1.25; }

.wrap { max-width: 1180px; margin: 0 auto; padding-inline: 20px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- header ---------- */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--bg) 75%, transparent); backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.12rem; color: var(--text); letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand-mark, .brand img { width: 34px; height: 34px; border-radius: 11px; flex: none; }
.brand-mark { background: var(--grad); display: grid; place-items: center; color: var(--on-accent); font-weight: 900;
  box-shadow: 0 4px 14px -4px rgb(255 88 0 / 60%); }
.brand img { object-fit: cover; box-shadow: 0 4px 14px -4px rgb(255 88 0 / 55%); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: var(--muted); font-weight: 600; padding: 6px 12px; border-radius: 999px; transition: color .15s, background .15s; }
.nav a:hover { color: var(--text); background: var(--accent-soft); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--text); background: var(--accent-soft); }
.nav a.nav-premium { position: relative; overflow: hidden; color: var(--on-accent); background: var(--grad); font-weight: 750;
  box-shadow: 0 4px 16px -4px rgb(255 88 0 / 60%); padding-inline: 14px; }
.nav a.nav-premium:hover, .nav a.nav-premium[aria-current="page"] { color: var(--on-accent); background: var(--grad);
  filter: brightness(1.07) saturate(1.1); box-shadow: 0 6px 22px -4px rgb(255 88 0 / 75%); }
.nav a.nav-premium::after { content: ""; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(110deg, transparent 30%, rgb(255 255 255 / 55%) 50%, transparent 70%);
  animation: shine 3.2s ease-in-out infinite; }
@keyframes shine { 0%, 55% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
.header-user { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); object-fit: cover;
  outline: 2px solid var(--border); }
.who { font-weight: 600; }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 18px;
  border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .12s, box-shadow .15s, background .15s, border-color .15s; }
.btn:hover { text-decoration: none; background: var(--surface-2); border-color: var(--orange); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--grad) border-box; border-color: transparent; color: var(--on-accent);
  box-shadow: 0 6px 18px -6px rgb(255 88 0 / 55%); }
.btn-primary:hover { background: var(--grad) border-box; filter: brightness(1.06) saturate(1.05); border-color: transparent;
  box-shadow: 0 10px 26px -8px rgb(255 88 0 / 65%); }
.btn-danger { color: var(--bad); }
.btn-danger:hover { border-color: var(--bad); }
.btn-sm { padding: 5px 12px; font-size: 0.86rem; }
.btn-lg { padding: 13px 26px; font-size: 1.04rem; }

label { display: block; font-weight: 650; margin-bottom: 6px; font-size: 0.94rem; }
.hint { color: var(--muted); font-size: 0.86rem; margin: 4px 0 0; }
input[type=text], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--orange) 45%, var(--border-strong)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); box-shadow: var(--ring); }
textarea { min-height: 130px; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 0.9rem; }
.btn:focus-visible, a:focus-visible, .switch input:focus-visible + span { outline: none; box-shadow: var(--ring); }
.field { margin-bottom: 18px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: end; }
.row > .field { flex: 1 1 200px; }
.grow { flex: 1; min-width: 0; }

.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--border-strong); transition: background .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 25%); transition: transform .2s; }
.switch input:checked + span { background: var(--grad); }
.switch input:checked + span::before { transform: translateX(20px); }
.switch input:disabled + span { opacity: 0.5; cursor: not-allowed; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
/* …but cards laid out in a grid line up: the gap does the spacing */
:is(.grid, .plans, .guild-grid, .tiles, .chart-grid-2, .folds) > :is(.card, .tile) { margin-top: 0; }
:is(.hint, .plans, .notice, .tiles, .folds) + .card { margin-top: 16px; }
.card h2 { margin: 0 0 14px; font-size: 1.12rem; }
.card h3 { margin-top: 0; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 99px; font-size: 0.74rem; font-weight: 750;
  letter-spacing: 0.02em; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); vertical-align: middle; }
.badge-premium { background: var(--grad) border-box; color: var(--on-accent); border-color: transparent; }
.badge-good { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); border-color: transparent; }
.badge-bad { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); border-color: transparent; }
.muted { color: var(--muted); }

/* ---------- landing ---------- */
.hero { position: relative; padding-block: 96px 64px; text-align: center; isolation: isolate; }
.hero::before { content: ""; position: absolute; inset: 10% 15% auto; height: 340px; z-index: -1; border-radius: 50%;
  background: radial-gradient(closest-side, rgb(255 126 0 / 22%), transparent); filter: blur(30px);
  animation: glow 9s ease-in-out infinite alternate; }
@keyframes glow { from { transform: translateX(-6%) scale(1); } to { transform: translateX(6%) scale(1.12); } }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; margin-bottom: 18px; padding: 5px 14px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--muted); font-size: 0.86rem; font-weight: 650; backdrop-filter: blur(8px); }
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--grad);
  box-shadow: 0 0 0 3px rgb(255 126 0 / 18%); }
.hero h1 { font-size: clamp(2.2rem, 5.5vw, 3.8rem); line-height: 1.06; margin: 0 auto 18px; letter-spacing: -0.035em; max-width: 860px; }
.hero h1 .grad-text { display: inline; }
.hero p { font-size: 1.16rem; color: var(--muted); max-width: 640px; margin: 0 auto 30px; }
.hero .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.stats { display: inline-flex; gap: 0; justify-content: center; margin-top: 44px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.stats > div { padding: 14px 32px; }
.stats > div + div { border-left: 1px solid var(--border); }
.stats strong { display: block; font-size: 1.7rem; font-weight: 850; letter-spacing: -0.02em; }
.stats span { color: var(--muted); font-size: 0.88rem; }
.section { padding-block: 48px; }
.section h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); margin: 0 0 6px; letter-spacing: -0.025em; }
.section > .wrap > p.lead { color: var(--muted); margin: 0 0 26px; }
.feature { position: relative; overflow: hidden; transition: transform .18s, box-shadow .18s, border-color .18s; }
.feature::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--grad); opacity: 0; transition: opacity .18s; }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--border-strong); }
.feature:hover::before { opacity: 1; }
.feature { display: flex; flex-direction: column; }
.feature-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 14px; }
.feature-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; background: var(--grad-soft); border: 1px solid var(--border); transition: transform .25s; }
.feature:hover .feature-icon { transform: scale(1.08) rotate(-4deg); }
.feature h3 { margin: 0 0 6px; font-size: 1.04rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.feature p { margin: 0; color: var(--muted); font-size: 0.94rem; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps li { counter-increment: step; display: flex; gap: 14px; align-items: center; }
.steps li::before { content: counter(step); width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--grad); color: var(--on-accent); font-weight: 800; }

/* ---------- commands page ---------- */
.cmd-toolbar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.cmd-toolbar input { flex: 1 1 280px; }
.cmd-toolbar select { flex: 0 1 240px; width: auto; }
.cmd-section { margin-bottom: 30px; }
.cmd-section h2 { font-size: 1.2rem; margin-bottom: 4px; display: flex; gap: 8px; align-items: center; }
.cmd-list { list-style: none; margin: 12px 0 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.cmd-list li { padding: 12px 16px; border-top: 1px solid var(--border); transition: background .12s; }
.cmd-list li:hover { background: var(--surface-2); }
.cmd-list li:first-child { border-top: 0; }
.cmd-name { font-family: ui-monospace, Consolas, monospace; font-weight: 700; color: var(--link); }
.cmd-opts { color: var(--muted); font-family: ui-monospace, Consolas, monospace; font-size: 0.84rem; margin-top: 2px; }

/* ---------- pricing ---------- */
.plans { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); max-width: 860px; align-items: stretch; }
.plan { display: flex; flex-direction: column; }
.plan > .btn { margin-top: auto; }
.plan > p.muted { margin: 4px 0 22px; }
.plan h3 { font-size: 1.3rem; margin: 0; display: flex; gap: 8px; align-items: center; }
.plan .price { font-size: 2.2rem; font-weight: 850; margin: 8px 0; letter-spacing: -0.03em; }
.plan ul { padding-left: 1.2em; margin: 12px 0 20px; flex: 1; }
.plan li { margin-bottom: 4px; }
.plan .btn { align-self: flex-start; }
.plan .price .per { font-size: 1rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.price-line { font-size: 1.05rem; letter-spacing: 0; font-weight: 500; }
.price-line strong { font-size: 1.6rem; font-weight: 850; letter-spacing: -0.02em; }
.section-title { font-size: 1.15rem; margin: 24px 0 12px; }
.dash-main .plans { margin-bottom: 16px; max-width: none; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.dash-main .plan > .btn { width: 100%; }
.dash-main .plan .price { font-size: 2rem; }
.plan-ribbon { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  box-shadow: 0 6px 16px -6px rgb(255 88 0 / 70%); }
.plan-premium { position: relative; border: 1px solid transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box; box-shadow: var(--shadow-lift); }

/* ---------- prose ---------- */
.prose { max-width: 760px; padding-block: 48px; }
.prose h1 { margin-top: 0; font-size: 2.2rem; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 72px; padding-block: 30px calc(30px + env(safe-area-inset-bottom, 0px));
  color: var(--muted); font-size: 0.9rem; }
.site-footer .wrap { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; margin-left: auto; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }

/* ---------- dashboard ---------- */
.dash { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; padding-block: 28px; }
.dash-side { position: sticky; top: calc(84px + env(safe-area-inset-top, 0px)); align-self: start;
  max-height: calc(100vh - 104px - env(safe-area-inset-top, 0px)); overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.dash-side::-webkit-scrollbar { width: 8px; }
.dash-side::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 2px solid var(--surface); }
/* switching dashboard pages: the new page eases in */
.dash-main.page-enter > * { animation: rise .45s cubic-bezier(.2, .7, .2, 1) both; }
.dash-main.page-enter > :nth-child(2) { animation-delay: 40ms; }
.dash-main.page-enter > :nth-child(3) { animation-delay: 80ms; }
.dash-main.page-enter > :nth-child(4) { animation-delay: 120ms; }
.dash-main.page-enter > :nth-child(n+5) { animation-delay: 160ms; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.guild-head { display: flex; align-items: center; gap: 12px; padding: 4px 4px 14px; margin-bottom: 10px; border-bottom: 1px solid var(--border); }
.guild-head img, .guild-icon { width: 44px; height: 44px; border-radius: 14px; background: var(--grad-soft); flex: none;
  display: grid; place-items: center; font-weight: 800; color: var(--link); object-fit: cover; border: 1px solid var(--border); }
.guild-head strong { display: block; line-height: 1.25; overflow-wrap: anywhere; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { position: relative; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 600;
  transition: background .12s, color .12s; }
.side-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.side-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--text); }
.side-nav a[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
  border-radius: 3px; background: var(--grad); }
.dash-main h1 { margin: 0 0 4px; font-size: 1.7rem; }
.dash-main > p.lead { margin: 0 0 22px; color: var(--muted); }
.savebar { position: sticky; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; justify-content: flex-end; margin-top: 18px; }
.savebar .btn { box-shadow: 0 10px 30px -8px rgb(255 88 0 / 60%); }

.plan-badge { font-size: 0.68rem; letter-spacing: 0.08em; padding: 2px 8px; }
.badge-free { background: var(--surface-2); color: var(--muted); border-color: var(--border-strong); }
.badge-premium.plan-badge { box-shadow: 0 2px 10px -3px rgb(255 88 0 / 65%); }
.guild-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.guild-meta { display: flex; gap: 6px; align-items: center; margin-top: 4px; }
.side-nav a .nav-lock { font-size: 0.8rem; opacity: 0.85; }
.control-row { gap: 10px; margin-top: 6px; }

/* Premium-only page on a free server: the page shows blurred behind a notice */
.locked { position: relative; min-height: 460px; }
.locked-content { filter: blur(5px) saturate(0.85); opacity: 0.55; pointer-events: none; user-select: none; }
.locked-overlay { position: absolute; inset: 0; display: flex; justify-content: center; align-items: flex-start; padding: 70px 16px 0; }
.locked-card { position: sticky; top: 110px; max-width: 440px; width: 100%; text-align: center; padding: 30px 26px; }
.locked-card h2 { font-size: 1.35rem; margin-bottom: 8px; }
.locked-card .btn { margin-top: 8px; }
.locked-icon { font-size: 2.4rem; line-height: 1; margin-bottom: 10px; filter: drop-shadow(0 4px 12px rgb(255 88 0 / 45%)); }

.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 16px; }
.tile { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); }
.tile::after { content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%;
  background: var(--grad); opacity: 0.14; }
.tile strong { display: block; font-size: 1.6rem; font-weight: 850; letter-spacing: -0.02em; }
.tile span { color: var(--muted); font-size: 0.86rem; }

.guild-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); margin-top: 18px; }
.guild-card { display: flex; align-items: center; gap: 12px; padding: 16px; transition: transform .15s, box-shadow .15s, border-color .15s; }
.guild-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--border-strong); }
.guild-card .grow { flex: 1; min-width: 0; }
.guild-card strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card + .guild-card, .guild-card + .card { margin-top: 0; }

.module { display: flex; gap: 16px; align-items: center; padding: 16px 0; border-top: 1px solid var(--border); }
.module:first-child { border-top: 0; padding-top: 0; }
.module:last-child { padding-bottom: 0; }
.module .grow { flex: 1; }
.module h3 { margin: 0 0 2px; font-size: 1rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.module p { margin: 0; color: var(--muted); font-size: 0.92rem; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: 99px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 0.86rem; font-weight: 550; }
.chip button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 5px;
  border-radius: 50%; }
.chip button:hover { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.chip-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }

input[type=password] { width: 100%; padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; }
input[type=color] { width: 56px; height: 40px; padding: 3px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); cursor: pointer; }
input[type=checkbox] { accent-color: var(--orange); width: 17px; height: 17px; flex: none; }
label.check { display: flex; align-items: center; gap: 9px; font-weight: 550; margin: 6px 0; cursor: pointer; }
.code-inline { font-family: ui-monospace, Consolas, monospace; color: var(--link); }
input.prefix-input { max-width: 120px; font-family: ui-monospace, Consolas, monospace; }
.commands-table td:first-child { min-width: 200px; }
.commands-table .text-cell { white-space: nowrap; }
.commands-table .usage { margin-top: 6px; white-space: normal; max-width: 260px; overflow-wrap: anywhere; }
ul.notes { list-style: none; padding: 0; margin: 0 0 14px; }
ul.notes li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.note-text { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.account { max-width: 760px; margin-inline: auto; }
.account-card { display: flex; gap: 16px; align-items: center; }
.account-card h2 { margin: 2px 0; }
.account-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-2); }
.link-options h3 { margin: 22px 0 8px; font-size: 1rem; }
.period-tabs { margin-bottom: 8px; }
.chart-grid-2 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.chart-card h3 { margin: 0 0 10px; font-size: 1rem; }
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; touch-action: pan-y; }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-axis { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart-bar { fill: var(--link); }
.chart-line { fill: none; stroke: var(--link); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-hover { stroke: var(--border-strong); stroke-width: 1; }
.chart-dot { fill: var(--link); stroke: var(--surface); stroke-width: 2; }
.chart-tip { position: absolute; top: 0; padding: 6px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow); font-size: 0.85rem; pointer-events: none; white-space: nowrap; }
.chart-table { margin-top: 10px; box-shadow: none; }
table.clickable tbody tr { cursor: pointer; }
tr.flagged td { background: color-mix(in srgb, var(--bad) 6%, transparent); }
td .badge + .badge, td div + div { margin-top: 4px; }
.shift-card.on { border-color: color-mix(in srgb, var(--good) 45%, var(--border)); }
.shift-card h2 { margin-bottom: 2px; }
.shift-card .row { align-items: center; }
.shift-card .field { margin-bottom: 0; flex: none; }
.shift-card p { margin: 0; }
.action-row input[type=text] { flex: 1 1 160px; width: auto; }
.action-row input[type=color] { flex: none; }
.rule-card { box-shadow: none; padding: 14px 16px; margin-bottom: 10px; }
table.clickable tbody tr:hover, table.clickable tbody tr:focus-visible { background: var(--surface-2); outline: none; }

.member-picker { position: relative; }
.search-results { position: absolute; z-index: 10; left: 0; right: 0; top: calc(100% + 4px); max-height: 260px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-lift); padding: 4px; }
.search-result { display: block; width: 100%; text-align: left; border: 0; background: none; color: var(--text); font: inherit;
  padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.search-result:hover, .search-result:focus-visible { background: var(--accent-soft); outline: none; }
.search-empty { padding: 8px 10px; }

.folds { display: grid; gap: 10px; margin-bottom: 14px; }
.card .folds .card, .folds .fold { box-shadow: none; }
.fold { padding: 0; overflow: hidden; }
.card + .fold, .fold + .card { margin-top: 0; }
.fold > summary { list-style: none; cursor: pointer; padding: 14px 18px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  transition: background .12s; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before { content: "›"; font-size: 1.3rem; line-height: 1; color: var(--orange); transition: transform .15s; width: 14px; }
.fold[open] > summary::before { transform: rotate(90deg); }
.fold > summary:hover { background: var(--surface-2); }
.fold-body { padding: 4px 18px 18px; border-top: 1px solid var(--border); }
.fold-body h3 { font-size: 0.95rem; margin: 18px 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

.q-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.q-row input[type=text] { flex: 1 1 220px; width: auto; }
.q-row label.check { margin: 0; }
.q-num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 0.82rem; font-weight: 800;
  background: var(--grad); color: var(--on-accent); }
.actions-row { justify-content: flex-end; margin-top: 16px; }
.actions-row .btn-danger { margin-right: auto; }

.table-wrap { overflow-x: auto; margin-inline: -4px; padding-inline: 4px; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 700; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.06em; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
tr.voided td { color: var(--muted); text-decoration: line-through; }
td.num, th.num { text-align: right; }
td.num input { max-width: 90px; text-align: right; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }

.notice { padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); margin-bottom: 16px; }
.notice-warn { border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn) 9%, var(--surface)); }
.notice-premium { border: 1px solid transparent;
  background: linear-gradient(color-mix(in srgb, var(--orange) 8%, var(--surface)), color-mix(in srgb, var(--orange) 8%, var(--surface))) padding-box,
              var(--grad) border-box; }

.toast { position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 50;
  padding: 12px 18px; border-radius: 12px; background: var(--text); color: var(--bg); font-weight: 600;
  box-shadow: var(--shadow-lift); max-width: min(420px, calc(100vw - 40px)); animation: toast-in .2s ease-out; }
.toast::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 10px;
  background: var(--grad); vertical-align: middle; }
.toast.error { background: var(--bad); color: #fff; }
.toast.error::before { background: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.loading { color: var(--muted); padding: 48px 0; text-align: center; }
.loading::before { content: ""; display: block; width: 28px; height: 28px; margin: 0 auto 12px; border-radius: 50%;
  border: 3px solid var(--border-strong); border-top-color: var(--orange); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.code-box { font-family: ui-monospace, Consolas, monospace; font-size: 1.05rem; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px dashed var(--orange); display: inline-block; user-select: all; }

.modal-back { position: fixed; inset: 0; z-index: 40; background: rgb(20 10 0 / 50%); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 16px; animation: toast-in .15s ease-out; }
.modal { max-width: 460px; width: 100%; box-shadow: var(--shadow-lift); }
.modal .row { justify-content: flex-end; margin-top: 8px; }

/* ---------- scroll reveal ---------- */
.reveal { opacity: 0; translate: 0 22px; scale: 0.985;
  transition: opacity .7s cubic-bezier(.2, .7, .2, 1), translate .7s cubic-bezier(.2, .7, .2, 1), scale .7s cubic-bezier(.2, .7, .2, 1),
              transform .18s, box-shadow .18s, border-color .18s, background .15s;
  transition-delay: var(--reveal-delay, 0ms); }
.reveal.in { opacity: 1; translate: 0 0; scale: 1; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; translate: none; scale: none; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 820px) {
  .dash { grid-template-columns: 1fr; gap: 18px; }
  .dash-side { position: static; max-height: none; overflow: visible; }
  .side-nav { flex-direction: row; overflow-x: auto; padding-bottom: 2px; }
  .side-nav a { white-space: nowrap; }
  .side-nav a[aria-current="page"]::before { left: 10px; right: 10px; top: auto; bottom: 2px; width: auto; height: 3px; }
  .header-user .who { display: none; }
  .stats > div { padding: 12px 22px; }
}

@media (max-width: 640px) {
  /* phones: brand + account on one row, the nav as one swipeable row underneath */
  .site-header .wrap { gap: 8px 12px; padding-block: 8px; min-height: 0; }
  .nav { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -4px; padding: 2px 4px; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; flex: none; }
  .hero { padding-block: 56px 40px; }
  .stats > div { padding: 12px 18px; }
}

.premium-inline { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.premium-inline .btn { flex: none; }

/* ---------- message builder ---------- */
.message-editor { border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.me-tabs { display: flex; gap: 4px; padding: 6px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.me-tab { flex: 1; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 650; padding: 8px 12px;
  border-radius: var(--radius-sm); cursor: pointer; }
.me-tab[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.me-tab[aria-selected="true"]::after { content: ""; display: block; height: 2px; margin: 4px auto 0; width: 32px; border-radius: 2px; background: var(--grad); }
.me-pane { padding: 16px; }
.me-toggle { margin: 4px 0 14px; }
.me-embed { border-left: 3px solid var(--orange); padding-left: 14px; }
.me-color { display: flex; gap: 8px; align-items: center; }
.me-hex { max-width: 110px; }
.me-desc { min-height: 110px; font-family: inherit; }
.me-count { font-weight: 500; color: var(--muted); font-size: 0.78rem; margin-left: 6px; }
.me-count.over { color: var(--bad); }
.me-fields { display: grid; gap: 10px; }
.me-field { border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 10px; display: grid; gap: 8px; }
.me-field-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.me-field-head strong { margin-right: auto; }
.me-field-head label.check { margin: 0; }
.me-field-value { min-height: 60px; font-family: inherit; }
.me-help { margin-top: 10px; }
.me-help summary { cursor: pointer; font-weight: 600; color: var(--link); }
.me-help-body { padding-top: 8px; }
.me-ph { cursor: pointer; font-family: ui-monospace, Consolas, monospace; padding: 3px 10px; }
.me-ph:hover { border-color: var(--orange); }

/* Discord-style preview — always Discord's dark theme so it looks like the real thing */
.me-preview { background: #313338; }
.dc-chat { color: #dbdee1; font-family: "gg sans", "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 15px; line-height: 1.375; }
.dc-message { display: flex; gap: 14px; padding: 4px 0; }
.dc-avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; background: var(--grad); object-fit: cover; }
.dc-body { min-width: 0; flex: 1; }
.dc-meta { display: flex; align-items: center; gap: 6px; }
.dc-name { color: #f2f3f5; font-weight: 600; }
.dc-bot { background: #5865f2; color: #fff; font-size: 0.62rem; font-weight: 700; padding: 1px 4px; border-radius: 3px; }
.dc-time { color: #949ba4; font-size: 0.75rem; }
.dc-content, .dc-desc, .dc-field-value { white-space: pre-wrap; overflow-wrap: anywhere; }
.dc-chat a { color: #00a8fc; }
.dc-line { min-height: 1.2em; }
.dc-h1 { font-size: 1.5rem; font-weight: 700; margin: 6px 0 2px; }
.dc-h2 { font-size: 1.25rem; font-weight: 700; margin: 6px 0 2px; }
.dc-h3 { font-size: 1.05rem; font-weight: 700; margin: 4px 0 2px; }
.dc-sub { font-size: 0.8rem; color: #949ba4; }
.dc-quote { border-left: 4px solid #4e5058; padding-left: 10px; }
.dc-list { margin: 2px 0; padding-left: 22px; }
.dc-code { background: #2b2d31; border: 1px solid #1e1f22; border-radius: 4px; padding: 0 3px; font-size: 0.85em; }
.dc-pre { background: #2b2d31; border: 1px solid #1e1f22; border-radius: 4px; padding: 8px; margin: 4px 0; white-space: pre-wrap; font-size: 0.85em; }
.dc-mention { background: rgb(88 101 242 / 30%); color: #c9cdfb; border-radius: 3px; padding: 0 2px; font-weight: 500; }
.dc-var { background: rgb(255 126 0 / 22%); color: #ffd29e; border-radius: 3px; padding: 0 2px; }
.dc-spoiler { background: #1e1f22; color: transparent; border-radius: 3px; transition: color .15s; cursor: pointer; }
.dc-spoiler:hover { color: inherit; }
.dc-embed { display: flex; gap: 16px; max-width: 520px; margin-top: 4px; background: #2b2d31; border-radius: 4px;
  border-left: 4px solid #1e1f22; padding: 8px 16px 16px 12px; }
.dc-embed-main { min-width: 0; flex: 1; display: grid; gap: 8px; padding-top: 8px; }
.dc-author { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; font-weight: 600; color: #f2f3f5; }
.dc-author img, .dc-footer img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.dc-footer img { width: 20px; height: 20px; }
.dc-title { font-weight: 600; color: #f2f3f5; }
.dc-desc { font-size: 0.875rem; }
.dc-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dc-field { grid-column: 1 / -1; font-size: 0.875rem; }
.dc-field.inline { grid-column: auto; }
.dc-field-name { font-weight: 600; color: #f2f3f5; margin-bottom: 2px; }
.dc-image { max-width: 100%; border-radius: 4px; margin-top: 8px; }
.dc-thumb { width: 80px; height: 80px; object-fit: cover; border-radius: 4px; margin-top: 8px; flex: none; }
.dc-footer { display: flex; align-items: center; gap: 8px; font-size: 0.75rem; color: #b5bac1; }
.dc-empty { color: #949ba4; font-style: italic; }

/* ---------- Premium bot profile ---------- */
.profile-pick { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.profile-img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border-strong); background: var(--surface-2); }
.profile-img.wide { width: 240px; height: 84px; border-radius: var(--radius-sm); }
.profile-actions { display: grid; gap: 6px; }
input[type=url] { width: 100%; padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; }
input[type=file] { font: inherit; color: var(--muted); }

/* Gradient fills: never tile, and overhang the shape by a pixel. Otherwise browsers can draw a
   1px sliver of the repeated gradient (the wrong end's colour) along the edges of rounded shapes
   whose width isn't a whole number of pixels. Kept last so hover/active shorthands can't undo it. */
.brand-mark,
.nav a.nav-premium, .nav a.nav-premium:hover, .nav a.nav-premium[aria-current="page"],
.btn-primary, .btn-primary:hover,
.badge-premium, .switch input:checked + span,
.steps li::before, .side-nav a[aria-current="page"]::before, .tile::after,
.q-num, .toast::before, .me-tab[aria-selected="true"]::after, .dc-avatar {
  background-repeat: no-repeat;
  background-size: calc(100% + 4px) calc(100% + 4px);
  background-position: center;
}

.perks { padding-left: 1.2em; display: grid; gap: 8px; }
.perk-desc, .plan li .perk-desc { display: block; color: var(--muted); font-size: 0.9rem; }
