/* ============================================================
   Orbio-KingShot — design system
   ============================================================ */
:root {
    color-scheme: dark; /* native controls (selects, dropdown lists, scrollbars) render dark */
    --bg: #0b0d12;
    --bg-2: #0e1118;
    --panel: #151925;
    --panel-2: #1b2030;
    --border: #232a3a;
    --border-soft: #1c2230;
    --text: #eef1f6;
    --muted: #9aa2b4;
    --faint: #6b7284;
    --brand: #6d78ff;
    --brand-2: #a25bff;
    --accent: #5865f2;
    --ok: #3fce8f;
    --warn: #f0b232;
    --danger: #ed4d55;
    --gold: #f0b232;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 10px 40px -12px rgba(0,0,0,.55);
    --ring: 0 0 0 1px var(--border);
    --grad: linear-gradient(135deg, var(--brand), var(--brand-2));
    --maxw: 1080px;
}

* { box-sizing: border-box; }

/* scrollbar-gutter: the vertical scrollbar's width is always reserved, so the
   page never shifts horizontally when content grows past the viewport
   (e.g. opening a FAQ answer) and the scrollbar pops in/out. */
html { scroll-behavior: smooth; scrollbar-gutter: stable; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
    background:
        radial-gradient(80% 55% at 50% -10%, rgba(109,120,255,.10), transparent 60%),
        var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: #9aa4ff; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; }
code {
    background: #0a0c11; padding: 2px 7px; border-radius: 6px;
    color: #c3c9d6; font-size: .88em; border: 1px solid var(--border-soft);
}
.muted { color: var(--muted); }
.faint { color: var(--faint); }

/* ---------- Layout ---------- */
/* width: 100% is required: body is a column flex container and the auto margins
   disable stretching, so without it the container shrinks to fit its content —
   its width (and centering) would shift whenever content expands (FAQ answers). */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 40px 24px 72px; }
.container.narrow { max-width: 440px; }
section { margin-top: 40px; }
.page-head { margin-bottom: 6px; }
.page-head h1 { margin: 0 0 6px; font-size: 1.9rem; }

.kicker {
    display: inline-block; text-transform: uppercase; letter-spacing: .12em;
    font-size: .72rem; font-weight: 700; color: var(--brand);
    background: rgba(109,120,255,.10); padding: 4px 10px; border-radius: 999px;
    border: 1px solid rgba(109,120,255,.25); margin-bottom: 14px;
}

/* ---------- Nav ---------- */
.nav {
    position: sticky; top: 0; z-index: 50;
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
    padding: 10px 24px;
    background: rgba(12,14,20,.82);
    backdrop-filter: saturate(140%) blur(12px);
    border-bottom: 1px solid var(--border-soft);
}
.nav .brand { justify-self: start; font-weight: 800; font-size: 1.08rem; color: var(--text); letter-spacing: -.02em; white-space: nowrap; }
.nav .brand .crown { filter: drop-shadow(0 2px 6px rgba(240,178,50,.45)); }

.nav-center { justify-self: center; display: flex; align-items: center; gap: 26px; }
.nav-center a { color: var(--muted); font-size: .94rem; font-weight: 500; position: relative; padding: 4px 0; }
.nav-center a:hover { color: var(--text); text-decoration: none; }
.nav-center a::after {
    content: ""; position: absolute; left: 0; right: 100%; bottom: -2px; height: 2px;
    background: var(--grad); border-radius: 2px; transition: right .18s;
}
.nav-center a:hover::after { right: 0; }

.nav-actions { justify-self: end; display: flex; align-items: center; gap: 10px; }

/* Dropdowns (lang + user) */
.dropdown { position: relative; }
.dropdown > summary {
    list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
    height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border);
    color: var(--text); font-size: .85rem; font-weight: 600; background: rgba(255,255,255,.03);
    user-select: none; transition: border-color .14s, background .14s;
}
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown > summary::marker { content: ""; }
.dropdown > summary:hover { border-color: var(--brand); background: rgba(109,120,255,.09); }
.dropdown[open] > summary { border-color: var(--brand); background: rgba(109,120,255,.09); }
.dropdown .caret { color: var(--muted); font-size: .6rem; margin-left: 1px; transition: transform .15s; }
.dropdown[open] .caret { transform: rotate(180deg); }

