/* SAFE V105 — app-wide badge / pill / pale-panel contrast repair.
   Presentation only: no markup, handler, API, sheet, payment or enrollment logic.

   Root cause (verified 2026-11-19 on main c36d6b4):
   1. contrast-audit-safe-v1.css forces `color:inherit` on every span/b/strong inside
      enrollment groups, so the cream status badge (.badge) inherits the white card text
      and renders white-on-cream (measured 1.00:1) — the 등록 tab screenshot.
   2. home-scroll-checkbox-safe-v93.css forces `color:inherit` on home .badge too.
   3. Several components kept a light-theme background (modal sheet, chips, category
      cards, filter rows, pager, summary panels) while the dark theme made their text light.
   Every rule below is scoped to those components and keeps the semantic colour meaning. */

/* ---------- 1. status badges: keep the semantics, restore the text colour ---------- */
.badge {
  background: #43371c !important;
  color: #ffdd9e !important;
  border: 1px solid #6b5730 !important;
}
.badge--active,
.payment-state--paid {
  background: #21362a !important;
  color: #b5e7c4 !important;
  border-color: #3d644b !important;
}
.badge--unpaid,
.payment-state--unpaid {
  background: #482725 !important;
  color: #ff9b93 !important;
  border-color: #643330 !important;
}
.badge--near {
  background: #443b20 !important;
  color: #f4d285 !important;
  border-color: #6b5a2c !important;
}
.badge--hold {
  background: #292f37 !important;
  color: #b3beca !important;
  border-color: #3d454f !important;
}
.badge--done {
  background: #233446 !important;
  color: #a4c5e7 !important;
  border-color: #35506b !important;
}
.badge--settled,
.payment-state--settlement {
  background: #2e333a !important;
  color: #ccd4de !important;
  border-color: #454c55 !important;
}
.student-contact-badge-v33 {
  background: #3f3419 !important;
  color: #ffd98a !important;
  border-color: #6b5730 !important;
}

/* 1b. Containers that force `color: inherit` on every child must not reach the badge text. */
#view-detail :is(.enrollment-group-safe-v27, .enrollment-history-safe-v28) :is(.item, section) .badge:not(.badge--active):not(.badge--unpaid):not(.badge--near):not(.badge--hold):not(.badge--done):not(.badge--settled):not(.student-contact-badge-v33),
#view-home :is(.home-attention-card, .home-operating-card, .home-today-card, .home-service-card-safe-v40) .badge:not(.badge--active):not(.badge--unpaid):not(.badge--near):not(.badge--hold):not(.badge--done):not(.badge--settled):not(.student-contact-badge-v33) {
  background: #43371c !important;
  color: #ffdd9e !important;
  border-color: #6b5730 !important;
}

/* 1c. Disclosure counts and detail summaries that stayed on the light palette. */
.home-list-disclosure > summary b {
  background: #34343a !important;
  color: #f0f0f3 !important;
  border: 1px solid #4d4d57 !important;
}
.advanced-disclosure-v2b1 > summary,
.operation-disclosure-v2b1 > summary,
.recovery-disclosure-v2b1 > summary {
  color: #a9c8f5 !important;
}
.debug-detail-v2b1,
.debug-detail-v2b1 summary,
.debug-detail-v2b1 code {
  color: #aab4c4 !important;
}

/* ---------- 2. tag / filter chips ---------- */
.chip {
  background: #2a2a2f !important;
  color: #e6e6ea !important;
  border: 1px solid #4a4a52 !important;
}
.chip.active,
.message-filter-row .chip.active {
  background: #2f4a3a !important;
  color: #e4f7ea !important;
  border: 1px solid #4f7c60 !important;
}

/* ---------- 3. dialog sheets (quick settlement, status picker, re-registration) ---------- */
.quick-settlement-overlay .quick-settlement-sheet {
  background: #1c1c20 !important;
  color: #f3f4f6 !important;
  border: 1px solid #414149 !important;
}
.quick-settlement-overlay .quick-settlement-sheet :is(h1, h2, h3, h4, b, strong) {
  color: #f5f6f7 !important;
}
.quick-settlement-overlay .quick-settlement-sheet :is(.muted, .meta, label, legend, small, p) {
  color: #c2c8d2 !important;
}
.quick-settlement-overlay .quick-settlement-sheet .eyebrow {
  color: #a9b3c1 !important;
}
.quick-settlement-overlay .quick-settlement-sheet :is(.quick-settlement-facts div, .quick-settlement-preview span, .quick-settlement-modes label, .quick-settlement-amount-mode label, .contract-persist-safe-v32, .contract-memo-safe-v32) {
  background: #25262b !important;
  color: #f0f1f4 !important;
  border-color: #43444c !important;
}
.quick-settlement-overlay .quick-settlement-sheet :is(.quick-settlement-facts span, .quick-settlement-preview span) {
  color: #c7cdd6 !important;
}
.quick-settlement-overlay .quick-settlement-sheet :is(.quick-settlement-facts b, .quick-settlement-preview b) {
  color: #f5f6f7 !important;
}
.quick-settlement-overlay .quick-settlement-sheet .status-choice {
  background: #2b2b31 !important;
  color: #e8e9ed !important;
  border-color: #4a4a54 !important;
}
.quick-settlement-overlay .quick-settlement-sheet .status-choice--active {
  background: #2f4a3a !important;
  color: #e4f7ea !important;
  border-color: #4f7c60 !important;
}
/* Keep the destructive choice visibly red instead of flattening it into the neutral chip. */
.quick-settlement-overlay .quick-settlement-sheet .status-choice.danger,
.quick-settlement-overlay .quick-settlement-sheet .status-choice[onclick*="정산종료"],
.quick-settlement-overlay .quick-settlement-sheet .status-choice[onclick*="수강종료"] {
  background: #3b2422 !important;
  color: #ffb4ab !important;
  border-color: #6b3a36 !important;
}

