/* The free-test engine shares the homepage's editorial palette.
   Screen-only rules leave the existing native print styles intact.
   Visibility and membership state remain controlled by the legacy engine. */
@font-face {
  font-family: "MMT Editorial Serif";
  src: url("/fonts/mmt-editorial-serif.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@media screen {
  body.tool-editorial {
    --editorial-paper: #f5f2eb;
    --editorial-ink: #202e30;
    --editorial-muted: #5d655f;
    --editorial-line: #cecfc5;
    --editorial-accent: #8b5039;
    --editorial-serif: "MMT Editorial Serif", "Noto Serif TC", "Songti TC", "PMingLiU", serif;
    --ink: var(--editorial-ink);
    --blue: var(--editorial-accent);
    --muted: var(--editorial-muted);
    background: var(--editorial-paper) !important;
    color: var(--editorial-ink) !important;
    padding-top: 81px !important;
  }

  /* Navigation uses the same dimensions and wordmark as the homepage. */
  .tool-editorial .site-nav { background: #f5f2ebf5; border-color: var(--editorial-line); }
  .tool-editorial .nav-inner { max-width: 1288px; min-height: 80px; padding-inline: 32px; }
  .tool-editorial .wordmark strong { font-family: Georgia, serif; font-size: 30px; font-weight: 500; letter-spacing: -.06em; }
  .tool-editorial .wordmark span { border-color: #b8b9ae; font-size: 12px; color: var(--editorial-muted); }
  .tool-editorial a.nav-cta { background: var(--editorial-ink); color: #fff; border-radius: 0; padding: 12px 19px; min-height: 44px; }
  .tool-editorial a.nav-cta:hover { background: #394b49; transform: none; }
  .tool-editorial .mega { background: var(--editorial-paper); border-color: var(--editorial-line); box-shadow: 0 12px 20px #202e3008; }
  .tool-editorial .mega-inner { padding-inline: 28px; }
  .tool-editorial .mobile-menu.open { background: var(--editorial-paper); border-color: var(--editorial-line); }

  .tool-editorial #pane-calc {
    --navy: var(--editorial-ink);
    --gold: var(--editorial-accent);
    --sf: #fcfaf6;
    --sf2: #eeeee5;
    --bd: var(--editorial-line);
    --bd2: #b5b9ac;
    --bdc: var(--editorial-line);
    --tx: var(--editorial-ink);
    --mu: var(--editorial-muted);
    --hi: #697268;
    max-width: 1184px !important;
    padding: 28px 32px 40px !important;
  }
  .tool-editorial #pane-calc .tool-shell { max-width: 1120px !important; }
  .tool-editorial #lang-switcher { margin-bottom: 30px !important; }
  .tool-editorial .lang-dd-btn {
    background: transparent; color: var(--editorial-ink); border: 1px solid var(--editorial-line);
    border-radius: 0; box-shadow: none; font-size: 14px; min-height: 44px;
  }
  .tool-editorial .lang-dd-menu { border-radius: 4px; background: #fcfaf6; }
  .tool-editorial .lang-dd-item { border-radius: 2px; }
  .tool-editorial .lang-dd-item.on { background: #e9e9df; }
  .tool-editorial .lang-dd-btn .lang-dd-globe { color: var(--editorial-muted); }

  /* Real DOM order: introduction, birthday fields, secondary member entry. */
  .tool-editorial .tool-intro-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    column-gap: clamp(32px, 5vw, 72px);
    align-items: start;
    margin-bottom: 48px;
  }
  .tool-editorial .tool-intro-grid > .shdr {
    grid-column: 1; grid-row: 1;
    text-align: left; justify-content: flex-start;
    margin: 24px 0 32px !important;
  }
  .tool-editorial .tool-intro-grid > .shdr > div { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
  .tool-editorial .tool-intro-grid .stitle {
    font-family: var(--editorial-serif) !important;
    font-size: clamp(34px, 3.9vw, 48px) !important;
    font-weight: 600 !important;
    line-height: 1.5 !important;
    letter-spacing: .025em !important;
    text-wrap: balance;
    margin: 0 0 22px;
    color: var(--editorial-ink);
  }
  .tool-editorial .shdr [data-i18n="head.kicker"] {
    order: -1; font-size: 12px !important; letter-spacing: .18em !important;
    margin: 0 0 24px !important; color: var(--editorial-accent) !important;
  }
  .tool-editorial .shdr [data-i18n="head.lede"] { font-size: 17px !important; line-height: 1.95; margin: 0 !important; max-width: 26em; text-wrap: balance; }
  .tool-editorial .shdr [data-i18n="head.sub"] { font-size: 14px !important; line-height: 1.8; margin-top: 16px !important; }
  .tool-editorial.customer-lead-mode .shdr [data-i18n="head.sub"] { display: none; }
  .tool-editorial .tool-intro-grid .shdr > div > div:last-child { margin: 26px 0 0 !important; width: 64px !important; background: var(--editorial-line) !important; }
  /* 首屏四大能量圓盤（訪客與會員共用；文字是真 HTML 疊在圖上） */
  #lead-energy-wheel { display: none; }
  .tool-editorial #lead-energy-wheel {
    display: block; position: relative; container-type: inline-size;
    grid-column: 1; grid-row: 2; justify-self: center; align-self: center;
    width: min(100%, 500px); aspect-ratio: 1; margin: 0 0 32px;
    filter: drop-shadow(0 18px 34px #202e3021);
  }
  #lead-energy-wheel img { display: block; width: 100%; height: 100%; }
  #lead-energy-wheel figcaption { position: absolute; inset: 0; margin: 0; color: var(--editorial-ink); }
  #lead-energy-wheel .ew-q {
    position: absolute; transform: translate(-50%, -50%);
    display: flex; flex-direction: column; align-items: center; gap: 1.2cqw;
    white-space: nowrap; text-shadow: 0 0 10px #fcf9f3, 0 0 18px #fcf9f3, 0 0 3px #fcf9f3;
  }
  #lead-energy-wheel .ew-q svg {
    width: 8.4cqw; height: 8.4cqw; padding: 1.7cqw; box-sizing: border-box; margin-bottom: .4cqw;
    background: #fcfaf6; border-radius: 50%; box-shadow: 0 0 0 1px #c8890f66, 0 2px 8px #202e3024;
  }
  #lead-energy-wheel .ew-wind svg { color: #14785a; }
  #lead-energy-wheel .ew-fire svg { color: #b53a1d; }
  #lead-energy-wheel .ew-water svg { color: #185fae; }
  #lead-energy-wheel .ew-earth svg { color: #8a5210; }
  #lead-energy-wheel .ew-q b { font-family: var(--editorial-serif); font-weight: 600; font-size: 9.6cqw; line-height: 1; }
  #lead-energy-wheel .ew-q i { font-style: normal; font-weight: 600; font-size: 3.5cqw; letter-spacing: .08em; }
  #lead-energy-wheel .ew-wind { left: 28%; top: 27%; }
  #lead-energy-wheel .ew-fire { left: 72%; top: 27%; }
  #lead-energy-wheel .ew-water { left: 28%; top: 73%; }
  #lead-energy-wheel .ew-earth { left: 72%; top: 73%; }
  #lead-energy-wheel .ew-wind b { color: #14785a; }
  #lead-energy-wheel .ew-fire b { color: #b53a1d; }
  #lead-energy-wheel .ew-water b { color: #185fae; }
  #lead-energy-wheel .ew-earth b { color: #6e3f08; }
  #lead-energy-wheel .ew-core {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: 27%; display: flex; flex-direction: column; align-items: center; gap: .8cqw;
    text-align: center; white-space: nowrap;
  }
  #lead-energy-wheel .ew-core em { font-style: normal; font-size: 3.1cqw; letter-spacing: .06em; color: var(--editorial-muted); }
  #lead-energy-wheel .ew-core strong { font-family: var(--editorial-serif); font-weight: 600; font-size: 4.5cqw; color: var(--editorial-accent); }
  html:not([lang^="zh"]) #lead-energy-wheel :is(.ew-q i, .ew-core) { display: none; }
  html:not([lang^="zh"]) #lead-energy-wheel .ew-q b { font-size: 6cqw; }
  .tool-editorial #lead-member-entry {
    grid-column: 1; grid-row: 3; align-self: end;
    width: 100%; max-width: none; margin: 0 !important;
    padding: 22px 0 0 !important; border: 0 !important; border-top: 1px solid var(--editorial-line) !important;
    background: transparent !important; border-radius: 0 !important; gap: 16px;
  }
  .tool-editorial #lead-member-entry [data-i18n="member.q"] { font-size: 15px !important; font-weight: 600 !important; }
  .tool-editorial #lead-member-entry [data-i18n="member.desc"] { font-size: 14px !important; line-height: 1.8; }
  .tool-editorial #lead-member-entry button {
    background: transparent !important; color: var(--editorial-ink) !important;
    border: 1px solid #a7aea1 !important; border-radius: 0 !important;
    padding: 10px 16px !important; font-size: 14px !important; font-weight: 600 !important; min-height: 44px;
  }
  .tool-editorial #lead-member-entry button:hover { background: #e9e9df !important; }

  .tool-editorial .birthday-input-card {
    grid-column: 2; grid-row: 1 / 4;
    width: 100%; min-width: 0; max-width: none;
    margin: 0 !important; padding: 32px !important;
    background: #fcfaf6 !important; border: 1px solid var(--editorial-line) !important;
    border-top: 3px solid var(--editorial-ink) !important;
    border-radius: 0 !important; box-shadow: 0 8px 28px #202e3004 !important;
  }
  .tool-editorial .tool-form-heading { border-bottom: 1px solid #deded3; padding-bottom: 22px; margin-bottom: 24px; }
  .tool-editorial .tool-form-heading > span { display: block; font-size: 11px; letter-spacing: .12em; color: var(--editorial-muted); margin-bottom: 8px; }
  .tool-editorial .tool-form-heading h2 { font-family: var(--editorial-serif) !important; font-size: 25px; font-weight: 600; line-height: 1.55; margin: 0; }
  .tool-editorial .birthday-input-card label { font-size: 15px !important; font-weight: 600 !important; letter-spacing: .02em !important; margin-bottom: 8px !important; color: var(--editorial-ink) !important; }
  .tool-editorial .birthday-input-card :is(input:not([type=radio]), select) {
    background: #fffefb !important; border: 1px solid #b5b9ac !important;
    border-radius: 3px !important; color: var(--editorial-ink) !important;
    min-height: 50px; padding: 12px !important; font-size: 16px !important;
    min-width: 0; max-width: 100%;
  }
  .tool-editorial #c-era-hint { font-size: 14px !important; }
  .tool-editorial #c-era-hint:empty { display: none; }
  .tool-editorial .tool-birthday-fields { grid-template-columns: 1.25fr 1fr 1fr !important; gap: 10px !important; }
  .tool-editorial .tool-birthday-fields > div { min-width: 0; }
  .tool-editorial #c-privacy-note { font-size: 13px !important; line-height: 1.85 !important; margin-top: 12px !important; }
  .tool-editorial #calc-empty { margin-top: 22px; padding: 14px 0 0 !important; border-top: 1px solid #deded3; font-size: 14px !important; line-height: 1.8 !important; color: var(--editorial-muted) !important; text-align: left !important; }
  .tool-editorial #calc-empty br { display: block; }

  /* Results retain the four energy colours as meaningful chart labels. */
  .tool-editorial #calc-result { scroll-margin-top: 110px; }
  .tool-editorial #calc-name-badge {
    background: transparent !important; color: var(--editorial-ink) !important;
    padding: 22px 0 !important; margin-bottom: 24px !important;
    border-radius: 0 !important; border-top: 1px solid var(--editorial-line);
    font-family: var(--editorial-serif); font-size: 28px !important; font-weight: 600 !important;
    overflow-wrap: anywhere;
  }
  .tool-editorial .tool-result-grid { gap: 18px !important; }
  .tool-editorial .tool-result-card {
    padding: 28px !important; border: 1px solid var(--editorial-line) !important;
    border-radius: 3px !important; background: #fcfaf6 !important; min-width: 0;
  }
  .tool-editorial .tool-result-card > div:first-child:not(#r-mentor-shadow-grid),
  .tool-editorial #r-mentor-shadow-grid [data-i18n] {
    color: var(--editorial-ink) !important; font-size: 19px !important;
    font-weight: 600 !important; letter-spacing: .03em !important; margin-bottom: 18px !important;
  }
  .tool-editorial [data-i18n="card.energyHint"] { font-size: 13px; font-weight: 400; color: var(--editorial-muted); letter-spacing: 0; margin-left: 8px; }
  .tool-editorial #energy-gauges { gap: 12px !important; }
  .tool-editorial #energy-gauges .gauge-card { background: #f5f4ed !important; border-radius: 3px !important; }
  .tool-editorial #energy-gauges summary { padding: 18px 10px !important; background: none !important; }
  .tool-editorial #energy-gauges .gauge-card[open] { background: #fcfaf6 !important; }
  .tool-editorial #energy-gauges summary .noprint { color: var(--editorial-muted) !important; font-size: 13px !important; }
  .tool-editorial #r-energy svg circle[stroke="#EAF5FC"] { stroke: #e1e3d9; }
  .tool-editorial #calc-result .chip { border-radius: 3px; font-size: 17px !important; line-height: 1.7; padding: 7px 12px !important; }
  .tool-editorial #r-gifts .chip { background: #eeede3; color: #4e5346; border: 1px solid #d6d7c7; }
  .tool-editorial #r-mentors .chip { background: #eaf0ed; color: #3a5c51; border: 1px solid #cdd9d1; }
  .tool-editorial #r-complete .chip { background: #80513e !important; color: #fff !important; }
  .tool-editorial #r-complete-box b { color: var(--editorial-accent) !important; }
  .tool-editorial #r-ys .chip { background: #eaf0ed !important; color: #3a5c51 !important; border: 1px solid #cdd9d1; }
  .tool-editorial #r-ys .chip + .chip { background: #f2eee2 !important; color: #665439 !important; border-color: #d9d1be; }
  .tool-editorial #r-hook-wrap,
  .tool-editorial #mmt-lead-flow { background: var(--editorial-ink) !important; border: 0 !important; border-radius: 3px !important; padding: 32px !important; box-shadow: none !important; margin-block: 24px !important; }
  .tool-editorial #r-hook-wrap > div:first-child,
  .tool-editorial #mmt-lead-flow [data-i18n="lead.kicker"] { color: #d9c4a2 !important; font-size: 13px !important; letter-spacing: .1em !important; }
  .tool-editorial #mmt-lead-flow [data-i18n="lead.title"] { font-family: var(--editorial-serif); font-size: 28px !important; font-weight: 600 !important; line-height: 1.6 !important; }
  .tool-editorial #mmt-lead-flow [data-i18n="lead.desc"] { font-size: 16px !important; }
  .tool-editorial #mmt-lead-flow label { font-size: 16px !important; font-weight: 500 !important; }
  .tool-editorial #mmt-lead-flow select { border: 1px solid #b9c1b7 !important; border-radius: 3px !important; background: #fcfaf6 !important; color: var(--editorial-ink) !important; min-height: 50px; }
  .tool-editorial .mmt-lead-actions button { border-radius: 3px !important; font-size: 16px !important; font-weight: 600 !important; min-height: 52px; }
  .tool-editorial .mmt-lead-actions button:first-child { background: #e6ead9 !important; color: #243b30 !important; }
  .tool-editorial #lead-flow-status { color: #d9c4a2 !important; font-size: 14px !important; }
  .tool-editorial #r-hook { font-size: 18px !important; }
  .tool-editorial #r-hook-wrap :is(a, button) { font-size: 16px !important; border-radius: 3px !important; }
  .tool-editorial #r-hook-wrap button { color: #e6d3b4 !important; border-color: #acac92 !important; }
  .tool-editorial #r-hook-wrap .bgold { color: var(--editorial-ink) !important; background: #e6d3b4 !important; border-color: #e6d3b4 !important; }
  .tool-editorial :is(#team-role-section, #team-config-section) { background: #fcfaf6 !important; border: 1px solid var(--editorial-line) !important; border-radius: 3px !important; padding: 28px !important; margin-block: 24px !important; }
  .tool-editorial .mmt-next { background: #eeece3; border-color: var(--editorial-line); border-radius: 3px; padding: 28px; }
  .tool-editorial .mmt-next h2 { font-family: var(--editorial-serif) !important; color: var(--editorial-ink); font-weight: 600; }
  .tool-editorial a.mmt-primary { background: var(--editorial-ink); border-radius: 3px; font-size: 16px; }
  .tool-editorial a.mmt-primary:hover { background: #394b49; }
  .tool-editorial .mmt-secondary { color: var(--editorial-accent); }
  .tool-editorial .aeo-intro {
    border-top: 1px solid var(--editorial-line); padding-top: 28px;
    margin: 48px auto 0 !important; max-width: 880px;
    font-size: 15px !important; line-height: 1.95 !important;
  }
  .tool-editorial .aeo-intro details { margin-block: 20px !important; }
  .tool-editorial .aeo-intro summary { padding-block: 10px; min-height: 44px; }
  .tool-editorial .aeo-intro dd { margin-bottom: 20px !important; }
  .tool-editorial .aeo-intro > p:last-child { font-size: 12px !important; line-height: 2; }
  .tool-editorial .aeo-intro a:hover { text-decoration: underline; }

  /* Keep the member entry visually connected without altering authentication. */
  .tool-editorial #auth-modal {
    --navy: var(--editorial-ink); --gold: var(--editorial-accent);
    --tx: var(--editorial-ink); --mu: var(--editorial-muted);
    background: #202e30bf !important; overflow-y: auto;
  }
  .tool-editorial #auth-modal > div {
    background: #fcfaf6 !important; border-top-color: var(--editorial-ink) !important;
    border-radius: 3px !important; max-height: calc(100dvh - 32px); overflow-y: auto;
  }
  .tool-editorial #auth-title { font-family: var(--editorial-serif); font-weight: 600 !important; }
  .tool-editorial #auth-modal input { background: #fffefb; border-color: #b5b9ac !important; border-radius: 3px !important; }
  .tool-editorial #auth-submit { background: var(--editorial-ink) !important; color: #fff !important; border-color: var(--editorial-ink) !important; min-height: 50px; }

  .tool-editorial .site-footer { background: #ece9e1; border-top: 1px solid var(--editorial-line); color: #555e59; margin-top: 32px; }
  .tool-editorial .site-footer .wrap-new { max-width: 1288px; padding-inline: 32px; }
  .tool-editorial .footer-top { color: var(--editorial-ink); border-color: #c8cabf; }
  .tool-editorial .footer-top strong { font-family: var(--editorial-serif); font-size: 23px; font-weight: 600; }
  .tool-editorial .footer-grid strong { color: var(--editorial-ink); }
  .tool-editorial .footer-grid a { min-height: 36px; display: flex; align-items: center; }
  .tool-editorial .footer-note { color: #646b62; }
  .tool-editorial .footer-bottom { border-color: #c8cabf; }
  .tool-editorial :is(a, button, summary, input, select, textarea):focus-visible { outline: 2px solid var(--editorial-accent) !important; outline-offset: 4px; }
}

@media screen and (max-width: 1000px) {
  .tool-editorial .nav-inner { gap: 20px; padding-inline: 24px; }
  .tool-editorial .nav-links { gap: 15px; }
  .tool-editorial .tool-intro-grid { column-gap: 32px; }
  .tool-editorial .birthday-input-card { padding: 26px !important; }
  .tool-editorial .birthday-input-card select { padding-inline: 8px !important; }
}
@media screen and (max-width: 760px) {
  body.tool-editorial { padding-top: 71px !important; }
  .tool-editorial .nav-inner { min-height: 70px; padding: 10px 20px; gap: 12px; }
  .tool-editorial .wordmark strong { font-size: 27px; }
  .tool-editorial .wordmark span { font-size: 10px; padding-left: 10px; }
  .tool-editorial a.nav-cta { font-size: 13px; padding: 11px 14px; }
  .tool-editorial .menu-toggle { font-size: 23px; padding: 6px; }
  .tool-editorial #pane-calc { padding: 20px 20px 28px !important; }
  .tool-editorial #lang-switcher { margin-bottom: 14px !important; }
  .tool-editorial .tool-intro-grid { grid-template-columns: minmax(0, 1fr); margin-bottom: 32px; gap: 0; }
  .tool-editorial .tool-intro-grid > .shdr { grid-column: 1; grid-row: auto; margin: 10px 0 28px !important; }
  .tool-editorial .tool-intro-grid .stitle { font-size: clamp(30px, 7.7vw, 38px) !important; line-height: 1.5 !important; max-width: 17em; margin-bottom: 16px; }
  .tool-editorial .shdr [data-i18n="head.kicker"] { margin-bottom: 16px !important; font-size: 11px !important; }
  .tool-editorial .shdr [data-i18n="head.lede"] { font-size: 16px !important; }
  .tool-editorial .tool-intro-grid .shdr > div > div:last-child { display: none; }
  .tool-editorial .birthday-input-card { grid-column: 1; grid-row: auto; padding: 24px 20px !important; }
  .tool-editorial .tool-form-heading { margin-bottom: 20px; padding-bottom: 18px; }
  .tool-editorial .tool-form-heading h2 { font-size: 23px; }
  .tool-editorial #lead-member-entry { grid-column: 1; grid-row: auto; margin-top: 24px !important; padding-top: 20px !important; }
  .tool-editorial #lead-energy-wheel { grid-column: 1; grid-row: auto; width: min(100%, 400px); margin: 32px auto 0; }
  .tool-editorial.has-calc-result #lead-energy-wheel { display: none; }
  #lead-energy-wheel .ew-q i { font-size: 3.9cqw; letter-spacing: .04em; }
  #lead-energy-wheel .ew-core em { font-size: 3.3cqw; letter-spacing: 0; }
  .tool-editorial #calc-name-badge { font-size: 25px !important; }
  .tool-editorial .tool-result-card { padding: 22px 18px !important; }
  .tool-editorial [data-i18n="card.energyHint"] { display: block; margin: 4px 0 0; }
  .tool-editorial #r-energy > div { gap: 24px !important; }
  .tool-editorial #energy-gauges { flex-basis: 100% !important; }
  .tool-editorial #energy-gauges summary { padding: 14px 8px !important; }
  .tool-editorial :is(#r-hook-wrap, #mmt-lead-flow, #team-role-section, #team-config-section) { padding: 24px 20px !important; }
  .tool-editorial #mmt-lead-flow [data-i18n="lead.title"] { font-size: 25px !important; }
  .tool-editorial .mmt-lead-actions { grid-template-columns: minmax(0, 1fr) !important; }
  .tool-editorial .aeo-intro { margin-top: 36px !important; }
  .tool-editorial .site-footer .wrap-new { padding-inline: 24px; }
  .tool-editorial .footer-grid a { min-height: 44px; }
}
@media screen and (max-width: 380px) {
  .tool-editorial .wordmark span { display: none; }
  .tool-editorial #pane-calc { padding-inline: 16px !important; }
  .tool-editorial .birthday-input-card { padding-inline: 16px !important; }
  .tool-editorial .tool-birthday-fields { gap: 8px !important; }
  .tool-editorial .birthday-input-card select { padding-inline: 8px !important; }
}
