/* Shared refinement: the content remains readable at narrow desktop widths. */
:root { --radius: 10px; --radius-sm: 7px; }
:root[data-theme="dark"] {
    --bg: #0e0e10; --bg-soft: #121214; --card: #171719; --elev: #1d1d20;
    --line: #333337; --line-soft: #28282c; --text: #eeeef0; --dim: #a5a5ad;
    --input: #111113; --hover: #252529; --row-alt: #1b1b1e;
    --accent: #dd555b; --accent-2: #ef7479; --accent-soft: #352024;
    --shadow: 0 5px 20px #00000020; --shadow-up: 0 12px 28px #00000055;
}
@media (prefers-color-scheme: dark) {
    :root[data-theme="auto"] {
        --bg:#0e0e10; --bg-soft:#121214; --card:#171719; --elev:#1d1d20;
        --line:#333337; --line-soft:#28282c; --text:#eeeef0; --dim:#a5a5ad;
        --input:#111113; --hover:#252529; --row-alt:#1b1b1e;
        --accent:#dd555b; --accent-2:#ef7479; --accent-soft:#352024;
    }
}
body { font-family: "Segoe UI", system-ui, sans-serif; font-size:14px; line-height:1.5; }
.wrap { max-width:1480px; padding-inline:24px; }
.shell { gap:24px; }
.side { order:0; flex-basis:224px; position:static; align-self:flex-start; max-height:none; overflow:visible; padding-bottom:12px; }
.side-group { margin-top:12px; padding:6px; box-shadow:none; background:var(--bg-soft); }
.side-group:first-child { margin-top:0; }
.side-title { padding:13px 11px 7px; font-size:10px; letter-spacing:.09em; }
.side-item { padding:9px 10px; margin-block:2px; border-radius:6px; }
.side-item:hover { background:var(--hover); }
.card { padding:22px; box-shadow:var(--shadow); border-color:var(--line-soft); margin-bottom:20px; }
h1 { font-size:23px; letter-spacing:-.025em; line-height:1.25; }
h2 { font-size:16px; line-height:1.35; }
.card>h1 { margin-top:0; padding-bottom:16px; }
.crumbs { min-height:50px; margin-bottom:10px; }
.btn { border-radius:7px; font-weight:600; box-shadow:none; min-height:36px; }
.btn.ghost { background:transparent; border-color:var(--line); }
.btn:hover { filter:brightness(1.08); }
input:not([type="checkbox"]):not([type="radio"]),select,textarea { border-radius:7px; box-shadow:none; min-height:38px; }
input:focus-visible,select:focus-visible,textarea:focus-visible,.btn:focus-visible,summary:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.tbl th { background:var(--bg-soft); font-size:12px; color:var(--dim); font-weight:600; }
.tbl td,.tbl th { padding:11px 12px; }
.tbl tbody tr:hover { background:var(--hover); }
.tabs { gap:5px; padding-bottom:9px; flex-wrap:wrap; }
.tabs .tab { border-radius:6px; padding:7px 12px; }
.shop-list { grid-template-columns:repeat(auto-fill,minmax(min(100%,230px),1fr)); gap:16px; }
.goods-row { padding:18px; background:var(--bg-soft); border-color:var(--line-soft); gap:12px; }
.goods-row:hover { transform:none; border-color:var(--accent); box-shadow:0 0 0 1px var(--accent-soft); }
.goods-row .goods-head { min-height:78px; }
.goods-row .field { margin-bottom:0; }
.goods-row .goods-desc { line-height:1.5; }
.chatlog { padding:8px; border-color:var(--line-soft); background:var(--input); }
.cl-line { display:grid; grid-template-columns:76px 44px minmax(100px,164px) minmax(0,1fr); gap:8px; align-items:start; padding:5px 6px; }
.cl-who { white-space:normal; overflow-wrap:anywhere; line-height:1.4; }
.cl-ch { padding:0; border:0; border-radius:0; background:none; min-width:44px; line-height:19px; }
.cl-ch .chat-ico { width:44px; height:19px; max-width:none; object-fit:contain; vertical-align:middle; }
.cl-msg { min-width:0; line-height:1.4; overflow-wrap:anywhere; }
.chat-link[data-peek] { cursor:help; text-decoration:underline dotted; text-underline-offset:3px; }
.cl-msg .emo { vertical-align:middle; }
.cell-tip,.peek-card { font-family:"Segoe UI",sans-serif; line-height:1.38; }
.setup-hero { display:flex; justify-content:space-between; gap:24px; align-items:center; border-top:2px solid var(--accent); }
.setup-hero h1 { margin:7px 0 10px; }
.eyebrow { font-size:11px; color:var(--accent); text-transform:uppercase; letter-spacing:.08em; }
.setup-total { display:grid; text-align:right; flex-shrink:0; color:var(--dim); }
.setup-total strong { font-size:38px; color:var(--text); font-weight:600; line-height:1; }
.setup-total span { margin-top:8px; font-size:12px; }
.setup-step { display:grid; grid-template-columns:42px minmax(0,1fr); gap:14px; }
.setup-step h2 { margin:0; }
.setup-step details { margin:15px 0; }
.setup-step summary { cursor:pointer; color:var(--dim); }
.setup-step details p { max-width:85ch; margin-block:12px; }
.setup-number { color:var(--accent); font-weight:600; font-size:20px; border-right:1px solid var(--line); }
.setup-issue { display:flex; gap:12px; align-items:baseline; padding-block:10px; border-bottom:1px solid var(--line-soft); }
.setup-issue p { margin:5px 0; }
.setup-issue:last-of-type { margin-bottom:16px; }
@media (max-width:1000px) {
    .wrap { padding-inline:14px; }
    .shell { gap:14px; }
    .side { flex-basis:188px; }
    .card { padding:17px; }
    .cl-line { grid-template-columns:70px 44px minmax(0,1fr); gap:8px; }
    .cl-msg { grid-column:3; }
    .cl-who { grid-column:3; }
}
@media (max-width:720px) {
    .shell { display:flex; flex-direction:column; }
    .side { order:-1; width:100%; flex-basis:auto; position:static; max-height:none; overflow:visible; }
    .content { width:100%; }
    .setup-hero { align-items:flex-start; }
    .setup-total strong { font-size:28px; }
    .setup-total span { max-width:80px; }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; } }

