/* ============================================================
   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; }
.container.survey-wrap { max-width: 620px; }
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;
    white-space: nowrap;
}
/* Some locales (e.g. "Suivi des royaumes", "Meilleures alliances") don't fit the
   170px default — a wider menu keeps every label on one line so the icon stays
   aligned with it instead of centering against an ugly two-line wrap. */
.tools-dd .dd-menu { min-width: 220px; }
.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; }
/* A section-title following a <section> (panel) is a NEW group further down the page
   (e.g. "Guild bans" after the abuse panels, "Failure history" after the response-rules
   panels) — it needs the same breathing room a fresh <section> gets, unlike a
   page-opening section-title right under the header, which should stay tight. */
section + h2.section-title { margin-top: 40px; }
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; }

/* ---------- Active gift codes (home) ---------- */
.codes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 22px; }
.code-card {
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
    transition: border-color .15s, transform .15s;
}
.code-card:hover { border-color: rgba(240,178,50,.4); transform: translateY(-2px); }
.code-card .code-big { font-size: 1.15rem; padding: 6px 12px; }
.code-date { font-size: .8rem; }
.copy-btn { display: inline-flex; align-items: center; gap: 7px; }
.copy-btn.copied { border-color: var(--ok); color: var(--ok); background: rgba(63,206,143,.12); }

/* ---------- 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; display: flex; align-items: center; gap: 8px; }
.card-value { font-size: 1.9rem; font-weight: 800; }
.card-sub { font-size: .78rem; }
.muted-card .card-value { color: var(--muted); font-size: 1rem; }

.card-icon {
    width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(109,120,255,.14); border: 1px solid rgba(109,120,255,.28); color: #aab4ff;
}
.card-icon .svgico svg { width: 14px; height: 14px; }
.card-icon.gold { background: rgba(240,178,50,.16); border-color: rgba(240,178,50,.32); color: var(--gold); }

/* A "headline" stat gets extra visual weight — used for the single most important
   number in a panel (e.g. Power) so the eye lands there first. */
.card.highlight {
    border-color: rgba(240,178,50,.4);
    background: linear-gradient(165deg, rgba(240,178,50,.08), var(--panel) 60%);
}
.card.highlight .card-value { color: var(--gold); font-size: 2.3rem; }

.card-group-title {
    font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase;
    letter-spacing: .06em; margin: 22px 0 4px; display: flex; align-items: center; gap: 8px;
}
.cards + .card-group-title { margin-top: 22px; }

/* ---------- Kingdom directory (crest cards + KVK timeline) ---------- */
.crest {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
    background: var(--grad); color: #fff; font-weight: 800; font-size: .95rem;
    box-shadow: 0 6px 18px -8px rgba(109,120,255,.55);
}
.crest.lg { width: 72px; height: 72px; border-radius: 18px; font-size: 1.6rem; }
.crest.xl { width: 88px; height: 88px; border-radius: 22px; font-size: 2rem; }
.crest.gold-glow {
    background: linear-gradient(135deg, var(--gold), #ffd873); color: #241a03;
    box-shadow: 0 10px 26px -10px rgba(240,178,50,.65);
}

.kingdom-hero { display: flex; align-items: center; gap: 20px; margin-bottom: 10px; }
.kingdom-hero-body h1 { margin: 0 0 6px; font-size: 1.9rem; }
.kingdom-hero-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

.local-rankings { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.lb-list.compact .lb-row { padding: 9px 12px; gap: 10px; }
.lb-list.compact .lb-avatar { width: 30px; height: 30px; border-radius: 8px; }
.lb-list.compact .lb-name { font-size: .9rem; }

.kingdom-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin: 18px 0; }
.kingdom-card {
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px; display: flex; gap: 14px; align-items: flex-start;
    transition: border-color .15s, transform .15s; color: inherit;
}
.kingdom-card:hover { border-color: rgba(109,120,255,.4); transform: translateY(-2px); }
.kingdom-card .kc-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kingdom-card .kc-title { font-weight: 700; font-size: 1.05rem; }
.kingdom-card .kc-meta { font-size: .78rem; color: var(--muted); }
.kingdom-card .kc-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.kingdom-card .kc-stats { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
.kingdom-card .kc-stat { font-size: .78rem; color: var(--faint); display: flex; align-items: center; gap: 7px; }
.kingdom-card .kc-stat .svgico svg { width: 13px; height: 13px; flex-shrink: 0; color: var(--faint); }
.kingdom-card .kc-power { color: var(--gold); font-weight: 600; }
.kingdom-card .kc-power .svgico svg { color: var(--gold); }

.kvk-timeline { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.kvk-item {
    background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--border-soft);
    border-radius: var(--radius-sm); padding: 12px 16px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.kvk-item.win { border-left-color: var(--ok); }
.kvk-item.loss { border-left-color: var(--danger); }
.kvk-item.mixed { border-left-color: var(--gold); }
.kvk-item .kvk-season { font-size: .78rem; color: var(--muted); }
.kvk-item .kvk-opponent { font-weight: 600; }
.kvk-item .kvk-phases { display: flex; gap: 14px; flex-wrap: wrap; }
.kvk-item .kvk-phase { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); }

.winbar { width: 100%; height: 6px; border-radius: 999px; background: var(--panel-2); overflow: hidden; margin: 8px 0 2px; }
.winbar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--gold), var(--ok)); }

.rp-dots { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.rp-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--border-soft); flex-shrink: 0; }
.rp-dot.win { background: var(--ok); }
.rp-dot.loss { background: var(--danger); }
.rp-dot.mixed { background: var(--gold); }

/* ---------- Global leaderboards (Tools > Players / Alliances) ---------- */
.lb-list { display: flex; flex-direction: column; gap: 8px; margin: 18px 0; }
.lb-row {
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 12px 16px; display: flex; align-items: center; gap: 14px; transition: border-color .15s;
}
.lb-row:hover { border-color: rgba(109,120,255,.4); }
.lb-rank {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
    background: var(--panel-2); color: var(--muted); font-weight: 800; font-size: .85rem;
}
.lb-rank.top3 { background: var(--grad); color: #fff; }
.lb-avatar { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: var(--panel-2); }
.lb-avatar-fallback { display: inline-flex; align-items: center; justify-content: center; color: var(--faint); }
.lb-avatar-fallback .svgico svg { width: 18px; height: 18px; }
.lb-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.lb-name { font-weight: 700; font-size: .98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-meta { font-size: .78rem; color: var(--muted); }
.lb-power { font-weight: 800; color: var(--gold); font-size: 1.05rem; white-space: nowrap; flex-shrink: 0; }

/* ---------- 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; table-layout: auto; }
.col-truncate { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fleet-actions { display: flex; flex-wrap: wrap; gap: 6px; min-width: 300px; }
.tag-mode {
    display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .74rem;
    font-weight: 600; text-transform: uppercase; letter-spacing: .03em; border: 1px solid transparent;
}
.tag-mode-free    { background: rgba(52,199,120,.12); color: #34c778; border-color: rgba(52,199,120,.35); }
.tag-mode-mixed   { background: rgba(120,140,255,.14); color: #8f9bff; border-color: rgba(120,140,255,.35); }
.tag-mode-premium { background: rgba(240,178,50,.14); color: var(--gold); border-color: rgba(240,178,50,.35); }
.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; }
.notice-card .notice-ico { display: block; font-size: 1.9rem; margin-bottom: 10px; }

/* ---------- 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;
    animation: flash-in .35s ease-out;
}
.flash.ok { background: rgba(63,206,143,.12); border: 1px solid rgba(63,206,143,.35); color: var(--ok); animation: flash-in .35s ease-out, pulse-ok 1.3s ease-out .35s; }
.flash.err { background: rgba(237,77,85,.10); border: 1px solid rgba(237,77,85,.3); color: var(--danger); animation: flash-in .35s ease-out, pulse-err 1.3s ease-out .35s; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes pulse-ok { 0% { box-shadow: 0 0 0 0 rgba(63,206,143,.45); } 70% { box-shadow: 0 0 0 10px rgba(63,206,143,0); } 100% { box-shadow: 0 0 0 0 rgba(63,206,143,0); } }
@keyframes pulse-err { 0% { box-shadow: 0 0 0 0 rgba(237,77,85,.4); } 70% { box-shadow: 0 0 0 10px rgba(237,77,85,0); } 100% { box-shadow: 0 0 0 0 rgba(237,77,85,0); } }
/* Save/Add/Post actions in the management forms: a distinct green so the
   "confirm this row" action stands out from the brand-purple nav CTAs. */
.btn.mgmt-save { background: linear-gradient(135deg, var(--ok), #2fae76); box-shadow: 0 8px 22px -8px rgba(63,206,143,.55); }
.btn.mgmt-save:hover { box-shadow: 0 12px 28px -8px rgba(63,206,143,.65); }
.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; }
/* Groups a label with its field as one atomic unit, so rows with many pairs
   (e.g. the Bear Trap channel/role/date/time/minutes row) wrap a whole
   label+field together instead of splitting them onto separate lines. */
.mgmt-row .mgmt-field { display: inline-flex; align-items: center; gap: 8px; }
.mgmt-row .mgmt-field label { flex: 0 0 auto; }
.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; }
/* Plain text field (e.g. a KingShot player ID) — same dark styling as select/mgmt-num,
   but wide enough that its placeholder hint isn't clipped. */
.mgmt-text {
    background: #0a0c11; border: 1px solid var(--border); color: var(--text);
    padding: 9px 12px; border-radius: 9px; font: inherit; min-width: 240px; max-width: 320px;
}
.mgmt-text:hover { border-color: #384054; }
.mgmt-text:focus { outline: none; border-color: var(--brand); }
.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: 18px 20px; border-radius: var(--radius-sm);
    border: 1px solid rgba(240,178,50,.35);
    background: radial-gradient(120% 140% at 50% 0%, rgba(240,178,50,.10), transparent 60%);
    text-align: center; /* the whole block follows the centered CTA button */
}
.premium-cta strong { color: var(--gold); }
.premium-cta p { margin: 0 0 6px; }
.premium-cta .btn-row { margin: 10px 0; }
.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; }
/* box-shadow reset: .btn:hover's default brand-blue glow would otherwise show through
   behind this red button on hover (never overridden until now). */
.danger-btn:hover { background: rgba(237,77,85,.22); color: var(--danger); filter: none; transform: none; box-shadow: 0 10px 26px -10px rgba(237,77,85,.5); }

/* 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, .form textarea {
    background: #0a0c11; border: 1px solid var(--border); color: var(--text);
    padding: 10px 12px; border-radius: 8px; font: inherit;
}
.form textarea { resize: vertical; min-height: 70px; }
.form input:focus, .form textarea:focus { outline: none; border-color: var(--brand); }
.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; }

/* ---------- Surveys ---------- */
.option-rows { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.option-row { display: flex; gap: 8px; }
.option-row input { flex: 1; }
.survey-options { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 18px; }
.option-choice {
    display: flex; align-items: center; gap: 14px; padding: 15px 18px;
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm);
    cursor: pointer; transition: border-color .15s, background .15s, transform .15s; color: var(--text);
}
.option-choice:hover { border-color: rgba(109,120,255,.4); transform: translateY(-1px); }
.option-choice:has(input:checked) { border-color: var(--brand); background: rgba(109,120,255,.1); }

/* Custom radio/checkbox — the bare browser control clashes with the dark theme. */
.option-choice input[type="radio"], .option-choice input[type="checkbox"] {
    appearance: none; -webkit-appearance: none; width: 21px; height: 21px; flex-shrink: 0;
    border: 2px solid var(--border-soft, var(--border)); background: #0a0c11; position: relative;
    cursor: pointer; transition: border-color .15s, background .15s;
}
.option-choice input[type="radio"] { border-radius: 50%; }
.option-choice input[type="checkbox"] { border-radius: 6px; }
.option-choice input:checked { border-color: var(--brand); background: var(--grad); }
.option-choice input[type="radio"]:checked::after {
    content: ""; position: absolute; inset: 5px; border-radius: 50%; background: #fff;
}
.option-choice input[type="checkbox"]:checked::after {
    content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px;
    border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.option-choice input:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.survey-card {
    text-align: left;
    background: linear-gradient(160deg, var(--panel), rgba(109,120,255,.07));
}
.survey-card h1 { text-align: left; }
.survey-card .btn { width: auto; }
.survey-kicker {
    display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
    color: #aab4ff; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
}
.survey-kicker .ico { font-size: 1rem; }

/* Public survey list (/{lang}/surveys) */
.survey-list { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.survey-list-card {
    display: flex; align-items: center; justify-content: space-between; gap: 18px;
    padding: 22px 26px; background: var(--panel); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text); transition: border-color .15s, transform .15s;
}
.survey-list-card:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow); }
.survey-list-body h3 { margin: 0 0 6px; }
.survey-list-body p { margin: 0; }
.survey-list-arrow { font-size: 1.4rem; color: var(--brand); flex-shrink: 0; }

/* ---------- 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);
    overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.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; flex: 0 0 auto; }
.admin-nav a .ic + span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.admin-nav-cat { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin: 14px 0 2px; padding: 0 12px; }
.admin-nav-cat:first-child { margin-top: 0; }
.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; }

/* ============================================================
   Member server dashboard (/me/servers/{id}) — same layout as the
   staff console, distinct class names to avoid "admin-" on a member page.
   ============================================================ */
.member-layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 56px); }
.member-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);
    overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.member-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.member-brand strong { display: block; font-size: .98rem; }
.member-brand small { display: block; font-size: .78rem; }
.member-nav { display: flex; flex-direction: column; gap: 4px; }
.member-nav a {
    display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 9px;
    color: var(--muted); font-weight: 500; font-size: .93rem;
}
.member-nav a:hover { background: rgba(255,255,255,.04); color: var(--text); }
.member-nav a.on { background: rgba(109,120,255,.14); color: #cbd0ff; border: 1px solid rgba(109,120,255,.3); }
.member-nav a .ic { width: 20px; text-align: center; }
.member-side-foot { margin-top: auto; padding: 0 6px; font-size: .86rem; }

.member-main { padding: 26px 30px 60px; min-width: 0; }

.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); }
.searchbar-select { background: #0a0c11; border: 1px solid var(--border); color: var(--text); padding: 10px 12px;
    border-radius: 9px; font: inherit; cursor: pointer; }
.searchbar-select: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; }

/* survey results: option bars + vote-share doughnut side by side */
.survey-results { display: grid; grid-template-columns: 1fr 200px; gap: 28px; align-items: center; }
.survey-bars { min-width: 0; }
.survey-donut { height: 210px; }

/* code progress */
.code-row { display: grid; grid-template-columns: 160px 1fr auto; align-items: center; gap: 14px; margin: 12px 0; }
.code-row.link-row { grid-template-columns: 1fr auto; }
.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; }
.premium-btn .svgico svg { width: 14px; height: 14px; vertical-align: -2px; }
.nav-center a { display: inline-flex; align-items: center; gap: 6px; }
.nav-center a .ic .svgico svg { width: 15px; height: 15px; vertical-align: -1px; }
.dd-menu .ic .svgico svg { width: 15px; height: 15px; }
.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; }

/* ---------- Chart.js line charts (see static/js/charts.js) ---------- */
.oc-chart { position: relative; height: 220px; margin-top: 14px; }
.oc-chart.compact { height: 150px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 12px; font-size: .82rem; color: var(--muted); }
.chart-legend strong { color: var(--text); }

/* Trend window selector (7/14/30 days — admin overview main chart) */
.panel-head-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.panel-head-row .panel-title { margin: 0; }
.trend-range { display: flex; gap: 6px; }
.trend-range a { padding: 4px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; color: var(--muted); background: rgba(255,255,255,.03); border: 1px solid var(--border); }
.trend-range a:hover { color: var(--text); border-color: rgba(255,255,255,.18); }
.revenue-panel-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.trend-range a.active { color: #fff; background: var(--grad); border-color: transparent; }

/* 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); }

/* ---------- Response rules — add form ---------- */
.rule-form { display: grid; grid-template-columns: 2fr 1.2fr 2fr auto; gap: 14px; align-items: end; margin-top: 4px; }
.rule-form label { display: flex; flex-direction: column; gap: 6px; font-size: .82rem; color: var(--muted); }
.rule-form input, .rule-form select {
    background: #0a0c11; border: 1px solid var(--border); color: var(--text);
    padding: 9px 12px; border-radius: 8px; font: inherit; width: 100%;
}
.rule-form input:focus, .rule-form select:focus { outline: none; border-color: var(--brand); }
.rule-form .rule-form-submit { padding: 9px 20px; }
@media (max-width: 900px) { .rule-form { grid-template-columns: 1fr; align-items: stretch; } }
@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); }
.fleet-create-form { display: inline-flex; align-items: center; gap: 10px; }
.fleet-create-form input, .fleet-create-form select {
    background: #0a0c11; border: 1px solid var(--border); color: var(--text);
    padding: 9px 12px; border-radius: 8px; font: inherit;
}
.fleet-create-form input:focus, .fleet-create-form select:focus { outline: none; border-color: var(--brand); }
.fleet-logs-popup { padding: 0; background: #0a0c11; height: 100vh; overflow: hidden; }
.fleet-logs-main { padding: 14px 18px; max-width: 100%; height: 100vh; display: flex; flex-direction: column; box-sizing: border-box; }
.fleet-logs-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; flex: none; }
.fleet-logs-head h1 { font-size: 1.1rem; margin: 0; }
.fleet-logs-toolbar { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 12px; }
.fleet-logs-tail { display: inline-flex; align-items: center; gap: 6px; }
.fleet-logs-tail a {
    display: inline-block; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--border);
    color: var(--muted); text-decoration: none; font-size: .82rem; line-height: 1.4;
}
.fleet-logs-tail a:hover { border-color: var(--brand); color: var(--text); }
.fleet-logs-tail a.active { color: #0a0c11; font-weight: 600; background: var(--brand); border-color: var(--brand); }
.fleet-log-box {
    background: #11141b; border: 1px solid var(--border); border-radius: 8px;
    padding: 14px 16px; color: var(--text); font-family: ui-monospace, "SF Mono", Consolas, monospace;
    font-size: .82rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
    flex: 1 1 auto; overflow-y: auto; margin: 0; min-height: 0;
}

/* In-page "window" overlay for the Fleet logs iframe — styled like a floating
   window (title bar + close button) but stays inside the tab, unlike a real
   browser popup which Marco didn't want. */
.fleet-logs-overlay {
    position: fixed; inset: 0; background: rgba(5, 6, 9, .65);
    display: flex; align-items: center; justify-content: center; z-index: 500;
}
.fleet-logs-overlay[hidden] { display: none; }

.fleet-autoscaler-block {
    margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--border-soft);
}
.fleet-autoscaler-block h3 { margin: 0 0 6px; font-size: 1rem; }
.autoscaler-form { margin-top: 14px; }
.autoscaler-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px; max-width: 620px;
}
.autoscaler-mode-card {
    background: #0a0c11; border: 1px solid var(--border); border-radius: 10px;
    padding: 12px 14px; display: flex; flex-direction: column; gap: 8px;
}
.autoscaler-mode-name { font-weight: 600; font-size: .9rem; }
.autoscaler-mode-card label {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    font-size: .78rem; color: var(--muted);
}
.autoscaler-mode-card input {
    width: 70px; background: #11141b; border: 1px solid var(--border); color: var(--text);
    padding: 6px 8px; border-radius: 6px; font: inherit; text-align: right;
}
.autoscaler-mode-card input:focus { outline: none; border-color: var(--brand); }
.autoscaler-form > .btn { margin-top: 14px; }
.fleet-logs-window {
    width: min(960px, 92vw); height: min(680px, 88vh);
    background: #0a0c11; border: 1px solid var(--border); border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0,0,0,.55); overflow: hidden;
    display: flex; flex-direction: column;
}
.fleet-logs-titlebar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; background: #11141b; border-bottom: 1px solid var(--border);
    font-size: .85rem; font-weight: 600; flex: none;
}
.fleet-logs-close {
    background: none; border: none; color: var(--muted); font-size: 1.2rem;
    line-height: 1; cursor: pointer; padding: 0 4px;
}
.fleet-logs-close:hover { color: var(--text); }
.fleet-logs-iframe { flex: 1 1 auto; border: none; width: 100%; }
.roles-hint { margin-top: 22px; border-top: 1px solid var(--border-soft); padding-top: 16px; }
.kico.gold { color: var(--gold); }

