:root {
  --canvas: #f3f5f8;
  --surface: #ffffff;
  --surface-soft: #f8f9fb;
  --ink: #171a22;
  --muted: #6c7380;
  --line: #e4e7ed;
  --line-strong: #d6dbe4;
  --accent: #635bdf;
  --accent-hover: #5149ca;
  --accent-soft: #efedff;
  --success: #14866d;
  --success-soft: #e9f7f2;
  --warning: #a36a15;
  --warning-soft: #fff7e8;
  --danger: #c54855;
  --danger-soft: #fff0f1;
  --gold: #b68019;
  --shadow-soft: 0 8px 24px rgba(27, 31, 44, 0.05);
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--canvas); }
body { min-height: 100vh; margin: 0; color: var(--ink); background: var(--canvas); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif; font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input, select { font: inherit; }
button { border: 0; cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(99, 91, 223, 0.2); outline-offset: 2px; }
button:disabled, input:disabled, select:disabled { cursor: not-allowed; opacity: 0.52; }
[hidden] { display: none !important; }
body.busy button, body.busy input, body.busy select { pointer-events: none; }

.app-header { position: sticky; z-index: 30; top: 0; border-bottom: 1px solid rgba(222, 226, 233, 0.94); background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(18px); }
.topbar { display: grid; min-height: 76px; grid-template-columns: 230px minmax(0, 1fr) 150px; align-items: center; gap: 18px; padding: 0 max(24px, calc((100vw - 1440px) / 2)); }
.brand { display: flex; min-width: 0; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand img { width: 84px; height: 48px; flex: 0 0 auto; object-fit: contain; }
.brand > span, .brand strong, .brand small { display: block; min-width: 0; }
.brand strong { overflow: hidden; font-size: 16px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.brand small { margin-top: 1px; color: #838a96; font-size: 13px; }
.primary-nav { display: flex; min-width: 0; justify-content: center; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.primary-nav::-webkit-scrollbar { display: none; }
.primary-nav button { display: flex; min-width: max-content; min-height: 52px; align-items: center; gap: 7px; padding: 0 11px; border-radius: 8px; color: #626975; background: transparent; font-size: 15px; font-weight: 650; }
.primary-nav button:hover { color: var(--ink); background: var(--surface-soft); }
.primary-nav button.active { color: var(--accent); background: var(--accent-soft); }
.primary-nav button b { display: grid; min-width: 21px; height: 21px; place-items: center; padding: 0 5px; border-radius: 999px; color: #fff; background: var(--accent); font-size: 12px; }
.connection-state { display: flex; justify-self: end; align-items: center; gap: 8px; color: var(--muted); white-space: nowrap; }
.connection-state i, .status-dock i { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #a4aab4; box-shadow: 0 0 0 4px rgba(122, 129, 141, 0.1); }
.connection-state[data-kind="busy"] i, .status-dock[data-kind="busy"] i { background: var(--accent); box-shadow: 0 0 0 4px rgba(99, 91, 223, 0.12); animation: pulse 1s infinite; }
.connection-state[data-kind="ok"] i, .status-dock[data-kind="ok"] i { background: var(--success); box-shadow: 0 0 0 4px rgba(20, 134, 109, 0.1); }
.connection-state[data-kind="warn"] i, .status-dock[data-kind="warn"] i { background: #d59b35; box-shadow: 0 0 0 4px rgba(213, 155, 53, 0.12); }
.connection-state[data-kind="error"] i, .status-dock[data-kind="error"] i { background: var(--danger); box-shadow: 0 0 0 4px rgba(197, 72, 85, 0.1); }
@keyframes pulse { 50% { opacity: 0.35; } }

.connect-strip { display: grid; min-height: 64px; grid-template-columns: auto minmax(220px, 1fr) auto 42px auto; align-items: center; gap: 10px; padding: 10px max(24px, calc((100vw - 1440px) / 2)); border-top: 1px solid var(--line); background: var(--surface-soft); }
.connect-strip label { color: #505763; font-weight: 650; }
.connect-strip input { width: 100%; height: 44px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink); background: var(--surface); }
.connect-strip input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(99, 91, 223, 0.09); outline: none; }
.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 8px; color: #555c67; background: var(--surface); font-weight: 680; }
.button:hover:not(:disabled) { color: var(--ink); background: var(--surface-soft); }
.button.primary { color: #fff; border-color: var(--accent); background: var(--accent); }
.button.primary:hover:not(:disabled) { color: #fff; background: var(--accent-hover); box-shadow: 0 8px 18px rgba(99, 91, 223, 0.18); }
.button.danger { color: #fff; border-color: var(--danger); background: var(--danger); }
.icon-button { width: 42px; height: 42px; padding: 0; border-radius: 8px; color: #767d88; background: #eceff3; font-size: 23px; }
.icon-button:hover { color: var(--danger); background: var(--danger-soft); }
.mutation-state { justify-self: end; color: var(--muted); white-space: nowrap; }
.mutation-state[data-enabled="true"] { color: var(--success); font-weight: 700; }

.page-shell { width: min(calc(100% - 40px), 1440px); margin: 14px auto 100px; }
.empty-state { min-height: calc(100vh - 175px); display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--muted); }
.empty-state img { width: 128px; height: 96px; object-fit: contain; opacity: 0.78; }
.empty-state strong { color: var(--ink); font-size: 20px; }
.account-overview { display: grid; min-height: 96px; grid-template-columns: minmax(230px, 1.2fr) minmax(560px, 3fr) minmax(170px, 0.8fr); align-items: stretch; gap: 0; overflow: hidden; border: 1px solid #dfe1fb; border-radius: 8px; background: #f1f2ff; }
.player-summary { display: flex; min-width: 0; align-items: center; gap: 12px; padding: 14px 17px; }
.avatar { display: grid; width: 48px; height: 48px; flex: 0 0 auto; place-items: center; border-radius: 8px; color: #fff; background: var(--accent); font-size: 20px; font-weight: 800; }
.player-summary > span { display: grid; min-width: 0; }
.player-summary small { color: #6862b5; font-weight: 650; }
.player-summary strong { overflow: hidden; color: #252345; font-size: 20px; text-overflow: ellipsis; white-space: nowrap; }
.player-summary b { overflow: hidden; color: #747394; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.overview-stats { display: grid; grid-template-columns: repeat(6, minmax(80px, 1fr)); margin: 0; border-left: 1px solid #dfe1fb; }
.overview-stats div { display: grid; align-content: center; min-width: 0; padding: 13px 15px; border-right: 1px solid #dfe1fb; }
.overview-stats dt { color: #777394; }
.overview-stats dd { overflow: hidden; margin: 3px 0 0; color: #282543; font-size: 20px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.archive-state { display: grid; align-content: center; padding: 14px 17px; }
.archive-state span { color: #393561; font-weight: 700; }
.archive-state small { margin-top: 3px; color: #777394; }
.status-dock { position: sticky; z-index: 20; top: 141px; display: flex; min-height: 48px; align-items: center; gap: 10px; margin: 9px 0; padding: 0 16px; border: 1px solid #dcdaf8; border-radius: 8px; color: var(--muted); background: rgba(248, 247, 255, 0.96); box-shadow: var(--shadow-soft); backdrop-filter: blur(14px); }
.status-dock[data-kind="error"] { color: var(--danger); border-color: #efd5d8; background: rgba(255, 244, 245, 0.97); }
.browse-notice { display: flex; min-height: 50px; align-items: center; gap: 12px; margin: 9px 0 12px; padding: 10px 16px; border: 1px solid #ead9a9; border-radius: 8px; color: #5f4a20; background: #fff9e9; box-shadow: var(--shadow-soft); }
.browse-notice strong { flex: 0 0 auto; color: #7d5815; }
.browse-notice span { min-width: 0; }
body[data-connected="false"] [data-connection-lock] { opacity: 0.52; filter: saturate(0.65); }
body[data-connected="false"] .buff-main[data-connection-lock], body[data-connected="false"] .market-item[data-connection-lock] { opacity: 0.62; }

.view { display: none; }
.view.active { display: block; }
.page-heading { display: flex; min-height: 86px; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-soft); }
.page-heading > div:first-child { min-width: 0; }
.page-heading span { color: var(--muted); font-weight: 650; }
.page-heading h1 { margin: 1px 0 0; font-size: 28px; line-height: 1.2; }
.page-heading > b { color: var(--accent); font-weight: 700; }
.segmented { display: flex; gap: 4px; padding: 4px; border-radius: 8px; background: #f0f2f5; }
.segmented button { min-height: 38px; padding: 0 14px; border-radius: 6px; color: var(--muted); background: transparent; font-weight: 650; }
.segmented button.active { color: var(--ink); background: var(--surface); box-shadow: 0 2px 8px rgba(21, 24, 33, 0.07); }
.subview { display: none; margin-top: 12px; }
.subview.active { display: block; }
.section-title { margin: 18px 2px 8px; font-size: 18px; }
.source-note { margin: 10px 0; color: var(--muted); }

.overview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.overview-grid button { min-height: 138px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; color: inherit; background: var(--surface); box-shadow: var(--shadow-soft); text-align: left; }
.overview-grid button:hover { border-color: #d3cff8; background: #fbfaff; transform: translateY(-1px); }
.overview-grid span, .overview-grid strong, .overview-grid small { display: block; }
.overview-grid span { color: var(--accent); font-weight: 700; }
.overview-grid strong { margin-top: 14px; font-size: 20px; }
.overview-grid small { margin-top: 3px; color: var(--muted); }
.data-bands { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.data-bands > section { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-soft); }
.data-bands header { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.data-bands header span { color: var(--muted); }
.data-bands dl { display: grid; gap: 7px; margin: 11px 0 0; }
.data-bands dl div { display: flex; justify-content: space-between; gap: 12px; }
.data-bands dt { color: var(--muted); }
.data-bands dd { overflow: hidden; margin: 0; font-weight: 700; text-align: right; text-overflow: ellipsis; white-space: nowrap; }

.summary-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-soft); }
.summary-row div { display: flex; min-height: 64px; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 18px; border-right: 1px solid var(--line); }
.summary-row div:last-child { border-right: 0; }
.summary-row span { color: var(--muted); }
.summary-row strong { font-size: 20px; }
.filter-row { display: flex; justify-content: flex-end; margin: 10px 0; }
.bulk-toolbar { display: flex; align-items: center; gap: 14px; margin: 10px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.bulk-toolbar > div:first-child { display: grid; min-width: 0; margin-right: auto; }
.bulk-toolbar > div:first-child span { margin-top: 2px; color: var(--muted); font-size: 12px; }
.bulk-toolbar > label { display: grid; grid-template-columns: auto 76px; align-items: center; gap: 8px; color: var(--muted); font-weight: 650; white-space: nowrap; }
.bulk-toolbar > label input { width: 76px; }
.bulk-actions { display: flex; gap: 8px; }
.buff-groups { display: grid; gap: 14px; }
.buff-group { display: grid; gap: 8px; }
.buff-group > header { display: flex; min-height: 42px; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px; }
.buff-group > header strong { font-size: 17px; }
.buff-group > header span { color: var(--muted); }
.buff-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.buff-card { width: 100%; min-height: 144px; overflow: hidden; border: 1px solid var(--line); border-left: 4px solid #68a98e; border-radius: 8px; color: inherit; background: var(--surface); box-shadow: var(--shadow-soft); }
.buff-main { display: grid; width: 100%; min-height: 142px; grid-template-columns: 72px minmax(0, 1fr) 118px; align-items: center; gap: 14px; padding: 15px; color: inherit; background: transparent; text-align: left; }
.buff-card.quality-传说 { border-left-color: #d0a335; }
.buff-card.quality-神话 { border-left-color: #a767c5; }
.buff-card:hover { border-color: #cfcaf7; background: #faf9ff; transform: translateY(-1px); }
.buff-card.owned { border-color: #d3e8df; background: #f1faf6; }
.buff-card.pending { border-color: var(--accent); background: #f6f4ff; box-shadow: inset 3px 0 var(--accent), var(--shadow-soft); }
.buff-main:disabled { cursor: default; opacity: 1; }
.item-icon { position: relative; display: grid; width: 70px; height: 70px; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.item-icon img { width: 100%; height: 100%; object-fit: contain; }
.item-icon b { position: absolute; right: 3px; bottom: 3px; min-width: 21px; padding: 1px 4px; border-radius: 5px; color: #fff; background: rgba(23, 26, 34, 0.82); font-size: 12px; text-align: center; }
.item-copy { min-width: 0; }
.item-copy header { display: flex; align-items: center; gap: 8px; }
.item-copy header span { padding: 3px 6px; border-radius: 5px; color: #5b55b3; background: var(--accent-soft); font-weight: 700; }
.item-copy p { margin: 7px 0 3px; color: #555c67; }
.item-copy small { color: var(--muted); }
.buff-action { display: grid; justify-items: center; gap: 3px; }
.buff-action b { display: grid; min-width: 38px; height: 38px; place-items: center; border-radius: 8px; color: var(--accent); background: var(--accent-soft); font-size: 18px; }
.buff-action small { color: var(--muted); text-align: center; }
.buff-draft-actions { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); background: rgba(255, 255, 255, 0.7); }
.buff-draft-actions button { min-height: 34px; color: #5a557a; background: transparent; font-size: 12px; font-weight: 700; }
.buff-draft-actions button + button { border-left: 1px solid var(--line); }
.buff-draft-actions button:hover { color: var(--accent); background: var(--accent-soft); }
.stepper { display: grid; justify-items: center; gap: 7px; }
.stepper > span { color: var(--muted); }
.stepper > div, .quantity-control { display: grid; grid-template-columns: 34px 44px 34px; align-items: center; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }
.stepper button, .quantity-control button { width: 34px; height: 38px; padding: 0; color: #555c67; background: #f0f2f5; font-size: 18px; }
.stepper strong { text-align: center; }

.skin-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.skin-card { display: grid; min-height: 118px; grid-template-columns: 82px minmax(0, 1fr); grid-template-rows: 1fr auto; gap: 8px 12px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-soft); }
.skin-card.pending { border-color: var(--accent); background: #fbfaff; }
.skin-card.owned { background: var(--surface-soft); }
.skin-image { position: relative; width: 82px; height: 82px; grid-row: 1 / 3; overflow: hidden; border-radius: 8px; background: #f0f1f7; }
.skin-image img { width: 100%; height: 100%; object-fit: contain; }
.skin-image span { position: absolute; right: 3px; bottom: 3px; padding: 1px 5px; border-radius: 5px; color: #fff; background: rgba(23, 26, 34, 0.76); font-size: 12px; }
.skin-card > div:nth-child(2) { display: grid; align-content: center; min-width: 0; }
.skin-card > div:nth-child(2) strong, .skin-card > div:nth-child(2) small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skin-card small { color: var(--muted); }
.skin-card button { min-height: 34px; border-radius: 7px; color: var(--accent); background: var(--accent-soft); font-weight: 700; }

.activity-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 12px; }
.feature-panel { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-soft); }
.feature-panel.invite-panel { grid-row: span 2; }
.feature-panel > header { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.panel-index { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border-radius: 8px; color: var(--accent); background: var(--accent-soft); font-weight: 800; }
.turntable-index { color: var(--gold); background: #fff6df; }
.lucky-index { color: var(--success); background: var(--success-soft); }
.feature-panel h2, .mode-panel h2 { margin: 0; font-size: 24px; }
.feature-panel p { margin: 1px 0 0; color: var(--muted); }
.invite-rewards { display: grid; gap: 8px; }
.invite-stage { display: grid; min-height: 72px; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.invite-stage.pending { border-color: var(--accent); background: #f7f5ff; }
.invite-stage.claimed { border-color: #cfe8df; background: var(--success-soft); }
.invite-stage > b { color: var(--accent); }
.invite-stage > span { display: grid; min-width: 0; }
.invite-stage small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.invite-stage button { min-width: 84px; min-height: 36px; border-radius: 7px; color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.form-grid { display: grid; grid-template-columns: minmax(140px, 0.7fr) minmax(180px, 1fr) minmax(100px, 0.45fr) auto; align-items: end; gap: 10px; }
.form-grid label, .hunter-controls label, .coin-editor label { display: grid; gap: 7px; color: var(--muted); font-weight: 650; }
select, input[type="number"], input[type="search"] { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink); background: var(--surface); }
select:focus, input[type="number"]:focus, input[type="search"]:focus { border-color: var(--accent); outline: none; }

.mode-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.mode-panel { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-soft); }
.mode-panel > header { display: flex; min-height: 82px; align-items: center; justify-content: space-between; gap: 15px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: #f7f5ff; }
.normal-panel > header { background: #eef7f5; }
.wood-panel > header { background: #f2f4f7; }
.hunter-panel > header { background: #f2f7f5; }
.adventure-panel > header { background: #fbf8ef; }
.adventure-clock { display: flex; min-height: 64px; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; padding: 11px 13px; border: 1px solid #eadfca; border-radius: 8px; background: #fff8e9; }
.adventure-clock > div { display: grid; gap: 2px; }
.adventure-clock span { color: #8a641d; font-size: 12px; font-weight: 750; }
.adventure-clock strong { color: #49391b; font-size: 17px; }
.adventure-clock > small { color: #79694c; text-align: right; }
.adventure-clock[data-open="true"] { border-color: #cde3d7; background: #eff8f3; }
.adventure-clock[data-open="true"] span { color: #24734f; }
.adventure-clock[data-open="true"] strong { color: #244b3a; }
.adventure-clock[data-open="true"] > small { color: #527262; }
.mode-panel > header span { color: var(--muted); font-weight: 650; }
.mode-panel > header > b { padding: 5px 9px; border-radius: 7px; color: var(--accent); background: var(--surface); }
.mode-body { padding: 20px; }
.skin-spotlight { display: flex; align-items: center; gap: 13px; }
.skin-spotlight img { width: 96px; height: 96px; object-fit: contain; border-radius: 8px; background: var(--surface-soft); }
.skin-spotlight span { display: grid; }
.skin-spotlight small { color: var(--muted); }
.skin-spotlight strong { font-size: 22px; }
.mode-body dl { display: grid; grid-template-columns: repeat(3, 1fr); margin: 18px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; }
.mode-body dl div { min-width: 0; padding: 12px; border-right: 1px solid var(--line); }
.mode-body dl div:last-child { border-right: 0; }
.mode-body dt { color: var(--muted); }
.mode-body dd { overflow: hidden; margin: 4px 0 0; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.mode-body > .button { width: 100%; }
.mode-tabs { max-width: min(100%, 680px); flex-wrap: wrap; justify-content: flex-end; }
.difficulty-strip { display: grid; grid-template-columns: repeat(13, minmax(48px, 1fr)); gap: 5px; margin-bottom: 14px; overflow-x: auto; padding-bottom: 3px; }
.difficulty-strip > span { display: grid; min-width: 48px; min-height: 50px; align-content: center; justify-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: var(--surface-soft); }
.difficulty-strip b { font-size: 13px; }
.difficulty-strip small { width: 100%; overflow: hidden; padding: 0 3px; font-size: 10px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.difficulty-strip > span.cleared { color: #276e58; border-color: #c8e2d8; background: #eef8f4; }
.difficulty-strip > span.current { color: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.difficulty-strip > span.pending { color: #6b54bc; border-color: #cfc5f0; background: #f4f0ff; }
.role-strip { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.role-strip span { padding: 6px 10px; border: 1px solid #d9dee7; border-radius: 7px; color: #525966; background: #f5f7f9; font-weight: 700; }
.hunter-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
.hunter-strip > span { display: grid; min-width: 0; justify-items: center; padding: 5px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: #f4f6f5; }
.hunter-strip > span.owned { border-color: #c9e2d8; color: #276e58; background: #eef8f4; }
.hunter-strip img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 7px; }
.hunter-strip small { width: 100%; overflow: hidden; margin-top: 3px; font-size: 10px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.hunter-role-card small { white-space: normal !important; }
.hunter-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.check-control { align-content: end; }
.check-control input { position: absolute; opacity: 0; }
.check-control span { display: flex; height: 44px; align-items: center; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink); background: var(--surface); }
.check-control span::before { content: ""; width: 18px; height: 18px; margin-right: 9px; border: 1px solid #b7bec9; border-radius: 5px; background: #fff; }
.check-control input:checked + span::before { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 4px #fff; }
.mode-actions { display: grid; grid-template-columns: 0.75fr 1.25fr; gap: 9px; margin-top: 12px; }
.match-actions { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); }

.daily-sign-panel { padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-soft); }
.daily-sign-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.daily-sign-panel h2 { margin: 0; font-size: 24px; }
.daily-sign-panel header span { color: var(--muted); }
.daily-sign-panel header b { color: var(--accent); }
.daily-sign-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.daily-sign-grid { display: grid; grid-template-columns: repeat(7, minmax(112px, 1fr)); gap: 7px; margin-top: 14px; overflow-x: auto; padding-bottom: 4px; }
.daily-sign-day { display: grid; min-width: 112px; min-height: 184px; grid-template-rows: auto 58px minmax(40px, 1fr) auto; justify-items: center; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); text-align: center; }
.daily-sign-day > span { color: var(--muted); font-size: 12px; font-weight: 700; }
.daily-sign-day img { width: 58px; height: 58px; object-fit: contain; }
.daily-sign-day strong { align-self: center; font-size: 12px; }
.daily-sign-day button { width: 100%; min-height: 32px; border-radius: 7px; color: var(--accent); background: var(--accent-soft); font-size: 12px; font-weight: 700; }
.daily-sign-day.claimed { border-color: #cfe5dc; background: #eff8f4; }
.daily-sign-day.pending { border-color: var(--accent); background: #f5f2ff; }

.coin-editor { display: grid; min-height: 150px; grid-template-columns: 88px minmax(160px, 1fr) minmax(220px, 1fr) auto; align-items: center; gap: 18px; padding: 24px; border: 1px solid #ece1c7; border-radius: 8px; background: #fffaf0; box-shadow: var(--shadow-soft); }
.coin-editor > img { width: 80px; height: 80px; object-fit: contain; }
.coin-editor > div { display: grid; }
.coin-editor > div span { color: var(--muted); }
.coin-editor > div strong { color: #6b4d14; font-size: 28px; }
.search-field { display: grid; grid-template-columns: auto minmax(220px, 360px); justify-content: end; align-items: center; gap: 10px; margin: 10px 0; color: var(--muted); }
.market-list { display: grid; gap: 8px; }
.market-item { display: grid; width: 100%; min-height: 94px; grid-template-columns: 64px minmax(0, 1fr) 84px; align-items: center; gap: 10px 14px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface); box-shadow: var(--shadow-soft); text-align: left; }
.market-item:hover:not(:disabled) { border-color: #cfcaf7; background: #faf9ff; transform: translateY(-1px); }
.market-item.owned { border-color: #d3e8df; background: #f1faf6; }
.market-item.pending { border-color: var(--accent); background: #f6f4ff; box-shadow: inset 3px 0 var(--accent), var(--shadow-soft); }
.market-item:disabled { cursor: default; opacity: 1; }
.market-item > img { width: 62px; height: 62px; object-fit: contain; border-radius: 8px; background: var(--surface-soft); }
.market-copy { display: grid; min-width: 0; }
.market-item header { display: flex; align-items: center; gap: 9px; }
.market-item header span { color: var(--muted); font-family: Consolas, monospace; }
.market-item p { margin: 4px 0 0; color: var(--muted); }
.market-copy > small { margin-top: 5px; color: var(--accent); font-weight: 700; }
.stock { display: grid; justify-items: end; }
.stock small { color: var(--muted); }
.stock strong { font-size: 20px; }
.stock b { color: var(--success); }
.market-actions { display: grid; grid-column: 1 / -1; grid-template-columns: 32px 44px 32px; align-items: center; justify-content: end; padding-top: 7px; border-top: 1px solid var(--line); }
.market-actions button { width: 32px; height: 30px; padding: 0; border-radius: 6px; color: var(--accent); background: var(--accent-soft); font-size: 18px; }
.market-actions b { text-align: center; }
.quantity-control input { width: 44px; height: 38px; padding: 0; border: 0; outline: none; text-align: center; -moz-appearance: textfield; }
.quantity-control input::-webkit-inner-spin-button { appearance: none; }

.shop-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.shop-item { display: grid; min-width: 0; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-soft); }
.shop-item.owned { border-color: #d3e8df; background: #f4faf7; }
.shop-item.pending { border-color: #cfcaf7; background: #f7f5ff; }
.shop-item > img { width: 44px; height: 44px; object-fit: contain; border-radius: 7px; background: var(--surface-soft); }
.shop-copy { min-width: 0; }
.shop-copy header { display: flex; align-items: baseline; justify-content: space-between; gap: 7px; }
.shop-copy header span, .shop-copy small, .shop-stock small { color: var(--muted); font-size: 11px; }
.shop-copy p { display: -webkit-box; overflow: hidden; margin: 3px 0; color: #555c67; font-size: 12px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.shop-stock { display: grid; justify-items: end; }
.shop-stock strong { color: var(--accent); font-size: 18px; }
.shop-actions { display: grid; grid-column: 1 / -1; grid-template-columns: 32px 38px 32px; align-items: center; justify-content: end; overflow: hidden; border-top: 1px solid var(--line); padding-top: 7px; }
.shop-actions button { width: 32px; height: 30px; padding: 0; border-radius: 6px; color: var(--accent); background: var(--accent-soft); font-size: 18px; }
.shop-actions b { text-align: center; }

.rank-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; margin: 12px 0 10px; overflow: hidden; border: 1px solid #ddd6fa; border-radius: 8px; background: #f6f3ff; }
.rank-publish-panel { margin: 12px 0; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-soft); }
.rank-publish-panel > header { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.rank-publish-panel > header span { color: var(--accent); font-size: 12px; font-weight: 800; }
.rank-publish-panel > header h2 { margin: 2px 0 0; font-size: 22px; }
.rank-publish-panel > header p { max-width: 560px; margin: 0; color: var(--muted); text-align: right; }
.rank-publish-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rank-publish-grid article { display: grid; grid-template-columns: minmax(112px, .65fr) minmax(170px, 1fr) minmax(150px, .8fr) minmax(100px, .5fr); align-items: end; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); }
.rank-publish-grid label { display: grid; gap: 7px; min-width: 0; color: var(--muted); font-weight: 650; }
.rank-publish-grid .rank-publish-toggle { display: flex; align-items: center; align-self: center; gap: 8px; color: var(--ink); font-size: 16px; font-weight: 800; }
.rank-publish-toggle input { width: 18px; height: 18px; }
.rank-publish-grid article > small { grid-column: 1 / -1; color: var(--muted); }
.rank-publish-action { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 12px; }
.rank-publish-action span { color: var(--muted); font-size: 13px; }
.rank-summary > div { display: grid; min-height: 86px; align-content: center; padding: 13px 18px; border-right: 1px solid #ddd6fa; }
.rank-summary span, .rank-summary small { color: #77709f; }
.rank-summary strong { color: #332d59; font-size: 22px; }
.rank-summary p { align-self: center; margin: 0; padding: 16px; color: var(--muted); }
.rank-tabs { width: fit-content; margin-left: auto; }
.rank-table { margin-top: 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-soft); }
.rank-table > header, .rank-table article { display: grid; grid-template-columns: 90px minmax(0, 1fr) 140px; align-items: center; gap: 12px; }
.rank-table > header { min-height: 46px; padding: 0 18px; color: var(--muted); background: var(--surface-soft); }
.rank-table > header span:last-child { text-align: right; }
.rank-table article { min-height: 64px; padding: 8px 18px; border-top: 1px solid var(--line); }
.rank-table article.current { background: var(--accent-soft); }
.rank-table article > span { display: flex; min-width: 0; align-items: center; gap: 10px; }
.rank-table article img { width: 42px; height: 42px; flex: 0 0 auto; border-radius: 8px; object-fit: cover; background: var(--surface-soft); }
.rank-avatar-fallback { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border-radius: 8px; color: #fff; background: var(--accent); font-size: 17px; font-weight: 850; }
.rank-table article strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-table article small { color: var(--accent); }
.rank-table article > b:last-child { text-align: right; }
.rank-table p { padding: 36px; color: var(--muted); text-align: center; }

.review-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 10px; margin-top: 12px; }
.review-list, .match-impact { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-soft); }
.review-list > header { display: flex; min-height: 52px; align-items: center; justify-content: space-between; padding: 0 16px; border-bottom: 1px solid var(--line); }
.review-list > header b { display: grid; min-width: 25px; height: 25px; place-items: center; border-radius: 999px; color: var(--accent); background: var(--accent-soft); }
.review-list article { display: grid; min-height: 72px; grid-template-columns: 48px minmax(0, 1fr) 36px; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line); }
.review-list article:last-child { border-bottom: 0; }
.review-list article img, .review-mark { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 8px; object-fit: contain; color: var(--accent); background: var(--accent-soft); font-weight: 800; }
.review-list article > span:nth-child(2) { display: grid; min-width: 0; }
.review-list article small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.review-list article button { width: 34px; height: 34px; border-radius: 7px; color: var(--muted); background: var(--surface-soft); font-size: 20px; }
.review-list > div > p { padding: 40px; color: var(--muted); text-align: center; }
.match-impact { padding: 18px; color: #332d59; border-color: #ddd6fa; background: #f8f6ff; }
.match-impact > span { color: #77709f; font-weight: 700; }
.match-impact dl { display: grid; grid-template-columns: repeat(3, 1fr); margin: 14px 0; }
.match-impact dl div { padding: 10px; border-right: 1px solid #ddd6fa; }
.match-impact dl div:last-child { border-right: 0; }
.match-impact dt { color: #77709f; }
.match-impact dd { margin: 3px 0 0; color: var(--accent); font-size: 20px; font-weight: 750; }
.match-impact p { color: var(--muted); }
.match-impact .button { width: 100%; }
.failure-editor { display: grid; grid-template-columns: minmax(0, 1fr) 96px; align-items: end; gap: 8px; margin-top: 10px; }
.failure-editor label { display: grid; gap: 5px; color: #77709f; font-size: 12px; font-weight: 700; }
.failure-editor input { height: 40px; color: #332d59; background: #fff; }
.failure-editor .button { min-height: 40px; }
#failure-hint { display: block; margin-top: 6px; color: #77709f; }
.server-preview { margin-top: 10px; overflow: hidden; border: 1px solid #cbc5f5; border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-soft); }
.server-preview > header { display: flex; min-height: 62px; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid #e2def8; background: #faf8ff; }
.server-preview > header div { display: grid; }
.server-preview > header span, .server-preview > header > b { color: var(--muted); }
#preview-details { display: grid; grid-template-columns: repeat(4, 1fr); }
#preview-details div { display: grid; padding: 15px 18px; border-right: 1px solid var(--line); }
#preview-details div:last-child { border-right: 0; }
#preview-details span { color: var(--muted); }
.server-preview footer { display: flex; justify-content: flex-end; padding: 0 18px 18px; }
.contract-panel { margin-top: 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-soft); }
.contract-panel > header { display: flex; min-height: 66px; align-items: center; justify-content: space-between; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.contract-panel > header div { display: grid; }
.contract-panel > header span, .contract-panel > header > b { color: var(--muted); }
.contract-table { min-width: 660px; }
.contract-head, .contract-table article { display: grid; grid-template-columns: 150px 230px minmax(0, 1fr); gap: 14px; align-items: center; min-height: 46px; padding: 0 18px; }
.contract-head { color: var(--muted); background: var(--surface-soft); }
.contract-table article { border-top: 1px solid var(--line); }
.contract-table article span { font-family: Consolas, monospace; }
.contract-table article small { color: var(--muted); }

.draft-tray { position: fixed; z-index: 40; left: 50%; bottom: 16px; display: grid; width: min(720px, calc(100vw - 32px)); min-height: 70px; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; transform: translateX(-50%); padding: 11px 13px 11px 18px; border: 1px solid #393c49; border-radius: 8px; color: #fff; background: #252735; box-shadow: 0 14px 36px rgba(20, 22, 30, 0.24); }
.draft-tray > div { display: grid; }
.draft-tray > div span, .draft-tray p { color: #b7bac7; }
.draft-tray > div b { color: #dcd8ff; }
.draft-tray p { overflow: hidden; margin: 0; text-overflow: ellipsis; white-space: nowrap; }
.draft-tray button { min-height: 42px; padding: 0 15px; border-radius: 8px; color: #fff; background: var(--accent); font-weight: 700; }
body:has(#view-review.active) .draft-tray { display: none; }
.toast { position: fixed; z-index: 60; top: 156px; left: 50%; max-width: min(520px, calc(100vw - 32px)); transform: translate(-50%, -12px); padding: 11px 16px; border-radius: 8px; color: #fff; background: var(--success); box-shadow: 0 10px 28px rgba(20, 22, 30, 0.2); opacity: 0; pointer-events: none; transition: opacity 160ms, transform 160ms; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast[data-kind="error"] { background: var(--danger); }
.toast[data-kind="warn"] { color: #4d3510; background: #f0bd58; }

@media (max-width: 1180px) {
  .topbar { grid-template-columns: 210px minmax(0, 1fr); }
  .connection-state { display: none; }
  .primary-nav { justify-content: flex-start; }
  .account-overview { grid-template-columns: 220px minmax(0, 1fr); }
  .archive-state { display: none; }
  .overview-stats { grid-template-columns: repeat(3, 1fr); }
  .skin-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form-grid .button { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .app-header { position: static; }
  .topbar { grid-template-columns: 190px minmax(0, 1fr); gap: 10px; padding: 0 14px; }
  .primary-nav { justify-content: flex-start; }
  .connect-strip { grid-template-columns: minmax(0, 1fr) auto 42px; padding: 10px 14px; }
  .connect-strip label, .mutation-state { display: none; }
  .page-shell { width: min(calc(100% - 28px), 1440px); }
  .status-dock { position: static; }
  .account-overview { grid-template-columns: 1fr; }
  .player-summary { border-bottom: 1px solid #dfe1fb; }
  .overview-stats { border-left: 0; }
  .overview-grid, .data-bands, .activity-layout, .mode-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-panel.invite-panel { grid-row: auto; grid-column: 1 / -1; }
  .buff-grid { grid-template-columns: 1fr; }
  .skin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-layout { grid-template-columns: 1fr; }
  .rank-publish-panel > header { align-items: flex-start; flex-direction: column; gap: 5px; }
  .rank-publish-panel > header p { text-align: left; }
  .rank-publish-grid { grid-template-columns: 1fr; }
  .match-impact { order: -1; }
  .coin-editor { grid-template-columns: 70px minmax(0, 1fr) minmax(180px, 1fr); }
  .coin-editor > img { width: 66px; height: 66px; }
  .coin-editor .button { grid-column: 2 / -1; }
}

@media (max-width: 620px) {
  .topbar { min-height: 68px; grid-template-columns: 158px minmax(0, 1fr); padding: 0 10px; }
  .brand { gap: 6px; }
  .brand img { width: 58px; height: 40px; }
  .brand small { display: none; }
  .primary-nav button { min-height: 46px; padding: 0 9px; }
  .connect-strip { padding: 9px 10px; }
  .page-shell { width: min(calc(100% - 20px), 1440px); margin-top: 10px; }
  .empty-state { min-height: calc(100vh - 140px); }
  .overview-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .overview-stats div { padding: 10px; }
  .overview-stats dd { font-size: 17px; }
  .page-heading { min-height: 0; align-items: flex-start; flex-direction: column; padding: 16px; }
  .page-heading h1 { font-size: 26px; }
  .page-heading .segmented { width: 100%; }
  .page-heading .segmented button { flex: 1; padding: 0 8px; }
  .overview-grid, .data-bands, .activity-layout, .mode-layout, .skin-grid { grid-template-columns: 1fr; }
  .overview-grid button { min-height: 120px; }
  .summary-row div { min-height: 74px; align-items: flex-start; flex-direction: column; justify-content: center; gap: 1px; padding: 10px; }
  .summary-row strong { font-size: 17px; }
  .filter-row .segmented { width: 100%; }
  .filter-row .segmented button { flex: 1; padding: 0 5px; }
  .buff-main { min-height: 168px; grid-template-columns: 62px minmax(0, 1fr); gap: 10px; padding: 12px; }
  .item-icon { width: 60px; height: 60px; align-self: start; }
  .stepper { grid-column: 1 / -1; grid-template-columns: 1fr auto; justify-items: stretch; align-items: center; }
  .stepper > div { justify-self: end; }
  .feature-panel, .mode-body { padding: 16px; }
  .form-grid, .hunter-controls { grid-template-columns: 1fr; }
  .form-grid .button { grid-column: auto; }
  .mode-body dl { grid-template-columns: 1fr; }
  .adventure-clock { align-items: flex-start; flex-direction: column; gap: 5px; }
  .adventure-clock > small { text-align: left; }
  .mode-body dl div { display: flex; justify-content: space-between; border-right: 0; border-bottom: 1px solid var(--line); }
  .mode-body dl div:last-child { border-bottom: 0; }
  .mode-body dd { margin: 0; }
  .mode-actions { grid-template-columns: 1fr; }
  .coin-editor { grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 16px; }
  .coin-editor label, .coin-editor .button { grid-column: 1 / -1; }
  .market-item { grid-template-columns: 54px minmax(0, 1fr) 114px; gap: 10px; padding: 10px; }
  .market-item > img { width: 52px; height: 52px; }
  .stock { display: none; }
  .market-item p { display: none; }
  .search-field { grid-template-columns: 1fr; }
  .search-field { color: transparent; gap: 0; }
  .rank-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rank-publish-panel { padding: 14px; }
  .rank-publish-grid article { grid-template-columns: 1fr 1fr; }
  .rank-publish-grid .rank-publish-toggle, .rank-publish-grid article > small { grid-column: 1 / -1; }
  .rank-publish-action { align-items: stretch; flex-direction: column; }
  .rank-summary p { grid-column: 1 / -1; padding: 10px 14px; border-top: 1px solid #ddd6fa; }
  .rank-table > header, .rank-table article { grid-template-columns: 48px minmax(0, 1fr) 84px; padding-inline: 10px; }
  #preview-details { grid-template-columns: repeat(2, 1fr); }
  #preview-details div:nth-child(2) { border-right: 0; }
  #preview-details div { border-bottom: 1px solid var(--line); }
  .contract-panel { overflow: hidden; }
  .contract-panel > header { min-width: 0; align-items: flex-start; flex-direction: column; padding-block: 14px; }
  .contract-table { min-width: 0; }
  .contract-head { display: none; }
  .contract-table article { grid-template-columns: 1fr; gap: 2px; align-items: start; padding-block: 10px; }
  .draft-tray { grid-template-columns: 1fr auto; gap: 10px; }
  .draft-tray p { display: none; }
  .toast { top: 145px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}

/* Batch workflow and compact inventories */
.connect-strip { grid-template-columns: auto minmax(220px, 1fr) auto auto; }
.clear-button { min-width: 64px; padding-inline: 14px; color: #656c77; background: #eceff3; }
.clear-button:hover:not(:disabled) { color: var(--danger); background: var(--danger-soft); }

.batch-console { position: relative; z-index: 1; margin: 9px 0 12px; overflow: hidden; border: 1px solid #d8d2f5; border-radius: 8px; background: #fbfaff; box-shadow: 0 12px 26px rgba(58, 48, 105, 0.1); }
.quick-config { margin: 12px 0; overflow: hidden; border: 1px solid #ddd8f3; border-radius: 12px; background: linear-gradient(135deg, #fff, #f7f4ff); box-shadow: 0 10px 25px rgba(62, 52, 112, .07); }
.quick-config > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 17px; border-bottom: 1px solid #e8e4f5; }
.quick-config > header > div { display: grid; gap: 3px; }
.quick-config > header span { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.quick-config > header h2 { margin: 0; color: #37305d; font-size: 19px; }
.quick-config > header p { margin: 0; color: var(--muted); font-size: 13px; }
.quick-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 15px 17px; }
.quick-fields > label { display: grid; gap: 7px; color: #625b7e; font-size: 13px; font-weight: 700; }
.quick-scalar { min-height: 66px; grid-template-columns: minmax(0, 1fr) minmax(92px, 42%); align-items: center; gap: 12px !important; padding: 12px; border: 1px solid #e1dcef; border-radius: 10px; background: #fff; }
.quick-scalar > span { min-width: 0; line-height: 1.35; }
.quick-fields input[type="number"] { width: 100%; height: 40px; padding: 0 11px; border: 1px solid #ddd8eb; border-radius: 9px; background: #fff; }
.quick-check input { width: 19px; height: 19px; justify-self: end; accent-color: var(--accent); }
.quick-item-group { grid-column: 1 / -1; overflow: hidden; border: 1px solid #e4dff1; border-radius: 10px; background: rgba(255,255,255,.82); }
.quick-item-group > header { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; background: #f2effc; }
.quick-item-group > header small { color: var(--muted); }
.quick-item-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 10px; }
.quick-item { display: grid; grid-template-columns: minmax(0, 1fr) 68px; align-items: center; gap: 8px; min-width: 0; padding: 7px 8px; border: 1px solid #ebe7f3; border-radius: 9px; background: #fff; }
.quick-item > span { display: flex; min-width: 0; align-items: center; gap: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-item img { width: 28px; height: 28px; flex: 0 0 auto; object-fit: contain; }
.quick-item input { height: 34px !important; padding: 0 7px !important; }
.quick-config > footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 17px; border-top: 1px solid #e8e4f5; background: rgba(246,244,252,.72); }
.quick-config > footer span { color: var(--muted); font-size: 12px; line-height: 1.5; }
@media (max-width: 980px) { .quick-item-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { .quick-fields { grid-template-columns: 1fr 1fr; } .quick-item-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .quick-config > footer { align-items: stretch; flex-direction: column; } }
@media (max-width: 480px) { .quick-config > header { align-items: flex-start; flex-direction: column; } .quick-fields { grid-template-columns: 1fr; padding: 12px; } .quick-item-grid { grid-template-columns: 1fr; } .quick-config > footer .button { width: 100%; } }
.batch-console > header { display: grid; min-height: 66px; grid-template-columns: auto minmax(160px, 1fr) auto; align-items: center; gap: 16px; padding: 10px 12px 10px 17px; color: #332d59; }
.batch-console > header > div:first-child { display: grid; min-width: 112px; }
.batch-console > header span, .batch-console > header p { color: #77709f; }
.batch-console > header strong b { color: var(--accent); }
.batch-console > header p { overflow: hidden; margin: 0; text-overflow: ellipsis; white-space: nowrap; }
.batch-actions { display: flex; gap: 8px; }
.batch-console > details { border-top: 1px solid #e2def8; background: #f7f6fb; }
.batch-console > details > summary { padding: 10px 16px; color: #5d5686; background: #f0edfb; cursor: pointer; font-weight: 650; }
.batch-console .review-layout { margin: 10px; }
.batch-console .server-preview { margin: 0 10px 10px; }
.batch-console .contract-panel { margin: 0 10px 10px; }
.contract-panel > summary { padding: 12px 16px; color: var(--accent); cursor: pointer; font-weight: 700; }
.contract-panel[open] > summary { border-bottom: 1px solid var(--line); }

.buff-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.buff-card { min-height: 110px; border-left-width: 3px; }
.buff-main { min-height: 108px; grid-template-columns: 52px minmax(0, 1fr) 104px; gap: 9px; padding: 10px; }
.item-icon { width: 50px; height: 50px; }
.item-copy header { gap: 6px; }
.item-copy header span { padding: 1px 5px; font-size: 12px; }
.item-copy p { display: -webkit-box; overflow: hidden; margin: 4px 0 1px; font-size: 13px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.item-copy small, .stepper > span { font-size: 12px; }
.stepper { gap: 4px; }
.stepper > div { grid-template-columns: 30px 38px 30px; }
.stepper button { width: 30px; height: 34px; }

.feature-panel { padding: 18px; }
.feature-panel > header { margin-bottom: 13px; }
.feature-panel > header > b { margin-left: auto; color: var(--muted); font-size: 13px; font-weight: 650; }
.invite-panel > header .button { margin-left: auto; }
.activity-actions { display: flex; grid-column: 1 / -1; justify-content: flex-end; gap: 7px; }
.activity-actions .button { min-height: 44px; padding-inline: 12px; }
.form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.key-drop-panel { display: grid; min-height: 112px; grid-template-columns: 70px minmax(180px, 1fr) minmax(230px, 0.8fr) auto; align-items: center; gap: 16px; padding: 16px 18px; border: 1px solid #d8e8e1; border-radius: 8px; background: #f3faf7; box-shadow: var(--shadow-soft); }
.key-drop-panel > img { width: 64px; height: 64px; object-fit: contain; }
.key-drop-panel > div { display: grid; }
.key-drop-panel > div span, .key-drop-panel small, .key-drop-panel dt { color: var(--muted); }
.key-drop-panel > div strong { font-size: 22px; }
.key-drop-panel dl { display: grid; grid-template-columns: repeat(2, 1fr); margin: 0; overflow: hidden; border: 1px solid #d8e8e1; border-radius: 8px; background: #fff; }
.key-drop-panel dl div { padding: 10px 14px; border-right: 1px solid #d8e8e1; }
.key-drop-panel dl div:last-child { border-right: 0; }
.key-drop-panel dd { margin: 2px 0 0; font-weight: 750; }

.coin-editor { min-height: 104px; grid-template-columns: 62px minmax(140px, 0.7fr) minmax(200px, 1fr) auto; gap: 14px; padding: 16px 18px; }
.coin-editor > img { width: 56px; height: 56px; }
.coin-editor > div strong { font-size: 24px; }
.market-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.market-item { min-height: 92px; grid-template-columns: 46px minmax(0, 1fr) 68px; gap: 5px 9px; padding: 9px 10px; }
.market-item > img { width: 44px; height: 44px; }
.market-item header { display: grid; gap: 0; }
.market-item header strong, .market-item header span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.market-item header span { font-size: 11px; }
.market-item p { display: none; }
.stock { justify-items: end; }
.stock strong { font-size: 16px; }

@media (max-width: 1250px) {
  .buff-grid, .market-list, .shop-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .batch-console { position: static; }
  .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .activity-actions { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .connect-strip { grid-template-columns: minmax(0, 1fr) auto auto; }
  .batch-console > header { grid-template-columns: auto minmax(0, 1fr); }
  .batch-console > header > p { display: none; }
  .batch-actions { grid-column: 1 / -1; }
  .batch-actions .button { flex: 1; }
  .key-drop-panel { grid-template-columns: 62px minmax(0, 1fr); }
  .key-drop-panel dl, .key-drop-panel > .button { grid-column: 1 / -1; }
  .match-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .difficulty-strip { grid-template-columns: repeat(13, 52px); }
  .daily-sign-grid { grid-template-columns: repeat(7, 112px); }
  .bulk-toolbar { align-items: stretch; flex-wrap: wrap; }
  .bulk-toolbar > div:first-child { flex: 1 1 100%; }
}

@media (max-width: 620px) {
  .connect-strip { grid-template-columns: minmax(0, 1fr) auto auto; }
  .clear-button { min-width: 58px; padding-inline: 10px; }
  .batch-console > header { gap: 9px; padding: 10px; }
  .batch-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .batch-actions .danger { grid-column: 1 / -1; }
  .batch-console .review-layout { margin: 8px; }
  .buff-grid { grid-template-columns: 1fr; }
  .market-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .buff-main { min-height: 124px; grid-template-columns: 50px minmax(0, 1fr); }
  .buff-group > header { align-items: flex-start; flex-direction: column; justify-content: center; gap: 0; }
  .buff-action { grid-column: 1 / -1; grid-template-columns: auto minmax(0, 1fr); align-items: center; justify-items: start; }
  .activity-actions { display: grid; grid-template-columns: 0.7fr 1.3fr; }
  .invite-panel > header { align-items: flex-start; flex-wrap: wrap; }
  .invite-panel > header .button { width: 100%; margin-left: 54px; }
  .key-drop-panel { gap: 10px; padding: 13px; }
  .coin-editor { min-height: 0; }
  .market-item { min-height: 76px; grid-template-columns: 38px minmax(0, 1fr); gap: 6px; padding: 8px; }
  .market-item > img { width: 38px; height: 38px; }
  .market-item header strong { font-size: 13px; }
  .market-item header span, .market-copy > small { font-size: 10px; }
  .bulk-toolbar > label { flex: 1 1 100%; grid-template-columns: minmax(0, 1fr) 76px; }
  .bulk-actions { display: grid; width: 100%; grid-template-columns: 1fr 1fr; }
  .shop-list { grid-template-columns: 1fr; }
  .match-actions { grid-template-columns: 1fr; }
  .mode-tabs { max-width: 100%; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; }
  .page-heading .mode-tabs button { min-width: max-content; flex: 0 0 auto; }
  .hunter-strip { grid-template-columns: repeat(7, 64px); overflow-x: auto; }
  .daily-sign-actions { display: grid; grid-template-columns: 1fr; }
  .rank-table > header, .rank-table article { grid-template-columns: 42px minmax(0, 1fr) 112px; }
  .rank-table article > b:last-child { font-size: 12px; }
}