.role-filters { display:flex; flex-wrap:wrap; align-items:center; gap:10px 16px; border:0; margin:0; padding:4px 0; min-width:0; flex-basis:100%; }
.role-filters legend { font-size:12px; color:var(--dim); margin-bottom:8px; }
.role-filter { display:inline-flex; align-items:center; gap:7px; }
.role-count { border:1px solid var(--line); border-radius:5px; padding:0 6px; font-size:11px; font-variant-numeric:tabular-nums; color:var(--dim); }
.role-pill { white-space:nowrap; }
.account-role-form { border:1px solid var(--line-soft); border-radius:8px; padding:14px; background:var(--bg-soft); }
.account-role-form { flex-wrap:wrap; }
.gm-rights { flex-basis:100%; min-width:0; border:1px solid var(--line); border-radius:8px; padding:14px; }
.gm-rights legend { font-weight:600; padding-inline:7px; }
.gm-rights-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr)); gap:4px 18px; margin-block:12px; }
.gm-right { display:flex; gap:8px; align-items:start; padding:5px; cursor:pointer; border-radius:5px; }
.gm-right:hover { background:var(--hover); }
.gm-right input { margin-top:4px; flex-shrink:0; }
.gm-right-id { min-width:25px; font-variant-numeric:tabular-nums; font-size:11px; color:var(--dim); padding-top:2px; }
.role-pill { background:var(--bg-soft); color:var(--dim); border:1px solid var(--line); border-radius:5px; padding:3px 7px; font-size:11px; font-weight:600; }
.role-pill[data-level="1"] { color:var(--gold); border-color:color-mix(in srgb,var(--gold) 35%,var(--line)); }
.role-pill[data-level="2"] { color:var(--link); border-color:color-mix(in srgb,var(--link) 35%,var(--line)); }
.role-pill[data-level="3"] { color:#ba9aeb; border-color:#675181; }
.role-pill[data-level="4"] { color:var(--accent); border-color:var(--accent); }
.role-pill[data-level="5"] { color:var(--gold); border-color:var(--gold); }
.gm-rights[hidden] { display:none; }
.account-role-form>[data-role-effect] { flex-basis:100%; margin:0; }
/* Quick previews live outside tables, so their contents cannot widen a column. */
.account-preview-trigger { display:inline-block; margin-top:4px; font-size:12px; white-space:normal; }
.account-preview { box-sizing:border-box; width:min(1060px,calc(100vw - 40px)); max-width:calc(100vw - 40px); max-height:calc(100dvh - 40px); padding:0; margin:auto; border:1px solid var(--line); border-radius:12px; background:var(--card); color:var(--text); box-shadow:0 24px 90px #0009; overflow:hidden; }
.account-preview::backdrop { background:#0009; backdrop-filter:blur(3px); }
.account-preview>header,.account-preview>footer { display:flex; gap:16px; justify-content:space-between; align-items:center; padding:14px 18px; }
.account-preview>header { border-bottom:1px solid var(--line); }
.account-preview>header h2 { margin:0; font-size:16px; }
.account-preview>footer { border-top:1px solid var(--line); }
.account-preview iframe { display:block; box-sizing:border-box; border:0; width:100%; height:min(66dvh,680px); background:var(--card); }
@media(max-width:600px) { .account-preview { width:calc(100vw - 16px); max-width:calc(100vw - 16px); max-height:calc(100dvh - 16px); } .account-preview>header,.account-preview>footer { padding:10px; } }

.framed { padding:14px 18px; } .framed .rows { display:grid; grid-template-columns: minmax(120px,180px) minmax(0,1fr); gap:8px 16px; } .framed .rows dt,.framed .rows dd { margin:0; min-width:0; overflow-wrap:anywhere; }
@media(max-width:550px) { .framed .rows {grid-template-columns:1fr;} .framed .rows dd {margin-bottom:10px;} }

.cl-line .cl-ch { display:flex; align-items:center; min-height:19px; min-width:44px; }
.cl-line .cl-time { font-size:11px; line-height:19px; }


.provider-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,255px),1fr)); gap:14px; margin:14px 0 24px; }
.provider-card { display:flex; flex-direction:column; gap:14px; min-width:0; padding:18px; background:var(--bg-soft); border:1px solid var(--line); border-radius:10px; }
.provider-head { display:flex; align-items:center; gap:10px; }
.provider-head h4 { margin:0; font-size:14px; overflow-wrap:anywhere; }
.provider-symbol { display:grid; place-items:center; width:32px; height:32px; flex-shrink:0; border:1px solid var(--line); border-radius:8px; color:var(--accent); background:var(--card); font-size:18px; }
.provider-description { font-size:12px; line-height:1.5; color:var(--dim); margin:0; flex:1; }
.provider-meta { display:flex; gap:10px; justify-content:space-between; align-items:center; font-size:11px; }
.provider-status { padding:3px 7px; border-radius:5px; background:var(--card); color:var(--dim); border:1px solid var(--line); }
.provider-status.is-ready { color:var(--text); border-color:var(--accent); }
.provider-pending { border-style:dashed; }
.provider-wait { font-size:12px; min-height:36px; display:flex; align-items:center; }
.provider-card form { margin:0; }
.provider-card .btn { width:100%; justify-content:center; }
.preset-custom { border-top:1px solid var(--line); padding-top:16px; }
.preset-custom summary { cursor:pointer; font-weight:600; }
.provider-fields,.form-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr)); gap:14px; margin:16px 0; }
.provider-fields label,.form-grid label { display:flex; flex-direction:column; gap:6px; min-width:0; font-size:12px; color:var(--dim); }
.provider-fields input,.provider-fields select,.form-grid input,.form-grid select { width:100%; box-sizing:border-box; }

