:root {
    color-scheme: dark;
    --bg: #10110f;
    --ink: #f4f1ea;
    --muted: #a39c90;
    --line: #2a2924;
    --accent: #e7ff4a;
    --on-accent: #10110f;
    --mark: #e7ff4a;
    --danger: #ffb4a8;
    --card: #141512;
    --panel: #181914;
    --hover: #22221c;
    --pick: #2a2924;
    --trade-on: #1b1e12;
    --hint: #8eb6ff;
}

html[data-theme="light"] {
    color-scheme: light;
    --bg: #f6f5f1;
    --ink: #171714;
    --muted: #6d675f;
    --line: #e3dfd4;
    --accent: #4e5b00;
    --on-accent: #f6f5f1;
    --mark: #4e5b00;
    --danger: #b42318;
    --card: #ffffff;
    --panel: #ffffff;
    --hover: #efece4;
    --pick: #e8e4da;
    --trade-on: #d7e4a4;
    --hint: #2457b8;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: Pretendard, "Apple SD Gothic Neo", sans-serif;
    background: var(--bg);
    color: var(--ink);
}

a { color: inherit; }

.top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--line);
}

body:not(:has(.admin-shell)) .top {
    padding-left: max(24px, calc((100% - 1200px) / 2));
    padding-right: max(24px, calc((100% - 1200px) / 2));
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-decoration: none;
}

.logo svg {
    width: 22px;
    height: 22px;
    display: block;
    flex: 0 0 auto;
    color: var(--accent);
}

.logo-t {
    color: var(--accent);
    letter-spacing: 0;
    margin-right: 0.16em;
}

nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

nav a, .who {
    font-size: 14px;
    text-decoration: none;
}

button.install {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border: 0;
    background: var(--accent);
    color: var(--on-accent);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

button.install[hidden] { display: none; }

.menu-panel button.install {
    min-height: 44px;
    font-size: 16px;
}

.who { color: var(--muted); }

.hello {
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.cash {
    color: var(--mark);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

nav form { margin: 0; }

.theme-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--card);
    color: var(--muted);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.theme-knob {
    position: relative;
    box-sizing: border-box;
    width: 36px;
    height: 20px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--bg);
}

.theme-knob::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    transition: transform 160ms ease;
}

html[data-theme="light"] .theme-knob::after { transform: translateX(16px); }

html:not([data-theme="light"]) .theme-switch .is-dark,
html[data-theme="light"] .theme-switch .is-light { color: var(--ink); }

.btn[hidden],
button[hidden] {
    display: none !important;
}

.pill, .btn, button.text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border: 0;
    cursor: pointer;
    font: inherit;
}

.pill, .btn {
    padding: 0 16px;
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 600;
    text-decoration: none;
}

.btn.ghost, button.text {
    background: transparent;
    color: var(--ink);
}

button.text {
    padding: 0;
    font-size: 14px;
}

main {
    flex: 1;
    width: min(1200px, calc(100% - 48px));
    margin: 0 auto;
    padding: 28px 0 40px;
}

.eyebrow, .meta, .switch, label {
    color: var(--muted);
    font-size: 13px;
}

.eyebrow {
    margin: 0;
    letter-spacing: 0.16em;
}

h1 {
    margin: 14px 0 0;
    font-size: clamp(48px, 8vw, 84px);
    font-weight: 600;
    letter-spacing: -0.045em;
    line-height: 0.95;
}

.lead {
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.5;
}

.meta { margin: 8px 0 0; }

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.auth { width: min(420px, 100%); }

body:not(:has(.admin-shell)) .auth {
    margin-left: auto;
    margin-right: auto;
}

.auth h1 { font-size: clamp(36px, 6vw, 48px); }

form { margin-top: 8px; }

label { display: block; margin: 18px 0 8px; }

input {
    width: 100%;
    min-height: 48px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 16px;
}

.phone-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.phone-row input { flex: 1; min-width: 0; width: auto; }

.phone-row button {
    flex: 0 0 auto;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.phone-row button:disabled {
    opacity: 0.45;
    cursor: default;
}

.sms-note { margin: 8px 0 0; color: var(--muted); font-size: 14px; }

.sms-note.bad { color: var(--danger); }

input:focus, select:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

select {
    width: 100%;
    min-height: 48px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 16px;
}

button.btn { width: 100%; margin-top: 22px; }

.error {
    margin: 18px 0 0;
    color: var(--danger);
}

.auth > a.btn { width: 100%; margin-top: 16px; border: 1px solid var(--line); }

.auth-links {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin: 16px 0 0;
    font-size: 14px;
    font-weight: 700;
}

.auth-links a { color: var(--ink); }

.show-password {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    font-size: 14px;
    font-weight: 700;
}

.show-password input {
    width: 18px;
    min-height: 18px;
    margin: 0;
    padding: 0;
}

.switch { margin: 20px 0 0; font-size: 14px; }

.switch a { color: var(--ink); }

.admin-shell {
    display: flex;
    flex: 1;
}

.side {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 220px;
    flex: none;
    padding: 24px 18px;
    border-right: 1px solid var(--line);
}

.side-label {
    margin: 22px 0 4px;
    color: var(--muted);
    font-size: 13px;
}

.side-link {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 12px;
    background: transparent;
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
}

.side-link.active {
    background: var(--accent);
    color: var(--on-accent);
}

.menu-dot {
    width: 8px;
    height: 8px;
    margin-left: 8px;
    border-radius: 50%;
    background: #e23d3d;
    flex: none;
}

.side form { margin-top: auto; }

.admin-main {
    flex: 1;
    min-width: 0;
    padding: 36px 28px 64px;
}

.admin-main h1 { font-size: clamp(32px, 5vw, 42px); }

.members-head .lead { margin-top: 10px; }

.member-back {
    display: inline-flex;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 14px;
    text-decoration: none;
}

.member-back:hover { color: var(--ink); }

.member-info {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 14px 20px;
    margin-top: 28px;
    max-width: 480px;
}

.member-info dt {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.member-info dd { margin: 0; font-weight: 600; }

form.grant { margin-top: 32px; }

.grant-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.grant-row input { flex: 1; min-width: 0; width: auto; }

.grant-row button.btn {
    flex: 0 0 auto;
    width: auto;
    margin-top: 0;
    padding: 0 28px;
}

.grant-log { margin-top: 40px; }

.grant-log h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
}

.revenue-month {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
}

.revenue-month input { width: 180px; }

.revenue-month button.btn {
    width: auto;
    margin-top: 0;
    padding: 0 22px;
}

.revenue-month a {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.revenue-month a:hover { color: var(--ink); }

.grant-log .table-wrap { margin-top: 14px; }

td .member-link {
    color: var(--mark);
    font-weight: 600;
    text-decoration: none;
}

.table-wrap { overflow-x: auto; margin-top: 28px; }

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: nowrap;
}

th {
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
}

.empty { color: var(--muted); white-space: normal; }

.me {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-left: auto;
    color: var(--ink);
    text-decoration: none;
}

.me svg { width: 26px; height: 26px; }

.menu-open {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-left: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
}

.menu-open svg { width: 26px; height: 26px; }

.menu-layer {
    position: fixed;
    inset: 0;
    z-index: 40;
    visibility: hidden;
    pointer-events: none;
}

.menu-layer.is-open {
    visibility: visible;
    pointer-events: auto;
}

.menu-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.55);
    cursor: pointer;
}