/* ============================================================
   KINGDOM — gamified leaderboard (original medieval scene)
   ============================================================ */
.kicker.gold { color: var(--gold); border-color: rgba(240,178,50,.35); background: rgba(240,178,50,.08); }
.grad-gold { background: linear-gradient(135deg, #ffd76a, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kingdom .page-head { text-align: center; }
.k-formula { font-size: .8rem; margin-top: 2px; }

.k-scene {
    position: relative; margin-top: 26px; padding: 40px 18px 0; border-radius: var(--radius);
    border: 1px solid var(--border);
    background:
        radial-gradient(60% 45% at 50% 0%, rgba(109,120,255,.14), transparent 70%),
        linear-gradient(180deg, #0d1020 0%, #12152a 55%, #191430 100%);
    overflow: hidden;
}
/* twinkling stars */
.k-stars i {
    position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #fff;
    opacity: .5; animation: ktwinkle 3.2s ease-in-out infinite;
}
.k-stars i:nth-child(1)  { left: 6%;  top: 12%; animation-delay: .1s; }
.k-stars i:nth-child(2)  { left: 14%; top: 34%; animation-delay: 1.1s; }
.k-stars i:nth-child(3)  { left: 22%; top: 8%;  animation-delay: 2s; }
.k-stars i:nth-child(4)  { left: 33%; top: 24%; animation-delay: .6s; }
.k-stars i:nth-child(5)  { left: 44%; top: 6%;  animation-delay: 1.6s; }
.k-stars i:nth-child(6)  { left: 55%; top: 18%; animation-delay: .3s; }
.k-stars i:nth-child(7)  { left: 64%; top: 9%;  animation-delay: 2.4s; }
.k-stars i:nth-child(8)  { left: 73%; top: 28%; animation-delay: .9s; }
.k-stars i:nth-child(9)  { left: 82%; top: 12%; animation-delay: 1.9s; }
.k-stars i:nth-child(10) { left: 90%; top: 30%; animation-delay: .4s; }
.k-stars i:nth-child(11) { left: 49%; top: 38%; animation-delay: 1.3s; }
.k-stars i:nth-child(12) { left: 8%;  top: 52%; animation-delay: 2.7s; }
@keyframes ktwinkle { 0%,100% { opacity: .15; transform: scale(.8); } 50% { opacity: .8; transform: scale(1.2); } }

/* king block + golden aura (like the in-game dome) */
.k-king { position: relative; display: flex; justify-content: center; }
.k-aura {
    position: absolute; top: -8%; width: 460px; height: 340px; border-radius: 50%;
    background: radial-gradient(50% 50% at 50% 50%, rgba(240,178,50,.28), rgba(240,178,50,.08) 55%, transparent 72%);
    filter: blur(6px); animation: kaura 3.6s ease-in-out infinite; pointer-events: none;
}
@keyframes kaura { 0%,100% { opacity: .75; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }

.k-card {
    position: relative; text-align: center; padding: 18px 26px 20px; border-radius: 16px;
    background: linear-gradient(180deg, rgba(23,26,40,.92), rgba(17,19,32,.94));
    border: 1px solid rgba(240,178,50,.35);
    box-shadow: 0 14px 42px rgba(0,0,0,.45);
    animation: krise .7s ease both;
}
.k-rank1 {
    border-color: rgba(240,178,50,.6); box-shadow: 0 0 0 1px rgba(240,178,50,.25), 0 18px 50px rgba(0,0,0,.5), 0 0 60px rgba(240,178,50,.14);
    animation: kkingrise .85s cubic-bezier(.2,.9,.3,1.3) both, kbreathe 5s ease-in-out .85s infinite;
}
@keyframes krise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes kkingrise { from { opacity: 0; transform: translateY(46px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes kbreathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.012); } }

.k-castle { width: 220px; height: 150px; overflow: visible; display: block; margin: 0 auto 6px; }
.k-castle.sm { width: 120px; height: 92px; margin-bottom: 2px; }
.kc-wall { fill: #2c3044; }
.kc-roof { fill: #6d78ff; }
.kc-roof.gold { fill: #f0b232; }
.k-crown { transform-origin: 100px -20px; animation: kcrown 3s ease-in-out infinite; }
@keyframes kcrown { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.k-banner { animation: kflag 2.6s ease-in-out infinite; transform-origin: top center; }
.k-banner.d2 { animation-delay: 1.3s; }
@keyframes kflag { 0%,100% { transform: skewX(0); } 50% { transform: skewX(-5deg); } }

.k-title { font-weight: 800; color: var(--gold); font-size: 1.15rem; letter-spacing: .04em; text-transform: uppercase; margin-top: 4px; }
.k-title.sm { font-size: .8rem; }
.k-guild { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.k-name { font-weight: 700; font-size: 1.05rem; }
.k-mini .k-name { font-size: .92rem; }
.avatar.gold-ring { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(240,178,50,.35); }
.k-score { font-size: 1.6rem; font-weight: 800; margin-top: 8px; }
.k-score small { color: var(--muted); font-weight: 600; font-size: .8rem; }
.k-score.sm { font-size: 1.15rem; margin-top: 6px; }
.k-stats { color: var(--muted); font-size: .84rem; margin-top: 4px; }
.k-rankchip {
    position: absolute; top: 10px; left: 12px; background: var(--panel-2);
    border: 1px solid var(--border); color: var(--gold); font-weight: 800; font-size: .78rem;
    border-radius: 999px; padding: 2px 9px;
}

/* ── tier layouts: podium (2-3, gold) above council (4-7, silver) ── */
.k-podium {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px;
    margin: 34px auto 0; max-width: 620px; position: relative; z-index: 1;
}
.k-council {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 14px;
    margin: 18px auto 0; max-width: 980px; position: relative; z-index: 1; padding-bottom: 34px;
}
.k-council .k-card { width: 226px; }
.k-podium .k-card:nth-child(1) { animation-delay: .10s; }
.k-podium .k-card:nth-child(2) { animation-delay: .20s; }
.k-council .k-card:nth-child(1) { animation-delay: .30s; }
.k-council .k-card:nth-child(2) { animation-delay: .38s; }
.k-council .k-card:nth-child(3) { animation-delay: .46s; }
.k-council .k-card:nth-child(4) { animation-delay: .54s; }
.k-mini { border-color: var(--border); transition: transform .18s, border-color .18s, box-shadow .18s; }
.k-mini:hover { transform: translateY(-4px); }

/* gold tier (podium) vs silver tier (council) */
.k-card.k-gold { border-color: rgba(240,178,50,.42); box-shadow: 0 10px 34px rgba(0,0,0,.45), 0 0 26px rgba(240,178,50,.08); }
.k-card.k-gold:hover { border-color: rgba(240,178,50,.7); box-shadow: 0 14px 40px rgba(0,0,0,.5), 0 0 36px rgba(240,178,50,.16); }
.k-card.k-silver { opacity: .96; }
.k-card.k-silver .k-castle { filter: saturate(.75) brightness(.92); }
.k-card.k-silver:hover { border-color: rgba(154,162,180,.55); }
.k-title.gold { color: var(--gold); }
.k-rankchip.gold {
    border-color: rgba(240,178,50,.5); background: rgba(240,178,50,.12);
    overflow: hidden; position: absolute;
}
.k-rankchip.gold::after {
    content: ""; position: absolute; inset: 0; transform: translateX(-120%);
    background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent);
    animation: kchipshine 4.2s ease-in-out infinite;
}
@keyframes kchipshine { 0%, 60% { transform: translateX(-120%); } 85% { transform: translateX(120%); } 100% { transform: translateX(120%); } }
.k-castle.md { width: 150px; height: 112px; margin-bottom: 4px; }

/* clickable castles (opt-in public profiles) */
.k-overlink { position: absolute; inset: 0; z-index: 3; border-radius: inherit; }
.k-card.has-link { cursor: pointer; }
.k-card.has-link::after {
    content: "👁"; position: absolute; top: 10px; right: 12px; font-size: .8rem;
    opacity: .45; transition: opacity .18s, transform .18s;
}
.k-card.has-link:hover::after { opacity: 1; transform: scale(1.15); }
.k-card.has-link:hover { transform: translateY(-4px); }

/* windows flicker like candlelight */
.kc-window { fill: #f0b232; opacity: .85; animation: kwindow 3.4s ease-in-out infinite; }
.kc-window.d2 { animation-delay: 1.2s; }
.kc-window.d3 { animation-delay: 2.1s; }
@keyframes kwindow { 0%,100% { opacity: .5; } 45% { opacity: 1; } 60% { opacity: .7; } 75% { opacity: .95; } }

/* sparkles orbiting the king */
.k-sparkles b {
    position: absolute; width: 5px; height: 5px; border-radius: 50%;
    background: #ffd76a; box-shadow: 0 0 8px 2px rgba(255,215,106,.55);
    animation: ksparkle 4.4s ease-in-out infinite; opacity: 0; z-index: 2; pointer-events: none;
}
.k-sparkles b:nth-child(1) { left: 32%; top: 16%; animation-delay: 0s; }
.k-sparkles b:nth-child(2) { left: 66%; top: 10%; animation-delay: .8s; }
.k-sparkles b:nth-child(3) { left: 26%; top: 52%; animation-delay: 1.6s; }
.k-sparkles b:nth-child(4) { left: 72%; top: 46%; animation-delay: 2.3s; }
.k-sparkles b:nth-child(5) { left: 48%; top: 4%;  animation-delay: 3.1s; }
.k-sparkles b:nth-child(6) { left: 58%; top: 62%; animation-delay: 3.8s; }
@keyframes ksparkle {
    0%, 100% { opacity: 0; transform: translateY(6px) scale(.6); }
    18% { opacity: 1; transform: translateY(0) scale(1); }
    40% { opacity: 0; transform: translateY(-14px) scale(.5); }
}

/* shooting star across the sky */
.k-scene::before {
    content: ""; position: absolute; top: 14%; left: -12%; width: 90px; height: 2px;
    background: linear-gradient(90deg, transparent, #fff, transparent);
    transform: rotate(-14deg); opacity: 0; animation: kshoot 9s linear infinite; pointer-events: none;
}
@keyframes kshoot {
    0%, 86% { opacity: 0; left: -12%; top: 12%; }
    88% { opacity: .9; }
    96% { opacity: 0; left: 104%; top: 30%; }
    100% { opacity: 0; }
}

/* progress bars grow in on load, then a light sheen sweeps across */
.k-progress-fill { position: relative; overflow: hidden; animation: kfill 1.1s ease .45s both; }
@keyframes kfill { from { width: 0; } }
.k-progress-fill::after {
    content: ""; position: absolute; inset: 0; transform: translateX(-120%);
    background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent);
    animation: ksheen 3.6s ease-in-out 1.6s infinite;
}
@keyframes ksheen { 0%, 55% { transform: translateX(-120%); } 85% { transform: translateX(120%); } 100% { transform: translateX(120%); } }

/* score lands with a small gold pulse once the count-up finishes */
.k-countup.k-land { animation: kland .5s ease; }
@keyframes kland { 0% { transform: scale(1); } 35% { transform: scale(1.14); text-shadow: 0 0 18px rgba(240,178,50,.7); } 100% { transform: scale(1); } }

/* Court table rows: staggered fade/slide entrance */
.k-court tbody tr { animation: kcourtrise .5s ease both; }
.k-court tbody tr:nth-child(1) { animation-delay: .04s; }
.k-court tbody tr:nth-child(2) { animation-delay: .08s; }
.k-court tbody tr:nth-child(3) { animation-delay: .12s; }
.k-court tbody tr:nth-child(4) { animation-delay: .16s; }
.k-court tbody tr:nth-child(5) { animation-delay: .20s; }
.k-court tbody tr:nth-child(6) { animation-delay: .24s; }
.k-court tbody tr:nth-child(7) { animation-delay: .28s; }
.k-court tbody tr:nth-child(8) { animation-delay: .32s; }
.k-court tbody tr:nth-child(n+9) { animation-delay: .36s; }
@keyframes kcourtrise { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
.k-court tbody tr:hover .k-progress-fill::after { animation-duration: 1.2s; }

/* profile page extras */
.k-profile-hero { padding-bottom: 34px; }
.k-name.xl { font-size: 1.35rem; }
.k-titlebar { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 10px; }
/* relative (not static): keeps the chip in the flex row like static would, but still
   gives its ::after shine sweep (.k-rankchip.gold) a local containing block — otherwise
   the sweep escapes to .k-card (the next positioned ancestor) and balloons into a huge
   sliding rectangle across the whole hero scene instead of a small shine on the chip.
   top/left reset to 0: unlike static, relative DOES honor .k-rankchip's own top:10px/
   left:12px (meant for its normal absolute placement), which would otherwise nudge the
   chip out of its flex-centered spot in the titlebar row. */
.k-titlebar .k-rankchip { position: relative; top: 0; left: 0; }
.k-toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.k-toggle input { accent-color: var(--gold); width: 16px; height: 16px; }
.mgmt-hint { font-size: .8rem; margin: 2px 0 0; }
.mgmt-viewlink { font-size: .84rem; text-decoration: underline; }

/* respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    .k-aura, .k-crown, .k-banner, .k-stars i, .kc-window, .k-sparkles b,
    .k-scene::before, .k-card, .k-progress-fill, .k-progress-fill::after,
    .k-rankchip.gold::after, .k-countup.k-land, .k-court tbody tr { animation: none !important; }
}

.k-progress { display: block; height: 6px; background: #0a0c11; border-radius: 999px; overflow: hidden; margin-top: 10px; }
.k-progress-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), #ffd76a); }
.k-roadcell { min-width: 150px; }
.k-roadcell .k-progress { display: inline-block; width: 90px; margin: 0 8px 0 0; vertical-align: middle; }

/* Soft golden glow at the foot of the castle scene. No hard border-top: a
   full-width 1px line reads as a rendering artifact rather than "the ground". */
.k-ground {
    position: absolute; left: 0; right: 0; bottom: 0; height: 26px;
    background: radial-gradient(60% 100% at 50% 100%, rgba(240, 178, 50, .12), transparent 70%);
    pointer-events: none;
}

.k-court { margin-top: 34px; }

@media (max-width: 640px) {
    .k-podium { grid-template-columns: 1fr; max-width: 340px; }
    .k-council .k-card { width: 100%; max-width: 340px; }
    .k-aura { width: 320px; height: 260px; }
    .k-castle { width: 180px; height: 122px; }
}

/* ---------- 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-nav-cat { flex-basis: 100%; margin: 8px 0 0; padding: 0 4px; }
    .admin-side-foot { margin: 0; }
    .member-layout { grid-template-columns: 1fr; }
    .member-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
    .member-nav { flex-direction: row; flex-wrap: wrap; }
    .member-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; }
    .survey-results { grid-template-columns: 1fr; }
    .survey-donut { height: 230px; margin-top: 4px; }
}
@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, .code-row.link-row { grid-template-columns: 1fr; gap: 6px; }
    .admin-main { padding: 20px 14px 48px; }
    .member-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; }
}

/* ── Live data refresh (app.js polling) ─────────────────────────────────────
   Values flash briefly when they change in place; progress bars glide. */
@keyframes live-flash {
    0%   { color: var(--brand); text-shadow: 0 0 14px rgba(109, 120, 255, 0.55); }
    100% { color: inherit; text-shadow: none; }
}
.live-flash { animation: live-flash 1.1s ease-out; }
.bar-fill, .progress-fill { transition: width 0.8s ease; }
@media (prefers-reduced-motion: reduce) {
    .live-flash { animation: none; }
    .bar-fill, .progress-fill { transition: none; }
}

/* ── Management panel v2: grouped sub-cards + switch toggle ───────────────── */
.mgmt-group {
    border: 1px solid var(--border-soft); background: rgba(255, 255, 255, .015);
    border-radius: var(--radius-sm); padding: 14px 16px 12px; margin: 14px 0;
}
.mgmt-group-title {
    display: flex; align-items: center; gap: 8px; font-size: .76rem;
    text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin: 0 0 10px;
}
.mgmt-group .mgmt-row:first-of-type { margin-top: 0; }
.mgmt-group .mgmt-row:last-of-type { margin-bottom: 0; }
.mgmt-group .mgmt-hint { margin-top: 8px; }

/* Slider switch (replaces the native checkbox) */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
    width: 42px; height: 24px; border-radius: 999px; flex: none;
    background: #0a0c11; border: 1px solid var(--border);
    transition: background .25s ease, border-color .25s ease;
}
.switch .track::after {
    content: ''; display: block; width: 16px; height: 16px; margin: 3px;
    border-radius: 50%; background: #6b7284;
    transition: transform .25s ease, background .25s ease;
}
.switch input:checked + .track { background: rgba(240, 178, 50, .25); border-color: var(--gold); }
.switch input:checked + .track::after { transform: translateX(18px); background: var(--gold); }
.switch input:focus-visible + .track { outline: 2px solid var(--brand); outline-offset: 2px; }
.switch .sw-label { font-size: .92rem; }

/* ── Premium navbar button (gold, subtle shine sweep) ─────────────────────── */
.premium-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px;
    border-radius: 999px; font-weight: 600; font-size: .88rem; text-decoration: none;
    color: #1a1405;
    background: linear-gradient(135deg, #ffd76a, var(--gold) 55%, #d98f1f);
    border: 1px solid rgba(255, 215, 106, .6);
    box-shadow: 0 2px 14px -4px rgba(240, 178, 50, .55);
    position: relative; overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease;
}
.premium-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 20px -4px rgba(240, 178, 50, .75); }
.premium-btn::after {
    content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
    background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .55), transparent);
    transform: skewX(-20deg);
    animation: premium-shine 3.4s ease-in-out infinite;
}
@keyframes premium-shine {
    0%, 55% { left: -60%; }
    85%, 100% { left: 130%; }
}
@media (prefers-reduced-motion: reduce) { .premium-btn::after { animation: none; } }
@media (max-width: 700px) {
    .premium-btn .pb-label { display: none; }
    .premium-btn { padding: 7px 10px; }
}

/* ── Premium pricing cards (blue Personal / gold Alliance / purple Kingdom) ── */
.plan-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 18px; margin: 22px 0 30px;
}
.plan-card {
    --pc: var(--brand);
    position: relative; text-align: center;
    background: var(--panel); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px 20px 20px;
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.plan-card::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(120% 90% at 50% 0%,
        color-mix(in srgb, var(--pc) 16%, transparent), transparent 62%);
}
.plan-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--pc) 55%, var(--border));
    box-shadow: 0 14px 40px -14px color-mix(in srgb, var(--pc) 45%, transparent);
}
.plan-card.personal { --pc: #4db6ff; }
.plan-card.alliance { --pc: var(--gold); }
.plan-card.kingdom  { --pc: #a25bff; }

.pc-medal {
    position: relative; width: 58px; height: 58px; margin: 0 auto 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.7rem; border-radius: 50%;
    background: color-mix(in srgb, var(--pc) 14%, #0a0c11);
    border: 1px solid color-mix(in srgb, var(--pc) 50%, transparent);
    box-shadow: 0 0 22px -4px color-mix(in srgb, var(--pc) 55%, transparent);
}
.pc-name {
    position: relative; margin: 0 0 6px; font-size: 1.3rem; letter-spacing: .02em;
    color: var(--pc); text-transform: uppercase; font-weight: 800;
}
.pc-tag {
    position: relative; display: inline-block; margin: 0 0 14px; padding: 4px 12px;
    font-size: .72rem; text-transform: uppercase; letter-spacing: .08em;
    color: var(--text); border: 1px solid color-mix(in srgb, var(--pc) 45%, transparent);
    border-radius: 999px; background: rgba(0, 0, 0, .25);
}
.pc-features {
    position: relative; list-style: none; margin: 0 0 16px; padding: 0;
    text-align: left; display: grid; gap: 8px;
}
.pc-features li {
    display: flex; align-items: flex-start; gap: 10px;
    font-size: .88rem; color: var(--muted);
    padding: 8px 10px; border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, .025);
    border: 1px solid var(--border-soft);
}
.pc-ico {
    flex: none; width: 26px; height: 26px; display: flex; align-items: center;
    justify-content: center; font-size: .95rem; border-radius: 7px;
    background: color-mix(in srgb, var(--pc) 14%, #0a0c11);
    border: 1px solid color-mix(in srgb, var(--pc) 35%, transparent);
}
.pc-price {
    position: relative; font-size: 1.9rem; font-weight: 800; color: var(--pc);
    padding: 10px 0 2px; border-top: 1px solid var(--border-soft);
    text-shadow: 0 0 24px color-mix(in srgb, var(--pc) 45%, transparent);
}
.pc-price span { font-size: .5em; font-weight: 600; color: var(--muted); text-shadow: none; }
@media (prefers-reduced-motion: reduce) { .plan-card, .plan-card:hover { transform: none; } }

/* ── TrueGold badge icons (in-game artwork, tier number baked in) ───────────
   The baked-in tier digit is small, so: bigger base size + a hover zoom that
   magnifies the badge in place (absolutely-positioned copy so the row height
   never changes), plus the title tooltip as a text fallback. ─────────────── */
.tg-ico {
    width: 28px; height: 28px; vertical-align: middle; display: inline-block;
    transition: transform .15s ease;
}
.lvl.tg {
    display: inline-flex; align-items: center;
    position: relative; /* zoom anchor */
}
.lvl.tg:hover .tg-ico {
    transform: scale(2.4);
    position: relative; z-index: 30;
    filter: drop-shadow(0 4px 14px rgba(0, 0, 0, .7));
}
.top-player .tg-ico, td .tg-ico { width: 30px; height: 30px; }
@media (prefers-reduced-motion: reduce) {
    .lvl.tg:hover .tg-ico { transform: scale(1.8); }
}

/* ── Brand logo (navbar / footer / login) ─────────────────────────────────── */
.brand-logo {
    border-radius: 50%; vertical-align: middle; margin-right: 7px;
    box-shadow: 0 0 12px -2px rgba(109, 120, 255, .5);
}
.auth-card .logo img { border-radius: 50%; box-shadow: 0 0 26px -4px rgba(109, 120, 255, .55); }

/* ── Cluster live: worker groups by mode (free / mixed / premium) ─────────── */
.cluster-group { margin: 0 0 20px; }
.cluster-group:last-child { margin-bottom: 0; }
.cluster-group-title {
    display: flex; align-items: center; gap: 8px; margin: 0 0 8px;
    font-size: .84rem; font-weight: 700; color: var(--text);
}
.cluster-group-title .badge { font-size: .7rem; }
.badge.mixed { background: rgba(162,91,255,.15); color: #c79bff; }

/* ── Gift code announcement generator ──────────────────────────────────────── */
.announce-input { background: #0a0c11; border: 1px solid var(--border); color: var(--text); padding: 10px 12px; border-radius: 8px; font: inherit; min-width: 220px; }
.announce-input:focus { outline: none; border-color: var(--brand); }
.announce-code-field { flex-wrap: wrap; }
.announce-code-field #codePicker { min-width: 200px; }
.announce-code-field #codeInput { min-width: 170px; }
.mgmt-hint { font-size: .78rem; color: var(--faint); margin: 10px 0 0; }

.icon-picker { flex: 1 1 auto; display: flex; flex-wrap: wrap; gap: 8px; }
.icon-choice {
    display: flex; align-items: center; justify-content: center; width: 60px; height: 60px;
    border-radius: 10px; border: 2px solid transparent; cursor: pointer; padding: 3px; flex: 0 0 auto;
    background: rgba(255,255,255,.03); transition: border-color .15s, background .15s, transform .1s;
}
.icon-choice:hover { border-color: rgba(109,120,255,.5); transform: translateY(-2px); }
.icon-choice:has(input:checked) { border-color: var(--brand); background: rgba(109,120,255,.18); box-shadow: 0 0 0 3px rgba(109,120,255,.18); }
.icon-choice input { display: none; }
.icon-choice img { width: 100%; height: 100%; object-fit: contain; border-radius: 7px; }
.icon-choice.none-choice { color: var(--faint); font-size: 1.4rem; font-weight: 700; background: rgba(255,255,255,.02); }
.icon-choice.none-choice:has(input:checked) { color: var(--danger); border-color: rgba(237,77,85,.4); background: rgba(237,77,85,.1); }

/* Worker screenshot history (admin error-detail page) */
.screenshot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 14px; }
.screenshot-card { background: rgba(255,255,255,.03); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; }
.screenshot-card img { width: 100%; height: 140px; object-fit: cover; object-position: top; border-radius: 8px; background: #0a0c11; display: block; }
.screenshot-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: .78rem; }
.screenshot-msg { font-size: .8rem; margin: 6px 0 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.screenshot-worker { font-size: .74rem; margin: 4px 0 0; }

.announce-card-frame {
    display: flex; justify-content: center; background: radial-gradient(circle at 50% 0%, rgba(109,120,255,.12), transparent 70%);
    border-radius: var(--radius); padding: 14px; margin-bottom: 14px;
}
.announce-card-img {
    max-width: 100%; width: 340px; border-radius: 14px; box-shadow: 0 20px 50px -18px rgba(109,120,255,.55);
    border: 1px solid rgba(109,120,255,.35);
}
.announce-text {
    width: 100%; background: #0a0c11; border: 1px solid var(--border); color: var(--text);
    padding: 12px 14px; border-radius: 8px; font: inherit; font-size: .86rem; resize: vertical; line-height: 1.5;
}
.announce-text:focus { outline: none; border-color: var(--brand); }
.announce-history-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* Tools player-detail page — hero cards with their equipped gear strip, and the
   governor-gear grid, both styled to match the existing dark/card/gold language
   rather than copy mightpulse.com's own look pixel-for-pixel. */
.hero-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.hero-card {
    background: var(--panel-2); border: 1px solid var(--border); border-radius: 14px;
    padding: 14px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
}
.hero-icon { width: 56px; height: 56px; border-radius: 14px; border: 1px solid var(--border); object-fit: cover; }
.hero-gear-row { display: flex; gap: 5px; margin-top: 6px; flex-wrap: wrap; justify-content: center; }
.hero-gear-piece {
    width: 28px; height: 28px; border-radius: 7px; background: rgba(240,178,50,.14);
    border: 1px solid rgba(240,178,50,.35); display: inline-flex; align-items: center; justify-content: center;
}
.hero-gear-piece.red { background: rgba(237,77,85,.16); border-color: rgba(237,77,85,.4); }
.hero-gear-level { font-size: .62rem; font-weight: 700; color: var(--gold); }
.hero-gear-piece.red .hero-gear-level { color: #ff8a90; }

.gov-gear-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.gov-gear-item {
    background: var(--panel-2); border: 1px solid var(--border); border-radius: 14px;
    padding: 14px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
}
.gov-gear-icon { width: 48px; height: 48px; border-radius: 12px; border: 1px solid var(--border); object-fit: cover; }

/* ============================================================
   Alliance bulk-register tool (/me/servers/{id}/alliance)
   ============================================================ */
.badge.brand { background: rgba(109,120,255,.15); color: #aab2ff; }
.member-nav .nav-pro { margin-left: auto; font-size: .62rem; padding: 2px 7px; border-radius: 999px;
    background: rgba(240,178,50,.15); color: var(--gold); font-weight: 700; letter-spacing: .04em; }
.at-head h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; }
.at-pbadge { font-size: .7rem; }
.at-head p { margin: 0 0 18px; }
.at-hint { font-size: .85rem; margin: 10px 2px; }

/* locked showcase */
.at-locked { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border);
    background: var(--panel); min-height: 380px; display: grid; place-items: center; padding: 28px; }
.at-locked-preview { position: absolute; inset: 0; padding: 22px; filter: blur(3px); opacity: .45; pointer-events: none;
    display: flex; flex-direction: column; gap: 8px; }
.at-locked-card { position: relative; max-width: 460px; text-align: center; padding: 30px 28px;
    background: rgba(14,17,24,.88); border: 1px solid rgba(240,178,50,.35); border-radius: var(--radius);
    box-shadow: 0 20px 60px -20px rgba(240,178,50,.25), var(--shadow); backdrop-filter: blur(6px); }
.at-locked-card h3 { margin: 10px 0 6px; font-size: 1.3rem; }
.at-lock-ico { width: 56px; height: 56px; margin: 0 auto; border-radius: 16px; display: grid; place-items: center;
    background: linear-gradient(135deg, rgba(240,178,50,.25), rgba(162,91,255,.25)); color: var(--gold); }
.at-lock-ico svg { width: 26px; height: 26px; }
.at-feats { list-style: none; padding: 0; margin: 18px 0 22px; text-align: left; display: grid; gap: 9px; }
.at-feats li { background: var(--panel-2); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 10px 12px; }
.at-ghost-line { height: 10px; border-radius: 6px; background: var(--panel-2); }

/* slots */
.at-slots { display: flex; align-items: center; gap: 22px; padding: 16px 20px; margin-bottom: 18px;
    background: linear-gradient(135deg, rgba(109,120,255,.12), rgba(162,91,255,.08)); border: 1px solid var(--border);
    border-radius: var(--radius); flex-wrap: wrap; }
.at-slots-main { display: flex; flex-direction: column; align-items: center; min-width: 92px; }
.at-slots-num { font-size: 2.1rem; font-weight: 800; line-height: 1; background: var(--grad); -webkit-background-clip: text;
    background-clip: text; color: transparent; transition: transform .2s; }
.at-slots-num.bump { transform: scale(1.18); }
.at-slots-num.zero { background: none; color: var(--danger); }
.at-slots-lbl { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.at-slots-meta { flex: 1; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: .88rem; }
.at-meter { flex: 1 1 160px; height: 8px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.at-meter-fill { display: block; height: 100%; background: var(--grad); border-radius: 999px; }

/* search */
.at-search { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.at-field { display: flex; flex-direction: column; gap: 6px; font-size: .82rem; color: var(--muted); }
.at-field.grow { flex: 1 1 240px; }
.at-field input { background: var(--bg-2); border: 1px solid var(--border); color: var(--text); border-radius: var(--radius-sm);
    padding: 10px 12px; font: inherit; font-size: .95rem; min-width: 110px; }
.at-field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(109,120,255,.18); }
.at-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin: 16px 0 22px; }
.at-card { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--panel); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.at-card:hover { border-color: var(--brand); transform: translateY(-2px); color: var(--text); }
.at-card-body { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.at-card-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.at-card-name strong { color: var(--gold); }
.at-card-meta { font-size: .8rem; }
.at-card-go { font-size: .8rem; color: var(--brand); font-weight: 600; }
.at-flag { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--border);
    overflow: hidden; display: grid; place-items: center; }
.at-flag img { width: 100%; height: 100%; object-fit: cover; }
.at-flag.lg { width: 64px; height: 64px; flex-basis: 64px; border-radius: 14px; }
.at-lookup { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; flex-wrap: wrap; }
.at-lookup h3 { margin: 0 0 4px; font-size: 1rem; }
.at-lookup p { margin: 0; }

/* alliance header */
.at-alliance { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 12px 0 16px; padding: 18px;
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.at-alliance-id { flex: 1; min-width: 200px; }
.at-alliance-id h2 { margin: 0 0 4px; }
.at-tag { color: var(--gold); }
.at-counts { display: flex; gap: 10px; flex-wrap: wrap; }
.at-count { display: flex; flex-direction: column; align-items: center; padding: 8px 14px; border-radius: var(--radius-sm);
    background: var(--panel-2); border: 1px solid var(--border-soft); font-size: .74rem; color: var(--muted); }
.at-count strong { font-size: 1.25rem; color: var(--text); }
.at-count.ok strong { color: var(--ok); }
.at-count.warn strong { color: var(--warn); }

/* upsell */
.at-upsell { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px 18px;
    margin-bottom: 14px; border-radius: var(--radius); border: 1px solid rgba(240,178,50,.45);
    background: linear-gradient(135deg, rgba(240,178,50,.14), rgba(162,91,255,.10)); animation: flash-in .35s ease-out; }
.at-upsell[hidden] { display: none; }
.at-upsell p { margin: 4px 0 0; }

/* toolbar + list */
.at-toolbar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.at-toolbar-actions { display: flex; gap: 8px; }
.at-filter { flex: 1 1 220px; max-width: 340px; background: var(--bg-2); border: 1px solid var(--border); color: var(--text);
    border-radius: var(--radius-sm); padding: 9px 12px; font: inherit; }
.at-filter:focus { outline: none; border-color: var(--brand); }
.at-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.at-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 110px 80px 210px 52px; align-items: center; gap: 12px;
    padding: 10px 14px; background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
    transition: border-color .15s, background .15s; }
.at-row[hidden] { display: none; }

.err-msg { font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.bar-row.rowlink { color: inherit; text-decoration: none; border-radius: 6px; }
a.bar-row.rowlink:hover { background: rgba(255,255,255,.03); }

.admin-main .section-title { margin-top: 34px; }

.sort-th { color: inherit; text-decoration: none; }
.sort-th:hover { color: var(--text); }
.sort-th.on { color: var(--text); }
.sort-th.on::after { content: " ▼"; font-size: .7em; color: var(--brand); }

.acc-status { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

.rev-split { padding: 16px 20px; }
.rev-split-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.rev-split-head strong { font-size: 1.15rem; color: var(--gold); }
.rev-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--panel-2); }
.rev-bar .seg { display: block; height: 100%; }
.rev-bar .seg.kingdom, .rev-legend .dot.kingdom { background: #a25bff; }
.rev-bar .seg.alliance, .rev-legend .dot.alliance { background: var(--gold); }
.rev-bar .seg.personal, .rev-legend .dot.personal { background: #5aa8ff; }
.rev-legend { display: flex; gap: 18px; margin-top: 10px; font-size: .85rem; color: var(--muted); }
.rev-legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; }

/* Admin monitoring */
.mon-banner { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin: 6px 0 4px; border-radius: var(--radius);
    border: 1px solid var(--border); background: var(--panel); }
.mon-banner > div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.mon-banner strong { font-size: 1rem; }
.mon-dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 12px; background: var(--muted); }
.mon-banner.ok { border-color: rgba(63,206,143,.35); background: rgba(63,206,143,.07); }
.mon-banner.ok .mon-dot { background: var(--ok); box-shadow: 0 0 0 4px rgba(63,206,143,.2); }
.mon-banner.warn { border-color: rgba(240,178,50,.4); background: rgba(240,178,50,.08); }
.mon-banner.warn .mon-dot { background: var(--warn); box-shadow: 0 0 0 4px rgba(240,178,50,.2); }
.mon-banner.danger { border-color: rgba(237,77,85,.45); background: rgba(237,77,85,.08); }
.mon-banner.danger .mon-dot { background: var(--danger); box-shadow: 0 0 0 4px rgba(237,77,85,.22); animation: pulse-err 1.6s infinite; }
.delta { font-weight: 700; font-size: .82rem; margin-right: 6px; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--danger); }
.mon-stack { position: relative; height: 100%; }
.mon-stack .tb-fill { position: absolute; left: 0; bottom: 0; }
.tb-fill.mon-fail { background: linear-gradient(180deg, #ff7a80, #c63a42); opacity: .85; }
.tb-fill.mon-ok { background: linear-gradient(180deg, #5fe0a6, #2fae76); }
.mon-key { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin: 0 5px 0 12px; vertical-align: middle; }
.mon-key.ok { background: var(--ok); }
.mon-key.danger { background: var(--danger); }

/* Admin codes */
@media (min-width: 1100px) { .cards.kpi-4col { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.acode-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; margin-bottom: 26px; }
.acode-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px;
    display: flex; flex-direction: column; gap: 12px; }
.acode-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.acode-name { font-size: 1.05rem; font-weight: 700; color: var(--gold); background: rgba(240,178,50,.08);
    border: 1px solid rgba(240,178,50,.3); padding: 4px 10px; border-radius: 8px; }
.acode-age { margin-left: auto; font-size: .82rem; }
.acode-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--panel-2);
    border: 1px solid var(--border-soft); }
.acode-bar .seg { display: block; height: 100%; transition: width .6s ease; }
.acode-bar .seg.ok { background: linear-gradient(90deg, #2fae76, var(--ok)); }
.acode-bar .seg.danger { background: linear-gradient(90deg, #c63a42, var(--danger)); }
.acode-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .85rem; align-items: center; }
.acode-legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.acode-legend .dot.ok { background: var(--ok); }
.acode-legend .dot.danger { background: var(--danger); }
.acode-legend .dot.off { background: #3a4152; }
.acode-legend .muted { margin-left: auto; }
.acode-status { display: flex; gap: 6px; flex-wrap: wrap; }
.acode-status .badge { font-size: .72rem; }
@media (max-width: 640px) { .acode-cards { grid-template-columns: 1fr; } }

.inline-meter { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.inline-meter .mini-progress { width: 70px; margin: 0; }

/* Admin overview layout */
@media (min-width: 900px) { .cards.kpi-3col { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.panels.split-1-2 { align-items: start; }
@media (min-width: 1100px) { .panels.split-1-2 { grid-template-columns: minmax(380px, 1fr) minmax(0, 1.6fr); } }

/* Admin visitors: human proof */
.an-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin: 6px 0 4px; border-radius: var(--radius-sm);
    background: rgba(63,206,143,.07); border: 1px solid rgba(63,206,143,.25); font-size: .88rem; }
.an-banner p { margin: 0; color: var(--muted); }
.an-banner-ico { font-size: 1.2rem; }
.an-toggle { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 500;
    color: var(--muted); cursor: pointer; }
.an-toggle .at-switch { margin-left: 2px; }
#live-body:not(.show-all) tr.live-other { display: none; }
tr.live-other td { opacity: .62; }
.badge.verdict.human { background: rgba(63,206,143,.16); color: var(--ok); }
.badge.verdict.waiting { background: rgba(109,120,255,.15); color: #aab2ff; }
.badge.verdict.suspect { background: rgba(240,178,50,.14); color: var(--warn); }
.badge.verdict.legacy { background: rgba(154,162,180,.12); color: var(--muted); }
.an-reason { display: block; font-size: .72rem; margin-top: 3px; }
.an-dot { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.an-dot.green { background: #3fce8f; }
.an-dot.blue { background: #5865f2; }
.an-dot.dashed { background: repeating-linear-gradient(90deg, #6b7284 0 4px, transparent 4px 7px); }

/* Admin visitors: who's logged in / premium */
.live-split { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.live-split .badge { font-size: .74rem; }
tr.live-premium td { background: rgba(240,178,50,.06); }
tr.live-premium td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.badge.tier-badge { font-weight: 700; }
.badge.tier-badge.personal { background: rgba(90,168,255,.16); color: #8cc4ff; }
.badge.tier-badge.alliance { background: rgba(240,178,50,.16); color: var(--gold); }
.badge.tier-badge.kingdom { background: rgba(162,91,255,.18); color: #c9a2ff; }

/* Member dashboard: sidebar categories, plan card, shortcuts */
.member-nav-cat { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); margin: 14px 0 2px; padding: 0 12px; }
.member-nav-cat:first-child { margin-top: 0; }
.member-plan { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: var(--radius-sm);
    background: var(--panel); border: 1px solid var(--border); font-size: .86rem; }
.member-plan.on { border-color: rgba(240,178,50,.4); background: linear-gradient(135deg, rgba(240,178,50,.10), rgba(162,91,255,.06)); }
.member-plan-lbl { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.member-plan strong { font-size: 1rem; }
.member-plan.on strong { color: var(--gold); }
.member-plan .btn { align-self: flex-start; }
.member-shortcut { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 16px; border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(109,120,255,.10), rgba(162,91,255,.06)); border: 1px solid var(--border);
    color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.member-shortcut:hover { border-color: var(--brand); transform: translateY(-1px); color: var(--text); }
.member-shortcut-ico { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px; display: grid; place-items: center;
    background: rgba(109,120,255,.18); color: #aab2ff; }
.member-shortcut-ico svg { width: 20px; height: 20px; }
.member-shortcut-body { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.member-shortcut-body strong { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.member-shortcut-go { font-size: 1.3rem; color: var(--brand); }
@media (max-width: 860px) {
    /* Compact mobile dashboard nav: one swipeable row instead of a full-screen menu. */
    .member-layout { grid-template-columns: minmax(0, 1fr); }
    .member-side { gap: 10px; padding: 12px 12px 10px; min-width: 0; max-width: 100vw; }
    .member-brand, .member-nav-cat, .member-side-foot { display: none; }
    .member-nav { flex-wrap: nowrap; overflow-x: auto; width: 100%; gap: 6px; padding-bottom: 4px;
        scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .member-nav::-webkit-scrollbar { display: none; }
    .member-nav a { flex: 0 0 auto; white-space: nowrap; padding: 8px 12px; border: 1px solid var(--border-soft); }
    .member-plan { flex-direction: row; align-items: center; flex-wrap: wrap; width: 100%; padding: 8px 12px; }
    .member-main { padding: 18px 14px 50px; }
    .member-shortcut-go { display: none; }
}
@media (max-width: 640px) {
    .nav-actions { flex-wrap: wrap; justify-content: flex-end; gap: 6px; min-width: 0; }
    .hide-sm { display: none; }
    .table-wrap table.compact-sm { min-width: 0; }
    .member-main .claims th, .member-main .claims td { padding: 10px 8px; }
    .member-main .claims .btn.small { padding: 7px 10px; font-size: .8rem; }
}

/* Admin API page: keep charts inside the panel on narrow screens */
.mp-split > *, .mp-block, .mp-head > * { min-width: 0; }
.mp-hours, .mp-days { overflow: hidden; }
@media (max-width: 640px) {
    .mp-big { font-size: 2rem; }
    .mp-day em { font-size: .58rem; }
}
.flash.warn-flash { background: rgba(240,178,50,.10); border: 1px solid rgba(240,178,50,.35); color: var(--warn); }
.at-row:hover { border-color: var(--border); }
.at-row.changed { border-color: rgba(109,120,255,.55); background: rgba(109,120,255,.06); }
.at-row.locked { opacity: .72; }
.at-row.ghost { grid-template-columns: 40px 1fr 52px; }
.at-row.shake { animation: at-shake .35s; }
.at-who { display: flex; flex-direction: column; min-width: 0; }
.at-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.at-sub { display: flex; gap: 8px; align-items: center; font-size: .78rem; }
.at-rank { padding: 1px 7px; border-radius: 6px; background: var(--panel-2); color: var(--muted); font-size: .72rem; }
.at-pow { font-variant-numeric: tabular-nums; color: var(--muted); text-align: right; }
.at-status .badge { font-size: .72rem; }
.at-switch-wrap { position: relative; display: inline-flex; justify-self: end; cursor: pointer; }
.at-switch-wrap input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.at-switch { width: 44px; height: 24px; border-radius: 999px; background: #2a3142; position: relative; transition: background .2s;
    display: inline-block; flex: 0 0 44px; }
.at-switch > span { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #cfd5e3;
    transition: transform .2s; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.at-switch.on, .at-switch-wrap input:checked + .at-switch { background: linear-gradient(135deg, var(--ok), #2fae76); }
.at-switch.on > span, .at-switch-wrap input:checked + .at-switch > span { transform: translateX(20px); background: #fff; }
.at-switch-wrap input:focus-visible + .at-switch { box-shadow: 0 0 0 3px rgba(109,120,255,.35); }
.at-switch-wrap input:disabled + .at-switch { cursor: not-allowed; opacity: .55; }
.at-switch-wrap input:disabled:checked + .at-switch { background: #3a4fa0; }

/* sticky save bar */
.at-savebar { position: sticky; bottom: 14px; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 14px;
    flex-wrap: wrap; padding: 12px 16px; background: rgba(21,25,37,.94); backdrop-filter: blur(8px);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); transition: border-color .2s; }
.at-savebar.dirty { border-color: var(--brand); box-shadow: 0 0 0 1px rgba(109,120,255,.3), var(--shadow); }
.at-pending { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .9rem; }
.at-chip { padding: 4px 10px; border-radius: 999px; font-size: .8rem; background: var(--panel-2); color: var(--muted); }
.at-chip.add b { color: var(--ok); }
.at-chip.rem b { color: var(--danger); }
.at-save-actions { display: flex; gap: 8px; }
.at-save-actions .btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.at-failures { margin-top: 8px; font-size: .85rem; }
.at-failures summary { cursor: pointer; }
.at-failures ul { margin: 6px 0 0; padding-left: 18px; }

@keyframes at-shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

@media (max-width: 760px) {
    .at-row { grid-template-columns: 36px minmax(0, 1fr) 52px; }
    .at-row .at-lvl, .at-row .at-pow { display: none; }
    .at-row .at-status { grid-column: 2; grid-row: 2; }
}

/* ============================================================
   mightpulse.com consumption (admin API page)
   ============================================================ */
.mp-usage { --mp: var(--ok); }
.mp-usage.tone-warn { --mp: var(--warn); }
.mp-usage.tone-danger { --mp: var(--danger); }
.mp-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.mp-today { display: flex; align-items: baseline; gap: 10px; }
.mp-big { font-size: 2.6rem; font-weight: 800; line-height: 1; color: var(--mp); font-variant-numeric: tabular-nums; }
.mp-of { font-size: 1rem; }
.mp-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: .9rem; }
.mp-utc { font-size: .72rem; opacity: .7; }
.mp-bar { position: relative; height: 18px; border-radius: 999px; background: var(--panel-2); overflow: hidden;
    border: 1px solid var(--border-soft); }
.mp-fill, .mp-proj { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; transition: width .8s ease; }
.mp-fill { background: linear-gradient(90deg, var(--mp), color-mix(in srgb, var(--mp) 70%, #fff)); box-shadow: 0 0 18px -4px var(--mp); }
.mp-proj { background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--mp) 35%, transparent) 0 6px, transparent 6px 12px); }
.mp-reserve { position: absolute; top: 0; bottom: 0; right: 0; border-left: 2px dashed rgba(240,178,50,.85);
    background: rgba(240,178,50,.10); }
.mp-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: .8rem; margin: 8px 2px 18px; }
.mp-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.mp-legend .dot.used { background: var(--mp); }
.mp-legend .dot.proj { background: repeating-linear-gradient(45deg, var(--mp) 0 2px, transparent 2px 4px); border: 1px solid var(--mp); }
.mp-legend .dot.reserve { background: rgba(240,178,50,.25); border: 1px dashed var(--gold); }
.mp-cards { margin-bottom: 18px; }
.mp-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.mp-block { background: var(--panel-2); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 14px 16px; }
.mp-block h3 { margin: 0 0 12px; font-size: .95rem; }
.mp-src { margin-bottom: 12px; }
.mp-src-top { display: flex; justify-content: space-between; font-size: .88rem; margin-bottom: 5px; }
.mp-src-bar { height: 8px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.mp-src-bar span { display: block; height: 100%; border-radius: 999px; transition: width .8s ease; background: var(--brand); }
.mp-src-bar span.sweep { background: #a25bff; }
.mp-src-bar span.sync { background: #5aa8ff; }
.mp-src-bar span.backfill { background: #f0b232; }
.mp-src-bar span.interactive { background: var(--ok); }
.mp-src-hint { font-size: .75rem; margin: 4px 0 0; }
.mp-hours, .mp-days { position: relative; display: flex; align-items: flex-end; gap: 3px; height: 140px; padding-bottom: 18px; }
.mp-hour, .mp-day { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; }
.mp-hour span, .mp-day span { display: block; width: 100%; min-height: 2px; border-radius: 4px 4px 0 0;
    background: linear-gradient(180deg, var(--brand-2), var(--brand)); opacity: .85; transition: opacity .15s; }
.mp-hour:hover span, .mp-day:hover span { opacity: 1; }
.mp-day.over span { background: linear-gradient(180deg, #ff7a80, var(--danger)); }
.mp-hour em, .mp-day em { position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%); font-style: normal;
    font-size: .66rem; color: var(--faint); white-space: nowrap; }
.mp-limit-line { position: absolute; left: 0; right: 0; border-top: 1px dashed rgba(237,77,85,.7); pointer-events: none; }
@media (max-width: 860px) { .mp-split { grid-template-columns: 1fr; } }

/* ---------- Battle plans (Tools) ---------- */
.bp-list-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; margin-top: 18px; }
.bp-panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.bp-panel h2 { margin: 0 0 12px; font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }
.bp-plan-list { display: flex; flex-direction: column; gap: 8px; }
.bp-plan-row { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); }
.bp-plan-main { flex: 1; min-width: 0; color: var(--text); text-decoration: none; display: flex; flex-direction: column; gap: 3px; }
.bp-plan-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-plan-meta { display: flex; gap: 6px; flex-wrap: wrap; color: var(--muted); font-size: .82rem; align-items: center; }
.bp-tag { background: rgba(240,178,50,.14); color: var(--gold); border: 1px solid rgba(240,178,50,.3); border-radius: 6px; padding: 1px 7px; font-weight: 700; font-size: .8rem; }
.bp-danger:hover { border-color: var(--danger) !important; color: var(--danger) !important; background: rgba(237,77,85,.08) !important; }
.bp-form { display: flex; flex-direction: column; gap: 12px; }
.bp-form label { display: flex; flex-direction: column; gap: 5px; font-size: .85rem; color: var(--muted); flex: 1; }
.bp-form-row { display: flex; gap: 10px; }
.bp-form input, .bp-form select, #bp-app input, #bp-app select, #bp-app textarea {
    background: var(--bg-2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; font: inherit; font-size: .92rem; min-width: 0;
}
#bp-app input:focus, #bp-app select:focus, #bp-app textarea:focus, .bp-form input:focus { outline: none; border-color: var(--brand); }

.bp-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 6px 0 16px; }
.bp-back { color: var(--muted); text-decoration: none; font-size: .88rem; width: 100%; }
.bp-head-main { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 6px; }
#bp-app .bp-name { font-size: 1.5rem; font-weight: 800; background: transparent; border-color: transparent; padding: 4px 6px; margin-left: -6px; }
#bp-app .bp-name:hover { border-color: var(--border); }
.bp-head-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .88rem; }
#bp-app .bp-enemy { width: 90px; padding: 4px 8px; }
.bp-save { font-size: .78rem; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.bp-save[data-state=saved] { color: var(--ok); border-color: rgba(63,206,143,.35); }
.bp-save[data-state=saving], .bp-save[data-state=unsaved] { color: var(--gold); border-color: rgba(240,178,50,.35); }
.bp-save[data-state=error], .bp-save[data-state=conflict] { color: var(--danger); border-color: rgba(237,77,85,.4); }

.bp-layout { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
.bp-pool { position: sticky; top: 76px; max-height: calc(100vh - 92px); display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.bp-count { font-size: .75rem; background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; color: var(--muted); font-weight: 600; }
.bp-tabs { display: flex; gap: 4px; background: var(--bg-2); border-radius: 9px; padding: 3px; }
.bp-tabs button { flex: 1; background: none; border: 0; color: var(--muted); padding: 7px; border-radius: 7px; cursor: pointer; font: inherit; font-size: .85rem; }
.bp-tabs button.on { background: var(--panel-2); color: var(--text); font-weight: 600; }
.bp-tab input[type=search], #bp-pool-filter, #bp-picker-filter { width: 100%; }
.bp-results { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow-y: auto; margin-top: 6px; }
.bp-result, .bp-ally-head { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: var(--panel-2); border: 1px solid var(--border-soft); border-radius: 8px; padding: 8px 10px; color: var(--text); font: inherit; font-size: .88rem; cursor: pointer; }
.bp-result:hover, .bp-ally-head:hover { border-color: var(--brand); }
.bp-result.in { opacity: .55; }
.bp-r-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-r-power { color: var(--gold); font-size: .8rem; font-weight: 600; white-space: nowrap; }
.bp-r-add { width: 22px; text-align: center; color: var(--brand); font-weight: 800; }
.bp-ally { display: flex; flex-direction: column; gap: 4px; }
.bp-ally.open .bp-caret { transform: rotate(180deg); }
.bp-ally-body { display: flex; flex-direction: column; gap: 4px; padding-left: 10px; border-left: 2px solid var(--border); }
.bp-add-all { align-self: flex-start; }
.bp-inline { display: flex; gap: 6px; flex-wrap: wrap; }
.bp-inline input[name=name] { flex: 1 1 140px; }
.bp-inline input[name=tag] { width: 80px; }
.bp-sub { margin: 4px 0 0; font-size: .85rem; color: var(--muted); font-weight: 600; }
.bp-pool-list { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; min-height: 60px; }
.bp-pool-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; font-size: .86rem; }
.bp-pool-row:hover { background: var(--panel-2); }
.bp-used { font-size: .72rem; color: var(--brand); font-weight: 700; }
.bp-x { background: none; border: 0; color: var(--faint); font-size: 1.15rem; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.bp-x:hover { color: var(--danger); background: rgba(237,77,85,.1); }

.bp-board-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.bp-board-head h2 { margin: 0; font-size: 1.1rem; display: flex; gap: 8px; align-items: center; }
.bp-group { margin-bottom: 16px; }
.bp-group-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px; display: flex; gap: 8px; align-items: center; }
.bp-group[data-tower=CASTLE] .bp-group-title { color: var(--gold); }
.bp-group.empty .bp-squads { display: none; }
.bp-group.empty { margin-bottom: 6px; opacity: .55; }
.bp-squads { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.bp-squad { background: var(--panel); border: 1px solid var(--border); border-top: 3px solid var(--sq); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.bp-squad-head { display: flex; gap: 6px; align-items: center; }
#bp-app .bp-squad-name { flex: 1; font-weight: 700; color: var(--sq); background: transparent; border-color: transparent; padding: 5px 6px; }
#bp-app .bp-squad-name:hover { border-color: var(--border); }
#bp-app .bp-tower { padding: 5px 8px; font-size: .82rem; }
.bp-slot { background: var(--bg-2); border: 1px solid var(--border-soft); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.bp-slot.leader { border-color: color-mix(in srgb, var(--sq) 45%, transparent); }
.bp-slot-top { display: flex; align-items: center; gap: 6px; }
.bp-role { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); width: 54px; flex-shrink: 0; }
.bp-slot.leader .bp-role { color: var(--sq); font-weight: 700; }
.bp-who { flex: 1; min-width: 0; text-align: left; background: none; border: 1px dashed transparent; color: var(--text); font: inherit; font-weight: 600; font-size: .9rem; padding: 3px 6px; border-radius: 6px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-who:hover { border-color: var(--border); }
.bp-who.empty { color: var(--faint); border-color: var(--border); font-weight: 400; }
.bp-warn { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--gold); color: #241a03; font-weight: 900; font-size: .8rem; flex-shrink: 0; cursor: help; }
.bp-slot-bottom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bp-heroes { display: flex; gap: 3px; background: none; border: 0; padding: 0; cursor: pointer; }
.bp-hero { width: 32px; height: 32px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--border); display: grid; place-items: center; font-weight: 800; font-size: .85rem; color: var(--muted); overflow: hidden; }
.bp-hero img { width: 100%; height: 100%; object-fit: cover; }
.bp-hero.ph { border-style: dashed; color: var(--faint); }
.bp-troops { flex: 1; min-width: 190px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; position: relative; padding-bottom: 6px; }
.bp-tin { display: flex; align-items: center; gap: 2px; font-size: .7rem; color: var(--muted); }
.bp-tin > span:first-child { width: 22px; font-weight: 700; }
.bp-tin.inf > span:first-child { color: #36b5e0; }
.bp-tin.arch > span:first-child { color: #3fce8f; }
.bp-tin.cav > span:first-child { color: #ff8a3d; }
#bp-app .bp-tin input { width: 100%; padding: 4px; font-size: .82rem; text-align: right; -moz-appearance: textfield; }
.bp-tin input::-webkit-inner-spin-button { display: none; }
.bp-pct { font-size: .72rem; }
.bp-tbar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 2px; background: var(--border-soft); display: flex; overflow: hidden; }
.bp-tseg.inf { background: #36b5e0; }
.bp-tseg.arch { background: #3fce8f; }
.bp-tseg.cav { background: #ff8a3d; }
.bp-troops.over .bp-tbar { background: var(--danger); }
.bp-add-joiner { background: none; border: 1px dashed var(--border); border-radius: 9px; color: var(--muted); padding: 7px; cursor: pointer; font: inherit; font-size: .85rem; }
.bp-add-joiner:hover { border-color: var(--brand); color: var(--text); }
#bp-app .bp-note { resize: vertical; font-size: .82rem; padding: 6px 8px; }

.bp-dialog { background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; width: min(440px, 94vw); max-height: 80vh; }
.bp-dialog::backdrop { background: rgba(5,7,12,.7); }
.bp-dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.bp-dialog .bp-results { max-height: 55vh; }
.bp-hero-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; max-height: 60vh; overflow-y: auto; }
.bp-hero-pick { display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--panel-2); border: 1px solid var(--border-soft); border-radius: 10px; padding: 8px 4px; color: var(--text); font: inherit; font-size: .75rem; cursor: pointer; }
.bp-hero-pick .bp-hero { width: 44px; height: 44px; }
.bp-hero-pick.on { border-color: var(--gold); background: rgba(240,178,50,.1); }

@media (max-width: 1150px) {
    .bp-list-grid, .bp-layout { grid-template-columns: 1fr; }
    .bp-pool { position: static; max-height: none; }
    .bp-pool-list { max-height: 240px; }
    .bp-squads { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {

    .bp-form-row { flex-direction: column; }
    .bp-plan-row { flex-wrap: wrap; }
    .bp-plan-main { flex-basis: 100%; }
    #bp-app .bp-name { font-size: 1.2rem; }
}

/* Battle plans — live collaboration, offers, export */
.bp-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bp-tier { font-size: .74rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.bp-tier.alliance { color: var(--brand); border-color: rgba(109,120,255,.4); }
.bp-tier.kingdom { color: var(--gold); border-color: rgba(240,178,50,.4); }
.bp-people { display: flex; align-items: center; }
.bp-av { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; overflow: hidden; background: var(--panel-2);
    border: 2px solid var(--bg); margin-left: -8px; font-weight: 800; font-size: .8rem; color: var(--text); flex-shrink: 0; }
.bp-av:first-child { margin-left: 0; }
.bp-av img { width: 100%; height: 100%; object-fit: cover; }
.bp-av.me { border-color: var(--brand); }
.bp-av.typing { border-color: var(--ok); }
.bp-av.xs { width: 18px; height: 18px; margin: 0; border-width: 0; font-size: .6rem; }
.bp-lockbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px;
    border-radius: var(--radius-sm); background: rgba(109,120,255,.1); border: 1px solid rgba(109,120,255,.35); font-size: .9rem; }
.bp-lockbar.mine { background: rgba(63,206,143,.1); border-color: rgba(63,206,143,.35); }
.bp-upsell { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px;
    border-radius: var(--radius-sm); background: rgba(240,178,50,.08); border: 1px solid rgba(240,178,50,.28); font-size: .86rem; color: var(--muted); }
.bp-tier-note { font-size: .82rem; margin: 14px 0 0; }
.bp-ro .bp-layout { pointer-events: none; }
.bp-ro .bp-layout .bp-tabs, .bp-ro .bp-layout .bp-tab, .bp-ro #bp-pool-filter, .bp-ro .bp-results { pointer-events: auto; }
.bp-ro .bp-squad input, .bp-ro .bp-squad select, .bp-ro .bp-squad textarea, .bp-ro .bp-add-joiner, .bp-ro #bp-add-squad, .bp-ro .bp-x { opacity: .6; }
.bp-ro .bp-head-main input { pointer-events: none; }
.bp-board-head { gap: 10px; flex-wrap: wrap; }
.bp-phases { display: flex; gap: 4px; background: var(--bg-2); border-radius: 9px; padding: 3px; }
.bp-phases button { background: none; border: 0; color: var(--muted); padding: 6px 10px; border-radius: 7px; cursor: pointer; font: inherit; font-size: .8rem; }
.bp-phases button.on { background: var(--panel-2); color: var(--gold); font-weight: 700; }
.bp-limit { margin: 0 0 10px; padding: 8px 12px; border-radius: 8px; background: rgba(237,77,85,.08); border: 1px solid rgba(237,77,85,.3); color: var(--danger); font-size: .85rem; }
#bp-add-squad:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.bp-subs-title { margin: 4px 0 0; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.bp-slot.sub { border-style: dashed; }
.bp-add-joiner.sub { font-size: .78rem; padding: 5px; }
.bp-import { width: 100%; margin-bottom: 6px; }
.bp-import-lock { font-size: .8rem; margin: 0 0 6px; }
.bp-anchored { position: relative; }
.bp-cursor { position: absolute; top: -10px; right: 8px; display: flex; gap: 4px; z-index: 5; pointer-events: none; }
.bp-cursor-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 2px; border-radius: 999px; background: var(--brand);
    color: #fff; font-size: .7rem; font-weight: 700; white-space: nowrap; box-shadow: 0 4px 14px -4px rgba(0,0,0,.6); animation: bpPop .18s ease-out; }
@keyframes bpPop { from { transform: scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
.bp-export-dlg { width: min(980px, 96vw); }
.bp-export-opts { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 10px; }
.bp-export-opts label { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; color: var(--muted); }
.bp-export-opts input, .bp-export-opts select { background: var(--bg-2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font: inherit; }
.bp-export-opts input[type=color] { padding: 2px; width: 54px; height: 36px; }
.bp-export-preview { max-height: 60vh; overflow: auto; border-radius: 10px; border: 1px solid var(--border); }
.bp-export-preview canvas { width: 100%; height: auto; display: block; }
.bp-export-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
@media (max-width: 700px) {
    .bp-actions { width: 100%; }
    .bp-actions .btn, .bp-actions form { flex: 1; }
    .bp-actions form .btn { width: 100%; }
}
.bp-lockbar[hidden], .bp-limit[hidden] { display: none; }
.bp-layout > *, .bp-list-grid > * { min-width: 0; }
@media (max-width: 1150px) { .bp-list-grid, .bp-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 420px) { .bp-troops { min-width: 0; flex-basis: 100%; } .bp-squad-head { flex-wrap: wrap; } #bp-app .bp-squad-name { flex-basis: 100%; } }
.bp-export-opts { align-items: flex-start; }
.bp-export-opts label { justify-content: flex-start; }
.bp-export-opts input, .bp-export-opts select { height: 42px; box-sizing: border-box; }
.bp-export-opts input[type=color] { height: 42px; width: 56px; }
.bp-export-opts > p { align-self: center; margin: 18px 0 0; }

/* Battle plans — board as one column per post, cleaner troop inputs */
#bp-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; align-items: start; }
.bp-group, .bp-group.empty { margin: 0; opacity: 1; background: rgba(255,255,255,.015); border: 1px solid var(--border-soft);
    border-radius: var(--radius); padding: 10px; }
.bp-group.empty .bp-squads { display: grid; }
.bp-group-title { margin: 2px 4px 10px; font-size: .78rem; }
.bp-group-ico { width: 22px; height: 22px; border-radius: 7px; display: inline-grid; place-items: center; background: var(--panel-2);
    border: 1px solid var(--border); font-size: .8rem; color: var(--text); }
.bp-group[data-tower=CASTLE] { border-color: rgba(240,178,50,.3); background: linear-gradient(180deg, rgba(240,178,50,.06), transparent 160px); }
.bp-group[data-tower=CASTLE] .bp-group-ico { background: rgba(240,178,50,.18); border-color: rgba(240,178,50,.4); color: var(--gold); }
.bp-group-empty { margin: 0; padding: 18px; text-align: center; color: var(--faint); border: 1px dashed var(--border); border-radius: 10px; }
.bp-squads { grid-template-columns: 1fr; gap: 10px; }
.bp-squad { box-shadow: 0 10px 28px -18px rgba(0,0,0,.8); }
.bp-squad-head { flex-wrap: wrap; }
#bp-app .bp-squad-name { flex: 1 1 140px; font-size: 1rem; }

.bp-slot-bottom { flex-wrap: nowrap; align-items: stretch; }
.bp-heroes { align-items: center; }
.bp-troops { min-width: 0; flex: 1; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; padding-bottom: 7px; }
.bp-tin { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 2px; padding: 3px 8px 4px; border-radius: 9px;
    background: rgba(255,255,255,.03); border: 1px solid var(--border-soft); transition: border-color .15s, background .15s; }
.bp-tin .bp-tname { grid-column: 1 / -1; width: auto; font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
    cursor: pointer; user-select: none; }
.bp-tin .bp-tname:hover { text-decoration: underline; }
#bp-app .bp-tin input { background: transparent; border: 0; padding: 0; text-align: left; font-weight: 800; font-size: .95rem; width: 100%; }
#bp-app .bp-tin input::placeholder { color: var(--faint); }
.bp-tin .bp-pct { color: var(--faint); font-weight: 700; }
.bp-tin.inf.on { background: rgba(54,181,224,.12); border-color: rgba(54,181,224,.5); }
.bp-tin.arch.on { background: rgba(63,206,143,.12); border-color: rgba(63,206,143,.5); }
.bp-tin.cav.on { background: rgba(255,138,61,.12); border-color: rgba(255,138,61,.5); }
.bp-tin.on .bp-pct { color: var(--text); }
.bp-tbar { height: 4px; }
@media (max-width: 520px) {
    #bp-groups { grid-template-columns: minmax(0, 1fr); }
    .bp-slot-bottom { flex-wrap: wrap; }
}

/* Plan list cards */
.bp-plan-row { padding: 14px; gap: 10px; transition: border-color .15s, transform .15s; }
.bp-plan-row:hover { border-color: var(--brand); transform: translateY(-1px); }
.bp-plan-name { font-size: 1.05rem; }
.bp-plan-stats { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.bp-chip { font-size: .74rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.06); color: var(--muted); }
.bp-chip.post { background: rgba(109,120,255,.14); color: #b8beff; }
.bp-chip.post.castle { background: rgba(240,178,50,.16); color: var(--gold); }
.bp-plan-ico { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center; font-size: 1.3rem;
    background: linear-gradient(135deg, rgba(240,178,50,.25), rgba(162,91,255,.25)); border: 1px solid rgba(240,178,50,.3); }
.bp-list-grid { margin-top: 22px; }
.bp-tin { grid-template-columns: auto 1fr; }
#bp-app .bp-tin input { width: 3.3ch; }

/* ================= Site refresh (home, pricing, premium, me, faq) ================= */
.center { text-align: center; }
.container.wide-home { max-width: 1180px; }
.container.wide-home > section, .container.me-wrap > section { margin-top: 64px; }
.sec-head { text-align: center; margin-bottom: 26px; }
.sec-head .section-title { margin-top: 6px; }
.btn.gold { background: linear-gradient(135deg, #f0b232, #ffd873); color: #241a03; box-shadow: 0 10px 28px -10px rgba(240,178,50,.7); }
.btn.gold:hover { color: #241a03; }

/* hero */
.hero-v2 { position: relative; overflow: hidden; padding-bottom: 56px; }
.hero-glow { position: absolute; inset: -40% -10% auto; height: 520px; pointer-events: none;
    background: radial-gradient(closest-side at 30% 50%, rgba(109,120,255,.28), transparent),
                radial-gradient(closest-side at 70% 40%, rgba(240,178,50,.18), transparent); filter: blur(10px); }
.hero-v2 > *:not(.hero-glow) { position: relative; }
.hero-logo { display: block; margin: 0 auto 14px; border-radius: 24px; filter: drop-shadow(0 12px 30px rgba(109,120,255,.45));
    animation: heroFloat 6s ease-in-out infinite; }
@keyframes heroFloat { 50% { transform: translateY(-6px); } }
.hero-v2 .trust { flex-wrap: wrap; }

/* tools */
.tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tool-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 20px; border-radius: 16px; text-decoration: none; color: var(--text);
    background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--border); transition: transform .18s, border-color .18s, box-shadow .18s; }
.tool-card:hover { transform: translateY(-3px); border-color: var(--brand); box-shadow: 0 18px 40px -22px rgba(109,120,255,.8); color: var(--text); }
.tool-card.big { grid-column: span 2; background: radial-gradient(120% 140% at 0% 0%, rgba(109,120,255,.18), transparent 60%), var(--panel); }
.tool-card.big.gold { background: radial-gradient(120% 140% at 100% 0%, rgba(240,178,50,.18), transparent 60%), var(--panel); }
.tool-card.big.gold:hover { border-color: var(--gold); box-shadow: 0 18px 40px -22px rgba(240,178,50,.8); }
.tool-card h3 { margin: 4px 0 0; font-size: 1.08rem; }
.tool-card.big h3 { font-size: 1.3rem; }
.tool-card p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.tc-ico { width: 46px; height: 46px; display: grid; place-items: center; font-size: 1.45rem; border-radius: 13px; background: var(--panel-2); border: 1px solid var(--border); }
.tc-badge { position: absolute; top: 16px; right: 16px; font-size: .7rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; }
.tc-badge.free { background: rgba(63,206,143,.14); color: var(--ok); }
.tc-badge.login { background: rgba(88,101,242,.18); color: #aab3ff; }
.tc-badge.premium { background: rgba(240,178,50,.16); color: var(--gold); }
.tc-badge.plus { background: linear-gradient(90deg, rgba(63,206,143,.16), rgba(240,178,50,.18)); color: #ffe39a; }

/* how it works */
.how-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; counter-reset: none; }
.how-steps li { position: relative; padding: 24px 20px 20px; border-radius: 16px; background: var(--panel); border: 1px solid var(--border); text-align: center; }
.how-steps li:not(:last-child)::after { content: '→'; position: absolute; right: -14px; top: 50%; transform: translate(50%, -50%); color: var(--faint); font-size: 1.3rem; z-index: 1; }
.how-steps h3 { margin: 12px 0 6px; font-size: 1.05rem; }
.how-steps p { margin: 0; color: var(--muted); font-size: .9rem; }
.hs-n { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 900; font-size: 1.1rem;
    box-shadow: 0 8px 22px -8px rgba(109,120,255,.8); }

/* pricing */
.pricing { scroll-margin-top: 80px; }
.pr-head { text-align: center; margin-bottom: 26px; }
.pr-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.pr-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 18px 20px; border-radius: 18px; text-align: center;
    background: var(--panel); border: 1px solid var(--border); }
.pr-card h3 { margin: 4px 0 0; font-size: 1.2rem; }
.pr-card .btn { margin-top: auto; width: 100%; }
.pr-medal { font-size: 1.9rem; }
.pr-amount { display: flex; align-items: baseline; gap: 4px; margin-top: 4px; }
.pr-amount span { font-size: 2.1rem; font-weight: 900; letter-spacing: -.02em; }
.pr-amount small { color: var(--muted); font-weight: 600; }
.pr-scope { color: var(--faint); font-size: .8rem; margin-bottom: 14px; }
.pr-ribbon { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: .7rem; font-weight: 800; padding: 4px 12px;
    border-radius: 999px; background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); }
.pr-card.personal { border-color: rgba(54,181,224,.45); }
.pr-card.personal .pr-ribbon { background: #0f2b38; border-color: rgba(54,181,224,.5); color: #7fd4f2; }
.pr-card.alliance { border-color: rgba(109,120,255,.6); background: radial-gradient(120% 90% at 50% 0%, rgba(109,120,255,.18), transparent 70%), var(--panel);
    box-shadow: 0 20px 50px -28px rgba(109,120,255,.9); }
.pr-card.alliance .pr-ribbon { background: var(--grad); border: 0; color: #fff; }
.pr-card.kingdom { border-color: rgba(240,178,50,.6); background: radial-gradient(120% 90% at 50% 0%, rgba(240,178,50,.16), transparent 70%), var(--panel);
    box-shadow: 0 20px 50px -28px rgba(240,178,50,.8); }
.pr-card.kingdom .pr-ribbon { background: linear-gradient(135deg, #f0b232, #ffd873); border: 0; color: #241a03; }
.pr-card.kingdom .pr-amount span { color: var(--gold); }
.pr-table-wrap { margin-top: 22px; overflow-x: auto; border-radius: 16px; border: 1px solid var(--border); background: var(--panel); }
.pr-table { width: 100%; border-collapse: collapse; min-width: 640px; font-size: .9rem; }
.pr-table th, .pr-table td { padding: 11px 14px; text-align: center; border-bottom: 1px solid var(--border-soft); }
.pr-table tbody th { text-align: left; font-weight: 600; color: var(--text); }
.pr-table thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--bg-2); position: sticky; top: 0; }
.pr-table thead th.personal { color: #7fd4f2; }
.pr-table thead th.alliance { color: #aab3ff; }
.pr-table thead th.kingdom { color: var(--gold); }
.pr-table td:nth-child(5) { background: rgba(240,178,50,.04); }
.pr-table td:nth-child(4) { background: rgba(109,120,255,.04); }
.pr-table tr:last-child th, .pr-table tr:last-child td { border-bottom: 0; }
.pr-table tr.group th, .pr-table tr.group td { border-top: 2px solid var(--border); }
.pr-table td.y { color: var(--ok); font-weight: 900; font-size: 1.05rem; }
.pr-table td.n { color: var(--faint); }
.pr-table td.s { color: var(--faint); font-size: .8rem; }
.pr-note { display: flex; gap: 10px; align-items: center; justify-content: center; margin: 18px auto 0; max-width: 760px; padding: 12px 16px; border-radius: 12px;
    background: rgba(54,181,224,.08); border: 1px solid rgba(54,181,224,.3); color: #cfeefa; font-size: .9rem; }
.pr-secure { text-align: center; color: var(--faint); font-size: .82rem; margin: 10px 0 0; }

/* final CTA */
.cta-v2 { position: relative; overflow: hidden; background: radial-gradient(80% 140% at 50% 0%, rgba(109,120,255,.22), transparent 70%), var(--panel);
    border: 1px solid rgba(109,120,255,.35); }

@media (max-width: 980px) {
    .tool-grid, .pr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pr-grid { row-gap: 22px; }
}
@media (max-width: 640px) {
    .tool-grid, .pr-grid, .how-steps { grid-template-columns: minmax(0, 1fr); }
    .tool-card.big { grid-column: auto; }
    .how-steps li:not(:last-child)::after { content: '↓'; right: 50%; top: auto; bottom: -14px; transform: translate(50%, 50%); }
}

/* /me welcome */
.container.me-wrap { padding-top: 32px; }
.me-hero { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; padding: 24px; border-radius: 20px;
    background: radial-gradient(90% 160% at 0% 0%, rgba(109,120,255,.2), transparent 60%), var(--panel); border: 1px solid var(--border); }
.me-id { display: flex; align-items: center; gap: 16px; min-width: 0; }
.me-id h1 { margin: 0 0 4px; font-size: 1.8rem; }
.me-id p { margin: 0; }
.me-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 3px solid rgba(109,120,255,.6); flex-shrink: 0;
    box-shadow: 0 10px 30px -10px rgba(109,120,255,.8); }
.me-avatar.fallback { display: grid; place-items: center; background: var(--grad); font-size: 1.8rem; font-weight: 900; color: #fff; }
.me-plan { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--border); }
.me-plan > div { display: flex; flex-direction: column; gap: 2px; }
.me-plan a { font-size: .85rem; color: #7fd4f2; }
.me-plan.on { border-color: rgba(54,181,224,.5); background: rgba(54,181,224,.08); }
.me-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.me-stat { padding: 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--border); text-align: center; }
.me-stat .n { display: block; font-size: 1.7rem; font-weight: 900; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.me-stat .l { color: var(--muted); font-size: .85rem; }
.container.me-wrap > section.me-tools-sec { margin-top: 26px; }
.me-tools-sec h2 { font-size: 1.1rem; margin: 0 0 10px; }
.me-tools { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.me-tool { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--border);
    color: var(--text); text-decoration: none; font-weight: 700; font-size: .9rem; transition: border-color .15s, transform .15s; }
.me-tool:hover { border-color: var(--brand); transform: translateY(-2px); color: var(--text); }
.me-tool.gold { border-color: rgba(240,178,50,.4); background: radial-gradient(120% 140% at 100% 0%, rgba(240,178,50,.14), transparent 60%), var(--panel); }
.me-tool .tc-ico { width: 38px; height: 38px; font-size: 1.15rem; flex-shrink: 0; }
.me-wrap > section > h2 { margin-bottom: 12px; }
.guild-card { transition: transform .15s, border-color .15s, box-shadow .15s; }
.guild-card:not(.static):hover { transform: translateY(-2px); box-shadow: 0 16px 36px -22px rgba(109,120,255,.9); }

/* Premium page */
.premium-page .back { display: inline-block; margin-bottom: 4px; }
.premium-hero { margin: 0 -24px; border-radius: 22px; padding-top: 40px; }
.premium-page .pm-section { margin-top: 54px; scroll-margin-top: 80px; }
.pm-personal { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 22px; border-radius: 18px;
    background: radial-gradient(120% 160% at 0% 0%, rgba(54,181,224,.16), transparent 60%), var(--panel); border: 1px solid rgba(54,181,224,.4); }
.pm-personal .pr-medal { font-size: 2.4rem; }
.pm-personal-body { flex: 1; min-width: 220px; }
.pm-personal-body h2 { margin: 0 0 4px; }
.pm-personal-body p { margin: 0; }
.pm-personal .btn-row { margin: 0; }

/* Surveys list */
.survey-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.survey-list-card { border-radius: 16px; transition: transform .15s, border-color .15s, box-shadow .15s; }
.survey-list-card:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -22px rgba(109,120,255,.9); }

@media (max-width: 980px) { .me-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
    .me-stats { grid-template-columns: 1fr 1fr 1fr; }
    .me-stat .n { font-size: 1.3rem; }
    .me-id h1 { font-size: 1.4rem; }
    .premium-hero { margin: 0; }
}
.tool-grid > .tool-card.wide { grid-column: span 2; }
@media (max-width: 640px) { .tool-grid > .tool-card.wide { grid-column: auto; } }

/* Expired codes: one main row + a slim status row, read as one block */
.codes-past td.num, .codes-past th.num { text-align: right; }
.codes-past tr.code-main td { border-bottom: 0; padding-bottom: 4px; }
.codes-past tr.code-sub td { padding-top: 0; padding-bottom: 12px; }
.codes-past tr.code-sub .acode-status { margin: 0; }
.codes-past tr.code-sub .badge { font-size: .72rem; }

/* Proxy panel: projected days of the billing cycle */
.mp-day.proj span { opacity: .3; }

/* Errors page: one row per failure cause */
a.cause-row { display: grid; width: 100%; grid-template-columns: minmax(0, 2.2fr) minmax(80px, 1fr) 120px 150px; gap: 14px; align-items: center;
             padding: 10px 4px; border-bottom: 1px solid var(--border, rgba(255,255,255,.06)); }
a.cause-row:last-child { border-bottom: 0; }
a.cause-row.expected { opacity: .72; }
.cause-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cause-main .badge { align-self: flex-start; }
.cause-what { font-size: .82rem; }
.cause-n { text-align: right; white-space: nowrap; }
.cause-last { font-size: .8rem; text-align: right; }
.err-trend { height: 48px; margin-top: 8px; }
@media (max-width: 720px) { a.cause-row { grid-template-columns: 1fr auto; } a.cause-row .bar, .cause-last { display: none; } }

/* Announce: hand reward cropper */
.icon-crop-form { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.icon-file-btn { cursor: pointer; }
.icon-crop-stage { flex: 1 1 100%; }
.icon-crop-stage canvas { max-width: 100%; cursor: crosshair; border-radius: 8px; border: 1px solid var(--border); }
.icon-crop-side { display: flex; flex-direction: column; gap: 10px; width: 200px; }
.icon-crop-side canvas { width: 128px; height: 128px; border-radius: 10px; border: 1px solid var(--border); background: #0a0c11; }
.icon-custom-list { margin-top: 18px; }
.icon-custom { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.icon-custom img { width: 40px; height: 40px; border-radius: 8px; }
.icon-custom span { flex: 1; }


/* Code post page: three numbered steps, occasional tools folded away */
.post-step { margin-bottom: 18px; }
.post-step.muted-step { opacity: .6; }
.post-step-title { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 1.1rem; }
.step-n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand);
          color: #fff; font-weight: 800; font-size: .9rem; flex: none; }
.step-n.small { width: 22px; height: 22px; font-size: .75rem; margin-right: 8px; }
.shot-drop { display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center; cursor: pointer;
             padding: 22px; margin-bottom: 16px; border: 2px dashed rgba(109,120,255,.45); border-radius: 14px;
             background: rgba(109,120,255,.06); transition: background .15s, border-color .15s; }
.shot-drop:hover, .shot-drop.over { background: rgba(109,120,255,.14); border-color: var(--brand); }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 8px; margin-bottom: 14px; }
.slot { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 10px; }
.slot.check { border-color: var(--warn); }
.slot.unknown { border-color: var(--danger); }
.slot-n { color: var(--muted); width: 14px; text-align: right; font-size: .8rem; }
.slot-crop { width: 40px; height: 40px; border-radius: 8px; flex: none; }
.slot-pick { flex: 1; min-width: 0; }
.slot-pick summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; min-height: 40px; }
.slot-pick summary::-webkit-details-marker { display: none; }
.slot-pick summary img { width: 40px; height: 40px; border-radius: 8px; }
.slot-pick summary span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-pick[open] { flex-basis: 100%; }
.slot-pick[open] .icon-picker { margin-top: 8px; }
.slot:has(.slot-pick[open]) { flex-wrap: wrap; grid-column: 1 / -1; }
.slot .mgmt-num { width: 74px; }
.slot-x { color: var(--muted); }
.post-new .shot-new { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.post-new .shot-new input[type=text] { flex: 1; min-width: 0; }
.publish { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 22px; align-items: start; }
@media (max-width: 900px) { .publish { grid-template-columns: 1fr; } }
.publish-side { display: flex; flex-direction: column; gap: 10px; }
.publish-btn { display: flex; align-items: center; justify-content: flex-start; text-align: left; }
.publish-last { display: flex; align-items: center; margin: 2px 0; }
.publish-text summary { cursor: pointer; color: var(--muted); margin-top: 6px; }
.publish-more { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.post-extra { margin-top: 14px; }
.post-extra > summary { cursor: pointer; display: flex; gap: 10px; align-items: baseline; }
.post-extra[open] > summary { margin-bottom: 12px; }

/* Code post: make what needs checking explicit, steps a/b/c readable */
.slot-src { display: flex; flex-direction: column; align-items: center; flex: none; }
.slot-src em { font-style: normal; font-size: .62rem; color: var(--warn); line-height: 1; margin-top: 2px; }
.slot.unknown .slot-src em { color: var(--danger); }
.slot-edit { font-style: normal; color: var(--muted); margin-left: auto; padding: 0 4px; }
.slot-pick summary:hover .slot-edit { color: var(--brand); }
.mgmt-num.qty-missing { border-color: var(--warn); box-shadow: 0 0 0 2px rgba(240,178,50,.25); }
.publish-btn .step-n.small, .publish-last .step-n.small { background: #fff; color: #11141c; }
.publish-btn { padding: 14px 16px; font-size: 1rem; }
.publish-last { display: flex; align-items: center; padding: 14px 16px; border-radius: 12px;
                border: 1px dashed rgba(255,255,255,.18); color: var(--text); }

/* Code post on a phone */
.slots { grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); }
.on-touch { display: none; }
@media (pointer: coarse) { .on-touch { display: inline; } .on-desktop { display: none; } }
@media (max-width: 640px) {
    .post-step .mgmt-row { flex-direction: column; align-items: stretch; }
    .post-step .announce-input, .announce-code-field #codePicker, .announce-code-field #codeInput { min-width: 0; width: 100%; }
    .announce-code-field { display: flex; flex-direction: column; gap: 8px; }
    .shot-drop { padding: 26px 14px; }
    .slot { flex-wrap: wrap; }
    .slot .mgmt-num { width: 64px; }
    .icon-choice img { width: 40px; height: 40px; }
    .post-step-title { font-size: 1rem; }
    .publish-btn, .publish-last { padding: 16px; }
    .icon-crop-side { width: 100%; }
}

/* Code post: doubtful slots apart, full width, nothing cut */
.slot-group.doubt { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.slot-group.doubt .slot { padding: 8px 12px; }
.slot-group.doubt .slot-pick summary span { overflow: visible; white-space: normal; }
.slot-group-title { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin: 4px 0 8px; }
.slot-group-title.warn { color: var(--warn); }
.slot-group-title.ok { color: var(--ok); }
.slot .mgmt-num { width: 64px; flex: none; }

/* Admin commands page */
.cmd-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(60px, 1fr) 90px; gap: 12px; align-items: center; margin: 8px 0; }
.cmd-row code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd-row > span:last-child { text-align: right; }

/* Workers page: RAM/CPU per machine */
.res-sub { font-size: .85rem; font-weight: 500; margin-left: 4px; }
.res-grid { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 24px; align-items: center; }
@media (max-width: 760px) { .res-grid { grid-template-columns: 1fr; } }
.res-label { margin: 10px 0 6px; font-size: .86rem; display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.res-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: #0a0c11; }
.res-bar .seg { height: 100%; transition: width .4s; }
.res-bar .seg.brand, .dot.brand { background: var(--brand); }
.res-bar .seg.other, .dot.other { background: rgba(255,255,255,.22); }
.res-room { display: flex; flex-direction: column; gap: 4px; text-align: center; padding: 14px; border-radius: 12px; background: rgba(109,120,255,.08); }
.res-room-n { font-size: 2.4rem; font-weight: 800; color: var(--ok); line-height: 1; }
.res-avg { font-size: .8rem; margin-top: 6px; }
.autoupdate-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }

/* Workers page: readable 24h chart (values written out, no hover needed) */
.res-chart { margin-top: 18px; }
.res-peaks { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 12px; }
.res-peaks > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.03); }
.res-peaks strong { font-size: 1.4rem; }
.res-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .82rem; margin-bottom: 6px; align-items: center; }
.res-legend .ln { display: inline-block; width: 16px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.ln.mem { background: rgba(255,255,255,.55); } .ln.wk { background: var(--brand); } .ln.cpu { background: var(--warn); }
.res-svg { width: 100%; height: 190px; overflow: visible; }
.res-svg .grid { stroke: rgba(255,255,255,.07); stroke-width: 1; }
.res-svg .ax { fill: var(--muted); font-size: 12px; }
.res-svg path { fill: none; stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.res-svg path.mem { stroke: rgba(255,255,255,.55); }
.res-svg path.wk { stroke: var(--brand); }
.res-svg path.cpu { stroke: var(--warn); }

/* Resource chart hover */
.res-plot { position: relative; }
.res-plot svg { cursor: crosshair; }
.res-cursor { position: absolute; width: 1px; background: rgba(255,255,255,.25); pointer-events: none; }
.res-dot { position: absolute; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 50%;
           border: 2px solid #11141c; pointer-events: none; box-shadow: 0 0 0 3px rgba(255,255,255,.08); }
.res-dot.mem { background: #cfd3dc; } .res-dot.wk { background: var(--brand); } .res-dot.cpu { background: var(--warn); }
.res-tip { position: absolute; display: flex; flex-direction: column; gap: 3px; min-width: 190px; padding: 10px 12px;
           border-radius: 10px; background: rgba(17,20,28,.96); border: 1px solid var(--border); font-size: .82rem;
           pointer-events: none; box-shadow: 0 8px 24px rgba(0,0,0,.45); z-index: 5; white-space: nowrap; }
.res-tip .ln { display: inline-block; width: 12px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.res-tip b { float: right; margin-left: 14px; }

/* ── Admin overview cockpit ── */
@media (min-width: 900px) { .cards.kpi-4col { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.panels.split-1-1 { align-items: stretch; }
@media (min-width: 1100px) { .panels.split-1-1 { grid-template-columns: 1fr 1fr; } }
.ov-status { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: 18px; }
.ov-stat { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px 18px 16px 34px;
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text);
    text-decoration: none; transition: border-color .15s, transform .15s; }
.ov-stat:hover { transform: translateY(-1px); border-color: var(--brand); }
.ov-stat .ov-dot { position: absolute; left: 14px; top: 21px; }
.ov-stat-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.ov-stat strong { font-size: 1.6rem; font-weight: 800; line-height: 1.15; }
.ov-stat .muted { font-size: .82rem; }
.ov-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; background: var(--faint); }
.tone-ok .ov-dot { background: var(--ok); box-shadow: 0 0 0 4px rgba(63,206,143,.18); }
.tone-warn .ov-dot { background: var(--warn); box-shadow: 0 0 0 4px rgba(240,178,50,.2); }
.tone-danger .ov-dot { background: var(--danger); box-shadow: 0 0 0 4px rgba(237,77,85,.22); animation: pulse-err 1.6s infinite; }
.ov-stat.tone-warn { border-color: rgba(240,178,50,.4); }
.ov-stat.tone-danger { border-color: rgba(237,77,85,.45); background: rgba(237,77,85,.05); }
.ov-codes { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
.ov-code { display: grid; grid-template-columns: minmax(0, 1fr) 70px 36px; align-items: center; gap: 8px; font-size: .78rem; }
.ov-code code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-bar { height: 6px; border-radius: 3px; background: var(--panel-2); overflow: hidden; }
.ov-bar > span { display: block; height: 100%; background: var(--grad); }
.ov-watch { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ov-watch a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--radius-sm);
    background: var(--panel-2); border: 1px solid var(--border-soft); color: var(--text); text-decoration: none; }
.ov-watch a:hover { border-color: var(--brand); }
.ov-watch .tone-danger a { border-color: rgba(237,77,85,.4); }
.ov-watch .tone-warn a { border-color: rgba(240,178,50,.35); }
.ov-watch a > span:nth-child(2) { flex: 1; }
.ov-go { color: var(--muted); }
.ov-allgood { display: flex; align-items: center; gap: 12px; margin: 0; padding: 14px; border-radius: var(--radius-sm);
    background: rgba(63,206,143,.07); border: 1px solid rgba(63,206,143,.3); color: var(--ok); font-weight: 700; }
.ov-allgood .ov-dot { background: var(--ok); }
.ov-biz { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ov-biz a { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: var(--radius-sm);
    background: var(--panel-2); border: 1px solid var(--border-soft); color: var(--text); text-decoration: none; }
.ov-biz a:hover { border-color: var(--brand); }
.ov-biz a > span { font-size: .78rem; }
.ov-biz strong { font-size: 1.45rem; font-weight: 800; }
.ov-biz strong.gold { color: var(--gold); }

/* ── Revenue: live Stripe figures, schedule, costs ── */
.pos { color: var(--ok); }
.neg { color: var(--danger); }
.st-source { display: flex; align-items: center; gap: 14px; justify-content: space-between; flex-wrap: wrap;
    margin: 0 0 14px; font-size: .88rem; color: var(--muted); }
.st-source .st-live { background: var(--ok); box-shadow: 0 0 0 4px rgba(63,206,143,.18); width: 8px; height: 8px; }
.st-warn { color: var(--warn); }
.st-balance, .st-profit { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 14px; }
.st-balance > div, .st-profit > div, .st-ind > div { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px;
    border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--border-soft); }
.st-balance strong, .st-profit strong { font-size: 1.45rem; font-weight: 800; }
.st-balance span, .st-profit span { font-size: .78rem; }
.st-sub { font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 16px 0 8px; }
.st-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.st-list li { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 10px; padding: 8px 12px;
    border-radius: var(--radius-sm); background: var(--panel-2); font-size: .9rem; }
.st-list li .badge { justify-self: start; }
.st-ind { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.st-ind strong { font-size: 1.25rem; font-weight: 800; }
.st-ind span { font-size: .78rem; font-weight: 700; letter-spacing: .04em; }
.st-ind small { color: var(--muted); font-size: .78rem; line-height: 1.35; }
.st-cal { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 4px; align-items: end; height: 150px; margin: 6px 0 16px; }
.st-cal-col { display: flex; flex-direction: column; align-items: center; height: 100%; gap: 4px; }
.st-cal-amt { font-size: .62rem; color: var(--gold); font-weight: 700; white-space: nowrap; }
.st-cal-bar { flex: 1; width: 100%; display: flex; align-items: flex-end; background: var(--panel-2); border-radius: 4px; overflow: hidden; }
.st-cal-bar > span { display: block; width: 100%; min-height: 0; background: linear-gradient(180deg, #ffd873, var(--gold)); border-radius: 4px 4px 0 0; }
.st-cal-col.empty .st-cal-bar { opacity: .5; }
.st-cal-col:hover .st-cal-bar { outline: 1px solid var(--brand); }
.st-cal-day { font-size: .62rem; color: var(--faint); height: 12px; white-space: nowrap; }
.st-schedule { max-height: 460px; overflow-y: auto; }
.st-schedule td .muted { display: block; font-size: .78rem; }
tr.st-stopping td, tr.st-ended td { opacity: .6; }
.st-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.st-form input { background: #0a0c11; border: 1px solid var(--border); color: var(--text); padding: 9px 12px; border-radius: var(--radius-sm); }
.st-form input[name=label] { flex: 1 1 200px; }
.st-form input.st-amount { width: 100px; }
.st-form input:focus { outline: none; border-color: var(--brand); }
.st-add { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.st-actions { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; }
.st-actions form { margin: 0; }
.st-edit summary { list-style: none; cursor: pointer; }
.st-edit summary::-webkit-details-marker { display: none; }
.st-edit[open] .st-form { margin-top: 8px; padding: 10px; background: var(--panel-2); border-radius: var(--radius-sm); min-width: 520px; }
.st-months { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; height: 170px; align-items: end; margin: 6px 0 8px; }
.st-month { display: flex; flex-direction: column; align-items: center; height: 100%; gap: 6px; }
.st-month-bars { flex: 1; width: 100%; display: flex; gap: 3px; align-items: flex-end; justify-content: center; }
.st-month-bars span { width: 42%; border-radius: 4px 4px 0 0; }
.st-month-bars .in { background: var(--ok); }
.st-month-bars .out { background: var(--danger); opacity: .75; }
.st-month-label { font-size: .7rem; color: var(--muted); white-space: nowrap; }
.dot.st-in { background: var(--ok); }
.dot.st-out { background: var(--danger); }
.st-note { font-size: .78rem; margin: 10px 0 0; }

/* ── Revenue section (overview / calendar / analysis / costs) ── */
.rev-tabs-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 18px 0 22px; }
.rev-tabs { display: flex; gap: 4px; padding: 4px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; flex-wrap: wrap; }
.rev-tabs a { padding: 8px 16px; border-radius: 9px; color: var(--muted); font-weight: 700; font-size: .9rem; text-decoration: none; }
.rev-tabs a:hover { color: var(--text); background: var(--panel-2); }
.rev-tabs a.on { color: #fff; background: var(--grad); box-shadow: 0 6px 18px -8px rgba(109,120,255,.7); }
.rev-sync { display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--muted); }
.rev-sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: rev-pulse 2.4s infinite; }
@keyframes rev-pulse { 0% { box-shadow: 0 0 0 0 rgba(63,206,143,.55); } 70% { box-shadow: 0 0 0 8px rgba(63,206,143,0); } 100% { box-shadow: 0 0 0 0 rgba(63,206,143,0); } }
.rev-alert { margin: -6px 0 16px; padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid rgba(240,178,50,.4); background: rgba(240,178,50,.07); color: var(--warn); font-size: .9rem; }
.rev-alert.muted { color: var(--muted); border-color: var(--border); background: var(--panel); }
.rev-eyebrow { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--muted); }
.gold { color: var(--gold); }
.rev-link { color: #aab4ff; font-weight: 700; font-size: .88rem; text-decoration: none; }
.rev-link:hover { color: #fff; }

.rev-hero { display: grid; grid-template-columns: minmax(260px, 1fr) 2fr; gap: 14px; margin-bottom: 18px; }
@media (max-width: 1000px) { .rev-hero { grid-template-columns: 1fr; } }
.rev-hero-main { display: flex; flex-direction: column; gap: 8px; justify-content: center; padding: 24px 26px; border-radius: var(--radius);
    background: radial-gradient(120% 140% at 0% 0%, rgba(240,178,50,.16), transparent 60%), var(--panel); border: 1px solid rgba(240,178,50,.3); }
.rev-big { font-size: 2.9rem; font-weight: 900; line-height: 1; color: var(--gold); letter-spacing: -.02em; }
.rev-chip { align-self: flex-start; padding: 4px 10px; border-radius: 999px; font-size: .8rem; font-weight: 800; }
.rev-chip.up { background: rgba(63,206,143,.14); color: var(--ok); }
.rev-chip.down { background: rgba(237,77,85,.14); color: var(--danger); }
.rev-hero-sub { font-size: .85rem; }
.rev-hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 700px) { .rev-hero-stats { grid-template-columns: 1fr; } }
.rev-hero-stats a { display: flex; flex-direction: column; gap: 6px; justify-content: center; padding: 20px; border-radius: var(--radius);
    background: var(--panel); border: 1px solid var(--border); color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.rev-hero-stats a:hover { border-color: var(--brand); transform: translateY(-1px); }
.rev-hero-stats strong { font-size: 1.75rem; font-weight: 800; }
.rev-hero-stats .muted { font-size: .82rem; }

.rev-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 900px) { .rev-week { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rev-wday { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--border-soft); min-height: 150px; min-width: 0; }
.rev-wday.today { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.rev-wday.empty { opacity: .55; }
.rev-wday-head { display: flex; align-items: baseline; gap: 6px; color: var(--muted); font-size: .8rem; text-transform: capitalize; }
.rev-wday-head strong { color: var(--text); font-size: 1.15rem; }
.rev-wday-amt { font-size: 1.3rem; font-weight: 800; color: var(--gold); }
.rev-wday.empty .rev-wday-amt { color: var(--faint); }
.rev-wday-n { font-size: .78rem; }
.rev-wday-who { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: .78rem; }
.rev-wday-who li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.rev-wday-who li.stopping { text-decoration: line-through; opacity: .7; }
.rev-payout-chip { align-self: flex-start; margin-top: auto; padding: 3px 8px; border-radius: 6px; font-size: .72rem; font-weight: 800;
    background: rgba(109,120,255,.16); color: #aab4ff; white-space: nowrap; }

.rev-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.rev-tiles > div { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--border-soft); }
.rev-tiles > div.warn { border-color: rgba(240,178,50,.4); }
.rev-tiles strong { font-size: 1.5rem; font-weight: 800; }
.rev-tiles small { font-size: .78rem; line-height: 1.35; }
.rev-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rev-rows li { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 9px 12px; border-radius: var(--radius-sm); background: var(--panel-2); font-size: .9rem; }

.rvbs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; align-items: end; height: 230px; padding-top: 8px; }
.rvbs.twelve { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; height: 260px; }
.rvb-col { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; min-width: 0; }
.rvb-val { font-size: .8rem; font-weight: 800; white-space: nowrap; }
.rvb { position: relative; flex: 1; width: 100%; max-width: 64px; display: flex; align-items: flex-end; }
.rvb > span { display: block; width: 100%; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, #5fe0a8, var(--ok)); min-height: 2px; }
.rvb-pair { flex: 1; width: 100%; display: flex; gap: 4px; justify-content: center; align-items: stretch; }
.rvb-pair .rvb { max-width: 30px; flex-direction: column; justify-content: flex-end; }
.rvb-pair .rvb em { font-style: normal; font-size: .66rem; font-weight: 800; text-align: center; margin-bottom: 3px; white-space: nowrap; }
.rvb.in em { color: var(--ok); }
.rvb.out em { color: #ff8b91; }
.rvb.out > span { background: linear-gradient(180deg, #ff8b91, var(--danger)); }
.rvb-label { font-size: .75rem; color: var(--muted); white-space: nowrap; text-transform: capitalize; }
.rvb-sub { font-size: .72rem; font-weight: 800; white-space: nowrap; }
.rev-legend-row { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; font-size: .82rem; margin-bottom: 6px; }
.rev-legend-row i.dot, .rev-cal-legend i.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }

.rev-cal-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.rev-cal-nav { display: flex; align-items: center; gap: 10px; }
.rev-cal-nav h2 { margin: 0; font-size: 1.5rem; min-width: 200px; text-align: center; text-transform: capitalize; }
.rev-cal-totals { display: flex; gap: 10px; flex-wrap: wrap; }
.rev-cal-totals > div { display: flex; flex-direction: column; gap: 2px; padding: 8px 14px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--border-soft); }
.rev-cal-totals strong { font-size: 1.15rem; }
.rev-cal-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin-bottom: 10px; }
.dot.rc-received, .rev-cal-items li.received .dot { background: var(--ok); }
.dot.rc-expected, .rev-cal-items li.expected .dot { background: var(--gold); }
.dot.rc-stopping, .rev-cal-items li.stopping .dot { background: var(--danger); }
.dot.rc-payout { background: #aab4ff; }
.rev-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.rev-cal-wd { text-align: center; font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 4px 0; }
.rev-cal-day { display: flex; flex-direction: column; gap: 6px; min-height: 128px; padding: 8px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--border-soft); min-width: 0; }
.rev-cal-day.out { opacity: .35; }
.rev-cal-day.past:not(.money) { opacity: .6; }
.rev-cal-day.today { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.rev-cal-top { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; }
.rev-cal-num { font-weight: 800; font-size: .95rem; color: var(--muted); }
.rev-cal-day.today .rev-cal-num { color: #fff; background: var(--brand); border-radius: 6px; padding: 0 6px; }
.rev-cal-sum { font-size: .95rem; font-weight: 900; white-space: nowrap; }
.rev-cal-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: .74rem; }
.rev-cal-items li { display: flex; align-items: center; gap: 5px; min-width: 0; }
.rev-cal-items li .dot { width: 6px; height: 6px; border-radius: 50%; flex: 0 0 6px; }
.rev-cal-items li a, .rev-cal-items li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); text-decoration: none; }
.rev-cal-items li a:hover { color: #aab4ff; }
.rev-cal-items li b { flex: 0 0 auto; font-weight: 700; color: var(--muted); }
.rev-cal-items li.stopping a, .rev-cal-items li.stopping span { text-decoration: line-through; opacity: .7; }
.rev-cal-items li.more { color: var(--muted); padding-left: 11px; }
@media (max-width: 900px) {
    .rev-cal { grid-template-columns: 1fr; }
    .rev-cal-wd, .rev-cal-day.out, .rev-cal-day:not(.money) { display: none; }
    .rev-cal-day { min-height: 0; }
}
.rev-cal-list { margin-top: 16px; }
.rev-cal-list summary { cursor: pointer; font-weight: 700; color: #aab4ff; }
.rev-cal-list-day { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.rev-cal-list-day > strong { text-transform: capitalize; }
.rev-cal-list-day ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.rev-cal-list-day li { display: grid; grid-template-columns: 10px 1fr 90px 80px; gap: 8px; align-items: center; font-size: .88rem; }
.rev-cal-list-day li .dot { width: 7px; height: 7px; border-radius: 50%; }
.rev-cal-list-day li.received .dot { background: var(--ok); }
.rev-cal-list-day li.expected .dot { background: var(--gold); }
.rev-cal-list-day li.stopping .dot { background: var(--danger); }
.rev-cal-list-day li b { text-align: right; }

.rev-ind { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .rev-ind { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rev-ind > div { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--border-soft); }
.rev-ind strong { font-size: 1.5rem; font-weight: 800; }
.rev-ind small { color: var(--muted); font-size: .8rem; line-height: 1.4; }
.rev-table tr.rev-empty td { opacity: .45; }

.rev-flow { display: flex; align-items: stretch; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.rev-flow > div { flex: 1 1 170px; display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); }
.rev-flow strong { font-size: 1.7rem; font-weight: 900; }
.rev-flow > div.rev-flow-result { border-color: rgba(63,206,143,.35); background: radial-gradient(120% 140% at 0% 0%, rgba(63,206,143,.12), transparent 60%), var(--panel); }
.rev-flow-be { margin-left: 12px; }
.rev-op { align-self: center; font-size: 1.6rem; font-weight: 900; color: var(--faint); }
@media (max-width: 800px) { .rev-op { display: none; } .rev-flow-be { margin-left: 0; } }
.panels.rev-costs-grid { grid-template-columns: 1.6fr 1fr; align-items: start; }
@media (max-width: 1100px) { .panels.rev-costs-grid { grid-template-columns: 1fr; } }
.rev-cost-list { display: flex; flex-direction: column; gap: 8px; }
.rev-cost { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--border-soft); }
.rev-cost.ended { opacity: .55; }
.rev-cost-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rev-cost-main .muted { font-size: .78rem; }
.rev-cost-cat { align-self: flex-start; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #aab4ff; }
.rev-cost-amt { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.rev-cost-amt strong { font-size: 1.1rem; }
.rev-cost-amt .muted { font-size: .78rem; }
.rev-cost-actions { display: flex; gap: 6px; align-items: flex-start; }
.rev-cost-actions form { margin: 0; }
.rev-cost-actions .st-edit[open] { position: relative; }
.rev-cost-actions .st-edit[open] .rev-form { position: absolute; right: 0; top: 44px; z-index: 5; width: 420px; padding: 14px; background: var(--panel);
    border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); min-width: 0; margin: 0; }
.danger-txt { color: #ff8b91; }
.rev-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.rev-form.stacked { flex-direction: column; align-items: stretch; }
.rev-field { display: flex; flex-direction: column; gap: 5px; font-size: .78rem; color: var(--muted); font-weight: 700; }
.rev-field.grow { flex: 1 1 100%; }
.rev-form input, .rev-form select { background: #0a0c11; border: 1px solid var(--border); color: var(--text); padding: 10px 12px; border-radius: var(--radius-sm); font: inherit; font-weight: 500; }
.rev-form input:focus, .rev-form select:focus { outline: none; border-color: var(--brand); }
.rev-money { display: flex; gap: 6px; }
.rev-money input { width: 110px; flex: 1; }

/* Revenue overview: one framed card per month, the bar inside a graduated track */
.rvm-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1000px) { .rvm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.rvm { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--border-soft); min-width: 0; }
.rvm.current { border-color: rgba(63,206,143,.45); background: radial-gradient(120% 90% at 50% 0%, rgba(63,206,143,.10), transparent 70%), var(--panel-2); }
.rvm-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.rvm-label { font-size: .8rem; font-weight: 800; text-transform: capitalize; color: var(--muted); }
.rvm-delta { font-size: .7rem; font-weight: 800; padding: 2px 7px; border-radius: 999px; }
.rvm-delta.up { background: rgba(63,206,143,.14); color: var(--ok); }
.rvm-delta.down { background: rgba(237,77,85,.14); color: var(--danger); }
.rvm-amt { font-size: 1.2rem; font-weight: 900; }
.rvm-track { position: relative; height: 120px; display: flex; align-items: flex-end; justify-content: center; border-radius: 8px;
    background: repeating-linear-gradient(0deg, rgba(255,255,255,.05) 0 1px, transparent 1px 30px), #0e1119; border: 1px solid var(--border-soft); padding: 0 22%; }
.rvm-fill { display: block; width: 100%; min-height: 3px; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, #6ff0b6, var(--ok)); box-shadow: 0 0 18px -4px rgba(63,206,143,.6); }
.rvm-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-size: .78rem; border-top: 1px solid var(--border-soft); padding-top: 8px; }
.rvm-foot b { font-weight: 800; }
.rvm-delta.live { background: rgba(109,120,255,.16); color: #aab4ff; }

/* Revenue analysis: framed 12-month chart with a Y axis and gridlines */
.rvc { display: grid; grid-template-columns: 56px 1fr; gap: 0 10px; margin-top: 8px; }
.rvc-axis { position: relative; height: 262px; font-size: .7rem; color: var(--faint); }
.rvc-axis span { position: absolute; right: 0; transform: translateY(-50%); }
.rvc-axis span:nth-child(1) { top: 25px; }
.rvc-axis span:nth-child(2) { top: calc(25px + 59.25px); }
.rvc-axis span:nth-child(3) { top: calc(25px + 118.5px); }
.rvc-axis span:nth-child(4) { top: calc(25px + 177.75px); }
.rvc-axis span:nth-child(5) { top: 262px; }
.rvc-plot { position: relative; display: flex; align-items: stretch; height: 262px; padding-top: 24px; box-sizing: border-box; border-radius: 10px; border: 1px solid var(--border-soft); overflow: visible;
    background: linear-gradient(180deg, rgba(255,255,255,.07) 1px, transparent 1px) content-box 0 0 / 100% 25% repeat-y, #0e1119; }
.rvc-col { flex: 1; display: flex; justify-content: center; align-items: flex-end; padding: 0 4px; border-right: 1px dashed rgba(255,255,255,.04); min-width: 0; }
.rvc-col:last-child { border-right: 0; }
.rvc-col.current { background: linear-gradient(180deg, rgba(109,120,255,.08), transparent); }
.rvc-bars { display: flex; gap: 4px; align-items: flex-end; height: 100%; width: 100%; max-width: 70px; }
.rvc-bar { position: relative; flex: 1; min-height: 3px; border-radius: 5px 5px 0 0; }
.rvc-bar.in { background: linear-gradient(180deg, #6ff0b6, var(--ok)); box-shadow: 0 0 16px -6px rgba(63,206,143,.7); }
.rvc-bar.out { background: linear-gradient(180deg, #ff8b91, var(--danger)); opacity: .9; }
.rvc-bar em { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 4px; font-style: normal; font-size: .66rem; font-weight: 800; white-space: nowrap; }
.rvc-bar.in em { color: var(--ok); }
.rvc-bar.out em { color: #ff8b91; }
.rvc-months { display: flex; gap: 6px; margin-top: 8px; }
.rvc-month { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 4px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--border-soft); min-width: 0; font-size: .72rem; }
.rvc-month.current { border-color: rgba(109,120,255,.5); }
.rvc-month-label { font-weight: 800; text-transform: capitalize; font-size: .78rem; }
.rvc-month b { font-size: .8rem; }

/* Revenue forecast */
.rev-stat { display: flex; flex-direction: column; gap: 6px; justify-content: center; padding: 20px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); }
.rev-stat strong { font-size: 1.75rem; font-weight: 800; }
.rev-stat .muted { font-size: .82rem; }
.fc-stack { position: relative; display: flex; justify-content: center; align-items: flex-end; height: 100%; width: 100%; max-width: 44px; }
.fc-bar { flex: 0 0 70%; z-index: 1; }
.fc-bar.proj { background: repeating-linear-gradient(135deg, rgba(240,178,50,.85) 0 6px, rgba(240,178,50,.55) 6px 12px); box-shadow: 0 0 16px -6px rgba(240,178,50,.7); }
.fc-bar.proj em { color: var(--gold); }
.fc-range { position: absolute; left: 0; right: 0; border-radius: 6px; background: rgba(240,178,50,.10); border: 1px dashed rgba(240,178,50,.45); }
.rvc-col.fc-future { background: linear-gradient(180deg, rgba(240,178,50,.04), transparent); }
.rvc-month.fc-future { border-style: dashed; }
.dot.fc-dot { background: var(--gold); }
.dot.fc-range-dot { background: transparent; border: 1px dashed var(--gold); }
.fc-miles { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fc-miles li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm);
    background: var(--panel-2); border: 1px solid rgba(240,178,50,.3); }
.fc-miles li strong { font-size: 1.15rem; color: var(--gold); }
.fc-miles li.far { border-color: var(--border-soft); opacity: .7; }
.fc-miles li.far strong { color: var(--text); }
.fc-how { line-height: 1.55; margin: 0 0 10px; }
.rvc-months .fc-month { padding: 7px 2px; gap: 3px; }
.fc-month .rvc-month-label { font-size: .68rem; white-space: nowrap; }
.fc-month b { font-size: .66rem; white-space: nowrap; letter-spacing: -.02em; }

/* ── Member dashboard: setting cards, alerts, accounts, quotas, overview ── */
.ms-form { display: flex; flex-direction: column; gap: 16px; padding-bottom: 90px; }
.ms-card { display: flex; flex-direction: column; gap: 16px; padding: 20px 22px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); margin: 0 0 16px; }
.ms-form .ms-card { margin: 0; }
.ms-card-head { display: flex; align-items: flex-start; gap: 14px; }
.ms-card-head > div { flex: 1; min-width: 0; }
.ms-card-head h3 { margin: 0 0 3px; font-size: 1.05rem; }
.ms-card-head p { margin: 0; font-size: .86rem; line-height: 1.45; }
.ms-ico { flex: 0 0 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; background: var(--panel-2); border: 1px solid var(--border-soft); font-size: 1.15rem; }
.ms-link { color: #aab4ff; font-weight: 700; font-size: .86rem; text-decoration: none; white-space: nowrap; }
.ms-grid { display: grid; grid-template-columns: minmax(0, 360px); gap: 14px; }
.ms-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ms-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 800px) { .ms-grid.two, .ms-grid.three { grid-template-columns: 1fr; } }
.ms-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ms-field > span:first-child { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .8rem; font-weight: 700; color: var(--muted); }
.ms-field select, .ms-field input { width: 100%; box-sizing: border-box; background: #0a0c11; border: 1px solid var(--border); color: var(--text);
    padding: 11px 12px; border-radius: var(--radius-sm); font: inherit; }
.ms-field select:focus, .ms-field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(109,120,255,.18); }
.ms-field small { font-size: .76rem; line-height: 1.4; }
.ms-field.grow { flex: 1 1 220px; }
.ms-suffix { position: relative; display: block; }
.ms-suffix input { padding-right: 76px; }
.ms-suffix em { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: .8rem; color: var(--muted); pointer-events: none; }
.ms-state { font-size: .66rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.ms-state.on { background: rgba(63,206,143,.14); color: var(--ok); }
.ms-state.off { background: rgba(255,255,255,.06); color: var(--faint); }
.ms-switch { align-self: flex-start; }
.ms-savebar { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 140%); display: flex; align-items: center; gap: 12px;
    padding: 12px 14px 12px 20px; border-radius: 14px; background: #1d2234; border: 1px solid rgba(109,120,255,.45);
    box-shadow: 0 18px 50px -12px rgba(0,0,0,.8); transition: transform .25s ease; z-index: 30; font-weight: 700; }
.ms-form.dirty .ms-savebar { transform: translate(-50%, 0); }
.ms-savebar span { margin-right: 10px; }

.ev-intro { margin: -4px 0 16px; font-size: .9rem; line-height: 1.5; max-width: 820px; }
.ev-card { position: relative; }
.ev-card.live { border-color: rgba(63,206,143,.35); }
.ev-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ev-pair .ms-card { margin: 0 0 16px; }
@media (max-width: 1100px) { .ev-pair { grid-template-columns: 1fr; } }
.ev-state { flex: 0 0 auto; font-size: .72rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.ev-state.on { background: rgba(63,206,143,.14); color: var(--ok); }
.ev-state.off { background: rgba(255,255,255,.06); color: var(--muted); }
.ev-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.ev-next { font-size: .84rem; color: var(--muted); }
.ev-next.on { color: var(--text); }
.ev-next.on::before { content: "⏰ "; }
form[data-card-form] [data-save]:disabled { opacity: .45; cursor: default; box-shadow: none; }
form[data-card-form].dirty { border-color: rgba(109,120,255,.5); }

.acc-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 16px; margin-bottom: 16px; align-items: stretch; }
@media (max-width: 1100px) { .acc-top { grid-template-columns: 1fr; } }
.acc-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.acc-stats > div { display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); }
.acc-stats strong { font-size: 1.9rem; font-weight: 900; }
.warn-txt { color: var(--warn); }
.acc-add { margin: 0; }
.acc-add-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.acc-add-row .ms-field:not(.grow) { flex: 0 1 150px; }
.acc-tools { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }
.acc-search { flex: 1 1 260px; max-width: 420px; background: #0a0c11; border: 1px solid var(--border); color: var(--text); padding: 10px 14px; border-radius: var(--radius-sm); font: inherit; }
.acc-search:focus { outline: none; border-color: var(--brand); }
.chips button.chip { cursor: pointer; font: inherit; }
.acc-act { text-align: right; }
.acc-none { text-align: center; padding: 18px 0; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 20px; text-align: center; border: 1px dashed var(--border); border-radius: var(--radius); background: var(--panel); }
.empty-state.small { padding: 22px; background: var(--panel-2); border-color: var(--border-soft); }
.empty-state h3 { margin: 4px 0 0; }
.empty-state p { margin: 0; max-width: 460px; }
.empty-ico { font-size: 2rem; }

.q-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .q-layout { grid-template-columns: 1fr; } }
.q-layout .ms-card { margin: 0 0 16px; }
.q-list { display: flex; flex-direction: column; gap: 8px; }
.q-row { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--border-soft); }
.q-role { font-weight: 800; color: #c9a6ff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-limit strong { font-size: 1.3rem; }
.q-rules ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: .88rem; line-height: 1.5; color: var(--muted); }

.setup { border-color: rgba(109,120,255,.4); background: radial-gradient(120% 120% at 0% 0%, rgba(109,120,255,.12), transparent 60%), var(--panel); }
.setup-pct { font-size: 1.4rem; font-weight: 900; color: #aab4ff; }
.setup-bar { height: 8px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.setup-bar span { display: block; height: 100%; background: var(--grad); border-radius: 99px; }
.setup-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.setup-step { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--border-soft); color: var(--text); text-decoration: none; transition: border-color .15s; }
.setup-step:hover { border-color: var(--brand); }
.setup-step > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.setup-step small { font-size: .76rem; line-height: 1.35; }
.setup-check { flex: 0 0 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; font-weight: 900; font-size: .8rem; }
.setup-step.done { opacity: .6; }
.setup-step.done .setup-check { background: var(--ok); border-color: var(--ok); color: #06281a; }
.setup-go { color: #aab4ff; font-weight: 800; }
.ov-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
@media (max-width: 1000px) { .ov-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ov-kpi { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
a.ov-kpi:hover { border-color: var(--brand); transform: translateY(-1px); }
.ov-kpi strong { font-size: 1.9rem; font-weight: 900; line-height: 1.1; }
.ov-kpi small { font-size: .8rem; }
.ov-kpi.plan.on { border-color: rgba(240,178,50,.4); background: radial-gradient(120% 140% at 0% 0%, rgba(240,178,50,.12), transparent 60%), var(--panel); }
.ov-kpi.plan.on strong { color: var(--gold); }
.setup-check { width: 24px; min-width: 24px; box-sizing: border-box; }
.ev-foot .muted { font-size: .84rem; }
.guild-detail-head + .at-head { margin-top: 24px; }
.acc-add-row .ms-field:not(.grow) { flex: 0 1 190px; }
.ms-pick { position: relative; }
.ms-pick summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: var(--radius-sm); background: #0a0c11; border: 1px solid var(--border); cursor: pointer; }
.ms-pick summary::-webkit-details-marker { display: none; }
.ms-pick summary .caret { margin-left: auto; color: var(--muted); }
.ms-pick[open] summary { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(109,120,255,.18); }
.ms-pick-menu { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; display: flex; flex-direction: column; padding: 6px; border-radius: var(--radius-sm); background: #151925; border: 1px solid var(--border); box-shadow: var(--shadow); }
.ms-pick-menu button { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.ms-pick-menu button:hover { background: var(--panel-2); }
.ms-pick-menu button.on { background: rgba(109,120,255,.18); }
.ms-pick .flag-svg { flex: 0 0 auto; }
.at-slots-note { margin: -6px 0 16px; padding: 10px 14px; border-radius: var(--radius-sm); background: rgba(109,120,255,.08); border: 1px solid rgba(109,120,255,.25); font-size: .86rem; line-height: 1.5; }
.bp-section-tabs { display: inline-flex; margin: 4px 0 18px; }

/* ── Battle-plan sign-ups (manager) ── */
.su-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .su-layout { grid-template-columns: 1fr; } }
.su-layout .ms-card { margin: 0; }
.su-list { display: flex; flex-direction: column; gap: 8px; }
.su-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 14px; align-items: center; padding: 12px 14px; border-radius: var(--radius-sm);
    background: var(--panel-2); border: 1px solid var(--border-soft); color: var(--text); text-decoration: none; transition: border-color .15s; }
.su-row:hover { border-color: var(--brand); }
.su-row.closed { opacity: .6; }
.su-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.su-row-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.su-row-count strong { font-size: 1.15rem; }
.su-check { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; font-size: .9rem; color: var(--text); font-weight: 500; cursor: pointer; }
.su-check input { margin-top: 3px; accent-color: var(--brand); }
.su-check small { display: block; }
.su-back { display: inline-block; margin-bottom: 12px; }
.su-head .ms-card-head h3 { font-size: 1.3rem; }
.su-share { display: flex; gap: 10px; }
.su-share input { flex: 1; min-width: 0; background: #0a0c11; border: 1px solid rgba(109,120,255,.45); color: #aab4ff; padding: 11px 14px; border-radius: var(--radius-sm); font: inherit; font-weight: 700; }
.su-share-help { margin: -6px 0 0; font-size: .82rem; }
.su-head-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.su-kpis { display: flex; align-items: center; gap: 14px; }
.su-kpis strong { font-size: 1.5rem; }
.su-actions { display: flex; gap: 8px; }
.su-actions form { margin: 0; }
.su-stats { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; }
@media (max-width: 1100px) { .su-stats { grid-template-columns: 1fr; } }
.su-stats .ms-card { margin: 0 0 16px; }
.su-bars { display: flex; flex-direction: column; gap: 4px; }
.su-bar-row { display: grid; grid-template-columns: 74px 1fr 34px; gap: 10px; align-items: center; padding: 4px 6px; border-radius: 6px; color: var(--text); text-decoration: none; font-size: .84rem; }
a.su-bar-row:hover { background: var(--panel-2); }
a.su-bar-row.on { background: rgba(109,120,255,.16); }
.su-bar-row strong { text-align: right; }
.su-bar-label { color: var(--muted); font-weight: 700; white-space: nowrap; }
.su-bar { height: 10px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.su-bar > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #3fce8f, #6ff0b6); }
.su-troops { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 800px) { .su-troops { grid-template-columns: 1fr; } }
.su-troop-title { display: flex; justify-content: space-between; margin: 0 0 6px; font-weight: 800; font-size: .9rem; }
.su-troop.inf .su-bar > span { background: linear-gradient(90deg, #2f6fd6, #5b9bff); }
.su-troop.cav .su-bar > span { background: linear-gradient(90deg, #d4691b, #ff9a4a); }
.su-troop.arch .su-bar > span { background: linear-gradient(90deg, #c2393f, #ff6b71); }
.su-troop.inf .su-troop-title span:first-child { color: #5b9bff; }
.su-troop.cav .su-troop-title span:first-child { color: #ff9a4a; }
.su-troop.arch .su-troop-title span:first-child { color: #ff6b71; }
.su-lvl { font-weight: 800; font-size: .8rem; white-space: nowrap; }
.su-lvl.inf { color: #5b9bff; } .su-lvl.cav { color: #ff9a4a; } .su-lvl.arch { color: #ff6b71; }
.su-tag { color: #aab4ff; font-weight: 800; }
.su-slots-cell { max-width: 220px; }
.su-slot { display: inline-block; margin: 1px 3px 1px 0; padding: 1px 6px; border-radius: 5px; background: rgba(63,206,143,.12); color: var(--ok); font-size: .72rem; font-weight: 700; }
.su-note { max-width: 220px; font-size: .82rem; color: var(--muted); }
th.sortable { cursor: pointer; user-select: none; }
th.sortable::after { content: " ↕"; opacity: .35; }
th.sortable.asc::after { content: " ↑"; opacity: 1; }
th.sortable.desc::after { content: " ↓"; opacity: 1; }

/* ── Public sign-up page ── */
.sp-wrap { max-width: 720px; margin: 0 auto; padding: 34px 18px 60px; }
.sp-head { text-align: center; margin-bottom: 22px; }
.sp-eyebrow { display: inline-block; padding: 4px 12px; border-radius: 99px; background: rgba(109,120,255,.14); color: #aab4ff; font-size: .78rem; font-weight: 800; }
.sp-head h1 { margin: 12px 0 6px; font-size: 2rem; }
.sp-done { display: flex; align-items: center; gap: 14px; padding: 16px 18px; margin-bottom: 16px; border-radius: var(--radius); background: rgba(63,206,143,.08); border: 1px solid rgba(63,206,143,.35); }
.sp-done p { margin: 3px 0 0; }
.sp-done-ico { flex: 0 0 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: #06281a; font-weight: 900; font-size: 1.2rem; }
.sp-mine { margin-bottom: 16px; padding: 14px 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); }
.sp-mine-row { display: flex; gap: 10px; align-items: center; padding: 6px 0; color: var(--text); text-decoration: none; }
.sp-form { display: flex; flex-direction: column; gap: 14px; }
.sp-step { display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); }
.sp-label { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 800; font-size: 1.05rem; }
.sp-num { flex: 0 0 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #fff; font-size: .85rem; }
.sp-id-row { display: flex; gap: 10px; }
.sp-form input[type=text], .sp-form select, .sp-form textarea { background: #0a0c11; border: 1px solid var(--border); color: var(--text); padding: 12px 14px; border-radius: var(--radius-sm); font: inherit; }
.sp-form input[type=text]:focus, .sp-form select:focus, .sp-form textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(109,120,255,.18); }
.sp-id-row input { flex: 1; min-width: 0; font-size: 1.1rem; letter-spacing: .04em; }
.sp-player { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: rgba(63,206,143,.08); border: 1px solid rgba(63,206,143,.3); }
.sp-player img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; }
.sp-player div { display: flex; flex-direction: column; gap: 2px; }
.sp-msg { margin: 0; color: var(--warn); font-weight: 600; font-size: .9rem; }
.sp-troops { display: flex; flex-direction: column; gap: 8px; }
.sp-troop { display: grid; grid-template-columns: 110px 1fr 1fr; gap: 10px; align-items: center; }
.sp-troop-name { font-weight: 800; }
.sp-troop.inf .sp-troop-name { color: #5b9bff; } .sp-troop.cav .sp-troop-name { color: #ff9a4a; } .sp-troop.arch .sp-troop-name { color: #ff6b71; }
.sp-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.sp-slot { position: relative; cursor: pointer; }
.sp-slot input { position: absolute; opacity: 0; }
.sp-slot span { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--border-soft); transition: all .12s; }
.sp-slot small { font-size: .7rem; color: var(--muted); min-height: 1em; }
.sp-slot input:checked + span { background: rgba(63,206,143,.16); border-color: var(--ok); color: var(--ok); }
.sp-slot input:focus-visible + span { box-shadow: 0 0 0 3px rgba(109,120,255,.3); }
.sp-submit { padding: 15px; font-size: 1.05rem; }
.sp-privacy { text-align: center; font-size: .8rem; margin: 0; }
@media (max-width: 560px) { .sp-troop { grid-template-columns: 1fr 1fr; } .sp-troop-name { grid-column: 1 / -1; } }
.su-back { display: block; width: fit-content; }
.sp-player[hidden], .sp-msg[hidden], .sp-player img[hidden] { display: none !important; }
.ms-field .su-check input { width: auto; flex: 0 0 auto; padding: 0; }
.ms-field .su-check > span { display: block; color: var(--text); font-weight: 600; font-size: .9rem; }

/* ── Battle plan: sign-ups pool tab + castle map ── */
.bp-r-info { display: block; grid-column: 1 / -1; font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-pool-row .bp-r-info { flex-basis: 100%; order: 9; }
.bp-pool-row { flex-wrap: wrap; }
#bp-su-form, #bp-su-slot { width: 100%; margin-bottom: 8px; background: #0a0c11; border: 1px solid var(--border); color: var(--text); padding: 8px 10px; border-radius: var(--radius-sm); font: inherit; }
.bp-view { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--border-soft); margin-left: auto; margin-right: 8px; }
.bp-view button { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 700; font-size: .85rem; padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.bp-view button.on { background: var(--grad); color: #fff; }
.bp-map-locked { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 50px 20px; text-align: center; border: 1px dashed var(--border); border-radius: var(--radius); }
.bp-map-locked p { max-width: 520px; margin: 0; }
.bp-map-wrap { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); gap: 14px; align-items: start; }
@media (max-width: 1200px) { .bp-map-wrap { grid-template-columns: 1fr; } }
.bp-map-stage { position: sticky; top: 76px; border-radius: var(--radius); background: #0d111c; border: 1px solid var(--border); overflow: hidden; }
.bp-map-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border-soft); font-size: .8rem; }
.bp-map-zoom { display: inline-flex; gap: 4px; }
.bp-map-zoom button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); font-weight: 800; cursor: pointer; }
.bp-map { display: block; width: 100%; aspect-ratio: 1; touch-action: none; user-select: none; }
.bp-map.armed { cursor: crosshair; }
.bp-map [data-sq], .bp-map [data-en] { cursor: grab; }
.bp-map-side { display: flex; flex-direction: column; gap: 12px; }
.bp-m-card { padding: 14px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); }
.bp-m-card h3, .bp-m-card summary { margin: 0 0 10px; font-size: .95rem; font-weight: 800; cursor: default; }
.bp-m-card summary { cursor: pointer; margin: 0; }
.bp-m-card[open] summary { margin-bottom: 10px; }
.bp-m-card.timing { border-color: rgba(240,178,50,.35); }
.bp-m-card.enemy { border-color: rgba(237,77,85,.3); }
.bp-m-row { padding: 10px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--border-soft); margin-bottom: 8px; border-left: 4px solid var(--sq, #ed4d55); }
.bp-m-row.armed { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(109,120,255,.35); }
.bp-m-row-head { display: flex; align-items: center; gap: 8px; }
.bp-m-row-head strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-m-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--sq); transform: rotate(45deg); flex: 0 0 10px; }
.bp-m-tw { font-size: .72rem; font-weight: 800; color: #ffd873; white-space: nowrap; }
.bp-m-fields { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 6px 8px; align-items: center; margin-top: 8px; font-size: .78rem; color: var(--muted); }
.bp-m-fields input, .bp-m-fields select, .bp-m-name { width: 100%; box-sizing: border-box; background: #0a0c11; border: 1px solid var(--border); color: var(--text); padding: 6px 8px; border-radius: 7px; font: inherit; font-size: .85rem; }
.bp-m-name { flex: 1; min-width: 0; }
.bp-m-twl { grid-column: 1 / -1; color: #ffd873; font-weight: 800; }
.bp-m-march { margin: 8px 0 0; font-size: .8rem; color: #aab4ff; font-weight: 700; }
.bp-m-sched { padding: 10px 0; border-top: 1px solid var(--border-soft); }
.bp-m-sched:first-of-type { border-top: 0; padding-top: 0; }
.bp-m-sched h4 { margin: 0 0 6px; color: #ffd873; }
.bp-m-info { margin: 8px 0; padding: 8px 10px; border-radius: 8px; font-size: .82rem; font-weight: 600; }
.bp-m-info.ok { background: rgba(63,206,143,.08); color: var(--ok); }
.bp-m-info.bad { background: rgba(237,77,85,.1); color: #ff8b91; }
.bp-m-ok { margin: 0 0 6px; font-size: .78rem; color: var(--ok); }
.bp-m-table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: .85rem; }
.bp-m-table th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 4px 6px; }
.bp-m-table td { padding: 6px; border-top: 1px solid var(--border-soft); }
.bp-m-who { border-left: 3px solid var(--sq); font-weight: 700; }
.bp-m-start { color: #ffd873; font-weight: 900; font-variant-numeric: tabular-nums; }
.bp-m-model { font-size: .74rem; margin-top: 10px; }
#bp-groups[hidden], #bp-map-view[hidden] { display: none !important; }
.bp-map-coord { font-weight: 800; color: #ffd873; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Pool tabs: four of them never fit one row in French — two rows of two. */
.bp-pool .bp-tabs { display: grid; grid-template-columns: 1fr 1fr; }
.bp-pool .bp-tabs button { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 7px 6px; }
/* Battle plan editor: board header and map mode */
.bp-board-head { justify-content: space-between; }
.bp-board-head .bp-view { margin: 0; }
.bp-view .bp-count { margin-left: 4px; }
.bp-phases.bp-squads-only { margin: 0 0 10px; }
.bp-map-mode .bp-layout { grid-template-columns: 1fr; }
.bp-map-mode .bp-pool, .bp-map-mode .bp-squads-only { display: none !important; }
/* Top menu: labels never split over two lines; between 1100 and 1400 px the icons go first. */
.nav-center > a, .nav-center summary { white-space: nowrap; }
@media (max-width: 1400px) and (min-width: 1100px) { .nav-center > a .ic { display: none; } .nav-center { gap: 16px; } }
.bp-map-side > * { margin-top: 0; }
.su-troops { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
@media (max-width: 1400px) { .su-stats { grid-template-columns: 1fr; } }

/* ══ Site-wide controls ══════════════════════════════════════════════════════
   1. [hidden] always wins: several components set display:flex/grid, which silently
      cancelled the hidden attribute (collapsing alliances, map view, player card…).
   2. Selects drop the native Windows chrome (light arrow box on hover) for our own chevron.
   3. Checkboxes are switches, radios are dots — no more native ticks. */
[hidden] { display: none !important; }

select {
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%239aa2b4' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 12px 8px !important;
    padding-right: 34px !important;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}
select:hover:not(:disabled) { border-color: rgba(109,120,255,.55) !important; }
select:focus { outline: none; border-color: var(--brand) !important; box-shadow: 0 0 0 3px rgba(109,120,255,.18); }
select:disabled { opacity: .55; cursor: not-allowed; }
select option, select optgroup { background: #151925; color: #eef1f6; }
select option:checked { background: #2a2f63; }

input[type=checkbox]:not(.native):not(.option-choice input) {
    -webkit-appearance: none; appearance: none; flex: 0 0 auto;
    width: 38px; height: 22px; margin: 0; border-radius: 99px; position: relative; cursor: pointer;
    background: #2a3044; border: 1px solid var(--border); transition: background .18s, border-color .18s;
    vertical-align: middle;
}
input[type=checkbox]:not(.native):not(.option-choice input)::after {
    content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
    background: #c8cedb; box-shadow: 0 1px 3px rgba(0,0,0,.4); transition: transform .18s, background .18s;
}
input[type=checkbox]:not(.native):not(.option-choice input):checked { background: var(--brand); border-color: var(--brand); }
input[type=checkbox]:not(.native):not(.option-choice input):checked::after { transform: translateX(16px); background: #fff; }
input[type=checkbox]:not(.native):not(.option-choice input):disabled { opacity: .6; cursor: default; }
input[type=checkbox]:not(.native):not(.option-choice input):focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(109,120,255,.3); }

input[type=radio]:not(.native):not(.option-choice input) {
    -webkit-appearance: none; appearance: none; flex: 0 0 auto; width: 20px; height: 20px; margin: 0; border-radius: 50%;
    border: 2px solid #4a5168; background: #0a0c11; cursor: pointer; position: relative; transition: border-color .15s; vertical-align: middle;
}
input[type=radio]:not(.native):not(.option-choice input):checked { border-color: var(--brand); }
input[type=radio]:not(.native):not(.option-choice input):checked::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--brand); }

/* Sign-up form builder: switches in rows, access as two choice cards */
.su-toggles { display: flex; flex-direction: column; gap: 6px; }
.su-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
    background: var(--panel-2); border: 1px solid var(--border-soft); cursor: pointer; }
.su-toggle span { color: var(--text); font-weight: 600; font-size: .9rem; }
.su-toggle small { display: block; color: var(--muted); font-weight: 500; font-size: .76rem; margin-top: 2px; }
.su-toggle.locked { opacity: .7; cursor: default; }
.su-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 600px) { .su-choices { grid-template-columns: 1fr; } }
.su-choice { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px 14px 14px 44px; border-radius: var(--radius-sm);
    background: var(--panel-2); border: 1px solid var(--border-soft); cursor: pointer; transition: border-color .15s, background .15s; }
.su-choice input { position: absolute; left: 14px; top: 15px; }
.su-choice strong { color: var(--text); font-size: .92rem; }
.su-choice small { color: var(--muted); font-size: .78rem; line-height: 1.35; }
.su-choice:has(input:checked) { border-color: var(--brand); background: rgba(109,120,255,.1); }

/* ══ Battle plan editor layout ══ */
.bp-head { padding: 16px 18px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); margin: 8px 0 14px; }
.bp-back { flex-basis: 100%; }
.bp-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }
.bp-toolbar .bp-phases { margin: 0; }
.bp-toolbar .bp-spacer { flex: 1; }
.bp-ally-head .bp-caret { transition: transform .15s; }
.bp-ally.open .bp-ally-head .bp-caret { transform: rotate(180deg); }

/* ══ Mobile ══ */
@media (max-width: 900px) {
    .bp-layout { grid-template-columns: 1fr; }
    .bp-pool { position: static; max-height: none; }
    .bp-pool .bp-pool-list { max-height: 320px; overflow: auto; }
    .bp-head { flex-direction: column; align-items: stretch; }
    .bp-actions { display: flex; gap: 8px; }
    .bp-actions > * { flex: 1; }
    .bp-actions .btn { width: 100%; }
    .bp-toolbar .bp-view { flex: 1; }
    .bp-toolbar .bp-view button { flex: 1; }
    .bp-map-stage { position: static; }
    .bp-m-fields { grid-template-columns: auto 1fr; }
    .ms-savebar { left: 12px; right: 12px; transform: translateY(140%); justify-content: space-between; }
    .ms-form.dirty .ms-savebar { transform: translateY(0); }
    .ms-savebar span { display: none; }
    .su-row { grid-template-columns: 1fr auto; }
    .su-row .ms-link, .su-row-count { display: none; }
    .su-share { flex-direction: column; }
    .su-head-foot { flex-direction: column; align-items: stretch; }
    .su-actions { justify-content: stretch; }
    .su-actions form, .su-actions .btn { flex: 1; width: 100%; }
    .acc-stats strong { font-size: 1.5rem; }
    .rev-cost { grid-template-columns: 1fr; }
    .rev-cost-amt { align-items: flex-start; }
    .rev-cost-actions .st-edit[open] .rev-form { position: static; width: auto; }
}
.su-choice input[type=radio] { width: 20px !important; height: 20px !important; padding: 0 !important; }
.bp-board > .bp-limit[hidden] + #bp-groups, .bp-board > #bp-groups:first-child { margin-top: 0; }
.bp-board { padding-top: 0 !important; margin-top: 0 !important; }
.bp-squad-head { flex-wrap: nowrap; min-width: 0; }
.bp-squad-head .bp-squad-name { flex: 1 1 auto; min-width: 0; }
.bp-squad-head select { min-width: 0; max-width: 130px; flex: 0 1 auto; }
.bp-squad-head .bp-x { flex: 0 0 auto; }
.sp-form > .sp-step, .sp-form > section { margin: 0; }
@media (max-width: 900px) {
    .bp-toolbar { flex-direction: column; align-items: stretch; }
    .bp-toolbar .bp-view { display: flex; width: 100%; }
    .bp-toolbar .bp-view button { flex: 1; white-space: nowrap; padding: 9px 8px; }
    .bp-toolbar .bp-spacer { display: none; }
    .bp-toolbar .bp-phases { overflow-x: auto; }
    .bp-head-meta { gap: 6px; }
}
.su-choice { display: grid; grid-template-columns: 20px 1fr; column-gap: 12px; row-gap: 4px; padding: 14px; align-items: start; }
.su-choice input[type=radio] { position: static !important; grid-row: 1 / span 2; margin-top: 1px !important; }
.su-choice strong, .su-choice small { grid-column: 2; }
.su-choice input[type=radio] { position: relative !important; left: auto; top: auto; }
/* Squad cards never grow past their column: the header wraps, the name takes what is left. */
#bp-groups > *, .bp-group, .bp-squads > *, .bp-squad, .bp-slot { min-width: 0; }
.bp-squad-head { flex-wrap: wrap; }
.bp-squad-head .bp-squad-name { flex: 1 1 140px; width: 0; }
.bp-squad-head select { flex: 0 1 auto; max-width: 140px; }
.bp-squad-head .bp-x { margin-left: auto; }
.bp-slot-bottom { min-width: 0; }
.bp-squad { position: relative; }
.bp-squad-head { padding-right: 22px; }
.bp-squad-head .bp-x { position: absolute; top: 8px; right: 6px; margin: 0; }
.lang-row.ok .su-bar > span { background: linear-gradient(90deg, #3fce8f, #6ff0b6); }
.lang-row.missing .su-bar > span { background: linear-gradient(90deg, #d98a12, #f0b232); }
.lang-row.missing .su-bar-label { color: var(--warn); }
.lang-row { grid-template-columns: 170px 1fr auto; }
.lang-legend { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 4px 0 14px; color: var(--muted); font-size: .8rem; }
.lang-legend > span { display: inline-flex; align-items: center; gap: 7px; }
.lang-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.lang-dot.ok { background: #3fce8f; }
.lang-dot.missing { background: #f0b232; }
.code-reactivate { margin-left: auto; }
.lang-name { display: flex; align-items: center; gap: 9px; min-width: 0; white-space: nowrap; overflow: hidden; }
.lang-name > span { overflow: hidden; text-overflow: ellipsis; }
.lang-flag { width: 22px; height: 16px; object-fit: cover; border-radius: 3px; flex: 0 0 auto; box-shadow: 0 0 0 1px rgba(255,255,255,.08); }

/* Pages refreshed in place by live-swap.js */
.live-pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 99px; font-size: .78rem; font-weight: 600;
    color: #6ff0b6; background: rgba(63,206,143,.1); border: 1px solid rgba(63,206,143,.3); }
.live-pill i { width: 7px; height: 7px; border-radius: 50%; background: #3fce8f; animation: live-blink 2s infinite; }
.live-pill.paused { color: var(--muted); background: transparent; border-color: var(--border); }
.live-pill.paused i { background: var(--muted); animation: none; }
@keyframes live-blink { 50% { opacity: .35; } }

/* NOT_ELIGIBLE / CODE_EXPIRED: processed by the game, not a failure */
.seg.neutral { background: #6b7385; }
.dot.neutral { background: #6b7385; }

.lang-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
@media (max-width: 1100px) { .lang-cols { grid-template-columns: 1fr; } }

.code-retry { margin-top: 12px; display: flex; justify-content: flex-end; }