/* Account filters stay aligned with the columns; results update without replacing inputs. */
.account-list { width:100%; table-layout:fixed; }
.account-list th:nth-child(1) { width:7%; }
.account-list th:nth-child(2) { width:16%; }
.account-list th:nth-child(3) { width:20%; }
.account-list th:nth-child(4) { width:20%; }
.account-list th:nth-child(5) { width:11%; }
.account-list th:nth-child(6) { width:15%; }
.account-list th:nth-child(7) { width:11%; }
.account-list th, .account-list td { overflow-wrap:anywhere; white-space:normal; padding:9px 7px; }
.account-list .column-filters th { vertical-align:top; text-transform:none; font-weight:normal; }
.account-list .column-filters input:not([type=checkbox]) { width:100%; min-width:0; box-sizing:border-box; padding:8px; }
.account-list .role-pill { white-space:normal; }
.account-list td:last-child .btn { margin-bottom:4px; }
.account-role-filter summary { cursor:pointer; padding:8px; border:1px solid var(--line,#333); border-radius:7px; }
.account-role-options { display:grid; gap:7px; padding:10px 0; }
.account-role-options .tick { display:flex; gap:6px; align-items:center; font-size:12px; }
.account-role-options .role-count { margin-left:auto; }
.account-filter-status { min-height:1.5em; }
[data-account-filters][aria-busy=true] [data-account-rows] { opacity:.55; }
.recipient-choice { display:flex; gap:8px; align-items:center; padding:14px 0; }
@media(max-width:850px) { .account-list { min-width:760px; } }

.account-list td:nth-child(6) { white-space:nowrap; }
.account-list .account-preview-trigger { display:inline-flex; white-space:nowrap; margin:0; }

/* Channels have their own bounded cell, even if an old template still renders text. */
.chatlog .cl-line { grid-template-columns:76px 44px minmax(110px,164px) minmax(0,1fr); column-gap:10px; align-items:center; }
.chatlog .cl-ch { min-width:0; width:44px; max-width:44px; overflow:hidden; white-space:nowrap; font-size:10px; letter-spacing:0; }
.chatlog .cl-channel-label { display:block; max-width:44px; overflow:hidden; text-overflow:ellipsis; }
.chatlog .cl-who { min-width:0; overflow-wrap:anywhere; }
.chatlog .cl-msg .emo { width:auto; height:auto; max-width:64px; max-height:48px; vertical-align:middle; image-rendering:auto; }
@media(max-width:1000px) {
 .chatlog .cl-line { grid-template-columns:70px 44px minmax(0,1fr); align-items:start; }
 .chatlog .cl-time,.chatlog .cl-ch { grid-row:1 / span 2; }
 .chatlog .cl-who { grid-column:3; grid-row:1; }
 .chatlog .cl-msg { grid-column:3; grid-row:2; }
}

.chatlog .cl-line:hover { background:color-mix(in srgb,var(--ch) 7%,var(--input)); }
.chatlog .lg-role:hover,.chatlog .lg-guild:hover { color:var(--ch); }

.vote-identity { display:grid; gap:6px; margin:12px 0; font-size:12px; }
.vote-identity input { width:100%; min-width:0; box-sizing:border-box; font-weight:600; }
.vote-tiers { display:grid; gap:7px; margin:12px 0; }
.vote-tiers > div { display:flex; flex-wrap:wrap; justify-content:space-between; gap:6px 12px; font-size:12px; }
.vote-tiers b { font-weight:500; }

.provider-fields textarea { width:100%; min-width:0; box-sizing:border-box; resize:vertical; font-family:monospace; font-size:12px; }

.system-heading h1 { margin-bottom:6px; }
.system-tabs { display:flex; flex-wrap:wrap; gap:6px; margin-top:16px; }
.system-tabs a { padding:8px 12px; color:var(--dim); border:1px solid transparent; border-radius:7px; }
.system-tabs a:hover { color:var(--text); background:var(--hover); }
.system-tabs a.on { color:var(--text); border-color:var(--line); background:var(--accent-soft); }
.system-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr)); gap:12px; margin:14px 0; }
.system-tile { display:flex; flex-direction:column; padding:18px; border:1px solid var(--line); border-radius:10px; background:var(--card); color:var(--text); }
.system-tile h3 { margin:0 0 8px; font-size:15px; }
.system-tile p { color:var(--dim); font-size:12px; line-height:1.5; flex:1; }
.system-tile > span { color:var(--accent); margin-top:12px; font-size:12px; }
.system-tile:hover { border-color:var(--accent); }
.system-versions { display:flex; flex-wrap:wrap; gap:12px 24px; padding:12px 0; }
.system-versions b { color:var(--text); margin-left:6px; }

