/* Melopod's shared editorial finish.
 * Named legacy surfaces only: never reset all descendants, SVGs, avatars,
 * vinyl records, artwork palettes, player overlays, switches or chat bubbles.
 * Loaded in the common head; specificity wins over later page-local styles.
 * Important declarations are limited to visual properties overridden inline
 * or by older mobile rules. Layout, visibility and event hooks remain local.
 */

/* Utilities, management screens, uploads and transaction pages. */
html:root body :is(.mp-panel,.mp-empty,.mp-create-dialog,.mp-create-option,
 .music-panel,.music-empty,.music-notice,.music-options>div,.music-manager-row,
 .market-wrap>.market-card,.direct-layout>.market-card,.market-form,.empty-market,
 .summary-card,.my-track-row,.empty-my-tracks,.track-upload-card,.track-drop,.track-tips,
 .create-world-form,.create-world-visibility label,.competition-form,.fund-now-row,
 .admin-nav,.admin-card,.admin-stat,.admin-report,.admin-item,.admin-audit,.admin-empty,
 .collab-panel,.collab-request,.collab-source,.collab-project-card,.collab-project-note,
 .collab-return,.collab-chat,.collab-members li,.cu-panel,.world-shell,
 .engage-card,.rising-card,.goal,.empty-card,.streak,
 .legal-summary,.support-form,.faq-empty,.policy-consent,.policy-modal-card,
 .review-card,.form-alert,.track-upload-error,.create-world-error,.competition-error,
 .mp-publish-progress,.mp-publish-inline-error,.mp-search-form input,.mp-chip,
 .app-search,.global-search-results,.global-search-result,.top-profile-menu,
 .mp-search-card,.worlds-empty,.competition-empty,.music-art-preview,
 .fss-card,.fss-prompt-card,.fss-empty,.fss-recording-item,.fss-stats-grid>div,
 .dash-card,.metric-card,.manage-card,.manage-thumb,.transaction-room-list,
 .admin-video-repair__panel,.admin-video-repair__notice,.join-world-card,.join-world-help,
 .world-rules,.world-link-card,.world-share,.world-chat-header,.feedback-stat,
 .path-card,.stat-card,.unit-card,.side-card,.lesson-shell,.concept-card,.activity-card,.era-card) {
 border-radius:2px!important;box-shadow:none;
}
html:root body :is(.track-upload-card,.track-tips,.summary-card,.empty-my-tracks,
 .admin-card,.admin-stat,.admin-report,.admin-item,.admin-audit,.admin-empty,
 .market-wrap>.market-card,.direct-layout>.market-card,.market-form,.empty-market,
 .create-world-form,.create-world-visibility label,.competition-form,
 .legal-summary,.support-form,.faq-empty,.review-card,.engage-card,.rising-card,.goal,
 .empty-card,.streak,.worlds-empty,.competition-empty,.dash-card,.metric-card,
 .manage-card,.admin-video-repair__panel,.join-world-card,.join-world-help) {
 background:var(--mp-surface);color:var(--mp-text);border-color:var(--mp-border);box-shadow:none;
}

/* Flat page headings, not promotional hero panels. Preserve poster art. */
html:root body :is(.market-hero,.create-world-intro,.join-world-intro,.my-tracks-hero,
 .help-hero,.fss-head,.for-you-hero,.path-hero,.learn-intro,.creator-hero,.school-hero) {
 background:transparent;color:var(--mp-text);border:0;border-radius:0;
 box-shadow:none;min-height:0;padding:24px 0;margin-bottom:24px;
}
html:root body :is(.market-hero,.create-world-intro,.join-world-intro,.help-hero,.fss-head,.for-you-hero)::before,
html:root body :is(.market-hero,.create-world-intro,.join-world-intro,.help-hero,.fss-head,.for-you-hero)::after {display:none}
html:root body :is(.market-hero,.create-world-intro,.join-world-intro,.help-hero,.fss-head,.for-you-hero) :is(h1,h2) {
 color:var(--mp-text);font-family:var(--mp-font);font-size:clamp(28px,4vw,42px)!important;
 line-height:1.12;letter-spacing:-.035em;margin:8px 0 12px;
}
html:root body :is(.market-hero,.create-world-intro,.join-world-intro,.help-hero,.fss-head,.for-you-hero) :is(p,.lead,.eyebrow) {color:var(--mp-muted)}
html:root body :is(.mp-page-header,.mp-premium-feature-page,.ce-page) h1 {font-size:clamp(28px,4vw,42px);line-height:1.12}
html:root body .app-page>.page-title {font-size:clamp(28px,4vw,42px);line-height:1.12}

