/* Lịch Việt v16.49 r4 — one typography control for all frontend routes.
   Never alter calendar day grid geometry, Studio canvas or Admin. */
html[data-lvg-font-scale="100"]{--lv-readable:16px;--lv-label-readable:15px;--lv-input-readable:16px;--lv-action-readable:15px;--lv-heading-one:30px;--lv-heading-two:24px;--lv-heading-three:20px;--lv-brand-title:15.5px;--lv-brand-subtitle:10.5px}
html[data-lvg-font-scale="115"]{--lv-readable:18px;--lv-label-readable:17px;--lv-input-readable:18px;--lv-action-readable:17px;--lv-heading-one:34px;--lv-heading-two:27px;--lv-heading-three:22px;--lv-brand-title:16.5px;--lv-brand-subtitle:11px}
html[data-lvg-font-scale="130"]{--lv-readable:21px;--lv-label-readable:19px;--lv-input-readable:20px;--lv-action-readable:19px;--lv-heading-one:38px;--lv-heading-two:30px;--lv-heading-three:25px;--lv-brand-title:18px;--lv-brand-subtitle:12px}
/* Root rem-based typography and legacy easy-mode root size agree, without scaling layout widths. */
html[data-lvg-font-scale="100"],html[data-lvg-font-scale="100"][data-easy="comfort"]{font-size:16px!important}
html[data-lvg-font-scale="115"],html[data-lvg-font-scale="115"][data-easy="comfort"]{font-size:18.4px!important}
html[data-lvg-font-scale="130"],html[data-lvg-font-scale="130"][data-easy="comfort"]{font-size:20.8px!important}
/* Text content: keep 100% at existing page defaults; expand 115/130 only.
   Don't blindly resize icon glyphs, dates or dense calendar cells. */