/* Inline SVG flags */
.flag-svg {
    display: inline-flex; width: 20px; height: 14px; border-radius: 3px; overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); flex-shrink: 0;
}
.flag-svg svg { width: 100%; height: 100%; display: block; }
.nav-actions .btn.small { height: 36px; padding: 0 16px; }
.admin-btn { height: 36px; }
.dd-menu {
    position: absolute; top: calc(100% + 8px); left: 0; min-width: 170px; z-index: 60;
    background: var(--panel); border: 1px solid var(--border); border-radius: 11px;
    padding: 6px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px;
}
.dd-menu.right { left: auto; right: 0; }
.dd-menu a, .dd-form button {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 9px 11px; border-radius: 8px; color: var(--muted); font-size: .9rem;
    background: none; border: none; cursor: pointer; font: inherit; text-align: left;
}
.dd-menu a:hover, .dd-form button:hover { background: rgba(255,255,255,.05); color: var(--text); text-decoration: none; }
.dd-menu a.active { color: var(--text); background: rgba(109,120,255,.12); }
.dd-form { margin: 0; border-top: 1px solid var(--border-soft); margin-top: 4px; padding-top: 4px; }
.dd-menu .ic { width: 18px; text-align: center; }

/* User zone */
.user-dd > summary { padding: 4px 10px 4px 4px; }
.nav-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: var(--panel-2); }
.user-dd .uname { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Admin button — set apart */
.admin-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 9px;
    font-size: .86rem; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, #f0555c, #cf2e3a);
    box-shadow: 0 6px 18px -8px rgba(207,46,58,.65);
}
.admin-btn:hover { filter: brightness(1.07); color: #fff; text-decoration: none; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--grad); color: #fff; padding: 12px 22px; border-radius: 10px;
    font-weight: 600; border: none; cursor: pointer; font-size: .96rem;
    box-shadow: 0 8px 24px -8px rgba(109,120,255,.6); transition: transform .12s, box-shadow .12s, filter .12s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.06); color: #fff; box-shadow: 0 12px 30px -8px rgba(109,120,255,.7); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); box-shadow: none; }
.btn.ghost:hover { border-color: var(--brand); background: rgba(109,120,255,.08); }
.btn.small { padding: 9px 16px; font-size: .9rem; }
.btn.discord { background: #5865f2; box-shadow: 0 8px 24px -8px rgba(88,101,242,.6); }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }

/* ---------- Hero ---------- */
.hero {
    position: relative; text-align: center; padding: 72px 24px 56px; margin-top: 0;
    overflow: hidden;
}
.hero::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background:
        radial-gradient(60% 80% at 50% 0%, rgba(162,91,255,.18), transparent 60%),
        radial-gradient(50% 60% at 50% 0%, rgba(109,120,255,.20), transparent 65%);
}
.hero h1 { font-size: 2.7rem; margin: 0 auto 16px; max-width: 720px; }
.hero h1 .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { color: var(--muted); font-size: 1.12rem; margin: 0 auto 26px; max-width: 620px; }

/* trust band */
.trust {
    display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 40px;
}
.trust .stat-pill {
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px 26px; min-width: 150px; box-shadow: var(--shadow);
}
.trust .stat-pill .n { font-size: 1.7rem; font-weight: 800; display: block; }
.trust .stat-pill .n .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.trust .stat-pill .l { color: var(--muted); font-size: .85rem; }

/* ---------- Section titles ---------- */
h2.section-title { font-size: 1.5rem; margin: 0 0 6px; border: none; padding: 0; }
h2 { border-bottom: 1px solid var(--border-soft); padding-bottom: 10px; margin-top: 44px; font-size: 1.3rem; }
.section-sub { color: var(--muted); margin: 0 0 20px; }

/* ---------- Feature cards ---------- */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-top: 22px; }
.feature {
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 24px; transition: border-color .15s, transform .15s;
}
.feature:hover { border-color: var(--border); transform: translateY(-2px); }
.feature .ico {
    width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
    font-size: 1.4rem; margin-bottom: 14px; background: rgba(109,120,255,.12); border: 1px solid rgba(109,120,255,.25);
}
.feature h3 { margin: 0 0 8px; font-size: 1.05rem; }
.feature p { margin: 0; color: var(--muted); font-size: .93rem; }

