/* Hand-written glue for the app side of the main-site chrome (`#siteChrome`).
 *
 * `site_chrome.css` is generated from the replica by site/tools/extract_chrome.py and must
 * not be edited; this file is the app's own small layer on top of it: spacing around the
 * app card, and the status line that replaced the app's old dark footer.
 * [INVARIANT: KAT-SITE-CHROME]
 */

/* The app card and its status line fill the site panel between header and footer.
 * 6px of top padding: the legacy header is a fixed 175px box and its navigation bar sits
 * at 145px, so the bar overhangs its parent by ~3px on the replica too. */
#siteChrome .siteChromeApp {
  padding: 0 0 12px;
  box-sizing: border-box;
}

#siteChrome .siteChromeApp > #blossomAppRoot,
#siteChrome .siteChromeApp > .max-w-4xl {
  width: 100%;
  max-width: none;
  background-color: #FFFEF8;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

#siteChrome .siteChromeStatus {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  align-items: center;
  max-width: none;
  margin: 8px 0 4px;
  padding: 6px 10px;
  font-size: 11px;
  color: #6b5a25;
  background: #fff9dd;
  border: 1px solid #e6d68a;
  border-radius: 0;
}

/* On a phone the site header shrinks to 110px (media.css). The module bar is sticky, so
   it must not slide under the header while the page is at the top. */
@media (max-width: 740px) {
  #siteChrome .siteChromeApp { padding-top: 2px; }
}

/* Tailwind's preflight sets `box-sizing: border-box` on everything, but the replica's
 * chrome was authored for **content-box**: `.nav a{height:21px;padding:6px 5px}` means a
 * 33px link on the site and a 21px link here with 9px left for the text — the menu looked
 * clipped, and most of its height was no longer part of the link, so clicks fell through.
 * Restored for the chrome only: the app card lives outside `.header`/`.footer` and keeps
 * border-box, which its Tailwind layout depends on. `[INVARIANT: KAT-SITE-CHROME]` */
#siteChrome .header,
#siteChrome .header *,
#siteChrome .footer,
#siteChrome .footer * {
  box-sizing: content-box;
}

/* The navigation bar is positioned 145px down a 175px header and hangs 5px below it on
 * the replica, where the hero image absorbs the overhang. Here the app card follows
 * immediately, so the box grows to contain its own menu instead of spilling onto it. */
#siteChrome .header {
  height: 180px;
}

/* [INVARIANT: KAT-PUJA-SERVICE-GRID-001] Layer 3: Borderless, Flat, Non-Pill Scrolling Spotlight Ticker */
#siteChrome #upcomingCeremonySpotlight.kat-spotlight-bar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0;
  margin: 0;
  background: rgba(233, 241, 138, 0.45);
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: hidden;
  min-height: 34px;
}

#siteChrome .kat-spotlight-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #ffc;
  background: #900;
  padding: 7px 12px;
  border: 0 !important;
  border-radius: 0 !important;
  white-space: nowrap;
  flex-shrink: 0;
  z-index: 2;
}

#siteChrome .kat-spotlight-viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  position: relative;
  padding-left: 14px;
}

@media (max-width: 640px) {
  .kat-spotlight-badge,
  #siteChrome .kat-spotlight-badge {
    display: none !important;
  }
  .kat-spotlight-viewport,
  #siteChrome .kat-spotlight-viewport {
    padding-left: 6px;
  }
}

#siteChrome .kat-spotlight-track {
  display: inline-flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
  padding-left: 0;
  animation: katAppTicker 55s linear infinite;
}

#siteChrome #upcomingCeremonySpotlight:hover .kat-spotlight-track,
#siteChrome #upcomingCeremonySpotlight:focus-within .kat-spotlight-track {
  animation-play-state: paused;
}

@keyframes katAppTicker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  #siteChrome .kat-spotlight-track {
    animation: none;
    flex-wrap: wrap;
    white-space: normal;
    padding: 4px 12px;
    gap: 12px;
  }
}

#siteChrome .kat-spotlight-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 42px 4px 0;
  border: 0 !important;
  border-radius: 0 !important;
  background: none !important;
  box-shadow: none !important;
  font-size: 15px;
  font-weight: 400;
  color: #7a1c1c !important;
  text-decoration: none !important;
}