.menu-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    width: min(300px, 86vw);
    padding: 28px 22px;
    border-left: 1px solid var(--line);
    background: var(--bg);
    overflow: auto;
    transform: translateX(100%);
    transition: transform 0.2s ease;
}

.menu-layer.is-open .menu-panel { transform: translateX(0); }

.menu-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.menu-panel .hello {
    margin: 0;
    font-size: 18px;
    line-height: 1.4;
    white-space: normal;
}

.menu-close {
    flex: none;
    width: 40px;
    height: 40px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.menu-link {
    display: flex;
    align-items: center;
    min-height: 44px;
    color: var(--ink);
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
}

.menu-link.active { color: var(--mark); }

.menu-nav {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.menu-sell {
    width: 100%;
    min-height: 44px;
    margin: 0;
}

body.menu-lock { overflow: hidden; }

.notify-setting {
    margin-top: 36px;
}

.notify-setting h2 {
    margin: 0;
    font-size: 22px;
}

.notify-setting p {
    margin: 8px 0 0;
    color: var(--muted);
}

.notify-setting .btn {
    width: auto;
    min-width: 160px;
    margin-top: 16px;
}

form.logout { margin-top: 28px; }

form.logout .text {
    width: 100%;
    color: var(--muted);
}

.notice { margin: 18px 0 0; color: var(--mark); }

.trade-alerts {
    position: fixed;
    z-index: 45;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(420px, calc(100% - 32px));
}

.trade-alert {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: center;
    padding: 14px 12px 14px 16px;
    border: 1px solid var(--line);
    background: var(--card);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
    animation: trade-alert-in 0.25s ease;
}

.trade-alert strong {
    display: block;
    font-size: 15px;
}

.trade-alert p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.trade-alert a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 12px;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.trade-alert button {
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 20px;
    cursor: pointer;
}

.trade-alert button:hover { color: var(--ink); }

@keyframes trade-alert-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

.notify-modal {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.62);
}

.notify-modal[hidden] { display: none; }

.notify-card {
    width: min(420px, 100%);
    padding: 28px 24px;
    border: 1px solid var(--line);
    background: var(--bg);
}

.notify-card h2 {
    margin: 0;
    font-size: 28px;
    letter-spacing: -0.03em;
}

.notify-card p {
    margin: 14px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.notify-note:empty { display: none; }

.notify-card p.notify-note {
    color: var(--mark);
    font-weight: 700;
}

.notify-actions {
    display: flex;
    gap: 12px;
    margin-top: 22px;
}

.notify-switch {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    min-height: 44px;
    color: var(--ink);
    font-weight: 700;
    cursor: pointer;
}

.notify-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    border: 0;
}

.notify-knob {
    position: relative;
    box-sizing: border-box;
    width: 52px;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--bg);
    flex: none;
}

.notify-knob::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--muted);
    transition: transform 160ms ease, background 160ms ease;
}

.notify-switch input:checked + .notify-knob {
    background: var(--accent);
    border-color: var(--accent);
}

.notify-switch input:checked + .notify-knob::after {
    transform: translateX(20px);
    background: #fff;
}

.notify-switch input:focus-visible + .notify-knob {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.notify-switch input:disabled + .notify-knob {
    opacity: 0.6;
}

.notify-actions button {
    flex: 1;
    min-height: 48px;
    border: 0;
    background: var(--accent);
    color: var(--on-accent);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.notify-actions .ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line);
}

.install-modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.62);
}

.install-modal[hidden] { display: none; }

.install-card {
    width: min(420px, 100%);
    padding: 28px 24px;
    border: 1px solid var(--line);
    background: var(--bg);
}

.install-card h2 {
    margin: 0;
    font-size: 28px;
    letter-spacing: -0.03em;
}

.install-card p {
    margin: 14px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.install-actions {
    display: flex;
    gap: 12px;
    margin-top: 22px;
}

.install-actions button {
    flex: 1;
    min-height: 48px;
    border: 0;
    background: var(--accent);
    color: var(--on-accent);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.install-actions .ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line);
}

.search, .add-row {
    display: flex;
    align-items: end;
    gap: 8px;
}

.search { margin-bottom: 8px; }

.results { margin-top: 24px; }

