/* Wai Phra — reference-aligned visual system, layered over functional v2 CSS.
   IMPORTANT: changes live here; app.js, temple.js, merit.js remain the data/player source of truth.
   Light from visual references; night color tokens preserved from functional site. */
:root {
  --wp-font: "Bai Jamjuree", "Noto Sans Thai", "Sarabun", sans-serif;
  --parchment: #fff6e6; --surface: #fffaf2; --ink: #5f4330;
  --sage: #8d7660; --border: #ecd7bb; --saffron: #ef7e25;
  --gold: #dba354; --plum: #694c36; --wide-bg: #fff3df;
  --wp-bg: #fff6e6; --wp-surface: #fffaf2; --wp-text: #5f4330;
  --wp-muted: #907963; --wp-line: #ecd7bb; --wp-accent: #ef7e25;
  --wp-accent-dark: #d86518; --wp-gold: #dba354;
  --radius-xs: 12px; --radius-sm: 16px; --radius-md: 20px;
  --radius-lg: 28px; --radius-pill: 999px;
  --wp-shadow: 0 10px 28px rgba(119,77,31,.095),0 2px 6px rgba(119,77,31,.045);
  --wp-shadow-soft: 0 3px 11px rgba(119,77,31,.08);
  --shadow-sm: var(--wp-shadow-soft); --shadow-md: var(--wp-shadow);
  --shadow-warm: 0 10px 28px rgba(172,86,18,.18);
}
body.night {
  /* EXACT palette of functional app's night mode. */
  --parchment:#1A1208; --surface:#231A0E; --ink:#D4B483;
  --sage:#B0996E; --border:rgba(212,180,131,.16);
  --gold:#c2a169; --wide-bg:#120C05; --saffron:#E8A855;
  --wp-bg:#1A1208; --wp-surface:#231A0E; --wp-text:#D4B483;
  --wp-muted:#B0996E; --wp-line:rgba(212,180,131,.20);
  --wp-accent:#d98940; --wp-accent-dark:#b66d29;
  --wp-gold:#c2a169; --wp-shadow:0 14px 34px rgba(0,0,0,.26);
  --wp-shadow-soft:0 4px 14px rgba(0,0,0,.2);
  --hl-bg: rgba(232,168,85,.18); --hl-text:#E8A855;
  background:#1A1208 !important;
}
body {background-color: var(--parchment) !important; background-image: radial-gradient(ellipse at 15% 12%,rgba(255,255,255,.85),transparent 52%), radial-gradient(ellipse at 94% 53%,rgba(239,170,81,.05),transparent 60%) !important; color:var(--ink) !important;}
body.night {background-image: radial-gradient(ellipse at 12% 8%,rgba(123,76,24,.13),transparent 52%), radial-gradient(ellipse at 97% 60%,rgba(206,122,83,.035),transparent 50%) !important;}
svg {stroke:currentColor; fill:none; stroke-width:1.65; stroke-linecap:round; stroke-linejoin:round;}
button, input, textarea, select {font-family:var(--wp-font) !important;}
button {transition:background-color .16s,border-color .16s,box-shadow .16s,transform .16s,color .16s;}
button:where(:hover):not(:disabled){filter:brightness(1.015)}
button:focus-visible, [role="button"]:focus-visible, input:focus-visible {outline:3px solid color-mix(in srgb,var(--saffron) 55%,transparent) !important;outline-offset:3px;}
::selection {background:rgba(239,126,37,.22)}
/* Two-story global header, shared by every page. */
.app-header, body.night .app-header {
  position:sticky !important; top:0 !important; width:100% !important; max-width:none !important;
  min-height:0 !important; padding:20px max(24px,calc((100vw - 1150px)/2)) 0 !important;
  display:grid !important; grid-template-columns: minmax(0,1fr) 62px !important;
  grid-template-rows: 108px 75px !important; column-gap:12px !important; row-gap:0 !important;
  align-items:center !important;
  background-color:var(--parchment) !important;
  background-image:url('assets/waves.svg') !important; background-repeat:no-repeat !important;
  background-size:360px auto !important; background-position:right top !important;
  border-bottom:0 !important; box-shadow:none !important;
  z-index:1100 !important;
}
body.night .app-header {background-image:linear-gradient(rgba(26,18,8,.83),rgba(26,18,8,.86)),url('assets/waves.svg') !important;}
.app-header::after{content:"";height:1px;position:absolute;bottom:0;left:max(24px,calc((100vw - 1150px)/2));right:max(24px,calc((100vw - 1150px)/2));background:var(--border);}
.app-header .brand-button,
.app-header .brand-button:hover {grid-column:1 !important;grid-row:1 !important;justify-self:start !important;display:flex !important;align-items:center !important;gap:14px !important;
  min-height:90px !important;padding:0 !important;border:0 !important;background:none !important;
  color:var(--ink) !important;font-size:initial !important;text-shadow:none !important;border-radius:0 !important;
}
.app-header .brand-mark{width:90px !important;height:95px !important;object-fit:contain !important;flex-shrink:0 !important;filter:none !important;}
.brand-wordmark{display:flex;flex-direction:column;align-items:stretch;gap:1px;line-height:1.1;}
.brand-wordmark strong{color:var(--ink);font-size:clamp(30px,3.15vw,43px);font-weight:700;letter-spacing:-.06em;}
.brand-wordmark small{display:grid;grid-template-columns:1fr 20px 1fr;column-gap:7px;align-items:center;max-width:190px;text-align:center;color:var(--saffron);font-weight:500;}
.brand-wordmark small i{height:1px;background:var(--saffron);opacity:.8;}
.brand-wordmark small .brand-lotus{width:20px;height:20px;stroke:var(--saffron);stroke-width:1.6;}
.brand-wordmark small span{grid-column:1/-1;font-size:13px;letter-spacing:.31em;white-space:nowrap;}
.app-header .primary-tabs{grid-column:1/-1 !important;grid-row:2 !important;width:100% !important;max-width:none !important;
  align-self:stretch !important;justify-self:stretch !important;display:grid !important;grid-template-columns:repeat(4,minmax(0,1fr)) !important;
  gap:0 !important;padding:0 !important;margin:0 !important;background:transparent !important;border:0 !important;
  box-shadow:none !important;overflow:visible !important;
}
.app-header .primary-tab, .app-header .primary-tab:focus, .app-header .primary-tab:hover, .app-header .primary-tab.active {
  display:flex !important;flex-direction:row !important;align-items:center !important;justify-content:center !important;gap:12px !important;
  padding:10px 8px 13px !important;min-height:74px !important;min-width:0 !important;width:100% !important;
  flex:initial !important;border:0 !important;border-bottom:4px solid transparent !important;
  border-radius:0 !important;background:none !important;box-shadow:none !important;
  color:var(--ink) !important;font-weight:500 !important;font-size:clamp(17px,1.6vw,21px) !important;
}
.app-header .primary-tab:not(:last-child)::after{content:"";width:1px;height:26px;background:var(--border);position:absolute;right:0;top:calc(50% - 15px)}
.app-header .primary-tab{position:relative !important;}
.app-header .primary-tab .nav-ico{width:31px;height:31px;stroke-width:1.45;flex:0 0 auto;}
.app-header .primary-tab.active,.app-header .primary-tab.active:hover{color:var(--saffron) !important;border-bottom-color:var(--saffron) !important;font-weight:700 !important;}
.app-header .icon-btn,.app-header .icon-btn:hover{grid-column:2 !important;grid-row:1 !important;align-self:start !important;justify-self:end !important;
  margin-top:14px !important;display:grid !important;place-items:center !important;
  width:57px !important;height:57px !important;min-width:57px !important;padding:0 !important;
  background:#60452e !important;color:#fff1dd !important;border:1px solid #8a6645 !important;
  border-radius:50% !important;box-shadow:0 4px 12px rgba(70,43,17,.14) !important;font-size:0 !important;}