#siteChrome .kat-spotlight-item:hover {
  color: #c00 !important;
  text-decoration: underline !important;
}

/* [INVARIANT: KAT-PUJA-SERVICE-GRID-001] 5-Service Multicolor Flat Rectangular Band:
 * Uses the exact classic `.banners` multicolor flat/beveled rectangular aesthetic
 * (scrn_edges.png bevel overlay, 0 border-radius, 0 gap, circular number badges). */
#siteChrome #mainTabBar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  width: 100%;
  border: 0;
  border-radius: 0 !important;
}

@media (max-width: 639px) {
  #siteChrome #mainTabBar #mainTabDonate {
    grid-column: span 2;
  }
}

@media (min-width: 640px) {
  #siteChrome #mainTabBar {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (min-width: 640px) and (max-width: 1024px) {
  #siteChrome #mainTabBar .site-service-card {
    padding: 8px 4px;
  }
  #siteChrome #mainTabBar .service-card-head {
    font-size: 15px;
    font-weight: 400;
    gap: 4px;
  }
}

#siteChrome #mainTabBar .site-service-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 72px;
  padding: 10px 8px;
  text-align: center;
  border-radius: 0 !important;
  border: 0;
  color: #ffffff !important;
  box-shadow: none !important;
  transition: background-color 140ms ease, filter 140ms ease;
  white-space: normal;
  position: relative;
}

#siteChrome #mainTabBar .site-service-card--puja,
#siteChrome #mainTabBar #mainTabPuja {
  background: url(/_img/scrn_edges.png) repeat right top, #801800 url(/_img/scrn_edges.png) repeat left bottom !important;
  background-color: #801800 !important;
  border-top: 1px solid #9B2500 !important;
  border-bottom: 1px solid #6A1400 !important;
}
#siteChrome #mainTabBar .site-service-card--puja:hover,
#siteChrome #mainTabBar #mainTabPuja:hover {
  background-color: #6A1400 !important;
}

#siteChrome #mainTabBar .site-service-card--birthday,
#siteChrome #mainTabBar #mainTabBirthday {
  background: url(/_img/scrn_edges.png) repeat center top, #304D0C url(/_img/scrn_edges.png) repeat left bottom !important;
  background-color: #304D0C !important;
  border-top: 1px solid #3F6212 !important;
  border-bottom: 1px solid #263E09 !important;
}
#siteChrome #mainTabBar .site-service-card--birthday:hover,
#siteChrome #mainTabBar #mainTabBirthday:hover {
  background-color: #263E09 !important;
}

#siteChrome #mainTabBar .site-service-card--memorial,
#siteChrome #mainTabBar #mainTabMemorial {
  background: url(/_img/scrn_edges.png) repeat center top, #1D1030 url(/_img/scrn_edges.png) repeat center bottom !important;
  background-color: #1D1030 !important;
  border-top: 1px solid #2A1B44 !important;
  border-bottom: 1px solid #160B25 !important;
}
#siteChrome #mainTabBar .site-service-card--memorial:hover,
#siteChrome #mainTabBar #mainTabMemorial:hover {
  background-color: #160B25 !important;
}

#siteChrome #mainTabBar .site-service-card--supplies,
#siteChrome #mainTabBar #mainTabSupplies {
  background: url(/_img/scrn_edges.png) repeat right top, #014D77 url(/_img/scrn_edges.png) repeat center bottom !important;
  background-color: #014D77 !important;
  border-top: 1px solid #0369A1 !important;
  border-bottom: 1px solid #013D5E !important;
}
#siteChrome #mainTabBar .site-service-card--supplies:hover,
#siteChrome #mainTabBar #mainTabSupplies:hover {
  background-color: #013D5E !important;
}

#siteChrome #mainTabBar .site-service-card--donate,
#siteChrome #mainTabBar #mainTabDonate {
  background: url(/_img/scrn_edges.png) repeat right top, #B8860B url(/_img/scrn_edges.png) repeat center bottom !important;
  background-color: #B8860B !important;
  border-top: 1px solid #E9C033 !important;
  border-bottom: 1px solid #8C6500 !important;
}
#siteChrome #mainTabBar .site-service-card--donate:hover,
#siteChrome #mainTabBar #mainTabDonate:hover {
  background-color: #996F00 !important;
}