/* Shared rectangular actions; circular audio/collaboration icons are excluded. */
html:root body :is(.mp-button,.mp-chip,.music-button,.music-nav a,.collab-button,
 .track-publish,.track-cancel,.competition-submit,.competition-cancel,.prize-tier-add,
 .create-world-submit,.my-tracks-actions a,.empty-my-tracks a,.admin-nav a,
 .help-categories button,.policy-tabs button,.policy-modal-actions button,
 .mp-create-option-icon,.mp-library-button,.ce-button,.fss-btn-big,.fss-btn-secondary,.fss-btn-danger,
 .dash-actions a,.dash-quick a,.dash-quick button,.btn-save,.btn-delete,.admin-video-repair__button,
 .join-world-submit,.world-members-toggle,.world-share button) {
 border-radius:2px!important;text-decoration:none;box-shadow:none;
}
html:root body :is(.app-page,.market-wrap,.auth-card,.legal-top,.help-page) :is(.primary,.secondary,.social-btn) {
 border-radius:2px!important;text-decoration:none;box-shadow:none;
}
html:root body :is(.track-publish,.competition-submit,.create-world-submit,.join-world-submit,.btn-save) {
 background:var(--mp-accent);color:var(--mp-on-accent);border:1px solid transparent;
 min-height:44px;box-shadow:none;
}
html:root body :is(.track-cancel,.competition-cancel,.prize-tier-add) {
 background:var(--mp-surface-soft);color:var(--mp-text);border:1px solid var(--mp-border);min-height:44px;
}

/* Form controls: do not size checkboxes, ranges, file controls or player inputs. */
html:root body :is(.track-field,.create-world-field,.competition-form,.admin-page,
 .market-form,.direct-form,.mp-premium-form,.rq-fields,.music-editor,.collab-page,
 .mp-settings-page,.auth-card,.support-form,.help-search,.mp-search-form,.join-world-form,.manage-card)
 :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=hidden]):not([type=file]),select,textarea) {
 box-sizing:border-box;max-width:100%;min-width:0;min-height:44px;border:1px solid var(--mp-border);
 border-radius:2px!important;background:var(--mp-surface);color:var(--mp-text);font-family:var(--mp-font);box-shadow:none;
}
html:root body :is(.track-field,.create-world-field,.competition-form,.admin-page,.market-form,
 .direct-form,.mp-premium-form,.rq-fields,.music-editor,.collab-page,.mp-settings-page,.auth-card,.support-form)
 :is(input,textarea)::placeholder {color:var(--mp-muted);opacity:1}
html:root body :is(.track-upload-error,.create-world-error,.competition-error,.form-alert.error) {
 background:var(--mp-surface-soft);color:var(--mp-error);border:1px solid var(--mp-error);
}
html:root body :is(.notice,.music-notice,.admin-notice) {border-radius:2px;box-shadow:none}
html:root body :is(.notice.direct-info,.track-tips,.fund-now-row) {background:var(--mp-surface-soft);color:var(--mp-text);border-color:var(--mp-border)}
html:root body.mp-app .app-page :is(.card,.article) {
 border-radius:2px;background:var(--mp-surface);color:var(--mp-text);border-color:var(--mp-border);box-shadow:none;
}
html:root body.mp-app .app-page .card :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=hidden]):not([type=color]),textarea,select) {
 border-radius:2px;background:var(--mp-surface);color:var(--mp-text);border-color:var(--mp-border);max-width:100%;box-sizing:border-box;
}

/* Existing components retain their own layout and semantics, share theme tokens. */
html:root body :is(.collab-page,.cu-workbench) {
 --collab-card:var(--mp-surface);--collab-soft:var(--mp-surface-soft);--collab-ink:var(--mp-text);
 --collab-muted:var(--mp-muted);--collab-line:var(--mp-border);--collab-accent:var(--mp-accent);
}
html:root body .ce-page {--ce-ink:var(--mp-text);--ce-paper:var(--mp-bg);--ce-rule:var(--mp-border);--ce-accent:var(--mp-accent);font-family:var(--mp-font)}
html:root body .ce-page h1 {font-family:var(--mp-font);font-weight:750}
html:root body .settings-page {
 --s-bg:var(--mp-bg);--s-card:var(--mp-surface);--s-raised:var(--mp-surface-soft);
 --s-line:var(--mp-border);--s-muted:var(--mp-muted);--s-text:var(--mp-text);--s-accent:var(--mp-accent);
 background:var(--mp-bg);color:var(--mp-text);
}
html:root body .settings-page::before,html:root body .settings-panel::after {display:none}
html:root body .settings-page .completeness-fill {background:var(--mp-accent)}
html:root body .settings-page .banner-placeholder {background:var(--mp-surface-soft)}
html:root body .mp-create-option {background:var(--mp-surface);color:var(--mp-text);border-color:var(--mp-border);box-shadow:none}
html:root body .mp-create-option small {color:var(--mp-muted)}
html:root body .mp-create-option-icon {background:var(--mp-surface-soft);border-color:var(--mp-border)}
html:root body .mp-create-option-icon img {filter:brightness(0)}
html:root.theme-dark body .mp-create-option-icon img {filter:brightness(0) invert(1)}
html:root body .mp-create-option:hover {background:var(--mp-surface-soft);transform:none;filter:none}
html:root body .mpv-thumb-placeholder {background:var(--mp-surface-soft);color:var(--mp-muted)}
html:root body :is(.my-track-art,.feedback-beat-placeholder,.era-card,.fss-now-card,.fss-empty) {background:var(--mp-surface-soft);color:var(--mp-text);border-radius:2px}
html:root body .empty-waveform i {background:var(--mp-accent)}
html:root body .fss-wrap::before {display:none}
html:root body .fss-record-launch {background:var(--mp-surface-soft);color:var(--mp-text);border-radius:2px;box-shadow:none}
html:root body #melopodSearchPage .mp-search-form input[type=search] {border-radius:2px!important;box-shadow:none!important}
html:root body #melopodSearchPage .mp-search-form input[type=search]:focus-visible {outline:2px solid var(--mp-accent)!important;outline-offset:2px}

