/* Immersive work viewer. Distinct child classes isolate it from legacy detail styles. */
#sheet.detail-sheet>.sheet-card{border-radius:0!important;padding:0!important;max-width:600px!important;margin:0 auto!important;height:100dvh!important;max-height:100dvh!important;overflow:hidden!important}
.detail-sheet .xhs-work-detail{--work-footer:48px;position:relative;height:100%!important;padding:0!important;overflow:hidden!important;background:#000;color:#fff;font-family:-apple-system,BlinkMacSystemFont,"PingFang SC",sans-serif}
.xhs-work-detail .work-stage{position:absolute;inset:0 0 calc(var(--work-footer) + env(safe-area-inset-bottom,0px));background:#000}
.xhs-work-detail .work-media{display:block;width:100%;height:100%;max-width:none;max-height:none;object-fit:cover;background:#000}
.xhs-work-detail .work-shade{position:absolute;inset:0;pointer-events:none;background:linear-gradient(180deg,#0003 0%,transparent 20%,transparent 62%,#0004 100%)}
.xhs-work-detail svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
.xhs-work-detail button{font-family:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}
.xhs-work-detail .work-toolbar{position:absolute;z-index:2;top:env(safe-area-inset-top,0px);left:0;right:0;height:58px;padding:0 12px;display:flex;justify-content:space-between;align-items:center;color:#ddd}
.work-toolbar>div{display:flex;gap:0}
.work-toolbar button{display:grid;place-items:center;width:38px;height:44px;padding:5px;border:0;background:transparent;color:inherit}
.work-toolbar button svg{width:27px;height:27px}
.work-toolbar [data-action="back"]{margin-left:-8px}
.work-toolbar [data-action="share"]{width:34px}
.xhs-work-detail .work-overlay{position:absolute;z-index:2;left:14px;right:14px;bottom:calc(var(--work-footer) + env(safe-area-inset-bottom,0px) + 9px);display:flex;flex-direction:column;align-items:flex-start;gap:8px;max-height:45%;overflow:auto;scrollbar-width:none;text-shadow:0 1px 3px #0002}
.work-overlay::-webkit-scrollbar{display:none}
.work-author{display:flex;align-items:center;gap:8px;margin:0 0 1px}
.work-author img{width:34px;height:34px;border-radius:50%;object-fit:cover}
.work-author-name{font-size:16px;font-weight:500;line-height:24px}
.work-copy{width:100%;display:flex;align-items:flex-end;gap:12px;min-width:0}
.work-caption-button{flex:1;min-width:0;border:0;background:transparent;color:#c4d5e2;padding:0;text-align:left;font-size:14px;line-height:1.55;overflow-wrap:anywhere;white-space:pre-wrap}
.work-topic:not(:empty){display:inline}
.work-caption:not(:empty)+.work-topic:not(:empty)::before{content:" "}
.work-views{display:flex;align-items:center;flex-shrink:0;gap:3px;padding:4px 0;border:0;background:none;color:#dedede;font-size:12px;line-height:20px;white-space:nowrap}
.work-views svg{width:13px;height:13px;stroke-width:1.5;color:#c5c5c5}
.work-location{max-width:100%;display:flex;align-items:center;gap:4px;padding:4px 7px;border:0;border-radius:5px;background:#ffffff30;color:#fff;font-size:13px;line-height:18px;text-align:left;white-space:nowrap}
.work-location svg{width:15px;height:15px}
.work-place{min-width:0;overflow:hidden;text-overflow:ellipsis}
.work-distance{flex-shrink:0;display:flex;align-items:center;gap:6px;margin-left:2px}
.work-distance:not(:empty)::before{content:"";display:block;width:1px;height:12px;background:#ffffff70}
.work-distance:empty{display:none}
.xhs-work-detail .work-footer{position:absolute;z-index:3;bottom:0;left:0;right:0;height:calc(var(--work-footer) + env(safe-area-inset-bottom,0px));padding:7px 14px calc(7px + env(safe-area-inset-bottom,0px));display:flex;align-items:center;justify-content:space-between;gap:10px;background:#000}
.work-privacy{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:2px;border:0;padding:0;background:none;color:#eee;text-align:left;white-space:nowrap}
.work-visibility{display:flex;align-items:center;gap:5px}
.work-visibility svg{width:13px;height:15px}
.work-visibility b{font-size:14px;line-height:18px;font-weight:400;overflow:hidden;text-overflow:ellipsis;max-width:105px}
.work-privacy small{font-size:12px;line-height:14px;color:#999}
.work-actions{display:flex;align-items:center;gap:13px;flex:0 0 auto}
.work-actions button{display:flex;align-items:center;gap:5px;padding:0;border:0;background:none;color:#fff;font-size:14px;white-space:nowrap}
.work-actions svg{width:25px;height:27px;stroke-width:1.8}
.work-actions b{font-size:12px;font-weight:400;margin-left:3px}
.work-actions .is-selected{color:#ff2442}
.work-actions .is-selected svg{fill:currentColor}
.work-progress{--played:0%;position:absolute;left:0;top:-8px;width:100%;height:16px;margin:0;padding:0;border:0;appearance:none;-webkit-appearance:none;background:transparent;cursor:pointer}
.work-progress::-webkit-slider-runnable-track{height:1px;background:linear-gradient(to right,#eee var(--played),#ffffff40 var(--played))}
.work-progress::-moz-range-track{height:1px;background:#ffffff40}
.work-progress::-moz-range-progress{height:1px;background:#eee}
.work-progress::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:3px;height:3px;border-radius:50%;background:#eee;margin-top:-1px}
.work-progress::-moz-range-thumb{width:3px;height:3px;border:0;border-radius:50%;background:#eee}
.work-photo-rule{position:absolute;top:0;left:0;right:0;height:1px;background:#ffffff40}
.work-play{position:absolute;z-index:1;top:50%;left:50%;transform:translate(-50%,-50%);width:60px;height:60px;border:0;background:none;color:#fffc}
.work-play svg{width:46px;height:46px}
.work-play[hidden],.work-media-error[hidden]{display:none}
.work-media-error{position:absolute;top:40%;left:10%;right:10%;text-align:center;font-size:14px;color:#ccc}
.work-editor{position:fixed;inset:0;margin:auto;width:calc(100% - 24px);max-width:430px;max-height:calc(100dvh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - 24px);padding:0;border:0;border-radius:16px;background:#fff;color:#222;font-family:inherit;overflow:auto;overscroll-behavior:contain}
.work-editor::backdrop{background:#0008}
.work-editor form{margin:0}
.work-editor header{position:sticky;top:0;z-index:1;background:#fff;display:flex;align-items:center;justify-content:space-between;padding:14px 18px;border-bottom:1px solid #eee}
.work-editor h2{font-size:18px;margin:0}
.work-editor header button{border:0;background:none;font-size:26px;width:32px;color:#555}
.work-editor-fields{padding:4px 18px 14px;display:grid;gap:7px}
.work-editor-fields label{font-size:13px;margin-top:10px;color:#666}
.work-editor input,.work-editor textarea,.work-editor select{box-sizing:border-box;width:100%;min-width:0;border:1px solid #ddd;border-radius:7px;padding:10px;font-family:inherit;font-size:16px;line-height:1.4;color:#222;background:#fff}
.work-editor footer{position:sticky;bottom:0;background:#fff;display:flex;gap:12px;padding:12px 18px calc(12px + env(safe-area-inset-bottom,0px));border-top:1px solid #eee}
.work-editor footer button{flex:1;padding:11px;border:0;border-radius:20px;font-size:15px;background:#eee;color:#333}
.work-editor footer button[type="submit"]{background:#ff2442;color:white}
.work-save-error{margin:0;color:#c02;font-size:13px}
@media(max-width:374px){.work-footer{gap:6px!important;padding-left:10px!important;padding-right:10px!important}.work-actions{gap:8px}.work-actions button{gap:3px;font-size:12px}.work-actions svg{width:22px;height:24px}.work-privacy small{font-size:10px}.work-visibility b{font-size:12px}.work-actions b{font-size:10px}.work-views{font-size:11px}.work-copy{gap:6px}}

/* Only the four marked work icons: reference outlines and optical sizing. */
.xhs-work-detail svg[data-work-icon="share"]{stroke-width:1.55;transform:scale(.94);fill:none}
.xhs-work-detail .work-actions svg[data-work-icon="heart"],.xhs-work-detail .work-actions svg[data-work-icon="star"],.xhs-work-detail .work-actions svg[data-work-icon="comment"]{stroke-width:1.8;overflow:visible;transform:scale(1.04);stroke-linecap:round;stroke-linejoin:round}

.work-editor .work-replace{padding:11px;border:1px solid #ff2442;border-radius:8px;background:#fff5f6;color:#e92345;font-size:15px}
.work-replacement-preview:empty{display:none}
.work-replacement-preview img,.work-replacement-preview video{display:block;width:100%;max-height:160px;object-fit:contain;background:#111;border-radius:8px}
.work-replacement-name{font-size:12px;color:#888;overflow-wrap:anywhere}
.work-editor button:disabled{opacity:.5;cursor:wait}

.work-time{display:none;margin-top:6px;font-size:12px;line-height:1.5;color:rgba(255,255,255,.8);font-weight:400}

/* Keep the work editor inside the visible viewport while the mobile keyboard is open. */
.work-editor{max-height:calc(var(--editor-height,100dvh) - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - 24px)}
.work-editor input:not([type]),.work-editor input[type="text"],.work-editor textarea{-webkit-user-select:text;user-select:text;touch-action:manipulation;cursor:text}
