/* True Song weights. Brush lettering belongs only to the fixed introduction brand. */
:root {
  --book-font: "Yinian Reading", "Noto Serif CJK SC", "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --title-font: "Yinian Heading", "Yinian Reading", "Noto Serif CJK SC", "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --studio-display: "Ma Shan Zheng", "STKaiti", "KaiTi", serif;
  --type-body: max(16px, calc(17px * var(--user-font-scale, 1)));
  --type-control: max(16px, calc(16px * var(--user-font-scale, 1)));
  --type-note: max(14px, calc(14px * var(--user-font-scale, 1)));
  --type-card: calc(20px * var(--user-font-scale, 1));
  --type-page: calc(26px * var(--user-font-scale, 1));
  --type-heading: calc(32px * var(--user-font-scale, 1));
  --type-question: calc(22px * var(--user-font-scale, 1));
  --type-name: calc(24px * var(--user-font-scale, 1));
  --reading-width: 680px;
  --page-gutter: 24px;
}
:root, html.theme-yaji, body, html.theme-yaji body, html.theme-yaji body.yj-tab-qigua {
  --body: var(--book-font) !important; --seri: var(--book-font) !important;
  --song: var(--book-font) !important; --hand: var(--book-font) !important;
  --brush: var(--book-font) !important; --xing: var(--book-font) !important;
  --kai: var(--book-font) !important; --roman: var(--book-font) !important;
  --pond-font: var(--book-font) !important; --font-body: var(--book-font) !important;
  --font-brush: var(--book-font) !important; --font-display: var(--book-font) !important;
  --ref-body: var(--type-body) !important; --ref-note: var(--type-note) !important;
  --ref-title: var(--type-heading) !important;
}
html { font-synthesis: none; }
html body, html.theme-yaji body {
  font-family: var(--book-font); font-size: var(--type-body); font-weight: 400;
  line-height: 1.9; letter-spacing: 0;
}
html body :is(button, input, textarea, select) { font-family: inherit; font-weight: 400; font-size: var(--type-control); }
html.theme-yaji :is(.v7-wordmark--kai, .zw-hero-zh, .xt-hero-zh, .history-title,
  .info-title, .v7-header-title, .xt-article-title, .xt-video-hero-title,
  .zw-modal-title, .zw-overlay-title, .mp-title, .yn-auth-title, .privacy-modal-title) {
  font-family: var(--title-font); font-size: var(--type-page); font-weight: 300;
  line-height: 1.5; letter-spacing: .02em; text-shadow: none;
}
html.theme-yaji .v7-wordmark--kai { font-size: var(--type-name); }
html.theme-yaji .v7-welcome-title { font: 300 var(--type-heading)/1.4 var(--title-font); font-family: var(--title-font) !important; letter-spacing: .02em; }
html.theme-yaji :is(.xt-card-title, .xt-lecture-title, .xt-article-h2, .xt-article-h3,
  .xt-video-section-title, .zw-settings-title) {
  font: 400 var(--type-card)/1.6 var(--book-font); letter-spacing: 0;
}
html.theme-yaji :is(.v7-msg-bubble, .xt-article-content, .xt-article-p, .xt-article-quote,
  .xt-body-p, .xt-body-quote, .xt-video-desc-p, .mp-item, .mp-portrait-text,
  .privacy-modal-content, .privacy-modal-content p, .privacy-modal-content li) {
  font: 400 var(--type-body)/1.9 var(--book-font); letter-spacing: 0;
  text-indent: 0; font-style: normal; overflow-wrap: anywhere;
}
html.theme-yaji :is(.xt-article-content, .v7-msg-bubble) :is(strong, b, em) {
  font-weight: 400; font-style: normal;
}
html.theme-yaji :is(.nav-label, .v7-header-subtitle, .yj-rank-caption, .zw-setting-hint,
  .xt-lecture-meta, .v7-persona-badge, .v7-msg-disclaimer, .zw-menu-right-text) {
  font: 400 var(--type-note)/1.6 var(--book-font); letter-spacing: 0;
}
html.theme-yaji :is(.zw-menu-label, .zw-modal-subtitle, .zw-field-label, .zw-btn) { letter-spacing: 0; }
html.theme-yaji :is(.yj-wordmark, .yj-wordmark-char) { font-family: var(--title-font); font-weight: 300; text-shadow: none; }
html.theme-yaji .yj-wordmark-char { font-size: clamp(48px, 10vw, 64px); line-height: 1.2; }
html body :is(code, pre, kbd, samp), html body :is(code, pre, kbd, samp) * {
  font-family: ui-monospace, SFMono-Regular, Consolas, "PingFang SC", "Microsoft YaHei", monospace;
}
/* Existing ritual typography stays with its scene owner until integration. */
html.theme-yaji :is(.question-title, #inkPondTitle) {
  font-size: var(--type-heading) !important; font-weight: 400 !important; line-height: 1.4 !important;
}
html.theme-yaji #questionOverlay .ink-pond-form :is(.question-title, .question-btn) { letter-spacing: normal !important; }
html.theme-yaji #questionOverlay .ink-pond-form .question-title { font-weight: 400 !important; }
/* Secondary pages consume the same roles without requiring the APP theme. */
html body.yn-legal h1 { font: 300 var(--type-page)/1.5 var(--title-font); }
html body.yn-legal :is(h2, h3), html body.yn-download :is(h2, h3) { font: 400 var(--type-card)/1.6 var(--book-font); }
html body.yn-legal :is(p, li), html body.yn-download :is(.faq p, .steps li) { font: 400 var(--type-body)/1.9 var(--book-font); }
html body.yn-download :is(.tagline, .dl-meta, .steps small, footer) { font: 400 var(--type-note)/1.6 var(--book-font); }
html body.yn-download .wordmark { font: 300 48px/1.2 var(--title-font); letter-spacing: .02em; }
html body.yn-download #platformHint { font-size: var(--type-note) !important; line-height: 1.8; }
#gate .g-plaque .mark, #reveal h1, #reveal h1 > span { font-family: var(--studio-display); font-weight: 400; line-height: 1.2; }
#gate .g-plaque :is(.sub, .tag), #reveal .tagline { font: 400 var(--type-body)/1.8 var(--book-font); }
/* Explicit metadata roles keep old small labels legible under M/L/XL. */
html.theme-yaji :is(.watermark, .zw-profile-sub, .zw-llm-hint, .zw-llm-card-sub,
  .zw-llm-think-hint, .zw-menu-badge, .zw-menu-coming, .zw-version, .zw-name-hint,
  .zw-card-duration, .zw-card-subtitle, .zw-card-time, .zw-card-footer, .zw-chats-empty-sub,
  .v7-history-row-date, .v7-service-banner, .v7-persona-sheet-section-label,
  .v7-persona-portrait-meta, .v7-persona-thread-meta, .v7-persona-thread-archive-summary,
  .v7-recall-card-label, .v7-recall-card-meta, .v7-memory-flash, .v7-recall-verified,
  .v7-td-note, .v7-dr-label, .v7-demo-cta-note, .v7-demo-cast-note,
  .v7-dc-arrow, .v7-dc-prompt, .v7-demo-prog, .v7-voice-bubble-hint),
html.theme-yaji .v7-time-divider > span,
html.theme-yaji .v7-demo-panel :is(.mp-section, .mp-thread, .mp-foot) {
  font: 400 var(--type-note)/1.6 var(--book-font); letter-spacing: 0;
}
html.theme-yaji :is(.zw-llm-think-label, .zw-perm-btn, .zw-clear-btn, .zw-card-preview,
  .v7-continue-card-btn, .v7-ritual-btn, .v7-dc-skip) { font-size: var(--type-control); line-height: 1.6; }
html.theme-yaji :is(.v7-msg-disclaimer, .xt-article-quote) { font-style: normal; }
html.theme-yaji :is(.question-title, .xt-article-title, .xt-video-hero-title, .zw-modal-title, .zw-overlay-title) { text-wrap: balance; }
html.theme-yaji :is(.v7-msg-bubble, .xt-article-p, .xt-article-quote) { text-wrap: pretty; }
@media (max-width: 360px) { :root { --page-gutter: 18px; } }