/* Standalone legal/help/account documents use the same canvas as discovery. */
html:root body.legal-body {background:var(--mp-bg);color:var(--mp-text);font-family:var(--mp-font)}
html:root body.legal-body :is(.legal-top,.legal-sidebar,.legal-document,.legal-footer) {background:var(--mp-bg);color:var(--mp-text);border-color:var(--mp-border)}
html:root body.legal-body :is(.legal-updated,.legal-note,.legal-footer,.lead) {color:var(--mp-muted)}
html:root body.legal-body .legal-document h1 {font-size:clamp(30px,4.5vw,50px);line-height:1.12}
html:root body.legal-body .help-search {border-radius:2px;background:var(--mp-surface);border-color:var(--mp-border);max-width:100%}
html:root body.legal-body .help-search input {color:var(--mp-text)}
html:root body.legal-body .help-search input {border:0;background:transparent;box-shadow:none}
html:root body.legal-body .help-categories button {background:var(--mp-surface-soft);color:var(--mp-text);border-color:var(--mp-border)}
html:root body.legal-body .primary {background:var(--mp-accent);color:var(--mp-on-accent)}
html:root body.legal-body .secondary {background:var(--mp-surface);color:var(--mp-text);border-color:var(--mp-border)}
html:root body .auth-wrap {background:var(--mp-bg)}
html:root body .auth-card:not(.echo-intro) {border-radius:2px;background:var(--mp-surface);color:var(--mp-text);border-color:var(--mp-border);box-shadow:none}
html:root body .auth-art {background:var(--mp-surface-soft);color:var(--mp-text)}
html:root body .auth-card .primary.full {background:var(--mp-accent);color:var(--mp-on-accent);border-radius:2px}
html:root body .auth-card .divider span {background:var(--mp-surface);color:var(--mp-muted)}
html:root body .echo-root {--ea-bg:var(--mp-bg);--ea-panel:var(--mp-surface);--ea-ink:var(--mp-text);--ea-muted:var(--mp-muted);--ea-line:var(--mp-border);--ea-accent:var(--mp-accent);--ea-field:var(--mp-surface)}
html:root body .echo-root :is(.echo-panel,.echo-dialog),html:root body .echo-popup .echo-dialog {border-radius:2px;box-shadow:none}
html:root body .echo-root :is(.primary,.echo-join) {border-radius:2px!important;background:var(--mp-accent)!important;color:var(--mp-on-accent)!important}
html:root body .echo-root :is(input:not([type=checkbox]):not([type=hidden]),select,textarea) {border-radius:2px!important}
html:root body:has(>.echo-page) {background:var(--mp-bg)!important}
html:root body .echo-environment {background:none}

/* Mouse/touch actions stay clean; keyboard focus remains visible. */
html:root body :is(.mp-button,.music-button,.collab-button,.track-publish,.track-cancel,
 .competition-submit,.competition-cancel,.create-world-submit,.prize-tier-add,.ce-button):focus:not(:focus-visible) {outline:0;box-shadow:none}
html:root body :is(.mp-button,.music-button,.collab-button,.track-publish,.track-cancel,
 .competition-submit,.competition-cancel,.create-world-submit,.prize-tier-add,.ce-button):focus-visible {outline:2px solid var(--mp-accent);outline-offset:3px}
@media(max-width:640px) {
 html:root body :is(.track-field,.create-world-field,.competition-form,.auth-card,.support-form,.mp-settings-page) :is(input,select,textarea) {font-size:16px}
 html:root body :is(.track-upload-card,.create-world-form,.competition-form,.support-form) {padding:18px;min-width:0}
 html:root body :is(.market-hero,.create-world-intro,.help-hero,.fss-head) {padding-block:18px;margin-bottom:18px}
}
@media print {
 html:root body .license-terms {background:#fff!important;color:#111!important;box-shadow:none!important}
}
