/* Shared appearance for public pages, checkout and the management center. */
:root {
    color-scheme: light;
    --paper: #fff;
    --ink: #161616;
    --muted: #5e5e5e;
    --line: #e3e3e3;
    --surface: #fff;
    --soft: #f5f5f5;
    --field: #fafafa;
    --header-glass: rgba(255, 255, 255, .94);
    --accent: #161616;
    --accent-strong: #181818;
    --accent-hover: #363636;
    --accent-soft: #efefef;
    --on-accent: #fff;
    --signal: #c52b32;
    --signal-soft: rgba(197, 43, 50, .10);
    --blue: var(--accent);
    --green: var(--accent);
    --glow: rgba(0, 0, 0, .07);
    --shadow: 0 12px 38px rgba(0, 0, 0, .07);
    --lift: 0 14px 32px rgba(0, 0, 0, .13);
    --focus: rgba(0, 0, 0, .14);
    --danger: #a72029;
    --danger-bg: #fff1f1;
    --success: #333;
    --success-bg: #efefef;
    --scene-line: rgba(18, 18, 18, .15);
    --scene-grid: rgba(18, 18, 18, .10);
    --radius: 18px;
    --control-radius: 11px;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --paper: #111;
    --ink: #f5f5f5;
    --muted: #b9b9b9;
    --line: #3a3a3a;
    --surface: #1c1c1c;
    --soft: #252525;
    --field: #171717;
    --header-glass: rgba(17, 17, 17, .94);
    --accent: #f5f5f5;
    --accent-strong: #ededed;
    --accent-hover: #fff;
    --accent-soft: #303030;
    --on-accent: #161616;
    --signal: #ff6670;
    --signal-soft: rgba(255, 102, 112, .13);
    --glow: rgba(255, 255, 255, .07);
    --shadow: 0 16px 44px rgba(0, 0, 0, .24);
    --lift: 0 16px 32px rgba(0, 0, 0, .4);
    --focus: rgba(255, 255, 255, .17);
    --danger: #ff9ca2;
    --danger-bg: #391e20;
    --success: #eee;
    --success-bg: #2e2e2e;
    --scene-line: rgba(255, 255, 255, .19);
    --scene-grid: rgba(255, 255, 255, .12);
}

body {
    background: var(--paper);
    color: var(--ink);
}
.theme-backdrop {
    position: fixed;
    z-index: 0;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}
.theme-backdrop ~ #app { position: relative; }
.theme-grid-line { stroke: var(--scene-grid); stroke-width: .65; }
.theme-grid-node { fill: var(--scene-grid); }
.theme-route-lines { stroke: var(--scene-line); stroke-width: 1; }
.theme-route-lines path, .theme-route-packets path { vector-effect: non-scaling-stroke; }
.theme-route-packets {
    stroke: var(--signal);
    stroke-opacity: .67;
    stroke-width: 1.55;
    stroke-linecap: round;
}
.theme-route-packets path { stroke-dasharray: 1.6 98.4; stroke-dashoffset: -9; }
.theme-route-packets path:nth-child(2) { stroke-dashoffset: -14; }
.theme-route-packets path:nth-child(3) { stroke-dashoffset: -86; }
.theme-scene-cross { fill: none; stroke: var(--scene-line); stroke-width: 1.2; }
.theme-scene-ring { fill: none; stroke: var(--signal); stroke-opacity: .22; transform-origin: center; transform-box: fill-box; }
.theme-scene-dot { fill: var(--signal); opacity: .75; }
::selection { background: var(--accent-soft); color: var(--ink); }
:where(a, button, input, textarea, select, summary):focus-visible,
.site-header :focus-visible, .square-content button:focus-visible {
    outline: 2px solid var(--signal);
    outline-offset: 3px;
}
.skip-link { background: var(--surface); color: var(--ink); }
input, select { accent-color: var(--accent-strong); }

