/* Entry and account layouts. Shared colors are supplied by product-ui.css. */
body[data-entry-page] { background:var(--ui-bg,#f7f5f1)!important; color:var(--ui-ink,#302925)!important; font:15px/1.65 -apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif; }
body[data-entry-page] *,body[data-entry-page] *::before,body[data-entry-page] *::after { box-sizing:border-box; }
body[data-entry-page] .petal,body[data-entry-page] .promise-orbit,body[data-entry-page] .warm-heart,body[data-entry-page] .auth-shell::before { display:none!important; }
body[data-entry-page] :is(button,input,select) { font:inherit; }
body[data-entry-page] :is(button,a,input):focus-visible { outline:2px solid var(--ui-accent,#c86a4a); outline-offset:3px; }
body[data-entry-page] input:not([type="checkbox"]) { min-height:46px; font-size:16px!important; color:var(--ui-ink,#302925)!important; background:var(--ui-surface,#fffefc)!important; border-color:var(--ui-line,#e2dcd4)!important; }
body[data-entry-page] input[type="checkbox"] { accent-color:var(--ui-accent,#c86a4a); }
body[data-entry-page] :is(.text-mute,small) { color:var(--ui-muted,#776d65); }
body[data-entry-page] :is([class*="text-[10px]"],[class*="text-[11px]"],small) { font-size:12px; }
body[data-entry-page] :is(.btn-primary,.confirm-button,.advance-button,.payment-confirm) { min-height:44px; background:var(--ui-accent,#c86a4a)!important; color:var(--ui-on-accent,#fff)!important; border:0; border-radius:12px; box-shadow:none!important; transform:none!important; }
body[data-entry-page] button:disabled { cursor:not-allowed; opacity:.55; }
body[data-entry-page] .entry-retry { display:block; min-height:44px; margin:12px auto 0; padding:10px 18px; border:1px solid var(--ui-line,#e2dcd4); border-radius:12px; background:var(--ui-surface,#fffefc); color:var(--ui-ink,#302925); }
body[data-entry-page] .entry-retry.hidden { display:none; }
body[data-entry-page] .entry-note { font-size:13px; color:var(--ui-muted,#776d65); line-height:1.7; }
body[data-entry-page] .entry-pricing-note { margin-top:20px; padding:16px 20px; border:1px solid var(--ui-line,#e2dcd4); border-radius:16px; font-size:13px; color:var(--ui-muted,#776d65); }
body[data-entry-page] .entry-pricing-note summary { cursor:pointer; min-height:28px; color:var(--ui-ink,#302925); font-weight:600; }
body[data-entry-page] .entry-pricing-note p { margin-top:10px; }

/* Authentication: the form, not a second welcome screen, is the primary task. */
body[data-entry-page="landing"] { margin:0; }
body[data-entry-page="landing"] a { text-decoration:none; color:inherit; }
body[data-entry-page="landing"] h1,body[data-entry-page="landing"] h2,body[data-entry-page="landing"] h3,body[data-entry-page="landing"] p,body[data-entry-page="landing"] figure { margin:0; }
.landing-container { width:min(1120px,calc(100% - 64px)); margin:0 auto; }
.landing-header { width:min(1240px,calc(100% - 64px)); min-height:88px; margin:auto; display:flex; align-items:center; justify-content:space-between; gap:24px; border-bottom:1px solid var(--ui-line,#e2dcd4); }
.landing-brand { display:inline-flex; align-items:center; gap:10px; font-size:18px; font-weight:650; }
.landing-brand img { border-radius:10px; }
.landing-nav { display:flex; gap:32px; color:var(--ui-muted,#776d65); font-size:14px; }
.landing-nav a { display:flex; align-items:center; min-height:44px; }
body[data-entry-page="landing"] .landing-button { display:inline-flex; justify-content:center; align-items:center; gap:26px; min-height:50px; padding:12px 24px; border-radius:12px; color:var(--ui-on-accent,#fff); background:var(--ui-accent,#c86a4a); font-size:15px; font-weight:600; }
body[data-entry-page="landing"] .landing-button-small { min-height:44px; padding:8px 18px; font-size:14px; gap:18px; }
.landing-hero { display:grid; grid-template-columns:1fr 1fr; gap:80px; align-items:center; min-height:620px; padding-top:52px; padding-bottom:64px; }
.landing-eyebrow { font-size:12px; font-weight:600; letter-spacing:.12em; color:var(--ui-accent,#c86a4a); }
body[data-entry-page="landing"] h1 { margin:20px 0 24px; font-weight:600; font-size:clamp(40px,4.3vw,62px); letter-spacing:-.04em; line-height:1.25; }
.landing-description { color:var(--ui-muted,#776d65); font-size:16px; line-height:1.9; }
.landing-hero-copy .landing-button { margin-top:28px; }
body[data-entry-page="landing"] .landing-small-note { margin-top:18px; color:var(--ui-muted,#776d65); font-size:12px; line-height:1.7; }
.landing-portraits { position:relative; height:510px; }
.landing-portrait { position:absolute; border-radius:22px; overflow:hidden; background:var(--ui-surface,#fffefc); box-shadow:0 12px 36px #3029250e; }
.landing-portrait-main { width:70%; height:420px; top:0; right:0; }
.landing-portrait-secondary { width:43%; height:260px; left:0; bottom:22px; border:6px solid var(--ui-bg,#f7f5f1); }
.landing-portrait img { display:block; width:100%; height:100%; object-fit:cover; object-position:50% 30%; }
.landing-portrait figcaption { position:absolute; inset:auto 0 0; padding:36px 20px 16px; background:linear-gradient(transparent,rgba(20,16,13,.72)); color:#fff; }
.landing-portrait-main figcaption { padding-left:28%; text-align:right; }
.landing-portrait figcaption strong { display:block; font-size:20px; font-weight:600; }
.landing-portrait figcaption span { display:block; font-size:12px; margin-top:2px; }
.landing-photo-note { position:absolute; right:0; bottom:26px; width:51%; color:var(--ui-muted,#776d65); font-size:12px; }
.landing-features { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:40px; padding-top:32px; padding-bottom:40px; border-top:1px solid var(--ui-line,#e2dcd4); border-bottom:1px solid var(--ui-line,#e2dcd4); }
.landing-number { display:block; margin-bottom:12px; font-size:12px; color:var(--ui-accent,#c86a4a); }
body[data-entry-page="landing"] .landing-features h2 { font-size:18px; font-weight:600; margin-bottom:10px; }
.landing-features p { font-size:14px; color:var(--ui-muted,#776d65); }
.landing-section { padding-top:76px; padding-bottom:76px; scroll-margin-top:24px; }
.landing-section-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:32px; margin-bottom:28px; }
body[data-entry-page="landing"] .landing-section h2 { margin-top:12px; font-size:32px; font-weight:600; letter-spacing:-.025em; line-height:1.35; }
.landing-section-heading > a { font-size:14px; min-height:44px; display:flex; align-items:center; color:var(--ui-accent,#c86a4a)!important; }
.landing-section-heading > p { max-width:290px; font-size:14px; color:var(--ui-muted,#776d65); }
.landing-character-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:24px; }
.landing-character { display:block; border-radius:20px; background:var(--ui-surface,#fffefc); border:1px solid var(--ui-line,#e2dcd4); overflow:hidden; }
.landing-character > img { display:block; width:100%; height:300px; object-fit:cover; object-position:50% 30%; }
.landing-character > div { padding:22px; }
.landing-character h3 { display:flex; justify-content:space-between; align-items:center; gap:8px; font-size:22px; font-weight:600; }
.landing-character h3 span { color:var(--ui-muted,#776d65); font-size:13px; font-weight:400; }
body[data-entry-page="landing"] .landing-character-role { margin:8px 0 14px; color:var(--ui-accent,#c86a4a); font-size:12px; }
.landing-character p { font-size:14px; color:var(--ui-muted,#776d65); }
.landing-pricing-section { background:var(--ui-surface,#fffefc); border-block:1px solid var(--ui-line,#e2dcd4); }
.landing-price-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:24px; }
.landing-price-grid article { padding:26px; background:var(--ui-bg,#f7f5f1); border:1px solid var(--ui-line,#e2dcd4); border-radius:16px; }
.landing-price-grid h3 { font-size:17px; font-weight:600; }
body[data-entry-page="landing"] .landing-price { margin:18px 0 8px; font-size:32px; font-weight:600; }
.landing-price span { color:var(--ui-muted,#776d65); font-size:13px; font-weight:400; }
.landing-price-grid p:not(.landing-price) { color:var(--ui-muted,#776d65); font-size:14px; }
.landing-price-grid a { display:flex; align-items:center; min-height:44px; margin-top:14px; font-size:14px; color:var(--ui-accent,#c86a4a)!important; }
.landing-faq { display:grid; grid-template-columns:1fr 1.5fr; gap:70px; }
.landing-faq details { padding:20px 0; border-bottom:1px solid var(--ui-line,#e2dcd4); }
.landing-faq details:first-child { padding-top:0; }
.landing-faq summary { display:flex; justify-content:space-between; gap:20px; min-height:44px; align-items:center; cursor:pointer; list-style:none; font-weight:600; }
.landing-faq summary::-webkit-details-marker { display:none; }
.landing-faq summary span { font-size:22px; color:var(--ui-muted,#776d65); font-weight:400; }
.landing-faq details[open] summary span { transform:rotate(45deg); }
.landing-faq details p { color:var(--ui-muted,#776d65); font-size:14px; padding:12px 28px 0 0; }
.landing-faq details p a { text-decoration:underline!important; }
.landing-footer { display:flex; align-items:center; justify-content:space-between; gap:20px; padding-top:28px; padding-bottom:36px; border-top:1px solid var(--ui-line,#e2dcd4); }
.landing-footer p,.landing-footer > div { font-size:12px; color:var(--ui-muted,#776d65); }
.landing-footer > div { display:flex; gap:22px; }
.landing-footer > div a { display:flex; align-items:center; min-height:44px; }
.landing-skip { position:absolute; top:-100px; left:20px; padding:12px; background:var(--ui-surface,#fffefc); z-index:20; }
.landing-skip:focus { top:12px; }
@media(max-width:900px) {
  .landing-hero { gap:36px; min-height:0; }
  .landing-portraits { height:430px; }
  .landing-portrait-main { height:350px; }
  .landing-portrait-secondary { height:210px; }
  .landing-character > img { height:240px; }
  .landing-faq { gap:32px; }
}
@media(max-width:640px) {
  .landing-container,.landing-header { width:calc(100% - 40px); }
  .landing-header { min-height:74px; }
  .landing-nav { display:none; }
  .landing-hero { grid-template-columns:1fr; gap:32px; padding-top:36px; padding-bottom:32px; }
  body[data-entry-page="landing"] h1 { font-size:40px; margin:12px 0 16px; }
  .landing-description { font-size:15px; }
  .landing-hero-copy .landing-button { margin-top:22px; }
  .landing-portraits { height:340px; }
  .landing-portrait-main { height:300px; width:66%; }
  .landing-portrait-secondary { height:210px; width:45%; bottom:0; }
  .landing-photo-note { display:none; }
  .landing-features { grid-template-columns:1fr; gap:24px; padding-block:28px; }
  .landing-features article { display:grid; grid-template-columns:32px 1fr; column-gap:10px; }
  .landing-number { grid-row:1/3; margin:3px 0 0; }
  .landing-features p { grid-column:2; }
  .landing-section { padding-block:48px; }
  .landing-section-heading { align-items:flex-start; flex-direction:column; gap:14px; margin-bottom:24px; }
  body[data-entry-page="landing"] .landing-section h2 { font-size:28px; }
  .landing-character-grid { grid-template-columns:1fr; gap:18px; }
  .landing-character { display:grid; grid-template-columns:38% minmax(0,1fr); }
  .landing-character > img { height:100%; min-height:216px; }
  .landing-character > div { padding:20px 16px; }
  .landing-character h3 { flex-direction:column; align-items:flex-start; font-size:21px; }
  .landing-price-grid { grid-template-columns:1fr; gap:14px; }
  .landing-price-grid article { padding:22px; }
  .landing-faq { grid-template-columns:1fr; gap:28px; }
  .landing-footer { flex-wrap:wrap; padding-block:24px; }
  .landing-footer > div { width:100%; }
}
body[data-entry-page="auth"] header { padding:22px 32px; }
body[data-entry-page="auth"] main { padding:24px 32px 48px!important; }
body[data-entry-page="auth"] .auth-card.glass { padding:30px!important; background:var(--ui-surface,#fffefc)!important; border:1px solid var(--ui-line,#e2dcd4)!important; border-radius:22px!important; box-shadow:none!important; backdrop-filter:none; }
body[data-entry-page="auth"] .auth-card h2 { font-size:26px; }
body[data-entry-page="auth"] .auth-card > div:first-child { margin-bottom:20px; }
body[data-entry-page="auth"] .auth-card > div:nth-child(2) { margin-bottom:24px; }
body[data-entry-page="auth"] .auth-tab { min-height:44px; color:var(--ui-muted,#776d65); }
body[data-entry-page="auth"] button,body[data-entry-page="bind"] #btn-copy-command { min-height:44px; }
body[data-entry-page="auth"] .auth-tab.tab-active { color:var(--ui-ink,#302925); }
body[data-entry-page="auth"] .tab-active::after { background:var(--ui-accent,#c86a4a); }
body[data-entry-page="auth"] .promise-panel { min-height:540px; padding:0; border:0; border-radius:24px; background:var(--ui-surface,#fffefc); box-shadow:none; overflow:hidden; }
body[data-entry-page="auth"] .auth-editorial-photo { width:100%; height:410px; object-fit:cover; object-position:50% 35%; }
body[data-entry-page="auth"] .auth-editorial-caption { padding:25px 28px; }
body[data-entry-page="auth"] .auth-editorial-caption h2 { margin:0 0 6px; font-size:24px; }
body[data-entry-page="auth"] .auth-editorial-caption p { margin:0; font-size:14px; color:var(--ui-muted,#776d65); }
body[data-entry-page="auth"] .auth-legal { margin-top:18px; font-size:12px; }
body[data-entry-page="auth"] form > p.rounded-xl { display:none; }
body[data-entry-page="auth"] [id^="btn-send"] { min-height:46px; color:var(--ui-accent,#c86a4a); background:var(--ui-accent-soft,#f1e5dc); }
body[data-entry-page="forgot"] main { padding:18px 24px 40px; align-items:flex-start; }
body[data-entry-page="forgot"] main > div > .text-center:first-child { margin-bottom:22px; }
body[data-entry-page="forgot"] .auth-card { padding:24px; border:1px solid var(--ui-line,#e2dcd4); border-radius:20px; background:var(--ui-surface,#fffefc); box-shadow:none; }
body[data-entry-page="forgot"] #forgot-title { font-size:28px; }

/* Role selection: faces and readable descriptions. */
body[data-entry-page="create"] .page-shell { width:min(1160px,100% - 48px); margin:28px auto 48px; background:transparent; border:0; border-radius:0; box-shadow:none; overflow:visible; }
/* Reuse the original room photograph; keep the library close to the first
   viewport instead of bringing back the old full-height welcome screen. */
body[data-entry-page="create"] .hero { min-height:260px; background-image:url('/assets/character-library/hero-warm-room.webp'); background-size:cover; background-position:center 55%; padding:0; margin-bottom:30px; border:1px solid var(--ui-line); border-radius:28px; box-shadow:var(--ui-shadow); }
body[data-entry-page="create"] .hero::before,body[data-entry-page="create"] .hero::after { display:block; }
body[data-entry-page="create"] .hero-content { width:65%; padding:48px 36px; }
body[data-entry-page="create"] .hero-kicker { font-size:12px; color:var(--ui-accent,#c86a4a); letter-spacing:.06em; }
body[data-entry-page="create"] .hero h1 { margin:8px 0; font-size:38px; line-height:1.25; color:var(--ui-ink,#302925); }
body[data-entry-page="create"] .hero h1 em { color:inherit; font-style:normal; }
body[data-entry-page="create"] :is(.hero h1,.section-title,.role-name,.role-summary,.selected-title) { font-family:inherit; }
body[data-entry-page="create"] .hero-copy { max-width:600px; margin:12px 0 0; color:var(--ui-muted,#776d65); font-size:15px; }
body[data-entry-page="create"] .library-entry { display:none; }
body[data-entry-page="create"] .library-section { margin:0; padding:0; background:none; border-radius:0; box-shadow:none; }
body[data-entry-page="create"] .library-head { margin-bottom:24px; }
body[data-entry-page="create"] .section-title { font-size:20px; }
body[data-entry-page="create"] .section-title::before { display:none; }
body[data-entry-page="create"] .section-subtitle { margin:6px 0 0; font-size:13px; }
body[data-entry-page="create"] .section-title-wrap { display:block; }
body[data-entry-page="create"] .filter-button { min-height:44px; padding:8px 22px; border:1px solid var(--ui-line,#e2dcd4); border-radius:12px; color:var(--ui-muted,#776d65); background:var(--ui-surface,#fffefc); }
body[data-entry-page="create"] .filter-button[aria-pressed="true"] { color:var(--ui-accent,#c86a4a); border-color:var(--ui-accent,#c86a4a); background:var(--ui-accent-soft,#f1e5dc); }
body[data-entry-page="create"] .role-grid { grid-template-columns:repeat(4,minmax(0,1fr)); gap:20px; }
body[data-entry-page="create"] .role-card { display:flex; flex-direction:column; min-height:0; text-align:left; overflow:hidden; border:1px solid var(--ui-line,#e2dcd4); border-radius:20px; background:var(--ui-surface,#fffefc); box-shadow:none; transform:none; }
body[data-entry-page="create"] .role-card.selected { outline:2px solid var(--ui-accent,#c86a4a); outline-offset:2px; border-color:transparent; }
body[data-entry-page="create"] .role-cover-wrap { width:100%; min-height:0; aspect-ratio:4/4.7; }
body[data-entry-page="create"] .role-cover { width:100%; height:100%; object-fit:cover; }
body[data-entry-page="create"] .role-details { width:100%; padding:18px; }
body[data-entry-page="create"] .role-name { font-size:22px; color:var(--ui-ink,#302925); }
body[data-entry-page="create"] .role-meta { margin-top:7px; font-size:12px; line-height:1.6; min-height:38px; -webkit-line-clamp:2; }
body[data-entry-page="create"] .role-tags { margin-top:10px; gap:6px; }
body[data-entry-page="create"] .role-tag { padding:3px 8px; font-size:12px; background:var(--ui-accent-soft,#f1e5dc); color:var(--ui-muted,#776d65); border-radius:6px; }
body[data-entry-page="create"] .role-summary { margin-top:12px; font-size:13px; line-height:1.7; color:var(--ui-muted,#776d65); -webkit-line-clamp:3; }
body[data-entry-page="create"] .role-extra { display:none; }
body[data-entry-page="create"] .role-status { top:12px; right:12px; font-size:12px; padding:4px 9px; border:0; background:var(--ui-surface,#fffefc); color:var(--ui-muted,#776d65); box-shadow:none; }
body[data-entry-page="create"] .role-status.active { background:var(--ui-accent,#c86a4a); color:var(--ui-on-accent,#fff); }
body[data-entry-page="create"] .selection-panel { position:fixed; left:50%; transform:translateX(-50%); bottom:16px; width:min(900px,calc(100% - 32px)); z-index:20; padding:20px; border:1px solid var(--ui-line,#e2dcd4); background:var(--ui-surface,#fffefc); border-radius:18px; box-shadow:0 6px 24px #30292512; }
body[data-entry-page="create"].has-role-selection { padding-bottom:200px; }
body[data-entry-page="create"] .selection-note { font-size:12px; }
body[data-entry-page="create"] .wechat-onboarding { padding:12px; background:rgba(30,25,22,.55); backdrop-filter:none; }
body[data-entry-page="create"] .wechat-onboarding-card { width:min(760px,100%); max-height:calc(100dvh - 24px); display:flex; flex-direction:column; background:var(--ui-surface,#fffefc); border:0; border-radius:20px; }
body[data-entry-page="create"] .wechat-onboarding-head { flex:0 0 auto; padding:16px 20px; align-items:center; }
body[data-entry-page="create"] .wechat-onboarding-head h2 { font-size:19px; }
body[data-entry-page="create"] .wechat-onboarding-head p { font-size:12px; }
body[data-entry-page="create"] .wechat-onboarding-skip { min-height:44px; border-radius:10px; font-size:13px; }
body[data-entry-page="create"] .wechat-onboarding-frame { flex:1 1 auto; min-height:0; height:min(680px,75dvh); background:var(--ui-surface,#fffefc); }

/* Binding: actionable errors, same-phone guidance and accurate channel state. */
body[data-entry-page="bind"] main { padding-top:26px; }
body[data-entry-page="bind"] #back-link { min-height:44px; margin-bottom:12px; }
body[data-entry-page="bind"] #step-label { display:none; }
body[data-entry-page="bind"] #page-title { font-size:30px; }
body[data-entry-page="bind"] main > .text-center { margin-bottom:24px; }
body[data-entry-page="bind"] .channel-choice { min-height:62px; border-radius:14px; background:var(--ui-surface,#fffefc); border-color:var(--ui-line,#e2dcd4); color:var(--ui-ink,#302925); }
body[data-entry-page="bind"] .channel-choice.is-active { background:var(--ui-accent-soft,#f1e5dc)!important; border-color:var(--ui-accent,#c86a4a); color:var(--ui-accent,#c86a4a); box-shadow:none; }
body[data-entry-page="bind"] .channel-choice:disabled { opacity:.6; }
body[data-entry-page="bind"] .bind-card { padding:28px; gap:28px; border:1px solid var(--ui-line,#e2dcd4); background:var(--ui-surface,#fffefc); border-radius:20px; box-shadow:none; }
body[data-entry-page="bind"] .qr-frame { width:240px; height:240px; border-radius:14px; border:1px solid var(--ui-line,#e2dcd4); background:#fff; color:#302925; }
body[data-entry-page="bind"] .qr-frame .corner,body[data-entry-page="bind"] .scan-line { display:none!important; }
body[data-entry-page="bind"] #qr-img { width:204px; height:204px; border-radius:0; box-shadow:none; }
body[data-entry-page="bind"] #instruction-title { font-size:18px; }
body[data-entry-page="bind"] #msg { font-size:13px; }
body[data-entry-page="bind"] .bind-qr-column { display:flex; flex-direction:column; align-items:center; gap:12px; }
body[data-entry-page="bind"] #btn-confirm { margin:0; min-height:44px; width:240px; }
body[data-entry-page="bind"] #bind-channel-status { max-width:448px; margin:0 auto 18px; font-size:13px; color:var(--ui-muted,#776d65); text-align:center; }
body[data-entry-page="bind"] #same-device-help { margin:20px 0 0; font-size:13px; line-height:1.7; color:var(--ui-muted,#776d65); }
body[data-entry-page="bind"].is-embedded,body[data-entry-page="bind"].is-embedded main { background:var(--ui-surface,#fffefc)!important; }
body[data-entry-page="bind"].is-embedded .bind-card { padding:18px; }

/* Account and usage: service actions before profile editing. */
body[data-entry-page="account"] #account-content { display:flex; flex-direction:column; gap:20px; }
body[data-entry-page="account"] #account-content.hidden { display:none; }
body[data-entry-page="account"] #account-content > * { margin:0; }
body[data-entry-page="account"] .account-card,body[data-entry-page="usage"] .usage-card { border:1px solid var(--ui-line,#e2dcd4); border-radius:20px; background:var(--ui-surface,#fffefc); box-shadow:none; }
body[data-entry-page="account"] #account-identity { order:0; }
body[data-entry-page="account"] #services { order:1; }
body[data-entry-page="account"] #account-profile { order:2; }
body[data-entry-page="account"] #account-profile summary { min-height:44px; cursor:pointer; display:flex; align-items:center; justify-content:space-between; }
body[data-entry-page="account"] #account-profile summary::after { content:'＋'; color:var(--ui-muted,#776d65); font-weight:400; }
body[data-entry-page="account"] #account-profile[open] summary::after { content:'−'; }
body[data-entry-page="account"] #account-balance-link { display:inline-flex; align-items:center; min-height:44px; color:var(--ui-accent,#c86a4a); text-decoration:none; }
body[data-entry-page="account"] #account-security { order:3; }
body[data-entry-page="account"] #account-identity > .grid { margin-top:16px; grid-template-columns:1fr 1fr; }
body[data-entry-page="account"] .account-service { min-height:70px; }
body[data-entry-page="account"] .account-service-icon { font-size:18px; background:var(--ui-accent-soft,#f1e5dc); color:var(--ui-accent,#c86a4a); }
body[data-entry-page="account"] #profile-save { min-height:44px; background:var(--ui-accent,#c86a4a); color:var(--ui-on-accent,#fff); border-radius:12px; box-shadow:none; }
body[data-entry-page="usage"] .usage-hero { background:var(--ui-surface,#fffefc); }
body[data-entry-page="usage"] .usage-progress>span { background:var(--ui-accent,#c86a4a); }
body[data-entry-page="usage"] #usage-detail-toggle { min-height:44px; font-size:13px; }
body[data-entry-page="usage"] .subscription-stat { background:var(--ui-bg,#f7f5f1); }

/* Billing: three comparable plans, one billing-period control. */
body[data-entry-page="billing"] .billing-stage { max-width:1140px; padding:36px 24px 48px; }
body[data-entry-page="billing"] .subscription-panel { overflow:visible; border:0; background:none; box-shadow:none; border-radius:0; }
body[data-entry-page="billing"] .subscription-inner { padding:0; }
body[data-entry-page="billing"] .subscription-title { font-family:inherit; font-size:32px; color:var(--ui-ink,#302925); }
body[data-entry-page="billing"] .title-petal,body[data-entry-page="billing"] .annual-banner,body[data-entry-page="billing"] .coming-soon { display:none; }
body[data-entry-page="billing"] .subscription-lead { font-size:14px; }
body[data-entry-page="billing"] .close-button { width:44px; height:44px; border-radius:12px; background:var(--ui-surface,#fffefc); border:1px solid var(--ui-line,#e2dcd4); color:var(--ui-muted,#776d65); }
body[data-entry-page="billing"] .test-billing-banner { margin:20px 0; padding:12px 16px; border:1px solid var(--ui-line,#e2dcd4); background:var(--ui-surface,#fffefc); color:var(--ui-muted,#776d65); border-radius:12px; font-size:13px; text-align:left; font-weight:400; }
body[data-entry-page="billing"] .billing-cycle { display:flex; gap:4px; width:max-content; padding:4px; margin:22px 0; border:1px solid var(--ui-line,#e2dcd4); border-radius:14px; background:var(--ui-surface,#fffefc); }
body[data-entry-page="billing"] .billing-cycle button { min-height:44px; padding:8px 24px; border:0; border-radius:10px; font-size:14px; color:var(--ui-muted,#776d65); background:none; }
body[data-entry-page="billing"] .billing-cycle button[aria-pressed="true"] { background:var(--ui-accent-soft,#f1e5dc)!important; background-image:none!important; color:var(--ui-accent,#c86a4a)!important; box-shadow:none!important; font-weight:600; }
body[data-entry-page="billing"] .tier-list { grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; margin-top:0; }
body[data-entry-page="billing"] .tier-card { display:flex; flex-direction:column; padding:24px; border:1px solid var(--ui-line,#e2dcd4); background:var(--ui-surface,#fffefc); border-radius:20px; box-shadow:none; }
body[data-entry-page="billing"] .tier-title { font-family:inherit; font-size:20px; font-weight:600; line-height:1.4; color:var(--ui-ink,#302925); }
body[data-entry-page="billing"] .tier-title::before { display:none; }
body[data-entry-page="billing"] .tier-copy { margin:8px 0 22px; min-height:0; font-size:13px; color:var(--ui-muted,#776d65); }
body[data-entry-page="billing"] .plan-stack { margin-top:auto; gap:0; }
body[data-entry-page="billing"] .plan-option { display:block; min-height:0; padding:0; border:0!important; background:none!important; border-radius:10px; overflow:visible; transform:none!important; box-shadow:none!important; }
body[data-entry-page="billing"] .plan-option:hover .plan-action { filter:brightness(.95); }
body[data-entry-page="billing"] .plan-option[hidden] { display:none!important; }
body[data-entry-page="billing"] .plan-icon,body[data-entry-page="billing"] .option-arrow,body[data-entry-page="billing"] .plan-badge { display:none; }
body[data-entry-page="billing"] .plan-copy { display:block; padding:0; }
body[data-entry-page="billing"] .price-row { margin-top:0; }
body[data-entry-page="billing"] .plan-price { font-size:34px; font-weight:650; color:var(--ui-ink,#302925); }
body[data-entry-page="billing"] .plan-cycle,body[data-entry-page="billing"] .plan-suffix { font-size:13px; color:var(--ui-muted,#776d65); }
body[data-entry-page="billing"] .plan-summary { display:block; font-size:13px; color:var(--ui-muted,#776d65); }
body[data-entry-page="billing"] .plan-option::after { display:none!important; }
body[data-entry-page="billing"] .plan-action { display:flex; align-items:center; justify-content:center; margin-top:22px; padding:10px; min-height:44px; text-align:center; border-radius:10px; color:var(--ui-on-accent,#fff)!important; background:var(--ui-accent,#c86a4a)!important; background-image:none!important; box-shadow:none!important; font-size:14px; font-weight:600; }
body[data-entry-page="billing"] .discount-chips { gap:6px 12px; margin-top:8px; }
body[data-entry-page="billing"] .discount-chip { padding:0; border:0; background:none; font-size:12px; font-weight:400; color:var(--ui-muted,#776d65); }
body[data-entry-page="billing"] .purchase-status { justify-content:flex-start; margin-top:20px; padding:0; background:none; color:var(--ui-muted,#776d65); font-size:13px; font-weight:400; text-align:left; }
body[data-entry-page="billing"] .current-subscription { font-size:13px; background:var(--ui-surface,#fffefc); color:var(--ui-muted,#776d65); }
body[data-entry-page="billing"] .payment-backdrop { z-index:11000; padding:16px; background:rgba(30,25,22,.55); backdrop-filter:none; overflow-y:auto; }
body[data-entry-page="billing"] .payment-bubble { width:min(440px,100%); max-height:calc(100dvh - 32px); overflow-y:auto; overscroll-behavior:contain; padding:24px; border:1px solid var(--ui-line,#e2dcd4); border-radius:20px; background:var(--ui-surface,#fffefc); color:var(--ui-ink,#302925); box-shadow:0 18px 60px #0002; }
body[data-entry-page="billing"] .payment-row { font-size:14px; color:var(--ui-muted,#776d65); border-color:var(--ui-line,#e2dcd4); }
body[data-entry-page="billing"] .payment-row strong { color:var(--ui-ink,#302925); font-size:14px; }
body[data-entry-page="billing"] .payment-actions { position:sticky; bottom:0; margin-top:12px; padding:12px 0 0; background:var(--ui-surface,#fffefc); }
body[data-entry-page="billing"] .payment-actions button { min-height:44px; font-size:14px; border-radius:12px; }
body[data-entry-page="billing"] #payment-close { width:44px; height:44px; background:var(--ui-bg,#f7f5f1); color:var(--ui-muted,#776d65); }
body[data-entry-page="billing"] .payment-error { font-size:13px; text-align:left; }
body[data-entry-page="bind"].is-embedded :is(#app-account-trigger,.app-account-panel,.app-account-backdrop) { display:none!important; }
html[data-theme] body[data-entry-page] :is(.btn-primary,.confirm-button,.advance-button,.payment-confirm,.plan-action) { color:var(--ui-on-accent,#fff)!important; }

/* Account destinations share the same palette as the menu that opens them.
   Keep this visual bridge scoped: legacy page variables and dark-theme rules
   must not introduce a second pink/blue/brown theme. No navigation or layout
   behavior belongs in this layer. */
html[data-theme] body[data-entry-page]:is([data-entry-page="account"],[data-entry-page="billing"],[data-entry-page="usage"],[data-entry-page="bind"],[data-entry-page="create"],[data-entry-page="forgot"]) {
  --paper:var(--ui-bg);
  --paper-strong:var(--ui-surface);
  --ink:var(--ui-ink);
  --ink-soft:var(--ui-muted);
  --ink-mute:var(--ui-muted);
  --muted:var(--ui-muted);
  --rose:var(--ui-accent);
  --rose-deep:var(--ui-accent);
  --rose-pale:var(--ui-accent-soft);
  --line:var(--ui-line);
  --shadow:var(--ui-shadow);
  --sakura:var(--ui-accent);
  --sakura-deep:var(--ui-accent);
  --sakura-soft:var(--ui-accent-soft);
  --glass-bg:var(--ui-surface);
  --glass-bg-strong:var(--ui-surface);
  --glass-bg-soft:var(--ui-surface);
  --glass-border:var(--ui-line);
}
html[data-theme] body[data-entry-page] :is(.account-card,.usage-card,.tier-card,.bind-card,.payment-bubble,.billing-message,.auth-card,.role-card,.wechat-onboarding-card) {
  background:var(--ui-surface)!important;
  color:var(--ui-ink);
  border-color:var(--ui-line)!important;
  box-shadow:none!important;
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
}
html[data-theme] body[data-entry-page] :is(.entry-note,.subscription-lead,.subscription-note,.tier-copy,.plan-cycle,.plan-suffix,.plan-summary,.discount-chip,.role-meta,.section-subtitle,.selected-summary,.selection-note,.wechat-onboarding-head p) {
  color:var(--ui-muted);
}
html[data-theme] body[data-entry-page] :is(.subscription-title,.tier-title,.plan-price,.selected-title,.role-name) { color:var(--ui-ink); }
html[data-theme] body[data-entry-page] :is(.entry-retry,.close-button,.payment-cancel,.wechat-onboarding-skip) {
  background:var(--ui-surface);
  color:var(--ui-ink);
  border-color:var(--ui-line);
  box-shadow:none;
}
html[data-theme] body[data-entry-page] :is(.entry-retry,.close-button,.payment-cancel,.wechat-onboarding-skip):hover { background:var(--ui-accent-soft); }
html[data-theme] body[data-entry-page] :is([class*="text-mute/"],[class*="text-gray-"]) { color:var(--ui-muted)!important; }
html[data-theme] body[data-entry-page] :is(.bg-sakura-soft,[class*="bg-sakura-soft/"],.bg-pink-50,.bg-pink-100) { background:var(--ui-accent-soft)!important; }
html[data-theme] body[data-entry-page] :is(.text-emerald-500,.text-emerald-600,.text-emerald-700,.text-green-600,.text-green-700) { color:var(--ui-positive)!important; }
html[data-theme] body[data-entry-page] :is(.text-red-400,.text-red-500,.text-red-600,.text-red-700) { color:var(--ui-danger)!important; }
html[data-theme] body[data-entry-page] :is(.bg-emerald-50,.bg-emerald-100,.bg-green-50,.bg-green-100,.bg-red-50,.bg-red-100) { background:var(--ui-bg)!important; }
html[data-theme] body[data-entry-page] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
html[data-theme] body[data-entry-page] textarea,
html[data-theme] body[data-entry-page] select { background:var(--ui-surface)!important; color:var(--ui-ink)!important; border-color:var(--ui-line)!important; }
html[data-theme] body[data-entry-page] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):focus,
html[data-theme] body[data-entry-page] :is(textarea,select):focus { background:var(--ui-surface)!important; border-color:var(--ui-accent)!important; }
html[data-theme] body[data-entry-page] input:-webkit-autofill {
  -webkit-text-fill-color:var(--ui-ink)!important;
  -webkit-box-shadow:0 0 0 1000px var(--ui-surface) inset!important;
}

html[data-theme] body[data-entry-page="account"] .account-service { border-color:var(--ui-line); }
html[data-theme] body[data-entry-page="account"] .account-service:hover { background:var(--ui-accent-soft); }
html[data-theme] body[data-entry-page="account"] .account-service-icon { background:var(--ui-accent-soft); color:var(--ui-accent); }
html[data-theme] body[data-entry-page="account"] #profile-save { background:var(--ui-accent)!important; color:var(--ui-on-accent,#fff)!important; }
html[data-theme] body[data-entry-page="usage"] :is(.usage-hero,#usage-details) { background:var(--ui-surface); }
html[data-theme] body[data-entry-page="usage"] .subscription-stat { background:var(--ui-bg); }
html[data-theme] body[data-entry-page="usage"] .usage-progress { background:var(--ui-line); }
html[data-theme] body[data-entry-page="usage"] .usage-progress > span { background:var(--ui-accent); }
html[data-theme] body[data-entry-page="usage"] .usage-ledger-row { border-color:var(--ui-line); }
html[data-theme] body[data-entry-page="usage"] :is(#usage-plan,#usage-detail-toggle) {
  background:var(--ui-accent-soft)!important;
  color:var(--ui-accent)!important;
  border-color:var(--ui-line);
  box-shadow:none;
}
html[data-theme] body[data-entry-page="billing"] .subscription-panel { background:none; color:var(--ui-ink); }
html[data-theme] body[data-entry-page="billing"] :is(.test-billing-banner,.current-subscription,.billing-cycle) {
  background:var(--ui-surface);
  color:var(--ui-muted);
  border-color:var(--ui-line);
}
html[data-theme] body[data-entry-page="billing"] .discount-chip { background:none; border-color:transparent; }
html[data-theme] body[data-entry-page="billing"] .purchase-status { background:none; color:var(--ui-muted); }
html[data-theme] body[data-entry-page="billing"] .payment-row { color:var(--ui-muted); border-color:var(--ui-line); }
html[data-theme] body[data-entry-page="billing"] .payment-row strong { color:var(--ui-ink); }
html[data-theme] body[data-entry-page="billing"] .payment-error { color:var(--ui-danger); }
html[data-theme] body[data-entry-page="bind"] :is(#bind-help,#qq-command-panel,#btn-copy-command,#qq-bind-command) { border-color:var(--ui-line); }
html[data-theme] body[data-entry-page="bind"] :is(#bind-help,#btn-copy-command,#qq-bind-command) { background:var(--ui-surface)!important; }
/* Override the legacy character-theme !important gradient. Loading/error
   panels follow the app surface; a visible QR retains its white quiet zone. */
html[data-theme] body[data-entry-page="bind"] .qr-frame { border-color:var(--ui-line)!important; background:var(--ui-surface)!important; color:var(--ui-ink); }
html[data-theme] body[data-entry-page="bind"] .qr-frame:has(#qr-img:not(.hidden)) { background:#fff!important; }
html[data-theme] body[data-entry-page="bind"] #qr-img { background:#fff!important; }
html[data-theme] body[data-entry-page="create"] :is(.page-shell,.library-section) { background:none; }
html[data-theme] body[data-entry-page="create"] :is(.selection-panel,.wechat-onboarding-frame) { background:var(--ui-surface); border-color:var(--ui-line); }
html[data-theme] body[data-entry-page="create"] .role-cover-wrap { background:var(--ui-accent-soft); }
html[data-theme] body[data-entry-page="create"] :is(.role-gender,.role-gender.male,.selection-label) { color:var(--ui-accent); }
html[data-theme] body[data-entry-page="create"] .role-tag { background:var(--ui-accent-soft); color:var(--ui-muted); }
html[data-theme] body[data-entry-page="create"] .role-status { background:var(--ui-surface); color:var(--ui-muted); }
html[data-theme] body[data-entry-page="create"] .role-status.active { background:var(--ui-accent); color:var(--ui-on-accent,#fff); }
html[data-theme] body[data-entry-page="create"] .role-card:hover { border-color:var(--ui-accent)!important; }
html[data-theme] body[data-entry-page="create"] .role-card.selected { border-color:var(--ui-accent)!important; }
html[data-theme] body[data-entry-page="create"] .filter-button:hover { color:var(--ui-accent); border-color:var(--ui-accent); }
html[data-theme] body[data-entry-page="create"] :is(.loading,.notice,.empty-state) { background:var(--ui-surface); color:var(--ui-muted); border-color:var(--ui-line); }
html[data-theme] body[data-entry-page="create"] .notice.error { color:var(--ui-danger); }
html[data-theme] body[data-entry-page="create"] .notice.ok { color:var(--ui-positive); }
html[data-theme] body[data-entry-page="create"] .spinner { border-color:var(--ui-line); border-top-color:var(--ui-accent); }

@media(max-width:1000px) {
  body[data-entry-page="create"] .role-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media(max-width:767px) {
  body[data-entry-page="auth"] header { padding:16px 22px; }
  body[data-entry-page="auth"] main { padding:10px 20px 32px!important; }
  body[data-entry-page="auth"] .auth-card.glass { padding:24px!important; }
  body[data-entry-page="auth"] .auth-card h2 { font-size:26px; }
  body[data-entry-page="auth"] main > div { display:block; }
  body[data-entry-page="auth"] .promise-panel { display:none; }
  body[data-entry-page="create"] .page-shell { width:calc(100% - 32px); margin:16px auto 32px; }
  body[data-entry-page="create"] .hero { min-height:220px; margin-bottom:24px; border-radius:22px; background-position:66% center; }
  body[data-entry-page="create"] .hero-content { width:100%; padding:36px 22px 30px; }
  body[data-entry-page="create"] .hero-copy { max-width:270px; font-size:14px; }
  body[data-entry-page="create"] .hero h1 { font-size:30px; }
  body[data-entry-page="create"] .library-head { gap:18px; flex-direction:column; }
  body[data-entry-page="create"] .filters { width:100%; }
  body[data-entry-page="create"] .filter-button { flex:1; }
  body[data-entry-page="create"] .role-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
  body[data-entry-page="create"] .role-details { padding:14px; }
  body[data-entry-page="create"] .role-name { font-size:20px; }
  body[data-entry-page="create"] .role-summary { -webkit-line-clamp:3; }
  body[data-entry-page="create"] .selection-panel { bottom:8px; padding:16px; }
  body[data-entry-page="create"] .wechat-onboarding-head { padding:12px; gap:10px; }
  body[data-entry-page="create"] .wechat-onboarding-head p { display:none; }
  body[data-entry-page="bind"] main { padding:12px 20px 32px; }
  body[data-entry-page="bind"] #page-title { font-size:26px; }
  body[data-entry-page="bind"] .bind-card { grid-template-columns:1fr; padding:22px; gap:22px; }
  body[data-entry-page="bind"].is-embedded main { padding:12px; }
  body[data-entry-page="bind"].is-embedded .bind-card > div:last-child :is(h2,ol) { display:block!important; }
  body[data-entry-page="billing"] .billing-stage { padding:24px 16px 40px; }
  body[data-entry-page="billing"] .subscription-title { font-size:28px; }
  body[data-entry-page="billing"] .tier-list { grid-template-columns:1fr; gap:16px; }
  body[data-entry-page="billing"] .tier-card { padding:20px; }
  body[data-entry-page="billing"] .tier-copy { min-height:0; margin:6px 0 14px; }
  body[data-entry-page="billing"] .plan-option { min-height:0; }
  body[data-entry-page="billing"] .plan-action { margin-top:18px; }
}
@media(max-height:500px) and (orientation:landscape) {
  body[data-entry-page="create"] .hero { min-height:0; }
  body[data-entry-page="create"] .hero-content { padding-block:24px; }
  body[data-entry-page="auth"] header { padding:8px 20px; }
  body[data-entry-page="auth"] main { padding:4px 20px 24px!important; }
  body[data-entry-page="auth"] .auth-card.glass { padding:20px!important; }
  body[data-entry-page="auth"] .auth-card > div:first-child { margin-bottom:10px; }
  body[data-entry-page="auth"] .auth-card > div:first-child p { display:none; }
  body[data-entry-page="auth"] .auth-card > div:nth-child(2) { margin-bottom:14px; }
  body[data-entry-page="create"] .wechat-onboarding-frame { height:calc(100dvh - 100px); }
  body[data-entry-page="billing"] .payment-backdrop { padding:8px; }
  body[data-entry-page="billing"] .payment-bubble { max-height:calc(100dvh - 16px); padding:16px; }
  body[data-entry-page="billing"] .payment-actions { bottom:0; }
}
