/* Shared visual language for the public site, player workspace and admin tools. */
:root {
 --ui-canvas:#edf6f1; --ui-surface:#fff; --ui-soft:#f3f8f5; --ui-ink:#253a33;
 --ui-rarity-1:#63746c;--ui-rarity-2:#19834e;--ui-rarity-3:#2868bf;--ui-rarity-4:#8850bb;--ui-rarity-5:#92680f;--ui-rarity-6:#c13e3e;
 --ui-muted:#647b70; --ui-line:#d8e5de; --ui-primary:#214b40; --ui-primary-soft:#e8f3ed; --ui-primary-ink:#fff;
 --ui-success:#187b59; --ui-success-soft:#edf8f1; --ui-danger:#b64d43; --ui-danger-soft:#fff1ee;
 --ui-warning:#946515; --ui-warning-soft:#fff8e8; --ui-backdrop:rgba(24,43,38,.43);
 --ui-shadow:0 28px 90px rgba(20,43,33,.18); --ui-radius:16px;
 --ink:var(--ui-ink); --muted:var(--ui-muted); --blue:var(--ui-primary); --line:var(--ui-line); --soft:var(--ui-soft);
}
html[data-theme="dark"],body.app-shell:not(.light-theme) {
 --ui-canvas:#13242b; --ui-surface:#1b2e36; --ui-soft:#243b42; --ui-ink:#e4efeb;
 --ui-rarity-1:#aaa;--ui-rarity-2:#44ff88;--ui-rarity-3:#4a9eff;--ui-rarity-4:#c084fc;--ui-rarity-5:#ffcc00;--ui-rarity-6:#ff7777;
 --ui-muted:#a4bbb2; --ui-line:#3b5359; --ui-primary:#9ad7bf; --ui-primary-soft:#25483b; --ui-primary-ink:#142c22;
 --ui-success:#81d6ae; --ui-success-soft:#203d33; --ui-danger:#ffb1a6; --ui-danger-soft:#462e30;
 --ui-warning:#ecc575; --ui-warning-soft:#3c3525; --ui-backdrop:rgba(5,17,21,.65);
 --ui-shadow:0 28px 90px rgba(0,0,0,.35);
 --ink:var(--ui-ink); --muted:var(--ui-muted); --blue:var(--ui-primary); --line:var(--ui-line); --soft:var(--ui-soft);
}

/* A card's destination is always its top-right circular arrow. */
body.app-shell .overview-card-head { align-items:flex-start; gap:16px; }
body.app-shell .overview-card-head>div { flex:1; min-width:0; }
body.app-shell .section-open {
 display:inline-flex;align-items:center;justify-content:center;flex:0 0 38px;
 width:38px;height:38px;min-height:38px;padding:0;margin:0;border:1px solid var(--ui-line);
 border-radius:50%;background:var(--ui-soft);color:var(--ui-ink);cursor:pointer;
 transition:background .16s,border-color .16s,transform .16s;
}
body.app-shell .section-open:hover { background:var(--ui-primary-soft);border-color:var(--ui-primary);color:var(--ui-primary);transform:translate(1px,-1px); }
.section-open svg { width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;pointer-events:none; }
body.app-shell .overview-fetch-links { justify-content:flex-start; }
body.app-shell .overview-fetch-links .overview-link { padding:7px 0;font-size:12px;text-decoration:none; }
.shell-tooltip { background:var(--ui-ink);color:var(--ui-surface);border-radius:10px;font-weight:500; }

