/* v16: retain a visible page/card hierarchy in both themes. */
:root{--page15:#f2f4f7;--field15:#f3f5f7;--muted15:#657587;--line15:#e1e7ee;--accent15:#176eb9;--soft15:#e8f2fc}
:root[data-theme=dark]{--page15:#17212b;--field15:#283744;--muted15:#a0afbd;--line15:#33424f;--accent15:#64b5ef;--soft15:#273f53}
html[data-theme] .social-shell15>.win>.body:not(.nopad){background:var(--page15)!important;line-height:1.5}
html[data-theme] .social-shell15>.win.feed-window15>.body.feed-body15{background:var(--surface15)!important}
html[data-theme] .win .plans-hero{background:var(--surface15)!important;color:var(--ink15)!important;border:0!important;border-radius:14px!important;padding:20px!important;margin:0 0 16px!important;box-shadow:none!important;min-height:0!important}
html[data-theme] .plans-hero>span{font-size:11px!important;letter-spacing:.8px;color:var(--accent15)!important;font-weight:700}
html[data-theme] .plans-hero h1{font-size:25px!important;margin:8px 0!important;color:var(--ink15)!important}
html[data-theme] .plans-hero p{font-size:14px!important;margin:0!important;color:var(--muted15)!important}
html[data-theme] .win .plan-card{padding:18px!important;margin-bottom:12px!important;border-color:var(--line15)!important}
html[data-theme] .win .plan-card.plus{border-top:3px solid #3390ec!important}
html[data-theme] .win .plan-card.premium{border-top:3px solid #9573d4!important}
html[data-theme] .plan-card p{font-size:14px;line-height:1.5;margin:12px 0 8px}
html[data-theme] .plan-card>small{display:block;font-size:12px!important;color:var(--muted15)!important;line-height:1.5}
html[data-theme] .plan-card h2{margin:8px 0 10px!important;font-size:24px!important}
html[data-theme] .plan-card h2 small{font-size:12px!important;font-weight:400;color:var(--muted15)!important}
html[data-theme] .plan-card>span{font-size:11px!important;font-weight:700;color:var(--accent15)!important}
html[data-theme] .win .task-hero,html[data-theme] .win .games-hero{padding:18px!important;margin-bottom:16px!important}
html[data-theme] .task-hero h1 small{margin-left:8px!important;font-weight:500}
html[data-theme] .games-hero>p,html[data-theme] .task-hero>p{font-size:13px!important}
html[data-theme] .win .task-card{padding:14px!important;gap:10px!important;align-items:center!important;min-height:90px;box-sizing:border-box}
html[data-theme] .task-card b{font-size:14px!important;line-height:1.4}
html[data-theme] .task-card small{font-size:12px!important;line-height:1.5;margin-top:5px!important}
html[data-theme] .task-card>div:nth-child(2){flex:1}
html[data-theme] .task-card progress{display:block;width:100%;height:4px;margin-top:10px;accent-color:#3390ec}
html[data-theme] .task-card progress::-webkit-progress-bar{background:var(--field15);border-radius:4px}
html[data-theme] .task-card progress::-webkit-progress-value{background:#3390ec;border-radius:4px}
html[data-theme] .task-card .chip{flex-shrink:0;min-height:36px!important;border-radius:9px!important;font-size:12px!important;background:var(--soft15);color:var(--accent15)}
html[data-theme] .task-list{gap:10px!important}
html[data-theme] .games-body .game-choice small,html[data-theme] .games-body .learn-games button small{font-size:12px!important;color:var(--muted15)!important}
html[data-theme] .games-body .game-choice b,html[data-theme] .games-body .learn-games button b{font-size:15px!important}
html[data-theme] .games-body .online-games{gap:10px!important}
html[data-theme] .win h3{font-size:13px!important}
html[data-theme] .win label.l,html[data-theme] .sheet label.l{font-size:13px!important;color:var(--muted15)!important}
html[data-theme] .win .birth-input{background:var(--field15)!important;box-shadow:none!important;padding:5px!important;gap:5px!important}
html[data-theme] .win .birth-input input[data-birth]{background:var(--surface15)!important;box-shadow:none!important;border:0!important;padding:9px 2px!important}
html[data-theme] .win .pf-btns button.btn{border-radius:10px!important;font-size:13px!important;min-height:42px!important;background:var(--soft15)!important;color:var(--accent15)!important}
html[data-theme] .pf-stats small{font-size:11px!important}
html[data-theme] .win .market-v11 .mk-tabs button{min-height:36px;flex-shrink:0;background:var(--surface15)!important;border:1px solid var(--line15)!important;color:var(--ink15)!important}
html[data-theme] .win .market-v11 .mk-tabs button.on{background:var(--accent15)!important;color:#fff!important;border-color:var(--accent15)!important}
html[data-theme] .mk-card .tt{font-size:14px!important;line-height:1.4;min-height:40px;padding:10px 12px 4px!important;box-sizing:border-box}
html[data-theme] .mk-card .ct{font-size:11px!important}
html[data-theme] .market-card-social{min-height:42px;box-sizing:border-box}
html[data-theme] .market-card-social button{min-width:34px;min-height:28px;padding:3px!important}
html[data-theme] .market-search>.srch{background:var(--surface15)!important;border:1px solid var(--line15)!important}
html[data-theme] .app-nav15>button small{font-size:10px;line-height:1.2}
html[data-theme] .app-nav15>button.selected{color:var(--accent15);background:var(--soft15)}
html[data-theme] button:focus-visible,html[data-theme] a:focus-visible{outline:2px solid var(--accent15);outline-offset:3px}
html[data-theme] button:disabled{cursor:default}
@media(max-width:360px){html[data-theme] .task-card{flex-wrap:wrap}.task-card>div:nth-child(2){flex-basis:calc(100% - 42px)}html[data-theme] .task-card .chip{margin-left:40px}.app-nav15{padding-left:3px;padding-right:3px}}
/* A search field is one control, not an input boxed inside another input. */
html[data-theme] .win .srch input:not([type=checkbox]):not([type=range]):not([type=hidden]){background:transparent!important;border:0!important;box-shadow:none!important;border-radius:0!important;padding:9px 0!important;min-height:40px;color:var(--ink15)!important}
html[data-theme] .win .srch{gap:10px;padding:0 13px!important;min-height:44px;box-sizing:border-box}
html[data-theme] .win .srch:focus-within{outline:2px solid var(--accent15);outline-offset:1px}
html[data-theme] .win .srch svg{flex-shrink:0;color:var(--muted15)}
html[data-theme] .sheet .l:has(+input),html[data-theme] .sheet .l:has(+textarea){display:block;margin-top:15px}

html[data-theme] .win button.btn:not(.s):not(.r):not(.g),html[data-theme] .sheet button.btn:not(.s):not(.r):not(.g){background:#2378c2!important;color:#fff!important}
html[data-theme] .win button.btn:disabled,html[data-theme] .sheet button.btn:disabled{background:var(--field15)!important;color:var(--muted15)!important}
html[data-theme] .social-shell15 .chat-shell .srch{background:var(--surface15)!important;border:1px solid var(--line15)!important}

/* v17: avatars are media, never expanding text columns. */
html[data-theme] .av{flex-grow:0!important;flex-shrink:0!important;flex-basis:auto!important;box-sizing:border-box;aspect-ratio:1;object-fit:cover}
html[data-theme] .av>img{width:100%;height:100%;object-fit:cover;display:block}
html[data-theme] .post-comment-row15>.av{width:34px!important;height:34px!important;min-width:34px!important;max-width:34px!important;flex:0 0 34px!important;border-radius:50%!important}
.post-comment-row15>div:not(.av){flex:1;min-width:0;overflow-wrap:anywhere}
html[data-theme] .post-comment-row15{gap:12px;align-items:flex-start;margin-bottom:20px;padding:3px 2px}
html[data-theme] .post-comment-row15 b{font-size:13px;line-height:1.4}
html[data-theme] .post-comment-row15 p{font-size:14px;line-height:1.5;margin:5px 0 7px}
html[data-theme] .post-comment-row15 small,html[data-theme] .post-comment-row15 [data-delete]{font-size:11px}
html[data-theme] .post-comment-form15>.av{width:30px!important;height:30px!important;max-width:30px!important;flex:0 0 30px!important}
html[data-theme] .week-plan{width:100%!important;min-width:0;box-sizing:border-box!important;overflow:hidden;padding:6px!important}
html[data-theme] .week-plan .week-day{display:grid!important;grid-template-columns:24px minmax(0,1fr) auto;align-items:start;gap:10px!important;width:100%!important;max-width:100%;margin:0!important;padding:14px 10px!important;box-sizing:border-box!important;border-bottom:1px solid var(--line15)!important}
html[data-theme] .week-plan .week-day:last-child{border-bottom:0!important}
html[data-theme] .week-plan .week-day.today{border:0!important;border-radius:10px!important;background:var(--soft15)!important}
html[data-theme] .week-day>span{min-width:0;font-size:13px;line-height:1.5;overflow-wrap:anywhere}
html[data-theme] .week-day>b{font-size:12px;padding-top:2px}
html[data-theme] .week-day>small{white-space:nowrap;font-size:11px;padding-top:3px}
html[data-theme] .week-day span small{display:block;font-size:11px;line-height:1.5;margin-top:4px}
html[data-theme] .week-day.locked{opacity:.8!important}
/* Only the current screen scrolls; the phone frame stays inside the viewport. */
html,body{overflow:hidden!important}
@media(min-width:601px){html[data-theme] #phone{position:fixed;top:16px;left:0;right:0;width:390px;height:min(844px,calc(100dvh - 32px));margin:0 auto}}
@media(max-width:600px){html[data-theme] #phone{width:100%!important;margin:0!important;border-radius:0!important;box-shadow:none!important}}
html[data-theme] .row>.grow,html[data-theme] .member-control>div:not(.av),html[data-theme] .conversation-members .member-info{min-width:0;overflow-wrap:anywhere}
html[data-theme] .sheet h4{min-width:0;overflow-wrap:anywhere}
html[data-theme] .post-comments15{gap:14px;padding:17px 16px max(16px,env(safe-area-inset-bottom,0px))!important}
html[data-theme] .post-comment-form15{gap:8px;padding-top:12px}
html[data-theme] .post-comment-form15>input{min-width:0;min-height:42px!important}
/* Compact, consistent chat sheets, including participant search. */
html[data-theme] .sheet .srch input:not([type=checkbox]):not([type=range]):not([type=hidden]){background:transparent!important;border:0!important;box-shadow:none!important;border-radius:0!important;min-width:0;padding:9px 0!important;min-height:40px}
html[data-theme] .sheet .srch{padding:0 12px!important;gap:9px;min-height:44px;border:1px solid var(--line15)!important}
html[data-theme] .sheet:has(.chat-create-tabs){gap:10px}
html[data-theme] .sheet .chat-create-tabs{margin:5px 0!important;gap:4px;padding:4px!important}
html[data-theme] .sheet .chat-create-tabs button{min-height:36px!important;line-height:1.3}
html[data-theme] .sheet #gfields{padding:0!important;margin:0!important}
html[data-theme] .sheet #gfields>label:first-child{margin-top:5px!important}
html[data-theme] .sheet #gfields textarea{min-height:75px!important}
html[data-theme] .sheet:has(.chat-create-tabs) .srch{margin:6px 0!important}
.sheet #ures:empty,.sheet #gsel:empty{display:none!important}
html[data-theme] .sheet #cx{display:grid;place-items:center;flex:0 0 34px;width:34px;height:34px;padding:7px;border:0!important;border-radius:50%;background:var(--field15)!important;color:var(--muted15)}
html[data-theme] .sheet #cx svg{width:18px;height:18px}
html[data-theme] .sheet .fl-row{gap:12px;min-width:0}
html[data-theme] .sheet .fl-row .nm{flex:1;min-width:0;overflow-wrap:anywhere}
/* The retired desktop must not flash through section transitions. */
.social-shell15>#wall{display:none!important}
html[data-theme] .social-shell15>.win{transition:none!important}
@keyframes sheet-enter17{from{transform:translateY(22px)}to{transform:translateY(0)}}
html[data-theme] .sheet-bg{animation:none!important}
html[data-theme] .sheet{animation:sheet-enter17 .18s ease-out!important}
@media(prefers-reduced-motion:reduce){html[data-theme] .sheet{animation:none!important}}

/* Keep the app navigation in the selected light/dark theme while viewing reels. */
html[data-theme] .app-nav15{background:var(--surface15)!important;border-color:var(--line15)!important;color:var(--ink15)!important}
html[data-theme] .ri .pbar{bottom:0!important;height:3px!important;background:#ffffff66!important;box-shadow:0 0 2px #0008!important}
html[data-theme] .ri .pbar i{background:#fff!important;box-shadow:0 0 3px #0009!important}

/* Profile links are rows inside one settings card, not cards nested in a card. */
html[data-theme] .links-editor #link-rows{display:flex;flex-direction:column;gap:0;margin-top:10px}
html[data-theme] .links-editor .link-edit-row{display:block;margin:0!important;padding:14px 0 10px!important;background:transparent!important;border:0!important;border-bottom:1px solid var(--line15)!important;border-radius:0!important;box-shadow:none!important}
html[data-theme] .links-editor .link-edit-row:last-child{border-bottom:0!important}
html[data-theme] .links-editor .link-edit-row label.l{display:block;margin:0 0 6px!important;color:var(--muted15)!important}
html[data-theme] .links-editor .link-edit-row input{display:block;width:100%;box-sizing:border-box;margin:0 0 10px!important;background:var(--field15)!important;border:1px solid var(--line15)!important;border-radius:12px!important;color:var(--ink15)!important}
html[data-theme] .links-editor .link-edit-row .link-remove{background:transparent!important;border:0!important;border-radius:0!important;padding:4px 0!important;color:var(--muted15)!important}