/* ---------- Cards / stat grid ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin: 18px 0; }
.card {
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px; display: flex; flex-direction: column; gap: 6px;
}
.card-label { color: var(--muted); font-size: .84rem; }
.card-value { font-size: 1.9rem; font-weight: 800; }
.card-sub { font-size: .78rem; }
.muted-card .card-value { color: var(--muted); font-size: 1rem; }

/* ---------- Avatars ---------- */
.avatar {
    position: relative; display: inline-block; width: 34px; height: 34px;
    border-radius: 50%; overflow: hidden; flex-shrink: 0; vertical-align: middle;
    background: var(--panel-2); border: 1px solid var(--border);
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar .avatar-fallback {
    position: absolute; inset: 0; display: grid; place-items: center;
    font-weight: 700; font-size: .9rem; color: var(--muted);
}
/* When a photo is present, hide the fallback letter (transparent avatars would
   let it show through). onerror removes the <img>, which reveals it again. */
.avatar img + .avatar-fallback { display: none; }
.avatar.lg { width: 56px; height: 56px; }
.avatar.lg .avatar-fallback { font-size: 1.4rem; }
.cell-user { display: inline-flex; align-items: center; gap: 11px; }
.cell-user .uname { font-weight: 600; }
.cell-user .uinfo { display: inline-flex; flex-direction: column; gap: 3px; min-width: 0; }
.cell-user .subid { font-size: .68rem; color: var(--faint); background: none; border: none; padding: 0; }
a.rowlink { color: inherit; display: inline-flex; }
a.rowlink:hover .uname { color: var(--brand); }
.usub { display: inline-flex; align-items: center; gap: 8px; font-size: .76rem; color: var(--muted); }
.lvl { color: var(--muted); }
.lvl.tg { color: var(--gold); font-weight: 600; }
.kchip {
    background: var(--panel-2); border: 1px solid var(--border-soft); color: var(--faint);
    border-radius: 6px; padding: 1px 7px; font-size: .7rem; font-weight: 600;
}
.nowrap { white-space: nowrap; }

/* ---------- Tables ---------- */
/* Wide tables scroll horizontally on small screens instead of being crushed. */
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 14px; }
table.claims { width: 100%; border-collapse: collapse; }
.claims th, .claims td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border-soft); }
.claims tbody tr:last-child td, .claims tbody tr:last-child td { border-bottom: none; }
.claims thead th {
    color: var(--muted); font-weight: 600; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em;
    background: var(--bg-2);
}
.claims tbody tr { transition: background .12s; }
.claims tbody tr:hover { background: rgba(255,255,255,.02); }