#siteChrome #mainTabBar .site-service-card.site-tab--active,
#siteChrome #mainTabBar .site-service-card.is-active {
  box-shadow: inset 0 -4px 0 #FFD700 !important;
  filter: brightness(1.08);
}

#siteChrome #mainTabBar .service-card-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.25;
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

#siteChrome #mainTabBar .tab-label {
  font-weight: 400 !important;
}

#siteChrome #mainTabBar .service-card-num {
  display: none !important;
  width: 22px;
  height: 22px;
  border-radius: 50% !important;
  font-size: 12px;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.28);
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  flex-shrink: 0;
  line-height: 1;
}

#siteChrome #mainTabBar .site-service-card.site-tab--active .service-card-num,
#siteChrome #mainTabBar .site-service-card.is-active .service-card-num {
  background: #FFD700;
  color: #450a0a;
  border-color: #ffffff;
}

#siteChrome #mainTabBar .service-card-sub {
  display: block;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.25;
  color: rgba(255, 255, 240, 0.92) !important;
  padding-left: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

#siteChrome #mainTabBar .site-service-card.site-tab--active .service-card-sub,
#siteChrome #mainTabBar .site-service-card.is-active .service-card-sub {
  color: #fffbeb !important;
}

@media (max-width: 740px) {
  /* Same story on a phone: the collapsed menu ("選項") sits at 80px and is 46px tall. */
  #siteChrome .header {
    height: 130px;
  }
}

/* The staff login sits at the end of the site menu as an ordinary item — the same height,
 * padding and colour as the links beside it. It carried a red "button" style for one
 * release; on the main site it is plain, and the app must match.
 * Only what the button added is cancelled: `color` and `padding` must keep coming from the
 * legacy `.nav a` rule, or the item stops matching its neighbours. `[INVARIANT: KAT-SITE-CHROME]`
 * The class stays because the extraction tools find and count it by name. */
#siteChrome .nav_zh-tw a.site-nav-staff,
#siteChrome .nav_en a.site-nav-staff {
  background: none;
  border: 0;
  border-radius: 0;
  font-weight: inherit;
}

/* A printed registration form is a document, not a web page: the site's header,
 * navigation and footer have no place on paper (the rail already hides itself). */
@media print {
  #siteChrome .header,
  #siteChrome .footer,
  #siteChrome .siteChromeStatus { display: none !important; }
  #siteChrome > .layout { width: 100% !important; min-width: 0 !important; background: #fff !important; }
  body.site-chrome-on { background: #fff !important; }
}

/* ------------------------------------------------------------------------- */
/* [INVARIANT: KAT-SITE-A11Y-045] Keyboard access inside the app chrome.
 *
 * The site chrome is a legacy 1 000+-link surface, so /puja/ needs its own escape hatch:
 * a skip link as the first body child (emitted by site_chrome_head.html) that reveals
 * itself on focus and jumps to `#puja-main` (build_static.py adds tabindex="-1" so the
 * target actually receives focus). Focus-visible is scoped to the app card (`#siteChrome
 * #blossomAppRoot`) and the app `<main>`, never to the extracted legacy chrome — the
 * replica's own global.css already owns `.header`/`.footer` focus styling.
 * ------------------------------------------------------------------------- */
.blossom-skip-link {
  position: fixed;
  top: -60px;
  left: 8px;
  z-index: 2147483000;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: #7A1C1C;
  border: 2px solid #D4AF37;
  border-radius: 8px;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
  transition: top 120ms ease;
}
.blossom-skip-link:focus,
.blossom-skip-link:focus-visible {
  top: 8px;
  outline: 3px solid #D4AF37;
  outline-offset: 2px;
}

#siteChrome #blossomAppRoot :focus-visible,
#siteChrome .siteChromeApp :focus-visible,
#puja-main :focus-visible {
  outline: 3px solid #7A1C1C;
  outline-offset: 2px;
}

@media print {
  .blossom-skip-link { display: none !important; }
}

/* [INVARIANT: KAT-SITE-A11Y-046] The four module tabs are the primary touch targets on
 * the puja page. `.site-tab` (site_theme.css) renders at ~37px on a phone; the WCAG 2.2
 * Target Size (Minimum) guidance and the repo's 44px tap-target rule need >=44px. Only
 * the app's tab strip is touched — never the legacy replica navigation. */
