/* Shared semantic tokens. Legacy names remain aliases during screen migration. */
:root, :root[data-theme] {
 --ds-space-1:4px; --ds-space-2:8px; --ds-space-3:12px; --ds-space-4:16px; --ds-space-6:24px; --ds-space-8:32px;
 --ds-radius-control:12px; --ds-radius-card:16px; --ds-radius-sheet:24px;
 --ds-touch:44px; --ds-control:48px; --ds-duration:180ms;
 --ds-bg:#efeff4; --ds-surface:#fff; --ds-text:#17202a; --ds-secondary:#606975;
 --ds-line:#d9dde4; --ds-control-border:#7f8793; --ds-accent:#126eb3; --ds-on-accent:#fff; --ds-soft:#e8f2fc;
 --ds-danger:#b52c36; --ds-success:#23733d; --ds-warning:#805500; --ds-focus:#126eb3;
 --bg:var(--ds-bg); --surface:var(--ds-surface); --text:var(--ds-text); --hint:var(--ds-secondary);
 --line:var(--ds-line); --accent:var(--ds-accent); --button-text:var(--ds-on-accent); --accent-soft:var(--ds-soft);
}
:root[data-theme=dark] {
 color-scheme:dark; --ds-bg:#171719; --ds-surface:#252529; --ds-text:#f4f4f7; --ds-secondary:#b1b1bd;
 --ds-line:#414149; --ds-control-border:#777984; --ds-accent:#72b9f2; --ds-on-accent:#112538; --ds-soft:#24394b;
 --ds-danger:#ff939b; --ds-success:#83d49d; --ds-warning:#f3c469; --ds-focus:#91caff;
}
:root[data-theme=light]{color-scheme:light}
.ds {background:var(--bg);color:var(--text);font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;line-height:1.4}
.ds :where(button,input,select,textarea){font:inherit}
.ds :where(button,a,input,textarea,select,summary):focus-visible {outline:3px solid var(--ds-focus);outline-offset:3px}
.ds :where(button:disabled){cursor:default;opacity:.55}
.ds :where(.primary,.secondary,.ds-button){min-height:var(--ds-control);border-radius:var(--ds-radius-control);font-size:16px;font-weight:600;padding:12px 16px}
.ds :where(.primary,.ds-button-primary){background:var(--accent);color:var(--button-text)}
.ds :where(.secondary,.ds-button-secondary){background:var(--accent-soft);color:var(--accent)}
.ds :where(.text-button,.ds-button-text){min-height:var(--ds-touch);color:var(--accent)}
.ds :where(.danger,.ds-danger){color:var(--ds-danger)}
.ds .sheet-heading .circle-button,.ds .listing-footer .secondary,.ds .listing-footer .report-button,
.ds :where(.circle-button,.feed-icon-button,.header-button,.pc-icon){min-width:var(--ds-touch);min-height:var(--ds-touch);height:auto}
.ds :where(.panel,.listing,.ds-card){border-radius:var(--ds-radius-card)}
.ds :where(.field input,.field select,.field textarea,.collective-form input,.collective-form select,.collective-form textarea,.ds-field input){min-height:var(--ds-control);font-size:16px;border-radius:var(--ds-radius-control);border:1px solid var(--line);background:var(--surface);color:var(--text)}
.ds :where(.field,.ds-field){font-size:14px}
.ds :where(.row-note,.footnote){font-size:14px;line-height:1.45;color:var(--hint)}
.ds :where(.row){min-height:var(--ds-control)}
.ds :where(.row-content){min-width:0}
.ds :where(.row-title){overflow-wrap:anywhere}
.ds :where(.sheet-heading h2,.ds-section-title){font-size:20px;line-height:1.3}
.ds :where(dialog:not(.pc-player):not(.feed-photo-viewer)){border-radius:var(--ds-radius-sheet)}
.ds :where(.filter-line,.pc-segments,.pc-detail-tabs){gap:4px}
.ds :where(.filter,.pc-segments button,.pc-detail-tabs button){min-height:44px;border-radius:12px;font-size:14px;padding:10px 14px}
.ds :is(.filter.active,.pc-segments .selected,.pc-detail-tabs .selected){background:var(--accent);color:var(--button-text)}
.ds .pc-detail-tabs .selected:after{display:none}
.ds-status{display:inline-flex;align-items:center;gap:8px;border-radius:8px;padding:4px 8px;background:var(--accent-soft);font-size:14px;color:var(--text)}
.ds-status-success{color:var(--ds-success)}
.ds-status-warning{color:var(--ds-warning)}
.ds h1{font-size:28px;line-height:34px;letter-spacing:-.5px}
.ds-metadata{font-size:12px;line-height:16px;color:var(--hint)}
.ds .row input[role=switch]{width:44px;height:28px;flex-shrink:0;accent-color:var(--accent)}
.ds .row:has(input[role=switch]){min-height:48px;gap:12px}
.ds-message{font-size:14px;line-height:1.45;margin:12px 0;overflow-wrap:anywhere}
.ds-message-error{color:var(--ds-danger)}
.ds-empty{padding:24px 16px;text-align:center;color:var(--hint)}
.ds-empty h2{font-size:20px;color:var(--text)}
.ds-empty button{margin-top:12px}
.ds [aria-busy=true].ds-button{cursor:progress}
.ds-catalog{max-width:920px;margin:auto;padding:24px 16px 64px}
.ds-catalog section{margin:24px 0;padding:16px;background:var(--surface);border-radius:16px}
.ds-catalog .ds-examples{display:flex;flex-wrap:wrap;align-items:center;gap:12px}
.ds-catalog label{display:block;margin:12px 0}
.ds-catalog input{display:block;padding:12px;margin-top:8px;max-width:100%;box-sizing:border-box}
@media(prefers-reduced-motion:reduce){.ds *,.ds *:before,.ds *:after{animation-duration:0s!important;transition-duration:0s!important;scroll-behavior:auto!important}}