.app-header .icon-btn svg{width:26px;height:26px;stroke-width:1.8;}
body.night .app-header .icon-btn{background:#e6b46c !important;color:#23170b !important;border-color:#edc28a !important;}
/* Page space and ornamental backdrop */
main{width:100%;}
.tab-panel{width:100%;}
.tab-panel > :not(.home-hero):not(.page-intro), .setup-body, .complete-body, .pray-body,
#td-root, #md-root {max-width:1050px !important;margin-left:auto !important;margin-right:auto !important;}
.home-hero-new, .page-intro{
  position:relative;max-width:1050px !important;margin:0 auto !important;
  min-height:220px !important;padding:46px 32px 30px !important;background:transparent !important;
}
.page-intro::after,.home-hero-new::after{content:"";width:170px;height:160px;position:absolute;right:24px;top:42px;pointer-events:none;
 background:url('assets/lotus-watermark.svg') center/contain no-repeat;opacity:.55;}
body.night .page-intro::after,body.night .home-hero-new::after{opacity:.17;}
.eyebrow{display:block !important;color:var(--saffron) !important;letter-spacing:.14em !important;font-size:13px !important;font-weight:700 !important;margin-bottom:14px !important;}
.home-hero-new h1,.page-intro h1{font-size:clamp(30px,3.2vw,43px) !important;color:var(--ink) !important;letter-spacing:-.045em !important;line-height:1.3 !important;font-weight:700 !important;max-width:790px !important;position:relative;z-index:1;}
.home-hero-new p,.page-intro p{font-size:clamp(16px,1.8vw,21px) !important;line-height:1.8 !important;font-weight:400 !important;max-width:720px !important;color:var(--sage) !important;margin-top:8px !important;position:relative;z-index:1;}
.home-greeting{display:flex;align-items:center;gap:20px;color:var(--ink) !important;font-size:clamp(26px,2.8vw,37px) !important;font-weight:700 !important;line-height:1.25;margin-bottom:5px;}
.greeting-icon{width:70px;height:70px;color:var(--saffron);stroke-width:1.55;flex-shrink:0;}
#tab-home .home-hero-new h1,#tab-home .home-hero-new p{margin-left:90px !important;}
.home-hero-new{padding-top:52px !important;min-height:245px !important;}
#home-featured-slot,#home-continue-slot,.home-simple-actions{max-width:1050px !important;}
.home-featured,.home-continue-card,.home-main-action,.home-links-row button,.coll-card,.msc,.temple-card,.merit-card,
.md-section,.td-section,.md-summary-card{border:1px solid var(--border) !important;border-radius:22px !important;background:var(--surface) !important;
  box-shadow:var(--wp-shadow) !important;color:var(--ink) !important;}
/* hero: image on left, text on right, saffron CTA within card */
.home-featured{margin:0 28px 18px !important;position:relative;padding:30px 38px 28px !important;min-height:280px !important;overflow:hidden;cursor:pointer;}
.home-featured::before{content:"";position:absolute;left:-50px;bottom:-75px;width:240px;height:200px;border-radius:50%;background:radial-gradient(ellipse,rgba(240,170,88,.17),transparent 70%);pointer-events:none;}
.home-featured-eyebrow{position:absolute;top:0;left:0;background:linear-gradient(95deg,#ffe2bd,#ffeed5);color:#ab5217 !important;font-size:14px !important;font-weight:600 !important;
 border-radius:0 0 18px 0;padding:12px 22px !important;letter-spacing:0 !important;}
body.night .home-featured-eyebrow{background:#473019;color:#e8b982 !important;}
.home-featured-body{display:grid !important;grid-template-columns:235px minmax(0,1fr) !important;gap:25px !important;align-items:center !important;padding:46px 10px 10px !important;}
.home-featured-icon{display:grid !important;place-items:center !important;align-self:center;font-size:0 !important;width:195px;height:190px !important;filter:none !important;}
.home-featured-icon img{width:100%;height:100%;object-fit:contain;}
.home-featured-name{font-size:clamp(27px,3vw,35px) !important;font-weight:700 !important;color:var(--ink) !important;line-height:1.3;}
.home-featured-meta{color:var(--sage) !important;font-size:17px !important;line-height:1.65;margin-top:9px;}
.home-featured-cta{display:inline-flex !important;align-items:center;justify-content:center;min-height:55px;min-width:220px;margin-top:18px !important;
 background:linear-gradient(100deg,#f58225,#eb721e) !important;color:white !important;border-radius:14px !important;
 font-weight:700 !important;font-size:19px !important;box-shadow:none !important;text-align:center;}
body.night .home-featured-cta{background:linear-gradient(100deg,#c77b36,#a75822) !important;}
.home-continue-card{display:grid !important;grid-template-columns:90px minmax(0,1fr) !important;gap:20px !important;
 margin:0 28px 16px !important;min-height:127px !important;padding:20px 26px !important;align-items:center;cursor:pointer;}
.home-continue-icon{display:grid !important;place-items:center !important;width:78px;height:78px;min-width:78px;background:rgba(159,167,116,.18);border-radius:50%;font-size:0 !important;color:#858e5d;}
.home-continue-icon svg{width:39px;height:39px;}
.home-continue-title{color:var(--ink) !important;font-size:20px !important;font-weight:700;}
.home-continue-sub{color:var(--sage) !important;font-size:15px !important;line-height:1.5;}
.home-simple-actions{padding:0 28px 26px !important;}
.home-main-action{display:grid !important;grid-template-columns:82px minmax(0,1fr) 24px !important;align-items:center !important;gap:20px !important;
 min-height:125px !important;padding:22px 28px !important;text-align:left !important;cursor:pointer;}
.home-main-icon{display:grid !important;place-items:center !important;width:75px;height:75px;background:#fff0d5;border-radius:50%;color:var(--saffron);font-size:0 !important;}
body.night .home-main-icon{background:#4b321b;}
.home-main-icon svg{width:38px;height:38px;}
.home-main-action b{color:var(--ink) !important;font-size:23px !important;font-weight:700 !important;}
.home-main-action small{display:block;color:var(--sage) !important;font-size:16px !important;margin-top:4px;}
.home-main-action i{font-size:38px;color:var(--sage);font-style:normal;}
.home-links-row{display:grid !important;grid-template-columns:1fr 1fr !important;gap:16px !important;margin-top:16px !important;}
.home-links-row button{display:flex !important;align-items:center;gap:16px;min-height:106px !important;padding:20px !important;text-align:left !important;font-size:18px !important;}
.home-links-row button > svg:first-child{width:58px;height:58px;padding:11px;border-radius:50%;color:var(--saffron);background:#fff0d5;flex-shrink:0;}
body.night .home-links-row button > svg:first-child{background:#4b321b;}
.home-links-row button strong{display:block;font-size:20px;color:var(--ink);font-weight:700;}
.home-links-row button small{display:block;font-size:14px;font-weight:400;color:var(--sage);}
.home-links-row button .action-chevron{margin-left:auto;width:22px;height:22px;color:var(--sage);flex-shrink:0;}
/* Collections, prayer row modules */
.sub-tabs{display:flex !important;max-width:985px !important;margin:12px auto 20px !important;border:1px solid var(--border) !important;
 background:linear-gradient(110deg,rgba(241,186,118,.16),rgba(235,167,96,.07)) !important;border-radius:999px !important;padding:6px !important;height:auto !important;}
.sub-tab,.sub-tab.active{flex:1 !important;border:0 !important;border-radius:999px !important;min-height:53px !important;font-size:19px !important;background:transparent !important;color:var(--ink) !important;box-shadow:none !important;}
.sub-tab.active{background:var(--surface) !important;color:var(--saffron) !important;box-shadow:var(--wp-shadow-soft) !important;font-weight:700 !important;}
.collections-list,.temples-list,.merit-list,.mantra-list{padding:4px 28px 120px !important;display:flex;flex-direction:column;gap:14px !important;}
.coll-card{overflow:hidden !important;cursor:pointer;}
.coll-card.queued{border-color:var(--saffron) !important;background:color-mix(in srgb,var(--surface) 90%,var(--saffron)) !important;}
.coll-header{display:grid !important;grid-template-columns:28px 140px minmax(0,1fr) !important;gap:20px !important;padding:24px 28px !important;align-items:center !important;min-height:180px !important;}
.coll-check{width:26px !important;height:26px !important;border-radius:50% !important;color:white !important;}
.coll-icon{display:flex !important;align-items:center !important;justify-content:center !important;width:130px !important;height:130px !important;flex:initial !important;border-radius:28px !important;
  background:radial-gradient(circle at 40% 25%,#ffedd0,#f7d5a5) !important;color:transparent !important;font-size:0 !important;position:relative;}
.coll-icon::after{content:"";position:absolute;width:82%;height:82%;background:url('assets/wai-phra-mark.png') center/contain no-repeat;}
body.night .coll-icon{background:radial-gradient(circle at 40% 25%,#594027,#332215) !important;}
.coll-name{font-size:clamp(23px,2.6vw,30px) !important;font-weight:700 !important;color:var(--ink) !important;}
.coll-desc{font-size:17px !important;color:var(--sage) !important;line-height:1.65 !important;max-width:610px;margin-top:7px !important;}
.coll-fav-btn{font-family:var(--wp-font) !important;color:var(--saffron) !important;min-height:45px;}
.search-wrap{display:flex !important;align-items:center !important;gap:15px !important;background:var(--surface) !important;
 border:1px solid var(--border) !important;border-radius:999px !important;
 box-shadow:var(--wp-shadow) !important;padding:8px 24px !important;margin:8px 28px 24px !important;min-height:77px !important;}
.search-icon{width:30px;height:30px;flex-shrink:0;color:var(--ink);stroke-width:1.8;}
.search-input{color:var(--ink) !important;font-size:clamp(16px,1.65vw,20px) !important;line-height:1.5 !important;min-width:0;}
.search-input::placeholder{color:var(--sage) !important;opacity:.9;}
.search-clear{background:none;border:0;color:var(--sage);cursor:pointer;min-width:35px;min-height:35px;}
.quick-picks{padding:2px 28px 14px !important;}
.quick-picks.compact{padding-top:0 !important;}
.section-label{color:var(--ink) !important;letter-spacing:0 !important;text-transform:none !important;font-size:16px !important;font-weight:600 !important;margin:6px 0 12px !important;}
.chips-row{flex-wrap:wrap !important;overflow:visible !important;gap:10px 12px !important;padding-bottom:4px !important;}
.chip{border:1px solid var(--border) !important;background:transparent !important;color:var(--ink) !important;
 min-height:49px !important;border-radius:999px !important;padding:10px 21px !important;font-size:16px !important;font-weight:500 !important;box-shadow:none !important;}
.chip.active{border-color:var(--saffron) !important;color:var(--saffron) !important;background:rgba(239,126,37,.09) !important;font-weight:700 !important;}
.mantra-list{padding-top:14px !important;}
.mantra-card{padding:20px 23px !important;background:var(--surface) !important;border:1px solid var(--border) !important;
 border-radius:19px !important;box-shadow:var(--wp-shadow-soft) !important;margin:0 !important;cursor:pointer;}
.mantra-card:before{display:none !important;}
.mantra-card.selected{border-color:var(--saffron) !important;background:color-mix(in srgb,var(--surface) 94%,var(--saffron)) !important;}
.card-row{align-items:center !important;gap:16px !important;}
.checkbox{width:26px !important;height:26px !important;border-radius:50% !important;}
.card-name{color:var(--ink) !important;font-size:20px !important;font-weight:700 !important;}
.card-deity{color:var(--sage) !important;font-size:15px !important;}
.card-tags{margin-top:12px !important;}
.tag,.temple-tag,.merit-tag{display:inline-block;color:var(--sage) !important;background:rgba(220,166,100,.12) !important;
 border:1px solid var(--border) !important;padding:5px 12px !important;border-radius:10px !important;font-size:13px !important;}
.fav-star{color:var(--saffron) !important;}
.selected-tray{border-top:1px solid var(--border) !important;background:var(--surface) !important;box-shadow:0 -5px 24px rgba(0,0,0,.09) !important;}
.tray-btn,.setup-big-start-btn,.complete-home-btn,.td-pray-all-btn{background:linear-gradient(110deg,#f58225,#ea731e) !important;
 border:0 !important;color:#fff !important;border-radius:15px !important;box-shadow:var(--shadow-warm) !important;font-weight:700 !important;}
body.night .tray-btn,body.night .setup-big-start-btn,body.night .complete-home-btn,body.night .td-pray-all-btn{background:linear-gradient(110deg,#c77b36,#a65e27) !important;}
/* Temple listing: image (if from DB) or decorative icon placeholder */
.temple-card{display:grid !important;grid-template-columns: 35% minmax(0,1fr) auto !important;gap:20px !important;align-items:center !important;
 padding:15px !important;min-height:205px !important;position:relative;overflow:hidden !important;}
.temple-card-example{opacity:.74;}
.temple-cover{width:100% !important;height:178px !important;border-radius:15px !important;object-fit:cover !important;grid-row:1;}
.temple-cover-placeholder{display:flex !important;flex-direction:column;justify-content:center;align-items:center;gap:8px;
 background:radial-gradient(circle at 45% 30%,#fff0d5,#f4dfbd) !important;color:#c08349 !important;}
.temple-cover-placeholder svg{width:74px;height:74px;stroke-width:1.1;}
.temple-cover-placeholder span{font-size:13px;color:#9b7c5a;}
body.night .temple-cover-placeholder{background:radial-gradient(circle at 45% 30%,#44301b,#281b10) !important;color:#cba46d !important;}
.temple-body{padding:4px 0 !important;min-width:0;}
.temple-name{font-size:24px !important;font-weight:700 !important;color:var(--ink) !important;line-height:1.35 !important;}
.temple-province{font-size:17px !important;color:var(--sage) !important;margin-top:4px !important;}
.temple-tags{display:flex;flex-wrap:wrap;gap:7px !important;margin-top:10px !important;}
.temple-actions{padding:10px 10px !important;}
.temple-detail-btn{border:0 !important;background:transparent !important;color:var(--saffron) !important;font-weight:700 !important;font-size:17px !important;white-space:nowrap;}
.temple-error-banner,.beginner-note,.empty-msg,.loading-state{border-radius:16px !important;color:var(--sage) !important;line-height:1.7 !important;}
/* Merit guides intentionally share temple/card treatment */
.merit-card{width:100%;display:grid !important;grid-template-columns: 170px minmax(0,1fr) !important;gap:30px !important;align-items:center !important;
 padding:14px 25px !important;min-height:192px !important;text-align:left !important;cursor:pointer;}
.merit-card-cover,.merit-card-placeholder{height:160px !important;width:170px !important;border-radius:24px !important;object-fit:cover !important;}
.merit-card-placeholder{display:flex;align-items:center;justify-content:center;background:radial-gradient(circle,#fff0d6,#f4d8a8) !important;color:#e28328 !important;}
.merit-card-placeholder svg{width:90px;height:90px;stroke-width:1.05;}
body.night .merit-card-placeholder{background:radial-gradient(circle,#54351a,#392515) !important;color:#cda369 !important;}
.merit-card-body{padding:0 !important;min-width:0;}
.merit-card-title{font-size:27px !important;font-weight:700 !important;color:var(--ink) !important;line-height:1.36 !important;}
.merit-card-desc{font-size:17px !important;line-height:1.6 !important;color:var(--sage) !important;margin-top:3px !important;}
.merit-tags{display:flex !important;flex-wrap:wrap !important;gap:7px !important;margin-top:13px !important;}
/* Setup flow: special heading / tactile controls / fixed action row */
.workflow-bar-minimal,.pray-nav{max-width:1050px;margin:0 auto !important;padding:14px 28px !important;
  min-height:65px !important;position:sticky !important;top:203px !important;
  background:color-mix(in srgb,var(--parchment) 91%,transparent) !important;backdrop-filter:blur(14px);
  border:0 !important;z-index:950 !important;}
.workflow-bar-minimal .workflow-back-icon{width:49px !important;height:49px !important;min-width:49px !important;border:1px solid var(--border) !important;
 border-radius:15px !important;background:var(--surface) !important;color:var(--ink) !important;font-size:26px !important;}
.setup-body{padding:8px 28px 140px !important;max-width:1050px !important;width:100%;overflow:visible !important;}
.workflow-heading{display:flex;align-items:center;gap:24px;margin:5px 0 28px;padding:8px 0;}
.workflow-heading > svg{width:78px;height:78px;color:var(--saffron);stroke-width:1.4;flex-shrink:0;}
.workflow-heading h1{font-size:clamp(30px,3vw,41px);font-weight:700;color:var(--ink);line-height:1.25;}
.workflow-heading p{font-size:16px;color:var(--sage);line-height:1.5;margin-top:5px;}
.setup-sec-label{font-size:20px !important;letter-spacing:0 !important;text-transform:none !important;font-weight:700 !important;color:var(--ink) !important;
 padding:0 0 12px !important;margin:20px 0 15px !important;border:0 !important;}
.msc{padding:25px !important;margin-bottom:13px !important;}
.msc-header{gap:16px !important;margin-bottom:14px !important;}
.msc-order{width:41px !important;height:41px !important;border-radius:50% !important;background:#ffedd5 !important;color:var(--saffron) !important;font-size:20px !important;border:1px solid var(--border) !important;}
body.night .msc-order{background:#44311d !important;}
.msc-name{font-size:22px !important;color:var(--ink) !important;font-weight:700 !important;line-height:1.5 !important;}
.msc-deity{font-size:15px !important;color:var(--sage) !important;}
.msc-audio-meta,.msc-default-rounds{font-size:14px !important;color:var(--sage) !important;}
.order-btns{gap:7px !important;}
.order-btn{width:43px !important;height:39px !important;background:var(--surface) !important;border:1px solid var(--border) !important;
 border-radius:12px !important;color:var(--ink) !important;}
.round-input-row{padding-top:16px !important;margin-top:7px !important;border-top:1px solid var(--border) !important;}
.round-input-row strong{font-size:17px !important;color:var(--ink) !important;}
.round-input-row small{color:var(--sage) !important;}
.round-number-input{background:var(--surface) !important;color:var(--ink) !important;border:1px solid var(--saffron) !important;border-radius:12px !important;}
.setup-font-row{gap:10px !important;}
.setup-font-btn,.speed-choice{border:1px solid var(--border) !important;background:var(--surface) !important;
 border-radius:15px !important;color:var(--ink) !important;box-shadow:none !important;}
.setup-font-btn.active,.speed-choice.active{color:var(--ink) !important;background:rgba(235,144,43,.13) !important;border:1px solid var(--saffron) !important;box-shadow:none !important;}
.speed-choice-grid{grid-template-columns:repeat(5,minmax(0,1fr)) !important;gap:10px !important;}
.speed-choice{min-height:76px !important;font-size:19px !important;}
.speed-choice small{display:block;color:var(--sage) !important;font-size:13px !important;}
.font-preview-box,.print-btn{background:var(--surface) !important;color:var(--ink) !important;border:1px solid var(--border) !important;border-radius:17px !important;}
.print-btn{font-size:17px !important;min-height:57px;}
.setup-sticky-start{position:sticky !important;bottom:0 !important;z-index:980;display:flex !important;align-items:center !important;gap:14px !important;
 background:color-mix(in srgb,var(--parchment) 93%,transparent) !important;backdrop-filter:blur(14px);
 border-top:1px solid var(--border) !important;margin:25px 0 0 !important;padding:14px 6px 16px !important;}
.setup-repeat-btn{background:var(--surface) !important;color:var(--ink) !important;border-color:var(--border) !important;border-radius:15px !important;}
.setup-big-start-btn{min-height:70px !important;font-size:22px !important;}
/* Player and completion screens */
.pray-nav{display:flex !important;max-width:1050px !important;gap:16px !important;width:100%;}
.pray-body{padding:32px 28px 230px !important;background:transparent !important;overflow:visible !important;max-width:900px !important;width:100%;}
.round-badge{padding:12px 20px !important;border-radius:999px !important;border:1px solid var(--border) !important;
 background:var(--surface) !important;color:var(--saffron) !important;font-size:16px !important;}
.pray-act-btn{min-height:46px;background:var(--surface) !important;color:var(--ink) !important;border:1px solid var(--border) !important;border-radius:13px !important;}
.mantra-text-block{color:var(--ink) !important;line-height:2.15 !important;font-weight:500 !important;}
.word.active{background:var(--hl-bg) !important;color:var(--hl-text) !important;border-radius:7px !important;}
.pray-footer-fixed{padding:12px max(14px,calc((100vw - 900px)/2)) 18px !important;gap:9px !important;background:var(--surface) !important;border-top:1px solid var(--border) !important;box-shadow:0 -7px 28px rgba(0,0,0,.08) !important;}
.pray-footer-main{gap:12px !important;}
.tp-side,.tp-skip{background:var(--parchment) !important;color:var(--ink) !important;border:1px solid var(--border) !important;border-radius:14px !important;}
.tp-center{background:linear-gradient(120deg,#f58225,#ed751e) !important;color:white !important;border:0 !important;border-radius:50% !important;
 min-width:65px;max-width:75px;height:65px !important;flex:0 0 65px !important;}
body.night .tp-center{background:linear-gradient(120deg,#c77b36,#ad6025) !important;}
.complete-body{max-width:800px !important;align-items:center;padding:60px 30px !important;}
.complete-lotus{width:170px !important;height:170px !important;object-fit:contain;margin-bottom:15px !important;}
.complete-title{font-size:52px !important;color:var(--saffron) !important;}
.complete-sub{font-size:20px !important;line-height:1.9 !important;color:var(--sage) !important;}
.complete-home-btn{min-height:55px;padding:12px 35px !important;}
/* Database-backed detail pages */
#td-root,#md-root{width:100% !important;padding:10px 28px 100px !important;}
.td-hero-img,.md-hero{border-radius:24px !important;}
.td-section,.md-section,.td-deity-card,.md-summary-card{border:1px solid var(--border) !important;background:var(--surface) !important;border-radius:20px !important;box-shadow:var(--wp-shadow-soft) !important;}
.td-title,.md-title,#td-root h1,#md-root h1{color:var(--ink) !important;}
#td-root h2,#md-root h2{color:var(--ink) !important;}
.td-pray-all-btn{padding:14px 24px !important;}
/* closing line on all pages (not the reading/player screen) */
.wp-closing{text-align:center;max-width:1050px;width:100%;margin:10px auto 0;padding:35px 20px 45px;color:var(--ink);position:relative;}
.wp-closing::before{content:"";height:1px;position:absolute;top:10px;left:18%;right:18%;background:linear-gradient(to right,transparent,var(--border),transparent);}
.wp-closing strong{font-size:23px;font-weight:600;}
.wp-closing .closing-flower{display:inline-block;vertical-align:middle;margin-right:12px;color:#db9550;}
.wp-closing .closing-flower svg{height:35px;width:35px;}
.wp-closing p{margin-top:6px;color:var(--sage);font-size:15px;line-height:1.6;}
/* Night mode maintains existing functional-site chocolate / old gold colors rather than prototype's dark gray. */
body.night .home-featured,body.night .home-continue-card,body.night .home-main-action,body.night .home-links-row button,
body.night .coll-card,body.night .merit-card,body.night .temple-card,body.night .msc,body.night .mantra-card,
body.night .search-wrap{background:#231A0E !important;color:#D4B483 !important;border-color:rgba(212,180,131,.20) !important;}
body.night .home-featured-icon img,body.night .brand-mark{filter:sepia(.22) saturate(.78) !important;}
body.night .tag,body.night .temple-tag,body.night .merit-tag{background:#342414 !important;color:#cab08c !important;}
@media (min-width:1000px){
  .app-header,.app-header body {padding-left:max(30px,calc((100vw - 1140px)/2)) !important;padding-right:max(30px,calc((100vw - 1140px)/2)) !important;}
}
@media (max-width:820px){
 .app-header,body.night .app-header{min-height:0 !important;grid-template-columns:minmax(0,1fr) 58px !important;grid-template-rows:91px 63px !important;
 padding:8px 20px 0 !important;gap:0 !important;background-size:240px auto !important;}
 .app-header::after{left:18px;right:18px;}
 .app-header .brand-mark{width:70px !important;height:75px !important;}
 .app-header .brand-button{gap:9px !important;min-height:75px !important;}
 .brand-wordmark strong{font-size:34px;}
 .brand-wordmark small span{font-size:10px;}
 .app-header .icon-btn{margin-top:9px !important;height:48px !important;width:48px !important;min-width:48px !important;}
 .app-header .icon-btn svg{width:23px;height:23px;}
 .app-header .primary-tabs{grid-column:1/-1 !important;grid-row:2 !important;width:100% !important;margin:0 !important;grid-template-columns:repeat(4,1fr) !important;}
 .app-header .primary-tab,.app-header .primary-tab:focus,.app-header .primary-tab:hover,.app-header .primary-tab.active{min-height:63px !important;
  flex-direction:column !important;gap:2px !important;padding:4px 2px 8px !important;font-size:15px !important;}
 .app-header .primary-tab .nav-ico{width:27px;height:27px;}
 .app-header .primary-tab:not(:last-child)::after{height:22px;top:calc(50% - 12px);}
 .home-hero-new,.page-intro{min-height:0 !important;padding:28px 23px 25px !important;}
 .home-hero-new{padding-top:36px !important;}
 .home-hero-new h1,.page-intro h1{font-size:clamp(27px,5vw,37px) !important;}
 .home-hero-new p,.page-intro p{font-size:17px !important;}
 .page-intro::after,.home-hero-new::after{width:145px;height:135px;right:6px;top:42px;opacity:.33;}
 .home-greeting{font-size:30px !important;gap:13px;}
 .greeting-icon{width:55px;height:55px;}
 #tab-home .home-hero-new h1,#tab-home .home-hero-new p{margin-left:68px !important;}
 .home-featured{margin:3px 18px 15px !important;padding:20px !important;min-height:0 !important;}
 .home-featured-body{grid-template-columns:160px 1fr !important;gap:12px !important;padding:43px 0 2px !important;}
 .home-featured-icon{width:155px;height:145px !important;}
 .home-featured-name{font-size:28px !important;}
 .home-featured-meta{font-size:15px !important;}
 .home-featured-cta{min-height:49px;min-width:0;padding:8px 24px !important;font-size:16px !important;}
 .home-continue-card{margin:0 18px 15px !important;}
 .home-simple-actions{padding:0 18px 20px !important;}
 .home-main-action{min-height:110px !important;padding:16px !important;}
 .home-links-row{gap:12px !important;}
 .home-links-row button{min-height:93px !important;padding:13px !important;gap:9px;}
 .home-links-row button > svg:first-child{width:46px;height:46px;padding:8px;}
 .home-links-row button strong{font-size:18px;}
 .home-links-row button small{font-size:12px;}
 .home-links-row button .action-chevron{display:none;}
 .sub-tabs{margin:8px 18px 18px !important;}
 .search-wrap{margin:8px 18px 18px !important;min-height:67px !important;}
 .collections-list,.temples-list,.merit-list,.mantra-list{padding-left:18px !important;padding-right:18px !important;}
 .quick-picks{padding-left:18px !important;padding-right:18px !important;}
 .coll-header{grid-template-columns:24px 110px minmax(0,1fr) !important;gap:14px !important;min-height:155px !important;padding:18px !important;}
 .coll-icon{width:106px !important;height:106px !important;}
 .coll-name{font-size:23px !important;}
 .coll-desc{font-size:15px !important;}
 .temple-card{grid-template-columns:35% minmax(0,1fr) !important;gap:14px !important;}
 .temple-cover{height:145px !important;}
 .temple-actions{grid-column:2;justify-self:start;padding:0 !important;}
 .merit-card{grid-template-columns:145px minmax(0,1fr) !important;min-height:160px !important;gap:16px !important;}
 .merit-card-cover,.merit-card-placeholder{width:135px !important;height:133px !important;}
 .merit-card-title{font-size:22px !important;}
 .merit-card-desc{font-size:15px !important;}
 .workflow-bar-minimal,.pray-nav{top:162px !important;padding:9px 18px !important;}
 .setup-body{padding:10px 18px 100px !important;}
 .setup-sec-label{font-size:18px !important;}
 .workflow-heading{gap:15px;}
 .workflow-heading h1{font-size:30px;}
 .workflow-heading>svg{width:60px;height:60px;}
 .speed-choice-grid{grid-template-columns:repeat(3,1fr) !important;}
 #td-root,#md-root{padding:10px 18px 70px !important;}
}
@media (max-width:500px){
 .app-header,body.night .app-header{padding:7px 13px 0 !important;grid-template-columns:minmax(0,1fr) 48px !important;grid-template-rows:76px 59px !important;}
 .app-header .brand-mark{width:58px !important;height:60px !important;}
 .app-header .brand-button{gap:7px !important;min-height:65px !important;}
 .brand-wordmark strong{font-size:30px;}
 .brand-wordmark small{max-width:128px;grid-template-columns:1fr 15px 1fr;column-gap:5px;}
 .brand-wordmark small span{font-size:10px;}
 .brand-wordmark small .brand-lotus{width:15px;height:15px;}
 .app-header .icon-btn{width:44px !important;min-width:44px !important;height:44px !important;margin-top:8px !important;}
 .app-header .primary-tab,.app-header .primary-tab:focus,.app-header .primary-tab:hover,.app-header .primary-tab.active{font-size:13px !important;min-height:59px !important;}
 .app-header .primary-tab .nav-ico{width:25px;height:25px;}
 .home-hero-new,.page-intro{padding:25px 19px 22px !important;}
 .home-hero-new h1,.page-intro h1{font-size:29px !important;}
 .page-intro p,.home-hero-new p{font-size:16px !important;line-height:1.65 !important;}
 .home-greeting{font-size:25px !important;gap:10px;}
 .greeting-icon{width:45px;height:45px;}
 #tab-home .home-hero-new h1,#tab-home .home-hero-new p{margin-left:56px !important;}
 .home-featured{margin:0 13px 13px !important;padding:14px !important;border-radius:20px !important;}
 .home-featured-eyebrow{font-size:12px !important;padding:9px 15px !important;}
 .home-featured-body{grid-template-columns:105px minmax(0,1fr) !important;gap:10px !important;padding:40px 0 3px !important;}
 .home-featured-icon{width:105px;height:115px !important;}
 .home-featured-name{font-size:23px !important;}
 .home-featured-meta{font-size:13px !important;margin-top:4px;}
 .home-featured-cta{padding:8px 16px !important;font-size:14px !important;min-height:40px;margin-top:10px !important;}
 .home-continue-card{margin:0 13px 13px !important;min-height:99px !important;padding:14px !important;grid-template-columns:59px minmax(0,1fr) !important;gap:12px;}
 .home-continue-icon{width:57px;height:57px;min-width:57px;}
 .home-continue-icon svg{width:30px;height:30px;}
 .home-continue-title{font-size:17px !important;}
 .home-continue-sub{font-size:13px !important;}
 .home-simple-actions{padding:0 13px 20px !important;}
 .home-main-action{grid-template-columns:57px minmax(0,1fr) 18px !important;gap:10px !important;min-height:87px !important;padding:12px !important;}
 .home-main-icon{width:55px;height:55px;}
 .home-main-icon svg{width:30px;height:30px;}
 .home-main-action b{font-size:19px !important;}
 .home-main-action small{font-size:13px !important;}
 .home-main-action i{font-size:24px;}
 .home-links-row{gap:9px !important;margin-top:11px !important;}
 .home-links-row button{min-height:83px !important;padding:9px !important;gap:7px;}
 .home-links-row button > svg:first-child{width:37px;height:37px;padding:7px;}
 .home-links-row button strong{font-size:16px;}
 .home-links-row button small{font-size:11px;}
 .search-wrap{margin:6px 13px 16px !important;padding:4px 16px !important;gap:10px !important;min-height:62px !important;}
 .search-icon{width:25px;height:25px;}
 .search-input{font-size:14px !important;}
 .sub-tabs{margin:6px 13px 14px !important;}
 .sub-tab{font-size:16px !important;min-height:47px !important;}
 .quick-picks{padding-left:13px !important;padding-right:13px !important;}
 .chip{min-height:42px !important;padding:8px 13px !important;font-size:14px !important;}
 .collections-list,.temples-list,.merit-list,.mantra-list{padding-left:13px !important;padding-right:13px !important;gap:12px !important;}
 .coll-header{grid-template-columns:22px 81px minmax(0,1fr) !important;gap:9px !important;padding:12px !important;min-height:130px !important;}
 .coll-icon{width:80px !important;height:82px !important;border-radius:17px !important;}
 .coll-name{font-size:19px !important;}
 .coll-desc{font-size:13px !important;}
 .coll-card{border-radius:17px !important;}
 .temple-card{gap:10px !important;padding:10px !important;border-radius:16px !important;min-height:135px !important;}
 .temple-cover{height:120px !important;border-radius:12px !important;}
 .temple-cover-placeholder svg{width:50px;height:50px;}
 .temple-name{font-size:18px !important;}
 .temple-province{font-size:13px !important;}
 .temple-tags{gap:4px !important;margin-top:6px !important;}
 .temple-tag{padding:4px 7px !important;font-size:11px !important;}
 .temple-detail-btn{font-size:13px !important;}
 .merit-card{grid-template-columns:95px minmax(0,1fr) !important;padding:9px !important;gap:12px !important;min-height:122px !important;border-radius:16px !important;}
 .merit-card-cover,.merit-card-placeholder{width:92px !important;height:101px !important;border-radius:16px !important;}
 .merit-card-placeholder svg{width:55px;height:55px;}
 .merit-card-title{font-size:19px !important;}
 .merit-card-desc{font-size:13px !important;line-height:1.5 !important;}
 .merit-tags{margin-top:6px !important;gap:4px !important;}
 .merit-tag{font-size:11px !important;padding:3px 7px !important;}
 .mantra-card{padding:14px !important;}
 .card-name{font-size:17px !important;}
 .card-deity{font-size:13px !important;}
 .workflow-bar-minimal,.pray-nav{top:142px !important;padding:7px 13px !important;}
 .workflow-heading{gap:12px;margin-bottom:17px;}
 .workflow-heading>svg{width:53px;height:53px;}
 .workflow-heading h1{font-size:27px;}
 .workflow-heading p{font-size:13px;}
 .setup-body{padding:8px 13px 100px !important;}
 .msc{padding:14px !important;border-radius:17px !important;}
 .msc-header{gap:10px !important;}
 .msc-order{width:32px !important;height:32px !important;font-size:15px !important;}
 .msc-name{font-size:18px !important;}
 .order-btn{width:34px !important;height:34px !important;}
 .round-input-row{gap:10px !important;}
 .speed-choice-grid{grid-template-columns:repeat(3,1fr) !important;}
 .speed-choice:last-child{grid-column:auto !important;}
 .speed-choice{font-size:16px !important;min-height:64px !important;}
 .setup-font-btn{min-height:70px !important;}
 .setup-sticky-start{gap:8px !important;padding:8px 0 12px !important;}
 .setup-big-start-btn{min-height:63px !important;font-size:17px !important;}
 .setup-repeat-btn{min-width:65px !important;width:65px !important;}
 .pray-footer-main{gap:6px !important;}
 .tp-center{min-width:53px;max-width:53px;flex:0 0 53px !important;height:53px !important;}
 .tp-side,.tp-skip{min-height:49px !important;}
 .wp-closing strong{font-size:17px;}
 .wp-closing p{font-size:12px;}
 .wp-closing .closing-flower svg{width:26px;height:26px;}
}
@media (prefers-reduced-motion:reduce){*{animation-duration:0.01ms !important;transition-duration:0.01ms !important;scroll-behavior:auto !important;}}
@media print{.app-header,.wp-closing,.selected-tray,.pray-footer-fixed,.workflow-bar,.setup-sticky-start{display:none !important;}}
/* Hidden selection toolbar must not occupy visual or interaction space until a prayer is selected. */
.selected-tray.hidden{display:none !important;}
/* Consistent detail cards, including missing-image illustrations. */
#td-root .td-hero-img,#md-root .md-hero{height:clamp(210px,27vw,290px) !important;border-radius:22px !important;}
#td-root .td-hero-placeholder,#md-root .md-hero-placeholder{background:radial-gradient(circle at 45% 30%,#fff0d5,#f2d6ac) !important;color:#c1874c !important;font-size:0 !important;}
body.night #td-root .td-hero-placeholder,body.night #md-root .md-hero-placeholder{background:radial-gradient(circle at 40% 30%,#533922,#322215) !important;color:#d1a269 !important;}
.detail-hero-icon{height:120px;width:120px;stroke-width:1.1;}
#td-root .td-body{padding:24px 5px 80px !important;}
#td-root .td-name{font-size:clamp(25px,3vw,34px) !important;font-weight:700 !important;line-height:1.35;}
#td-root .td-info-row{font-size:15px !important;line-height:1.6;}
#td-root .td-body-text{font-size:16px !important;color:var(--ink) !important;line-height:1.9 !important;}
#td-root .td-section,#md-root .md-section{padding:22px !important;border:1px solid var(--border) !important;margin-top:20px !important;background:var(--surface) !important;border-radius:19px !important;}
#td-root .td-section-title,#md-root .md-section h2{font-size:20px !important;font-weight:700 !important;color:var(--ink) !important;margin-bottom:14px !important;}
#td-root .td-subhead{font-size:14px !important;color:var(--sage) !important;}
#td-root .td-mantra-name{font-size:17px !important;}
#md-root .md-article{padding:24px 5px 60px !important;}
#md-root .md-article h1{font-size:clamp(25px,3vw,36px) !important;font-weight:700 !important;}
#md-root .md-lead{font-size:18px !important;color:var(--sage) !important;line-height:1.75 !important;}
#md-root .md-steps,#md-root .md-body,#md-root .md-checklist li{font-size:16px !important;line-height:1.9 !important;}
#md-root .md-summary-card{padding:18px !important;}
#md-root .md-summary-card b{font-size:16px !important;color:var(--ink);}
#md-root .md-summary-card small{font-size:13px !important;}
.msc-name::before{content:"";display:inline-block;width:25px;height:25px;margin-right:9px;vertical-align:middle;background:url('assets/lotus-watermark.svg') center/contain no-repeat;}
body.night .msc-name::before{filter:brightness(.75);}
@media(max-width:500px){#td-root .td-body,#md-root .md-article{padding:20px 5px 50px !important;}#td-root .td-section,#md-root .md-section{padding:17px !important;}}