@media (max-width: 740px) {
  #siteChrome #mainTabBar .site-tab {
    min-height: 44px;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
  }

  /* [INVARIANT: KAT-PUJA-MOBILE-RESPONSIVE]
   * Mobile-First / Edge-to-Edge optimization: eliminates 5-layer nesting box waste on mobile screens.
   * Full width, no arbitrary margins/borders, safe touch padding.
   */
  #siteChrome .layout {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  #siteChrome .siteChromeApp {
    padding: 2px 4px 8px !important;
  }
  #siteChrome #blossomAppRoot {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  #siteChrome #pujaForm {
    padding: 8px 6px !important;
  }
  #siteChrome #mainTabPanel {
    padding: 8px 6px !important;
    border-width: 1px !important;
    border-radius: 12px !important;
    box-shadow: none !important;
  }
  #contactCard {
    padding: 10px !important;
    border-radius: 12px !important;
  }
  #registrationStepper {
    padding: 6px 4px !important;
  }
  #registrationStepper div[id^="stepCircle"] {
    width: 24px !important;
    height: 24px !important;
    font-size: 11px !important;
  }
  #registrationStepper button div[id^="stepLabel"] span {
    font-size: 10px !important;
  }
  #suppliesStickyBottomBar {
    bottom: env(safe-area-inset-bottom, 0px) !important;
    left: 0 !important;
    right: 0 !important;
    max-width: 100% !important;
    border-radius: 0 !important;
    padding: 10px 12px !important;
    padding-bottom: 8px !important;
    z-index: 990 !important;
  }
  #blossomAppRoot input[type="text"],
  #blossomAppRoot input[type="tel"],
  #blossomAppRoot input[type="email"],
  #blossomAppRoot select {
    font-size: 16px !important;
  }
}

/* [INVARIANT: KAT-PUJA-RESPONSIVE-TABLES]
 * Table-to-Card Responsive Transformation on phone screens (< 640px).
 * Eliminates horizontal scrollbar traps by rendering rows as clear, stacked cards with large touch targets.
 */