/* Compact tabs inside a soft header. The main navigation scrolls on narrow screens. */
.site-header {
    height: auto;
    position: sticky;
    top: 0;
    z-index: 25;
    background: var(--header-glass);
    color: var(--ink);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(15px);
}
.header-inner {
    width: 100%;
    max-width: 1280px;
    min-height: 66px;
    height: auto;
    gap: clamp(12px, 2vw, 26px);
    padding: 0 30px;
    flex-wrap: nowrap;
}
.brand { color: var(--ink); letter-spacing: -.3px; gap: 9px; font-size: 20px; }
.brand small { color: var(--muted); letter-spacing: .2px; }
.brand-logo { width: 38px; height: 38px; }
.main-nav {
    position: static;
    order: initial;
    flex: 0 1 auto;
    height: auto;
    gap: 4px;
    justify-content: flex-start;
    padding: 5px 3px;
    margin-inline: auto;
}
.main-nav a {
    flex: none;
    display: inline-flex;
    height: auto;
    min-height: 34px;
    padding: 5px 10px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: var(--muted);
    font-weight: 600;
    transition: color .18s, background-color .18s, border-color .18s;
}
.main-nav a:hover { color: var(--ink); background: var(--soft); }
.main-nav a[aria-current="page"], .main-nav a[aria-current="page"]:hover {
    background: var(--accent-soft);
    border-color: transparent;
    color: var(--accent);
    box-shadow: inset 0 -2px var(--signal);
}
.main-nav a[aria-current="page"] .nav-plus, .nav-plus { color: var(--signal); }
.theme-header-actions { display: flex; align-items: center; gap: 9px; flex: none; }
.header-inner:not(:has(.main-nav)) .theme-header-actions { margin-inline-start: auto; }
.theme-header-actions .header-account { margin: 0; }
.header-account .account-button { color: var(--ink); }
.account-button > span:nth-child(2) { max-width: 10ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar-dot { background: var(--accent-soft); color: var(--accent); }
.theme-toggle {
    display: none;
    height: 36px;
    width: 36px;
    padding: 0;
    place-items: center;
    border-radius: 11px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    transition: background-color .2s, color .2s, transform .2s;
}
.theme-ready .theme-toggle { display: grid; }
.theme-toggle:hover { color: var(--accent); background: var(--accent-soft); transform: rotate(-7deg); }
.theme-toggle .theme-sun, [data-theme="dark"] .theme-toggle .theme-moon { display: none; }
[data-theme="dark"] .theme-toggle .theme-sun { display: block; }
.theme-motion-toggle .theme-resume, [data-motion="paused"] .theme-motion-toggle .theme-pause { display: none; }
[data-motion="paused"] .theme-motion-toggle .theme-resume { display: block; }

/* One set of button states shared by parser, paid downloads and checkout. */
.button, .help-dock-button {
    border-radius: var(--control-radius);
    transition: color .18s, background-color .18s, border-color .18s, box-shadow .18s, transform .2s;
}
.button:active:not(:disabled), .help-dock-button:active { transform: translateY(1px); }
.site-header .header-login,
.button-dark, .button-green, .button-gold, .button.pd-primary,
.help-dock-button:not(.feedback-dock-button) {
    color: var(--on-accent);
    background: var(--accent-strong);
    border: 1px solid transparent;
    box-shadow: 0 4px 12px var(--glow);
}
.site-header .header-login { color: var(--on-accent) !important; }
.site-header .header-login:hover,
.button-dark:hover, .button-green:hover, .button-gold:hover,
.button.pd-primary:hover:not(:disabled), .help-dock-button:not(.feedback-dock-button):hover {
    color: var(--on-accent);
    background: var(--accent-hover);
    border-color: transparent;
}
.site-header .button-outline, .button-outline, .feedback-dock-button, .payment-method {
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: none;
}
.site-header .button-outline:hover, .button-outline:hover, .feedback-dock-button:hover, .payment-method:hover {
    color: var(--accent);
    background: var(--accent-soft);
    border-color: var(--line);
}
.pd-promo .pd-primary {
    color: var(--ink);
    background: var(--surface);
    border-color: var(--line);
    box-shadow: none;
}
.pd-promo .pd-primary:hover:not(:disabled) { color: var(--on-accent); background: var(--accent-strong); }
.button.button-danger { color: var(--danger); background: var(--danger-bg); border-color: var(--line); }
.button.button-danger:hover { color: var(--danger); background: var(--signal-soft); border-color: var(--signal); }
.button:disabled { box-shadow: none; opacity: .55; }
.action-icon {
    display: inline-block;
    width: 1.15em;
    height: 1.15em;
    margin-inline: .14em;
    flex: none;
    vertical-align: -.18em;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.text-button .action-icon, .teaser-link .action-icon, .parse-foot .action-icon, .ai-login .action-icon {
    color: var(--signal);
}
.theme-icon-dot, .pd-icon-dot { fill: var(--signal); stroke: none; }
.help-dock-button:not(.feedback-dock-button) .theme-icon-dot { fill: var(--on-accent); }
.nav-plus, .teaser-icon, .faq-list summary > span { color: var(--signal); }
.text-button, .teaser-link, .parse-foot a, .parse-foot .text-button, .login-switch button { color: var(--accent); }

/* The parser remains in the first screen on desktop. */
.page-shell { max-width: 1180px; }
.hero {
    min-height: 340px;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: clamp(18px, 5vw, 72px);
    padding-block: 38px 35px;
}
.theme-hero-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    border-radius: 999px;
    color: var(--accent);
    background: var(--accent-soft);
    font-size: 12px;
    font-weight: 700;
}
.theme-hero-label span, .green-dot, .status-dot {
    width: 6px;
    height: 6px;
    background: var(--signal);
    border-radius: 50%;
}
.hero h1 {
    margin: 17px 0 13px;
    font-size: clamp(34px, 4.1vw, 62px);
    line-height: 1.13;
    letter-spacing: -.055em;
}
.hero h1 em { color: inherit; font-style: normal; }
.hero p { color: var(--muted); font-size: clamp(14px, 1.5vw, 16px); }
.theme-hero-demo { display: grid; place-items: center; position: relative; min-width: 0; isolation: isolate; padding: 0 19px 19px 0; }
.theme-hero-demo::before {
    content: "";
    position: absolute;
    inset: 6% 0;
    z-index: -1;
    background: radial-gradient(ellipse, var(--glow) 15%, transparent 68%);
}
.theme-media-window {
    width: min(100%, 402px);
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--lift);
    border-radius: 20px;
    padding: 0 9px 9px;
    transform: rotate(-3deg);
    transition: transform .4s cubic-bezier(.2,.75,.2,1);
}
.theme-hero-demo:hover .theme-media-window { transform: rotate(0); }
.theme-media-top { height: 37px; display: flex; align-items: center; gap: 5px; padding: 0 7px; color: var(--muted); }
.theme-media-top i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.theme-media-top i:first-child { background: var(--signal); }
.theme-media-top span { margin-left: auto; font-size: 11px; }
.theme-media-frame {
    height: clamp(142px, 17vw, 202px);
    display: grid;
    place-items: center;
    border-radius: 13px;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: radial-gradient(ellipse at 68% 17%, #3a3a3a, transparent 78%), #121212;
}
.theme-media-graphic { position: absolute; inset: 0; width: 100%; height: 100%; }
.theme-media-orbits { fill: none; stroke: #fff; stroke-opacity: .24; }
.theme-media-orbits ellipse:nth-child(2) { stroke-opacity: .52; }
.theme-media-orbits .theme-media-trace { stroke: #ff6871; stroke-opacity: 1; stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 8 92; stroke-dashoffset: -36; }
.theme-media-corners { fill: none; stroke: #fff; stroke-opacity: .55; stroke-width: 1.35; }
.theme-media-scan { fill: none; stroke: #fff; stroke-opacity: .16; }
.theme-media-signal { fill: #ff6871; }
.theme-media-play {
    display: grid;
    place-items: center;
    padding-left: 2px;
    width: 54px;
    height: 54px;
    color: #fff;
    position: relative;
    border: 1px solid rgba(255,255,255,.5);
    background: rgba(255,255,255,.16);
    border-radius: 50%;
    backdrop-filter: blur(6px);
}
.theme-media-seek { position: absolute; left: 7%; right: 7%; bottom: 14px; height: 3px; border-radius: 6px; background: rgba(255,255,255,.25); }
.theme-media-seek span { display: block; width: 62%; height: 100%; border-radius: inherit; background: #ee535d; transform-origin: left; }
.theme-media-file {
    position: absolute;
    right: 0;
    bottom: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 10px 13px;
    color: var(--ink);
    background: var(--surface);
    box-shadow: var(--shadow);
    font-size: 12px;
    font-weight: 650;
}
.theme-media-file svg { color: var(--accent); }
.workspace {
    border: 1px solid var(--line);
    border-radius: 23px;
    background: var(--surface);
    box-shadow: var(--shadow);
    scroll-margin-top: 135px;
}
.workspace-top { min-height: 0; height: auto; gap: 10px; padding: 14px 22px 0; border-bottom: 0; }
.tool-tabs, .plan-toggle, .pd-tabs {
    flex: none;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--soft);
}
.tool-tabs a, .plan-toggle button, .pd-tabs a {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    padding: 6px 13px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--muted);
    font-weight: 650;
    transition: color .18s, background-color .18s, box-shadow .18s;
}
.tool-tabs a.active, .plan-toggle button.active, .pd-tabs a[aria-current="page"] {
    color: var(--accent);
    background: var(--surface);
    box-shadow: 0 2px 7px var(--glow), inset 0 -2px var(--signal);
    border-color: var(--line);
}
.tool-tabs a:not(.active):hover, .pd-tabs a:not([aria-current]):hover { color: var(--accent); background: var(--accent-soft); }
.parse-form { padding: 17px 22px 20px; }
.link-field {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--field);
}
.link-field:focus-within { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
.link-field input, .link-field textarea { color: var(--ink); background: transparent; }
.link-field input::placeholder, .link-field textarea::placeholder { color: var(--muted); }
.link-icon, .clear-link { color: var(--accent); }
.link-field .parse-button {
    --parse-outline: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
    isolation: isolate;
    min-width: 132px;
    min-height: 44px;
    border: 1px solid transparent;
    border-radius: 5px;
    background: transparent;
    box-shadow: none;
    color: #fff;
    font-size: 16px;
    font-weight: 750;
}
.link-field .parse-button:is(:hover, :active):not(:disabled) { transform: none; }
.link-field .parse-button::before,
.link-field .parse-button::after {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: -1;
    border-radius: inherit;
    clip-path: var(--parse-outline);
    pointer-events: none;
}
.link-field .parse-button::before {
    background-image:
        repeating-linear-gradient(135deg, transparent 0 7px, #ffb7b719 7px 9px, #ffb7b70b 9px 12px, transparent 12px 17px),
        linear-gradient(110deg, #a91624, #b8202e 55%, #871322);
    box-shadow: inset 0 0 0 1px #f16a74a6, inset 0 -3px #64101966;
}
.link-field .parse-button::after {
    background: linear-gradient(105deg, transparent 28%, #ff83914a 100%);
    box-shadow: inset 0 0 0 1px #ff9ba1, inset 0 0 15px #ff879448;
    opacity: 0;
}
.link-field .parse-button:focus-visible {
    outline: 2px solid var(--signal);
    outline-offset: 3px;
}
.link-field .parse-button:is(:hover, :focus-visible):not(:disabled)::after { opacity: .42; }
.link-field .parse-button:active:not(:disabled)::after { opacity: 1; }
.link-field .parse-button:disabled { opacity: .74; }

@media (prefers-reduced-motion: no-preference) {
    .link-field .parse-button::before,
    .link-field .parse-button > * { transition: transform .14s ease-out; }
    .link-field .parse-button::after { transition: opacity .16s ease-out, transform .14s ease-out; }
    .link-field .parse-button:active:not(:disabled)::before,
    .link-field .parse-button:active:not(:disabled)::after,
    .link-field .parse-button:active:not(:disabled) > * { transform: translateY(2px) scale(.97); }
    .link-field .parse-button:not(:disabled)::before { animation: parse-stripes 2.8s linear infinite; }
    :is([data-motion="paused"], .motion-inactive) .link-field .parse-button::before { animation-play-state: paused; }
}
@keyframes parse-stripes { to { background-position: 24px 0, 0 0; } }

/* Surfaces shared across member forms, records, account balance and utilities. */
.pd-promo, .pd-panel, .workspace, .results-panel, .video-card, .result-card, .download-list-card, .download-list-panel,
.member-teaser, .plan-card, .account-panel-new, .account-panel-new.account-is-vip, .membership-help,
.help-entry, .help-entry.feedback-entry, .help-contact-panel, .profile-card, .site-dialog,
.referral-panel, .referral-section, .referral-locked, .referral-rules > div, .referral-stats,
.admin-table-panel, .admin-stats article, .payment-card, .square-card, .square-player,
.platform-showcase-card, .history-card, .history-empty, .ext-package, .ext-demo, .ext-floating, .ext-download-panel {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--line);
    border-radius: var(--radius);
}
.pd-promo, .member-teaser, .plan-card.featured, .help-entry:first-child {
    background: linear-gradient(115deg, var(--surface) 14%, var(--soft));
}
.pd-promo {
    border-left: 1px solid var(--line);
    padding: 18px 22px;
    margin-top: 20px;
}
.pd-promo h2 { color: var(--ink); }
.pd-heading p, .pd-panel p, .pd-promo p,
.eyebrow, .private-note, .parse-foot, .batch-label, .batch-input-help, .batch-form-tools,
.platform-showcase-kicker, .platform-showcase-label h3, .platform-showcase-label p,
.platform-showcase-badge, .platform-showcase-note, .steps article > span, .steps p,
.member-teaser p, .member-teaser .eyebrow, .faq-list p, .footer-brand span, .site-footer p,
.membership-hero > p, .account-copy p, .account-panel-new .account-copy p, .account-copy .usage-note,
.account-overline, .account-secondary, .plan-description, .plan-note, .plan-kicker, .plan-features,
.plan-price small, .membership-help p, .dialog-intro, .dialog-bottom, .field-hint, .security-note,
.help-contact-panel > p, .help-entry p, .help-note, .feedback-field-note, .feedback-record > div,
.referral-panel .referral-heading p, .referral-share p, .referral-locked p, .referral-section p,
.referral-rules p, .referral-stats span, .referral-table th, .referral-note, .inviter-strip p, .profile-heading p,
.card-number, .order-summary span, .admin-hero p, .admin-table-heading p, .admin-footnote,
.admin-table th, .admin-table td, .user-cell small, .admin-stats span, .expired-text,
.admin-empty, .admin-pagination, .admin-bulk-bar small, .admin-user-filter p, .delete-user-list span,
.generate-card p, .code-copy > span, .payment-status, .payment-security, .payment-setting-heading p,
.payment-settings .field-hint, .payment-settings-save p, .download-list-card p, .end-note,
.square-hero p, .square-note, .square-type, .square-card-foot, .square-pagination, .square-toolbar span,
.ext-hero p, .ext-steps small, .ext-scene p, .ext-demo-footer, .ext-package p, .ext-package small,
.ext-notice, .ext-faq p, .ext-release p {
    color: var(--muted);
}
.platform-showcase, .faq-section, .faq-list details, .site-footer, .steps-and-member,
.membership-help > div, .help-wechat, .feedback-record, .my-feedback, .admin-table th, .admin-table td,
.admin-pagination, .admin-table-heading, .payment-setting-heading, .square-toolbar, .square-cover,
.referral-stats > div + div, .referral-table td, .referral-table th, .pd-form-footer, .pd-action {
    border-color: var(--line);
}
.platform-showcase { padding-block: 30px 24px; color: var(--ink); }
.platform-showcase-card {
    min-height: 80px;
    border-radius: 13px;
    transition: transform .23s, box-shadow .23s, border-color .2s;
}
.platform-showcase-card img { background: #fff; padding: 3px; border-radius: 8px; }
.platform-showcase-badge > span, .help-entry .text-button, .account-edit,
.admin-hero h1 > span, .referral-rules strong span, .payment-method-icon {
    color: var(--accent);
}
.help-entry-symbol, .small-icon, .inviter-icon, .referral-gift, .payment-method-icon,
.payment-method-xh .payment-method-icon, .square-close, .plan-recommend, .admin-stamp,
.invite-count, .table-avatar, .profile-avatar, .referral-qr span, .tool-tabs span {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: var(--line);
}
.member-tabs { gap: 5px; flex-wrap: wrap; }
.member-tabs button {
    color: var(--muted);
    border: 1px solid transparent;
    border-radius: 10px 10px 0 0;
    padding: 10px 14px;
    transition: background-color .18s, color .18s;
}
.member-tabs button:hover, .member-tabs button.active { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.member-tabs button.active { box-shadow: inset 0 -2px var(--signal); }
.history-heading p, .history-note, .history-empty p, .history-type, .history-day-heading span,
.history-card-foot, .history-pagination, .download-list-hero p { color: var(--muted); }
.history-result-link, .history-pictures a, .history-empty > span, .download-list-toolbar strong { color: var(--accent); }
.history-filter input { color: var(--ink); background: var(--field); border-color: var(--line); border-radius: var(--control-radius); }
.history-note, .history-cover, .download-list-message, .download-list-empty, .download-list-cover {
    background: var(--soft);
    color: var(--muted);
    border-color: var(--line);
}
.history-error, .download-list-message.is-error { color: var(--danger); background: var(--danger-bg); }
.history-status { color: var(--success); background: var(--success-bg); }
.download-list-art {
    border-color: var(--line);
    background: radial-gradient(ellipse at 75% 20%, var(--glow), transparent 65%), var(--surface);
}
.download-list-art::before, .download-list-art::after { background: linear-gradient(90deg, transparent, var(--glow), transparent); }
.download-list-art span, .download-list-art span:nth-child(2), .download-list-art b { color: var(--accent); }
.order-summary, .activation-account, .account-avatar, .account-panel-new .account-avatar,
.account-is-vip .account-avatar, .security-note, .inviter-strip, .referral-copy input,
.history-placeholder, .batch-form-tools, .batch-row, .video-select, .admin-bulk-bar,
.admin-user-filter, .admin-table th, .pd-record-head span,
.square-cover, .ext-notice, .ext-chips span, .ext-demo-footer, .ext-address, .ext-file-list,
.ext-load-button, .ext-empty-card, .ext-browser-bar, .ext-demo-file, .ext-demo-folder {
    color: var(--ink);
    background: var(--soft);
    border-color: var(--line);
}
.payment-settings .profile-card, .payment-settings .button { box-shadow: none; }
.generate-card form > label, .generate-card form > .button { margin: 0; }
.referral-qr, .referral-table th { background: var(--soft); border-color: var(--line); }
.activation-account strong, .activation-account small, .activation-account div > span,
.security-note > span, .inviter-strip code, .feedback-content summary, .feedback-content small,
.feedback-record > p, .square-cover-placeholder, .code-copy code, .user-cell strong,
.table-actions button, .payment-card .price, .pd-record p a, .pd-form-footer strong, .pd-panel .pd-balance {
    color: var(--ink);
}
.plan-card.featured { border-color: var(--accent); }
.plan-price, .plan-price > span { color: var(--ink); }
.profile-card input[readonly] {
    color: var(--muted);
    background: var(--soft);
    border-color: var(--line);
    border-radius: var(--control-radius);
}
.profile-section .profile-card input:not([type="file"], [readonly]),
.profile-form input, .profile-form select, .profile-form textarea, .site-dialog input,
.site-dialog select, .site-dialog textarea, .admin-search input, .admin-user-filter select,
.admin-dialog input, .generate-card input, .generate-card select, .paid-download input,
.payment-settings input:not([type="checkbox"]), .payment-settings textarea, .payment-settings select,
.pd-field input, .pd-field select {
    color: var(--ink);
    background: var(--field);
    border-color: var(--line);
    border-radius: var(--control-radius);
}
.admin-user-filter.admin-feedback-filter,
.admin-feedback-filter select,
.feedback-admin-table th { background: transparent; }
input::placeholder, textarea::placeholder, .site-dialog input::placeholder { color: var(--muted); }
input:focus, textarea:focus, select:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 3px var(--focus); }
:root[data-theme="dark"] .profile-section .profile-card input:autofill {
    -webkit-text-fill-color: var(--ink);
    box-shadow: inset 0 0 0 1000px var(--field);
}
:root[data-theme="dark"] .profile-section .profile-card input:autofill:focus {
    box-shadow: inset 0 0 0 1000px var(--field), 0 0 0 3px var(--focus);
}
.link-field input:focus, .link-field textarea:focus { box-shadow: none; }
.site-dialog::backdrop, .square-player::backdrop { background: rgba(12, 12, 12, .64); backdrop-filter: blur(3px); }
.dialog-close, .help-close { color: var(--muted); }
.toast, .square-duration, .square-play { color: #fff; background: #222; }
.payment-qr, .support-qr img, .help-contact-panel > img, .mini-program-qr,
.referral-qr img, .referral-qr canvas { background: #fff; }
.payment-qr { border-color: var(--line); }
.square-message, .state-pill.available, .referral-status.referral-rewarded, .account-success,
.feedback-resolved, .payment-success-mark { color: var(--success); background: var(--success-bg); border-color: var(--line); }
.account-alert, .payment-error, .square-error, .inline-alert, .form-error {
    color: var(--danger);
    background: var(--danger-bg);
    border-color: var(--line);
}
.pd-alert { color: var(--danger) !important; background: var(--danger-bg); border-color: var(--danger); }
.state-pill.redeemed, .referral-status, .referral-old, .feedback-pending,
.invite-hint, .payment-disabled-note { color: var(--muted); background: var(--soft); border-color: var(--line); }
.admin-table tbody tr:hover, .admin-table tbody tr.is-selected { background: var(--accent-soft); }
.pd-tabs { width: fit-content; max-width: 100%; }
.pd-choice-body {
    color: var(--ink);
    background: var(--field);
    border: 1px solid var(--line);
    border-radius: var(--control-radius);
    transition: background-color .2s, border-color .2s;
}
.pd-choice small { color: var(--muted); }
.pd-choice input:hover + .pd-choice-body { border-color: var(--accent); }
.pd-choice input:checked + .pd-choice-body { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.pd-choice input:checked + .pd-choice-body small { color: var(--muted); }
.pd-choice input:checked + .pd-choice-body .pd-icon-dot { fill: var(--signal); }
[data-theme="dark"] .ext-hero-art { background: radial-gradient(ellipse at top, var(--accent-soft), var(--field)); }
[data-theme="dark"] .ext-steps button { background: var(--surface); border-color: var(--line); color: var(--ink); }
[data-theme="dark"] .ext-steps button[aria-current] { background: var(--accent-soft); color: var(--accent); }
.ext-steps button[aria-current] b { color: var(--accent); }

@media (hover: hover) {
    .platform-showcase-card:hover, .plan-card:hover, .square-card:hover {
        transform: translateY(-3px);
        box-shadow: var(--shadow);
        border-color: var(--accent);
    }
}
@media (prefers-reduced-motion: no-preference) {
    .theme-hero-label, .hero h1, .hero p { animation: theme-rise .55s both; }
    .hero h1 { animation-delay: .06s; }
    .hero p { animation-delay: .12s; }
    .theme-media-window { animation: theme-preview .75s .05s both; }
    .theme-media-file { animation: theme-rise .62s .25s both; }
    .theme-media-seek span { animation: theme-progress .92s .3s both; }
    .theme-revealed { animation: theme-reveal .45s both; }
    .results-panel, .site-dialog[open] { animation: theme-rise .26s both; }
    .plan-card, .square-card { transition: transform .22s, box-shadow .22s, border-color .22s; }
    .theme-ready .theme-route-packets path, .theme-ready .theme-media-trace { animation: theme-trace 17s linear infinite; }
    .theme-ready .theme-route-packets path:nth-child(2) { animation-duration: 23s; animation-delay: -5s; }
    .theme-ready .theme-route-packets path:nth-child(3) { animation-duration: 21s; animation-delay: -15s; }
    .theme-ready .theme-media-trace { animation-duration: 8s; animation-delay: -2.8s; }
    .theme-ready .theme-scene-ring { animation: theme-ring 4.6s ease-out infinite; }
    .theme-ready .theme-scene-ring-late { animation-delay: -2.3s; }
    .theme-ready .theme-media-scan { animation: theme-scan 5.2s ease-in-out infinite alternate; }
    :is([data-motion="paused"], .motion-inactive) :is(.theme-route-packets path, .theme-media-trace, .theme-scene-ring, .theme-media-scan) {
        animation-play-state: paused;
    }
}
@keyframes theme-rise { from { opacity: 0; translate: 0 9px; } to { opacity: 1; translate: 0 0; } }
@keyframes theme-reveal { from { opacity: .7; translate: 0 9px; } to { opacity: 1; translate: 0 0; } }
@keyframes theme-preview { from { opacity: 0; translate: 14px 0; } to { opacity: 1; translate: 0 0; } }
@keyframes theme-progress { from { transform: scaleX(.08); } to { transform: scaleX(1); } }
@keyframes theme-trace { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -100; } }
@keyframes theme-ring {
    0%, 26% { transform: scale(.55); opacity: .95; }
    72%, 100% { transform: scale(1.45); opacity: 0; }
}
@keyframes theme-scan { from { transform: translateY(-34px); } to { transform: translateY(95px); } }

@media (max-width: 1030px) {
    .header-inner { flex-wrap: wrap; row-gap: 0; padding: 7px 24px 0; }
    .main-nav { order: 3; flex: 1 0 100%; padding: 5px 3px 8px; }
    .theme-header-actions { margin-block: 4px; margin-inline-start: auto; }
}
@media (max-width: 760px) {
    .header-inner { padding-inline: 16px; }
    .brand { font-size: 18px; }
    .brand-logo { width: 34px; height: 34px; }
    .theme-toggle { width: 34px; height: 34px; }
    .main-nav a { padding-inline: 9px; }
    .hero { grid-template-columns: 1fr; min-height: 0; padding: 29px 0 23px; gap: 0; }
    .hero h1 { font-size: clamp(31px, 8vw, 44px); margin: 12px 0 8px; }
    .theme-hero-demo { display: none; }
    .theme-route-lines { opacity: .8; }
    .theme-route-packets { stroke-opacity: .52; }
    .workspace { border-radius: 17px; }
    .workspace-top { padding: 12px 12px 0; flex-wrap: wrap; }
    .parse-form { padding: 13px 12px 15px; }
    .link-field { border-radius: 11px; }
    .pd-promo { padding: 15px; }
    .platform-showcase-card { min-height: 75px; }
    .member-tabs button { padding-inline: 8px; font-size: 13px; }
}
@media (max-width: 380px) {
    .theme-header-actions { gap: 5px; }
    .brand small, .account-button > span:nth-child(2) { display: none; }
    .theme-header-actions > .button { font-size: 11px; min-height: 34px; padding-inline: 8px; }
    .tool-tabs a, .pd-tabs a { padding-inline: 8px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .theme-toggle, .theme-media-window, .button, .main-nav a, .tool-tabs a, .member-tabs button,
    .platform-showcase-card, .plan-card, .square-card { transition: none; }
    .platform-showcase-card:hover, .plan-card:hover, .square-card:hover, .theme-toggle:hover { transform: none; }
    .theme-hero-demo:hover .theme-media-window { transform: rotate(-3deg); }
    .theme-ready .theme-motion-toggle { display: none; }
}
