:root .history-browser-bar { position:absolute; z-index:13; top:calc(68px + env(safe-area-inset-top,0px)); inset-inline:0; display:block; padding:0 16px 6px; background:var(--locket-ui-bg); pointer-events:none; }
:root .locket-phone-card #screenHistory:not([data-history-view="feed"]) .history-top-bar { height:68px; padding-block:10px; background:var(--locket-ui-bg); }
:root :is(#historyGridView,#historyCalendarView) { top:calc(152px + env(safe-area-inset-top,0px)); height:auto; overflow:hidden; transform:none; transition:opacity .18s ease,visibility .18s; }
:root .locket-phone-card :is(#historyGridView,#historyCalendarView) { background:var(--locket-ui-bg)!important; }
:root #screenHistory.active:not([data-history-view="feed"]) { animation-name:native-screen-enter; transform:none; }
:root .history-browser-bar[hidden] { display:none!important; }
:root .history-browser-bar button { width:auto; height:auto; font-family:var(--locket-font-family); touch-action:manipulation; -webkit-tap-highlight-color:transparent; }
.history-browser-main { display:flex; align-items:center; gap:9px; pointer-events:auto; }
.history-view-switch { display:flex; flex:1; min-width:0; padding:4px; gap:3px; background:var(--locket-ui-raised); border-radius:999px; }
:root .history-view-switch > button { display:flex; flex:1; align-items:center; justify-content:center; gap:5px; min-width:0; min-height:36px; padding:5px 8px; border:0; border-radius:999px; background:transparent; color:var(--locket-ui-muted); font-size:13px; font-weight:700; white-space:nowrap; cursor:pointer; transition:background .2s,color .2s,transform .2s var(--native-ease); }
:root .history-view-switch > button[aria-pressed="true"] { background:var(--locket-ui-card); color:var(--locket-ui-text); box-shadow:0 2px 6px #00000008; }
:root .history-browser-bar .native-icon { width:18px; height:18px; }
:root .history-browser-bar .history-options-toggle { position:relative; display:grid; place-items:center; flex:0 0 44px; width:44px; height:44px; min-height:44px; padding:0; border:0; border-radius:16px; background:var(--locket-ui-raised); color:var(--locket-ui-text); cursor:pointer; transition:background .18s,transform .18s; }
:root .history-browser-bar .history-options-toggle .native-icon { width:22px; height:22px; }
:root .history-browser-bar .history-options-toggle[aria-expanded="true"] { background:var(--locket-ui-card); box-shadow:inset 0 0 0 1px var(--locket-ui-border); }
:root .history-browser-bar .history-options-toggle:active { transform:scale(.94); }
.history-options-toggle.has-filter::after { content:""; position:absolute; top:6px; right:6px; width:6px; height:6px; border-radius:50%; background:var(--bs-primary); box-shadow:0 0 0 2px var(--locket-ui-card); }
.history-browser-summary { display:flex; align-items:center; justify-content:space-between; gap:10px; min-height:34px; padding:2px 4px 0; color:var(--locket-ui-muted); font:500 12px/1.4 var(--locket-font-sans,var(--locket-font-family)); }
:root .history-browser-summary > button { display:inline-flex; gap:5px; align-items:center; min-height:32px; padding:3px 0 3px 8px; border:0; background:transparent; color:var(--locket-ui-muted); font-size:12px; cursor:pointer; pointer-events:auto; }
:root .history-browser-summary .native-icon { width:14px; height:14px; }
.history-options-panel { position:absolute; z-index:2; top:calc(100% - 2px); inset-inline:16px; padding:17px; border:1px solid var(--locket-ui-border); border-radius:24px; background:var(--locket-ui-card); color:var(--locket-ui-text); box-shadow:0 12px 32px #0000001a; pointer-events:auto; }
.history-options-panel[hidden] { display:none; }
.history-options-panel > header { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.history-options-panel > header strong { font-size:16px; }
:root .history-options-panel > header button { min-height:32px; padding:3px 0 3px 10px; border:0; background:transparent; color:var(--locket-accent-text); font-size:12px; cursor:pointer; }
.history-options-panel fieldset { margin:0; padding:0; border:0; }
.history-options-panel fieldset + fieldset { margin-top:16px; }
.history-options-panel legend { margin-bottom:8px; color:var(--locket-ui-muted); font-size:12px; font-weight:600; }
.history-option-choices { display:flex; gap:6px; }
:root .history-option-choices button { flex:1; display:block; min-height:39px; padding:6px; border:1px solid transparent; border-radius:13px; background:var(--locket-ui-raised); color:var(--locket-ui-muted); font-size:14px; font-weight:600; cursor:pointer; }
:root .history-option-choices button[aria-pressed="true"] { border-color:color-mix(in srgb,var(--bs-primary) 45%,var(--locket-ui-border)); background:color-mix(in srgb,var(--bs-primary) 12%,var(--locket-ui-card)); color:var(--locket-ui-text); }
:root .history-grid-scroll { padding-top:10px; }
:root .history-grid { grid-template-columns:repeat(var(--history-columns,3),minmax(0,1fr)); }
.history-video-badge .native-icon { width:14px; height:14px; }
.history-day-group { padding:0 11px; margin-bottom:28px; }
.history-day-group > header { display:flex; align-items:center; gap:10px; margin-bottom:12px; }
.history-day-group > header > span { display:grid; place-items:center; width:38px; height:38px; flex:0 0 38px; border-radius:14px; background:var(--locket-ui-raised); color:var(--locket-accent-text); }
.history-day-group > header .native-icon { width:20px; height:20px; }
.history-day-group h3 { margin:0 0 2px; color:var(--locket-ui-text); font-size:18px; line-height:1.3; }
.history-day-group small { color:var(--locket-ui-muted); font:500 12px/1.4 var(--locket-font-sans,var(--locket-font-family)); }
.history-day-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.history-tile-caption { position:absolute; inset:auto 0 0; padding:24px 10px 9px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; background:linear-gradient(transparent,#000000a6); color:#fff; font:600 12px/1.3 var(--locket-font-sans,var(--locket-font-family)); text-align:left; }
:root .native-calendar-scroll { box-sizing:border-box; width:100%; min-width:0; max-width:640px; min-height:0; margin:0 auto; padding-top:12px; scrollbar-gutter:stable; overflow-anchor:none; }
.native-calendar-slot { min-width:0; aspect-ratio:.8; }
:root .native-calendar-day { box-sizing:border-box; width:100%; height:100%; min-height:0; padding:0; }
.native-calendar-days,.native-weekdays,.native-day-preview { width:100%; min-width:0; }
.native-calendar-day img { display:block; }
:root .native-calendar-heading .native-month-select { display:flex; justify-content:center; align-items:center; gap:6px; flex:1; width:auto; min-width:0; padding:0; border-radius:16px; background:transparent; font:800 clamp(18px,5vw,24px)/1.3 var(--locket-font-family); }
.native-month-select > .native-icon { width:14px; height:14px; transform:rotate(90deg); color:var(--locket-ui-muted); }
.native-month-meta { display:flex; align-items:center; justify-content:space-between; gap:8px; margin:14px 0 23px; }
:root .native-month-meta #nativeCalendarSummary { flex:1; min-width:0; margin:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-align:left; font:500 12px/1.5 var(--locket-font-sans,var(--locket-font-family)); }
#nativeCalendarSummary[aria-busy="true"]::before { content:""; display:inline-block; width:5px; height:5px; margin:0 6px 2px 0; border-radius:50%; background:currentColor; animation:history-loading .9s ease-in-out infinite alternate; }
.native-month-meta > button { flex-shrink:0; min-height:34px; padding:5px 10px; border:0; border-radius:99px; background:var(--locket-ui-raised); color:var(--locket-ui-text); font:600 12px var(--locket-font-family); cursor:pointer; }
.native-month-picker { margin-top:14px; padding:14px; border:1px solid var(--locket-ui-border); border-radius:24px; background:var(--locket-ui-card); }
.native-month-picker[hidden] { display:none; }
.native-month-year { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:12px; }
.native-month-year > button { width:36px; height:36px; padding:0; border:0; border-radius:50%; background:var(--locket-ui-raised); color:var(--locket-ui-text); font:600 25px/1 var(--locket-font-family); cursor:pointer; }
.native-month-year > label { display:flex; align-items:center; justify-content:center; gap:8px; color:var(--locket-ui-muted); font:600 13px var(--locket-font-family); }
.native-month-year input { width:78px; min-width:0; padding:5px; border:1px solid var(--locket-ui-border); border-radius:12px; background:var(--locket-ui-card); color:var(--locket-ui-text); font:700 18px var(--locket-font-family); text-align:center; appearance:textfield; -moz-appearance:textfield; }
.native-month-year input::-webkit-inner-spin-button,.native-month-year input::-webkit-outer-spin-button { appearance:none; margin:0; }
.native-month-choices { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; }
.native-month-choices > button { min-height:40px; padding:5px; border:1px solid transparent; border-radius:13px; background:var(--locket-ui-raised); color:var(--locket-ui-text); font:600 13px var(--locket-font-family); cursor:pointer; }
.native-month-choices > button[aria-pressed="true"] { border-color:var(--bs-primary); background:color-mix(in srgb,var(--bs-primary) 12%,var(--locket-ui-card)); }
.native-month-picker button:disabled { opacity:.35; cursor:default; }
.native-calendar-day[aria-pressed="true"]::after { content:""; position:absolute; inset:0; border:2px solid var(--bs-primary); border-radius:inherit; pointer-events:none; }
.native-day-count { position:absolute; top:3px; right:3px; display:grid; place-items:center; min-width:15px; height:15px; padding:0 3px; border-radius:99px; background:#00000085; color:#fff; font:700 9px/1 var(--locket-font-sans,var(--locket-font-family)); }
.native-day-preview { margin-top:24px; padding-top:18px; border-top:1px solid var(--locket-ui-border); }
.native-day-preview[hidden] { display:none; }
.native-day-preview > header { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:12px; }
.native-day-preview h3 { margin:0; color:var(--locket-ui-text); font-size:17px; }
.native-day-preview header > span { flex-shrink:0; color:var(--locket-ui-muted); font:500 11px var(--locket-font-sans,var(--locket-font-family)); }
.native-day-gallery { display:grid; width:calc(100% + 4px); min-width:0; grid-auto-flow:column; grid-auto-columns:calc((100% - 24px)/3); gap:10px; overflow-x:auto; overscroll-behavior-x:contain; scroll-snap-type:x proximity; padding:2px; margin:-2px; }
:root .native-day-gallery > .history-cell { border-radius:18px; scroll-snap-align:start; animation:none; }
.native-day-gallery .history-cell img { width:100%; height:100%; object-fit:cover; }
[data-moment-media-id][data-media-unavailable="true"] { object-fit:contain!important; padding:18%; background:var(--locket-ui-raised); opacity:.6; }
.native-day-gallery .history-tile-caption { font-size:10px; padding:20px 7px 6px; }
.history-load-status { display:flex; justify-content:center; align-items:center; flex-wrap:wrap; gap:9px; min-height:38px; margin:18px 12px 0; color:var(--locket-ui-muted); font:500 12px/1.5 var(--locket-font-sans,var(--locket-font-family)); text-align:center; }
.history-load-status[hidden],.history-load-status button[hidden] { display:none; }
.history-load-status button { min-height:36px; padding:5px 10px; border:0; border-radius:12px; background:var(--locket-ui-raised); color:var(--locket-ui-text); font:600 13px var(--locket-font-family); cursor:pointer; }
.history-load-dots { display:inline-flex; align-items:center; gap:3px; }
.history-load-dots i { width:4px; height:4px; border-radius:50%; background:currentColor; animation:history-loading .9s ease-in-out infinite alternate; }
.history-load-dots i:nth-child(2) { animation-delay:.15s; }
.history-load-dots i:nth-child(3) { animation-delay:.3s; }
.history-load-status[data-state="error"] .history-load-dots { display:none; }
@keyframes history-loading { from {opacity:.25;transform:translateY(1px)} to {opacity:.8;transform:translateY(-1px)} }
:root :is(.history-browser-bar,.native-month-picker,.native-day-preview) button:focus-visible { outline:2px solid var(--bs-primary); outline-offset:3px; }
@media (max-width:360px) { :root .history-browser-bar { padding-inline:10px; } :root .history-view-switch > button { gap:3px; padding-inline:5px; font-size:12px; } .history-browser-main { gap:6px; } .history-options-panel { inset-inline:10px; } :root .native-calendar-scroll { padding-inline:16px; } }
@media (prefers-reduced-motion:reduce) { .history-view-switch > button,:root .history-options-toggle { transition:none; } .history-load-dots i,#nativeCalendarSummary::before { animation:none; } }