@media (max-width: 640px) {
  /* Puja Blessing & Deliverance Cards */
  .overflow-x-auto:has(#blessingTableBody),
  .overflow-x-auto:has(#deliveranceTableBody) {
    overflow-x: visible !important;
    border: none !important;
    background: transparent !important;
  }
  .overflow-x-auto:has(#blessingTableBody) table,
  .overflow-x-auto:has(#deliveranceTableBody) table {
    display: block !important;
    width: 100% !important;
    background: transparent !important;
  }
  .overflow-x-auto:has(#blessingTableBody) thead,
  .overflow-x-auto:has(#deliveranceTableBody) thead {
    display: none !important;
  }
  #blessingTableBody,
  #deliveranceTableBody {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }
  #blessingTableBody tr,
  #deliveranceTableBody tr {
    display: flex !important;
    flex-direction: column !important;
    background: #ffffff !important;
    border: 1.5px solid #e7e5e4 !important;
    border-radius: 12px !important;
    padding: 10px 12px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    gap: 6px !important;
    position: relative !important;
  }
  #blessingTableBody tr:focus-within,
  #deliveranceTableBody tr:focus-within {
    border-color: #b91c1c !important;
  }
  #blessingTableBody tr td,
  #deliveranceTableBody tr td {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
    border: none !important;
  }
  #blessingTableBody tr td.row-idx-cell,
  #deliveranceTableBody tr td.row-idx-cell {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 4px !important;
    font-weight: 800 !important;
    font-size: 13px !important;
    color: #991b1b !important;
    border-bottom: 1px dashed #e7e5e4 !important;
    padding-bottom: 4px !important;
    margin-bottom: 2px !important;
  }
  #blessingTableBody tr td.row-idx-cell::before {
    content: "祈福善信 #" !important;
    font-size: 12px !important;
    color: #78716c !important;
    font-weight: 700 !important;
  }
  #deliveranceTableBody tr td.row-idx-cell::before {
    content: "超度對象 #" !important;
    font-size: 12px !important;
    color: #78716c !important;
    font-weight: 700 !important;
  }
  #blessingTableBody tr td.cell-actions,
  #deliveranceTableBody tr td.cell-actions {
    position: absolute !important;
    top: 8px !important;
    right: 10px !important;
    width: auto !important;
  }
  #blessingTableBody tr td.cell-actions button,
  #deliveranceTableBody tr td.cell-actions button {
    width: 26px !important;
    height: 26px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 9999px !important;
    background: #fee2e2 !important;
    color: #b91c1c !important;
    font-size: 12px !important;
    font-weight: bold !important;
  }
  #blessingTableBody tr td.cell-name::before {
    content: "姓名 (Name) *";
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #44403c;
    margin-bottom: 2px;
  }
  #blessingTableBody tr td.cell-birth::before {
    content: "生日 (Birth Date)";
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #44403c;
    margin-bottom: 2px;
  }
  #blessingTableBody tr td.cell-address::before {
    content: "地址 (Address)";
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #44403c;
    margin-bottom: 2px;
  }
  #blessingTableBody tr td.cell-wish::before {
    content: "祈願 (Wishes)";
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #44403c;
    margin-bottom: 2px;
  }
  #deliveranceTableBody tr td.cell-ancestor::before {
    content: "祖先·亡靈·冤親債主 (Deceased Name) *";
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #44403c;
    margin-bottom: 2px;
  }
  #deliveranceTableBody tr td.cell-tablet::before {
    content: "地址 / 附薦處 (Address / Tablet place)";
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #44403c;
    margin-bottom: 2px;
  }
  #deliveranceTableBody tr td.cell-wish::before {
    content: "祈願 (Wishes)";
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #44403c;
    margin-bottom: 2px;
  }

  /* [INVARIANT: KAT-PUJA-SITE-LANG] Chinese single-language card field headers (mobile cards only) */
  html[data-site-lang="zh"] #blessingTableBody tr td.cell-name::before,
  html[data-language-mode="zh"] #blessingTableBody tr td.cell-name::before,
  html[lang="zh-Hant"] #blessingTableBody tr td.cell-name::before,
  html[lang="zh-TW"] #blessingTableBody tr td.cell-name::before,
  html[lang="zh"] #blessingTableBody tr td.cell-name::before {
    content: "姓名 *" !important;
  }
  html[data-site-lang="zh"] #blessingTableBody tr td.cell-birth::before,
  html[data-language-mode="zh"] #blessingTableBody tr td.cell-birth::before,
  html[lang="zh-Hant"] #blessingTableBody tr td.cell-birth::before,
  html[lang="zh-TW"] #blessingTableBody tr td.cell-birth::before,
  html[lang="zh"] #blessingTableBody tr td.cell-birth::before {
    content: "生日" !important;
  }
  html[data-site-lang="zh"] #blessingTableBody tr td.cell-address::before,
  html[data-language-mode="zh"] #blessingTableBody tr td.cell-address::before,
  html[lang="zh-Hant"] #blessingTableBody tr td.cell-address::before,
  html[lang="zh-TW"] #blessingTableBody tr td.cell-address::before,
  html[lang="zh"] #blessingTableBody tr td.cell-address::before {
    content: "地址" !important;
  }
  html[data-site-lang="zh"] #blessingTableBody tr td.cell-wish::before,
  html[data-language-mode="zh"] #blessingTableBody tr td.cell-wish::before,
  html[lang="zh-Hant"] #blessingTableBody tr td.cell-wish::before,
  html[lang="zh-TW"] #blessingTableBody tr td.cell-wish::before,
  html[lang="zh"] #blessingTableBody tr td.cell-wish::before {
    content: "祈願" !important;
  }
  html[data-site-lang="zh"] #deliveranceTableBody tr td.cell-ancestor::before,
  html[data-language-mode="zh"] #deliveranceTableBody tr td.cell-ancestor::before,
  html[lang="zh-Hant"] #deliveranceTableBody tr td.cell-ancestor::before,
  html[lang="zh-TW"] #deliveranceTableBody tr td.cell-ancestor::before,
  html[lang="zh"] #deliveranceTableBody tr td.cell-ancestor::before {
    content: "祖先·亡靈·冤親債主 *" !important;
  }
  html[data-site-lang="zh"] #deliveranceTableBody tr td.cell-tablet::before,
  html[data-language-mode="zh"] #deliveranceTableBody tr td.cell-tablet::before,
  html[lang="zh-Hant"] #deliveranceTableBody tr td.cell-tablet::before,
  html[lang="zh-TW"] #deliveranceTableBody tr td.cell-tablet::before,
  html[lang="zh"] #deliveranceTableBody tr td.cell-tablet::before {
    content: "地址 / 附薦處" !important;
  }
  html[data-site-lang="zh"] #deliveranceTableBody tr td.cell-wish::before,
  html[data-language-mode="zh"] #deliveranceTableBody tr td.cell-wish::before,
  html[lang="zh-Hant"] #deliveranceTableBody tr td.cell-wish::before,
  html[lang="zh-TW"] #deliveranceTableBody tr td.cell-wish::before,
  html[lang="zh"] #deliveranceTableBody tr td.cell-wish::before {
    content: "祈願" !important;
  }

  /* English single-language card field headers (mobile cards only) */
  html[data-site-lang="en"] #blessingTableBody tr td.cell-name::before,
  html[data-language-mode="en"] #blessingTableBody tr td.cell-name::before,
  html[lang="en"] #blessingTableBody tr td.cell-name::before {
    content: "Name *" !important;
  }
  html[data-site-lang="en"] #blessingTableBody tr td.cell-birth::before,
  html[data-language-mode="en"] #blessingTableBody tr td.cell-birth::before,
  html[lang="en"] #blessingTableBody tr td.cell-birth::before {
    content: "Birth Date" !important;
  }
  html[data-site-lang="en"] #blessingTableBody tr td.cell-address::before,
  html[data-language-mode="en"] #blessingTableBody tr td.cell-address::before,
  html[lang="en"] #blessingTableBody tr td.cell-address::before {
    content: "Address" !important;
  }
  html[data-site-lang="en"] #blessingTableBody tr td.cell-wish::before,
  html[data-language-mode="en"] #blessingTableBody tr td.cell-wish::before,
  html[lang="en"] #blessingTableBody tr td.cell-wish::before {
    content: "Wishes" !important;
  }
  html[data-site-lang="en"] #deliveranceTableBody tr td.cell-ancestor::before,
  html[data-language-mode="en"] #deliveranceTableBody tr td.cell-ancestor::before,
  html[lang="en"] #deliveranceTableBody tr td.cell-ancestor::before {
    content: "Deceased Name *" !important;
  }
  html[data-site-lang="en"] #deliveranceTableBody tr td.cell-tablet::before,
  html[data-language-mode="en"] #deliveranceTableBody tr td.cell-tablet::before,
  html[lang="en"] #deliveranceTableBody tr td.cell-tablet::before {
    content: "Address / Tablet place" !important;
  }
  html[data-site-lang="en"] #deliveranceTableBody tr td.cell-wish::before,
  html[data-language-mode="en"] #deliveranceTableBody tr td.cell-wish::before,
  html[lang="en"] #deliveranceTableBody tr td.cell-wish::before {
    content: "Wishes" !important;
  }
  #blessingTableBody tr input,
  #deliveranceTableBody tr input {
    height: 40px !important;
    padding: 6px 10px !important;
    border-radius: 8px !important;
    font-size: 15px !important;
  }

  /* Supplies Product Cards */
  .overflow-x-auto:has(#suppliesReplicaTableBody) {
    overflow-x: visible !important;
    border: none !important;
    background: transparent !important;
  }
  .overflow-x-auto:has(#suppliesReplicaTableBody) table {
    display: block !important;
    width: 100% !important;
  }
  .overflow-x-auto:has(#suppliesReplicaTableBody) thead,
  .overflow-x-auto:has(#suppliesReplicaTableBody) tfoot {
    display: none !important;
  }
  #suppliesReplicaTableBody {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    background: transparent !important;
  }
  #suppliesReplicaTableBody tr {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    background: #ffffff !important;
    border: 1.5px solid #e7e5e4 !important;
    border-radius: 12px !important;
    padding: 8px 10px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    gap: 6px !important;
  }
  #suppliesReplicaTableBody tr.bg-amber-50\/70,
  #suppliesReplicaTableBody tr[class*="bg-amber-50"] {
    border-color: #f59e0b !important;
    background: #fffbeb !important;
  }
  #suppliesReplicaTableBody tr td:nth-child(1) {
    display: none !important;
  }
  #suppliesReplicaTableBody tr td:nth-child(2) {
    flex: 1 1 100% !important;
    padding: 0 !important;
  }
  #suppliesReplicaTableBody tr td:nth-child(3) {
    flex: 0 0 auto !important;
    padding: 0 !important;
    text-align: left !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #991b1b !important;
  }
  #suppliesReplicaTableBody tr td:nth-child(4) {
    flex: 0 0 auto !important;
    padding: 0 !important;
  }
  #suppliesReplicaTableBody tr td:nth-child(5) {
    display: none !important;
  }
  #suppliesReplicaTableBody button[onclick^="changeSupplyQty"] {
    min-width: 36px !important;
    min-height: 36px !important;
    font-size: 16px !important;
    font-weight: bold !important;
    border-radius: 8px !important;
  }
  #suppliesReplicaTableBody input[id^="supplyQty_"] {
    width: 36px !important;
    height: 36px !important;
    font-size: 15px !important;
  }
}

