#historyOpen{display:block;margin:12px auto 0;padding:9px 22px;border:0;border-radius:22px;background:#fff7e6d9;color:#28595b;font:inherit;font-weight:700;min-height:44px}
#lexyHistory{box-sizing:border-box;width:min(680px,calc(100vw - 24px));max-height:calc(100dvh - 32px);overflow:auto;--profile-padding:clamp(16px,4vw,28px);padding:var(--profile-padding);border:0;border-radius:28px;background:#fff9ea;color:#28595b}
#lexyHistory::backdrop{background:#244d4d77;backdrop-filter:blur(5px)}
#lexyHistory header{display:flex;justify-content:space-between;align-items:center;gap:12px}#lexyHistory h2{margin:0;font-size:30px}#lexyHistory h3{margin:22px 0 12px;font-size:22px}
#lexyHistory button{min-height:44px;border:0;border-radius:22px;background:#28595b;color:#fff9ea;padding:10px 16px;font:inherit}.history-close{min-width:44px}
#lexyHistory [role=status]{font-size:14px;line-height:1.45;margin:12px 0;color:#58736d}
.history-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:0}.history-stats>div{background:#e9efdf;padding:12px;border-radius:14px;min-width:0}.history-stats dt{font-size:13px}.history-stats dd{margin:4px 0 0;font-size:21px;font-weight:700;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.history-closet{list-style:none;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding:0;margin:0}.history-closet li{min-width:0;text-align:center;padding:8px;border-radius:16px;background:#f5e8c9}.history-closet canvas{width:100%;height:auto;display:block}.history-closet strong,.history-closet span{display:block;overflow-wrap:anywhere}.history-closet strong{font-size:15px}.history-closet span{font-size:12px;margin:6px 0}.history-closet .locked{background:#edeade;color:#697a72}.closet-count{font-size:14px}
@media(max-width:480px){.history-stats,.history-closet{grid-template-columns:repeat(2,minmax(0,1fr))}}
/* Override the game canvas/header positioning only inside this dialog. */
#lexyHistory header{position:static;inset:auto;width:auto;padding:0;pointer-events:auto;z-index:auto}
#lexyHistory canvas{position:static;inset:auto;touch-action:auto}

#lexyHistory .history-level{background:#dcece6;border-radius:18px;padding:16px;margin:16px 0;overflow-wrap:anywhere}
#lexyHistory .level-title{margin:0 0 12px;font-size:25px}
#lexyHistory .level-caption{font-size:14px;margin:8px 0 0}
#lexyHistory progress{display:block;width:100%;height:12px;border:0;border-radius:9px;overflow:hidden;accent-color:#287b78;background:#fff9ea}
#lexyHistory progress::-webkit-progress-bar{background:#fff9ea;border-radius:9px}
#lexyHistory progress::-webkit-progress-value{background:#287b78;border-radius:9px}
#lexyHistory progress::-moz-progress-bar{background:#287b78;border-radius:9px}
#lexyHistory .history-daily {margin-block:1.3rem;padding-block:1rem;border-block:1px solid #28595b25;}
#lexyHistory .daily-reset {font-size:.85rem;opacity:.8;margin-top:.2rem;}
#lexyHistory .daily-card {background:#fff9e9;border-radius:16px;padding:12px;margin:10px 0;min-width:0;}
#lexyHistory .daily-card p {margin:6px 0;}
#lexyHistory .daily-card progress {width:100%;accent-color:#28595b;}
#lexyHistory .daily-card small {display:block;overflow-wrap:anywhere;}
#lexyHistory .daily-card.complete {background:transparent;}
#lexyHistory .daily-bonus {padding:10px;border-radius:12px;background:#f5e6bc;font-weight:700;}
#lexyHistory .daily-bonus.celebrate {animation:daily-shine 1.1s ease-out;}
#lexyHistory .history-daily details {font-size:.85rem;}
@keyframes daily-shine {0%{box-shadow:0 0 0 0 #dfa84088}55%{box-shadow:0 0 0 8px #dfa84022}100%{box-shadow:0 0 0 0 transparent}}
@media(prefers-reduced-motion:reduce){#lexyHistory .daily-bonus.celebrate{animation:none}}
#lexyHistory .history-weekly {margin-block:1.3rem;padding:14px;background:#e8f0ed;border-radius:18px;}
#lexyHistory .weekly-reset {font-size:.85rem;opacity:.8;}
#lexyHistory .history-weekly progress {width:100%;accent-color:#28595b;}
#lexyHistory .weekly-count {font-size:.9rem;overflow-wrap:anywhere;}
#lexyHistory .weekly-milestones {list-style:none;padding:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;}
#lexyHistory .weekly-milestones li {padding:8px 2px;text-align:center;border-radius:10px;background:#fff9e9;min-width:0;overflow-wrap:anywhere;}
#lexyHistory .weekly-milestones small {display:block;margin-top:4px;}
#lexyHistory .weekly-milestones .reached {background:#d3e8df;}
#lexyHistory .weekly-message {border-radius:12px;padding:8px;font-weight:700;}
#lexyHistory .weekly-message.celebrate {animation:daily-shine 1.1s ease-out;}
@media(prefers-reduced-motion:reduce){#lexyHistory .weekly-message.celebrate{animation:none}}
/* Local stabilization: reachable controls and compact history sections. */
#lexyHistory header{flex-wrap:nowrap}
#lexyHistory h2{font-size:clamp(22px,5vw,30px)}
#lexyHistory .history-close{flex-shrink:0}
#lexyHistory .history-help{font-size:.85rem;line-height:1.5;color:#58736d}
#lexyHistory .history-section{margin:14px 0;border-top:1px solid #28595b25;padding-top:12px}
#lexyHistory summary{cursor:pointer;font-weight:700;min-height:44px;align-content:center}
#historyOver{display:block;margin:10px auto;padding:8px 16px;border:0;border-radius:20px;background:#e3eee5;color:#28595b;font:inherit}
@media(max-width:350px){#lexyHistory{--profile-padding:12px;padding:var(--profile-padding)}.weekly-milestones{font-size:.85rem}}
/* Details now sit behind the game shell; the collection leads this view. */
#lexyHistory .history-level{margin:10px 0;padding:12px 14px}
#lexyHistory .history-collection h3{display:flex;justify-content:space-between;align-items:baseline;gap:8px}
#lexyHistory .history-closet{display:grid;grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:43%;overflow-x:auto;scroll-snap-type:x proximity;padding:0 0 10px;scrollbar-width:thin;scrollbar-color:#628783 #efe7d4}
#lexyHistory .history-closet li{scroll-snap-align:start}
#lexyHistory .history-help{margin:6px 0 10px}
#lexyHistory .history-daily{padding:0;margin:10px 0;border:0}
#lexyHistory .daily-card{display:grid;grid-template-columns:1fr auto;gap:3px 8px;margin:7px 0;padding:8px;background:#edf1e4}
#lexyHistory .daily-card strong{font-size:11px}#lexyHistory .daily-card p{grid-column:1 / -1;margin:0;font-size:13px}
#lexyHistory .daily-card progress{grid-column:1 / -1;height:6px}#lexyHistory .daily-card small{grid-column:1 / -1;font-size:11px}
#lexyHistory .daily-bonus{padding:6px;font-size:12px}
#lexyHistory .history-weekly{padding:10px;margin:12px 0}
#lexyHistory .history-weekly h3{margin:0 0 6px}
#lexyHistory .weekly-milestones li{padding:3px;font-size:11px}
#lexyHistory .weekly-message{padding:3px;margin:4px 0;font-size:12px}
@media(min-width:600px){#lexyHistory .history-closet{grid-auto-columns:29%}}
#lexyHistory .history-save-row{display:flex;align-items:center;gap:8px}#lexyHistory .history-save-row [role=status]{flex:1;margin:5px 0}#lexyHistory .history-refresh{background:transparent;color:#28595b;padding:6px;min-width:44px;font-size:23px}#lexyHistory .history-collection{margin:6px 0;padding-top:0}#lexyHistory .history-collection h3{margin:12px 0 8px}
/* My Lexy challenge details: one adventure list, not a stack of report cards. */
#lexyHistory .history-daily h3,#lexyHistory .history-weekly h3{font-size:clamp(20px,4.7vw,25px);letter-spacing:-.025em}
#lexyHistory .daily-card{display:grid;grid-template-columns:38px minmax(0,1fr);gap:3px 12px;padding:14px 0;margin:0;border-radius:0;border-bottom:1px dashed #28595b30;background:transparent}
#lexyHistory .daily-card:last-of-type{border-bottom:0}
#lexyHistory .daily-token{grid-column:1;grid-row:1 / 4;align-self:center;display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:#f6df9e;color:#885021;font-size:25px;font-weight:700;transform:rotate(-8deg)}
#lexyHistory .daily-card.complete .daily-token{background:transparent;transform:none}
#lexyHistory .daily-card strong{grid-column:2;font-size:12px;color:#68786b;font-weight:600}
#lexyHistory .daily-card p{grid-column:2;grid-row:2;font-size:16px;line-height:1.3;font-weight:700;overflow-wrap:anywhere}
#lexyHistory .daily-card small{grid-column:2;grid-row:3;font-size:13px;line-height:1.45;color:#58736d}
#lexyHistory .daily-bonus{background:transparent;border-left:3px solid #dba947;border-radius:0;padding:6px 10px;margin:12px 0 18px;font-size:13px}
#lexyHistory .history-weekly{background:transparent;border-radius:0;border-top:1px solid #28595b25;margin:18px 0 0;padding:18px 0 0}
#lexyHistory .weekly-objective{font-weight:700;font-size:18px;line-height:1.35;margin:14px 0 9px}
#lexyHistory .history-weekly progress{height:7px;background:#e7e5d3}
#lexyHistory .history-weekly progress::-webkit-progress-bar{background:#e7e5d3}
#lexyHistory .weekly-count{margin:8px 0 12px;font-size:14px}
#lexyHistory .weekly-milestones{position:relative;gap:0;margin:12px 0;isolation:isolate}
#lexyHistory .weekly-milestones:before{content:'';position:absolute;top:15px;left:12.5%;right:12.5%;height:2px;background:#cfdbcd;z-index:-1}
#lexyHistory .weekly-milestones li,#lexyHistory .weekly-milestones .reached{background:transparent;border-radius:0;padding:0 2px;font-size:12px}
#lexyHistory .weekly-marker{display:grid;place-items:center;margin:0 auto 6px;width:30px;height:30px;border-radius:50%;background:#fff9ea;border:2px solid #bdcdbd;box-sizing:border-box;color:#58736d;font-size:19px}
#lexyHistory .reached .weekly-marker{background:#28595b;color:#fff9ea;border-color:#28595b}
#lexyHistory .weekly-milestones small{margin-top:3px;color:#68786b}
#lexyHistory .weekly-message{font-weight:500;font-size:13px;color:#58736d;margin:10px 0}
#lexyHistory .history-stats dt{display:flex;align-items:center;gap:7px;line-height:1.25}
#lexyHistory .stat-icon{display:inline-grid;place-items:center;flex:0 0 25px;width:25px;height:25px;font-size:20px;line-height:1;color:#b58a25}
#lexyHistory .history-stats dd{margin-top:8px}
.points-key{font-size:13px;line-height:1.4;color:#28595b;text-align:center}

/* Confirmed identity shares the compact Level header. */
#lexyHistory .history-level{display:grid;grid-template-columns:72px minmax(0,1fr);column-gap:12px;align-items:center}
#lexyHistory .history-avatar{grid-column:1;grid-row:1 / 5;width:72px;height:72px;background:transparent;mix-blend-mode:darken}
#lexyHistory .history-level .level-title,#lexyHistory .history-level .history-outfit,#lexyHistory .history-level progress,#lexyHistory .history-level .level-caption{grid-column:2}
#lexyHistory .history-outfit{margin:2px 0 8px;font-size:14px;font-weight:700}
/* A focused grid inside the same dialog, keeping the original collection nodes. */
#lexyHistory .history-collection h3{flex-wrap:wrap}
#lexyHistory .closet-all{margin-left:auto;padding:6px 12px;font-size:13px;min-height:36px;background:#e0ece6;color:#28595b;font-weight:800}
#lexyHistory .closet-back{background:#e0ece6;color:#28595b;font-weight:800;padding:8px 14px}
#lexyHistory .closet-back[hidden]{display:none}
#lexyHistory.closet-expanded .history-body> :not(.history-collection){display:none}
#lexyHistory.closet-expanded .history-collection{border:0;margin:0;padding:0}
#lexyHistory.closet-expanded .history-collection h3{font-size:0;margin:8px 0 14px}
#lexyHistory.closet-expanded .closet-all,#lexyHistory.closet-expanded .history-help{display:none}
#lexyHistory.closet-expanded .history-closet{grid-auto-flow:row;grid-auto-columns:auto;grid-template-columns:repeat(3,minmax(0,1fr));overflow:visible;scroll-snap-type:none;padding:0}
#lexyHistory.closet-expanded header h2{margin-right:auto}
@media(max-width:480px){#lexyHistory.closet-expanded .history-closet{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Header is outside the scrolling viewport: no sticky compositing or overlap. */
#lexyHistory{padding:0;overflow:hidden;isolation:isolate;max-height:calc(100dvh - 32px)}
#lexyHistory[open]{display:flex;flex-direction:column}
#lexyHistory>header{position:relative;inset:auto;flex:0 0 auto;margin:0;padding:16px var(--profile-padding);background:#fff9ea;box-shadow:none;border-bottom:1px solid #28595b14;z-index:1}
#lexyHistory .history-body{min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;padding:0 var(--profile-padding) var(--profile-padding);scrollbar-width:thin}

/* Closet tiles have their own small detail view in both the rail and full grid. */
#lexyHistory .history-closet li{display:flex;flex-direction:column;min-height:240px}
#lexyHistory .closet-face{display:flex;flex:1;flex-direction:column;align-items:center;justify-content:center;width:100%;padding:0;border:0;background:transparent;color:inherit;font:inherit;border-radius:10px}
#lexyHistory .closet-face canvas{position:static;pointer-events:none;max-width:160px}
#lexyHistory .closet-tile-actions,#lexyHistory .closet-tile-details{display:flex;flex:1;flex-direction:column;justify-content:center;gap:8px;padding:4px;overflow-wrap:anywhere}
#lexyHistory .closet-tile-actions button,#lexyHistory .closet-tile-details button{min-height:44px;width:100%;border:1px solid #28595b30;border-radius:12px;padding:8px 4px;background:#fff9ea;color:#28595b;font-size:13px;font-weight:700}
#lexyHistory .closet-tile-actions .closet-use{background:#28595b;color:#fff9ea}
#lexyHistory .closet-tile-actions>strong{margin-bottom:6px}
#lexyHistory .closet-tile-details p{font-size:14px;line-height:1.4;margin:4px 0;text-align:left}
#lexyHistory .closet-tile-details small{font-size:11px;opacity:.8}
#lexyHistory .closet-tile-details button{margin-top:auto}
#avatarPicker.avatar-confirm .avatar-options{grid-template-columns:minmax(0,180px);justify-content:center}
#avatarPicker.avatar-confirm .avatar-options button{pointer-events:none}
#avatarPicker.avatar-confirm .avatar-options canvas{mix-blend-mode:darken}

#lexyHistory .history-closet li{isolation:isolate}
#lexyHistory .history-closet canvas{mix-blend-mode:darken}
#lexyHistory .weekly-milestone-target{display:block;font-size:12px;font-weight:700;line-height:1.25;margin:4px 0;color:#28595b;overflow-wrap:anywhere}

#lexyHistory .closet-selected{color:#276647;background:#dcebd8;border-radius:10px;padding:9px 5px;font-size:12px;font-weight:700;line-height:1.4;text-align:center}

/* Distinct actions: a light peek, a filled profile action, then a quiet return. */
#lexyHistory .closet-tile-actions .closet-info,#lexyHistory .closet-tile-actions .closet-use{display:flex;align-items:center;justify-content:center;gap:7px;padding:10px 7px;line-height:1.25}
#lexyHistory .closet-tile-actions .closet-info{background:#fff9eac9;border:0;box-shadow:inset 0 -2px #d7caa74d}
#lexyHistory .closet-tile-actions .closet-use{border:0;box-shadow:0 2px 0 #194546}
#lexyHistory .closet-info::before,#lexyHistory .closet-use::before{content:'';display:block;flex:0 0 18px;width:18px;height:18px;background:currentColor;mask-position:center;mask-size:contain;mask-repeat:no-repeat}
#lexyHistory .closet-info::before{mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/g%3E%3C/svg%3E")}
#lexyHistory .closet-use::before{mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21v-2a8 6 0 0 1 16 0v2'/%3E%3C/g%3E%3C/svg%3E")}
#lexyHistory .closet-tile-actions .closet-back-link,#lexyHistory .closet-tile-details .closet-back-link{background:transparent;border:0;box-shadow:none;font-size:12px;font-weight:500;text-decoration:underline;text-underline-offset:3px;color:#536d65}

#lexyHistory .closet-tile-details p{white-space:pre-line}

/* Two columns keep long names from competing with the portrait and badge. */
#lexyHistory .history-level{grid-template-columns:112px minmax(0,1fr);gap:7px 16px;padding:18px;margin:12px 0 20px;background:#e2eee7;border:1px solid #28595b12;border-radius:22px}
#lexyHistory .history-level .history-avatar{grid-column:1;grid-row:1 / 5;position:static;width:112px;height:auto;aspect-ratio:12 / 11;align-self:center;justify-self:center;object-fit:contain}
#lexyHistory .history-level .profile-name-edit{grid-column:2;grid-row:1;padding:0;margin:0;min-height:0;text-align:left;align-self:end;font-size:22px;line-height:1.2;overflow-wrap:anywhere}
#lexyHistory .history-level .history-outfit{grid-column:2;grid-row:3;font-size:13px;color:#597268;margin:0;line-height:1.4;overflow-wrap:normal}
#lexyHistory .history-level .level-title{grid-column:2;grid-row:2;justify-self:start;font-size:12px;white-space:nowrap;border-radius:8px;background:#28595b;color:#fff;padding:4px 9px;margin:0}
#lexyHistory .history-level #avatarEdit{grid-column:2;grid-row:4;justify-self:start;min-height:32px;padding:5px 15px;margin:2px 0 0;font-size:13px}
#lexyHistory .history-level .level-meter-label{grid-column:1 / -1;display:flex;justify-content:space-between;gap:10px;font-size:12px;margin-top:12px}
#lexyHistory .history-level progress{grid-column:1 / -1;height:11px;margin:0}
#lexyHistory .history-level .level-caption{grid-column:1 / -1;text-align:center;font-size:12px;line-height:1.4;margin:3px 0 0;color:#526d62}
@media(max-width:370px){#lexyHistory .history-level{grid-template-columns:96px minmax(0,1fr);padding:14px;column-gap:12px}#lexyHistory .history-level .history-avatar{width:96px}#lexyHistory .history-level .profile-name-edit{font-size:19px}}

#lexyHistory .history-closet li{position:relative}

#lexyHistory .closet-wearing-tick{position:absolute;top:9px;left:9px;width:25px;height:25px;border-radius:50%;display:grid;place-items:center;background:#367652;color:#fff;font-size:17px;font-weight:800;z-index:2}
#lexyHistory .closet-wearing-tick[hidden]{display:none}

#lexyHistory .run-log>summary{font:800 19px/1.3 Nunito,sans-serif;cursor:pointer;padding:8px 0;color:#28595b}
.run-log-list{display:grid;gap:22px}.run-log-entry{background:var(--menu-soft,#edf4f1);border:1px solid #d6e0e1;border-radius:14px;padding:14px;overflow:hidden}.run-log-entry>summary{cursor:pointer;list-style:none}.run-log-entry>summary::-webkit-details-marker{display:none}
.run-log-top{display:flex;justify-content:space-between;gap:8px;align-items:baseline}.run-log-top time{font-size:12px;color:#52736d}.run-log-top strong{font-size:15px;white-space:nowrap}
.run-log-meta{display:flex;flex-wrap:wrap;gap:5px 12px;font-size:12px;margin-top:5px}.run-log-detail{padding-top:8px;font-size:12px}.run-log-detail p{margin:5px 0}.run-log>button{border:0;border-radius:12px;padding:10px 16px;margin-top:10px;background:var(--menu-soft);color:inherit;font-weight:800}

.run-log-entry>time{display:block;font-size:12px;font-weight:700;color:#52736d;margin-bottom:10px}
.run-log-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 16px}.run-log-grid small,.run-log-grid strong{display:block}.run-log-grid small{font-size:11px;color:#52736d}.run-log-grid strong{font-size:17px;line-height:1.3}
.run-log-rewards{margin-top:10px}.run-log-rewards>summary{font-size:12px;font-weight:800;cursor:pointer}.run-log-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}.run-log-chips>span{font-size:11px;padding:5px 8px;border-radius:9px;background:var(--menu-surface,#fff)}.run-log-entry>small{display:block;font-size:10px;color:#52736d;margin-top:8px}

#lexyHistory .history-closet li{height:290px;min-height:290px;box-sizing:border-box;overflow:hidden}
#lexyHistory .closet-face{height:100%;min-height:0;overflow:hidden}#lexyHistory .closet-face canvas{max-height:160px;object-fit:contain}
#lexyHistory .closet-requirement{display:block;font-size:11px;line-height:1.3;margin-top:5px;color:#52736d}
#lexyHistory .closet-tile-details,#lexyHistory .closet-tile-actions{min-height:0;height:100%;box-sizing:border-box;overflow:hidden;flex-shrink:1}
#lexyHistory .closet-tile-details p{min-height:0;flex:1;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;padding-right:5px}
#lexyHistory .closet-tile-details .closet-scroll-hint{font-size:10px;color:#52736d;flex:none}
#lexyHistory .closet-tile-details button{flex:none}

/* Run totals and level grants are distinct, with all rewards visible. */
.run-log-top{margin:-14px -14px 14px;padding:11px 14px;background:#e6eded;border-bottom:1px solid #d6e0e1}.run-log-top time{font-weight:800;color:#28595b}.run-log-top>small{font-size:10px;background:var(--menu-surface,#fff);border-radius:8px;padding:4px 7px}
.run-log-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.run-log-grid strong{font-size:15px;overflow-wrap:anywhere}
.run-log-rewards{border-top:1px solid #28595b18;margin-top:12px;padding-top:10px}
.run-log-rewards h4{font:800 12px/1.3 Nunito,sans-serif;margin:0 0 7px;color:#28595b}
.run-log-chips{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin:0}
.run-log-reward{display:flex;align-items:center;gap:5px;background:var(--menu-surface,#fff);border-radius:10px;padding:6px;font-size:11px;line-height:1.3;min-width:0}
.run-log-reward>span:last-child{overflow-wrap:break-word}.run-log-reward-icon{font-size:23px;flex:none}
.run-log-reward canvas{position:static;inset:auto;width:38px;height:36px;flex:none;object-fit:contain;touch-action:auto}

/* Closet portraits stay visible. One action and a quiet Info control per card. */
#lexyHistory .history-closet li{padding:12px;gap:7px;height:294px;min-height:294px;background:var(--menu-soft,#edf4f1);text-align:center}
#lexyHistory .closet-face{flex:1;height:auto;min-height:0;justify-content:flex-start;gap:4px;padding-top:14px;overflow:visible}
#lexyHistory .closet-face canvas{width:100%;height:124px;max-height:124px;flex:none;object-fit:contain}
#lexyHistory .closet-face strong{font-size:13px;line-height:1.25;min-height:33px;display:flex;align-items:center;justify-content:center}
#lexyHistory .closet-face .closet-requirement{font-size:11px;line-height:1.3;margin:0;min-height:29px}
#lexyHistory .closet-info-button{position:absolute;top:7px;right:7px;width:30px;height:30px;min-height:30px;padding:0;border:0;border-radius:50%;background:#28595b0b;color:#28595b;font:800 16px/1 Nunito,sans-serif;box-shadow:none;z-index:2}
#lexyHistory .closet-wear-button,#closetDetail .closet-detail-wear{display:block;width:100%;min-height:36px;padding:8px 10px;border:0;border-radius:11px;background:#d96948;color:white;font:800 13px/1.2 Nunito,sans-serif;box-shadow:0 2px 0 #b64e35;flex:none}
#lexyHistory .closet-card-state{display:flex;align-items:center;justify-content:center;min-height:36px;font:700 12px/1.2 Nunito,sans-serif;color:#697e77}
#lexyHistory .closet-card-state[data-wearing=true]{background:#dfeddf;border-radius:11px;color:#367652}
#lexyHistory .closet-card-status{font-size:11px;color:#a33f30;line-height:1.25}
#lexyHistory .closet-card-status:not([hidden]){position:absolute;inset:auto 5px 50px;background:#fff1ec;padding:8px;border-radius:8px;z-index:3}
#lexyHistory .closet-wear-button[hidden],#lexyHistory .closet-card-state[hidden],#lexyHistory .closet-card-status[hidden]{display:none}
#lexyHistory .closet-info-button::before{content:none}
#closetDetail{width:min(380px,calc(100vw - 32px));max-height:calc(100dvh - 32px);padding:0;border:0;border-radius:24px;background:var(--menu-surface,#fff);color:#28595b;overflow:hidden;box-sizing:border-box}
#closetDetail[open]{display:flex;flex-direction:column}
#closetDetail::backdrop{background:#153e4666}
#closetDetail>header{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;position:static;flex:none;margin:0;background:var(--menu-surface,#fff)}
#closetDetail>header button{min-height:36px;border:0;border-radius:12px;padding:8px 12px;background:var(--menu-soft,#edf4f1);color:#28595b;font:800 13px Nunito,sans-serif;box-shadow:none}
#closetDetail .closet-detail-close{width:36px;padding:0;border-radius:50%}
#closetDetail .closet-detail-body{padding:0 22px 12px;overflow:auto;overscroll-behavior:contain;min-height:0;scrollbar-width:thin;text-align:center}
#closetDetail .closet-detail-art{height:190px;display:flex;justify-content:center;align-items:center;background:#fff;border-radius:14px}
#closetDetail .closet-detail-art img,#closetDetail .closet-detail-art canvas{position:static;inset:auto;width:180px;height:180px;object-fit:contain;max-width:100%}
#closetDetail h2{font:600 23px/1.2 Fredoka,sans-serif;margin:12px 0 9px;overflow-wrap:anywhere}
#closetDetail .closet-detail-description{font:500 14px/1.5 Nunito,sans-serif;margin:14px 0 0;text-align:center}
#closetDetail .closet-detail-requirement{font:700 12px/1.4 Nunito,sans-serif;margin:0;color:#627970}
#closetDetail footer{flex:none;padding:10px 22px 18px;border-top:1px solid #28595b14}
#closetDetail .closet-detail-wear{min-height:42px;font-size:15px}
#closetDetail .closet-detail-state{display:block;text-align:center;font:800 14px Nunito,sans-serif;padding:8px;color:#367652}
#closetDetail .closet-detail-status{font:600 12px/1.4 Nunito,sans-serif;color:#a33f30;margin:0 0 10px}
#closetDetail [hidden]{display:none!important}
@media(max-height:600px){#closetDetail .closet-detail-art{height:140px}#closetDetail .closet-detail-art img,#closetDetail .closet-detail-art canvas{width:135px;height:135px}}
#closetDetail>header,#closetDetail>header button{pointer-events:auto}
#lexyHistory .history-closet .avatar-new-badge{right:44px;top:12px;left:auto}

#lexyHistory .time-reveal{display:inline-block;border:0;background:transparent;padding:4px 0;min-height:32px;font:700 13px/1.3 Nunito,sans-serif;color:#567b74;text-decoration:underline;text-underline-offset:3px;box-shadow:none}

/* Use the same menu controls as the surrounding profile. */
#closetDetail>header{inset:auto;width:auto;box-sizing:border-box;z-index:auto}
#closetDetail .closet-detail-close{background:#28595b;color:white;width:40px;height:40px;min-height:40px;font-size:20px}
#closetDetail button{cursor:pointer;touch-action:manipulation}
#lexyHistory .closet-info-button{display:grid;place-items:center;width:32px;height:32px;min-height:32px}

#lexyHistory .closet-wear-button,#lexyHistory .closet-card-state{box-sizing:border-box;width:100%;height:36px;min-height:36px;margin:0;padding:8px 10px;flex:0 0 36px;border-radius:11px;font:800 13px/1.2 Nunito,sans-serif;display:flex;align-items:center;justify-content:center}

#closetDetail .closet-detail-locked-art{display:grid;place-items:center;width:180px;height:180px;border-radius:18px;background:var(--menu-soft,#e2eee7);color:#59736d;font:600 76px/1 Fredoka,sans-serif}

#closetDetail .closet-detail-viewer{display:grid;grid-template-columns:40px minmax(0,1fr) 40px;align-items:center;gap:4px}
#closetDetail .closet-detail-viewer button{display:grid;place-items:center;width:40px;height:44px;min-height:44px;padding:0;border:0;border-radius:50%;background:var(--menu-soft,#edf4f1);color:#28595b;font:500 34px/1 Nunito,sans-serif;box-shadow:none}
#closetDetail .closet-detail-viewer button:disabled{opacity:.35;cursor:default}
#closetDetail .closet-detail-body{touch-action:pan-y}

#closetDetail .closet-detail-locked-art{max-width:100%}

/* A stable viewport while browsing short and long outfit descriptions. */
#closetDetail{height:min(570px,calc(100dvh - 32px))}
#closetDetail .closet-detail-body{flex:1;touch-action:pan-y}
#closetDetail footer{min-height:72px;box-sizing:border-box}
#closetDetail{touch-action:pan-y}

/* Keep the carousel clipped inside the fixed detail dialog. */
#closetDetail .closet-detail-body{min-width:0;backface-visibility:hidden}
#closetDetail .closet-carousel-preview{overflow:hidden;user-select:none}
#closetDetail .closet-detail-body canvas{pointer-events:none}
#closetDetail{user-select:none}
#lexyHistory .history-stats .time-running-value{height:44px;min-height:44px;max-height:44px;display:flex;align-items:center;line-height:1.15;font-size:clamp(16px,4vw,21px);overflow:auto}
#lexyHistory .time-running-value .time-reveal{height:44px;min-height:44px;box-sizing:border-box;margin:0;padding:0}
/* Shared by the profile preview and full Closet: a recognizable info control. */
html body #lexyHistory .closet-info-button{width:36px;height:36px;min-height:36px;background:#fff!important;border:1px solid #28595b24!important}
#lexyHistory .closet-info-button svg{display:block;width:22px;height:22px;pointer-events:none}
#lexyHistory .closet-info-button:focus-visible{outline:2px solid #28595b;outline-offset:2px}

/* Selection stays anchored to the tile while its portrait button is pressed. */
#lexyHistory .history-closet li>.closet-wearing-tick{top:9px;left:9px;pointer-events:none;line-height:1;margin:0;transform:none}

/* The expanded Closet has one exit: Back to My Lexy. */
#lexyHistory.closet-expanded .history-close{display:none!important}

#lexyHistory .history-collection h3 .closet-new-dot{position:static;display:inline-block;flex:0 0 10px;align-self:center;margin:0 2px}
#lexyHistory .history-collection h3 .closet-new-dot[hidden]{display:none}