/* ---------- Badges ---------- */
.badge { padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap; }
.badge.ok { background: rgba(63,206,143,.14); color: var(--ok); }
.badge.info { background: rgba(109,120,255,.14); color: #aab4ff; }
.badge.off { background: rgba(154,162,180,.14); color: var(--muted); }
.badge.owner { background: rgba(109,120,255,.16); color: #aab2ff; }
.badge.premium { background: rgba(240,178,50,.15); color: var(--gold); }
.badge.free { background: rgba(154,162,180,.13); color: var(--muted); }
.badge.danger { background: rgba(237,77,85,.14); color: var(--danger); }
.badge.warn { background: rgba(240,178,50,.14); color: var(--warn); }

/* ---------- Staff console extras ---------- */
.health-badge {
    display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px;
    border: 1px solid var(--border); background: var(--panel); font-size: .82rem; font-weight: 600;
}
.health-badge.ok { border-color: rgba(63,206,143,.4); }
.health-badge.warn { border-color: rgba(240,178,50,.4); }
.health-badge.danger { border-color: rgba(237,77,85,.45); }
.health-badge .health-txt { color: var(--muted); }
.health-badge .health-txt strong { color: var(--text); margin-left: 2px; }

/* Trend chart */
.trend { display: flex; align-items: flex-end; gap: 6px; height: 130px; margin-top: 16px; padding: 0 2px; }
.trend-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.tb-track { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.tb-fill { width: 100%; min-height: 2px; background: var(--grad); border-radius: 4px 4px 0 0; transition: height .3s; }
.tb-label { font-size: .62rem; color: var(--faint); }

/* Cluster live */
.cluster-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.cstat { background: var(--bg-2); border: 1px solid var(--border-soft); border-radius: 10px; padding: 14px; text-align: center; }
.cstat-n { display: block; font-size: 1.5rem; font-weight: 800; }
.cstat-l { color: var(--muted); font-size: .78rem; }

/* Filter chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.chip {
    padding: 6px 13px; border-radius: 999px; border: 1px solid var(--border);
    background: var(--panel); color: var(--muted); font-size: .82rem; font-weight: 600;
}
.chip:hover { color: var(--text); border-color: var(--brand); text-decoration: none; }
.chip.on { background: rgba(109,120,255,.14); color: #cbd0ff; border-color: rgba(109,120,255,.4); }

/* Key/value config grid */
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.kv > div { display: flex; flex-direction: column; gap: 4px; }
.kv .k { color: var(--faint); font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; }

/* Truncated message cell */
.msg { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }

/* ---------- Guild cards (member area) ---------- */
.guild-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; margin-top: 18px; }
.guild-card {
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px; display: flex; flex-direction: column; gap: 16px; color: var(--text);
    transition: border-color .15s, transform .15s, box-shadow .15s;
}
a.guild-card:hover { border-color: var(--brand); transform: translateY(-3px); box-shadow: var(--shadow); }
.guild-card.static:hover { transform: none; border-color: var(--border); box-shadow: none; }
.guild-head { display: flex; align-items: center; gap: 12px; }
.guild-icon { width: 46px; height: 46px; border-radius: 13px; object-fit: cover; flex-shrink: 0; }
.guild-icon.fallback {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--grad); color: #fff; font-weight: 800; font-size: 1.2rem;
}
.guild-icon.lg { width: 68px; height: 68px; border-radius: 18px; font-size: 1.7rem; }
.guild-title { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.guild-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.02rem; }
.tags { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.guild-metrics { display: flex; gap: 24px; color: var(--muted); font-size: .9rem; }
.guild-metrics strong { color: var(--text); font-size: 1.15rem; display: block; }
.guild-cta { color: var(--brand); font-weight: 600; font-size: .9rem; margin-top: auto; }

.guild-detail-head { display: flex; align-items: center; gap: 18px; }
.guild-detail-head h1 { margin: 0 0 8px; }
.back { display: inline-block; color: var(--muted); margin-bottom: 18px; font-size: .9rem; }
.back:hover { color: var(--text); }

.notice-card {
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 32px; margin: 22px 0; text-align: center;
}
.notice-card h2 { border: none; margin: 0 0 8px; padding: 0; }

/* ---------- Steps / FAQ ---------- */
.steps ol { padding-left: 20px; }
.steps li { margin: 10px 0; }

/* Numbered step cards */
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; margin-top: 22px; }
.step-card {
    position: relative; background: var(--panel); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px 22px 20px; display: flex; flex-direction: column; gap: 8px;
}
.step-card .step-num {
    width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
    font-weight: 800; margin-bottom: 6px;
    background: linear-gradient(135deg, #ffd76a, var(--gold)); color: #2a1e05;
}
.step-card h3 { margin: 0; font-size: 1.02rem; }
.step-card p { margin: 0; color: var(--muted); font-size: .92rem; }

/* ---------- FAQ v2 : help center (sticky category rail + smooth accordion) ---------- */
.faq-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 36px; align-items: start; margin-top: 18px; }
.faq-side { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 4px; }
.faq-side a {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px;
    color: var(--muted); font-size: .92rem; font-weight: 500;
}
.faq-side a:hover { background: rgba(255,255,255,.04); color: var(--text); }
.faq-side a .kico { color: var(--faint); margin-right: 0; }
.faq-side a:hover .kico { color: var(--brand); }

.faq-cat-section { margin-bottom: 38px; scroll-margin-top: 76px; }
.faq-cat-head { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.faq-cat-head .kico { color: var(--gold); margin-right: 0; }
.faq-cat-head .kico svg { width: 18px; height: 18px; }
.faq-cat-head h2 { margin: 0; font-size: 1.12rem; border: none; padding: 0; }
.faq-cat-head .count { margin-left: auto; font-size: .76rem; color: var(--faint); }

details.faq-item {
    background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
    margin: 10px 0; overflow: hidden; transition: border-color .18s;
}
details.faq-item:hover { border-color: rgba(109,120,255,.28); }
details.faq-item[open] { border-color: rgba(109,120,255,.42); background: linear-gradient(180deg, var(--panel), rgba(109,120,255,.04)); }
details.faq-item summary {
    cursor: pointer; font-weight: 600; list-style: none;
    display: flex; align-items: center; gap: 14px; padding: 15px 18px;
}
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item summary .chev { margin-left: auto; flex-shrink: 0; color: var(--faint); transition: transform .22s ease, color .22s; }
details.faq-item summary .chev svg { width: 15px; height: 15px; display: block; }
details.faq-item[open] summary .chev { transform: rotate(180deg); color: var(--brand); }
details.faq-item .faq-a { padding: 0 18px 16px 18px; color: var(--muted); line-height: 1.65; }
details.faq-item .faq-a code {
    background: var(--panel-2); border: 1px solid var(--border-soft); border-radius: 6px;
    padding: 1px 7px; font-size: .84em; color: #cbd0ff; white-space: nowrap;
}

/* Smooth open/close where the browser supports animating details content. */
@supports (interpolate-size: allow-keywords) {
    :root { interpolate-size: allow-keywords; }
    details.faq-item::details-content {
        block-size: 0; overflow: clip;
        transition: block-size .26s ease, content-visibility .26s allow-discrete;
    }
    details.faq-item[open]::details-content { block-size: auto; }
}

@media (max-width: 900px) {
    .faq-layout { grid-template-columns: 1fr; gap: 10px; }
    .faq-side { position: static; flex-direction: row; flex-wrap: wrap; }
    .faq-side a { padding: 7px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: .84rem; }
    .faq-side a .kico { display: none; }
}

/* CTA band */
.cta-band {
    margin-top: 44px; text-align: center; padding: 40px 28px; border-radius: var(--radius);
    border: 1px solid var(--border);
    background:
        radial-gradient(80% 120% at 50% 0%, rgba(240,178,50,.10), transparent 60%),
        linear-gradient(135deg, rgba(109,120,255,.10), rgba(162,91,255,.08));
}
.cta-band h2 { border: none; padding: 0; margin: 0 0 8px; }
.cta-band p { color: var(--muted); margin: 0 0 18px; }

/* Trust note */
.note-line {
    display: flex; align-items: center; gap: 12px; background: var(--panel);
    border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 18px; margin-top: 18px;
    color: var(--muted); font-size: .92rem;
}
.note-line .lock { font-size: 1.2rem; flex-shrink: 0; }
.note-line.warn { align-items: flex-start; border-color: rgba(240,178,50,.4); background: rgba(240,178,50,.06); }
.note-line.warn strong { display: block; color: var(--text); margin-bottom: 2px; }

/* Command chip */
.cmd {
    display: inline-block; max-width: 100%; vertical-align: middle;
    background: #0a0c11; border: 1px solid var(--border-soft); color: #c8ccd4;
    padding: 5px 9px; border-radius: 7px; font-size: .76rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.step-card .cmd { align-self: flex-start; margin-top: auto; }

/* Vertical setup guide — mirrors the bot's /ks-admin setup embed */
.setup-steps { list-style: none; padding: 0; margin: 22px 0 0; }
.setup-step { display: flex; gap: 16px; padding-bottom: 24px; position: relative; }
.setup-step:not(:last-child)::before {
    content: ""; position: absolute; left: 16px; top: 37px; bottom: 0; width: 2px; background: var(--border);
}
.ss-num {
    flex-shrink: 0; width: 33px; height: 33px; border-radius: 50%; z-index: 1;
    display: grid; place-items: center; font-weight: 800; font-size: .9rem;
    background: linear-gradient(135deg, #ffd76a, var(--gold)); color: #2a1e05;
}
.ss-num.member { background: var(--grad); color: #fff; font-size: 1rem; }
.ss-body { padding-top: 3px; min-width: 0; }
.ss-body h3 { margin: 0 0 4px; font-size: 1.05rem; }
.ss-body p { margin: 0 0 9px; color: var(--muted); font-size: .93rem; }

/* ---------- Server management (member area) ---------- */
.flash { padding: 12px 16px; border-radius: 9px; margin: 16px 0; font-size: .92rem; }
.flash.ok { background: rgba(63,206,143,.12); border: 1px solid rgba(63,206,143,.35); color: var(--ok); }
.flash.err { background: rgba(237,77,85,.10); border: 1px solid rgba(237,77,85,.3); color: var(--danger); }
.mgmt .mgmt-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 9px 0; }
.mgmt-row label { color: var(--muted); font-size: .9rem; flex: 0 0 148px; }
.mgmt-row select, .mgmt-num {
    background: #0a0c11; border: 1px solid var(--border); color: var(--text);
    padding: 9px 34px 9px 12px; border-radius: 9px; font: inherit; min-width: 210px;
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa2b4' stroke-width='2.5' stroke-linecap='round'><path d='M6 9l6 6 6-6'/></svg>");
    background-repeat: no-repeat; background-position: right 12px center;
}
.mgmt-row select:hover, .mgmt-num:hover { border-color: #384054; }
.mgmt-row select:focus, .mgmt-num:focus { outline: none; border-color: var(--brand); }
.mgmt-num { min-width: 96px; padding-right: 12px; background-image: none; text-align: center; }
.mgmt-sub { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin: 24px 0 8px; }
.inline { display: inline; margin: 0; }
.premium-cta {
    margin-top: 20px; padding: 16px 18px; border-radius: var(--radius-sm);
    border: 1px solid rgba(240,178,50,.35);
    background: radial-gradient(120% 140% at 0% 0%, rgba(240,178,50,.10), transparent 60%);
}
.premium-cta strong { color: var(--gold); }
.premium-cta p { margin: 0 0 4px; }
.premium-cta code { background: #0a0c11; }
.danger-btn { background: rgba(237,77,85,.14); color: var(--danger); border: 1px solid rgba(237,77,85,.3); box-shadow: none; }
.danger-btn:hover { background: rgba(237,77,85,.22); color: var(--danger); filter: none; transform: none; }

/* Empty state */
.empty-state {
    text-align: center; background: var(--panel); border: 1px dashed var(--border);
    border-radius: var(--radius); padding: 40px 28px; margin-top: 18px;
}
.empty-state .em-ico { font-size: 2rem; margin-bottom: 10px; }
.empty-state p { color: var(--muted); margin: 0 0 16px; }

/* ---------- Auth ---------- */
.auth-card {
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 40px 32px; text-align: center; box-shadow: var(--shadow); margin-top: 24px;
}
.auth-card .logo { font-size: 2.4rem; margin-bottom: 6px; }
.auth-card h1 { margin: 0 0 8px; font-size: 1.5rem; }
.auth-card .btn { width: 100%; margin-top: 18px; }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.form label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: .9rem; }
.form input {
    background: #0a0c11; border: 1px solid var(--border); color: var(--text);
    padding: 10px 12px; border-radius: 8px; font: inherit;
}
.alert { color: var(--danger); background: rgba(237,77,85,.1); border: 1px solid rgba(237,77,85,.25); padding: 10px 14px; border-radius: 8px; }
.notice { color: var(--ok); }
.stat { margin-top: 18px; }

/* ---------- Footer ---------- */
.footer {
    text-align: center; padding: 32px 24px; color: var(--muted);
    border-top: 1px solid var(--border-soft); font-size: .86rem; margin-top: 40px;
}

/* ============================================================
   KingShot royal touch — nav & footer
   ============================================================ */
.nav { border-top: 2px solid transparent; border-image: linear-gradient(90deg, transparent, var(--gold), transparent) 1; }
.nav .brand .crown { font-size: 1.1rem; margin-right: 7px; }
.nav .brand .ks { background: linear-gradient(135deg, #ffd76a, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.site-footer {
    border-top: 1px solid var(--border-soft); margin-top: auto;
    background: linear-gradient(180deg, transparent, rgba(240,178,50,.03));
}
.site-footer .foot-inner {
    max-width: var(--maxw); margin: 0 auto; padding: 34px 24px 24px;
    display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: flex-start;
}
.site-footer .foot-brand { display: flex; flex-direction: column; gap: 6px; max-width: 320px; }
.site-footer .foot-brand .name { font-weight: 800; font-size: 1.05rem; }
.site-footer .foot-brand .name .ks { background: linear-gradient(135deg, #ffd76a, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.site-footer .foot-brand .tag { color: var(--muted); font-size: .88rem; }
.site-footer .foot-links { display: flex; gap: 40px; flex-wrap: wrap; }
.site-footer .foot-col { display: flex; flex-direction: column; gap: 8px; }
.site-footer .foot-col strong { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.site-footer .foot-col a { color: var(--muted); font-size: .9rem; }
.site-footer .foot-col a:hover { color: var(--text); }
.site-footer .foot-bar {
    border-top: 1px solid var(--border-soft); text-align: center;
    padding: 16px 24px; color: var(--faint); font-size: .82rem;
}
.site-footer .foot-bar .divider { color: var(--gold); }

/* ============================================================
   Staff console (admin)
   ============================================================ */
.admin-layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 56px); }
.admin-side {
    background: var(--bg-2); border-right: 1px solid var(--border-soft);
    padding: 22px 16px; display: flex; flex-direction: column; gap: 20px; position: sticky; top: 49px; align-self: start;
    height: calc(100vh - 49px);
}
.admin-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.admin-brand .crest { font-size: 1.4rem; filter: drop-shadow(0 2px 6px rgba(240,178,50,.4)); }
.admin-brand strong { display: block; font-size: .98rem; }
.admin-brand small { display: block; font-size: .78rem; }
.admin-nav { display: flex; flex-direction: column; gap: 4px; }
.admin-nav a {
    display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 9px;
    color: var(--muted); font-weight: 500; font-size: .93rem;
}
.admin-nav a:hover { background: rgba(255,255,255,.04); color: var(--text); }
.admin-nav a.on { background: rgba(109,120,255,.14); color: #cbd0ff; border: 1px solid rgba(109,120,255,.3); }
.admin-nav a .ic { width: 20px; text-align: center; }
.admin-side-foot { margin-top: auto; padding: 0 6px; font-size: .86rem; }

.admin-main { padding: 26px 30px 60px; min-width: 0; }
.admin-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.admin-head h1 { margin: 0; font-size: 1.5rem; }

.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(63,206,143,.5); animation: pulse 2s infinite; }
.live-dot.off { background: var(--faint); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(63,206,143,.5); } 70% { box-shadow: 0 0 0 7px rgba(63,206,143,0); } 100% { box-shadow: 0 0 0 0 rgba(63,206,143,0); } }

/* search */
.searchbar { display: flex; gap: 10px; margin: 16px 0 8px; }
.searchbar input {
    flex: 1; background: #0a0c11; border: 1px solid var(--border); color: var(--text);
    padding: 10px 14px; border-radius: 9px; font: inherit;
}
.searchbar input:focus { outline: none; border-color: var(--brand); }
.result-count { font-size: .85rem; margin: 6px 0 10px; }

/* panels */
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; margin-top: 18px; }
/* Grid items must be allowed to shrink below their content (a wide table inside
   a panel would otherwise force the track width and overflow the page). */
.panels > *, .staff-panels > *, .faq-layout > * { min-width: 0; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; }
.panel-title { font-size: 1rem; margin: 0 0 16px; border: none; padding: 0; }
.hero-card { background: linear-gradient(135deg, var(--panel), rgba(109,120,255,.10)); }
.card-value.big { font-size: 2.4rem; }

/* bar rows */
.bar-row { display: grid; grid-template-columns: 150px 1fr 44px; align-items: center; gap: 12px; margin: 9px 0; }
.bar-label { overflow: hidden; }
.bar-label .badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: middle; }
.bar { height: 8px; background: #0a0c11; border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--muted); }
.bar-fill.ok { background: var(--ok); }
.bar-fill.warn { background: var(--warn); }
.bar-fill.danger { background: var(--danger); }
.bar-fill.brand { background: var(--grad); }
.bar-n { text-align: right; font-weight: 600; font-size: .9rem; }

/* code progress */
.code-row { display: grid; grid-template-columns: 160px 1fr auto; align-items: center; gap: 14px; margin: 12px 0; }
.code-name { justify-self: start; }
.code-meta { font-size: .9rem; white-space: nowrap; }
.progress { height: 10px; background: #0a0c11; border-radius: 999px; overflow: hidden; }
.progress-fill { display: block; height: 100%; border-radius: 999px; background: var(--grad); transition: width .4s; }
.progress-fill.ok { background: var(--ok); }

.cluster-todo { display: flex; align-items: flex-start; gap: 12px; }
.cluster-todo p { margin: 0; }

/* ---------- Console icons (inline SVG, no emojis) ---------- */
.svgico { display: inline-flex; }
.svgico svg { width: 17px; height: 17px; vertical-align: -3px; }
.admin-nav .ic .svgico svg { width: 16px; height: 16px; }
.admin-brand .crest .svgico svg { width: 22px; height: 22px; color: var(--gold); }
.kico { display: inline-flex; margin-right: 7px; color: var(--brand); }
.kico svg { width: 14px; height: 14px; }
.admin-btn .svgico svg { width: 14px; height: 14px; vertical-align: -2px; }
.panel-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel-title .panel-note { margin-left: auto; font-size: .8rem; font-weight: 400; }
.card-label { display: inline-flex; align-items: center; }

/* ---------- SVG line chart (overview trend) ---------- */
.linechart-wrap { margin-top: 12px; }
.linechart { width: 100%; height: 180px; display: block; }
.lc-line { stroke: var(--brand); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.lc-dot { fill: var(--brand-2); stroke: var(--bg); stroke-width: 1.5; transition: r .12s; pointer-events: none; }
.lc-dot.on { r: 5.5; fill: #fff; stroke: var(--brand); }
.lc-band { fill: transparent; cursor: crosshair; }
.lc-band:hover { fill: rgba(109,120,255,.06); }
.lc-labels { display: flex; justify-content: space-between; margin-top: 6px; padding: 0 2px; }
.lc-labels span { font-size: .66rem; color: var(--faint); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 12px; font-size: .82rem; color: var(--muted); }
.chart-legend strong { color: var(--text); }

/* Rich tooltip that follows the cursor over charts (see app.js) */
.chart-tip {
    position: fixed; z-index: 1000; pointer-events: none; max-width: 260px;
    background: #14161d; border: 1px solid var(--border); border-radius: 9px;
    padding: 9px 13px; font-size: .8rem; line-height: 1.45;
    box-shadow: 0 10px 30px rgba(0,0,0,.55);
    display: flex; flex-direction: column; gap: 2px;
}
.chart-tip[hidden] { display: none; }
.chart-tip strong { font-size: .82rem; }
.chart-tip span { color: var(--muted); }

/* ---------- Hourly bars + gold variant ---------- */
.trend.hourly { height: 110px; }
.trend.hourly .tb-label { font-size: .56rem; }
.tb-fill.gold { background: linear-gradient(180deg, #ffd76a, var(--gold)); }
.trend-bar[data-tip-title] { cursor: crosshair; border-radius: 6px; }
.trend-bar[data-tip-title]:hover { background: rgba(255,255,255,.04); }
.bar-row[data-tip-title] { cursor: default; border-radius: 6px; }
.bar-row[data-tip-title]:hover { background: rgba(255,255,255,.03); }
.em-ico.ok { color: var(--ok); }
.em-ico.ok svg { width: 34px; height: 34px; }

/* ---------- Rankings & mini progress (workers) ---------- */
.rank {
    display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px;
    border-radius: 50%; background: var(--panel-2); color: var(--muted); font-size: .74rem; font-weight: 700;
}
.rank.top { background: rgba(240,178,50,.16); color: var(--gold); }
.mini-progress { display: block; width: 64px; height: 4px; background: #0a0c11; border-radius: 999px; overflow: hidden; margin-top: 4px; }
.mini-fill { display: block; height: 100%; border-radius: 999px; }
.mini-fill.ok { background: var(--ok); }
.mini-fill.warn { background: var(--warn); }
.mini-fill.danger { background: var(--danger); }

/* ---------- Top players (member server page) ---------- */
.top-player { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border-soft); }
.top-player:last-child { border-bottom: none; }
.top-player .cell-user { flex: 1; min-width: 0; }
.tp-claims { white-space: nowrap; font-size: .88rem; }

/* ---------- Revenue ---------- */
.hero-card.gold { background: linear-gradient(135deg, var(--panel), rgba(240,178,50,.10)); }
.warn-card { border-color: rgba(240,178,50,.4); }
.kchip.warn { border-color: rgba(240,178,50,.4); color: var(--warn); }
.badge.gold { background: rgba(240,178,50,.18); color: var(--gold); }
.table-wrap.flat { margin-top: 4px; }

/* ---------- Staff management ---------- */
.roles-kv > div, .staff-row { display: flex; align-items: flex-start; gap: 12px; margin: 10px 0; }
.roles-kv .badge { flex-shrink: 0; margin-top: 1px; }
.staff-form { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 12px; align-items: end; }
.staff-form.vertical { grid-template-columns: 1fr; align-items: stretch; }
.staff-form label { display: flex; flex-direction: column; gap: 6px; font-size: .82rem; color: var(--muted); }
.staff-form label small { font-size: .72rem; }
.staff-form input, .staff-form select {
    background: #0a0c11; border: 1px solid var(--border); color: var(--text);
    padding: 9px 12px; border-radius: 8px; font: inherit;
}
.staff-form input:focus, .staff-form select:focus { outline: none; border-color: var(--brand); }
@media (max-width: 900px) { .staff-form { grid-template-columns: 1fr; align-items: stretch; } }
.staff-panels { grid-template-columns: minmax(380px, 3fr) minmax(300px, 2fr); }
@media (max-width: 1100px) { .staff-panels { grid-template-columns: 1fr; } }
.owner-row td { background: rgba(240,178,50,.035); }
.role-edit { display: inline-flex; align-items: center; gap: 8px; }
.role-edit select {
    background: #0a0c11; border: 1px solid var(--border); color: var(--text);
    padding: 6px 10px; border-radius: 7px; font: inherit; font-size: .84rem;
}
.role-edit select:focus { outline: none; border-color: var(--brand); }
.roles-hint { margin-top: 22px; border-top: 1px solid var(--border-soft); padding-top: 16px; }
.kico.gold { color: var(--gold); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .admin-layout { grid-template-columns: 1fr; }
    .admin-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
    .admin-nav { flex-direction: row; flex-wrap: wrap; }
    .admin-side-foot { margin: 0; }
}
@media (max-width: 820px) {
    .nav { grid-template-columns: auto 1fr; gap: 10px; padding: 10px 16px; row-gap: 8px; }
    .nav-center { grid-column: 1 / -1; justify-self: start; flex-wrap: wrap; gap: 16px; order: 3; }
    .nav-actions { justify-self: end; }
    .user-dd .uname { display: none; }
}
@media (max-width: 700px) {
    /* Force a natural width so multi-column tables scroll instead of wrapping badly. */
    .table-wrap table { min-width: 640px; }
    /* Right-edge fade: hints that the table scrolls horizontally. */
    .table-wrap { position: relative; }
    .table-wrap::after {
        content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 26px;
        background: linear-gradient(270deg, rgba(11,13,18,.8), transparent);
        pointer-events: none; border-radius: 0 var(--radius) var(--radius) 0;
    }
}
@media (max-width: 640px) {
    .hero h1 { font-size: 2rem; }
    .container { padding: 28px 16px 56px; }
    .code-row { grid-template-columns: 1fr; gap: 6px; }
    .admin-main { padding: 20px 14px 48px; }
    /* 24 hourly bars: labels become unreadable — the hover tooltip still has them. */
    .trend.hourly .tb-label { display: none; }
    .trend { gap: 3px; }
    .chart-legend { gap: 10px; font-size: .76rem; }
    .guild-detail-head h1 { font-size: 1.3rem; }

    /* Navbar: keep the brand + actions on one tight row — drop the "Orbio-"
       prefix and the language label (the flag stays) to make it all fit. */
    .nav { padding: 8px 12px; }
    .nav .brand { font-size: .95rem; }
    .nav .brand .brand-prefix { display: none; }
    .lang-dd .lang-label { display: none; }
    .nav-actions { gap: 6px; }
    .admin-btn { padding: 6px 10px; font-size: .8rem; }
    .dropdown > summary { padding: 6px 9px; }
    .dd-menu { right: 0; left: auto; }

    /* Stat cards: 2 per row instead of a screen-tall single column;
       hero cards (success rate, MRR) keep the full width. */
    .cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .card { padding: 14px; gap: 4px; }
    .card-value { font-size: 1.45rem; }
    .card-value.big { font-size: 1.9rem; }
    .hero-card, .warn-card { grid-column: 1 / -1; }

    /* Home trust numbers: one compact 3-column row. */
    .trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .trust .stat-pill { min-width: 0; padding: 12px 8px; text-align: center; }
    .trust .stat-pill .n { font-size: 1.25rem; }
    .trust .stat-pill .l { font-size: .68rem; }

    /* Status bars: the badge gets its own full-width line — no more truncation. */
    .bar-row { grid-template-columns: 1fr 44px; row-gap: 4px; }
    .bar-row .bar-label { grid-column: 1 / -1; }
}
