/* ===== EssaColor v8 shared site template (all prerendered + kept pages) ===== */
.lang a { min-width: 44px; min-height: 44px; padding: 0 10px; border-radius: 40px; font-size: 15px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.lang a[aria-current="true"] { color: var(--ink); background: var(--lime); box-shadow: inset 0 0 0 5px #000; }
.lang a:hover { color: var(--paper); }
.lang a[aria-current="true"]:hover { color: var(--ink); }
.sitepage main { max-width: 1180px; padding-top: 18px; }
.crumbs { font-size: 14px; color: var(--muted); margin: 4px 0 18px; letter-spacing: .04em; }
.crumbs a { color: #ccc8bf; text-decoration: underline; text-decoration-color: #57534e; text-underline-offset: 3px; }
.guide-head { border-bottom: 1px solid var(--line); padding-bottom: 22px; margin-bottom: 26px; }
.kicker, .stamp { font-size: 14px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.guide-head h1, .legacy h1 { font-size: clamp(30px, 4.2vw, 52px); line-height: 1.12; margin: 10px 0 16px; font-weight: 600; letter-spacing: -.01em; }
.lede { font-size: 19px; line-height: 1.65; max-width: 44em; margin: 0 0 12px; color: #e6dfd0; }
.stamp { margin-top: 14px; text-transform: none; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; margin: 0 0 34px; }
.pcard { border: 1px solid var(--line); border-radius: 8px; padding: 12px 12px 16px; display: flex; flex-direction: column; gap: 6px; background: #070706; transition: border-color .2s; }
.pcard:hover { border-color: var(--lime); }
.pcard .object { border-radius: 6px; }
.pcard .avail { right: 6px; top: 6px; }
.pcard h3 { font-size: 17px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pmeta { font-size: 14px; color: var(--muted); }
.pwhy { font-size: 15px; line-height: 1.5; color: #d9d2c3; flex: 1; }
.pcard .buy { margin-top: 8px; min-height: 44px; font-size: 15px; padding: 8px 14px; }
.pcard .buy.soon { color: var(--muted); border-style: dashed; }
.tips h2, .faq h2, .products h2, .legacy h2 { font-size: clamp(22px, 2.6vw, 30px); margin: 30px 0 14px; line-height: 1.25; }
.tipgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.tipgrid div { border-top: 1px solid var(--line); padding-top: 12px; }
.tipgrid h3, .legacy h3 { font-size: 19px; margin: 0 0 6px; }
.tipgrid p, .faq p { font-size: 16px; line-height: 1.6; color: #d9d2c3; }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-size: 17px; font-weight: 600; min-height: 28px; }
.faq details p { margin-top: 10px; }
.cta { margin: 34px 0 10px; padding: 22px; border: 1px dashed #57534e; border-radius: 8px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.cta p { font-size: 17px; max-width: 36em; }
.gcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 30px; }
.gcard { border: 1px solid var(--line); border-radius: 8px; padding: 16px; display: block; }
.gcard:hover { border-color: var(--lime); color: inherit; }
.gcard h2 { font-size: 19px; margin-bottom: 8px; line-height: 1.3; }
.gcard p { font-size: 15px; color: var(--muted); line-height: 1.5; }
.datatable { width: 100%; border-collapse: collapse; margin: 8px 0 24px; font-size: 16px; }
.datatable th, .datatable td { border-bottom: 1px solid var(--line); padding: 10px 8px; text-align: left; vertical-align: top; line-height: 1.5; }
.datatable th { color: var(--muted); font-weight: 600; font-size: 14px; letter-spacing: .04em; }
.note-box { border-left: 3px solid var(--lime); padding: 10px 14px; margin: 14px 0 22px; font-size: 16px; line-height: 1.6; color: #d9d2c3; background: #0b0b0a; }
/* footer */
.site-foot { width: 91.1%; max-width: 1540px; margin: 30px auto 0; border-top: 1px solid var(--line); padding: 28px 0 calc(34px + env(safe-area-inset-bottom)); }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 24px; }
.site-foot .logo { font-size: 34px; }
.site-foot p { font-size: 15px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.site-foot h2 { font-size: 14px; letter-spacing: .1em; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.site-foot .foot-grid a { display: block; font-size: 15px; padding: 6px 0; }
.site-foot .foot-note { margin-top: 22px; font-size: 14px; }
@media (max-width: 760px) {
  .sitepage main { padding-top: 10px; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-grid > div:first-child { grid-column: 1 / -1; }
  .site-foot { width: calc(100% - 32px); padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
  .pgrid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .pcard { padding: 8px 8px 12px; min-width: 0; }
  .pcard h3 { font-size: 15px; }
  .pwhy { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .pmeta { font-size: 12px; }
  .pcard .buy { font-size: 13px; padding: 6px 8px; }
  .pcard .avail { font-size: 12px; padding: 4px 7px; }
  .lede { font-size: 17px; }
  .datatable { font-size: 14px; display: block; overflow-x: auto; }
  .lang a { font-size: 14px; }
}
@media (max-width: 760px) { body.sitepage .bottom { display: grid; } }

/* ===== kept old pages: content verbatim, v8 look ===== */
.legacy { font-size: 17px; line-height: 1.7; color: #e6dfd0; }
.legacy p, .legacy li { max-width: 46em; margin: 0 0 14px; }
.legacy ul, .legacy ol { padding-left: 1.3em; margin: 0 0 16px; }
.legacy a:not(.pill):not(.button) { color: var(--paper); text-decoration: underline; text-decoration-color: var(--lime); text-underline-offset: 3px; }
.legacy a:hover { color: var(--lime); }
.legacy img { max-width: 100%; height: auto; border-radius: 6px; }
.legacy table { width: 100%; border-collapse: collapse; margin: 8px 0 24px; font-size: 16px; display: block; overflow-x: auto; }
.legacy th, .legacy td { border-bottom: 1px solid var(--line); padding: 9px 8px; text-align: left; vertical-align: top; }
.legacy th { color: var(--muted); font-size: 14px; }
.legacy details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.legacy summary { cursor: pointer; font-weight: 600; }
.legacy .breadcrumbs, .legacy .crumbs, .legacy nav[aria-label*="readcrumb"] { font-size: 14px; color: var(--muted); }
.legacy .micro, .legacy small { font-size: 14px; color: var(--muted); }
.legacy .button, .legacy button:not(.close), .legacy .cta-button, .legacy .seo-experience-button {
  border: 1px solid var(--paper); border-radius: 40px; padding: 10px 20px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; font-weight: 600; background: var(--paper); color: var(--ink) !important; text-decoration: none !important; font-size: 16px; cursor: pointer; }
.legacy .button.secondary { background: transparent; color: var(--paper) !important; border-color: #57534e; }
.legacy .button:hover, .legacy button:not(.close):hover { background: var(--lime); border-color: var(--lime); color: #000 !important; }
.legacy input, .legacy select, .legacy textarea { background: #0d0d0c; color: var(--paper); border: 1px solid #57534e; border-radius: 6px; min-height: 44px; padding: 8px 10px; font-size: 16px; }
.legacy code { background: #151412; padding: 1px 5px; border-radius: 4px; font-size: .92em; }
.legacy dialog, .legacy-dlg { background: #0b0b0a; color: var(--paper); border: 1px solid var(--line); border-radius: 10px; max-width: min(680px, 92vw); }
.legacy dialog::backdrop { background: #000c; }
.legacy [style*="background"] { border-color: #ffffff22; }
.products { border-top: 1px solid var(--line); margin-top: 34px; padding-top: 8px; }
.products .sub { color: var(--muted); font-size: 15px; margin: -6px 0 16px; }
@media (max-width: 760px) { .legacy { font-size: 16px; } .legacy table { font-size: 14px; } }
@media (prefers-reduced-motion: reduce) { .pcard, .gcard { transition: none; } }

/* ===== /zh/ /en/ today's lucky colour block (old card maker, injection verbatim) in v8 receipt style ===== */
#daily { width: 91.1%; max-width: 1540px; margin: 8px auto 0; padding: 26px 0 10px; border-top: 1px solid var(--line);
  background: none; color: #f3ecde; font-family: inherit; display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 0 4vw; align-items: start; }
#daily[hidden] { display: none; }
#daily .daily-title { font-size: 28px; letter-spacing: 2px; grid-column: 1; margin: 6px 0 8px; }
#daily > .foot, #daily > p.foot { grid-column: 1; font-size: 15px; color: var(--muted); margin: 10px 0 0; }
#daily .cm { grid-column: 2; grid-row: 1 / span 3; margin: 0; max-width: none; border-radius: 4px; background: #f3ecde; color: #18150f;
  border: 0; padding: 22px 24px 20px; font-family: inherit; box-shadow: 0 20px 60px #0008; position: relative; }
#daily .cm:before, #daily .cm:after { content: ""; position: absolute; left: 0; right: 0; height: 8px;
  background: radial-gradient(circle at 6px -2px, transparent 6px, #f3ecde 6.5px) 0 0 / 12px 8px repeat-x; }
#daily .cm:before { top: -7px; transform: rotate(180deg); }
#daily .cm:after { bottom: -7px; }
#daily .cm-eyebrow { font-size: 14px; letter-spacing: .14em; text-transform: uppercase; color: #6d665a; }
#daily .cm h1, #daily .cm h2#cm-h, #daily .cm #cm-h { font: 600 30px/1.2 inherit; font-family: inherit; color: #18150f; margin: 4px 0 14px; letter-spacing: 1px; }
#daily .cm-day { background: transparent; border: 0; border-top: 1px dashed #b8ae9c; border-radius: 0; padding: 12px 4px 6px; }
#daily .cm-dl, #daily .cm-sub, #daily .cm-time, #daily .cm-bd, #daily .cm-err, #daily .cm-ns { font-size: 14px; color: #5b554b; }
#daily .cm-cn { font-size: 18px; color: #18150f; }
#daily .cm-big { width: 44px; height: 44px; box-shadow: inset 0 0 0 1px #0002; }
#daily .cm-form input, #daily .cm-form select, #daily select { background: #fbf7ee; border: 1px solid #b8ae9c; border-radius: 6px; color: #18150f; font-size: 16px; min-height: 44px; }
#daily .button, #daily button.button { border-radius: 40px; background: #18150f; color: #f3ecde; border: 1px solid #18150f; min-height: 44px; font-weight: 600; font-family: inherit; }
#daily .button:hover { background: #000; color: var(--lime); }
#daily .button.secondary { background: transparent; color: #18150f; border-color: #8a8070; }
#daily .cm-pairlink, #daily .cm-pairlink a { font-size: 15px; color: #18150f; }
#daily .cm-pairlink a { text-decoration: underline; text-decoration-color: #8a8070; text-underline-offset: 3px; }
#daily .cm-result { color: #18150f; }
#daily .cm-result * { font-family: inherit; }
#daily .cm-result small, #daily .cm-result [class*="sub"], #daily .cm-result [class*="note"] { font-size: max(14px, 1em); }
#daily dialog, body > dialog:not(#dialog) { background: #f3ecde; color: #18150f; border: 0; border-radius: 4px; max-width: min(640px, 92vw); font-family: inherit; }
@media (max-width: 760px) {
  #daily { display: block; width: calc(100% - 32px); padding-top: 18px; }
  #daily .daily-title { font-size: 20px; margin-bottom: 12px; }
  #daily .cm { padding: 18px 14px 16px; }
  #daily .cm h1, #daily .cm h2#cm-h, #daily .cm #cm-h { font-size: 22px; }
  #daily .cm-dl, #daily .cm-sub, #daily .cm-time, #daily .cm-bd, #daily .cm-err, #daily .cm-ns, #daily .cm-eyebrow { font-size: 12px; }
  #daily .cm-cn { font-size: 15px; }
}
/* kept old pages: keep component layout but v8 type and colours */
.legacy-scope, .legacy-scope * { font-family: inherit !important; }
.legacy-scope { color: #e6dfd0; }
.legacy-scope > div { max-width: 980px; }
.legacy-scope .prose, .legacy-scope main { background: none !important; }
.legacy-scope figcaption, .legacy-scope td, .legacy-scope th, .legacy-scope small, .legacy-scope caption, .legacy-scope .micro, .legacy-scope label { font-size: max(14px, 0.85em) !important; }
@media (max-width: 760px) { .legacy-scope figcaption, .legacy-scope td, .legacy-scope th, .legacy-scope small, .legacy-scope caption, .legacy-scope .micro, .legacy-scope label { font-size: max(12px, 0.85em) !important; } }
.legacy-scope { background: none !important; }
.legacy-scope .app { background: none; min-height: 0; }
.legacy-scope .app:before, .legacy-scope .app:after, #daily .app:before { display: none !important; }
.legacy-scope .pi-q { color: #18150f; }
.legacy-scope .pi-q { background: #f3ecde !important; border-radius: 4px !important; }
.legacy-scope .prose p, .legacy-scope .prose li, .legacy-scope > .prose p { color: #d9d2c3 !important; font-size: 17px; line-height: 1.7; }
.legacy-scope .prose h2 { font-size: clamp(22px, 2.6vw, 30px); line-height: 1.3; }
.legacy-scope .prose .breadcrumb, .legacy-scope .prose .breadcrumb a { font-size: 14px; color: var(--muted) !important; }
@media (max-width: 760px) { .legacy-scope .prose p, .legacy-scope .prose li { font-size: 16px; } }
.legacy-scope .pi-q input, .legacy-scope .pi-q select { background: #fbf7ee !important; color: #18150f !important; border: 1px solid #b8ae9c !important; }
:root { --lf: 14px; }
@media (max-width: 760px) { :root { --lf: 12px; } }
.legacy-scope svg text { font-size: max(11px, 1em); }
.legacy-scope svg { max-width: 100%; height: auto; }
.legacy-scope [style*="font-size:9px"], .legacy-scope [style*="font-size:10px"], .legacy-scope [style*="font-size:11px"], .legacy-scope [style*="font-size:12px"], .legacy-scope [style*="font-size:13px"] { font-size: var(--lf, 14px) !important; }
.legacy-scope [style*="font-size: 9px"], .legacy-scope [style*="font-size: 10px"], .legacy-scope [style*="font-size: 11px"], .legacy-scope [style*="font-size: 12px"], .legacy-scope [style*="font-size: 13px"] { font-size: var(--lf, 14px) !important; }

/* ===== v8-fix1: birthday CTA + tables that stay on-screen on a phone ===== */
.legacy .p1-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin: 8px 0 20px;
  max-width: 46em;
}
.legacy .seo-experience-note { font-size: 14px; color: var(--muted); line-height: 1.45; }
.legacy-scope .search-table {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 760px) {
  .legacy .p1-cta { flex-direction: column; align-items: stretch; gap: 8px; }
  .legacy .p1-cta .seo-experience-button { width: 100%; }
  .legacy-scope .search-table { margin-left: 0; margin-right: 0; }
  /* 2-column "三种说法 / Three meanings" table: stack as cards, no clipped column */
  .legacy-scope .search-table-stack table {
    min-width: 0 !important;
    width: 100%;
    display: table;
    margin: 8px 0 16px;
  }
  .legacy-scope .search-table-stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }
  .legacy-scope .search-table-stack tbody { display: block; }
  .legacy-scope .search-table-stack tr {
    display: block;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 14px;
    margin: 0 0 12px;
    background: #0b0b0a;
  }
  .legacy-scope .search-table-stack th,
  .legacy-scope .search-table-stack td {
    display: block;
    border: 0;
    padding: 2px 0;
  }
  .legacy-scope .search-table-stack td:first-child {
    font-weight: 600;
    color: var(--paper) !important;
    margin-bottom: 4px;
  }
  .legacy-scope .search-table-stack td:last-child { color: #d9d2c3 !important; }
  /* wider tables (zodiac palette, etc.): scroll inside the wrapper, not the page */
  .legacy-scope .search-table:not(.search-table-stack) table {
    display: table;
  }
}
/* Mid widths just above the 760px compact header: English nav + Gift used to spill 56px past the viewport. */
@media (max-width: 899px) and (min-width: 761px) {
  .mast { gap: 12px; min-width: 0; }
  .logo { font-size: 40px; letter-spacing: -2px; }
  .mast nav { gap: 12px; padding-left: 14px; min-width: 0; }
  .mast nav a { font-size: 16px; letter-spacing: 0.5px; }
  .mast-tools { gap: 8px; flex-shrink: 0; }
  .mast .pill { font-size: 16px; padding: 8px 14px; }
}

/* ===== v8-fix1b: English "12 Winter Keep" must stay in the left column ===== */
.intro .month,
.intro .notes,
.intro .days { min-width: 0; }
html[lang="en"] .month-title {
  white-space: normal;
  display: block;
  max-width: 100%;
  overflow-wrap: break-word;
}
html[lang="en"] .month-title i {
  display: inline-block;
  vertical-align: baseline;
  margin-right: 0.08em;
}
@media (max-width: 1050px) and (min-width: 761px) {
  html[lang="en"] .month-title { font-size: clamp(28px, 4vw, 42px); line-height: 1.05; }
  html[lang="en"] .month-title i { font-size: clamp(58px, 8.4vw, 90px); letter-spacing: -4px; }
}


/* ===== v8-batch2: single-product hero, sign index, home season links ===== */
.product-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 28px; align-items: start; margin: 0 0 32px; }
.product-hero img { width: 100%; height: auto; border-radius: 8px; background: #111; }
.product-page .datatable { max-width: 36em; }
.product-page .buy { min-height: 44px; display: inline-flex; align-items: center; }
.sign-hub { margin: 28px 0 10px; }
.sign-index { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 18px; padding-left: 1.2em; margin: 0 0 24px; }
.sign-index a { text-decoration: underline; text-underline-offset: 3px; }
.season-links { margin: 8px 0 22px; padding: 12px 0 4px; border-top: 1px solid var(--line); }
.season-links p { display: flex; flex-wrap: wrap; gap: 10px 14px; margin: 0; }
.season-links a { font-size: 15px; color: #e6dfd0; text-decoration: underline; text-decoration-color: #57534e; text-underline-offset: 3px; min-height: 44px; display: inline-flex; align-items: center; }
@media (max-width: 760px) {
  .product-hero { grid-template-columns: 1fr; }
}


/* ===== v8-batch2fix: contrast, daily card, spacing, nails paper cards ===== */

/* Buy buttons: dark ink on paper, same as new pages. Win over .legacy a color. */
.legacy a.pill.ivory:not(.button),
.legacy-scope a.pill.ivory:not(.button),
.sitepage a.pill.ivory,
a.pill.ivory.buy,
.legacy-scope .pill.ivory {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}
.legacy a.pill.ivory:not(.button):hover,
.legacy-scope a.pill.ivory:not(.button):hover,
.sitepage a.pill.ivory:hover,
a.pill.ivory.buy:hover {
  background: var(--lime);
  color: #000;
  border-color: var(--lime);
}

/* Price stays on one line at 375 (Lidong and other product cards) */
.pcard .buy, a.pill.ivory.buy {
  white-space: nowrap;
}
@media (max-width: 430px) {
  .pcard .buy {
    font-size: 13px;
    padding: 8px 10px;
    width: 100%;
    box-sizing: border-box;
    justify-content: center;
  }
}

/* Bazi “免费查看完整排盘” and similar .btn links on restored pages */
.legacy a.btn:not(.pill):not(.button),
.legacy-scope a.btn:not(.pill):not(.button),
.legacy-scope .growth-links a.btn:not(.pill):not(.button) {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--ink);
}
.legacy a.btn:not(.pill):not(.button):hover,
.legacy-scope a.btn:not(.pill):not(.button):hover {
  background: var(--lime);
  color: #000;
  border-color: var(--lime);
}
.legacy a.btn.outline:not(.pill):not(.button),
.legacy-scope a.btn.outline:not(.pill):not(.button) {
  background: transparent;
  color: var(--paper);
  border: 1px solid var(--paper);
}

/* Nails “Start with this decision” paper cards + tables: ink on beige */
.legacy-scope .core-quick,
.legacy-scope .core-bridge,
.legacy .core-quick,
.legacy .core-bridge {
  background: #f2ede7;
  color: #18150f;
}
.legacy-scope .core-quick h1,
.legacy-scope .core-quick h2,
.legacy-scope .core-quick h3,
.legacy-scope .core-quick p,
.legacy-scope .core-quick li,
.legacy-scope .core-quick th,
.legacy-scope .core-quick td,
.legacy-scope .core-quick caption,
.legacy-scope .core-bridge h2,
.legacy-scope .core-bridge p,
.legacy-scope .core-bridge th,
.legacy-scope .core-bridge td,
.legacy-scope .core-bridge caption,
.legacy .core-quick :where(h1,h2,h3,p,li,th,td,caption),
.legacy .core-bridge :where(h1,h2,h3,p,li,th,td,caption) {
  color: #18150f;
}
.legacy-scope .core-quick a:not(.pill):not(.button),
.legacy-scope .core-bridge a:not(.pill):not(.button),
.legacy .core-quick a:not(.pill):not(.button),
.legacy .core-bridge a:not(.pill):not(.button) {
  color: #18150f;
  text-decoration-color: #6d665a;
}
.legacy-scope .core-table-wrap th,
.legacy-scope .core-table-wrap td,
.legacy-scope .core-table-wrap caption {
  color: #18150f;
}
.legacy-scope .core-table-wrap th {
  background: #e9e0d8;
  color: #18150f;
}

/* Date-night finger labels: SVG text was ink-dark, now sits on the dark page. Paper plate behind the chart. */
.legacy-scope #focused-guide-layout figure svg,
.legacy-scope figure svg[aria-label] {
  background: #f2ede7;
  border-radius: 8px;
}

/* Living-room theme buttons (“Wood” etc.) */
.legacy-scope [data-scene-palette],
.legacy-scope .search-demo button {
  background: #1a1916;
  color: #f3ecde;
  border: 1px solid #57534e;
}
.legacy-scope [data-scene-palette][aria-pressed="true"],
.legacy-scope .search-demo [aria-pressed="true"] {
  background: #f3ecde;
  color: #18150f;
  border-color: #f3ecde;
}

/* Subheadings and the paragraph that follows: NYE, tea, desk, other guides */
article.guide h2 {
  margin: 32px 0 16px;
}
article.guide h2 + p,
article.guide h2 + .lede {
  margin-top: 0;
  margin-bottom: 14px;
}

/* Daily result + pair-link: solid paper, ink text. Names sit on the panel, not on the swatch. */
#daily .cm-result {
  background: #fbf7ee;
  color: #18150f;
  border: 1px solid #cfc6b6;
  border-radius: 12px;
  padding: 12px;
}
#daily .cm-rt,
#daily .cm-dm,
#daily .cm-note,
#daily .cm-nm,
#daily .cm-nm b,
#daily .cm-nm small,
#daily .cm-pub,
#daily .cm-optional,
#daily .cm-optional a,
#daily .cm-status {
  color: #18150f;
}
#daily .cm-pairlink,
#daily .cm-pairlink a,
#daily .cm-pairlink span {
  color: #18150f;
}
#daily .cm-copy,
#daily .cm-pairbtn,
#daily .button.secondary {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--ink);
}
#daily .cm-copy:hover,
#daily .cm-pairbtn:hover,
#daily .button.secondary:hover {
  background: var(--lime);
  color: #000;
  border-color: var(--lime);
}
/* Primary share button stays ink on paper-inverse (already passes) */
#daily .cm-share.button,
#daily .button.cm-share {
  background: #18150f;
  color: #f3ecde;
  border-color: #18150f;
}

/* zh 375: color name must not overlap the swatch */
@media (max-width: 430px) {
  #daily .cm-days { grid-template-columns: 1fr; }
  #daily .cm-day {
    grid-template-columns: 44px minmax(0, 1fr);
    column-gap: 12px;
    align-items: start;
  }
  #daily .cm-big { grid-column: 1; width: 40px; height: 40px; }
  #daily .cm-cn, #daily .cm-sub { grid-column: 2; min-width: 0; }
  #daily .cm-cn {
    overflow-wrap: anywhere;
    word-break: break-word;
    font-size: 16px;
  }
}

/* 1440: season links align with the daily / header content column */
.apppage .season-links {
  width: 91.1%;
  max-width: 1540px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  padding-left: 0;
  padding-right: 0;
}
@media (max-width: 760px) {
  .apppage .season-links { width: calc(100% - 32px); }
}

/* JA in the language switch: same hit area as 中 / EN */
.lang a[lang="ja"] { min-width: 44px; }


/* ===== v8-batch2fix-2: leftover contrast + 320 overflow ===== */
@media (max-width: 360px) {
  .pgrid { grid-template-columns: 1fr; }
}
@media (max-width: 430px) {
  .mast { height: auto; min-height: 56px; flex-wrap: wrap; row-gap: 8px; }
  .mast-tools { gap: 6px; flex-shrink: 1; min-width: 0; flex-wrap: wrap; justify-content: flex-end; }
  .lang a, .lang a[lang="ja"] { min-width: 36px; padding: 6px 8px; font-size: 13px; }
  .mast-tools .pill, .mast .pill.send, .mast .pill { padding: 8px 10px; font-size: 14px; }
  header { overflow-x: clip; }
}

/* Primary .btn — dark ink on paper, including <button class="btn"> */
.legacy a.btn:not(.outline),
.legacy-scope a.btn:not(.outline),
.legacy button.btn:not(.outline),
.legacy-scope button.btn:not(.outline),
.legacy-scope .zodiac-form button.btn,
.legacy-scope .growth-links a.btn:not(.outline) {
  background: var(--paper) !important;
  color: var(--ink) !important;
  border: 1px solid var(--ink) !important;
}
.legacy a.btn.outline,
.legacy-scope a.btn.outline,
.legacy button.btn.outline,
.legacy-scope button.btn.outline {
  background: transparent !important;
  color: var(--paper) !important;
  border: 1px solid var(--paper) !important;
}
/* 2027 zodiac outline chips that sit on paper already */
.legacy-scope .es-zodiac button.btn.outline,
.legacy-scope .es-swatches button {
  background: var(--paper) !important;
  color: var(--ink) !important;
  border: 1px solid var(--ink) !important;
}
.es-swatches small,
.legacy-scope .es-swatches small,
.es-swatches button small {
  color: #4a453c !important;
}

/* Living-room / element chips: paper text on dark, ink on paper when pressed */
.legacy-scope [data-scene-palette],
.legacy-scope .search-demo button:not(.btn) {
  background: #1a1916 !important;
  color: #f3ecde !important;
  border: 1px solid #57534e !important;
}
.legacy-scope [data-scene-palette][aria-pressed="true"],
.legacy-scope .search-demo button:not(.btn)[aria-pressed="true"] {
  background: #f3ecde !important;
  color: #18150f !important;
  border-color: #f3ecde !important;
}

/* Pair tool tabbar */
.legacy-scope .tabbar button {
  color: #f3ecde !important;
  background: transparent !important;
}
.legacy-scope .tabbar button[aria-current="true"],
.legacy-scope .tabbar button[aria-pressed="true"],
.legacy-scope .tabbar button.active,
.legacy-scope .tabbar button.on,
.legacy-scope .tabbar .active button {
  color: #18150f !important;
  background: #f3ecde !important;
}

/* Do not recolor CTA buttons that already have a solid dark blue fill */
.legacy-scope a.cta,
.legacy a.cta,
.legacy-scope .core-quick a.cta,
.legacy-scope .core-bridge a.cta {
  color: #f3ecde !important;
  background: #315777 !important;
}

/* Finger charts + figcaptions: ink on a paper plate (overrides both light and dark fills) */
.legacy-scope figure svg,
.legacy-scope #focused-guide-layout figure svg,
.legacy-scope figure svg[aria-label] {
  background: #f2ede7;
  border-radius: 8px;
}
.legacy-scope figure svg text,
.legacy-scope figure svg tspan,
.legacy-scope #focused-guide-layout figure svg text,
.legacy-scope #focused-guide-layout figure svg tspan {
  fill: #18150f !important;
  stroke: none !important;
}
.legacy-scope figcaption {
  color: #18150f !important;
  background: #f2ede7;
  padding: 4px 8px;
  display: inline-block;
}

/* Pale-yellow specimen pages: light body text was sitting on a light panel */
.legacy-scope .yellow-specimen,
.legacy-scope .yellow-specimen p {
  color: #18150f !important;
}

/* Outfit-direction captions under diagrams */
.legacy-scope figure + p,
.legacy-scope figcaption + p {
  color: #e6dfd0;
}

/* Soft pink bullets on beige cards */
.legacy-scope .core-quick li::marker,
.legacy-scope .core-bridge li::marker {
  color: #5b3a3a;
}


/* ===== v8-batch2fix-3: figcaption links, inline nail chips, leftover SVG ===== */
.legacy-scope figcaption,
.legacy-scope figcaption a,
.legacy-scope figure figcaption a,
.legacy-scope figure a {
  color: #18150f !important;
}
.legacy-scope figcaption,
.legacy-scope figcaption a {
  background: #f2ede7;
}
.legacy-scope figure svg text,
.legacy-scope figure svg tspan,
.legacy-scope figure text,
.legacy-scope figure tspan {
  fill: #18150f !important;
  color: #18150f !important;
}
.legacy-scope .search-demo svg:not(.icon) text,
.legacy-scope .search-demo svg:not(.icon) tspan {
  fill: #f3ecde !important;
}
.legacy-scope figure div[style*="#D9B9B8"],
.legacy-scope figure div[style*="#d9b9b8"],
.legacy-scope figure div[style*="#EAE0D2"],
.legacy-scope figure div[style*="#eae0d2"] {
  color: #5b3a3a !important;
}
.legacy-scope code,
.legacy-scope .core-quick code,
.legacy-scope .core-bridge code {
  color: #18150f !important;
  background: #f3ecde !important;
  padding: 0 4px;
  border-radius: 3px;
}
.legacy-scope .core-visuals p,
.legacy-scope .core-case p,
.legacy-scope .core-case-grid p {
  color: #18150f !important;
  background: #f2ede7;
  padding: 6px 8px;
}
.lang span[aria-hidden] {
  color: #cfc6b6;
}


/* ===== v8-batch2fix-4 ===== */
.legacy-scope .core-visuals a,
.legacy-scope .core-visuals p a,
.legacy-scope #visual-nail-directions a {
  color: #18150f !important;
}
.legacy-scope .search-palette svg text,
.legacy-scope .search-palette svg tspan,
.legacy-scope [class*="search-palette"] svg text,
.legacy-scope [class*="search-palette"] svg tspan {
  fill: #f3ecde !important;
}
.legacy-scope .yellow-specimen,
.legacy-scope .yellow-specimen p {
  color: #18150f !important;
}
.legacy-scope #nails-with-black-dress p[style*="font-size:13px"] {
  color: #18150f !important;
}
.legacy-scope figure div[style*="background"] {
  color: #3f2a32 !important;
}