/* [INVARIANT: KAT-PUJA-NO-REPEATED-ROW-TITLES / KAT-UI-CLEAN-003]
 * Desktop & tablet tables (>= 641px) already possess authoritative <thead> column headers.
 * Cell pseudo-element titles (::before) are strictly disabled on desktop to eliminate duplicated row headers.
 */
@media (min-width: 641px) {
  #blessingTableBody tr td::before,
  #deliveranceTableBody tr td::before,
  #suppliesReplicaTableBody tr td::before,
  table tr td.cell-name::before,
  table tr td.cell-birth::before,
  table tr td.cell-address::before,
  table tr td.cell-wish::before,
  table tr td.cell-ancestor::before,
  table tr td.cell-tablet::before,
  table tr td.row-idx-cell::before {
    display: none !important;
    content: none !important;
  }
}

/* [INVARIANT: KAT-PUJA-SITE-LANG] Stepper & Content single-language clean display */
html[data-site-lang="zh"] .stepper-en,
html[data-site-lang="zh"] .lang-en,
html[data-language-mode="zh"] .stepper-en,
html[data-language-mode="zh"] .lang-en,
html[lang="zh-Hant"] .stepper-en,
html[lang="zh-Hant"] .lang-en,
html[lang="zh-TW"] .stepper-en,
html[lang="zh-TW"] .lang-en,
html[lang|="zh"] .stepper-en,
html[lang|="zh"] .lang-en,
html[lang^="zh"] .stepper-en,
html[data-site-lang="zh"] .stepper-en,
html[data-site-lang="zh"] .lang-en,
html[data-language-mode="zh"] .stepper-en,
html[data-language-mode="zh"] .lang-en,
html[lang|="zh"] .stepper-en,
html[lang|="zh"] .lang-en,
html[lang^="zh"] .stepper-en,
html[lang^="zh"] .lang-en,
html[lang="zh"] .stepper-en,
html[lang="zh"] .lang-en {
  display: none !important;
}
html[data-site-lang="en"] .stepper-zh,
html[data-site-lang="en"] .lang-zh,
html[data-language-mode="en"] .stepper-zh,
html[data-language-mode="en"] .lang-zh,
html[lang|="en"] .stepper-zh,
html[lang|="en"] .lang-zh,
html[lang^="en"] .stepper-zh,
html[lang^="en"] .lang-zh,
html[lang="en"] .stepper-zh,
html[lang="en"] .lang-zh {
  display: none !important;
}

/* [INVARIANT: KAT-PUJA-SITE-LANG] Printed sheets, live preview modal, and no-localize blocks remain 100% bilingual */
#previewModal .lang-en,
#previewModal .lang-zh,
.a4-sheet .lang-en,
.a4-sheet .lang-zh,
[data-no-localize] .lang-en,
[data-no-localize] .lang-zh {
  display: revert !important;
}

/* [INVARIANT: KAT-PUJA-MOBILE-RESPONSIVE] Small phone touch target polish */
@media (max-width: 480px) {
  #suppliesStickyBottomBar {
    padding: 8px 10px !important;
    gap: 8px !important;
  }
  #suppliesStickyBottomBar button {
    padding: 8px 12px !important;
    font-size: 12px !important;
  }
  #stickyBarTotalDisplay {
    font-size: 15px !important;
  }
  #birthdayExtraItemsGrid button,
  #birthdayPacksGrid button[onclick*="adjust"] {
    min-width: 32px !important;
    min-height: 32px !important;
    font-size: 14px !important;
  }
}

/* [INVARIANT: KAT-UI-CLEAN-002] Completely hide top-right status pill and wrapper */
#topStatusPill, #topStatusPillWrap {
  display: none !important;
}