/* Dialog shell: opaque surface, quiet header, scrollable content, stable actions. */
body.app-shell :is(.action-overlay,.account-overlay,.modal-overlay,.gun-solution-detail-overlay),
:is(.web-dialog-overlay,.admin-shell .overlay),.register-dialog-overlay {
 background:var(--ui-backdrop);backdrop-filter:blur(7px);padding:24px;align-items:center;justify-content:center;
}
body.app-shell :is(.action-card,.account-modal,.modal,.gun-solution-detail-card),:is(.web-dialog,.admin-shell .dialog),.register-dialog {
 border:1px solid var(--ui-line);border-radius:var(--ui-radius);background:var(--ui-surface);
 color:var(--ui-ink);box-shadow:var(--ui-shadow);padding:0;overflow:hidden;
 max-height:calc(100dvh - 48px);
}
body.app-shell :is(.account-modal,.modal),.register-dialog { display:flex;flex-direction:column; }
body.app-shell :is(.action-card-head,.account-modal-head,.modal-head),:is(.web-dialog-head,.admin-shell .dialog-head),.register-dialog-head {
 display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin:0;padding:24px 26px 20px;
 border:0;border-bottom:1px solid var(--ui-line);flex-shrink:0;
 background:linear-gradient(115deg,var(--ui-soft),var(--ui-surface));
}
body.app-shell :is(.action-card-head,.account-modal-head,.modal-head) h3,:is(.web-dialog-head,.admin-shell .dialog-head) h3,.register-dialog-head h3 {
 color:var(--ui-ink);font-size:20px;font-weight:650;line-height:1.45;letter-spacing:-.02em;
 margin:4px 0 0;overflow-wrap:anywhere;
}
body.app-shell :is(.account-modal-head,.action-card-head) p,.register-dialog-head p { color:var(--ui-muted);font-size:13px;line-height:1.7; }
body.app-shell :is(.action-card-body,.account-modal-body,.modal-body),.register-dialog-body {
 padding:24px 26px;min-height:0;overflow:auto;overscroll-behavior:contain;max-height:none;
 scrollbar-width:thin;scrollbar-color:var(--ui-line) transparent;
}
body.app-shell .action-card:not(.gun-solution-detail-card)>.action-card-body { padding:24px 26px; }
body.app-shell :is(.action-card-actions,.gun-solution-detail-footer),:is(.web-dialog-actions,.admin-shell .dialog-actions),.register-dialog-actions {
 display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap;
 margin:0;padding:18px 26px;border-top:1px solid var(--ui-line);background:var(--ui-soft);flex-shrink:0;
}
body.app-shell .action-card-actions:empty { display:none; }
body.app-shell .action-card-actions .btn,:is(.web-dialog-actions,.admin-shell .dialog-actions) .btn { margin:0; }
body.app-shell :is(.action-card-body,.account-modal-body,.modal-body) { color:var(--ui-ink); }
body.app-shell .action-card-body p { color:var(--ui-muted);font-size:14px;line-height:1.8; }
body.app-shell :is(.action-card-body,.account-modal-body,.modal-body) :is(h4,h5,strong) { color:var(--ui-ink); }
body.app-shell .action-card-body :is(.dialog-note,.admin-contact-note),body.app-shell .account-modal-body .dialog-note { color:var(--ui-muted);line-height:1.7; }
body.app-shell .action-card-body .admin-contact-note { background:var(--ui-soft);border-color:var(--ui-line);border-left-color:var(--ui-primary); }
body.app-shell :is(.action-card-head,.account-modal-head,.modal-head) :is(.close-link,.modal-close),:is(.web-dialog-close,.admin-shell .dialog-head>.btn),.register-dialog-close {
 display:inline-flex;position:relative;align-items:center;justify-content:center;flex:0 0 38px;
 width:38px;height:38px;padding:0;min-height:38px;border:1px solid var(--ui-line);border-radius:50%;
 background:var(--ui-surface);color:var(--ui-muted);font-size:0;line-height:1;cursor:pointer;
}
body.app-shell :is(.action-card-head,.account-modal-head,.modal-head) :is(.close-link,.modal-close)::before,
body.app-shell :is(.action-card-head,.account-modal-head,.modal-head) :is(.close-link,.modal-close)::after,
:is(.web-dialog-close,.admin-shell .dialog-head>.btn)::before,:is(.web-dialog-close,.admin-shell .dialog-head>.btn)::after,.register-dialog-close::before,.register-dialog-close::after {
 content:"";position:absolute;width:14px;height:1.6px;border-radius:2px;background:currentColor;transform:rotate(45deg);
}
body.app-shell :is(.action-card-head,.account-modal-head,.modal-head) :is(.close-link,.modal-close)::after,
:is(.web-dialog-close,.admin-shell .dialog-head>.btn)::after,.register-dialog-close::after { transform:rotate(-45deg); }
body.app-shell :is(.action-card-head,.account-modal-head,.modal-head) :is(.close-link,.modal-close):hover,:is(.web-dialog-close,.admin-shell .dialog-head>.btn):hover,.register-dialog-close:hover { background:var(--ui-soft);color:var(--ui-ink);border-color:var(--ui-muted); }
body.app-shell :is(.btn,.dialog-input,input,select,textarea),.site-page :is(.btn,.input) { font-family:inherit; }
body.app-shell .btn:not(.shell-icon-button):not(.theme-toggle) { min-height:38px;border-radius:11px;font-size:13px;font-weight:600;line-height:1.5;transition:background .15s,border-color .15s; }
body.app-shell :is(.btn-muted,.btn-feedback,.btn-demo),body.app-shell .btn:not([class*="btn-"]):not(.shell-icon-button) { background:var(--ui-soft);border:1px solid var(--ui-line);color:var(--ui-ink); }
body.app-shell :is(.btn-fetch,.btn-go) { background:var(--camp-button);color:#fff;border:1px solid var(--camp-button); }
body.app-shell :is(.btn-fetch,.btn-go):hover { background:color-mix(in srgb,var(--camp-button) 88%,#000); }
body.app-shell .btn-danger { background:var(--ui-danger-soft);color:var(--ui-danger);border:1px solid color-mix(in srgb,var(--ui-danger) 32%,var(--ui-line)); }
body.app-shell .btn-danger:hover { background:color-mix(in srgb,var(--ui-danger) 14%,var(--ui-surface)); }
body.app-shell :is(.dialog-input,.valuation-field input,.valuation-field select,.account-form input,.account-form select,.cloud-model-input) {
 background:var(--ui-soft);color:var(--ui-ink);border:1px solid var(--ui-line);border-radius:11px;
 min-height:42px;padding:10px 12px;font-size:14px;box-shadow:none;
}
body.app-shell :is(.dialog-input,.valuation-field input,.valuation-field select,.account-form input,.account-form select):focus { border-color:var(--ui-primary);outline:2px solid color-mix(in srgb,var(--ui-primary) 22%,transparent);outline-offset:1px; }
body.app-shell :is(input,textarea)::placeholder { color:var(--ui-muted);opacity:.8; }
body.app-shell :is(.account-form label,.valuation-field,.admin-create-form label) { color:var(--ui-muted);font-size:13px;gap:8px; }
body.app-shell :is(.account-empty,.report-empty,.report-item,.valuation-section,.valuation-asset-row,.detail-item,.account-item,.account-card,.companion-security,.mobile-download-platform,.admin-contact-card .contact-item) {
 background:var(--ui-soft);border:1px solid var(--ui-line);border-radius:14px;color:var(--ui-muted);box-shadow:none;
}
body.app-shell .account-empty { padding:16px 18px; }
body.app-shell :is(.account-item,.account-card):hover { background:var(--ui-primary-soft);border-color:var(--ui-primary); }
body.app-shell :is(.account-item.active,.account-card.active) { background:var(--ui-success-soft);border-color:var(--ui-success); }
body.app-shell :is(.binding-time,.account-actions .right,.account-meta,.report-item-meta,.detail-item .d-label,.detail-player-meta .meta-label,.valuation-section>p,.valuation-asset-copy p,.valuation-asset-row small) { color:var(--ui-muted); }
body.app-shell :is(.detail-item .d-val,.report-item-title,.account-name,.section-title,.valuation-section h4) { color:var(--ui-ink); }
body.app-shell :is(.section-title,.detail-player-head) { border-color:var(--ui-line); }
body.app-shell .modal-head .tag-list { margin-top:10px; }
body.app-shell .detail-grid { gap:12px; }
body.app-shell .detail-item { padding:14px; }
body.app-shell .detail-item .d-label { margin-bottom:7px;font-size:12px; }
body.app-shell :is(.modal-body,.account-modal-body,.action-card-body) table { border-collapse:separate;border-spacing:0; }
body.app-shell :is(.modal-body,.account-modal-body,.action-card-body) th { background:var(--ui-soft);color:var(--ui-muted);border-bottom:1px solid var(--ui-line);padding:12px;font-size:12px; }
body.app-shell :is(.modal-body,.account-modal-body,.action-card-body) td { border-bottom:1px solid var(--ui-line);padding:12px;color:var(--ui-ink); }
body.app-shell :is(.modal-body,.account-modal-body,.action-card-body) tr:hover { background:var(--ui-soft); }
body.app-shell :is(.companion-steps,.companion-security,.companion-update-status,.companion-update-summary,.companion-latest-changelog,.companion-release-note) { color:var(--ui-muted); }
body.app-shell :is(.companion-security,.companion-latest-changelog,.companion-update-summary) { background:var(--ui-soft);border-color:var(--ui-line);border-radius:14px; }
body.app-shell :is(.companion-steps strong,.companion-latest-changelog strong,.mobile-download-intro h4,.mobile-download-platform strong,.mobile-download-qr strong) { color:var(--ui-ink); }
body.app-shell :is(.mobile-download-badge,.mobile-download-qr a) { color:var(--ui-success); }
body.app-shell .mobile-download-platform.is-recommended { border-color:var(--ui-success);background:var(--ui-success-soft); }
body.app-shell .mobile-download-platform>span { color:var(--ui-muted); }
body.app-shell :is(.valuation-disclaimer,.valuation-missing,.valuation-asset-note) { color:var(--ui-muted);border-color:var(--ui-line);background:var(--ui-soft); }
body.app-shell .valuation-body { padding-right:26px;gap:18px; }
body.app-shell :is(.valuation-detail-list,.valuation-detail-total,.valuation-breakdown-row) { border-color:var(--ui-line);background:var(--ui-soft);color:var(--ui-muted); }
body.app-shell :is(.valuation-detail-total strong,.valuation-inline-result .valuation-total) { color:var(--ui-success); }

/* The gun detail view and tour are secondary surfaces too. Keep item rarity colors. */
body.app-shell :is(.gun-solution-detail-meta,.gun-solution-property,.gun-solution-accessory,.gun-solution-comment p) { background:var(--ui-soft);border-color:var(--ui-line);color:var(--ui-muted)!important; }
body.app-shell :is(.gun-solution-detail-summary-copy h3,.gun-solution-detail-section>h4,.gun-solution-accessory-copy h5,.gun-solution-detail-footer code) { color:var(--ui-ink)!important; }
body.app-shell :is(.gun-solution-detail-meta dd,.gun-solution-property strong,.gun-solution-accessory-copy>p,.gun-solution-detail-footer span,.gun-solution-code-block>span,.gun-solution-detail-footer small) { color:var(--ui-muted)!important; }
body.app-shell .gun-solution-detail-section { border-color:var(--ui-line); }
body.app-shell .gun-solution-detail-preview { border-color:var(--ui-line);background:radial-gradient(ellipse at center,var(--ui-soft),var(--ui-surface)); }
body.app-shell .gun-solution-detail-gun { color:var(--ui-success)!important; }
body.app-shell .gun-solution-property-track { background:var(--ui-line); }
body.app-shell .gun-solution-property b { color:var(--ui-success); }
body.app-shell :is(.demo-banner,.demo-tour-card) { background:var(--ui-surface);border-color:var(--ui-line);box-shadow:0 12px 40px rgba(24,50,40,.12); }
body.app-shell :is(.demo-tour-head,.demo-tour-actions) { background:var(--ui-soft);border-color:var(--ui-line); }
body.app-shell :is(.demo-banner-copy strong,.demo-tour-head h3) { color:var(--ui-ink); }
body.app-shell :is(.demo-banner-copy p,.demo-tour-body>p,.demo-tour-head span) { color:var(--ui-muted); }
body.app-shell .demo-mode-badge { background:var(--ui-success-soft);color:var(--ui-success);border:1px solid var(--ui-line); }
body.app-shell .demo-tour-dot { background:var(--ui-line); }
body.app-shell .demo-tour-dot.active,body.app-shell .demo-tour-dot.done { background:var(--camp-button);box-shadow:none; }

/* Remaining workspace modules use the same quiet surfaces as the overview. */
body.app-shell :is(.career-filter-panel,.career-season-card,.career-map-chart,.career-asset-chart,.convenience-tool-nav,.team-count-panel,.team-count-card,.gun-solution-card,.gun-solution-filters,.gun-solution-empty,.shared-person-card,.shared-unassigned-card) { background:var(--ui-surface);border-color:var(--ui-line);box-shadow:none; }
body.app-shell :is(.gun-solution-filters input,.gun-solution-filters select,.gun-solution-metrics span) { background:var(--ui-soft);border-color:var(--ui-line);color:var(--ui-ink); }
body.app-shell :is(.gun-solution-card h3,.gun-solution-result-head strong,.gun-solution-empty strong,.gun-solution-metrics b) { color:var(--ui-ink); }
body.app-shell :is(.gun-solution-card h4,.gun-solution-author,.gun-solution-card-kicker,.gun-solution-empty p) { color:var(--ui-muted); }
body.app-shell :is(.gun-solution-view-tabs>button,.gun-solution-tabs>button,.gun-solution-favorite-tabs>button,.gun-solution-price-choice) { background:var(--ui-soft);border-color:var(--ui-line);color:var(--ui-muted); }
body.app-shell :is(.gun-solution-view-tabs>button,.gun-solution-tabs>button,.gun-solution-favorite-tabs>button,.gun-solution-price-choice).is-active { background:var(--ui-primary-soft);border-color:var(--ui-primary);color:var(--ui-primary);box-shadow:none; }
body.app-shell :is(.empty,.report-empty,.account-empty) { font-size:13px;line-height:1.75; }

/* Administrator nested dialogs share the same shell, without changing their behavior. */
:is(.web-dialog,.admin-shell .dialog) { padding:0; }
:is(.web-dialog-message,.admin-shell .dialog-message),:is(.web-dialog-field,.admin-shell #dialogField) { margin:0;padding:20px 26px 0;color:var(--ui-muted); }
:is(.web-dialog-field,.admin-shell #dialogField) { padding-bottom:22px; }
:is(.web-dialog-field,.admin-shell #dialogField)[hidden] { display:none; }
:is(.web-dialog-message,.admin-shell .dialog-message):has(+:is(.web-dialog-field,.admin-shell #dialogField)[hidden]) { padding-bottom:22px; }
:is(.web-dialog,.admin-shell .dialog)>:is(#gameBody,#logDetail,#activityUserBody) { padding:22px 26px;min-height:0;overflow:auto; }
:is(.web-dialog,.admin-shell .dialog) .game-item { background:var(--ui-soft);border-color:var(--ui-line);border-radius:14px; }
:is(.web-dialog,.admin-shell .dialog) .detail-grid { color:var(--ui-ink); }
:is(.web-dialog,.admin-shell .dialog) .input,:is(.web-dialog,.admin-shell .dialog) input,:is(.web-dialog,.admin-shell .dialog) select { background:var(--ui-soft);border-color:var(--ui-line);color:var(--ui-ink);border-radius:11px; }
:is(.web-dialog,.admin-shell .dialog) .btn { border-radius:11px;min-height:40px; }
:is(.web-dialog,.admin-shell .dialog) .btn-primary { background:var(--ui-primary);color:var(--ui-primary-ink); }
:is(.web-dialog,.admin-shell .dialog) .btn-danger { background:var(--ui-danger-soft);color:var(--ui-danger); }

/* Public entry pages retain their content and use the same palette and controls. */
body.site-page { background:linear-gradient(115deg,#e8f8e6 0%,#edf5ed 42%,#e4ecfa 100%);color:var(--ui-ink); }
.site-page .btn { border-radius:11px;box-shadow:none; }
.site-page .btn-primary,.login-page .btn:not(.btn-secondary) { background:var(--ui-primary);color:var(--ui-primary-ink); }
.site-page .btn-secondary { background:var(--ui-surface);border-color:var(--ui-line);color:var(--ui-ink); }
.login-page .intro { background:linear-gradient(140deg,#1d3930,#294951 70%,#345778); }
.login-page .input { color:var(--ui-ink);border-color:var(--ui-line);background:var(--ui-soft); }
.login-page .input:focus { border-color:var(--ui-primary);box-shadow:0 0 0 3px var(--ui-primary-soft); }
.site-page :is(.register-message,.contact-item,.registration-note) { background:var(--ui-soft);color:var(--ui-ink);border-color:var(--ui-line); }
.site-page .register-message { border-left-color:var(--ui-primary); }
.site-page :is(.register-dialog-head p,.image-hint,.captcha-hint,.copy-feedback) { color:var(--ui-muted); }

@media(max-width:600px) {
 body.app-shell :is(.action-overlay,.account-overlay,.modal-overlay,.gun-solution-detail-overlay),:is(.web-dialog-overlay,.admin-shell .overlay),.register-dialog-overlay { padding:12px; }
 body.app-shell :is(.action-card,.account-modal,.modal,.gun-solution-detail-card),:is(.web-dialog,.admin-shell .dialog),.register-dialog { max-height:calc(100dvh - 24px);border-radius:18px; }
 body.app-shell :is(.action-card-head,.account-modal-head,.modal-head),:is(.web-dialog-head,.admin-shell .dialog-head),.register-dialog-head { padding:18px 18px 16px;gap:12px; }
 body.app-shell :is(.action-card-head,.account-modal-head,.modal-head) h3,:is(.web-dialog-head,.admin-shell .dialog-head) h3,.register-dialog-head h3 { font-size:18px; }
 body.app-shell :is(.action-card-body,.account-modal-body,.modal-body),body.app-shell .action-card:not(.gun-solution-detail-card)>.action-card-body,.register-dialog-body { padding:18px; }
 body.app-shell :is(.action-card-actions,.gun-solution-detail-footer),:is(.web-dialog-actions,.admin-shell .dialog-actions),.register-dialog-actions { padding:14px 18px;gap:8px; }
 body.app-shell .action-card-actions .btn,:is(.web-dialog-actions,.admin-shell .dialog-actions) .btn { min-height:42px;max-width:100%; }
 body.app-shell .action-card-actions .companion-download-action { min-width:0; }
 body.app-shell .account-form-row { grid-template-columns:minmax(0,1fr); }
 body.app-shell .detail-grid { grid-template-columns:repeat(2,minmax(0,1fr));gap:8px; }
 body.app-shell .detail-item { padding:12px;min-width:0; }
 body.app-shell .detail-item .d-val { overflow-wrap:anywhere; }
 :is(.web-dialog-message,.admin-shell .dialog-message),:is(.web-dialog-field,.admin-shell #dialogField) { padding-left:18px;padding-right:18px; }
 :is(.web-dialog,.admin-shell .dialog)>:is(#gameBody,#logDetail,#activityUserBody) { padding:18px; }
 .register-dialog { max-height:calc(100dvh - 24px); }
}
@media(prefers-reduced-motion:reduce) { body.app-shell .section-open { transition:none; } body.app-shell .section-open:hover { transform:none; } }

.admin-shell .dialog-head{top:0;margin:0}.admin-shell .dialog-actions{bottom:0;margin:0}.admin-shell .dialog .dialog-field{display:grid;gap:8px}.admin-shell .dialog .dialog-field[hidden]{display:none}.admin-shell #logDetail{margin-top:0!important}

.admin-shell .dialog #dialogField{margin:0!important;padding:0 26px 22px}
.admin-shell .dialog-message{padding-bottom:22px}
.admin-shell .dialog .dialog-head>.btn{border-radius:50%;width:38px;height:38px;min-height:38px;padding:0}
body.app-shell :is(.detail-player-items,.item-card){background:var(--ui-soft);border-color:var(--ui-line);border-radius:12px}
body.app-shell :is(.detail-player-items-title,.item-card .item-name){color:var(--ui-ink)}
body.app-shell :is(.detail-player-items-count,.item-card .item-meta){color:var(--ui-muted)}
body.app-shell :is(.modal-body,.account-modal-body,.action-card-body) .profit-pos{color:var(--ui-success)}
body.app-shell :is(.modal-body,.account-modal-body,.action-card-body) .profit-neg{color:var(--ui-danger)}
@media(max-width:600px){.admin-shell .dialog #dialogField{padding-left:18px;padding-right:18px}}

body.app-shell .valuation-section .valuation-missing{color:var(--ui-warning)!important}
.admin-shell .dialog{display:flex;flex-direction:column}
.admin-shell .dialog-message{min-height:0;overflow:auto;overscroll-behavior:contain}
.admin-shell .dialog #dialogField{flex-shrink:0}

.mobile-page .card{background:var(--ui-surface);border-color:var(--ui-line);border-radius:var(--ui-radius)}
.mobile-page :is(.intro,.card p,.note,ol,summary,code,.foot){color:var(--ui-muted)}
.mobile-page header p{color:var(--ui-success)}
.mobile-page .tag{background:var(--ui-success-soft);color:var(--ui-success)}
.mobile-page .download{background:var(--ui-primary);color:var(--ui-primary-ink);border-radius:11px}
.mobile-page .download:hover{filter:brightness(.92)}

/* Match results across lists and detail views with one compact status badge. */
body.app-shell .badge{padding:3px 8px;border:1px solid transparent;border-radius:7px;font-size:11px;font-weight:600;line-height:1.5;white-space:nowrap;vertical-align:middle}
body.app-shell .badge.b0{background:var(--ui-success-soft);color:var(--ui-success);border-color:color-mix(in srgb,var(--ui-success) 22%,transparent)}
body.app-shell .badge.b1{background:var(--ui-danger-soft);color:var(--ui-danger);border-color:color-mix(in srgb,var(--ui-danger) 22%,transparent)}
body.app-shell .badge.b2{background:var(--ui-warning-soft);color:var(--ui-warning);border-color:color-mix(in srgb,var(--ui-warning) 22%,transparent)}
body.app-shell .badge.b3{background:var(--ui-soft);color:var(--ui-muted);border-color:var(--ui-line)}
body.app-shell .overview-records{container-type:inline-size}
body.app-shell .overview-battle{display:grid;grid-template-columns:minmax(0,1fr) 86px 140px;gap:18px;padding:16px 0;min-height:80px;align-items:center}
body.app-shell .overview-battle:first-child{padding-top:4px}
body.app-shell .overview-battle-result{display:flex;flex-direction:column;align-items:flex-start;gap:6px;padding:0;margin:0;border:0;border-radius:0;background:none}
body.app-shell .overview-battle-result small{margin:0;font-size:11px;line-height:1.5;color:var(--ui-muted)}
body.app-shell .overview-battle-result b{color:var(--ui-ink);font-weight:600;font-variant-numeric:tabular-nums}
body.app-shell .overview-battle-profit{position:static;min-width:0;font-size:16px;white-space:normal;overflow-wrap:anywhere;line-height:1.45}
body.app-shell .overview-battle-profit small{font-size:11px;margin-top:5px}
@container(max-width:520px){
 body.app-shell .overview-battle{grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-areas:"main profit" "result result";gap:10px 14px;padding:16px 0}
 body.app-shell .overview-battle-main{grid-area:main}
 body.app-shell .overview-battle-profit{grid-area:profit;align-self:start;font-size:15px}
 body.app-shell .overview-battle-result{grid-area:result;flex-direction:row;align-items:center;gap:12px}
}
body.app-shell .overview-chart-svg{height:250px;min-height:0}
body.app-shell .career-chart-plot{min-width:0}
body.app-shell :is(.trend-axis-label,.trend-value-label){fill:var(--ui-muted);font-family:inherit;font-size:11px;font-weight:400;letter-spacing:normal}
body.app-shell :is(.career-season-chart-card,.trend-chart-stat,.trend-data-chip){background:var(--ui-surface);border-color:var(--ui-line)}
body.app-shell .career-season-chart-card>h3{color:var(--ui-ink)}

body.app-shell .overview-battle-main .overview-battle-meta{display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 8px}
body.app-shell .overview-battle-meta time,body.app-shell .overview-battle-meta .overview-battle-role{white-space:nowrap;font:inherit;margin:0}

/* One consistent pending state across local queries. */
.data-loading{display:flex;align-items:center;justify-content:center;gap:12px;min-height:120px;padding:24px;color:var(--text-muted,#748985)}
.data-spinner{display:inline-block;flex:none;width:22px;height:22px;border:2px solid #9bbdb944;border-top-color:#0b9d85;border-radius:50%;animation:data-spin .85s linear infinite}
@keyframes data-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.data-spinner{animation:none;border-top-width:5px}}

/* Approved UI/UX revision: shared surfaces, compact context, readable mobile data. */
body.app-shell { --camp-button:#285e4d; --camp-accent:var(--ui-primary); --camp-surface:var(--ui-surface); --camp-soft:var(--ui-soft); --camp-line:var(--ui-line); --camp-text:var(--ui-ink); --camp-muted:var(--ui-muted); font-size:14px; }
body.app-shell.light-theme { --camp-button:#214b40; --camp-accent:#24795d; }
body.app-shell .container { padding-top:24px; }
body.app-shell :is(.btn,.toolbar input,.toolbar select) { min-height:40px; }
body.app-shell :is(.btn,.toolbar input,.toolbar select,.career-subtab,.team-count-choice,.career-filter-choice) { border-radius:9px; }
body.app-shell :is(.btn-fetch,.btn-go) { color:#fff; }
body.app-shell :is(.btn-muted,.btn-feedback,.btn-demo) { background:var(--ui-soft);color:var(--ui-ink);border-color:var(--ui-line); }
body.app-shell .workspace-heading { margin-bottom:20px;align-items:center; }
body.app-shell .workspace-heading h1 { font-size:28px;letter-spacing:-.025em; }
body.app-shell .workspace-eyebrow { display:none; }
body.app-shell .workspace-context { flex-direction:row;flex-wrap:wrap;justify-content:flex-end;align-items:center; }
body.app-shell .workspace-player { border:0;background:none;padding:8px 0;line-height:1.6;cursor:pointer;text-align:right;font:inherit;font-size:13px;color:var(--ui-ink); }
body.app-shell .workspace-player:disabled { cursor:default;color:var(--ui-muted); }
.environment-badge { font-size:12px;color:var(--ui-warning);background:var(--ui-warning-soft);padding:4px 8px;border-radius:7px; }
.environment-badge[hidden] { display:none; }
.nav-group-label { color:var(--ui-muted);font-size:12px;padding:10px 14px 4px; }
.nav-group-label:not(:first-child) { border-top:1px solid var(--ui-line);margin-top:6px; }
body.has-ui-dialog { overflow:hidden; }
body.app-shell :is(.overview-muted,.overview-footnote,.overview-footer,.overview-stat-unit,.overview-stat-sample,.overview-item-copy small,.overview-item-price small,.overview-battle-main span,.overview-battle-main small,.overview-battle-result small,.overview-player-name small,.overview-player-count small) { font-size:12px; }
body.app-shell :is(.overview-card,.analysis-section,.career-season-card,.career-season-chart-card,.fetch-main-card,.fetch-status-card,.fetch-data-card,.valuation-entry,.valuation-inline-result,.convenience-tool-content) { border-radius:16px;box-shadow:none; }
body.app-shell :is(.analysis-summary .card,.summary .card)::before { display:none; }
body.app-shell :is(.analysis-section,.chart-box,.card,.analysis-summary .card,.career-metric,.career-report-metrics .career-metric) { background:var(--ui-surface);border-color:var(--ui-line);color:var(--ui-ink);box-shadow:none; }
body.app-shell :is(.card .val,.card .value,.analysis-summary .card .val,.analysis-section h3,.career-head h2,.chart-box h4,.career-report-metrics .career-metric b) { color:var(--ui-ink); }
body.app-shell :is(.card .lbl,.card .label,.card .sub,.analysis-summary .card .lbl) { color:var(--ui-muted);font-size:12px; }
body.app-shell :is(.val,.value,.d-val,.money,.profit-pos,.profit-neg) { font-variant-numeric:tabular-nums; }
body.app-shell .profit-pos { color:var(--ui-success); }
body.app-shell .profit-neg { color:var(--ui-danger); }
body.app-shell :is(.analysis-section,.career-head,.shared-account-head) { margin-bottom:18px; }
body.app-shell .analysis-section::before { display:none; }
body.app-shell .career-head { align-items:center;gap:12px; }
body.app-shell .career-head>.section-description { margin:0; }
body.app-shell .career-head-actions { flex-wrap:wrap; }
body.app-shell .career-refresh-note { background:none;border:0;padding:0;margin-bottom:12px;color:var(--ui-muted);font-size:12px; }
body.app-shell .career-refresh-note.partial { background:var(--ui-warning-soft);padding:12px;color:var(--ui-warning); }
body.app-shell .career-subnav { padding:6px; }
body.app-shell .career-subtab.is-active { background:var(--ui-primary-soft);color:var(--ui-primary);border-color:var(--ui-line); }
body.app-shell .career-subtab { font-size:14px; }
body.app-shell :is(.career-current-assets,.career-map-summary) { gap:12px; }
body.app-shell .career-metric { border:1px solid var(--ui-line);border-radius:10px;padding:14px; }
body.app-shell .career-metric b { font-size:20px; }
body.app-shell :is(.career-season-chart-legend,.career-map-table,.career-asset-table) { color:var(--ui-muted); }
body.app-shell .trend-sticky { padding-top:0;background:var(--ui-canvas); }

/* Dashboard cards share the top and bottom edges of each grid row. */
body.app-shell .overview-heading { margin-bottom:8px;min-height:40px; }
body.app-shell .overview-controls { margin-left:0; }
body.app-shell .overview-range-bar { margin-bottom:14px; }
body.app-shell .overview-summary { gap:14px;margin-bottom:16px; }
body.app-shell .overview-stat { min-height:104px;padding:16px 20px;border-radius:14px; }
body.app-shell .overview-stat:first-child { background:var(--ui-surface); }
body.app-shell .overview-stat strong { font-size:clamp(23px,2.2vw,32px);line-height:1.25;margin-top:8px;letter-spacing:-.025em; }
body.app-shell .overview-stat-sample { color:var(--ui-muted);margin-top:5px;line-height:1.5; }
body.app-shell .overview-grid { grid-template-columns:repeat(12,minmax(0,1fr));gap:18px;align-items:stretch; }
body.app-shell .overview-card { padding:20px; }
body.app-shell .overview-fetch { grid-column:1/-1;grid-row:1;display:grid;grid-template-columns:minmax(0,1fr) auto auto 40px;gap:6px 16px;align-items:center;background:var(--ui-surface); }
body.app-shell .overview-fetch .overview-card-head { display:contents; }
body.app-shell .overview-fetch .overview-card-head>div { grid-column:1;grid-row:1; }
body.app-shell .overview-fetch .section-open { grid-column:4;grid-row:1/span 2; }
body.app-shell .overview-fetch #overviewFetchNote { grid-column:1;grid-row:2;font-size:12px;line-height:1.65; }
body.app-shell .overview-fetch #overviewFetchAction { grid-column:2;grid-row:1/span 2;width:auto;min-width:120px;margin:0;border-radius:9px; }
body.app-shell .overview-fetch .overview-fetch-links { grid-column:3;grid-row:1/span 2;margin:0; }
body.app-shell .overview-fetch #overviewFetchProgress { grid-column:1/-1;margin:0; }
body.app-shell .overview-records { grid-column:1/span 6;grid-row:2; }
body.app-shell .overview-trends { grid-column:7/span 6;grid-row:2; }
body.app-shell .overview-items { grid-column:1/span 6;grid-row:3; }
body.app-shell .overview-players { grid-column:7/span 6;grid-row:3; }
body.app-shell .overview-card-head { margin-bottom:14px; }
body.app-shell .overview-card-head h3 { margin-top:0;font-size:17px; }
body.app-shell .overview-card-head .overview-muted { margin-top:5px; }
body.app-shell .overview-battle { padding:12px 0;min-height:68px;grid-template-columns:minmax(0,1fr) 82px 124px;gap:12px; }
body.app-shell .overview-battle-main strong { font-size:14px; }
body.app-shell .overview-chart-controls { margin-bottom:12px; }
body.app-shell .overview-chart-svg { height:250px; }
body.app-shell .overview-chart-detail { margin-top:8px;min-height:20px; }
body.app-shell .overview-item-list { grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 20px; }
body.app-shell .overview-item { grid-template-columns:40px minmax(0,1fr); }
body.app-shell .overview-item-image { width:40px;height:40px;border-radius:10px; }
body.app-shell .overview-item-copy strong { font-size:14px; }
body.app-shell .overview-item-price { color:var(--ui-ink);font-size:14px; }
body.app-shell .overview-player-list { grid-template-columns:minmax(0,1fr);gap:3px; }
body.app-shell .overview-player { flex-wrap:nowrap;gap:12px;padding:10px 0; }
body.app-shell .overview-player-name { flex-basis:auto; }
body.app-shell .overview-player-count { margin:0;text-align:right; }
body.app-shell .overview-empty { min-height:96px;padding:16px; }
body.app-shell .overview-footnote { margin-top:12px; }
body.app-shell .overview-chart-empty-day { fill:var(--ui-surface);stroke:var(--camp-accent);stroke-width:1.5; }
body.app-shell .overview-chart-gap { stroke:var(--ui-warning);stroke-width:1.5; }
body.app-shell .overview-chart-selected { stroke:var(--camp-accent);stroke-dasharray:4 4;stroke-width:1; }
body.app-shell .overview-chart-legend { color:var(--ui-muted);font-size:12px;line-height:1.6; }

/* Always-visible filters and secondary controls. */
.list-filter-head,.module-actions { display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:12px;color:var(--ui-muted);font-size:13px; }
.quick-date-options { display:flex;flex-wrap:wrap;gap:8px; }
.filter-summary { font-size:12px;color:var(--ui-muted); }
.filter-disclosure,.ui-disclosure { border:1px solid var(--ui-line);border-radius:12px;background:var(--ui-surface);margin:12px 0;min-width:0; }
body.app-shell .filter-disclosure>.toolbar { margin:0;border:0;background:none; }
.ui-disclosure>div { padding:14px; }
.ui-disclosure .scroll-table { border-radius:8px; }
body.app-shell .gun-filters-primary { grid-template-columns:repeat(3,minmax(0,1fr)) auto;align-items:end; }
body.app-shell .gun-advanced-filters .gun-solution-filters { margin:0;border:0; }
body.app-shell .export-options { position:relative;margin-left:auto;border:1px solid var(--ui-line);border-radius:10px;background:var(--ui-surface); }
.export-options-body { display:flex;gap:8px;flex-wrap:wrap;padding:12px;border-top:1px solid var(--ui-line); }
body.app-shell .team-filter { padding:14px;border-radius:12px;border:1px solid var(--ui-line);background:var(--ui-surface); }
body.app-shell .team-hint { font-size:13px;color:var(--ui-muted);margin-bottom:10px; }
body.app-shell .player-item { font:inherit;text-align:left;color:var(--ui-ink);cursor:pointer; }
.team-player-summaries { display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr));gap:12px;margin:14px 0; }
.team-player-summaries>article,.team-player-summaries>.card { padding:16px;border:1px solid var(--ui-line);border-radius:12px;background:var(--ui-surface); }
.asset-secondary-counts { display:flex;flex-wrap:wrap;gap:8px 20px;font-size:13px;color:var(--ui-muted);margin:0 0 16px; }
.asset-data-note { margin:0 0 14px; }
body.app-shell #panel-assets .asset-tabs-row { align-items:center;gap:12px; }
body.app-shell #panel-assets .toolbar { padding-block:10px; }
body.app-shell #panel-assets :is(.asset-preview,img) { object-fit:contain;max-width:100%; }

/* Task feedback is shared across pages, rather than blocking existing results. */
.client-task-status,.connection-status { display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px 16px;padding:12px 16px;background:var(--ui-primary-soft);border:1px solid var(--ui-line);border-radius:12px;margin-bottom:16px;color:var(--ui-ink);font-size:13px; }
.connection-status { background:var(--ui-warning-soft);color:var(--ui-warning); }
.client-task-status[hidden],.connection-status[hidden],.fetch-outcome[hidden] { display:none!important; }
.client-task-status button,.connection-status button { margin:0; }
.fetch-identity-summary { font-size:13px;color:var(--ui-muted);line-height:1.8;margin:16px 0; }
.fetch-primary-actions,.fetch-secondary-actions { display:flex;align-items:center;gap:10px;flex-wrap:wrap; }
.fetch-primary-actions { margin:18px 0; }
.fetch-primary-actions>.btn-go { min-width:150px; }
/* Keep the two work cards aligned while the log scrolls inside its own frame. */
body.app-shell .fetch-work-grid { align-items:stretch; }
body.app-shell .fetch-status-card { position:static;top:auto; }
.fetch-other-controls { display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:14px;min-width:0; }
.fetch-count-actions,.fetch-option-field { display:flex;align-items:center;gap:8px;min-width:0; }
.fetch-count-actions { flex-wrap:wrap; }
.fetch-option-field label { color:var(--ui-muted);font-size:13px;white-space:nowrap; }
body.app-shell .fetch-other-controls #fetchQueue { width:120px;min-width:0; }
body.app-shell .fetch-other-controls #fetchCount { width:90px;min-width:0; }
body.app-shell .fetch-other-controls .btn { min-height:40px;padding-inline:10px;font-size:13px;white-space:nowrap; }
.fetch-other-controls .fetch-secondary-actions { flex-wrap:nowrap;gap:8px;padding:0 0 0 12px;border-left:1px solid var(--ui-line); }
@media(max-width:767px) {
 .fetch-other-controls { align-items:stretch;gap:12px; }
 .fetch-count-actions { width:100%; }
 .fetch-other-controls .fetch-secondary-actions { width:100%;flex-wrap:wrap;border-left:0;border-top:1px solid var(--ui-line);padding:12px 0 0; }
 body.app-shell .fetch-other-controls :is(.btn,select,input) { min-height:44px; }
}
.fetch-help { background:none;border:0;margin-bottom:0; }
.fetch-help .fetch-hint { padding:12px; }
.fetch-outcome:empty,.fetch-identity-summary:empty { display:none; }
.fetch-outcome { margin:14px 0 16px;padding:14px;border:1px solid var(--ui-line);border-radius:12px;background:var(--ui-soft);font-size:14px;line-height:1.75; }
.fetch-outcome ul { padding-left:20px;margin:10px 0; }
.fetch-outcome.is-partial,.fetch-outcome.partial { color:var(--ui-warning);background:var(--ui-warning-soft); }
.fetch-outcome button { margin-top:10px; }
body.app-shell #fetchLogDetails { overflow:hidden; }
body.app-shell #fetchLog { min-height:0;max-height:300px;overflow-y:auto;overflow-x:hidden;scrollbar-gutter:stable;margin:0;padding:14px;font-size:12px;font-family:inherit;overflow-wrap:anywhere;background:var(--ui-soft)!important;color:var(--ui-muted)!important; }
body.app-shell .fetch-status-card:not(:has(.fetch-progress[style*="block"])):not(:has(#fetchOutcome:not(:empty))):not(:has(#fetchLog:not(:empty))) { border-style:dashed; }
.fetch-data-card p { max-width:70ch; }
#itemResultNote { margin:0 0 12px; }
#sharedReadProgress { display:flex;gap:12px;align-items:center;flex-wrap:wrap;font-size:13px;color:var(--ui-muted);margin:10px 0; }
#sharedReadProgress:empty { display:none; }

/* Mobile records keep the outcome visible without sideways navigation. */
.records-mobile-list { display:none; }
.battle-record-card { padding:16px;background:var(--ui-surface);border:1px solid var(--ui-line);border-radius:14px;min-width:0; }
.battle-record-card button { font:inherit; }
.battle-record-card :is(.battle-card-head,.record-card-head,.battle-record-head,.battle-record-title,.battle-record-meta,.record-card-meta) { display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap; }
.battle-record-card :is(h3,strong) { color:var(--ui-ink);font-size:15px; }
.battle-record-card :is(.profit-pos,.profit-neg) { font-size:21px;font-weight:650; }
.battle-record-card :is(small,time,.record-meta,.battle-record-meta,.record-card-meta) { color:var(--ui-muted);font-size:12px;line-height:1.7; }
.battle-record-card .btn { width:100%;margin:10px 0 0; }
.battle-record-card .tag-list { margin-top:10px; }
body.app-shell .detail-outcome { display:flex;gap:16px;align-items:center;justify-content:space-between;flex-wrap:wrap;padding:16px;background:var(--ui-soft);border:1px solid var(--ui-line);border-radius:12px;margin-bottom:16px; }
body.app-shell .detail-outcome strong { font-size:24px;font-variant-numeric:tabular-nums; }
body.app-shell .detail-meta { display:flex;gap:10px 22px;align-items:center;flex-wrap:wrap;color:var(--ui-muted);font-size:13px;margin:12px 0; }
body.app-shell .detail-meta small { font-size:12px; }
body.app-shell .modal-body .detail-grid { gap:8px; }
body.app-shell .modal-body .detail-item { padding:10px 12px;border-radius:9px; }
body.app-shell .modal-body .ui-disclosure>.detail-grid { padding:12px; }

@container(max-width:520px) {
 body.app-shell .overview-battle { grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-areas:"main profit" "result result";gap:8px 12px; }
}
@media(min-width:1800px) {
 body.app-shell .overview-card { padding:24px; }
 body.app-shell .overview-battle { grid-template-columns:minmax(0,1fr) 110px 160px; }
}
@media(max-width:1100px) {
 body.app-shell .overview-item-list { grid-template-columns:minmax(0,1fr); }
 body.app-shell .overview-fetch { grid-template-columns:minmax(0,1fr) auto 40px; }
 body.app-shell .overview-fetch .section-open { grid-column:3; }
 body.app-shell .overview-fetch .overview-fetch-links { grid-column:1;grid-row:3; }
 body.app-shell .overview-fetch #overviewFetchProgress { grid-row:4; }
 body.app-shell .gun-filters-primary { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:767px) {
 body.app-shell .workspace-heading { gap:10px;margin-bottom:18px;align-items:flex-start; }
 body.app-shell .workspace-context { justify-content:flex-start; }
 body.app-shell .workspace-player { text-align:left;flex-basis:auto;font-size:12px; }
 body.app-shell .workspace-heading h1 { font-size:25px; }
 body.app-shell .overview-summary { grid-template-columns:repeat(2,minmax(0,1fr));gap:10px; }
 body.app-shell .overview-stat { padding:14px;min-height:103px; }
 body.app-shell .overview-stat strong { font-size:25px; }
 body.app-shell .overview-grid { display:flex;flex-direction:column;gap:16px; }
 body.app-shell .overview-card { width:100%;padding:16px; }
 body.app-shell .overview-fetch { display:grid;order:0;grid-template-columns:minmax(0,1fr) 44px;gap:8px 12px; }
 body.app-shell .overview-fetch .overview-card-head>div { grid-column:1;grid-row:1; }
 body.app-shell .overview-fetch .section-open { grid-column:2;grid-row:1; }
 body.app-shell .overview-fetch #overviewFetchNote { grid-column:1/-1;grid-row:2; }
 body.app-shell .overview-fetch #overviewFetchAction { grid-column:1/-1;grid-row:3;width:100%; }
 body.app-shell .overview-fetch .overview-fetch-links { grid-column:1/-1;grid-row:4; }
 body.app-shell .overview-fetch #overviewFetchProgress { grid-row:5; }
 body.app-shell .overview-records { order:1; }
 body.app-shell .overview-trends { order:2; }
 body.app-shell .overview-items { order:3; }
 body.app-shell .overview-players { order:4; }
 body.app-shell .overview-heading { flex-direction:row; }
 body.app-shell .overview-controls { width:100%; }
 body.app-shell .overview-controls select { max-width:none; }
 body.app-shell .overview-item-list { grid-template-columns:minmax(0,1fr); }
 body.app-shell .overview-stat-sample { font-size:12px; }
 body.app-shell .overview-item { padding:6px 0; }
 body.app-shell .overview-chart-svg { height:250px; }
 body.app-shell .overview-player { align-items:flex-start; }
 body.app-shell .overview-player-count { white-space:normal;max-width:45%; }
 .records-mobile-list { display:grid;gap:12px; }
 body.app-shell .records-table { display:none; }
 .list-filter-head { align-items:flex-start; }
 .filter-summary { flex-basis:100%; }
 body.app-shell .gun-filters-primary { grid-template-columns:minmax(0,1fr); }
 body.app-shell .export-options { width:100%;margin-left:0; }
 body.app-shell .export-options-body { flex-direction:column; }
 body.app-shell .team-filter input[type=time] { max-width:100px; }
 body.app-shell .fetch-status-card { position:static; }
 body.app-shell .fetch-primary-actions .btn { flex:1; }
 .team-player-summaries { grid-template-columns:minmax(0,1fr); }
 body.app-shell .modal-overlay:has(>.modal) { padding:0; }
 body.app-shell .modal-overlay>.modal { width:100%;max-height:100dvh;height:100dvh;border-radius:0; }
 body.app-shell .shared-record-row { align-items:center; }
 body.app-shell :is(.shared-record-profit,.shared-record-result) { display:block; }
}
@media(max-width:600px) {
 body.app-shell :is(button,.btn,.shell-icon-button,.section-open,.career-subtab,.career-legend-choice,.trend-range-btn,.team-count-choice) { min-height:44px; }
 body.app-shell :is(.shell-icon-button,.section-open,.modal-close,.close-link) { min-width:44px;width:44px;height:44px;flex-basis:44px; }
 body.app-shell :is(input,select,textarea) { font-size:16px;min-height:44px;max-width:100%; }
 body.app-shell .overview-stat strong { font-size:24px; }
 body.app-shell .overview-footer { font-size:12px; }
 body.app-shell :is(.action-card-actions,.account-actions,.dialog-actions) .btn { min-height:44px; }
 body.app-shell .toolbar { align-items:flex-start; }
 body.app-shell .toolbar label { line-height:44px; }
 .ui-disclosure>div { padding:10px; }
}

/* Content produced by the shared renderers. */
body.app-shell #assetSummaryCards { display:block; }
.asset-primary-metrics { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:12px; }
.asset-primary-metrics .card { padding:18px; }
.asset-primary-metrics .val { font-size:28px;line-height:1.4;font-weight:650; }
.asset-secondary-counts .btn { margin:0; }
.table-sort { border:0;background:none;color:inherit;font:inherit;cursor:pointer;min-height:32px; }
.ui-read-error,.ui-empty-state { padding:20px 16px;font-size:14px;line-height:1.7;color:var(--ui-muted);background:var(--ui-soft);border-radius:12px;white-space:normal; }
.ui-read-error { color:var(--ui-warning);background:var(--ui-warning-soft); }
.ui-read-error .btn { margin:10px 0 0; }
.ui-read-error p { margin-top:5px; }
.battle-record-heading,.battle-record-result,.battle-record-footer { display:flex;justify-content:space-between;align-items:center;gap:12px; }
.battle-record-heading { margin-bottom:4px; }
.battle-record-result { margin:12px 0;font-size:12px;color:var(--ui-muted);flex-wrap:wrap; }
.battle-record-result>strong { text-align:right; }
.battle-record-result small { display:block;font-weight:400; }
.battle-record-footer { padding-top:10px;border-top:1px solid var(--ui-line);flex-wrap:wrap; }
.battle-record-card .battle-record-footer .btn { margin:0;width:auto; }
.team-player-summaries article { min-width:0;display:flex;flex-direction:column;gap:14px;font-size:13px;color:var(--ui-muted); }
.team-player-summaries article>strong { font-size:15px;color:var(--ui-ink);overflow-wrap:anywhere; }
.team-player-metrics { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px 12px;margin:0;padding-top:14px;border-top:1px solid var(--ui-line); }
.team-player-metrics>div { min-width:0; }
.team-player-metrics dt { margin:0 0 5px;font-size:12px;color:var(--ui-muted); }
.team-player-metrics dd { margin:0;color:var(--ui-ink);font-size:16px;font-weight:650;line-height:1.4;font-variant-numeric:tabular-nums;overflow-wrap:anywhere; }
@media(max-width:600px) { .team-player-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); } }
.detail-secondary { border-top:1px solid var(--ui-line);padding-top:12px;margin-top:16px; }
body.app-shell .detail-outcome .detail-item { border:0;padding:0;background:none;flex:1;min-width:100px; }
body.app-shell .detail-outcome .d-val { font-size:22px;font-weight:650; }
body.app-shell .detail-outcome .d-label { font-size:12px; }
[aria-busy="true"] { cursor:progress; }
.records-mobile-list[aria-busy="true"]:not(:has(.data-loading))::before { content:"正在更新战绩…";color:var(--ui-muted);font-size:12px; }
body.app-shell .toolbar input[type="time"] { font-variant-numeric:tabular-nums; }
@media(max-width:767px) {
 .asset-primary-metrics { grid-template-columns:repeat(2,minmax(0,1fr));gap:10px; }
 .asset-primary-metrics .val { font-size:23px; }
 body.app-shell #panel-items .items-table { overflow:visible;background:none;border:0; }
 body.app-shell #panel-items .items-table :is(table,tbody) { display:block;width:100%;min-width:0; }
 body.app-shell #panel-items .items-table thead { display:none; }
 body.app-shell #panel-items .items-table tbody>tr { display:grid;grid-template-columns:minmax(0,1fr);border:1px solid var(--ui-line);border-radius:14px;background:var(--ui-surface);padding:14px;margin-bottom:12px; }
 body.app-shell #panel-items .items-table td { display:flex;justify-content:space-between;align-items:center;gap:16px;border:0;padding:5px 0;text-align:right;white-space:normal;overflow-wrap:anywhere;font-size:14px; }
 body.app-shell #panel-items .items-table td[data-label]::before { content:attr(data-label);color:var(--ui-muted);font-size:12px;text-align:left;flex:0 0 65px; }
 body.app-shell #panel-items .items-table td[colspan] { display:block; }
 body.app-shell .shared-record-row { display:grid;grid-template-columns:26px minmax(0,1fr) auto;gap:8px;padding:12px; }
 body.app-shell .shared-record-row>.shared-record-check { grid-column:1;grid-row:1/span 2;min-height:24px;min-width:24px;margin:auto 0; }
 body.app-shell .shared-record-row>.shared-record-time { grid-column:2;grid-row:1;white-space:normal; }
 body.app-shell .shared-record-row>.shared-record-cell:nth-child(3) { grid-column:2;grid-row:2; }
 body.app-shell .shared-record-row>.shared-record-role { grid-column:2;grid-row:3;display:block; }
 body.app-shell .shared-record-row>.shared-record-outcome { grid-column:3;grid-row:1;display:block;text-align:right; }
 body.app-shell .shared-record-row>.shared-record-profit { grid-column:3;grid-row:2;display:block;text-align:right; }
 body.app-shell .shared-record-row>:last-child { grid-column:2/span 2;grid-row:4; }
}

/* Native hidden state always wins over a component layout rule. */
body.app-shell [hidden]{display:none!important}

/* Item cards retain every field while putting the item and price first. */
@media(max-width:767px) {
 body.app-shell #panel-items .items-table tbody>tr { grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 12px; }
 body.app-shell #panel-items .items-table td { min-width:0;flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:3px;text-align:left; }
 body.app-shell #panel-items .items-table td[data-label]::before { flex:0 0 auto; }
 body.app-shell #panel-items .items-table td[data-label="物品名"] { grid-column:1;grid-row:1;font-weight:650;font-size:16px; }
 body.app-shell #panel-items .items-table td[data-label="单价"] { grid-column:2;grid-row:1;align-items:flex-end;font-size:17px;font-weight:650; }
 body.app-shell #panel-items .items-table td[colspan] { grid-column:1/-1; }
}

/* Read directly; row clicks retain keyboard access without a separate action column. */
.ui-section-title { margin:0;padding:12px 16px;color:var(--ui-ink);font-size:14px;font-weight:600;line-height:1.6; }
.ui-section-title span { color:var(--ui-muted);font-size:12px;font-weight:400;margin-left:8px; }
.filter-disclosure>.ui-section-title,.ui-disclosure>.ui-section-title { border-bottom:1px solid var(--ui-line); }
body.app-shell .export-options { display:flex;align-items:center;flex-wrap:wrap; }
body.app-shell .export-options>.ui-section-title { padding:10px 4px 10px 12px;font-size:12px; }
body.app-shell .export-options-body { padding:8px;border-top:0; }
body.app-shell .fetch-help>.ui-section-title { padding-left:0;color:var(--ui-muted);border:0; }
#fetchLog:empty::before { content:"暂无任务记录，开始更新后会在这里显示。";color:var(--ui-muted); }
body.app-shell .battle-detail-row { cursor:pointer; }
body.app-shell .battle-detail-row:focus-visible { outline:2px solid var(--ui-primary);outline-offset:-2px; }
body.app-shell .battle-record-card.battle-detail-row:hover { border-color:var(--ui-primary); }
body.app-shell .detail-player-block .section-title { margin-top:20px; }
body.app-shell .modal-body .detail-grid { grid-template-columns:repeat(3,minmax(0,1fr));gap:12px; }
body.app-shell .modal-body .player-row { gap:10px;padding:12px; }
body.app-shell .modal-body .detail-item { padding:12px;min-width:0; }
body.app-shell .modal-body .d-val { overflow-wrap:anywhere; }
body.app-shell .modal-body .d-label { font-size:12px; }
@media(max-width:767px) {
 .ui-section-title span { display:block;margin-left:0; }
 body.app-shell .modal-body .detail-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
 body.app-shell .modal-body .player-row { grid-template-columns:repeat(2,minmax(0,1fr)); }
 body.app-shell .export-options-body { flex-direction:row; }
}
