/* Auxiliary pages share the existing DESIGN.md palette and 470px frame. */
html:has(> body.ysd-aux) { background: #e9e3d9; }
body.ysd-aux {
  --paper: #f7f1e7; --light: #fffdf8; --card: #fffdf8; --ink: #302a27;
  --muted: #75695f; --red: #9d3c34; --blue: #283852; --navy: #283852;
  --gold: #ba945b; --line: #ddd1c1; --tint: #f4e5df;
  --serif: 'Gowun Batang', 'Batang', serif; --sans: 'Noto Sans KR', sans-serif;
  width: min(100%, 470px); min-height: 100dvh; margin: 0 auto; padding: 0;
  background: var(--paper); color: var(--ink); box-shadow: none;
  font-family: var(--sans); word-break: keep-all; overflow-wrap: anywhere;
}
.ysd-aux::before { background: none; }
body.ysd-aux.ysd-community { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.ysd-aux.ysd-community > main { padding: 0; background: var(--paper); }
.ysd-aux [hidden] { display: none !important; }
.ysd-aux :is(h1, h2, h3) { font-family: var(--serif); font-weight: 700; }
.ysd-aux :is(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--red); outline-offset: 3px;
}
.ysd-aux :is(button, input, select, textarea) { font-family: var(--sans); }
.ysd-aux :is(button, .legal-nav a, .reading-toc a, .banner-actions a, .back-reading) { min-height: 44px; }
.ysd-aux :is(button, input, select, textarea):disabled { cursor: not-allowed; }
.ysd-aux :is(.legal-header, .catalog-topbar, .magazine-topbar, .match-topbar) {
  min-height: 72px; height: auto; padding: 12px 16px; gap: 8px;
  background: var(--light); border-bottom: 1px solid var(--line);
  box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
}
.ysd-aux :is(.catalog-topbar, .magazine-topbar, .match-topbar) { grid-template-columns: 44px minmax(0, 1fr) 44px; }
.ysd-aux :is(.catalog-topbar, .magazine-topbar, .match-topbar) > :is(a, span) {
  width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 8px;
  background: transparent; color: var(--ink);
}
.ysd-aux :is(.catalog-topbar, .magazine-topbar, .match-topbar) b { font-size: 20px; line-height: 1.4; }
.ysd-aux :is(.catalog-topbar, .magazine-topbar, .match-topbar) small { color: var(--muted); font-size: 11px; }
.ysd-aux :is(.magazine-topbar, .match-topbar) > span:empty { visibility: hidden; }
.ysd-aux .legal-header > a { min-height: 44px; display: flex; align-items: center; }
.ysd-aux .legal-brand { gap: 12px; }
.ysd-aux .legal-brand img { width: 44px; height: 44px; object-fit: contain; border-radius: 0; }
.ysd-aux .legal-brand b { font-size: 20px; }

/* Legal text and inquiry content keep their original markup and state. */
.ysd-aux :is(.legal-main, .cs-wrap) { width: 100%; margin: 0; padding: 32px 24px 48px; }
.ysd-aux :is(.legal-main h1, .cs-title h1) { margin: 12px 0 16px; font-size: 28px; line-height: 1.5; }
.ysd-aux :is(.legal-lead, .cs-title p) { color: var(--muted); font-size: 14px; line-height: 1.9; }
.ysd-aux .effective { margin: 16px 0 24px; padding: 8px 12px; background: var(--tint); color: var(--red); font-size: 11px; }
.ysd-aux .legal-nav { gap: 8px; margin-bottom: 24px; }
.ysd-aux .legal-nav a { display: flex; align-items: center; padding: 8px 12px; border-radius: 8px; background: var(--light); font-size: 12px; }
.ysd-aux .legal-nav a.active { background: var(--red); border-color: var(--red); color: var(--light); }
.ysd-aux .legal-section { padding: 24px 0; border-color: var(--line); }
.ysd-aux .legal-section h2 { font-size: 24px; line-height: 1.5; }
.ysd-aux .legal-section h3 { font-size: 16px; line-height: 1.7; }
.ysd-aux .legal-section :is(p, li) { color: var(--ink); font-size: 14px; line-height: 1.9; }
.ysd-aux .legal-section :is(th, td) { border-color: var(--line); padding: 12px; }
.ysd-aux .legal-section th { background: var(--light); }
.ysd-aux :is(.notice, .refund-callout) {
  margin: 24px 0; padding: 20px; border: 1px solid var(--line); border-left: 2px solid var(--gold);
  background: var(--light); color: var(--ink); font-size: 14px; line-height: 1.9;
}
.ysd-aux .refund-callout p { color: var(--muted); }
.ysd-aux .faq-item { padding: 24px 0; }
.ysd-aux .faq-item h2 { font-size: 20px; line-height: 1.6; }
.ysd-aux .legal-footer { padding: 24px; border-top: 1px solid var(--line); background: var(--light); color: var(--muted); font-size: 12px; }
.ysd-aux .legal-footer a { color: var(--red); }
.ysd-aux :is(.cs-title, .form-section-title) { margin-bottom: 24px; }
.ysd-aux :is(.inquiry-history-head h2, .form-section-title b) { font-size: 24px; line-height: 1.5; }
.ysd-aux .cs-form { padding: 24px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--light); }
.ysd-aux :is(.inquiry-card, .inquiry-empty, .inquiry-login-hint, .order-fields) {
  padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--light); box-shadow: none;
}
.ysd-aux :is(.inquiry-card p, .privacy-consent small) { color: var(--ink); line-height: 1.9; }
.ysd-aux :is(.inquiry-history-head p, .field-title span, .field > small) { color: var(--muted); font-size: 12px; }
.ysd-aux :is(.inquiry-answer, .inquiry-followup) { border-color: var(--line); }
.ysd-aux :is(.privacy-consent, .order-empty) { padding: 16px; background: var(--paper); color: var(--muted); font-size: 12px; }
.ysd-aux .inquiry-status { background: var(--paper); color: var(--muted); }
.ysd-aux .inquiry-status.answered { background: #e8eee7; color: #365643; }
.ysd-aux .inquiry-status.in_progress { background: #e9edf3; color: var(--navy); }
.ysd-aux :is(.field input, .field select, .field textarea, .followup-form textarea,
  .celebrity-request input:not([type=checkbox]), .celebrity-request textarea,
  .match-checkout-fields input, .match-checkout-fields select) {
  min-width: 0; min-height: 48px; padding: 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--light); color: var(--ink); font-size: 16px; line-height: 1.5; box-shadow: none;
}
.ysd-aux :is(.submit-inquiry, .followup-send, .celebrity-request-action button, .primary) {
  min-height: 48px; padding: 12px 16px; border: 0; border-radius: 8px;
  background: var(--red); color: var(--light); box-shadow: none; font-size: 14px; font-weight: 700;
}
.ysd-aux :is(.followup-open, .followup-cancel) { border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); }
.ysd-aux .inquiry-channel { border-radius: 8px; }
.ysd-aux .inquiry-channel a { min-height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 8px; }
.ysd-aux .cs-toast { border-radius: 8px; background: var(--ink); color: var(--light); box-shadow: none; }

