/* The attendance terminal owns the viewport, including its two protected panes. */
.attendance-tablet #kiosk { height:100vh; height:100dvh }
.attendance-tablet-home {
 position:absolute; inset:0; z-index:101; overflow:auto; outline:none;
 padding:clamp(14px,2.2vmin,28px); color:#183f3d; background:#f5f4ec;
 font-family:"PingFang TC","Noto Sans TC","Microsoft JhengHei",system-ui,sans-serif;
}
.tablet-shell { width:100%; min-height:100%; margin:auto; display:flex; flex-direction:column; gap:clamp(12px,2.3vh,24px) }
.tablet-heading,.tablet-brand,.tablet-system-status,.tablet-clock-top { display:flex; align-items:center }
.tablet-heading { justify-content:space-between; gap:12px; padding:2px 4px }
.tablet-heading-tools { display:flex; align-items:center; justify-content:flex-end; gap:clamp(8px,1.4vw,18px); min-width:0 }
.tablet-heading-tools .tablet-languages { flex:none; flex-wrap:nowrap }
.tablet-languages { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:5px }
.tablet-languages button { min-height:40px; padding:6px 10px; border:1px solid #bccfc3; border-radius:10px; color:#244f46; background:#fff; font:600 14px/1.2 system-ui,sans-serif; cursor:pointer }
.tablet-languages button[aria-pressed="true"] { background:#195c50; border-color:#195c50; color:#fff }
.tablet-languages button:focus-visible { outline:3px solid #c97824; outline-offset:2px }
#tabletBrandTranslation { margin:3px 0 0; font-size:13px; letter-spacing:0 }
.tablet-brand { gap:13px; min-width:0; overflow-wrap:anywhere }
.tablet-brand-mark { display:grid; place-items:center; flex:none; width:48px; height:48px; border-radius:15px 15px 5px 15px; background:#155a53; color:white; font-size:26px; font-weight:750 }
.tablet-brand p { margin:0 0 3px; font-size:13px; color:#526a60; letter-spacing:.055em }
#tabletTitle { display:block!important; margin:0; font-size:clamp(24px,2.6vw,36px); font-weight:800; line-height:1.15; color:#193e38 }
.tablet-system-status { gap:8px; min-height:40px; min-width:0; max-width:clamp(145px,31vw,320px); padding:6px 13px; border:1px solid #c6d4c6; border-radius:50px; font-size:14px; line-height:1.25; color:#335d50; background:#fff }
.tablet-state-dot { flex:none; width:9px; height:9px; border-radius:50%; background:#20825b }
.tablet-state-dot.is-warning { background:#aa650e }
.tablet-content { flex:1; display:grid; grid-template-columns:minmax(0,.95fr) minmax(0,1.05fr); gap:clamp(12px,1.6vw,24px) }
.tablet-clock-card { position:relative; isolation:isolate; overflow:hidden; min-width:0; border-radius:24px; padding:clamp(22px,3.4vw,56px); display:flex; flex-direction:column; background:linear-gradient(135deg,#154742,#175f54 70%,#246d5a); color:white }
.tablet-clock-card::after { content:""; position:absolute; z-index:-1; bottom:-45%; right:-40%; width:115%; aspect-ratio:1; border:1px solid #ffffff21; border-radius:50%; box-shadow:0 0 0 25px #ffffff07,0 0 0 26px #ffffff19,0 0 0 52px #ffffff06,0 0 0 53px #ffffff16,0 0 0 80px #ffffff06,0 0 0 81px #ffffff12; pointer-events:none }
.tablet-clock-top { justify-content:center; gap:10px; color:#d6efe2; font-size:16px; text-align:center }
.tablet-clock-symbol { position:relative; width:20px; height:20px; border:2px solid currentColor; border-radius:50% }
.tablet-clock-symbol::before { content:""; position:absolute; left:7px; top:3px; height:5px; width:4px; border:solid currentColor; border-width:0 0 2px 2px }
.tablet-clock-face { margin:auto 0; padding:18px 0; text-align:center }
.tablet-date { margin:0 0 12px; font-size:clamp(16px,1.7vw,25px); font-weight:550; color:#d7eee1 }
.tablet-time { display:flex; justify-content:center; align-items:baseline; gap:.1em; line-height:1; white-space:nowrap; font-size:clamp(52px,8.1vw,148px); letter-spacing:-.055em; font-weight:650; font-variant-numeric:tabular-nums }
#tabletSeconds { font-size:.29em; color:#bfe1cd; letter-spacing:0 }
.tablet-weather { display:flex; align-items:center; gap:clamp(10px,1.4vw,22px); width:fit-content; max-width:100%; margin:clamp(16px,4vh,40px) auto 0; padding:11px 15px; border:1px solid #b9ddc94d; border-radius:16px; background:#10292356; color:#edf7f0 }
.tablet-weather-icon { flex:none; width:1.2em; text-align:center; font-size:clamp(24px,3.7vw,55px); line-height:1; color:#d3eadb }
.tablet-weather-copy { min-width:0; overflow-wrap:anywhere }
.tablet-weather-copy p { margin:0; color:#d5e8dc; font-size:clamp(11px,1.35vw,18px); line-height:1.4 }
.tablet-weather-reading { display:flex; flex-wrap:wrap; justify-content:center; align-items:baseline; column-gap:9px; font-size:clamp(13px,1.6vw,21px); line-height:1.3 }
#tabletWeatherTemperature { font-size:clamp(21px,3.1vw,43px); font-variant-numeric:tabular-nums; white-space:nowrap }
.tablet-weather.is-stale #tabletWeatherDetails { color:#f0d3a3 }
.kiosk-night .tablet-weather { color:#cde2d3; border-color:#82aa9463; background:#10231f }
.kiosk-night .tablet-weather-icon,.kiosk-night .tablet-weather-copy p { color:#b6cdbe }
.kiosk-night .tablet-weather.is-stale #tabletWeatherDetails { color:#e6c59b }
.tablet-actions { min-width:0; display:flex; flex-direction:column; gap:clamp(10px,1.5vh,18px) }
.tablet-action { --accent:#1e6661; --surface:#d9ebe2; --edge:#c6dbcf; position:relative; flex:1; min-height:98px; width:100%; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:clamp(6px,1.4vh,14px); text-align:center; padding:clamp(10px,1.8vh,22px) clamp(28px,4vw,56px); border:1px solid var(--edge); border-radius:22px; background:var(--surface); color:#193e36; box-shadow:0 2px 5px #29433208 }
#tabletActivation { --accent:#9a5326; --surface:#fae9d4; --edge:#ebd5b9; color:#543b29 }
.tablet-action:enabled:hover { background:var(--surface); border-color:var(--accent) }
.tablet-action:enabled:active { box-shadow:inset 0 0 0 2px var(--accent) }
.tablet-action-icon,.tablet-action-arrow { display:grid; place-items:center; flex:none; color:var(--accent) }
.tablet-action-icon { width:clamp(48px,5.2vw,78px); aspect-ratio:1; border-radius:16px; background:#ffffffb5 }
.tablet-action-icon svg { width:57%; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round }
.tablet-action-copy { display:grid; gap:5px; min-width:0; max-width:100% }
.tablet-action-copy>* { overflow-wrap:anywhere }
.tablet-action-copy strong { font-size:clamp(22px,2.65vw,44px); line-height:1.2; font-weight:800 }
.tablet-action-copy small { font-size:clamp(14px,1.4vw,21px); font-weight:500; line-height:1.4 }
.tablet-action-arrow { position:absolute; inset-inline-end:14px; top:50%; transform:translateY(-50%); font-size:27px; line-height:1 }
.tablet-access-status { margin:0; border-radius:12px; padding:8px 14px; background:#fff8ee; color:#713a22; font-size:17px; font-weight:700; text-align:center }
.tablet-access-status:empty { display:none }
.tablet-access-status.access-announcement { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap }
#tabletManage :is(.access-scan,.access-shield,.access-retry) { display:none }
#tabletManage[data-feedback="checking"] { --accent:#275d81; --surface:#e1edf6; --edge:#b5d2e5; color:#21435b; opacity:1 }
#tabletManage[data-feedback="denied"] { --accent:#953c2a; --surface:#fff0e9; --edge:#c7755b; color:#752d23; box-shadow:inset 5px 0 var(--accent) }
#tabletManage[data-feedback="checking"] .access-scan,#tabletManage[data-feedback="denied"] .access-shield { display:block }
#tabletManage:is([data-feedback="checking"],[data-feedback="denied"]) :is(.access-calendar,.tablet-action-arrow) { display:none }
#tabletManage[data-feedback="denied"] .access-retry { display:inline-flex; justify-self:center; gap:8px; align-items:center; padding:5px 13px; background:#813b2e; color:white; font-size:16px; border-radius:9px }
@media(max-height:490px) and (orientation:landscape) {
 #tabletManage[data-feedback="denied"] { padding-block:9px }
 #tabletManage[data-feedback="denied"] .tablet-action-copy { gap:3px }
}
.attendance-tablet-home.is-hr,.attendance-tablet-home.activation-open {
 position:fixed; top:var(--tablet-viewport-top,0px); bottom:auto;
 height:var(--tablet-viewport-height,100%); padding:0; overflow:hidden;
}
.activation-open #tabletHome { display:none!important }
.tablet-hr-view,.tablet-activation-view { position:absolute; inset:0; display:flex; flex-direction:column; background:#f5f4ec }
.tablet-hr-frame,.tablet-activation-frame { display:block; flex:1; width:100%; min-height:0; border:0; background:#f5f4ec }
#attendanceTablet :is(.tablet-hr-heading,.tablet-activation-heading) { position:static; flex:none; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:6px clamp(12px,2vw,30px); min-height:54px; background:#164f49; color:#fff; border:0; pointer-events:auto }
.tablet-hr-heading>div,.tablet-activation-heading>div { display:flex; align-items:baseline; gap:14px }
#attendanceTablet header strong { font-size:22px; font-weight:750 }
#attendanceTablet header span { color:#daf0e5; font-size:16px }
.tablet-pane-name { display:grid; row-gap:2px }
.tablet-pane-name small { color:#c5dfd5; font-size:13px; line-height:1.15 }
#attendanceTablet header button { min-height:44px; padding:6px 18px; border-radius:12px; border:1px solid #8ab5a9; background:#fff; color:#164f49; font-size:16px }
@media (orientation:portrait),(max-width:640px) {
 .tablet-content { grid-template-columns:1fr; grid-template-rows:minmax(min-content,.8fr) minmax(210px,1.2fr) }
 .tablet-clock-card { padding:20px 24px }
 .tablet-clock-face { padding:14px 0 0 }
 .tablet-time { font-size:clamp(56px,13vw,100px) }
 .tablet-brand p { font-size:11px }
 .tablet-system-status { font-size:12px; padding:6px 9px }
}
@media (max-width:600px) {
 .tablet-heading { flex-wrap:wrap }
 .tablet-heading-tools { width:100%; justify-content:space-between; flex-wrap:wrap }
 .tablet-heading-tools .tablet-languages { max-width:100%; flex-wrap:wrap; justify-content:flex-start }
 .tablet-system-status { max-width:100% }
}
@media (max-height:450px) and (orientation:landscape) {
 .tablet-brand-mark { height:38px; width:38px; font-size:22px }
 .tablet-brand p { font-size:11px }
 .tablet-action { min-height:72px }
 .tablet-action-icon { width:36px; border-radius:10px }
 .tablet-clock-face { padding:10px 0 0 }
 .tablet-weather { margin-top:10px; padding:6px 10px }
}
/* Evening palette is scoped to the attendance tablet. */
.attendance-tablet-home.kiosk-night { color-scheme:dark; color:#d3e1db; background:#101b1a }
.kiosk-night .tablet-brand p,.kiosk-night .tablet-clock-top,.kiosk-night .tablet-date { color:#a8c2b6 }
.kiosk-night #tabletTitle { color:#d8e6df }
.kiosk-night .tablet-brand-mark { background:#294c41; color:#c5dfd0 }
.kiosk-night .tablet-system-status { color:#bad6c8; background:#1c3029; border-color:#385246 }
.kiosk-night .tablet-languages button { color:#c6dbd0; background:#1c3029; border-color:#385246 }
.kiosk-night .tablet-languages button[aria-pressed="true"] { color:#fff; background:#355e4d; border-color:#7da58d }
.kiosk-night .tablet-state-dot:not(.is-warning) { background:#79bb98 }
.kiosk-night .tablet-state-dot.is-warning { background:#dfa965 }
.kiosk-night .tablet-clock-card { background:linear-gradient(135deg,#152c29,#183b33); color:#cde2d3 }
.kiosk-night .tablet-clock-card::after { opacity:.52 }
.kiosk-night .tablet-action { --accent:#a8ceb8; --surface:#20372f; --edge:#365445; color:#d7e5db }
.kiosk-night #tabletActivation { --accent:#deb78c; --surface:#392f27; --edge:#554638; color:#e7d4bf }
.kiosk-night #tabletManage[data-feedback="checking"] { --accent:#a1c5dc; --surface:#223744; --edge:#476474; color:#d3e4ec }
.kiosk-night #tabletManage[data-feedback="denied"] { --accent:#df9a86; --surface:#3b2926; --edge:#80564b; color:#f0c9bc }
.kiosk-night #tabletManage[data-feedback="denied"] .access-retry { color:#f3d6c9; background:#673c31 }
.kiosk-night .tablet-action-icon { background:#ffffff0c }
.kiosk-night .tablet-access-status { background:#3b3026; color:#e4c5a4 }
#attendanceTablet.kiosk-night :is(.tablet-hr-view,.tablet-activation-view,.tablet-hr-frame,.tablet-activation-frame) { background:#14221e }
#attendanceTablet.kiosk-night header { background:#192f29; color:#cedfd5 }
#attendanceTablet.kiosk-night header button { background:#253c34; color:#d7e4dc; border-color:#51685e }

/* Match the one-stop portal while keeping the terminal's two-column layout. */
.attendance-tablet-home:not(.kiosk-night) { background:#f2f9f7; color:#10383c }
.attendance-tablet-home:not(.kiosk-night) .tablet-brand-mark { background:#073f43 }
.attendance-tablet-home:not(.kiosk-night) .tablet-languages button[aria-pressed="true"] { background:#073f43; border-color:#073f43; color:white }
.attendance-tablet-home:not(.kiosk-night) .tablet-clock-card { background:linear-gradient(135deg,#073f43,#146658) }
.attendance-tablet-home:not(.kiosk-night) #tabletManage:not([data-feedback="checking"]):not([data-feedback="denied"]) { --accent:#176c59; --surface:#e7f5f1; --edge:#cfe2df; color:#10383c }
.attendance-tablet-home:not(.kiosk-night) #tabletActivation { --accent:#247365; --surface:#fff; --edge:#cfe2df; color:#10383c }
#attendanceTablet:not(.kiosk-night) :is(.tablet-hr-heading,.tablet-activation-heading) { background:#073f43 }
.attendance-tablet-home.kiosk-night { background:#111f22 }
.kiosk-night .tablet-clock-card { background:linear-gradient(135deg,#10272a,#16443d) }
.kiosk-night #tabletManage:not([data-feedback="checking"]):not([data-feedback="denied"]) { --surface:#1d3633; --edge:#375550 }
.kiosk-night #tabletActivation { --accent:#9fc9bd; --surface:#202f31; --edge:#3a5455; color:#d3e4df }
.tablet-action-copy :is(strong,small),#tabletManage .access-retry,#attendanceTablet header :is(span,button),#tabletWeatherLocation,#tabletWeatherSummary,#tabletStation { white-space:pre-line }
#attendanceTablet:is([lang="id"],[lang="vi"]) .tablet-action-copy strong { font-size:clamp(18px,2.2vw,35px) }
#attendanceTablet .tablet-pane-tools { align-items:center; gap:8px }
#attendanceTablet header .tablet-languages { gap:4px }
#attendanceTablet header .tablet-languages button { min-height:42px; padding:5px 9px; font-size:14px }
#attendanceTablet header .tablet-languages [aria-pressed="true"] { background:#d8eae3; color:#134b43; border-color:#a1c4b5 }
#attendanceTablet.kiosk-night header .tablet-languages [aria-pressed="true"] { background:#355e52; color:#f4faf6; border-color:#7ca294 }
@media(max-width:680px) {
 #attendanceTablet :is(.tablet-hr-heading,.tablet-activation-heading) { flex-wrap:wrap }
 #attendanceTablet .tablet-pane-tools { flex-wrap:wrap; justify-content:space-between; flex:1 1 auto }
}
#tabletFamilyVisitView:not([hidden]) { display:flex; flex-direction:column; height:100%; overflow:auto; gap:8px; color:var(--ink,inherit) }
#tabletFamilyVisitView [hidden] { display:none!important }
.visit-choices,.visit-body { width:min(94%,920px); margin-inline:auto; box-sizing:border-box; text-align:center }
.visit-choices { flex:none; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; margin-top:6px }
.visit-choices button,.visit-body button,.visit-fields :is(input,select) { min-height:44px; border:1px solid #9eb9b0; border-radius:9px; padding:6px 10px; font:inherit; box-sizing:border-box }
.visit-choices button,.visit-body button { font-weight:650; color:#16483e; background:#edf5f1 }
.visit-choices button[aria-pressed=true],.visit-body button[type=submit],.visit-body button[data-arrive] { background:#175b52; color:white }
.visit-body { margin-block:auto; padding:14px; background:#fff; color:#153d38; border:1px solid #caddd6; border-radius:12px }
.visit-body:empty { display:none }
.visit-fields { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px }
.visit-fields label { display:flex; flex-direction:column; justify-content:end; gap:4px; text-align:start }
.visit-fields label:only-child { grid-column:1/-1; width:min(100%,460px); justify-self:center }
.visit-fields :is(input,select) { color:#152e29; background:#fff; min-width:0; width:100%; font-size:17px }
.visit-body .visit-controls { display:flex; justify-content:center; flex-wrap:wrap; gap:8px; margin-top:14px }
.visit-body [role=status]:empty { display:none }
.visit-body button { min-width:130px }
.visit-code { display:block; font-size:clamp(20px,3.5vw,38px); font-variant-numeric:tabular-nums }
.kiosk-night .visit-body { color:#e3ede8; background:#20342f; border-color:#526e60 }
.kiosk-night .visit-fields :is(input,select),.kiosk-night .visit-choices button { color:#e3ede8; background:#263c35; border-color:#688478; color-scheme:dark }
.kiosk-night .visit-choices button[aria-pressed=true] { color:#102b21; background:#a7d2bf }
#attendanceTablet .tablet-actions .tablet-action { min-height:62px }
@media(max-width:680px){.visit-fields{grid-template-columns:1fr 1fr}}

.visitor-record video { width:min(100%,480px); max-height:clamp(75px,32vh,270px); background:#152820; border-radius:10px; display:block; margin:auto }
.visitor-record p { margin:6px; font-size:17px }
.visitor-record button:is([data-record=start],[data-record=send]) { background:#175b52; color:white }
@media(max-width:680px){.visit-choices{grid-template-columns:repeat(2,minmax(0,1fr))}}

@media (orientation:landscape) {
 #tabletHome { height:100%; }
 #tabletHome .tablet-content { min-height:0; grid-template-rows:minmax(0,1fr); }
 #tabletHome .tablet-clock-card { padding-block:clamp(12px,2vh,22px); }
 #attendanceTablet .tablet-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:repeat(2,minmax(0,1fr)); }
 #attendanceTablet .tablet-actions .tablet-action { min-width:0; padding-inline:18px; }
 #attendanceTablet .tablet-access-status { grid-column:1/-1; }
}

.tablet-clock-face [hidden]{display:none!important}

#tabletSummary{padding:clamp(12px,2vw,26px);text-align:center}#tabletSummary h2{font-size:clamp(22px,3vw,42px);margin:0}#tabletSummary p{margin:.4em 0 .75em}#tabletSummary strong{font-size:clamp(19px,2.3vw,34px);line-height:1.4;white-space:pre-line}

#tabletSummaryText{display:block;overflow-wrap:anywhere;font-size:clamp(17px,2.1vw,30px)}

.tablet-clock-face{min-width:0}
#tabletSummary{min-width:0;padding-inline:8px}
#tabletSummaryText[data-line]{overflow:hidden;white-space:nowrap;line-height:1.7}
.summary-record-line{display:inline-block;max-width:none;width:max-content;white-space:nowrap}
.summary-sex{display:inline-block;border-radius:1em;padding:0 .38em;line-height:1.35}
.summary-sex.male{color:#163b69;background:#d8ebff}
.summary-sex.female{color:#75204d;background:#ffdbeb}
.summary-sex.unknown{color:inherit}
#tabletSummaryText:has(.summary-pan){text-align:start}
.summary-pan{display:block;animation:summary-read-across 9s ease-in-out infinite alternate}
@keyframes summary-read-across{0%,15%{transform:translateX(0)}85%,100%{transform:translateX(var(--shift))}}
