/* Suite-wide refinement, retaining the owner's original functional colours.
   These rules also reach canvas exports and native print; calculation and
   membership visibility remain owned by the existing engine. */
body.tool-editorial {
  --editorial-serif: "MMT Editorial Serif", "Noto Serif TC", "Songti TC", "PMingLiU", serif;
}
.tool-editorial :is(.rshell, .mmt-card, .ovcard, .pcard, .save-summary-card) {
  border-radius: 4px !important; box-shadow: none !important;
}
.tool-editorial :is(.rtitle, .mmt-hook-title) {
  font-family: var(--editorial-serif) !important; font-weight: 600;
}
.tool-editorial :is(.mmt-card-body, .mmt-para, .mmt-num-text, .mmt-hook-body) { line-height: 1.85; }
.tool-editorial :is(.mmt-hook, .mmt-premium) { border-radius: 4px !important; box-shadow: none !important; }
.tool-editorial .mmt-hook::before, .tool-editorial .rhdr::after { content: none !important; }
.tool-editorial .mmt-premium { border-style: solid; border-width: 1px; }
.tool-editorial .mmt-premium-ribbon {
  position: static; display: inline-block; margin: 12px 16px 0;
  border: 0; border-radius: 3px; box-shadow: none; letter-spacing: .08em;
}
.tool-editorial .mmt-hook-label { letter-spacing: .08em; }
.tool-editorial .mmt-num-item { border-radius: 3px; }
.tool-editorial .rchip { border-radius: 3px; }
.tool-editorial .rsechdr { border-bottom-width: 1px; }
.tool-editorial .rblk { background: transparent; padding: 0; border: 0; }
.tool-editorial .mmt-output h2 { font-family: var(--editorial-serif); }
.tool-editorial #duo-astro > div { border-radius: 4px !important; box-shadow: none !important; }
.tool-editorial :is(.save-summary-header, .save-summary-quote, .save-summary-footer) { box-shadow: none; }

/* Matrix colours / member colours / legend stay as originally designed. */
.tool-editorial .biz-cell { border-radius: 4px; box-shadow: none !important; transform: none !important; }
.tool-editorial :is(.biz-col-hdr, .biz-row-hdr) { border-radius: 4px; box-shadow: none !important; }
.tool-editorial :is(.biz-col-hdr, .biz-row-hdr).t-active { filter: none; }
.tool-editorial :is(.biz-scale-advisor, .biz-scale-card, .biz-scale-score-item) { border-radius: 4px; box-shadow: none; }

/* Human Design keeps its navy header, red/black chart and status colours. */
.tool-editorial .hd-hero { background: var(--navy); border-radius: 4px; }
.tool-editorial :is(.hd-title, .hd-panel-title, .hd-analysis-head h3) { font-family: var(--editorial-serif); font-weight: 600; }
.tool-editorial :is(.hd-boundary, .hd-panel, .hd-analysis-card, .hd-source-step, .hd-recognition-progress, .hd-stat, .hd-source-facts, .hd-analysis-summary) { border-radius: 4px; box-shadow: none; }
.tool-editorial .hd-btn { border-radius: 4px; min-height: 40px; box-shadow: none; }
/* The existing member theme uses a dark accent. Pair it with white for contrast. */
.tool-editorial .hd-btn.gold { color: #fff; }

@media screen {
  .tool-editorial .wrap { scroll-margin-top: 140px; }
  .tool-editorial .mmt-dashboard { font-size: clamp(17px, 1.25vw, 20px); }
  .tool-editorial .mmt-card-body { font-size: inherit; }
  .tool-editorial :is(.editbtn, .save-summary-close) { border-radius: 4px; }
  .tool-editorial .wrap .stitle { font-family: var(--editorial-serif); font-weight: 600 !important; letter-spacing: .02em !important; }
  .tool-editorial .wrap:not(#pane-calc) .stitle { font-size: clamp(24px, 2.1vw, 32px) !important; line-height: 1.5; }
  .tool-editorial :is(.gb, .fbar, .rank-setting, .yijing-embed-actions, .yijing-benefit, .yijing-embed-shell) { box-shadow: none; border-radius: 4px; }
  .tool-editorial .wrap:not(#pane-calc) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), select, textarea) {
    border-radius: 4px !important; min-height: 42px; font: inherit;
  }
  .tool-editorial :is(button, a, input, select, textarea, summary):focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; }
  .tool-editorial :is(.modal, .modal-box, .modal-content, .save-summary-card, .gate-panel) { border-radius: 4px !important; }
  /* Readable text on the original dark section headers. */
  .tool-editorial [style*="background:var(--navy)"] > [style*="color:var(--gold)"],
  .tool-editorial [style*="background:var(--navy);"][style*="color:var(--gold)"],
  .tool-editorial [style*="background:var(--navy2)"][style*="color:var(--gold)"],
  .tool-editorial th[style*="var(--navy)"] { color: #fff !important; }
  .tool-editorial #rpt-progress-bar { background: #e3ab3e !important; }
  .tool-editorial .wrap :is(.chip, .rchip) { border-radius: 3px !important; }
  @media (max-width: 768px) {
    body.tool-editorial #biz-snapshot-area > div[title*="左右滑動"] { overflow-x: auto !important; }
    body.tool-editorial #biz-grid-wrap { min-width: 720px !important; }
    body.tool-editorial #biz-grid-wrap > div:first-child,
    body.tool-editorial #biz-grid-wrap .biz-row { grid-template-columns: 80px repeat(5, minmax(0, 1fr)) !important; gap: 5px !important; }
    body.tool-editorial #biz-grid-wrap .biz-cell { padding: 12px 6px !important; min-height: 92px !important; }
    body.tool-editorial #biz-grid-wrap :is(.biz-num, .biz-action) { font-size: 16px !important; line-height: 1.5 !important; }
    body.tool-editorial #biz-snapshot-area .mobile-scroll-hint { display: block !important; font-size: 14px !important; }
  }
  @media (max-width: 640px) {
    .tool-editorial .duo-people-grid { grid-template-columns: 1fr !important; }
    .tool-editorial .wrap:not(#pane-calc) { padding-inline: 16px; }
    .tool-editorial .wrap:not(#pane-calc) .shdr { align-items: flex-start; gap: 12px; flex-wrap: wrap; }
    .tool-editorial #pane-synastry [style*="grid-template-columns:repeat(4,1fr)"] { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
  }
}
@media print {
  .tool-editorial :is(.rtitle, .rsectitle, .mmt-hook-title) { font-family: var(--editorial-serif) !important; }
  .tool-editorial :is(.mmt-card, .mmt-hook, .mmt-premium, .ovcard) { break-inside: avoid; }
  .tool-editorial :is(.mmt-card, .mmt-hook, .mmt-premium, .rchip) { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
