:root{color-scheme:only light;--sheet-base-transform:translate3d(0,0,0)}
html,body{color-scheme:only light}
input,select,textarea,button{color-scheme:only light}
input,select,textarea{background-color:#fff;color:var(--ink);font-size:16px}
input::placeholder,textarea::placeholder{color:#718079;opacity:1}
input:disabled,select:disabled,textarea:disabled{color:#59655f;-webkit-text-fill-color:#59655f;opacity:.7}
.date-label{display:flex;align-items:center;gap:6px}.date-help-toggle{display:inline-grid;place-items:center;width:20px;height:20px;padding:0;border:1px solid #9eaaa4;border-radius:50%;background:#fff;color:var(--green);font:700 12px/1 var(--font-sans)}.date-format-help{display:block;margin-top:6px;color:var(--muted);font-size:11px;font-weight:500;line-height:1.35}
input:-webkit-autofill{-webkit-text-fill-color:var(--ink);box-shadow:0 0 0 1000px #fff inset}
button{color:inherit}
.sheet-close{color:var(--green)}
.import-status{background:#f5f7f4;color:var(--ink);border:1px solid var(--line)}
*{scrollbar-width:none}
*::-webkit-scrollbar{display:none;width:0;height:0}
html.app-root,body.app-body{height:100%;width:100%;overflow:hidden;overscroll-behavior:none}
body.app-body{position:relative;min-height:0;height:100dvh}
.app-body #main{overflow-x:hidden;overflow-y:auto;overscroll-behavior:none;scroll-behavior:auto;-webkit-overflow-scrolling:touch}
.sheet{--sheet-base-transform:translate3d(0,0,0);transform:var(--sheet-base-transform);scroll-behavior:auto;max-height:92dvh;overscroll-behavior:none;transition:transform .26s cubic-bezier(.22,.68,0,1),opacity .26s ease-out}
.sheet-expanded{max-height:96dvh}
.sheet-dragging{transition:none;will-change:transform;user-select:none}
.sheet-enter{animation:sheet-enter .18s ease-out both}
.sheet-leaving{transform:var(--sheet-base-transform) translate3d(var(--sheet-exit-x,0px),var(--sheet-exit-y,110%),0);opacity:0;pointer-events:none}
.app-body .sheet-backdrop{backdrop-filter:none;-webkit-backdrop-filter:none}
.sheet-toolbar{position:relative;top:auto;z-index:3;height:36px;flex:0 0 36px;margin:0;background:var(--paper);touch-action:none;display:grid;place-items:center}
.sheet-toolbar .sheet-handle{position:static;left:auto;top:auto;transform:none;margin:0;pointer-events:none}
.sheet-toolbar .sheet-back,.sheet-toolbar .sheet-close{top:10px}
.portrait-notice{position:fixed;inset:0;z-index:1000;background:#f6f1e7;color:var(--ink);display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;padding:24px;gap:12px;font-size:16px;touch-action:none}
.portrait-notice strong{font-size:22px;color:var(--green)}
.portrait-notice p{margin:0;line-height:1.6}
/* The opaque portrait notice covers landscape; avoid toggling visibility on fixed controls. */
@keyframes sheet-enter{from{transform:var(--sheet-base-transform) translate3d(0,24px,0);opacity:.45}to{transform:var(--sheet-base-transform);opacity:1}}
@media(min-width:800px){.sheet{--sheet-base-transform:translateX(-50%)}}
@media(min-width:1100px){.sheet-leaving{transform:var(--sheet-base-transform) translate3d(var(--sheet-exit-x,0px),var(--sheet-exit-y,24px),0)}.sheet{--sheet-base-transform:translate(-50%,-50%)}.sheet-toolbar{margin:0;height:36px}.sheet-toolbar .sheet-back{left:20px}.sheet-toolbar .sheet-close{right:20px}}
@media(prefers-reduced-motion:reduce){.sheet{transition:none;animation:none}}

/* Scroll normally, without browser pinch or double-tap page scaling. */
html.mobile-zoom-locked,html.mobile-zoom-locked body{touch-action:pan-x pan-y}
html.mobile-zoom-locked .photo-viewport{touch-action:pan-x pan-y}

.sheet-toolbar{cursor:grab;outline-offset:-5px}
.sheet-toolbar:active{cursor:grabbing}
.sheet-toolbar:focus-visible{outline:2px solid var(--gold)}
.sheet-toolbar .sheet-handle{display:block;width:48px;height:5px;background:#b7bdb7}


.sheet-leaving{z-index:42;will-change:transform;opacity:1}
.sheet-underlay{pointer-events:none;z-index:41}
.sheet-enter{will-change:transform}

@media(min-width:1100px){.sheet-leaving{opacity:0}}

/* Fixed drag header and independent native scroll area. */
.sheet,.admin-body .sheet{display:flex;flex-direction:column;padding:0;overflow:hidden;gap:0;scroll-padding-top:0}
.sheet.hidden{display:none}
.sheet-content{flex:0 1 auto;min-height:0;min-width:0;overflow-x:hidden;overflow-y:auto;padding:0 20px calc(22px + var(--sab));overscroll-behavior:contain;scroll-behavior:auto;-webkit-overflow-scrolling:touch;touch-action:pan-y}
.photo-sheet .sheet-content{flex:1;display:flex;flex-direction:column;gap:12px}
.detail-photo{display:block;width:100%;min-width:0;isolation:isolate}
.detail-photo>button{display:block;width:100%;min-width:0;max-width:100%;height:100%;margin:0;text-align:initial}
.detail-photo img{display:block;width:100%;max-width:100%;height:100%;object-fit:cover;object-position:center}
.detail-photo>span{display:grid;height:100%;place-items:center}
.detail-photo .photo-hint{font-size:11px;color:#fff}
.photo-viewport{min-width:0;position:relative}
.photo-viewport img{display:block;min-width:0}
.photo-error{display:grid;place-items:center;height:100%;padding:16px;text-align:center;color:var(--muted);font-size:13px}
.photo-error button{border:1px solid var(--line);border-radius:10px;padding:10px 16px;background:#fff;color:var(--green)}
@media(min-width:1100px){.sheet-content{padding:0 34px 34px}}

/* Phones keep the same viewport layout through rotation, never tablet transforms. */
.mobile-phone{--app-height:100vh}
@supports(height:100dvh){.mobile-phone{--app-height:100dvh}}
.mobile-phone .app-body{height:var(--app-height)}
.mobile-phone .app-body>.topbar,.mobile-phone .app-body>.tabbar,.mobile-phone .app-body>#main{left:0;right:0;width:100%;transform:none}
.mobile-phone .app-body>.topbar{top:0;height:calc(64px + var(--sat))}
.mobile-phone .app-body>.tabbar{top:calc(var(--app-height,100dvh) - 68px - var(--sab));bottom:auto;height:calc(68px + var(--sab));touch-action:manipulation}
.mobile-phone .app-body>#main{top:calc(64px + var(--sat));bottom:auto;height:calc(var(--app-height,100dvh) - 132px - var(--sat) - var(--sab))}
.mobile-phone .app-body>.sheet{left:0;right:0;top:auto;bottom:0;width:100%;--sheet-base-transform:translate3d(0,0,0)}
.mobile-phone .app-body.keyboard-open>.tabbar{visibility:hidden;pointer-events:none}
.mobile-phone .app-body.keyboard-open>#main{height:calc(var(--app-height,100dvh) - 64px - var(--sat));padding-bottom:24px}
.mobile-phone .portrait-notice.hidden{pointer-events:none}

/* Tab taps use the selected color without a rectangular pressed border. */
.tabbar button:not(:disabled):active,.tabbar button.tap-feedback{box-shadow:none;filter:none}
.tabbar button:focus:not(:focus-visible){outline:none}
.mobile-phone .tabbar button:hover{background:transparent}

/* Lightweight app launch screen. */
.app-splash{position:fixed;inset:0;z-index:2000;display:grid;place-items:center;padding:calc(24px + var(--sat)) 24px calc(24px + var(--sab));background:#153f32;color:#fff;opacity:1;visibility:visible;transition:opacity .28s ease,visibility 0s linear .28s;touch-action:none}
.app-splash.splash-leaving{opacity:0;visibility:hidden;pointer-events:none}
.splash-brand{display:flex;flex-direction:column;align-items:center;text-align:center;transform:translateY(-3vh)}
.splash-brand img{width:92px;height:92px;border-radius:27px;box-shadow:0 16px 38px rgba(0,0,0,.24);object-fit:cover}
.splash-brand strong{margin-top:22px;font-family:var(--font-serif,var(--font-sans));font-size:27px;font-weight:650;letter-spacing:-.02em}
.splash-brand>span{margin-top:8px;color:rgba(255,255,255,.68);font-size:13px}
.splash-dots{display:flex;gap:7px;margin-top:30px;height:8px}
.splash-dots i{width:7px;height:7px;border-radius:50%;background:#e8c77f;animation:splash-dot 1s ease-in-out infinite both}
.splash-dots i:nth-child(2){animation-delay:.14s}.splash-dots i:nth-child(3){animation-delay:.28s}
@keyframes splash-dot{0%,60%,100%{transform:translateY(0);opacity:.35}30%{transform:translateY(-6px);opacity:1}}
@media(prefers-reduced-motion:reduce){.app-splash{transition:none}.splash-dots i{animation:none;opacity:.75}}

/* Balanced outline icons for primary navigation. */
.tabbar .tab-icon{width:25px;height:25px;display:grid;place-items:center;flex:0 0 25px;font-size:0}
.tabbar .tab-icon svg{display:block;width:24px;height:24px;overflow:visible}
.tabbar .tab-icon svg path,.tabbar .tab-icon svg circle{fill:none;stroke:currentColor;stroke-width:1.85;stroke-linecap:round;stroke-linejoin:round}
.tabbar .tab-more svg circle{fill:currentColor;stroke:none}
.tabbar .creative-plus rect{fill:currentColor;stroke:none}
.tabbar .scan-main{overflow:visible}
@media(max-width:1099px){
  .tabbar .scan-main{justify-content:center;padding-top:0}
  .tabbar .scan-main .tab-icon{width:52px;height:52px;flex-basis:52px;margin:0;border:3px solid var(--paper);border-radius:19px;background:var(--green);color:#e8c77f;box-shadow:0 6px 17px rgba(21,63,50,.28);transform:translateY(-5px)}
  .tabbar .scan-main .tab-icon svg{width:28px;height:28px}
  .tabbar .scan-main.active .tab-icon{background:var(--green2);color:#f6d68d}
}
@media(min-width:1100px){
  .tabbar .scan-main .tab-icon{width:34px;height:34px;flex-basis:34px;border-radius:12px;background:rgba(255,255,255,.12);color:inherit}
  .tabbar .scan-main .tab-icon svg{width:23px;height:23px}
}

.history-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.history-head>div{min-width:0}
.clear-history{flex:0 0 auto;margin-top:22px;padding:8px 11px;border:1px solid #dfc9c4;border-radius:10px;background:#fff8f6;color:#914a3e;font-size:12px}

/* Opaque, stable admin header below the iOS scroll-edge area. */
.admin-body{background:var(--cream);min-height:100vh;min-height:100dvh}
.admin-body .auth-card{background:var(--paper)}
.admin-record-list,#cemeteryRows{display:grid;gap:10px;margin-top:16px}
#panel-cemeteries>.panel-head{align-items:center;gap:8px;flex-wrap:nowrap}
#panel-cemeteries>.panel-head h2{font-size:18px;line-height:1.3;white-space:nowrap;margin:0}
#addCemeteryBtn{flex:none;white-space:nowrap;padding:9px 12px;font-size:14px;line-height:1.3}
@media(max-width:360px){#panel-cemeteries>.panel-head h2{font-size:16px}#addCemeteryBtn{padding:9px}}
.admin-record-list .swipe-record,#cemeteryRows .swipe-record{position:relative;display:block;padding:0;border:1px solid var(--line);border-radius:16px;overflow:hidden;background:#fff;isolation:isolate}
.swipe-actions{position:absolute;right:0;top:0;bottom:0;width:144px;display:flex;pointer-events:none}
.actions-open .swipe-actions{pointer-events:auto}
.swipe-actions button{width:72px;border:0;border-radius:0;color:#fff;font-size:14px;font-weight:700;min-height:44px;padding:8px}
.swipe-actions .swipe-edit{background:#386e5b}.swipe-actions .swipe-delete{background:#b8443f}
.swipe-content{position:relative;z-index:1;display:flex;align-items:center;gap:8px;padding:13px 14px;background:var(--paper);min-height:86px;touch-action:pan-y;transition:transform .22s ease;transform:translate3d(0,0,0)}
.actions-open .swipe-content{transform:translate3d(-144px,0,0)}
.swiping .swipe-content{transition:none;will-change:transform}
.record-info{flex:1;min-width:0;display:grid;gap:5px}
.record-title{display:flex;align-items:center;gap:8px;min-width:0}
.record-title b{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:16px}
.record-status{width:23px;height:23px;flex:none;display:grid;place-items:center;border-radius:50%;color:#52615a;background:#edf0eb}
.record-status.status-published{color:#216847;background:#e2eee7}.record-status.status-hidden{color:#7a6863;background:#f0e9e6}
.record-status svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.record-meta{font-size:13px;color:var(--muted);line-height:1.4;overflow-wrap:anywhere}
.record-info code{font-size:12px;color:var(--green);overflow-wrap:anywhere}
.record-count{font-size:12px;white-space:nowrap;color:var(--muted)}
#cemeteryRows .swipe-actions{flex-direction:row;gap:0}
#cemeteryRows .swipe-content{flex-direction:row;gap:8px}
#cemeteryRows .record-info{display:grid;gap:5px}
#cemeteryRows .record-title{flex-direction:row;gap:8px}
#cemeteryRows .record-meta{font-size:13px}
#cemeteryRows .swipe-actions button{align-self:stretch}
.swipe-content:focus-visible{outline:2px solid var(--gold);outline-offset:-3px}
#panel-requests>.panel-head{align-items:center;flex-wrap:wrap;gap:12px;margin-bottom:12px}
#panel-requests .notification-enable{background:var(--green);color:#fff;border:0;padding:10px 14px;line-height:1.3;min-height:40px;font-size:14px}
#panel-requests .notification-enable:disabled{background:#e6eee8;color:#426650;opacity:1}
#panel-requests .admin-notification-status{margin:0 0 14px;line-height:1.4;font-size:13px}
@media(prefers-reduced-motion:reduce){.swipe-content{transition:none}}
.admin-body .admin-top{position:sticky;top:0;z-index:30;background:#153f32;background-image:none;opacity:1;filter:none;-webkit-filter:none;backdrop-filter:none;-webkit-backdrop-filter:none;isolation:isolate;transform:translateZ(0)}
.admin-body .admin-top a,.admin-body .admin-top button{white-space:nowrap;flex:0 0 auto}
.admin-body .admin-top>div{min-width:0;flex:1}
.admin-body .admin-top b{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.admin-body .admin-top small{opacity:.82;white-space:nowrap}
@media(max-width:1099px){
  .admin-body .admin-top{height:78px;padding:12px 16px 0;gap:12px;align-items:center}
  .admin-body .admin-top a{font-size:14px}
  .admin-body .admin-top b{font-size:15px}
  .admin-body .admin-top button{margin-left:0;padding:8px 0;font-size:14px}
}

/* Compact phone headings and status rows. */
@media(max-width:440px){
.hero h1,.page-head h1{font-size:26px;line-height:1.25}
.sheet h2,.permission-onboarding-card h2{font-size:21px;line-height:1.3}
.admin-title h1{font-size:23px;line-height:1.3}
.panel-head h2,.section-head h2{font-size:18px;line-height:1.3}
.hero h1,.page-head h1,.sheet h2,.panel-head h2,.section-head h2,.admin-title h1,.form-card-head b,.quick-card b{white-space:nowrap;min-width:0;overflow:hidden;text-overflow:ellipsis}
.panel-head,.section-head,.admin-title,#panel-requests>.panel-head{align-items:center;flex-wrap:nowrap;gap:8px}
.panel-head>h2,.section-head>h2,.admin-title>div{min-width:0;flex:1}
.panel-head>button,.section-head>button,.admin-title>button{flex:none;white-space:nowrap;font-size:14px;padding:10px}
.permission-row{grid-template-columns:34px minmax(0,1fr) auto;gap:8px;padding:12px}
.permission-symbol{width:34px;height:34px;font-size:21px}
.permission-row button{font-size:14px;padding:9px 12px}
.permission-row b,.permission-row small,.admin-notification-status,.request-kind,.request-review-state,.record-meta,.quick-card small,.menu-row small{white-space:nowrap;min-width:0;overflow:hidden;text-overflow:ellipsis}
.quick-card b{font-size:14px}.quick-card small{display:block;font-size:12px}
.form-card-head>div{min-width:0}.form-card-head small{font-size:12px;white-space:nowrap}
#graveLocationStatus{font-size:14px}
}
