/* Berry Store design tokens: the navy and lavender of the store logo. Pages use tokens, never raw colors. */
:root {
  color-scheme: dark;
  --bg: #0e1433;
  --bg-2: #141c44;
  --surface: #1a2454;
  --surface-2: #222e66;
  --line: #2f3b7a;
  --text: #eef0fb;
  --muted: #aab2dc;
  --accent: #a493d6;
  --accent-strong: #c9beeb;
  --accent-ink: #171f4a;
  --ok: #4fd1a5;
  --warn: #f2c66d;
  --bad: #f2788f;
  --radius: 14px;
  --shadow: 0 10px 30px rgb(5 8 30 / .45);
  --sidebar: 250px;
  font-family: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); line-height: 1.6; font-size: 15px; }
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75em; }
:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; inset-inline-start: -999px; background: var(--surface); padding: 8px 14px; z-index: 50; }
.skip:focus { inset-inline-start: 8px; top: 8px; }
.muted { color: var(--muted); }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* Layout */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 18px; background: rgb(14 20 51 / .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar > a { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.topbar > a:hover { text-decoration: none; }
.brand { font-size: 1.05rem; }
.avatar { border-radius: 50%; }
.btn.menu-btn { display: none; }
.body { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: calc(100vh - 60px); }
.sidebar { background: var(--bg-2); border-inline-end: 1px solid var(--line); padding: 16px 12px; position: sticky; top: 60px; align-self: start; height: calc(100vh - 60px); overflow-y: auto; }
.nav-group { margin-bottom: 18px; }
.nav-title { color: var(--muted); font-size: .8rem; padding: 0 10px 6px; }
.sidebar a { display: block; padding: 8px 10px; border-radius: 9px; color: var(--text); }
.sidebar a:hover { background: var(--surface); text-decoration: none; }
.sidebar a.active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.content { padding: 24px; display: grid; gap: 18px; align-content: start; min-width: 0; }
.page-bare .content { padding: 0; display: block; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.page-head p { margin: 0; color: var(--muted); }
.loading { color: var(--muted); padding: 40px; text-align: center; }

/* Controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 7px 16px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; color: var(--text); background: var(--surface-2); }
.btn:hover { text-decoration: none; filter: brightness(1.12); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.danger { background: var(--bad); color: #2b0a12; }
.btn.small { min-height: 30px; padding: 3px 10px; font-size: .85rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card-title { margin-bottom: 12px; }
.field { display: grid; gap: 5px; margin-bottom: 14px; }
.label { font-weight: 600; font-size: .92rem; }
.hint { color: var(--muted); font-size: .82rem; }
.input { width: 100%; min-height: 40px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font: inherit; }
.input:focus { border-color: var(--accent); outline: none; }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.slider { position: absolute; inset: 0; border-radius: 26px; background: var(--line); transition: background .15s; }
.slider::before { content: ''; position: absolute; width: 20px; height: 20px; top: 3px; inset-inline-start: 3px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(-20px); }
[dir='ltr'] .switch input:checked + .slider::before { transform: translateX(20px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.setting { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; }
.multi { display: flex; flex-wrap: wrap; gap: 6px; max-height: 220px; overflow: auto; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); font-size: .88rem; cursor: pointer; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--surface-2); }
.pill.ok { color: var(--ok); }
.pill.warn { color: var(--warn); }
.pill.bad { color: var(--bad); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 12px; text-align: start; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th { color: var(--muted); font-weight: 600; font-size: .85rem; background: var(--bg-2); }
.table tr:last-child td { border-bottom: 0; }
.empty { display: grid; justify-items: center; gap: 10px; padding: 48px 16px; text-align: center; color: var(--muted); }
.savebar { position: sticky; bottom: 14px; z-index: 15; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--accent); box-shadow: var(--shadow); }
.savebar[hidden] { display: none; }
.toasts { position: fixed; bottom: 16px; inset-inline-start: 16px; display: grid; gap: 8px; z-index: 100; }
.toast { padding: 10px 16px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); box-shadow: var(--shadow); }
.toast.ok { border-color: var(--ok); }
.toast.bad { border-color: var(--bad); }
.modal { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; width: min(460px, calc(100vw - 32px)); }
.modal::backdrop { background: rgb(5 8 30 / .7); }
.tabs { display: flex; gap: 6px; overflow-x: auto; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.tabs a { padding: 6px 12px; border-radius: 8px; white-space: nowrap; color: var(--muted); }
.tabs a.active { background: var(--surface-2); color: var(--text); }
.stat { display: grid; gap: 2px; }
.stat b { font-size: 1.7rem; }
.bot-card { display: grid; gap: 10px; align-content: start; }
.bot-card img { border-radius: 12px; }
.bot-card h3 { margin: 0; }
.bot-actions { margin-top: auto; }
.bot-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.bot-group-head { margin-bottom: 12px; }
.bot-group-head h2 { margin: 0; font-size: 1.15rem; }
.bot-group-head p { margin: 2px 0 0; font-size: .88rem; }
.renew-banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.renew-focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

/* What is left on a subscription */
.sub-line { display: grid; gap: 6px; }
.sub-line p { margin: 0; }
.sub-text { font-size: .9rem; color: var(--muted); }
.sub-text.soon { color: var(--warn); font-weight: 600; }
.sub-text.ended { color: var(--bad); font-weight: 600; }
.sub-bar { height: 6px; border-radius: 6px; background: var(--bg-2); overflow: hidden; }
.sub-bar span { display: block; height: 100%; border-radius: 6px; background: var(--ok); }
.sub-bar.soon span { background: var(--warn); }
.sub-bar.ended span { background: var(--bad); }
.sub-note { font-size: .85rem; color: var(--warn); }
.sub-note.bad { color: var(--bad); }
.sub-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.sub-card .sub-line { flex: 1 1 260px; }
.board-link { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.board-link h3, .board-link p { margin: 0; }

/* One bot's page: tabs on top, sections beside the form, everything in place */
.tab-row { display: flex; gap: 6px; border-bottom: 1px solid var(--line); }
.tab-btn { font: inherit; font-weight: 600; color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 14px; cursor: pointer; margin-bottom: -1px; }
.tab-btn:hover { color: var(--text); }
.tab-btn[aria-selected='true'] { color: var(--text); border-bottom-color: var(--accent); }
.bs-notes { display: grid; gap: 6px; }
.bs-notes:empty { display: none; }
.bs-notes p { margin: 0; }
.bs-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 16px; align-items: start; }
.bs-layout:has(> .bs-panes:only-child) { grid-template-columns: minmax(0, 1fr); }
.bs-nav { position: sticky; top: 76px; display: grid; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.bs-nav-btn { position: relative; font: inherit; text-align: start; color: var(--text); background: none; border: 0; border-radius: 9px; padding: 8px 12px; cursor: pointer; }
.bs-nav-btn:hover { background: var(--surface-2); }
.bs-nav-btn[aria-current='true'] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.bs-nav-btn.has-changes::after { content: ''; position: absolute; inset-inline-end: 10px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--warn); }
.bs-panes { display: grid; gap: 16px; min-width: 0; }
.bs-panes .field:last-child { margin-bottom: 0; }
[data-off='true'], [data-miss='true'] { display: none !important; }
.flash { outline: 2px solid var(--bad); outline-offset: 6px; border-radius: 8px; }
.rows { display: grid; gap: 10px; }
.rows-list { display: grid; gap: 8px; }
.rows-item { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; }
.rows-item > summary { display: flex; align-items: center; gap: 8px; padding: 9px 12px; cursor: pointer; font-weight: 600; }
.rows-item[open] > summary { border-bottom: 1px solid var(--line); }
.rows-body { padding: 12px; }
.rows-tools { padding-top: 10px; }
.rows-del { color: var(--bad); }
.image-field { display: grid; gap: 8px; }
.image-preview { max-height: 120px; max-width: 240px; border-radius: 8px; object-fit: contain; }
/* Analytics */
.stat-tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.stat-tile { display: grid; gap: 2px; padding: 14px 16px; }
.stat-tile b { font-size: 1.5rem; line-height: 1.2; }
.stat-tile .muted { font-size: .85rem; }
.stat-unit { font-size: .85rem; font-weight: 500; color: var(--muted); }
.stat-tops { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); align-items: start; }
.stat-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.stat-rows li { display: grid; grid-template-columns: 20px auto minmax(0, 1fr) auto; column-gap: 8px; align-items: center; }
.stat-rows li:not(:has(img)) { grid-template-columns: 20px minmax(0, 1fr) auto; }
.stat-rank { color: var(--muted); font-size: .85rem; text-align: center; }
.stat-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-val { font-weight: 600; white-space: nowrap; }
.stat-val small { font-weight: 400; }
.stat-track { grid-column: 1 / -1; height: 4px; margin-top: 4px; border-radius: 4px; background: var(--bg-2); overflow: hidden; }
.stat-track span { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.chart-wrap { position: relative; touch-action: pan-y; }
.chart { display: block; width: 100%; height: 180px; }
.chart-line { fill: none; stroke: var(--accent-strong); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.chart-area { fill: var(--accent); opacity: .16; }
.chart-axis { stroke: var(--line); vector-effect: non-scaling-stroke; }
.chart-rule { stroke: var(--muted); stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.chart-dot { fill: var(--accent-strong); stroke: var(--surface); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart-tip { position: absolute; top: 0; transform: translateX(-50%); padding: 3px 9px; border-radius: 8px; font-size: .82rem; white-space: nowrap; pointer-events: none; background: var(--surface-2); border: 1px solid var(--line); }
.chart-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: .8rem; }
body.page-loading::before { content: ''; position: fixed; inset-block-start: 0; inset-inline: 0; height: 2px; z-index: 60; background: var(--accent); animation: page-load 1s ease-in-out infinite alternate; transform-origin: right; }
@keyframes page-load { from { transform: scaleX(.15); } to { transform: scaleX(.85); } }

@media (max-width: 860px) {
  .btn.menu-btn { display: inline-flex; }
  .body { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset-block: 60px 0; inset-inline-start: 0; width: var(--sidebar); height: auto; z-index: 30; transform: translateX(100%); transition: transform .18s; }
  .nav-open .sidebar { transform: none; }
  .content { padding: 16px; }
  .username { display: none; }
  .bs-layout { grid-template-columns: minmax(0, 1fr); }
  .bs-nav { position: static; display: flex; overflow-x: auto; }
  .bs-nav-btn { white-space: nowrap; padding-inline-end: 22px; }
  .bot-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Ticket bot dashboard */
.tk-id { direction: ltr; unicode-bidi: isolate; font-size: .85rem; color: var(--accent-strong); }
.tk-wrap { display: inline-block; white-space: normal; min-width: 180px; max-width: 420px; overflow-wrap: anywhere; }
.tk-stars { color: var(--warn); white-space: nowrap; }
.tk-stars .muted { opacity: .4; }
.tk-frame { display: block; width: 100%; height: min(75vh, 900px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
.tk-filters { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); align-items: center; }
.tk-q { gap: 8px; }
.tk-add { margin-top: 12px; }
.tk-add .input { flex: 1; width: auto; min-width: 180px; }
.tk-answer { padding: 10px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.tk-answer:last-child { border-bottom: 0; }
.tk-answer p { margin: 4px 0 0; white-space: pre-wrap; }
.tk-image { display: grid; gap: 8px; align-content: start; }
.tk-image h3, .tk-image p { margin: 0; }
.tk-image img { width: 100%; max-height: 180px; object-fit: contain; border-radius: 10px; background: var(--bg-2); }
.tk-vars ul { margin: 6px 0 0; padding-inline-start: 18px; }
.input.tk-narrow { width: auto; min-width: 130px; }
.page-head .row .input { width: auto; max-width: 260px; }

/* ==== Store: public site, cart, orders, invoice, legal and store admin ==== */
/* Bare pages have nothing to open, except the System dashboard, which brings its own sidebar. */
.page-bare:not(:has(.sidebar)) .menu-btn { display: none; }
.st-block { display: block; }
.st-min0 { min-width: 0; }
.hint code { overflow-wrap: anywhere; }
.st-tight { margin: 0; }
.st-nowrap { flex-wrap: nowrap; }
.st-wrap { white-space: normal; min-width: 260px; }
.st-full { width: 100%; margin-block: 12px 8px; }
.st-big { min-height: 46px; padding-inline: 24px; font-size: 1rem; }
.st-expired { color: var(--bad); }
.st-ltr-start { text-align: end; }
.st-list { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; }

.st-nav { display: flex; gap: 4px; overflow-x: auto; padding: 8px 18px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.st-nav a { padding: 5px 12px; border-radius: 8px; color: var(--text); white-space: nowrap; font-size: .92rem; }
.st-nav a:hover { background: var(--surface); text-decoration: none; }
.st-public { max-width: 1160px; margin-inline: auto; padding-inline: 20px; }

.st-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 36px; align-items: center; padding-block: 52px 36px; }
.st-hero h1 { font-size: clamp(2rem, 4.6vw, 3.2rem); margin-bottom: 14px; }
.st-eyebrow { display: inline-block; margin-bottom: 14px; padding: 4px 14px; border-radius: 999px; background: var(--surface-2); color: var(--accent-strong); font-weight: 600; font-size: .88rem; }
.st-lead { font-size: 1.1rem; color: var(--text); margin-bottom: 22px; }
.st-hero-img { display: block; width: 100%; height: auto; border-radius: 20px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.st-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; padding-block: 8px 12px; }
.st-fact { display: grid; gap: 2px; padding: 14px 16px; border-inline-start: 3px solid var(--accent); background: var(--bg-2); border-radius: 10px; }
.st-fact strong { font-size: 1.05rem; }
.st-fact span { font-size: .9rem; }

.st-section { padding-block: 40px; }
.st-head { margin-bottom: 20px; max-width: 720px; }
.st-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.st-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
a.st-product { display: grid; gap: 10px; align-content: start; color: var(--text); transition: border-color .15s, transform .15s; }
a.st-product:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
a.st-product h3 { margin: 0; }
a.st-product p { margin: 0; }
.st-product-logo { border-radius: 12px; flex: none; }
.st-from { font-weight: 600; color: var(--accent-strong); font-size: .92rem; margin-top: auto; }

.st-show { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 36px; align-items: center; }
.st-show-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 22px; }
.st-show-list p { margin: 0; font-size: .92rem; }
.st-mock { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); display: grid; gap: 10px; }
.st-mock-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.st-mock-row { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--bg-2); }
.st-mock-row .grow { display: grid; min-width: 0; }

.st-faq { display: grid; gap: 8px; max-width: 820px; }
.st-faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.st-faq summary { cursor: pointer; font-weight: 600; }
.st-faq p { margin: 10px 0 0; }

.st-cta { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px; }
.st-cta-img { display: block; width: 100%; height: auto; border-radius: 14px; }

.st-footer { margin-top: 24px; background: var(--bg-2); }
.st-line { display: block; width: 100%; height: 56px; object-fit: cover; }
.st-footer-grid { max-width: 1160px; margin-inline: auto; padding: 28px 20px 8px; display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.st-footer h3 { margin-bottom: 8px; }
.st-links { display: grid; gap: 4px; }
.st-copy { max-width: 1160px; margin-inline: auto; padding: 8px 20px 20px; font-size: .85rem; }

.st-plans { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-top: 12px; }
.st-plan { display: grid; gap: 10px; align-content: space-between; padding: 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.st-plan .btn { width: 100%; }
.st-plan-title p { font-size: .9rem; }
.st-price { display: grid; gap: 6px; justify-items: start; }
.st-price strong { font-size: 1.15rem; }
.st-detail-head { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 24px; flex-wrap: wrap; }
.st-detail-head > div { flex: 1; min-width: 240px; }
.st-steps { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 16px; }

.st-cart { display: grid; gap: 16px; }
.st-line-item { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.st-line-item:last-child { padding-bottom: 0; border-bottom: 0; }
.st-line-item img { border-radius: 10px; }
.st-line-item .grow { min-width: 170px; }
.st-qty { display: grid; gap: 2px; width: 76px; }
.st-line-total { min-width: 96px; text-align: end; }
.st-checkout { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); align-items: start; }
.st-pay-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.st-pay-options .chip { padding: 8px 14px; }
.st-totals { display: grid; gap: 6px; }
.st-total-row { display: flex; justify-content: space-between; gap: 16px; }
.st-total-row.grand { padding-top: 8px; border-top: 1px solid var(--line); font-weight: 700; font-size: 1.15rem; }
.st-order-totals { max-width: 380px; margin-top: 14px; margin-inline-start: auto; }
.st-bank { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 14px; padding: 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); font: inherit; }
.st-renew { display: flex; gap: 8px; flex-wrap: wrap; }
.st-renew .input { flex: 1; min-width: 170px; width: auto; }
.st-notice { padding: 12px 16px; border-radius: 12px; background: var(--surface-2); border-inline-start: 4px solid var(--accent); margin-block: 8px; }
.st-notice p { margin: 0 0 6px; }
.st-notice p:last-child { margin: 0; }
.st-notice.warn { border-color: var(--warn); }
.st-notice.good { border-color: var(--ok); }
.st-notice.bad { border-color: var(--bad); }

.st-invoice { display: grid; gap: 18px; max-width: 860px; }
.st-invoice-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.st-invoice-head p { margin: 0; }
.st-invoice-head h1 { font-size: 1.6rem; margin-bottom: 4px; }
.st-invoice section p { margin: 0; }

.st-legal { max-width: 820px; margin-inline: auto; }
.st-legal section { margin-top: 26px; }
.st-legal h2 { font-size: 1.2rem; }
.st-legal ul { margin: 0 0 .75em; padding-inline-start: 22px; }
.st-contact { margin-block: 18px; padding: 12px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); overflow-wrap: anywhere; }
.st-contact.pending { border: 2px dashed var(--warn); }

.st-admin-product summary { cursor: pointer; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-admin-product summary img { border-radius: 8px; }
.st-admin-body { margin-top: 16px; display: grid; gap: 4px; }
.st-admin-body h3 { margin-top: 14px; }
.st-admin-plan { display: grid; gap: 10px; align-items: end; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); padding: 12px; margin-bottom: 8px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.st-admin-plan .field { margin: 0; }
.st-admin-plan .input { background: var(--surface); }
.st-admin-plan.add { border-style: dashed; }
.st-admin-active { display: grid; gap: 5px; justify-items: start; }
.st-form-grid { display: grid; gap: 0 14px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

@media (max-width: 860px) {
  .st-hero, .st-show, .st-cta { grid-template-columns: minmax(0, 1fr); }
  .st-hero { padding-block: 28px 20px; gap: 22px; }
  .st-section { padding-block: 28px; }
  .st-order-totals { max-width: none; }
}
@media (max-width: 560px) {
  .topbar { flex-wrap: wrap; padding: 8px 12px; }
  .st-show-list { grid-template-columns: minmax(0, 1fr); }
  .st-public { padding-inline: 16px; }
}
@media print {
  :root { color-scheme: light; --bg: #fff; --bg-2: #fff; --surface: #fff; --surface-2: #f2f2f2; --line: #999; --text: #000; --muted: #333; --accent-strong: #000; }
  .topbar, .sidebar, .no-print, .toasts, .skip { display: none !important; }
  .body { display: block; min-height: 0; }
  .content { padding: 0; }
  .st-invoice { max-width: none; border: 0; padding: 0; }
  .table-wrap { overflow: visible; }
}

/* System bot dashboard */
.sys-main { padding: 24px; display: grid; gap: 18px; align-content: start; min-width: 0; max-width: 1100px; }
.sys-title { font-size: clamp(1.4rem, 3vw, 1.9rem); }
.sys-stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
.sys-grid { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.sys-note { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.sys-note.warn { border-color: var(--warn); }
.sys-note.bad { border-color: var(--bad); }
.sys-id { font-size: .85rem; color: var(--muted); }
.sys-wrap { display: inline-block; white-space: normal; max-width: 320px; overflow-wrap: anywhere; }
.sys-short { width: 150px; }
.sys-duration { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 8px; }
.sys-color { max-width: 150px; }
.sys-swatch { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); flex: none; }
.sys-search { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sys-rows { display: grid; gap: 10px; margin-bottom: 12px; }
.sys-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.sys-cell { display: grid; gap: 4px; flex: 1 1 170px; min-width: 0; }
.sys-list { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 6px; }
.sys-list li { display: flex; gap: 10px; align-items: center; overflow-wrap: anywhere; }
.sys-emoji { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.sys-emoji:last-child { border-bottom: 0; }
.sys-guild { display: flex; align-items: center; gap: 12px; color: var(--text); overflow-wrap: anywhere; }
.sys-guild:hover { text-decoration: none; border-color: var(--accent); }
.sys-guild img { border-radius: 50%; flex: none; }
.sys-details summary { cursor: pointer; font-weight: 600; overflow-wrap: anywhere; }
.sys-details[open] summary { margin-bottom: 12px; }
.sys-toggles { display: grid; max-height: 560px; overflow-y: auto; margin-top: 8px; }
/* The ticket dashboard: its own sidebar, an editor beside a live preview, everything on one page. */
.tk-main { padding: 24px; display: grid; gap: 18px; align-content: start; min-width: 0; max-width: 1500px; width: 100%; margin-inline: auto;
  background: radial-gradient(900px 420px at 85% -80px, rgb(143 130 201 / .16), transparent 70%); }
.tk-main > .page-head { flex-wrap: wrap; gap: 12px; }
.tk-side { display: flex; flex-direction: column; }
.tk-side-top { display: grid; justify-items: center; gap: 8px; padding: 10px 6px 18px; text-align: center; overflow-wrap: anywhere; }
.tk-side-icon { border-radius: 18px; object-fit: cover; box-shadow: 0 8px 24px rgb(5 8 30 / .5); }
.tk-side-badge { font-size: .75rem; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.tk-side .nav-title { text-transform: none; letter-spacing: .02em; }
.tk-side-back { margin-top: auto; border: 1px solid var(--line); text-align: center; }
.tk-glow { background: linear-gradient(135deg, #8f82c9, #6d7bea); color: #fff; border: 0; box-shadow: 0 6px 18px rgb(109 123 234 / .35); }
.tk-two { display: grid; gap: 4px 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.tk-three { display: grid; gap: 4px 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); align-items: start; }
.tk-sub { font-size: .78rem; font-weight: 700; color: var(--accent-strong); margin: 14px 0 6px; }
.tk-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tk-card { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(160deg, var(--surface), var(--bg-2)); align-content: start; min-width: 0; }
.tk-card.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 8px 24px rgb(143 130 201 / .22); }
.tk-card-top { display: flex; gap: 10px; align-items: center; min-width: 0; }
.tk-card-icon { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); font-size: 1.1rem; }
.tk-card-name { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.tk-card-actions { display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 10px; }
.tk-sent .tk-sub { margin-top: 0; }
.tk-work { display: grid; gap: 18px; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); align-items: start; }
.tk-editor { display: grid; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); min-width: 0; }
.tk-editor-empty { display: grid; gap: 12px; justify-items: center; padding: 40px 10px; text-align: center; }
.tk-editor-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.tk-editor-head h2 { margin: 0; font-size: 1.2rem; overflow-wrap: anywhere; }
.tk-editor-head p { margin: 4px 0 0; }
.tk-switch { padding: 4px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); }
.tk-switch .setting { border-bottom: 0; }
.tk-switch .tk-q { padding-bottom: 12px; }
.tk-switch .tk-q[hidden] { display: none; }
.tk-switch p { margin: 2px 0 0; }
.tk-opts-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 6px; }
.tk-opts-head h3 { margin: 0; }
.tk-opts { display: grid; gap: 8px; }
.tk-opt { border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); min-width: 0; }
.tk-opt.open { border-color: var(--accent); }
.tk-opt-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; flex-wrap: wrap; }
.tk-num { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); font-size: .85rem; font-weight: 700; }
.tk-opt.open .tk-num { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tk-opt-emoji { flex: none; width: 26px; display: grid; place-items: center; }
.tk-opt-title { flex: 1 1 120px; display: grid; min-width: 0; overflow-wrap: anywhere; }
.tk-chev { color: var(--muted); }
.tk-opt-body { padding: 0 14px 14px; border-top: 1px solid var(--line); }
.tk-opt-img { width: 72px; height: 44px; object-fit: cover; border-radius: 8px; }
.tk-preview { position: sticky; top: 76px; display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-2); min-width: 0; max-height: calc(100vh - 92px); overflow-y: auto; }
.tk-preview-title { font-size: .78rem; font-weight: 700; color: var(--muted); }
.dc-frame { padding: 12px; border-radius: 10px; background: #313338; color: #dbdee1; direction: rtl; }
.dc-msg { display: flex; gap: 10px; min-width: 0; }
.dc-avatar { flex: none; border-radius: 50%; }
.dc-body { flex: 1; display: grid; gap: 8px; min-width: 0; }
.dc-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dc-head strong { color: #fff; }
.dc-tag { font-size: .62rem; padding: 0 4px; border-radius: 3px; background: #5865f2; color: #fff; font-weight: 700; }
.dc-time { font-size: .72rem; color: #949ba4; }
.dc-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9rem; }
.dc-image { width: 100%; max-height: 190px; object-fit: cover; border-radius: 8px; display: block; }
.dc-noimage { height: 90px; display: grid; place-items: center; background: #2b2d31; color: #949ba4; font-size: .8rem; }
.dc-select { display: grid; border-radius: 6px; overflow: hidden; background: #1e1f22; border: 1px solid #1e1f22; }
.dc-select-head { display: flex; justify-content: space-between; padding: 8px 10px; color: #b5bac1; font-size: .88rem; overflow-wrap: anywhere; }
.dc-option { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #2b2d31; border: 0; border-top: 1px solid #1e1f22; color: #dbdee1; text-align: start; cursor: pointer; font: inherit; }
.dc-option:hover, .dc-option.on { background: #404249; }
.dc-option-text { display: grid; min-width: 0; overflow-wrap: anywhere; }
.dc-option-text small { color: #b5bac1; }
.dc-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.dc-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border: 0; border-radius: 4px; color: #fff; cursor: pointer; font: inherit; font-size: .88rem; }
.dc-btn.secondary { background: #4e5058; }
.dc-btn.primary { background: #5865f2; }
.dc-btn.success { background: #248046; }
.dc-btn.danger { background: #da373c; }
.dc-empty { margin: 0; padding: 10px; color: #949ba4; font-size: .85rem; }
@media (max-width: 1100px) { .tk-work { grid-template-columns: minmax(0, 1fr); } .tk-preview { position: static; max-height: none; } }
@media (max-width: 860px) { .tk-main { padding: 16px; } }
.sys-emoji-img { vertical-align: middle; }
.sys-emoji-field { display: grid; gap: 6px; min-width: 200px; }
.sys-idadd { display: grid; gap: 8px; }
.sys-emoji-row { display: grid; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sys-emoji-row:last-child { border-bottom: 0; }
.sys-emoji-now { width: 28px; height: 28px; display: grid; place-items: center; flex: none; }
.sys-emoji-grid { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 12px; max-height: 240px; overflow-y: auto; }
.sys-emoji-btn { width: 40px; height: 40px; display: grid; place-items: center; background: none; border: 1px solid transparent; border-radius: 8px; cursor: pointer; }
.sys-emoji-btn:hover, .sys-emoji-btn:focus-visible { background: var(--bg); border-color: var(--line); }
.sys-terms { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 14px; }
.sys-terms dt { font-weight: 600; }
.sys-terms dd { margin: 0; color: var(--muted); }
.sys-cmd-list { display: grid; gap: 12px; }
.sys-cat > summary { font-size: 1.05rem; }
.sys-cat-count { font-weight: 400; font-size: .85rem; }
.sys-cmd-name { font-weight: 600; font-size: .95rem; }
.sys-cmd-open { display: grid; gap: 16px; padding: 14px; margin-bottom: 12px; border-radius: 10px; background: var(--bg); }
.sys-cmd-doc p { margin: 0 0 8px; overflow-wrap: anywhere; }
.sys-cmd-use { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 10px 0; align-items: baseline; }
.sys-cmd-use code { overflow-wrap: anywhere; justify-self: start; }
.sys-cmd-part { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.sys-pick { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.sys-pick > summary { cursor: pointer; padding: 10px 12px; overflow-wrap: anywhere; }
.sys-pick-body { padding: 0 12px 12px; display: grid; gap: 8px; }
.sys-pick-list { display: grid; max-height: 320px; overflow-y: auto; }
.sys-pick-row { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-radius: 6px; cursor: pointer; overflow-wrap: anywhere; }
.sys-pick-row:hover { background: var(--bg); }
.sys-pick-head { padding: 10px 4px 2px; font-size: .8rem; color: var(--muted); font-weight: 600; }
.sys-pick-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.sys-add { display: flex; gap: 8px; align-items: stretch; }
.sys-add .grow { min-width: 0; }
.sys-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sys-chips:empty { display: none; }
.sys-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: .85rem; }
.sys-chip button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 2px; }
.sys-cmd-head { font-size: .85rem; color: var(--muted); padding: 14px 0 4px; font-weight: 600; }
.sys-tabs { flex-wrap: wrap; }
.sys-pane { display: grid; gap: 18px; }
.sys-pane[hidden] { display: none; }
.sys-switch { padding: 0 8px 8px; }
.sys-health { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); margin-top: 12px; }
.sys-check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.sys-check.warn { border-color: var(--warn); }
.sys-check-icon { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .8rem; border: 1px solid currentColor; }
.sys-check.ok .sys-check-icon { color: var(--ok); }
.sys-check.warn .sys-check-icon { color: var(--warn); }
.sys-profile { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.sys-profile > .grow { flex: 1 1 260px; min-width: 0; }
.sys-preview { position: relative; flex: 0 0 240px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg); }
.sys-pv-banner { height: 84px; background: var(--line) center / cover no-repeat; }
.sys-pv-avatar { position: absolute; top: 48px; inset-inline-start: 14px; border-radius: 50%; border: 4px solid var(--bg); object-fit: cover; background: var(--surface); }
.sys-pv-body { padding: 44px 14px 14px; overflow-wrap: anywhere; }
.sys-charts { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
/* Chart colours were validated with the dataviz script against --surface (#1a2454). */
.viz-box { position: relative; }
.viz-svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.viz-grid { stroke: var(--line); stroke-width: 1; }
.viz-tick { fill: var(--muted); font-size: 11px; }
.viz-cursor { stroke: var(--muted); stroke-width: 1; }
.viz-bar.viz-s1, .viz-dot.viz-s1 { fill: #3987e5; }
.viz-bar.viz-s2 { fill: #d95926; }
.viz-line.viz-s1 { fill: none; stroke: #3987e5; stroke-width: 2; stroke-linejoin: round; }
.viz-area.viz-s1 { fill: #3987e5; fill-opacity: .14; stroke: none; }
.viz-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; font-size: .85rem; color: var(--muted); }
.viz-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.viz-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.viz-key.viz-s1 { background: #3987e5; }
.viz-key.viz-s2 { background: #d95926; }
.viz-tip { position: absolute; top: 6px; z-index: 2; min-width: 130px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); box-shadow: var(--shadow); font-size: .85rem; pointer-events: none; }
.viz-tip[hidden] { display: none; }
.viz-tip-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.viz-tip-row b { margin-inline-start: auto; }
.sys-command > summary { cursor: pointer; list-style: none; }
.sys-command > summary::-webkit-details-marker { display: none; }
.sys-command[open] { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
@media (max-width: 860px) { .sys-main { padding: 16px; } .sys-short { width: 120px; } }

/* ==== Bot detail, schema settings and admin side ==== */
.notice { padding: 10px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); border-inline-start: 4px solid var(--accent); }
.notice.warn { border-inline-start-color: var(--warn); }
.stale-banner { margin: 10px 18px; }
.stale-banner a { font-weight: 600; text-decoration: underline; }
.bot-logo { border-radius: 12px; flex: none; }
.bot-value { text-align: end; min-width: 0; overflow-wrap: anywhere; }
.mono { font-family: Consolas, 'SFMono-Regular', Menlo, monospace; font-size: .85em; direction: ltr; unicode-bidi: isolate; }
.wrap { display: inline-block; white-space: normal; max-width: 320px; overflow-wrap: anywhere; }
.section-gap { margin-top: 14px; }
.pill-gap { margin-inline-start: 8px; }
.flags { display: flex; flex-wrap: wrap; gap: 4px; max-width: 300px; white-space: normal; }
.stats .stat { align-content: start; }
.filters { display: grid; gap: 0 14px; align-items: end; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.filters .btn { margin-bottom: 14px; }
.row.tight { gap: 4px; flex-wrap: nowrap; }
.colour-row { flex-wrap: nowrap; }
.colour { width: 46px; height: 40px; flex: none; padding: 2px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); cursor: pointer; }
.tab-on { color: var(--text); font-weight: 700; }
@media (max-width: 560px) { .filters { grid-template-columns: minmax(0, 1fr); } .row.tight { flex-wrap: wrap; } }
.content > * { min-width: 0; }

/* Pasted tokens stay hidden on screen. */
.secret-text { -webkit-text-security: disc; font-family: monospace; }

/* Status page */
.status-problem { display: flex; align-items: flex-start; gap: 12px; padding: 12px; margin-bottom: 8px; border: 1px solid var(--line); border-inline-start-width: 4px; border-radius: 8px; }
.status-problem.is-bad { border-inline-start-color: var(--bad); }
.status-problem.is-warn { border-inline-start-color: var(--warn, var(--line)); }
.status-problem p { margin: 4px 0; }
.status-server-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.status-servers { display: grid; gap: 16px; }
.status-events { display: grid; gap: 4px; margin-top: 8px; font-size: .85rem; }
.status-error { display: inline-block; max-width: 280px; font-size: .8rem; color: var(--bad); }
.status-problem-body { display: grid; gap: 4px; }

/* Protection levels: three cards, the strength shown as bars. */
.sys-levels { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-top: 6px; }
.sys-level { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--line); transition: border-color .15s, transform .15s; }
.sys-level:hover { border-color: var(--accent); transform: translateY(-2px); }
.sys-level.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); background: linear-gradient(180deg, var(--surface-2), var(--bg-2)); }
.sys-level p { margin: 0; font-size: .9rem; }
.sys-level .btn { margin-top: auto; }
.sys-level-head { display: flex; align-items: center; gap: 10px; }
.sys-level-head h3 { margin: 0; font-size: 1.15rem; }
.sys-level-bars { display: inline-flex; align-items: flex-end; gap: 3px; height: 18px; }
.sys-level-bars i { width: 6px; border-radius: 2px; background: var(--line); }
.sys-level-bars i:nth-child(1) { height: 8px; }
.sys-level-bars i:nth-child(2) { height: 13px; }
.sys-level-bars i:nth-child(3) { height: 18px; }
.lvl-1 .sys-level-bars i.full { background: var(--ok); }
.lvl-2 .sys-level-bars i.full { background: var(--warn); }
.lvl-3 .sys-level-bars i.full { background: var(--bad); }
.sys-level-points { margin: 0; padding-inline-start: 18px; display: grid; gap: 4px; font-size: .88rem; }
.sys-level-points li::marker { color: var(--accent); }
.sys-levels-card .card-title { margin: 0; }

/* System panel: a calmer, more finished look. Server card on top of the sidebar, foldable groups,
   a soft accent under page titles, and cards with a faint top light. */
.sys-sidebar { padding-top: 14px; }
.sys-server { display: flex; align-items: center; gap: 10px; padding: 12px; margin: 0 2px 8px; border-radius: 12px; background: linear-gradient(135deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); }
.sys-server-mark { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 1.1rem; }
.sys-server-kind { color: var(--muted); font-size: .75rem; }
.sidebar a.sys-server-name { padding: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar a.sys-server-name:hover { background: none; text-decoration: underline; }
.sys-server .sys-switch { padding: 2px 0 0; }
.sidebar a.sys-back { color: var(--muted); font-size: .85rem; margin-bottom: 10px; }
.sys-nav-group { margin-bottom: 6px; }
.sys-nav-group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: 8px; font-weight: 600; letter-spacing: .01em; user-select: none; }
.sys-nav-group > summary::-webkit-details-marker { display: none; }
.sys-nav-group > summary::after { content: '▾'; font-size: .8rem; margin-inline-start: 6px; transition: transform .15s; }
.sys-nav-group:not([open]) > summary::after { transform: rotate(90deg); }
.sys-nav-group > summary:hover { background: var(--surface); color: var(--text); }
.sys-nav-count { margin-inline-start: auto; font-size: .7rem; font-weight: 600; padding: 0 7px; border-radius: 999px; background: var(--surface); color: var(--muted); }
.sys-nav-group a { margin-inline-start: 8px; border-inline-start: 2px solid transparent; }
.sys-nav-group a.active { border-inline-start-color: var(--accent-strong); }
.sys-main .page-head { padding-bottom: 14px; border-bottom: 1px solid var(--line); position: relative; }
.sys-main .page-head::after { content: ''; position: absolute; inset-inline-start: 0; bottom: -1px; width: 72px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--accent-strong), var(--accent)); }
.sys-main .card { box-shadow: inset 0 1px 0 rgb(255 255 255 / .04); }
.sys-main .card-title, .sys-main .card h2 { font-size: 1.1rem; }
.sys-stats .stat { position: relative; overflow: hidden; border-inline-start: 3px solid var(--accent); transition: transform .15s, border-color .15s; }
.sys-stats .stat:hover { transform: translateY(-2px); border-color: var(--accent-strong); }
.sys-stats .stat b { color: var(--accent-strong); }
.sys-tabs { padding: 6px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); width: fit-content; max-width: 100%; }

/* Limits and punishments: one clear row per kind. */
.sys-limits { display: grid; gap: 8px; }
.sys-limit-row { display: grid; grid-template-columns: minmax(180px, 1.2fr) minmax(130px, .7fr) minmax(200px, 1.3fr); gap: 14px; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); transition: opacity .15s; }
.sys-limit-row.off .sys-limit-cell { opacity: .4; }
.sys-limit-row.off .sys-limit-name b { color: var(--muted); }
.sys-limit-name { display: flex; align-items: center; gap: 12px; }
.sys-limit-cell { display: grid; gap: 4px; }
.sys-limit-cell .hint { font-size: .75rem; }
.sys-limit-num { display: flex; align-items: center; gap: 8px; }
.sys-limit-num .input { max-width: 90px; }
@media (max-width: 720px) {
  .sys-limit-row { grid-template-columns: 1fr 1fr; }
  .sys-limit-name { grid-column: 1 / -1; }
}