.search-count {
    margin: 12px 0 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.search-count strong {
    color: var(--ink);
    font-weight: 800;
}

.search-count + .server-tabs { margin-top: 0; }

.search-wrap { position: relative; }

.search-wrap.open {
    background: #fff;
    color: #1c1c1c;
    border-radius: 18px;
    padding: 14px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.search-wrap.open label { color: #6f6f6f; }

.search-wrap.open input {
    background: #fff;
    color: #1c1c1c;
    border-color: #e4e4e4;
    border-radius: 12px;
}

.search-wrap.open input:focus { outline-color: #1c1c1c; }

.search-wrap.open .search { margin: 0; }

.search-wrap.open .btn { border-radius: 12px; }

.search-side {
    display: flex;
    flex: none;
    align-self: end;
    min-height: 48px;
    border: 1px solid var(--line);
}

.search-side label {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0 16px;
    min-height: 48px;
    cursor: pointer;
    font-weight: 700;
}

.search-side input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.search-side label:has(input:checked) {
    background: var(--accent);
    color: var(--on-accent);
}

.search-side label:has(input:focus-visible) {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.search-wrap.open .search-side { border-color: #d4d4d4; }

.search-wrap.open .search-side label { color: #1c1c1c; }

.search-wrap.open .search-side label:has(input:checked) {
    background: var(--accent);
    color: var(--on-accent);
}

.search-field { position: relative; flex: 1; min-width: 0; }

.search-field label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.search-box { position: relative; }

.search-box input { padding-right: 40px; }

.search-clear {
    position: absolute;
    top: 0;
    right: 4px;
    width: 36px;
    height: 48px;
    border: 0;
    background: transparent;
    color: #8a8a8a;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.suggest { padding: 8px 2px 2px; }

.suggest-label {
    margin: 14px 4px 6px;
    color: #8a8a8a;
    font-size: 13px;
    font-weight: 600;
}

.suggest-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
    margin: 0;
    padding: 0;
    list-style: none;
    max-height: 320px;
    overflow: auto;
}

.suggest-list.stack { grid-template-columns: 1fr; }

.recent-item {
    display: flex;
    align-items: center;
}

.suggest-list .recent-item .suggest-pick { flex: 1; width: auto; }

.suggest-list .recent-remove {
    width: 36px;
    min-height: 36px;
    margin-left: auto;
    padding: 0;
    color: #8a8a8a;
    font-size: 18px;
}

.suggest-list .recent-remove:hover { background: transparent; color: #1c1c1c; }

.suggest-list button {
    display: flex;
    align-items: baseline;
    gap: 8px;
    width: 100%;
    min-height: 40px;
    padding: 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #1c1c1c;
    font: inherit;
    font-size: 15px;
    text-align: left;
    cursor: pointer;
}

.suggest-list button[aria-selected="true"],
.suggest-list button:hover { background: #f3f3f3; }

.suggest-name { font-weight: 600; }

.suggest-server { color: #8a8a8a; font-size: 13px; }

.suggest-empty {
    margin: 8px 4px 4px;
    color: #8a8a8a;
    font-size: 14px;
}

.suggest-empty a {
    margin-left: 4px;
    color: #1c1c1c;
    font-weight: 700;
    text-decoration: underline;
}

.search .btn, .search a.sell, .add-row .btn {
    width: auto;
    margin: 0;
    min-width: 96px;
}

.search a.sell {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line);
}

.search-wrap.open a.sell {
    color: #1c1c1c;
    border-color: #d4d4d4;
    border-radius: 12px;
}

.game-list { display: grid; gap: 8px; margin-top: 28px; }

.game-card {
    border-top: 1px solid var(--line);
    padding-top: 16px;
}

.game-card h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.card-head, .manage-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-head form, .manage-list form, .manage-list { margin: 0; }

.game-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.game-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border: 1px solid var(--line);
}

.game-edit {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 8px;
    margin-top: 12px;
}

.game-edit .search-field { flex: 1 1 180px; }

.game-edit label { margin: 0 0 8px; }

.game-edit .btn { width: auto; min-width: 88px; }

.manage-list {
    list-style: none;
    padding: 0;
    margin-top: 12px;
}

.manage-list li {
    min-height: 44px;
    border-bottom: 1px solid var(--line);
}

.manage-list li.dragging { opacity: 0.45; }

.server-name { flex: 1; }

.drag-handle {
    width: 36px;
    min-height: 44px;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: grab;
    touch-action: none;
    font: inherit;
    font-size: 16px;
    letter-spacing: -0.12em;
}

.order-status {
    min-height: 1.4em;
    margin: 12px 0 0;
    color: var(--danger);
    font-size: 14px;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}

.chips li {
    border: 1px solid var(--line);
    padding: 6px 10px;
    font-size: 14px;
}

button.tiny {
    min-height: 36px;
    padding: 0 8px;
    border: 0;
    background: transparent;
    color: var(--danger);
    cursor: pointer;
    font: inherit;
    font-size: 14px;
}

.auth { margin-top: 8px; }

.site-foot {
    border-top: 1px solid var(--line);
    padding: 28px 24px 40px;
}

body:not(:has(.admin-shell)) .site-foot {
    padding-left: max(24px, calc((100% - 1200px) / 2));
    padding-right: max(24px, calc((100% - 1200px) / 2));
}

.site-foot-inner {
    width: min(1200px, 100%);
    margin: 0 auto;
}

body:not(:has(.admin-shell)) .site-foot-inner {
    width: auto;
    margin: 0;
}

.site-foot-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px 16px;
    margin: 0 0 22px;
}

.site-foot .theme-switch { flex: none; margin-left: auto; }

.site-foot-links {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 0;
    min-width: 0;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.site-foot-links a {
    color: var(--ink);
    text-decoration: none;
}

.site-foot-links a:hover { text-decoration: underline; }

.site-foot-links span { margin: 0 8px; }

.site-foot-label {
    margin: 0;
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.12em;
}

.site-foot-biz {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.75;
}

.site-foot-biz p { margin: 0; }

.site-foot-biz-name {
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
}

.site-foot-biz-line {
    display: flex;
    flex-wrap: wrap;
    column-gap: 16px;
    row-gap: 2px;
}

.site-foot-biz-line span { overflow-wrap: anywhere; }

.site-foot-note,
.site-foot-copy {
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
}

.site-foot-copy {
    margin-top: 8px;
    letter-spacing: 0.04em;
}

.auth.settings { width: min(760px, 100%); }

.auth.guest-support {
    position: relative;
    width: min(560px, 100%);
}

.hp-field {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.guest-captcha { margin-top: 18px; }

.auth.settings textarea,
.auth.guest-support textarea {
    width: 100%;
    min-height: 180px;
    padding: 12px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 15px;
    line-height: 1.6;
    resize: vertical;
}

.legal-body {
    margin-top: 28px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.75;
    font-size: 15px;
}

.guide h1 {
    margin: 0;
    font-size: 40px;
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1.15;
}

.guide-intro {
    margin: 18px 0 0;
    max-width: 680px;
    color: var(--ink);
    font-size: 15px;
    line-height: 1.75;
}

.guide-jump {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
}

.guide-jump a {
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink);
    font-size: 14px;
    line-height: 34px;
    text-decoration: none;
}

.guide-jump a:hover { background: var(--hover); }

.guide-section {
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}

.guide-section h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 650;
    letter-spacing: -0.03em;
}

.guide-section ol {
    margin: 16px 0 0;
    padding-left: 1.3em;
}

.guide-section li {
    margin: 0 0 14px;
    line-height: 1.7;
}

.guide-section li strong { font-weight: 650; }

@media (max-width: 640px) {
    .search, .add-row { flex-direction: column; align-items: stretch; }
    .search-side { width: 100%; }
    .search-side label { flex: 1; }
    .search .btn, .search a.sell, .add-row .btn { width: 100%; }
    .suggest-list { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
    .top nav.has-menu > .hello,
    .top nav.has-menu > .me { display: none; }

    .top nav.has-menu .menu-open { display: inline-flex; }

    .admin-shell {
        flex-direction: column;
        width: 100%;
        min-width: 0;
    }

    .side {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        flex: none;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: 4px;
        padding: 8px 16px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
    }

    .side::-webkit-scrollbar { display: none; }

    .side-label,
    .side-link,
    .side form {
        flex: none;
        margin: 0;
        white-space: nowrap;
    }

    .admin-main { padding: 24px 16px 48px; }
}

.side .theme-switch { align-self: flex-start; }

@media (max-width: 640px) {
    .top { padding: 14px 16px; gap: 10px; }
    body:not(:has(.admin-shell)) .top { padding: 14px 16px; }
    body:not(:has(.admin-shell)) .site-foot { padding-left: 16px; padding-right: 16px; }
    nav { gap: 8px; flex-shrink: 0; }
    nav a, .pill { white-space: nowrap; }
    .side .theme-switch { min-height: 32px; padding: 0 4px; gap: 0; }
    .side .theme-switch .theme-label { display: none; }
    .top .hello { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; }

    main {
        width: calc(100% - 32px);
        padding-top: 16px;
    }

    .guide h1 { font-size: 32px; }
    .actions .btn { flex: 1 1 140px; }

    .sell-row, .cat-panel { grid-template-columns: 1fr; }

    .cat-tabs {
        flex-direction: row;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
}

.sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.sell-intro { margin-bottom: 28px; }

.sell-kicker {
    margin: 0 0 8px;
    color: var(--mark);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
}

.sell h1 {
    margin: 0;
    font-size: 40px;
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1.15;
}

.sell-intro p:last-child {
    max-width: 36em;
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.5;
}

.sell-card {
    display: grid;
    gap: 22px;
    margin-top: 16px;
    padding: 22px;
    border: 1px solid var(--line);
    background: var(--card);
}

.sell-card h2 {
    margin: 0;
    color: var(--mark);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.sell-card.is-hidden { display: none; }

.sell-field select { width: min(360px, 100%); }

.account-facts { margin: 14px 0 0; }

.account-facts div {
    display: flex;
    gap: 12px;
    margin-top: 6px;
}

.account-facts dt {
    min-width: 88px;
    color: var(--muted);
}

.account-facts dd { margin: 0; }

.sell-row {
    display: grid;
    gap: 8px;
}

.sell-label,
.sell-label label {
    padding: 0;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
}

.sell-field { padding: 0; }

.sell label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: var(--ink);
}

.sell input[type="radio"],
.sell input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-height: 0;
    margin: 0;
    accent-color: var(--accent);
}

.radios { display: flex; gap: 18px; align-items: center; }

.trade-choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.sell .trade-choice {
    position: relative;
    display: grid;
    gap: 6px;
    align-content: start;
    min-height: 96px;
    margin: 0;
    padding: 16px;
    border: 1px solid var(--line);
    background: transparent;
    cursor: pointer;
}

.sell .trade-choice strong {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.sell .trade-choice span {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.sell .trade-choice input {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 0;
    margin: 0;
    opacity: 0;
}

.sell .trade-choice:has(input:checked) {
    border-color: var(--accent);
    background: var(--trade-on);
}

.sell .trade-choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.promo-lead { margin: -8px 0 0; }

.promo-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.sell .promo-pick {
    position: relative;
    display: grid;
    align-content: start;
    gap: 8px;
    min-height: 100%;
    margin: 0;
    padding: 16px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
}

.sell label.promo-pick { cursor: pointer; }

.sell .promo-pick > input[type="checkbox"] {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 0;
    margin: 0;
    opacity: 0;
}

.sell .promo-pick:has(input[type="checkbox"]:checked),
.sell .promo-pick:has(.promo-option input[data-price]:checked) {
    border-color: var(--accent);
    background: var(--trade-on);
}

.sell .promo-pick:has(input:focus-visible) {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.promo-price {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 12px;
    font-weight: 800;
}

.promo-price.is-idle {
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
}

.sell .promo-pick strong {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.promo-copy {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.promo-options {
    display: grid;
    gap: 6px;
    margin-top: 6px;
}

.sell .promo-option {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 8px 10px;
    border: 1px solid var(--line);
    background: var(--card);
    cursor: pointer;
}

.sell .promo-option span { flex: 1; font-size: 13px; }

.sell .promo-option b {
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
}

.sell .promo-option:has(input[data-price]:checked) {
    border-color: var(--accent);
    background: var(--bg);
}

.sell .promo-option input {
    width: 16px;
    height: 16px;
    min-height: 0;
    margin: 0;
}

.promo-total {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.04em;
    text-align: right;
}

@media (max-width: 900px) {
    .promo-grid { grid-template-columns: 1fr; }
}

.unit-field, .inline-field {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.unit-field input { width: min(220px, 100%); }

.split-field input { width: min(140px, 100%); }

.inline-field input { flex: 1; min-width: 160px; }

.unit-field span, .aside { color: var(--muted); font-size: 14px; }

.hint, .warn, .save-status {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.5;
}

.hint { color: var(--hint); }

.fee-note { margin: 10px 0 0; color: var(--ink); font-size: 14px; line-height: 1.5; }

.fee-note[hidden] { display: none !important; }

.warn { color: var(--danger); }

.save-status { min-height: 1.2em; color: var(--mark); }

.sell .mini {
    width: auto;
    min-height: 40px;
    margin: 0;
    padding: 0 14px;
    border: 0;
    background: var(--accent);
    color: var(--on-accent);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.sell .mini.ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line);
}

.cat-box { border: 0; }

.cat-search {
    display: flex;
    align-items: center;
    border: 1px solid var(--line);
    background: var(--bg);
}

.cat-search:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }

.cat-search input {
    flex: 1;
    width: auto;
    min-width: 0;
    border: 0;
}

.cat-search input:focus { outline: none; }

.cat-clear, .cat-star {
    width: 40px;
    min-height: 44px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 18px;
    cursor: pointer;
}

.cat-star[aria-pressed="true"] { color: var(--mark); }

.cat-panel {
    display: grid;
    grid-template-columns: 168px minmax(0, 1fr);
    min-height: 148px;
}

.cat-tabs {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--line);
    background: var(--panel);
}

.cat-tabs button {
    flex: 1;
    min-height: 48px;
    padding: 10px 12px;
    border: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
}

.cat-tabs button.on { background: var(--accent); color: var(--on-accent); font-weight: 700; }

.cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 220px;
    overflow: auto;
}

.cat-list li {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--line);
}

.cat-list .pick {
    flex: 1;
    min-height: 40px;
    padding: 8px 12px;
    border: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.cat-list .pick:hover { background: var(--hover); }

.cat-list .remove {
    width: 36px;
    min-height: 40px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 18px;
    cursor: pointer;
}

.cat-empty { margin: 12px; color: var(--muted); font-size: 14px; }

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
    padding: 0;
    border: 0;
}

.toolbar button {
    min-width: 36px;
    min-height: 36px;
    padding: 0 8px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    font: inherit;
    cursor: pointer;
}

.toolbar button:hover { background: var(--hover); }

.editor {
    min-height: 180px;
    padding: 16px;
    border: 1px solid var(--line);
    background: var(--bg);
    font-size: 16px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.editor:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.editor.align-center { text-align: center; }

.editor.align-right { text-align: right; }

.sell-actions { display: flex; padding-top: 16px; }

.sell-actions .btn { width: 100%; min-height: 56px; margin: 0; font-size: 16px; }

.sales { list-style: none; margin: 22px 0 0; padding: 0; overflow-x: auto; }

.sales li {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 720px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
}

.sale-main {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

a.sale-main {
    color: inherit;
    text-decoration: none;
}

.sales li.is-trade { cursor: pointer; }

.sale-main strong {
    flex: 1.4 1 140px;
    min-width: 0;
    overflow: hidden;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sales span {
    flex: 1 1 120px;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sales .sale-price {
    flex: 0 0 auto;
    color: var(--ink);
    font-weight: 700;
}

.sales .sale-status {
    flex: 0 0 auto;
    min-width: 58px;
    padding: 3px 8px;
    border: 1px solid var(--line);
    background: var(--pick);
    color: var(--mark);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.sales .sale-status.is-done {
    background: transparent;
    color: var(--muted);
}

.sale-actions {
    display: flex;
    flex: none;
    gap: 8px;
    margin: 0;
}

.sale-actions form { margin: 0; }

.sale-actions a,
.sale-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
}

.sale-actions a {
    background: var(--accent);
    border-color: transparent;
    color: var(--on-accent);
    font-weight: 600;
}

.history-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.history-filters button {
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    font: inherit;
    cursor: pointer;
}

.history-filters button.on {
    background: var(--accent);
    color: var(--on-accent);
    border-color: var(--accent);
    font-weight: 700;
}

.history-empty { margin: 18px 0 0; color: var(--muted); }

.sales li[hidden],
.history-empty[hidden] { display: none !important; }

.search-panel {
    margin-top: 4px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--card);
}

.result-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.result-tabs a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
}

.result-tabs a.on {
    background: var(--accent);
    color: var(--on-accent);
    border-color: var(--accent);
}

.cash-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: min(420px, 100%);
    margin: 18px 0 0;
}

.cash-tabs a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
}

.cash-tabs a.on {
    background: var(--accent);
    color: var(--on-accent);
    border-color: var(--accent);
}

.search-panel .search-count { margin: 14px 0 0; }

.server-fold { margin-top: 12px; }

.server-fold-summary,
.filter-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--ink);
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.server-fold-summary {
    justify-content: flex-end;
    width: 100%;
    min-height: 28px;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--muted);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
}

.server-fold-summary::-webkit-details-marker,
.filter-bar::-webkit-details-marker { display: none; }

.server-fold:not(.is-open) .server-tabs {
    max-height: 36px;
    overflow: hidden;
}

.filter-fold:not([open]) > .search-filters { display: none; }

.server-fold.is-open .fold-closed,
.filter-fold .fold-closed { display: none; }

.server-fold:not(.is-open) .fold-open,
.filter-fold:not([open]) .fold-open { display: none; }

.server-fold:not(.is-open) .fold-closed,
.filter-fold:not([open]) .fold-closed { display: inline; }

.fold-chevron {
    width: 7px;
    height: 7px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
}

.server-fold.is-open .fold-chevron,
details[open] > summary .fold-chevron { transform: translateY(2px) rotate(225deg); }

.server-tabs,
.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.server-tabs { margin-top: 8px; }

.server-tabs a,
.filter-tabs a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink);
    text-decoration: none;
}

.server-tabs a.on,
.filter-tabs a.on {
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    color: var(--accent);
    border-color: var(--accent);
    font-weight: 700;
}

.filter-tabs a.chip-lead { min-width: 112px; }

.filter-dock {
    position: relative;
    margin-top: 14px;
}

.filter-fold {
    display: flex;
    flex-direction: column;
}

.filter-fold > .filter-bar { order: 2; }

.filter-fold > .search-filters { order: 1; }

.filter-bar {
    justify-content: center;
    min-height: 46px;
    border-top: 1px solid var(--line);
    font-size: 14px;
}

.search-filters {
    display: grid;
    gap: 10px;
    padding: 4px 0 14px;
}

.filter-reset {
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 46px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.filter-reset:hover { color: var(--ink); }

.products {
    display: grid;
    gap: 8px;
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
}

.products li { margin: 0; }

.products li:has(a.is-pinned) + li:not(:has(a.is-pinned)) {
    margin-top: 6px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.products a.product {
    display: grid;
    gap: 6px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    background: var(--card);
    color: inherit;
    text-decoration: none;
}

.products a.product:hover { border-color: color-mix(in srgb, var(--ink) 24%, var(--line)); }

.products a.product.is-highlight {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 16%, var(--card));
}

.products a.product.is-highlight:hover {
    background: color-mix(in srgb, var(--accent) 24%, var(--card));
}

.products a.product.is-pinned {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--on-accent);
}

.products a.product.is-pinned:hover {
    background: color-mix(in srgb, var(--on-accent) 10%, var(--accent));
}

.product-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 8px;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 12px;
    font-weight: 800;
}

.product-state {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 8px;
    border: 1px solid var(--line);
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
}

.product-head .product-when { margin-left: auto; }

.cash-list {
    display: grid;
    gap: 8px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.cash-list li {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 12px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    background: var(--card);
}

.cash-list time,
.cash-list strong,
.cash-listing { grid-column: 1; }

.cash-list time {
    color: var(--muted);
    font-size: 13px;
}

.cash-list strong { font-size: 16px; }

.cash-listing {
    color: var(--muted);
    font-size: 13px;
}

.cash-spent {
    grid-column: 2;
    grid-row: 1 / -1;
    align-self: center;
    color: var(--danger);
    font-size: 16px;
    font-weight: 800;
}

.run-list {
    display: grid;
    gap: 8px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.run-list li {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.run-list a {
    display: grid;
    flex: 1;
    min-width: 0;
    grid-template-columns: 1fr auto;
    gap: 4px 12px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    background: var(--card);
    color: inherit;
    text-decoration: none;
}

.run-list form,
.run-delete {
    display: flex;
    margin: 0;
}

.run-list button,
.run-delete button {
    min-width: 72px;
    padding: 0 14px;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--danger);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.run-delete { margin-top: 16px; }

.run-delete button { min-height: 40px; }

.run-list button:disabled,
.run-delete button:disabled {
    color: var(--muted);
    opacity: 0.45;
    cursor: default;
}

.run-list strong { font-size: 16px; }

.run-list span {
    color: var(--muted);
    font-size: 13px;
}

.run-list b {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    font-size: 13px;
}

.run-wait { color: var(--muted); font-weight: 700; }

.run-done { color: var(--mark); font-weight: 800; }

.product-head,
.product-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.product-head { justify-content: flex-start; }

.product-kind {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 8px;
    background: var(--pick);
    color: var(--mark);
    font-size: 12px;
    font-weight: 700;
}

.product-when,
.product-where,
.product-who,
.product-deal,
.product-note {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.product-copy { min-width: 0; }

.products h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.25;
}

.products .product-kind,
.products .product-badge,
.products .product-state {
    min-height: 22px;
    font-size: 11px;
}

.products .product-when,
.products .product-where,
.products .product-deal {
    font-size: 12px;
}

.products .product-where { margin-top: 2px; }

.products .product-deal { margin-top: 1px; }

.products .product-offer strong { font-size: 18px; }

.product-where { margin-top: 6px; color: var(--ink); }

.products a.product.is-pinned h2,
.products a.product.is-pinned .product-offer strong,
.products a.product.is-pinned .product-where {
    color: var(--on-accent);
}

.products a.product.is-pinned .product-when,
.products a.product.is-pinned .product-deal,
.products a.product.is-pinned .product-who,
.products a.product.is-pinned .product-note {
    color: color-mix(in srgb, var(--on-accent) 68%, transparent);
}

.products a.product.is-pinned .product-kind,
.products a.product.is-pinned .product-badge {
    background: var(--on-accent);
    color: var(--accent);
}

.product-who,
.product-deal { margin-top: 4px; }

.product-offer {
    flex: none;
    margin: 0;
    text-align: right;
}

.product-offer strong {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1;
}

.detail {
    display: grid;
    gap: 10px;
    width: min(720px, 100%);
}

.detail:has(.trade-status) {
    width: 100%;
}

.trade-brief { display: grid; gap: 8px; }

.trade-brief-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.detail .trade-brief-top h1 {
    flex: 1 1 160px;
    min-width: 0;
    margin: 0;
    font-size: 22px;
    line-height: 1.25;
}

.trade-brief-price {
    flex: none;
    margin-left: auto;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1;
}

.trade-people {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 0;
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
}

.trade-people span + span::before {
    content: "·";
    margin: 0 8px;
    color: var(--muted);
    font-weight: 500;
}

.trade-people .is-focus {
    color: var(--mark);
    font-weight: 800;
}

.trade-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 4px 0 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}

.trade-facts > div {
    display: grid;
    grid-template-columns: 5.8em minmax(0, 1fr);
    gap: 6px;
    align-items: center;
    min-width: 0;
    padding: 6px 10px;
    border-top: 1px solid var(--line);
}

.trade-facts > div:nth-child(-n + 2) { border-top: 0; }

.trade-facts > div:nth-child(odd) { border-right: 1px solid var(--line); }

.trade-facts > div:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    border-right: 0;
}

.trade-facts dt,
.trade-facts dd {
    margin: 0;
    min-width: 0;
}

.trade-facts dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.trade-facts dd {
    overflow-wrap: anywhere;
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
}

.trade-facts > div.is-focus {
    background: color-mix(in srgb, var(--accent) 18%, transparent);
}

.trade-facts > div.is-focus dt,
.trade-facts > div.is-focus dd {
    color: var(--mark);
}

.trade-facts > div.is-focus dd {
    font-size: 14px;
    font-weight: 800;
}

@media (max-width: 640px) {
    .trade-facts { grid-template-columns: 1fr; }
    .trade-facts > div { border-right: 0; }
    .trade-facts > div:nth-child(2) { border-top: 1px solid var(--line); }
}

.detail .trade-body {
    margin-top: 0;
    padding: 10px 12px;
}

.detail h1 {
    margin: 4px 0 0;
    font-size: clamp(32px, 5vw, 48px);
    letter-spacing: -0.04em;
    line-height: 1.15;
}

.detail-price { margin: 8px 0 0; }

.detail-price strong {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.045em;
}

.detail-body {
    margin-top: 8px;
    padding: 18px;
    border: 1px solid var(--line);
    background: var(--card);
    white-space: pre-wrap;
    line-height: 1.65;
}

.detail .btn,
.detail button.btn {
    width: min(320px, 100%);
    margin-top: 12px;
}

.detail:has(.trade-status) .btn,
.detail:has(.trade-status) button.btn {
    width: 100%;
}

.detail:has(.trade-status) button.btn.is-commit {
    min-height: 56px;
    padding: 14px 18px;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.35;
    white-space: normal;
    text-align: center;
}

.detail:has(.trade-status) button.btn.is-waiting {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--line);
    font-weight: 700;
}

.buy-cash {
    margin: 18px 0 4px;
    font-size: 15px;
    font-weight: 700;
}

.buy-cash strong { color: var(--mark); }

.buy-short {
    margin: 12px 0 0;
    color: var(--danger);
    font-size: 15px;
    font-weight: 800;
}

.detail a.buy-charge { margin-top: 8px; }

.buy-form label { margin: 4px 0 8px; }

.buy-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.buy-row input {
    flex: 1;
    min-width: 0;
    width: auto;
}

.detail .buy-row .btn {
    width: auto;
    min-width: 140px;
    margin-top: 0;
}

.handoff-card {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border: 2px solid var(--accent);
    background: color-mix(in srgb, var(--accent) 16%, transparent);
}

.handoff-label {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.handoff-card .handoff-next { margin-top: 10px; }

.handoff-card strong {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.2;
    color: var(--mark);
}

.handoff-note {
    margin: 6px 0 0;
    font-size: 15px;
    font-weight: 700;
}

.contact-card {
    gap: 2px;
    padding: 8px 12px;
    border-width: 1px;
}

.contact-card .handoff-label {
    font-size: 12px;
}

.contact-card strong {
    font-size: 16px;
    letter-spacing: 0.02em;
}

.contact-card .handoff-note {
    margin-top: 2px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.45;
}

@media (max-width: 640px) {
    .buy-row { flex-direction: column; align-items: stretch; }
    .detail .buy-row .btn { width: 100%; }
}

.detail .btn.ghost {
    border: 1px solid var(--line);
}

.trade-status {
    margin: 0;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel);
    color: var(--ink);
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.trade-status.is-trading,
.trade-status.is-done {
    border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    color: var(--mark);
}

.trade-done,
.trade-state { margin: 8px 0 0; }

.trade-hint {
    margin: 8px 0 0;
    color: var(--ink);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.55;
}

.trade-done {
    color: var(--mark);
    font-weight: 700;
}

.trade-bang,
.trade-hint .trade-bang {
    display: block;
    margin: 0 0 12px;
    padding: 16px 14px;
    border-radius: 12px;
    background: var(--ink);
    color: var(--bg);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.25;
    text-align: center;
}

.trade-state { color: var(--muted); }

.trade-wait[hidden],
#receive-form[hidden],
.trade-lock[hidden],
#transfer-note[hidden],
#cancel-form[hidden],
#buyer-wait[hidden] { display: none !important; }

.trade-dock[hidden] { display: none !important; }

@media (max-width: 640px) {
    button.trade-dock {
        position: fixed;
        z-index: 35;
        left: 0;
        right: 0;
        bottom: 0;
        box-sizing: border-box;
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        border-radius: 0;
        background: var(--accent);
        color: var(--on-accent);
        font-weight: 800;
        box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.28);
    }

    button.trade-dock.is-waiting {
        background: var(--bg);
        color: var(--muted);
        border-top: 1px solid var(--line);
        font-weight: 700;
    }

    body.has-trade-dock { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
}

.btn.is-waiting {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn.is-waiting::before,
.wait-spin {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: wait-spin 0.7s linear infinite;
}

@keyframes wait-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .btn.is-waiting::before,
    .wait-spin { animation: none; border-right-color: currentColor; }
}

.trade-lock {
    margin: 14px 0 0;
    padding: 16px 18px;
    border: 2px solid var(--danger);
    background: color-mix(in srgb, var(--danger) 18%, var(--card));
    color: var(--danger);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.55;
}

.trade-chat {
    --room: #1b2830;
    --room-bar: #10110f;
    --bubble-in: #3a3a3c;
    --bubble-in-text: #f4f1ea;
    --bubble-out: #fee500;
    --bubble-out-text: #191919;
    --chat-time: rgba(255, 255, 255, 0.62);
    --chat-name: rgba(255, 255, 255, 0.78);
    --chat-input: #2a2a2a;
    --chat-line: rgba(255, 255, 255, 0.08);
    --chat-empty: rgba(255, 255, 255, 0.62);
    display: flex;
    flex-direction: column;
    margin-top: 28px;
    overflow: hidden;
    border: 1px solid var(--chat-line);
    border-radius: 18px;
    background: var(--room-bar);
}

html[data-theme="light"] .trade-chat {
    --room: #b2c7d9;
    --room-bar: #ffffff;
    --bubble-in: #ffffff;
    --bubble-in-text: #191919;
    --bubble-out: #c49b00;
    --bubble-out-text: #191919;
    --chat-time: rgba(0, 0, 0, 0.5);
    --chat-name: rgba(0, 0, 0, 0.62);
    --chat-input: #f0f0f0;
    --chat-line: rgba(0, 0, 0, 0.06);
    --chat-empty: rgba(0, 0, 0, 0.5);
}

.chat-room {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 10px 14px;
    background: var(--room-bar);
    border-bottom: 1px solid var(--chat-line);
}

.chat-room h2 {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.chat-room strong {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    font-size: 16px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html[data-theme="light"] .chat-room strong { color: #191919; }

.chat-export {
    margin-left: auto;
    flex: 0 0 auto;
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.chat-fold {
    flex: 0 0 auto;
    margin: 0;
    padding: 6px 10px;
    border: 1px solid var(--chat-line);
    border-radius: 999px;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

html[data-theme="light"] .chat-fold { color: #191919; }

.trade-chat.is-collapsed .chat-panel { display: none; }

html[data-theme="light"] .chat-export { color: #191919; }

.chat-locked {
    margin: 0;
    padding: 16px;
    border-top: 1px solid var(--chat-line);
    color: var(--chat-empty);
    font-size: 14px;
    font-weight: 700;
    text-align: center;
}

.chat-count {
    flex: 0 0 auto;
    color: var(--chat-name);
    font-size: 15px;
    font-weight: 500;
}

.chat-avatar {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 14px;
    background: #8a5cc2;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
}

.chat-avatar.is-c0 { background: #e85d4c; }
.chat-avatar.is-c1 { background: #f0a202; }
.chat-avatar.is-c2 { background: #3d9a6a; }
.chat-avatar.is-c3 { background: #3d7ec9; }
.chat-avatar.is-c4 { background: #8a5cc2; }
.chat-avatar.is-c5 { background: #d96c9b; }

.chat-log {
    display: flex;
    flex-direction: column;
    min-height: 320px;
    max-height: 480px;
    padding: 14px 12px 16px;
    overflow: auto;
    background: var(--room);
}

.chat-empty {
    margin: auto;
    color: var(--chat-empty);
    font-size: 14px;
}

.chat-system {
    align-self: center;
    max-width: min(420px, 92%);
    margin: 8px 0 12px;
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.28);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.55;
    text-align: center;
    white-space: pre-wrap;
}

.chat-date {
    align-self: center;
    margin: 4px 0 12px;
    padding: 5px 10px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.22);
    color: #fff;
    font-size: 12px;
    line-height: 1.3;
}

.chat-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: 86%;
    margin-top: 12px;
}

.chat-row.is-cont { margin-top: 4px; }

.chat-row.is-cont .chat-avatar { visibility: hidden; }

.chat-row.is-cont .chat-who { display: none; }

.chat-row.is-mine {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-row.is-mine .chat-avatar,
.chat-row.is-mine .chat-who { display: none; }

.chat-stack { min-width: 0; }

.chat-who {
    margin: 0 0 4px;
    color: var(--chat-name);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.chat-line {
    display: flex;
    align-items: flex-end;
    gap: 4px;
}

.chat-row.is-mine .chat-line { flex-direction: row-reverse; }

.chat-bubble {
    flex: 0 1 auto;
    max-width: min(280px, 64vw);
    margin: 0;
    padding: 8px 12px;
    border-radius: 16px;
    background: var(--bubble-in);
    color: var(--bubble-in-text);
    font-size: 15px;
    line-height: 1.45;
    text-align: left;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.chat-row:not(.is-mine):not(.is-cont) .chat-bubble { border-top-left-radius: 4px; }

.chat-row.is-mine .chat-bubble {
    border-top-right-radius: 4px;
    background: var(--bubble-out);
    color: var(--bubble-out-text);
}

.chat-row.is-mine.is-cont .chat-bubble { border-top-right-radius: 16px; }

.chat-row time {
    flex: 0 0 auto;
    margin: 0;
    color: var(--chat-time);
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
}

.trade-chat .error {
    margin: 0;
    padding: 6px 14px 0;
    background: var(--room-bar);
}

.chat-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin: 0;
    padding: 8px 10px 10px;
    background: var(--room-bar);
}

.chat-form textarea {
    flex: 1;
    min-width: 0;
    min-height: 40px;
    max-height: 120px;
    padding: 9px 14px;
    border: 0;
    border-radius: 20px;
    background: var(--chat-input);
    color: var(--ink);
    font: inherit;
    font-size: 16px;
    line-height: 1.4;
    resize: none;
}

html[data-theme="light"] .chat-form textarea { color: #191919; }

.chat-form textarea:focus {
    outline: 2px solid #fee500;
    outline-offset: 1px;
}

html[data-theme="light"] .chat-form textarea:focus { outline-color: var(--accent); }

.chat-send {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--chat-input);
    color: var(--chat-name);
    cursor: pointer;
}

.chat-send svg { width: 18px; height: 18px; fill: currentColor; }

.chat-send.is-ready {
    background: #fee500;
    color: #191919;
}

html[data-theme="light"] .chat-send.is-ready {
    background: var(--accent);
    color: var(--on-accent);
}

.results .empty { margin-top: 18px; }

.sell-row.is-hidden { display: none; }

.cat-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 112px;
    grid-template-rows: minmax(0, 1fr);
    min-height: 220px;
    max-height: 320px;
    margin-top: 8px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--bg);
}

.cat-columns[hidden] { display: none; }

.cat-steps { display: none; }

.cat-steps button {
    min-width: 0;
    min-height: 40px;
    padding: 8px 6px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.cat-steps button.on {
    border-color: transparent;
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 700;
}

.cat-steps button:disabled { opacity: 0.4; cursor: default; }

.cat-columns > ul,
.cat-server-col {
    min-width: 0;
    min-height: 0;
    margin: 0;
    border-right: 1px solid var(--line);
}

.cat-columns ul {
    margin: 0;
    padding: 4px 0;
    list-style: none;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.cat-server-col {
    display: flex;
    flex-direction: column;
}

.server-query {
    flex: 0 0 auto;
    width: 100%;
    min-height: 40px;
    margin: 0;
    padding: 8px 12px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    color: var(--ink);
    font: inherit;
}

.server-query:focus { outline: none; }

.cat-server-col ul {
    flex: 1 1 auto;
    min-height: 0;
    border-right: 0;
}

.cat-columns > ul:last-child,
.cat-columns > :last-child { border-right: 0; }

.cat-columns.games-only { grid-template-columns: 1fr; }

.cat-columns.games-only .cat-server-col,
.cat-columns.games-only ul:not(:first-child) { display: none; }

.cat-history {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    border: 0;
}

.cat-history:empty { display: none; }

.cat-history li {
    display: flex;
    align-items: center;
    border: 1px solid var(--line);
    background: var(--bg);
}

.cat-history li > button:first-child {
    flex: 0 1 auto;
    min-width: 0;
    min-height: 40px;
    padding: 8px 12px;
    border: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.cat-history li > button:first-child.on,
.cat-history li > button:first-child:hover { color: var(--mark); }

.cat-history-remove {
    width: 40px;
    min-height: 40px;
    margin-left: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 18px;
    cursor: pointer;
}

.cat-history-remove:hover { color: var(--ink); }

.cat-columns button {
    width: 100%;
    min-height: 36px;
    padding: 8px 12px;
    overflow: hidden;
    border: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.cat-columns button.on,
.cat-columns button:hover {
    background: var(--pick);
    color: var(--mark);
}

.cat-columns .cat-note {
    padding: 12px;
    color: var(--muted);
    font-size: 14px;
}

@media (max-width: 640px) {
    .sell-row, .cat-panel { grid-template-columns: 1fr; }

    .cat-tabs {
        flex-direction: row;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .sell-actions .btn { width: 100%; }

    .trade-choices { grid-template-columns: 1fr; }

    .results { margin-top: 18px; }
    .search-panel { padding: 12px; }
    .result-tabs { gap: 6px; }
    .result-tabs a { min-height: 40px; padding: 6px 4px; font-size: 13px; }
    .server-fold:not(.is-open) .server-tabs { max-height: 34px; }
    .server-tabs, .filter-tabs { gap: 6px; }
    .server-tabs a, .filter-tabs a { min-height: 32px; padding: 5px 10px; font-size: 13px; }
    .filter-tabs a.chip-lead { min-width: 96px; }
    .search-filters-wrap { margin-top: 12px; }
    .search-filters { gap: 10px; margin-top: 10px; }

    .products { gap: 6px; margin-top: 10px; }
    .products a.product { gap: 4px; padding: 8px 10px; }
    .product-head, .product-row { gap: 8px; }
    .products h2 { font-size: 15px; }
    .products .product-offer strong { font-size: 16px; }
    .product-when,
    .product-where,
    .product-who,
    .product-deal { font-size: 12px; }
    .product-where { margin-top: 2px; }
    .product-who, .product-deal { margin-top: 2px; }
    .product-offer strong { font-size: 16px; }

    .sales li { gap: 10px; min-width: 560px; padding: 10px 0; }
    .sale-main { gap: 10px; }
    .sale-main strong, .sales span { font-size: 13px; }
    .sale-actions a, .sale-actions button { min-height: 32px; padding: 0 10px; font-size: 13px; }

    .chat-log { min-height: 260px; }

    .cat-steps:not([hidden]) {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        margin-top: 8px;
    }

    .cat-columns {
        grid-template-columns: 1fr;
        max-height: none;
        overflow: visible;
    }

    .cat-columns > ul,
    .cat-server-col {
        display: none;
        max-height: 320px;
        border-right: 0;
    }

    .cat-columns[data-step="game"] #cat-games,
    .cat-columns[data-step="kind"] #cat-kinds { display: block; }

    .cat-columns[data-step="server"] .cat-server-col { display: flex; }

    .cat-columns[data-step="server"] #cat-servers {
        display: block;
        min-height: 0;
        overflow-y: auto;
    }

    .cat-columns button {
        min-height: 48px;
        font-size: 16px;
    }
}

.me-tabs {
    display: flex;
    width: min(420px, 100%);
    margin-top: 22px;
    border-bottom: 1px solid var(--line);
}

.me-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
}

.me-tab.active {
    color: var(--ink);
    border-bottom-color: var(--accent);
}

.me-panel { width: min(420px, 100%); }

.me-panel[hidden] { display: none !important; }

.charge-label {
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.charge-amount {
    margin: 6px 0 0;
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -0.04em;
}

.choice-row {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.choice-row button {
    flex: 1;
    min-height: 48px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.choice-row button:hover,
.choice-row button:focus-visible {
    border-color: var(--ink);
}

.method-row { margin-top: 18px; }

.charge-history {
    width: min(420px, 100%);
    margin-top: 36px;
}

.charge-history h2 {
    margin: 0;
    font-size: 18px;
}

.charge-history .meta { margin-top: 12px; }

.cash-tabs.cash-wide,
.auth.cash-wide,
.charge-history.cash-wide {
    width: min(760px, 100%);
}

.cash-rows {
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.cash-rows li {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    align-items: center;
    padding: 12px 0;
    border-top: 1px solid var(--line);
    font-size: 13px;
}

.cash-rows strong { font-size: 14px; }

.cash-rows .cash-account { color: var(--muted); }

.charge-state { color: var(--muted); }

.charge-state.is-done { color: var(--mark); font-weight: 700; }

.charge-state.is-rejected { color: var(--danger); font-weight: 700; }

.cash-rows li > :last-child { margin-left: auto; }

#withdraw-list li {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    column-gap: 16px;
    align-items: center;
}

#withdraw-list li > :last-child { margin-left: 0; }

#withdraw-list .cash-account { min-width: 0; }

#withdraw-list .charge-state { white-space: nowrap; }

#charge-list form { margin: 0 0 0 auto; }

#charge-list form button {
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.charge-layer {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.62);
}

.charge-layer[hidden] { display: none; }

.charge-sheet {
    width: min(420px, 100%);
    padding: 28px 24px;
    border: 1px solid var(--line);
    background: var(--bg);
    text-align: center;
}

.charge-bank {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
}

.charge-account {
    margin: 8px 0 0;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.charge-pay {
    margin: 18px 0 0;
    font-size: 18px;
}

.charge-ask,
.charge-match {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.charge-wait {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 18px 0 0;
    font-weight: 700;
}

.charge-spin {
    width: 16px;
    height: 16px;
    border: 2px solid var(--line);
    border-top-color: var(--ink);
    border-radius: 50%;
    animation: charge-spin 0.8s linear infinite;
}

.charge-spin[hidden] { display: none; }

@keyframes charge-spin { to { transform: rotate(360deg); } }

.desk-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
    padding: 22px 22px 20px;
    border: 1px solid var(--line);
    background:
        linear-gradient(120deg, color-mix(in srgb, var(--accent) 16%, transparent), transparent 42%),
        var(--card);
}

.desk-kicker {
    margin: 0;
    color: var(--mark);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.16em;
}

.desk-hero h1 { margin: 6px 0 0; }

.desk-hero .lead {
    max-width: 460px;
    margin: 8px 0 0;
}

.desk-lock {
    margin: 0;
    padding: 12px 14px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

button.support-open {
    width: auto;
    min-width: 132px;
    margin: 0;
    padding: 0 18px;
}

.desk-empty {
    padding: 36px 22px;
    border: 1px dashed var(--line);
    background: var(--card);
    text-align: center;
}

.desk-empty strong {
    display: block;
    font-size: 18px;
}

.desk-empty p {
    margin: 8px 0 0;
    color: var(--muted);
}

.inquiry-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.inquiry-card {
    padding: 16px 16px 14px;
    border: 1px solid var(--line);
    background: var(--card);
}

.inquiry-card.is-waiting { border-left: 4px solid var(--accent); }

.inquiry-card.is-answered { border-left: 4px solid var(--line); }

.inquiry-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.inquiry-kind,
.inquiry-state {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 800;
}

.inquiry-kind {
    background: var(--accent);
    color: var(--on-accent);
}

.inquiry-state {
    margin-left: auto;
    border: 1px solid var(--line);
    color: var(--muted);
}

.inquiry-card.is-waiting .inquiry-state {
    border-color: transparent;
    background: var(--trade-on);
    color: var(--mark);
}

.inquiry-delete {
    display: flex;
    margin: 0;
}

.inquiry-delete button.text {
    min-height: 26px;
    color: var(--danger);
    font-size: 13px;
    font-weight: 700;
}

.inquiry-top time,
.inquiry-id {
    color: var(--muted);
    font-size: 13px;
}

.inquiry-who { font-size: 15px; }

.inquiry-note {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.inquiry-text,
.inquiry-body {
    margin: 14px 0 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.55;
}

.inquiry-files {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.inquiry-files a {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 180px;
    color: var(--muted);
    font-size: 12px;
    text-decoration: none;
}

.inquiry-files img {
    display: block;
    width: 180px;
    height: 140px;
    object-fit: contain;
    border: 1px solid var(--line);
    background: var(--bg);
}

.inquiry-files span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.desk-file-note {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.support-sheet input[type="file"] {
    padding: 10px;
    font-size: 14px;
}

.support-sheet {
    position: relative;
    width: min(480px, 100%);
    padding: 26px 22px 20px;
    border-top: 4px solid var(--accent);
    background: var(--card);
    text-align: left;
}

.support-title {
    margin: 8px 0 0;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.04em;
    text-align: left;
}

.desk-sheet-note {
    margin: 8px 0 18px;
    color: var(--muted);
    line-height: 1.5;
}

.support-sheet label {
    display: block;
    margin: 14px 0 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.support-sheet select,
.support-sheet textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--ink);
    font: inherit;
}

.support-sheet select {
    min-height: 48px;
    padding: 0 12px;
}

.support-sheet textarea {
    min-height: 160px;
    padding: 12px;
    font-size: 16px;
    line-height: 1.5;
    resize: vertical;
}

.support-close {
    width: 100%;
    min-height: 46px;
    margin-top: 8px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.inquiry-reply {
    margin: 14px 0 0;
    padding: 12px 14px;
    background: color-mix(in srgb, var(--accent) 12%, var(--panel));
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.5;
}

.inquiry-reply span,
.desk-reply-label {
    display: block;
    margin: 0 0 6px;
    color: var(--mark);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.inquiry-reply-form {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.inquiry-reply-form textarea {
    width: 100%;
    min-height: 110px;
    padding: 12px;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--ink);
    font: inherit;
    font-size: 15px;
    line-height: 1.5;
    resize: vertical;
}

.inquiry-reply-form button.btn {
    width: auto;
    min-width: 108px;
    margin-top: 10px;
    padding: 0 16px;
}

@media (max-width: 720px) {
    .desk-hero { align-items: stretch; flex-direction: column; }
    button.support-open,
    .inquiry-reply-form button.btn { width: 100%; }
}

.deposit-help {
    margin: 16px 0 0;
    color: var(--muted);
    line-height: 1.5;
    animation: deposit-help-in 0.7s ease;
}

.deposit-help[hidden] { display: none; }

.deposit-help a {
    color: var(--ink);
    font-weight: 700;
}

@keyframes deposit-help-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

#deposit-close {
    width: 100%;
    min-height: 48px;
    margin-top: 18px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.method-row button[name="method"][value="bank"],
.method-row button[name="method"][value="card"] {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
}