html:is([data-lvg-font-scale="115"],[data-lvg-font-scale="130"]) body:not(.lvg-admin) :is(main,article,section) :is(p,li,dt,dd):not(.easy-home-day):not(.calendar-day):not(.day-number):not(.lvg-font-scale-hint){font-size:var(--lv-readable)!important;line-height:1.57!important;overflow-wrap:break-word}
html:is([data-lvg-font-scale="115"],[data-lvg-font-scale="130"]) body:not(.lvg-admin) :is(main,article,section) :is(label,summary){font-size:var(--lv-label-readable)!important;line-height:1.5!important;overflow-wrap:break-word}
html:is([data-lvg-font-scale="115"],[data-lvg-font-scale="130"]) body:not(.lvg-admin) :is(main,article,section) :is(h1){font-size:clamp(26px,8vw,var(--lv-heading-one))!important;line-height:1.27!important;overflow-wrap:break-word}
html:is([data-lvg-font-scale="115"],[data-lvg-font-scale="130"]) body:not(.lvg-admin) :is(main,article,section) :is(h2){font-size:var(--lv-heading-two)!important;line-height:1.33!important;overflow-wrap:break-word}
html:is([data-lvg-font-scale="115"],[data-lvg-font-scale="130"]) body:not(.lvg-admin) :is(main,article,section) :is(h3){font-size:var(--lv-heading-three)!important;line-height:1.35!important;overflow-wrap:break-word}
html:is([data-lvg-font-scale="115"],[data-lvg-font-scale="130"]) body:not(.lvg-admin) :is(main,article,section) :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea){font-size:var(--lv-input-readable)!important;max-width:100%;min-width:0;box-sizing:border-box}
html:is([data-lvg-font-scale="115"],[data-lvg-font-scale="130"]) body:not(.lvg-admin) :is(main,article,section) :is(button,a):not(.calendar-day):not(.day-number):not(.lvg-font-scale-close):not([data-lvg-font-choice]){font-size:var(--lv-action-readable)!important;overflow-wrap:break-word}
/* Keep calendar cells at their intentional compact sizing. */
html[data-lvg-font-scale] body:not(.lvg-admin) :is(.calendar-grid,.month-grid,.day-grid,.calendar-cells) :is(button,a,span,small,strong){font-size:inherit}
/* Brand never shrinks when text scaling is active; account for 320px widths by wrapping subtitle. */
html[data-lvg-font-scale] body:not(.lvg-admin) .lvg-app-header .lvg-header-brand-text strong{font-size:var(--lv-brand-title)!important;line-height:1.2!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap!important;max-width:100%}
html[data-lvg-font-scale] body:not(.lvg-admin) .lvg-app-header .lvg-header-brand-text small{font-size:var(--lv-brand-subtitle)!important;line-height:1.2!important;letter-spacing:0!important;max-width:100%}
@media(max-width:400px){html[data-lvg-font-scale] body:not(.lvg-admin) .lvg-app-header .lvg-header-brand-text small{white-space:normal!important;overflow-wrap:break-word!important}}
/* Typography control geometry is centralized with header controls below. */
body:not(.lvg-admin) .lvg-app-header .lvg-font-scale-panel[hidden]{display:none!important}
body:not(.lvg-admin) .lvg-app-header .lvg-font-scale-panel{box-sizing:border-box;position:absolute;z-index:400;top:calc(100% + 8px);right:8px;width:min(324px,calc(100vw - 20px));padding:14px;border:1px solid var(--ph-hairline,var(--ah-border,#bfd9cc));border-radius:16px;background:var(--ph-surface,var(--ah-bg,#fff));box-shadow:0 15px 36px rgba(0,38,29,.18);color:var(--ph-ink,var(--ah-ink,#183e32));font-family:'Bai Jamjuree',system-ui,sans-serif;max-height:min(78dvh,480px);overflow-y:auto}
body:not(.lvg-admin) .lvg-app-header .lvg-font-scale-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
body:not(.lvg-admin) .lvg-app-header .lvg-font-scale-heading strong{display:block;font-size:16px;line-height:1.3}
body:not(.lvg-admin) .lvg-app-header .lvg-font-scale-heading small{display:block;font-size:12px;margin-top:3px;color:var(--ph-sub,var(--ah-sub,#667c74))}
body:not(.lvg-admin) .lvg-app-header .lvg-font-scale-close{flex:0 0 auto;border:1px solid var(--ph-hairline,var(--ah-border,#bfd9cc));border-radius:9px;width:32px;height:32px;background:transparent;color:inherit;font:22px/1 system-ui;cursor:pointer}
body:not(.lvg-admin) .lvg-app-header .lvg-font-scale-options{display:grid;gap:7px;margin-top:12px}
body:not(.lvg-admin) .lvg-app-header .lvg-font-scale-options button{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:47px;border:1px solid var(--ph-hairline,var(--ah-border,#bfd9cc));border-radius:10px;padding:10px 12px;background:transparent;color:inherit;font:600 14px/1.35 'Bai Jamjuree',system-ui,sans-serif;cursor:pointer}
body:not(.lvg-admin) .lvg-app-header .lvg-font-scale-options button strong{font-weight:800;font-size:13px}
body:not(.lvg-admin) .lvg-app-header .lvg-font-scale-options button[aria-pressed="true"]{background:rgba(16,133,98,.13);border-color:#168066}
html[data-theme="dark"] body:not(.lvg-admin) .lvg-app-header .lvg-font-scale-options button[aria-pressed="true"]{background:rgba(116,207,163,.19);border-color:#9bdbbf}
body:not(.lvg-admin) .lvg-app-header .lvg-font-scale-hint{font-size:12px!important;line-height:1.5;margin:12px 0 0;color:var(--ph-sub,var(--ah-sub,#667c74))}
body:not(.lvg-admin) .lvg-app-header .lvg-font-scale-panel :is(button):focus-visible{outline:3px solid #b8872f;outline-offset:2px}
/* Easy Mode remains an independent accessibility mode: larger touch targets and lower visual noise.
   Text size follows the explicit 100/115/130 selection above. */
html[data-easy="comfort"] body:not(.lvg-admin) :is(main,article,section) :is(button,[role="button"]){min-height:48px;touch-action:manipulation}
html[data-easy="comfort"] body:not(.lvg-admin) :is(main,article,section) :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea){min-height:52px;box-sizing:border-box;max-width:100%}
html[data-easy="comfort"] body:not(.lvg-admin) :is(.calendar-grid,.month-grid,.day-grid,.calendar-cells) button{min-height:40px}
html[data-easy="comfort"] body:not(.lvg-admin) .mobile-bottom-nav a{min-height:60px}
html[data-easy="comfort"] body:not(.lvg-admin) :is(.ambient,.orb,.mt-aurora){display:none!important}
html[data-easy="comfort"] body:not(.lvg-admin) :is(.glass,.card,.panel,.sea-card,.qa-panel){-webkit-backdrop-filter:none!important;backdrop-filter:none!important;box-shadow:0 2px 9px rgba(13,55,42,.06)!important}
html[data-easy="comfort"] body:not(.lvg-admin) :is(a,button,input,select,textarea,summary):focus-visible{outline:3px solid #dbab47!important;outline-offset:3px!important}
@media(prefers-reduced-motion:reduce){body:not(.lvg-admin) .lvg-app-header .lvg-font-scale-panel *{transition:none!important}}


/* v16.49 r6 — minimal single-line typography & consistent action heights.
   Reuses current CSS request: no additional bundles, no change to Admin. */
:root,html[data-theme="light"]{
  --lvh-control-ink:#116451;
  --lvh-control-border:#d1e3d8;
  --lvh-control-bg:rgba(248,253,249,.78);
  --lvh-control-hover:rgba(229,244,234,.94);
  --lvh-control-active:rgba(217,239,225,.95);
  --lvh-control-ring:rgba(15,115,88,.13);
}
html[data-theme="dark"]{
  --lvh-control-ink:#e1f1e7;
  --lvh-control-border:#476f61;
  --lvh-control-bg:rgba(20,78,65,.72);
  --lvh-control-hover:rgba(39,106,86,.94);
  --lvh-control-active:rgba(48,114,92,.95);
  --lvh-control-ring:rgba(149,221,181,.13);
}
body:not(.lvg-admin) .lvg-app-header .lvg-header-actions{
  gap:6px!important;align-items:center!important;
}
body:not(.lvg-admin) .lvg-app-header .lvg-header-actions .round-icon{
  display:flex!important;align-items:center!important;justify-content:center!important;
  width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;
  border-radius:13px!important;border:1px solid var(--lvh-control-border)!important;
  background:var(--lvh-control-bg)!important;color:var(--lvh-control-ink)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.26),0 1px 3px rgba(3,52,38,.025)!important;
  -webkit-tap-highlight-color:transparent!important;
  transition:background-color .18s ease,border-color .18s ease,box-shadow .18s ease!important;
}
body:not(.lvg-admin) .lvg-app-header .lvg-header-actions .round-icon:is(:hover,:focus-visible){
  background:var(--lvh-control-hover)!important;
  border-color:var(--lvh-control-ink)!important;
  box-shadow:0 2px 9px rgba(12,69,49,.08)!important;
}
body:not(.lvg-admin) .lvg-app-header .lvg-header-actions .round-icon:active{
  transform:none!important;background:var(--lvh-control-active)!important;
}
body:not(.lvg-admin) .lvg-app-header .lvg-header-actions .round-icon:focus-visible{
  outline:2px solid var(--ph-focus,#16775b)!important;outline-offset:2px!important;
}
/* Three actions share EXACTLY 44px height. Aa is wider only to fit its inline value. */
body:not(.lvg-admin) .lvg-app-header .lvg-header-actions .lvg-font-scale-trigger{
  box-sizing:border-box!important;
  display:inline-flex!important;flex-direction:row!important;
  align-items:center!important;justify-content:center!important;
  gap:6px!important;flex:0 0 72px!important;
  width:72px!important;min-width:72px!important;max-width:72px!important;
  height:44px!important;min-height:44px!important;max-height:44px!important;
  padding:0 5px!important;white-space:nowrap!important;line-height:1!important;
}
body:not(.lvg-admin) .lvg-app-header .lvg-font-trigger-main{
  display:block!important;flex:none!important;margin:0!important;
  font:700 15px/1 'Bai Jamjuree',system-ui,sans-serif!important;
  letter-spacing:-.045em!important;color:inherit!important;white-space:nowrap!important;
}
body:not(.lvg-admin) .lvg-app-header .lvg-font-trigger-level{
  display:block!important;flex:none!important;margin:0!important;padding:0!important;
  background:none!important;border:0!important;border-radius:0!important;
  color:inherit!important;opacity:.78!important;
  font:600 11px/1 'Bai Jamjuree',system-ui,sans-serif!important;
  font-variant-numeric:tabular-nums!important;letter-spacing:-.025em!important;
  white-space:nowrap!important;
}
html:is([data-lvg-font-scale="115"],[data-lvg-font-scale="130"]) body:not(.lvg-admin) .lvg-app-header .lvg-font-scale-trigger,
body:not(.lvg-admin) .lvg-app-header .lvg-font-scale-trigger[aria-expanded="true"]{
  background:var(--lvh-control-active)!important;
  border-color:var(--lvh-control-ink)!important;
}
/* Menu remains subdued until open. Stroke weight matches Aa chevron and theme icon. */
body:not(.lvg-admin) .lvg-app-header .lvg-header-actions .lvg-header-menu svg{
  width:19px!important;height:19px!important;stroke-width:1.8!important;
}
body:not(.lvg-admin) .lvg-app-header .lvg-header-menu[aria-expanded="true"]{
  background:var(--lvh-control-active)!important;border-color:var(--lvh-control-ink)!important;
}
/* Theme: restrained jade moon for LIGHT, warm gold sun for DARK. */
body:not(.lvg-admin) .lvg-app-header .lvg-header-actions .lvg-header-theme{
  isolation:isolate;overflow:hidden;position:relative!important;
}
body:not(.lvg-admin) .lvg-app-header .lvg-header-theme::before{
  content:"";position:absolute;inset:7px;border-radius:50%;
  background:var(--lvh-control-ring);pointer-events:none;z-index:0;
  transition:transform .2s ease,background-color .2s ease;
}
body:not(.lvg-admin) .lvg-app-header .lvg-header-theme:hover::before{transform:scale(1.08)}
body:not(.lvg-admin) .lvg-app-header .lvg-header-actions .lvg-header-theme svg{
  width:20px!important;height:20px!important;position:relative;z-index:1;
  stroke-width:1.75!important;stroke:currentColor!important;fill:none!important;
}
html[data-theme="dark"] body:not(.lvg-admin) .lvg-app-header .lvg-header-actions .lvg-header-theme{
  color:#f0d88d!important;
}
html[data-theme="dark"] body:not(.lvg-admin) .lvg-app-header .lvg-header-theme::before{
  background:rgba(238,196,108,.14);
}
body:not(.lvg-admin) .lvg-app-header .lvg-header-actions .lvg-moon-spark{
  stroke-width:1.55!important;
}
/* Readable, light-weight panel; preserves native r4 keyboard/focus and all 3 options. */
body:not(.lvg-admin) .lvg-app-header .lvg-font-scale-panel{
  border-radius:18px!important;
  border:1px solid var(--lvh-control-border)!important;
  box-shadow:0 18px 42px rgba(1,40,30,.16),0 3px 10px rgba(1,40,30,.05)!important;
}
body:not(.lvg-admin) .lvg-app-header .lvg-font-scale-options button{
  border-radius:12px!important;
  transition:background-color .15s ease,border-color .15s ease;
}
body:not(.lvg-admin) .lvg-app-header .lvg-font-scale-options button[aria-pressed="true"]{
  background:var(--lvh-control-active)!important;
  border-color:var(--lvh-control-ink)!important;
}
/* At 320px reserve room for brand WITHOUT reducing the logo text size. */
@media (max-width:359px){
  body:not(.lvg-admin) .lvg-app-header.site-header{padding-inline:6px!important;gap:5px!important}
  body:not(.lvg-admin) .lvg-app-header .lvg-header-actions{gap:4px!important}
  body:not(.lvg-admin) .lvg-app-header .lvg-header-brand{gap:5px!important}
  body:not(.lvg-admin) .lvg-app-header .lvg-header-mark{flex-basis:32px!important;width:32px!important;height:32px!important}
}
@media(prefers-reduced-motion:reduce){
  body:not(.lvg-admin) .lvg-app-header .lvg-header-actions .round-icon,
  body:not(.lvg-admin) .lvg-app-header .lvg-header-theme::before{transition:none!important}
}


/* v16.49 r7 hotfix — remove the old Easy Mode selector collision.
   The visible Aa and percentage stay in ONE inline flex element, even if a
   browser temporarily serves a prior typography stylesheet. */
body:not(.lvg-admin) .lvg-app-header .lvg-header-actions button.round-icon.lvg-font-scale-trigger{
  box-sizing:border-box!important;display:inline-flex!important;flex-direction:row!important;
  flex:0 0 72px!important;width:72px!important;min-width:72px!important;max-width:72px!important;
  height:44px!important;min-height:44px!important;max-height:44px!important;
  align-items:center!important;justify-content:center!important;
  padding:0 6px!important;white-space:nowrap!important;gap:0!important;
}
body:not(.lvg-admin) .lvg-app-header .lvg-font-trigger-inline{
  display:inline-flex!important;flex-direction:row!important;align-items:center!important;
  justify-content:center!important;gap:5px!important;white-space:nowrap!important;
  flex-wrap:nowrap!important;line-height:1!important;min-width:max-content!important;
}
body:not(.lvg-admin) .lvg-app-header .lvg-font-trigger-inline > span{
  display:inline-block!important;white-space:nowrap!important;vertical-align:middle!important;
}
/* Ensure the sibling menu and theme buttons match the typography button height. */
body:not(.lvg-admin) .lvg-app-header .lvg-header-actions button.round-icon:is(.lvg-header-menu,.lvg-header-theme){
  box-sizing:border-box!important;flex:0 0 44px!important;
  width:44px!important;min-width:44px!important;max-width:44px!important;
  height:44px!important;min-height:44px!important;max-height:44px!important;
}