.ds-button{border:0;cursor:pointer}
.ds .stats button.stat{min-height:var(--ds-control);color:var(--accent);border:0;border-radius:0;background:none;box-shadow:none}
.ds .completed-tasks{margin-top:var(--ds-space-4)}
.ds .completed-tasks summary{min-height:var(--ds-control);padding:var(--ds-space-4);cursor:pointer;font-weight:600}
.ds .history-balance{margin:var(--ds-space-4) 0;font-size:18px}
.ds .amount{white-space:nowrap;flex-shrink:0}
.ds .amount-debit{color:var(--text)}
.ds .deal-drop{border-radius:var(--ds-radius-card)}
.ds .deal-market,.ds .deal-drop-body small,.ds .deal-price s,.ds .deal-discount{font-size:14px;line-height:1.45}
.ds .deal-price,.ds .deal-info>strong{font-size:16px}
.ds .deal-drop-body strong,.ds .deal-drop-body small{overflow-wrap:anywhere}
.ds .pc-mini [data-playback-state]{font-size:14px;white-space:normal;line-height:1.35}
.ds .pc-player-error{font-size:14px;line-height:1.45}
.ds-spacing-sample{background:var(--accent-soft);border:1px solid var(--line);border-radius:4px}
.ds-cover-placeholder{width:64px;aspect-ratio:1;display:grid;place-items:center;background:var(--accent-soft);border-radius:12px}
.ds-catalog .ds-examples{margin-top:16px}
.ds-catalog .row input{margin:0;padding:0}
.ds-catalog .row{max-width:100%}
.ds-catalog .row>span{min-width:0;overflow-wrap:anywhere}
.ds #example-dialog{width:min(480px,calc(100% - 24px));padding:24px;background:var(--surface);color:var(--text);border:1px solid var(--line)}
.ds .feed-photo-viewer>img{touch-action:pan-y pinch-zoom}
.ds .pc-sub-actions{flex-wrap:wrap}
.ds .pc-sub-actions .ds-message{flex-basis:100%;margin:8px 0}

.ds .ds-radio-list .row{gap:12px;cursor:pointer}
.ds .ds-radio-list input[type=radio]{width:22px;height:22px;flex-shrink:0;accent-color:var(--accent);margin:0}

/* Common surfaces must reflow when the user enlarges text. */
.ds :is(.heading-line,.sheet-heading)>:is(h1,h2){min-width:0;overflow-wrap:anywhere}
.ds :is(.heading-line,.sheet-heading)>.circle-button{flex-shrink:0}
.ds h1{line-height:1.215}
.ds .topbar{height:auto;min-height:48px;flex-wrap:wrap;gap:8px}
.ds .stat{min-width:0;overflow-wrap:anywhere}
.ds .tag-options label{max-width:100%}
.ds .tag-options span{min-height:44px;display:flex;align-items:center;overflow-wrap:anywhere}
.ds .feed-compose-toolbar .feed-publish{min-height:48px}
.ds-catalog{overflow-wrap:anywhere}

.ds :is(.field input,.field select,.field textarea,.collective-form input,.collective-form select,.collective-form textarea,.ds-field input){border-color:var(--ds-control-border);min-height:var(--ds-control);font-size:16px}
.ds .stats{grid-template-columns:repeat(auto-fit,minmax(min(100%,5em),1fr))}
.ds .tabbar button>span:not([data-icon]){max-width:100%;overflow-wrap:anywhere}
.ds-catalog label.row{display:flex}

.ds .lootbox-card{padding:16px}
.ds .lootbox-card h2{margin-bottom:8px;overflow-wrap:anywhere}
.ds .lootbox-card [data-box-price]{margin-bottom:16px}

.ds .community-navigation{display:flex;flex-wrap:wrap;gap:12px;margin:16px 0 0}

/* Stat tiles share geometry whether informational or an action button. */
.ds .stats > .stat{display:grid;grid-template-rows:auto 1fr;align-content:start;align-items:start;justify-items:center;gap:4px;min-width:0;padding:0 6px;line-height:1.25;text-align:center}
.ds .stats > .stat strong{margin:0;font-size:24px;line-height:30px;font-variant-numeric:tabular-nums}
.ds .stats > .stat span{display:block;margin:0;font-size:12px;line-height:16px}