/* ---------- 4. pale panels that never received a dark surface ---------- */
.home-search-results {
  background: #1c1c20 !important;
  border-color: #414149 !important;
  box-shadow: 0 16px 36px #0006 !important;
}
.home-search-results button {
  background: #1c1c20 !important;
  color: #f3f4f6 !important;
}
.home-search-results button + button {
  border-top-color: #383840 !important;
}
.home-search-results span {
  color: #c5c9d1 !important;
}
.message-selection-summary,
.music-category-card-v56,
.music-preview-player-v57,
.music-quick-save-v57,
.songdb-summary,
.songdb-filter-row,
.pager,
.price-summary-v2b,
.price-unset-v2b2,
.plan-assign-v2b1,
.recovery-disclosure-v2b1,
.prepay-applied,
.prepay-balance-chip-v46,
.student-receivable-breakdown-safe-v38,
.contract-persist-safe-v32 {
  background: #232327 !important;
  color: #f3f4f6 !important;
  border-color: #45454d !important;
}
.message-selection-summary :is(b, strong, span, small, p, div),
.music-category-card-v56 :is(b, strong, span, small, p, div),
.music-preview-player-v57 :is(b, strong, span, small, p, div),
.music-quick-save-v57 :is(b, strong, span, small, p, div),
.songdb-summary :is(b, strong, span, small, p, div),
.songdb-filter-row :is(b, strong, span, small, p, div),
.pager :is(b, strong, span, small, p, div, button),
.price-summary-v2b :is(b, strong, span, small, p, div),
.price-unset-v2b2 :is(b, strong, span, small, p, div),
.plan-assign-v2b1 :is(b, strong, span, small, p, div),
.recovery-disclosure-v2b1 :is(b, strong, span, small, p, div),
.prepay-applied :is(b, strong, span, small, p, div),
.prepay-balance-chip-v46 :is(b, strong, span, small, p, div),
.student-receivable-breakdown-safe-v38 :is(b, strong, span, small, p, div),
.contract-persist-safe-v32 :is(b, strong, span, small, p, div) {
  color: inherit;
}
.message-selection-summary :is(.muted, .meta, small),
.music-category-card-v56 :is(.muted, .meta, small),
.music-preview-player-v57 :is(.muted, .meta, small),
.music-quick-save-v57 :is(.muted, .meta, small),
.songdb-summary :is(.muted, .meta, small),
.songdb-filter-row :is(.muted, .meta, small),
.pager :is(.muted, .meta, small),
.price-summary-v2b :is(.muted, .meta, small),
.price-unset-v2b2 :is(.muted, .meta, small),
.plan-assign-v2b1 :is(.muted, .meta, small),
.recovery-disclosure-v2b1 :is(.muted, .meta, small),
.prepay-applied :is(.muted, .meta, small),
.student-receivable-breakdown-safe-v38 :is(.muted, .meta, small) {
  color: #c5c9d1 !important;
}

/* 4c. Light-theme heading colours that survived inside dark cards. */
.price-management-v2b2 h4,
.student-price-management-v2b2 h4 {
  color: #c9d9f2 !important;
}
.legacy-price-detail-v2b2 > summary {
  color: #a9c8f5 !important;
}
.legacy-price-grid-v2b2 > div {
  background: #232327 !important;
  color: #f3f4f6 !important;
  border: 1px solid #45454d !important;
}
.spotify-connect-v58 h3 {
  color: #b7f0c8 !important;
}
.spotify-connect-v58 summary {
  color: #b7f0c8 !important;
}
.spotify-status-ok-v58 {
  color: #8ce6a5 !important;
}
.service-facts-v2b1 strong {
  color: #f1f4f8 !important;
}

/* 4a. Disclosure summaries inside the message and music forms. */
.message-details > summary {
  color: #a9c8f5 !important;
}
#messageStudentList {
  background: #232327 !important;
  border-color: #45454d !important;
}
#messageStudentList :is(p, span, small, label) {
  color: #c5c9d1 !important;
}
.songdb-mini-tabs details {
  background: #232327 !important;
  border-color: #45454d !important;
}
.songdb-mini-tabs details > summary {
  color: #dce3ec !important;
}
.songdb-mini-tabs details :is(label, span, small, p) {
  color: #c5c9d1 !important;
}

/* 4b. Sticky student-manage toolbar was pure white over the dark roster. */
.ops-sticky-actions {
  background: #1c1c20 !important;
  border-color: #414149 !important;
}
.ops-sticky-actions :is(button, span, b, strong) {
  color: #f1f3f6 !important;
}
.ops-sticky-actions .selection-mode-label {
  background: #26313b !important;
  color: #edf3fa !important;
  border-color: #465463 !important;
}
