/* User-approved sandbox review fixes. No permission or backend changes. */
#view-home .main>.topbar{position:sticky;top:0;z-index:30}
/* Site-wide scrollbar appearance approved by the user; no overflow changes. */
html,body,body *{scrollbar-width:thin!important;scrollbar-color:#b3b9a8 transparent!important}
@supports selector(::-webkit-scrollbar){
 html,body,body *{scrollbar-width:auto!important;scrollbar-color:auto!important}
 html::-webkit-scrollbar,body::-webkit-scrollbar,body *::-webkit-scrollbar{width:6px!important;height:6px!important}
 html::-webkit-scrollbar-track,body::-webkit-scrollbar-track,body *::-webkit-scrollbar-track{background:transparent!important}
 html::-webkit-scrollbar-thumb,body::-webkit-scrollbar-thumb,body *::-webkit-scrollbar-thumb{background:#b3b9a8!important;border:0!important;border-radius:999px!important}
 html::-webkit-scrollbar-thumb:hover,body::-webkit-scrollbar-thumb:hover,body *::-webkit-scrollbar-thumb:hover{background:#89957c!important}
 html::-webkit-scrollbar-button,body::-webkit-scrollbar-button,body *::-webkit-scrollbar-button{display:none!important;width:0!important;height:0!important}
 html::-webkit-scrollbar-corner,body::-webkit-scrollbar-corner,body *::-webkit-scrollbar-corner{background:transparent!important}
}
#page-home #admin-home-150-root .admin150{padding-left:0;padding-right:0;background:transparent}
#page-home[data-home-loading=true]>:not(#home-loading-status){display:none!important}
#page-home[data-home-loading=true]::before{content:'首頁載入中…';display:block;padding:40px 0;color:var(--muted)}
.admin150 .calendar-inline-details .calendar-day-card{display:flex;align-items:center;gap:12px;box-sizing:border-box;width:100%;height:auto!important;max-height:none!important;min-height:64px!important;padding:14px!important;border:1px solid var(--gray);border-left:4px solid var(--day-band,#57634d)!important;border-radius:12px;text-align:left;white-space:normal;background:var(--white)}
.admin150 .ah-card[data-key=todo] .ah-todo-refresh{background:transparent!important;border:0!important;color:#7c806e!important;width:36px!important;height:36px!important;min-height:36px!important;max-height:36px!important;padding:0!important;font-size:22px!important;box-shadow:none!important}
/* Service tiles must not inherit the generic fixed-height button treatment. */
.admin150 .ah-services>button{height:auto!important;max-height:none!important;min-height:160px!important;display:flex;flex-direction:column;padding:20px 16px!important;gap:12px;box-sizing:border-box}
.admin150 .ah-services>button strong,.admin150 .ah-services>button small{display:block;position:static;white-space:normal}
.admin150 .ah-card:has(>.ah-view-all){display:flex;flex-direction:column}
.admin150 .ah-card>.ah-view-all{align-self:flex-end;margin-top:auto;padding:16px 0 0;color:var(--green,#59674d);font-size:12px;font-weight:700;text-decoration:none;line-height:1.5}
.admin150 .ah-card>.ah-view-all:hover{text-decoration:underline}
.admin150 .ah-card>.ah-view-all:focus-visible{outline:2px solid var(--green,#59674d);outline-offset:4px}
.admin150-dialog .ah-actions{display:flex;align-items:center;justify-content:flex-end;gap:12px;flex-wrap:wrap}
.admin150-dialog .ah-actions>button{margin:0!important;align-self:center;min-height:44px!important;height:44px!important;max-height:44px!important}
.admin150 .ah-grid>.ah-card[data-key="todo"]{border:1px solid #e9e5da;background:#e9e5da;color:#7c806e}
.admin150 .ah-card[data-key="todo"] :is(h2,button,.ah-todo-result,.ah-note){color:inherit!important}
.admin150 .ah-services>button,.admin150 .ah-services>button:nth-child(even){background:#f3f3eb!important;border-color:#e6e7da!important;color:var(--ink,#373d34)!important}
.admin150 .ah-services>button strong{color:var(--ink,#373d34)!important}
.admin150 .ah-services>button small{color:var(--muted,#787c70)!important}
.admin150 .ah-services>button svg{color:#758565!important}
.admin150 .ah-services>button:hover{background:#e8eddf!important;border-color:#aebba1!important}
#page-home[data-admin150-active=true]>.home-welcome,#page-home[data-admin150-active=true]>.home-work-banner{display:flex!important}
.admin150 .ah-header>div:first-child>.ah-kicker,.admin150 .ah-header>div:first-child>h1{display:none}
.leave-substitute-picker{box-sizing:border-box;grid-column:1/-1;min-width:0;width:100%;margin:16px 0 0;padding:16px;border:1px solid var(--gray,#d8d9cc);border-radius:12px;background:var(--white,#fffefa);display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px}
.leave-substitute-picker legend{padding:0 8px;color:var(--green,#59674d);font-weight:600}
.leave-substitute-picker :is(select,input){width:100%;min-width:0;margin:0}
.leave-substitute-picker small{grid-column:1/-1}
.leave-substitute-picker [hidden]{display:none!important}
#page-messages .message-compose>.message-compose-send,#page-messages .message-compose>.message-compose-group{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:10px 20px;border:1px solid var(--green,#59674d);border-radius:10px;margin:12px 12px 0 0;width:auto;cursor:pointer}
#page-messages .message-compose>.message-compose-send{background:var(--green,#59674d);color:#fff}
#page-messages .message-compose>.message-compose-group{background:transparent;color:var(--green,#59674d)}
#page-messages .message-compose>button:disabled{opacity:.5;cursor:not-allowed}
.access8-role-list{display:flex;flex-wrap:wrap;gap:12px;margin-bottom:20px}
.access8-role-list>section{flex:1 0 100%;display:flex;flex-wrap:wrap;gap:10px;padding:12px 0;border-bottom:1px solid var(--gray,#d8d9cc)}
.access8-role-list>section>p{flex:1 0 100%;margin:0 0 4px}
.access8-role-list button{margin:0;min-height:44px}
.access8-role-list button[aria-pressed="true"]{background:var(--green,#59674d);border-color:var(--green,#59674d);color:#fff}
.ledger-filters>.ledger-filter-chip-group{grid-column:1/-1;display:flex;align-items:flex-start;gap:12px;min-width:0;width:100%}
.ledger-filter-chip-group>small{flex:0 0 5em;padding-top:10px}
.ledger-filter-chip-group>.ledger-chips{display:flex;flex-direction:row;flex-wrap:wrap;gap:8px;min-width:0}
.ledger-filter-chip-group>.ledger-chips>button{width:auto;margin:0;min-height:40px}
@media(max-width:600px){.leave-substitute-picker{grid-template-columns:minmax(0,1fr)}.ledger-filters>.ledger-filter-chip-group{flex-direction:column;gap:6px}.ledger-filter-chip-group>small{flex:auto;padding-top:0}.access8-role-list>section{gap:8px}}

/* Keep daily events compact regardless of the available calendar height. */
.admin150 .home-calendar152 .calendar-day-list{align-content:start;grid-auto-rows:80px}
.admin150 .home-calendar152 .calendar-inline-details .calendar-day-card{height:80px!important;min-height:80px!important;max-height:80px!important;align-self:start;min-width:0;overflow:hidden}
.admin150 .home-calendar152 .calendar-day-description strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.home-calendar-add-footer{display:flex;justify-content:flex-end;margin-top:16px}

/* Keep duplicate dates out of the home toolbar. */
#page-home #admin-home-150-root .admin150{padding-top:12px}
.admin150 .ah-header{justify-content:flex-end;margin-bottom:12px}
/* Home toolbar: one row on desktop, two rows on mobile. */
.admin150 .ah-header{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:0 16px;margin:0 0 16px}
.admin150 .ah-header>.ah-filters{grid-column:1/-1;grid-row:1;margin:0;min-width:0}
.admin150 .ah-header>.ah-filters>summary{width:fit-content;max-width:calc(100% - 320px);min-height:40px;box-sizing:border-box;padding:10px 0;font-size:13px;cursor:pointer}
.admin150 .ah-header>.ah-actions{grid-column:2;grid-row:1;align-self:start;gap:8px;flex-wrap:nowrap}
.admin150 .ah-header>.ah-actions>button{font-size:13px!important;height:40px!important;min-height:40px!important;max-height:40px!important;padding:8px 12px!important;margin:0!important}
.admin150 .ah-header>.ah-actions>.ah-home-refresh{width:40px!important;min-width:40px;font-size:22px!important;padding:0!important}
.admin150 .ah-header>.ah-filters[open]>form{padding-top:4px}
@media(max-width:700px){
 .admin150 .ah-header{grid-template-columns:minmax(0,1fr);row-gap:10px}
 .admin150 .ah-header>.ah-filters{grid-column:1;grid-row:1}
 .admin150 .ah-header>.ah-filters>summary{max-width:100%}
 .admin150 .ah-header>.ah-actions{grid-column:1;grid-row:2;justify-self:end}
}/* Home actions use the same quiet text treatment as View all. */
.admin150 .ah-header>.ah-actions{gap:18px}
.admin150 .ah-header>.ah-actions>button{background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important;color:var(--green,#59674d)!important;font-size:12px!important;font-weight:700!important;padding:8px 0!important;height:36px!important;min-height:36px!important;max-height:36px!important}
.admin150 .ah-header>.ah-actions>button:hover{text-decoration:underline;background:transparent!important}
.admin150 .ah-header>.ah-actions>button:focus-visible{outline:2px solid var(--green,#59674d);outline-offset:3px}
.admin150 .ah-header>.ah-actions>.ah-home-refresh{width:28px!important;min-width:28px;font-size:20px!important}
.admin150 .ah-header>.ah-actions>.ah-home-refresh{width:auto!important;min-width:0;font-size:12px!important;white-space:nowrap}

/* Homepage previews match today's punch card; long content scrolls inside. */
.admin150 .ah-card:is([data-key=announcements],[data-key=notices]){display:flex;flex-direction:column;box-sizing:border-box;height:var(--ah-home-preview-height,380px);min-height:0;overflow:hidden}
.admin150 .ah-card:is([data-key=announcements],[data-key=notices])>.ah-list{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain}
.admin150 .ah-card:is([data-key=announcements],[data-key=notices])>:not(.ah-list){flex-shrink:0}