/* Catalog artwork remains intact; decorative backgrounds use quiet paper. */
.ysd-aux .catalog-hero { padding: 32px 24px 24px; background: var(--paper); }
.ysd-aux .catalog-hero::before, .ysd-aux .catalog-hero::after { content: none; }
.ysd-aux .catalog-hero h1 { font-size: 32px; line-height: 1.5; }
.ysd-aux .celebrity-search { margin-top: 24px; }
.ysd-aux .celebrity-search > div { height: 48px; border-color: var(--line); border-radius: 8px; background: var(--light); box-shadow: none; }
.ysd-aux .celebrity-search input { font-size: 16px; }
.ysd-aux .celebrity-search button { min-width: 44px; background: var(--paper); color: var(--muted); border-radius: 8px; }
.ysd-aux .catalog-filters { flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.ysd-aux .catalog-filters button { padding: 8px 16px; border-color: var(--line); border-radius: 8px; background: var(--light); color: var(--muted); font-weight: 600; }
.ysd-aux .catalog-filters button.active { border-color: var(--red); background: var(--red); color: var(--light); }
.ysd-aux .catalog-results { padding: 24px; }
.ysd-aux .catalog-results h2 { font-size: 24px; }
.ysd-aux .celebrity-banner-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ysd-aux .celebrity-banner { border-color: var(--line); border-radius: 8px; background: var(--light); box-shadow: none; }
.ysd-aux .banner-art { background: var(--paper); }
.ysd-aux .banner-art::before { content: none; }
.ysd-aux .banner-copy { padding: 16px 12px; background: var(--light); }
.ysd-aux .banner-copy h3 { font-size: 24px; line-height: 1.4; }
.ysd-aux .banner-copy p { color: var(--muted); font-size: 12px; line-height: 1.8; font-weight: 400; }
.ysd-aux .banner-actions a { display: flex; align-items: center; color: var(--red); border-color: var(--line); font-weight: 600; }
.ysd-aux .name-seal { background: var(--navy); color: var(--light); }
.ysd-aux .name-seal::before { border-color: var(--gold); border-radius: 8px; }
.ysd-aux .celebrity-request { margin: 24px; padding: 24px 20px; grid-template-columns: minmax(0, 1fr); gap: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--light); box-shadow: none; }
.ysd-aux .celebrity-request h2 { font-size: 24px; line-height: 1.5; }
.ysd-aux .celebrity-request-grid { min-width: 0; }
.ysd-aux .celebrity-request label { min-width: 0; color: var(--muted); font-size: 12px; }
.ysd-aux .catalog-note { margin: 24px; color: var(--muted); font-size: 12px; line-height: 1.8; }