.payment-provider > summary { cursor:pointer; display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px; list-style:none; }
.payment-provider > summary::before { content:'▸'; color:var(--accent); }
.payment-provider[open] > summary::before { content:'▾'; }
.payment-provider > summary b { margin-right:auto; }
.payment-provider > summary > span { font-size:12px; }
.payment-provider[open] > summary { padding-bottom:16px; margin-bottom:16px; border-bottom:1px solid var(--line); }

/* Character services: one focused operation on the current page. */
.service-dialog { box-sizing:border-box; width:min(560px,calc(100vw - 32px)); max-height:calc(100dvh - 32px); overflow:auto; margin:auto; padding:24px; border:1px solid var(--line); border-radius:12px; background:var(--card); color:var(--text); box-shadow:0 24px 90px #0009; }
.service-dialog::backdrop { background:#000a; }
.service-dialog > .card { margin:0; padding:0; border:0; box-shadow:none; max-width:none; }
.service-dialog h1,.service-dialog h2 { margin-top:0; font-size:21px; }
.service-dialog .editrow-form { flex-wrap:wrap; }
.service-dialog .ask-btns { display:flex; flex-wrap:wrap; gap:10px; margin-top:18px; }
.service-dialog .ask-rows { overflow-wrap:anywhere; }
.service-dialog .note { margin:16px 0; }

.card a.system-tile, .card a.system-tile:hover, .card a.system-tile:focus-visible { text-decoration:none; }
.filter-range { display:flex; flex-direction:column; gap:5px; min-width:115px; }
.filter-range input { width:100%; box-sizing:border-box; min-width:0; }
.account-list th.th-sort a { display:inline-flex; align-items:center; gap:5px; color:inherit; text-decoration:none; }
.account-list .column-filters th { vertical-align:top; }
.table-loading { opacity:.65; }
.table-filter-status { font-size:12px; color:var(--dim); }

.account-list .filter-range { min-width:0; }
.account-list th:nth-child(3) { width:17%; }
.account-list th:nth-child(4) { width:18%; }
.account-list th:nth-child(5) { width:15%; }
.account-list th:nth-child(6) { width:16%; }

/* Bulk price selection stays visible outside item icons and admin tools. */
.goods-row > .shop-price-select { position:static; display:flex; align-items:center; align-self:stretch; gap:7px; padding-right:90px; min-height:28px; text-align:left; font-size:12px; cursor:pointer; }
.shop-price-select { display:inline-flex; align-items:center; gap:8px; cursor:pointer; }
.shop-price-select > input[type="checkbox"] { position:static; appearance:auto; width:18px; height:18px; min-width:18px; margin:0; opacity:1; visibility:visible; flex:0 0 18px; accent-color:var(--accent); }
.goods-row:has(.shop-price-pick:checked) { border-color:var(--accent); }

/* Плитки разделов «Системы» — без подчёркивания, где бы ни стояли (сетка лежит вне .card). */
a.system-tile, a.system-tile:hover, a.system-tile:focus-visible, a.system-tile * { text-decoration: none; }

.lg-hide { gap:8px; }
.lg-channel-toggle { position:relative; display:inline-flex; margin:0; cursor:pointer; }
.lg-channel-toggle > input { position:absolute; width:1px; height:1px; min-height:0; margin:0; padding:0; opacity:0; clip-path:inset(50%); }
.lg-channel-button { position:relative; display:grid; place-items:center; width:36px; height:34px; border:1px solid var(--line); border-radius:8px; background:var(--input); color:var(--text); transition:background .15s,opacity .15s; }
.lg-channel-toggle:hover .lg-channel-button { background:var(--hover); border-color:var(--accent); }
.lg-channel-toggle > input:focus-visible + .lg-channel-button { outline:2px solid var(--accent); outline-offset:3px; }
.lg-channel-toggle > input:checked + .lg-channel-button { opacity:.5; }
.lg-channel-toggle > input:checked + .lg-channel-button::after { content:'×'; position:absolute; top:-6px; right:-5px; width:16px; height:16px; line-height:16px; text-align:center; background:var(--bad); color:#fff; border-radius:50%; font-size:13px; font-weight:700; }
.lg-channel-toggle[data-channel-tone="world"] .lg-channel-button { color:var(--chat-world); }
.lg-channel-toggle[data-channel-tone="group"] .lg-channel-button,.lg-channel-toggle[data-channel-tone="team"] .lg-channel-button { color:var(--chat-group); }
.lg-channel-toggle[data-channel-tone="guild"] .lg-channel-button,.lg-channel-toggle[data-channel-tone="alliance"] .lg-channel-button { color:var(--chat-guild); }
.lg-channel-toggle[data-channel-tone="whisper"] .lg-channel-button { color:var(--chat-whisper); }
.lg-channel-toggle[data-channel-tone="trade"] .lg-channel-button,.lg-channel-toggle[data-channel-tone="country"] .lg-channel-button { color:var(--chat-trade); }
.lg-channel-toggle[data-channel-tone="horn"] .lg-channel-button { color:var(--chat-horn); }
.lg-channel-toggle[data-channel-tone="global"] .lg-channel-button { color:var(--chat-global); }
.lg-channel-toggle[data-channel-tone="qpanel"] .lg-channel-button { color:var(--bad); }
.channel-tooltip { position:fixed; z-index:10050; max-width:min(260px,calc(100vw - 16px)); padding:7px 11px; border:1px solid var(--line); border-radius:7px; background:var(--card); color:var(--text); box-shadow:0 6px 24px #0005; font-size:12px; line-height:1.4; overflow-wrap:anywhere; pointer-events:none; }
.chatlog .cl-ch { display:grid; place-items:center; overflow:visible; }
.chatlog .cl-ch:focus-visible { outline:2px solid var(--accent); outline-offset:3px; border-radius:4px; }
.shop-gift-open { display:inline-flex; align-items:center; gap:6px; }
.shop-gift-dialog form { display:grid; gap:14px; }
.shop-gift-dialog .field { margin:0; }
.shop-gift-dialog .field input,.shop-gift-dialog .field select { width:100%; box-sizing:border-box; }
.shop-gift-product { margin:0; font-weight:700; overflow-wrap:anywhere; }
.shop-gift-actions { display:flex; flex-wrap:wrap; gap:10px; }

@media(min-width:761px){.chatlog .cl-who{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:4px;text-align:center}}

.account-list .account-row-actions{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
.account-list .account-row-actions>.btn{display:inline-flex;align-items:center;justify-content:center;flex:none;margin:0;min-height:30px;height:30px;box-sizing:border-box}
.account-list .account-row-actions>.account-preview-trigger{width:30px;padding:4px}

.registration-form .registration-required { font-weight: 700; color: var(--text); }
.registration-form [data-generate-password]:not([hidden]) { margin-bottom: .75rem; }
.registration-form [data-password-status]:not(:empty) { display: block; margin-bottom: .75rem; }