/* Reading surfaces preserve charts, portraits, selected states and content. */
.ysd-aux :is(.portrait-cover, .match-hero) { margin: 24px 24px 0; border: 1px solid var(--line); border-radius: 16px; box-shadow: none; background: var(--paper); }
.ysd-aux :is(.cover-copy, .match-hero-copy) { padding: 24px; color: var(--light); }
.ysd-aux :is(.cover-copy h1, .match-hero-copy h1) { font-size: 32px; line-height: 1.5; }
.ysd-aux :is(.cover-copy p, .match-hero-copy p) { color: var(--light); font-size: 14px; line-height: 1.8; }
.ysd-aux :is(.cover-copy small, .match-hero-copy small) { color: var(--light); font-size: 12px; }
.ysd-aux .opening { padding: 40px 24px 32px; background: none; }
.ysd-aux :is(.opening h2, .match-gate h2, .match-result > header h2) { font-size: 28px; line-height: 1.6; }
.ysd-aux .keywords { gap: 8px; margin-top: 24px; }
.ysd-aux .keywords span { padding: 8px 12px; border-color: var(--line); border-radius: 8px; background: var(--light); color: var(--muted); font-size: 12px; font-weight: 500; }
.ysd-aux :is(.chart-ledger, .element-ledger, .reading-toc, .time-note, .match-gate, .match-result) {
  margin: 0 24px 24px; padding: 24px 20px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--light); box-shadow: none;
}
.ysd-aux :is(.section-heading h2, .reading-heading h2) { font-size: 24px; line-height: 1.5; }
.ysd-aux .pillar-table { border-color: var(--line); border-radius: 8px; background: var(--paper); }
.ysd-aux .pillar.is-day { background: var(--red); color: var(--light); }
.ysd-aux .chart-reading { padding: 20px; border-color: var(--red); background: var(--paper); }
.ysd-aux .reading-toc a { border-radius: 8px; color: var(--ink); font-weight: 600; }
.ysd-aux .reading-toc a:hover { background: var(--paper); }
.ysd-aux .reading-toc span { background: var(--tint); }
.ysd-aux .reading-sections { padding: 0 24px; }
.ysd-aux .reading-sections article { padding: 24px 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; }
.ysd-aux .reading-sections article:nth-child(even) { background: transparent; }
.ysd-aux .reading-sections h3 { font-size: 24px; line-height: 1.6; }
.ysd-aux :is(.reading-sections p, .match-readings p) { color: var(--ink); font-size: 15px; line-height: 1.95; font-weight: 400; }
.ysd-aux .section-number { color: var(--gold); }
.ysd-aux .compatibility-callout { margin: 32px 24px 0; padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--navy); color: var(--light); box-shadow: none; }
.ysd-aux .compatibility-callout h2 { font-size: 24px; line-height: 1.6; }
.ysd-aux .compatibility-callout small { color: var(--light); }
.ysd-aux .compatibility-callout button { min-height: 48px; border-radius: 8px; background: var(--light); color: var(--navy); font-size: 14px; font-weight: 700; }
.ysd-aux .content-note { margin: 24px; padding-bottom: 48px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.ysd-aux .connection-mark { margin-block: 32px; }
.ysd-aux .connection-mark > i { border-color: var(--line); background: var(--light); box-shadow: none; }
.ysd-aux .connection-mark > span::before, .ysd-aux .connection-mark > span::after { background: var(--red); }
.ysd-aux :is(.match-status, .match-note, .match-checkout-fields) { padding: 16px; border-radius: 8px; background: var(--paper); color: var(--muted); border-color: var(--line); }
.ysd-aux :is(.profile-choice-card, .profile-edit-panel, .pair-ledger article, .match-pillar-grid) { border-color: var(--line); border-radius: 8px; background: var(--light); box-shadow: none; }
.ysd-aux .profile-choice-card.selected { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.ysd-aux .profile-choice-actions { border-color: var(--line); background: var(--paper); }
.ysd-aux .profile-choice-actions button { min-height: 44px; color: var(--ink); }
.ysd-aux .profile-choice-actions button[data-delete] { color: var(--red); }
.ysd-aux :is(.profile-edit-cancel, .back-reading, .match-actions a + a) { border: 1px solid var(--line); border-radius: 8px; background: var(--light); color: var(--ink); }
.ysd-aux .match-actions a { border-radius: 8px; background: var(--red); color: var(--light); }
.ysd-aux .match-actions a + a { background: var(--light); color: var(--ink); }
.ysd-aux .pair-ledger { gap: 8px; grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr); }
.ysd-aux .pair-ledger > b { width: 44px; height: 44px; border-radius: 8px; background: var(--tint); color: var(--red); }
.ysd-aux .match-readings article { padding: 24px 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
.ysd-aux .match-readings article:nth-child(n) { background: transparent; }
.ysd-aux .match-readings h3 { font-size: 24px; line-height: 1.6; }
.ysd-aux .match-result { margin-bottom: 48px; }
.ysd-aux .back-reading { padding: 12px; text-align: center; }
@media (max-width: 360px) {
  .ysd-aux :is(.legal-main, .cs-wrap, .catalog-hero, .catalog-results, .opening) { padding-inline: 20px; }
  .ysd-aux :is(.portrait-cover, .match-hero, .celebrity-request, .chart-ledger, .element-ledger,
    .reading-toc, .time-note, .match-gate, .match-result, .compatibility-callout) { margin-inline: 16px; }
  .ysd-aux :is(.cs-form, .celebrity-request, .match-gate, .match-result) { padding: 20px 16px; }
  .ysd-aux .celebrity-banner-list { gap: 12px; }
  .ysd-aux .banner-copy { padding: 12px; }
  .ysd-aux .banner-copy h3 { font-size: 20px; }
  .ysd-aux .reading-toc { grid-template-columns: minmax(0, 1fr); }
  .ysd-aux .pair-ledger { gap: 4px; }
  .ysd-aux .pair-ledger article { padding-inline: 8px; }
}
