*{box-sizing:border-box}
body{min-height:100vh;min-height:100dvh;margin:0;background:#fff;color:#202526;font:14px -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Hiragino Sans","Yu Gothic",YuGothic,"Noto Sans JP",Meiryo,sans-serif}
body[data-mode=line]{background:#7494c0}
body[data-mode=x]{background:#15202b}
#status{position:fixed;top:max(8px,env(safe-area-inset-top));right:max(8px,env(safe-area-inset-right));z-index:1000;max-width:calc(100% - 16px);padding:4px 8px;border-radius:12px;background:#151719b8;color:#fff;font-size:10px;line-height:1.4;pointer-events:none}
#empty{max-width:440px;margin:auto;padding:15vh 26px 40px;text-align:center}
.mark{margin:auto;width:58px;height:58px;display:grid;place-items:center;background:#b9eeaf;color:#18361e;border-radius:18px;font-size:29px;font-weight:700}
h1{font-size:23px;margin-top:24px}
p{color:#5b6568;line-height:1.8}
figure{margin:0}
#image{display:block;width:100%;height:auto}
button{border:1px solid #455047;background:#242b27;color:#d8f1d3;border-radius:9px;padding:9px 13px;cursor:pointer}
[hidden]{display:none!important}

/* 重ねて表示する枠（書き出したLPの確認など） */
#page{position:fixed;inset:0;width:100%;height:100%;border:0;background:#fff;z-index:900}
#pageChip{position:fixed;top:max(8px,env(safe-area-inset-top));right:max(8px,env(safe-area-inset-right));z-index:1001;display:flex;flex-direction:column;align-items:flex-end;gap:6px;transition:opacity .3s}
#pageChip.faded{opacity:.35}
#pageLabel{border:0;border-radius:12px;padding:4px 9px;background:#0f4f3acc;color:#fff;font-size:10px;line-height:1.4}
#pageMenu{background:#fff;border-radius:10px;box-shadow:0 4px 16px #0003;padding:6px}
#pageBack{border:0;background:#242b27;color:#d8f1d3;border-radius:8px;padding:8px 10px;font-size:12px}
@media (prefers-reduced-motion:reduce){#pageChip{transition:none}}

/* ダブルタップで出す高画質の画像。ダブルタップで拡大されないようにする */
main{touch-action:manipulation}
#hq{position:fixed;inset:0;z-index:1002;overflow-y:auto;-webkit-overflow-scrolling:touch;background:#111}
#hqBar{position:sticky;top:0;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:max(8px,env(safe-area-inset-top)) 10px 8px;background:#111e;color:#fff;font-size:12px;line-height:1.5}
#hqClose{flex-shrink:0;padding:6px 12px;font-size:12px}
#hqImage{display:block;width:100%;height:auto;-webkit-touch-callout:default;-webkit-user-select:auto;user-select:auto}

/* SNS表示。旧PreWinkのスマホビューアーから移植 */
.sns{display:flex;flex-direction:column;min-height:100dvh}

/* LINE */
#mode-line{height:100dvh;background:#7494c0;overflow:hidden}
.line-header{background:#7494c0;padding:8px 12px;padding-top:calc(env(safe-area-inset-top,0px) + 8px);display:flex;align-items:center;gap:8px;flex-shrink:0}
.line-back{display:flex;align-items:center;gap:2px;color:#1a1a1a;flex-shrink:0}
.line-back-count{font-size:13px;font-weight:600;color:#1a1a1a}
.line-avatar{width:32px;height:32px;background:#5a7a9a;border-radius:50%;flex-shrink:0;margin-left:4px}
.line-name{color:#1a1a1a;font-size:16px;font-weight:600;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.line-icons{display:flex;gap:14px;flex-shrink:0;align-items:center}
.line-icons span{color:#1a1a1a;display:flex;align-items:center}
.line-chat{flex:1;padding:20px 16px 12px;background:#7494c0;display:flex;flex-direction:column;justify-content:flex-start;gap:6px;overflow-y:auto}
.line-bubble{display:flex;align-items:flex-end;gap:6px}
.line-bubble-avatar{width:28px;height:28px;background:#5a7a9a;border-radius:50%;flex-shrink:0;align-self:flex-start;margin-top:2px}
.line-bubble-wrap{display:flex;flex-direction:column;gap:2px;max-width:75%}
.line-bubble-content{background:#fff;padding:10px 14px;border-radius:18px;border-bottom-left-radius:4px;font-size:15px;color:#333;line-height:1.5}
.line-bubble-time{font-size:11px;color:#ffffff80;align-self:flex-end;flex-shrink:0}
.line-menu{width:100%;flex-shrink:0}
.line-bottom{background:#f7f7f7;border-top:1px solid #ddd;padding:22px 16px 28px;display:flex;align-items:center;gap:12px;flex-shrink:0}
.line-bottom-kbd{color:#1a1a1a;display:flex;align-items:center}
.line-bottom-text{flex:1;text-align:center;font-size:13px;color:#1a1a1a}

/* Instagram */
#mode-ig{background:#fff;padding-bottom:calc(50px + env(safe-area-inset-bottom,0px))}
.ig-header{background:#fff;padding:10px 16px;padding-top:calc(env(safe-area-inset-top,0px) + 10px);display:flex;align-items:center}
.ig-header-back{color:#262626;margin-right:12px;display:flex;align-items:center}
.ig-header-username{font-size:20px;font-weight:700;color:#262626;flex:1}
.ig-header-icons{display:flex;gap:20px;align-items:center}
.ig-header-icons span{color:#262626;display:flex;align-items:center}
.ig-profile{padding:16px 16px 8px;display:flex;align-items:center;gap:24px}
.ig-profile-avatar{width:86px;height:86px;border-radius:50%;background:linear-gradient(45deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888);padding:2px;flex-shrink:0;display:flex;align-items:center;justify-content:center}
.ig-profile-avatar-inner{width:78px;height:78px;background:#ccc;border-radius:50%;border:2px solid #fff}
.ig-profile-stats{display:flex;gap:8px;flex:1;justify-content:center}
.ig-stat{text-align:center;flex:1}
.ig-stat-num{font-size:17px;font-weight:700;color:#262626}
.ig-stat-label{font-size:13px;color:#262626}
.ig-profile-info{padding:4px 16px 8px}
.ig-profile-name{font-size:14px;font-weight:600;color:#262626}
.ig-profile-bio{font-size:14px;color:#262626;margin-top:2px;line-height:1.4}
.ig-mutual{display:flex;align-items:center;gap:8px;padding:4px 16px 12px}
.ig-mutual-avatars{display:flex}
.ig-mutual-avatar{width:28px;height:28px;border-radius:50%;background:#ccc;border:2px solid #fff;margin-left:-8px}
.ig-mutual-avatar:first-child{margin-left:0}
.ig-mutual-text{font-size:12px;color:#262626;flex:1}
.ig-actions{padding:0 16px 12px;display:flex;gap:6px}
.ig-btn{padding:7px 0;border-radius:8px;font-size:13px;font-weight:600;text-align:center}
.ig-btn-follow,.ig-btn-secondary{flex:1;background:#efefef;color:#262626}
.ig-btn-icon{width:36px;flex-shrink:0;background:#efefef;color:#262626;display:flex;align-items:center;justify-content:center;font-size:15px}
.ig-highlights{padding:4px 16px 8px;display:flex;gap:16px}
.ig-highlight{display:flex;flex-direction:column;align-items:center;gap:4px}
.ig-highlight-circle{width:64px;height:64px;border-radius:50%;background:#efefef;border:1px solid #dbdbdb}
.ig-highlight-label{font-size:11px;color:#262626;max-width:64px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ig-tabs{display:flex;border-bottom:1px solid #dbdbdb}
.ig-tab{flex:1;padding:12px 0;display:flex;align-items:center;justify-content:center;color:#8e8e8e;border-bottom:2px solid transparent;margin-bottom:-1px}
.ig-tab.active{color:#262626;border-bottom-color:#262626}
.ig-grid{width:100%}
.ig-footer{position:fixed;bottom:0;left:0;right:0;z-index:10;display:flex;align-items:center;justify-content:space-around;background:#fff;border-top:1px solid #dbdbdb;padding:8px 0;padding-bottom:calc(env(safe-area-inset-bottom,0px) + 8px)}
.ig-footer-item{display:flex;align-items:center;justify-content:center;width:44px;height:32px;color:#262626}
.ig-footer-avatar{width:24px;height:24px;border-radius:50%;background:#ccc;border:1px solid #262626}

/* X */
#mode-x{height:100dvh;overflow-y:auto;background:#15202b}
.x-header-wrap{position:relative}
.x-header-nav{position:absolute;top:0;bottom:0;left:0;right:0;padding:0 8px;display:flex;align-items:center;justify-content:space-between;z-index:10}
.x-nav-btn{width:34px;height:34px;border-radius:50%;background:#0000008c;display:flex;align-items:center;justify-content:center;color:#e7e9ea;font-size:16px}
.x-nav-right{display:flex;gap:8px}
.x-profile{padding:12px 16px;background:#15202b;position:relative}
.x-profile-avatar{width:72px;height:72px;border-radius:50%;background:#333;border:4px solid #15202b;margin-top:-40px}
.x-profile-actions{position:absolute;top:12px;right:16px;display:flex;gap:8px}
.x-btn-outline{padding:6px 16px;border-radius:20px;border:1px solid #536471;color:#e7e9ea;font-size:14px;font-weight:700;background:transparent}
.x-profile-name{font-size:20px;font-weight:800;color:#e7e9ea;margin-top:8px}
.x-profile-handle{font-size:15px;color:#71767b}
.x-profile-bio{font-size:15px;color:#e7e9ea;margin-top:8px;line-height:1.4}
.x-profile-meta{display:flex;gap:16px;margin-top:12px;font-size:14px;color:#71767b}
.x-profile-meta strong{color:#e7e9ea;font-weight:700}
.x-tabs{display:flex;margin-top:12px;position:relative}
.x-tabs::after{content:'';position:absolute;bottom:0;left:-16px;right:-16px;border-bottom:1px solid #38444d}
.x-tab{flex:1;padding:14px 0;text-align:center;font-size:14px;font-weight:500;color:#71767b;white-space:nowrap}
.x-tab.active{color:#e7e9ea;border-bottom:2px solid #1d9bf0}
.x-posts{background:#15202b}
.x-post{padding:12px 16px;border-bottom:1px solid #38444d;display:flex;gap:12px}
.x-post-avatar{width:40px;height:40px;border-radius:50%;background:#333;flex-shrink:0}
.x-post-body{flex:1}
.x-post-header{font-size:15px;color:#71767b}
.x-post-header strong{color:#e7e9ea;font-weight:700}
.x-post-text{font-size:15px;color:#e7e9ea;margin-top:4px;line-height:1.4}
.x-post-actions{display:flex;gap:48px;margin-top:10px;font-size:13px;color:#71767b}
.x-post-actions span{display:inline-flex;align-items:center;gap:6px}
.x-footer{position:fixed;bottom:0;left:0;right:0;z-index:10;display:flex;align-items:center;justify-content:space-around;background:#15202b;border-top:1px solid #38444d;padding:14px 0 10px;padding-bottom:calc(env(safe-area-inset-bottom,0px) + 10px)}
.x-footer-item{position:relative;display:flex;align-items:center;justify-content:center;color:#8899a6}
.x-footer-item.active{color:#e7e9ea}
.x-compose-btn{position:fixed;bottom:80px;right:20px;width:56px;height:56px;border-radius:50%;background:#1d9bf0;color:#fff;display:flex;align-items:center;justify-content:center;z-index:15;box-shadow:0 2px 8px #0000004d}
.x-footer-badge{position:absolute;top:-6px;right:-10px;background:#1d9bf0;color:#fff;font-size:11px;font-weight:700;min-width:18px;height:18px;border-radius:9px;display:flex;align-items:center;justify-content:center;padding:0 4px}

/* YouTube */
#mode-yt{height:100dvh;overflow-y:auto;background:#fff}
.yt-header{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;padding-top:max(env(safe-area-inset-top),12px);background:#fff;position:sticky;top:0;z-index:10}
.yt-header-left{display:flex;align-items:center;gap:16px}
.yt-header-right{display:flex;align-items:center;gap:20px}
.yt-icon{color:#0f0f0f;display:flex;align-items:center;justify-content:center}
.yt-banner{width:calc(100% - 32px);margin:0 auto;border-radius:12px;padding-top:25.21%;background:#e5e5e5;position:relative;overflow:hidden}
.yt-banner #image{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:167.54%;max-width:none;height:auto;object-fit:cover}
.yt-channel-info{padding:12px 16px}
.yt-info-top{display:flex;align-items:center;gap:12px;margin-bottom:12px}
.yt-avatar{width:50px;height:50px;border-radius:50%;background:#ccc;flex-shrink:0}
.yt-text-info{display:flex;flex-direction:column;justify-content:center}
.yt-name{font-size:18px;font-weight:700;color:#0f0f0f}
.yt-meta{font-size:12px;color:#606060;margin-top:2px}
.yt-desc{display:flex;align-items:center;gap:4px;font-size:12px;color:#606060;margin-bottom:12px}
.yt-subscribe-btn{background:#0f0f0f;color:#fff;border-radius:18px;padding:0 16px;height:36px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:500;width:100%}
.yt-tabs{display:flex;overflow-x:auto;border-bottom:1px solid #e5e5e5;scrollbar-width:none}
.yt-tabs::-webkit-scrollbar{display:none}
.yt-tab{padding:10px 16px;white-space:nowrap;font-size:14px;font-weight:500;color:#606060;border-bottom:2px solid transparent}
.yt-tab.active{color:#0f0f0f;border-bottom-color:#0f0f0f}
.yt-content{background:#fff;padding-bottom:calc(20px + env(safe-area-inset-bottom,0px))}
.yt-section-title{font-size:16px;font-weight:700;color:#0f0f0f;padding:12px 16px 4px}
.yt-video{display:flex;flex-direction:column;gap:8px;margin-bottom:24px}
.yt-thumb{width:100%;aspect-ratio:16/9;background:#ccc}
.yt-video-info{display:flex;gap:12px;padding:0 12px}
.yt-video-icon{width:36px;height:36px;border-radius:50%;background:#ccc;flex-shrink:0}
.yt-video-text{flex:1}
.yt-video-title{font-size:14px;font-weight:500;color:#0f0f0f;line-height:1.3;margin-bottom:4px}
.yt-video-meta{font-size:12px;color:#606060}

/* サムネイル（YouTubeホーム風） */
.thumb-page{background:#fff;padding-bottom:calc(56px + env(safe-area-inset-bottom,0px))}
.thumb-header{display:flex;justify-content:space-between;align-items:center;padding:10px 16px;padding-top:calc(env(safe-area-inset-top,0px) + 10px);background:#fff;position:sticky;top:0;z-index:10}
.thumb-header-left{display:flex;align-items:center}
.thumb-header-icons{display:flex;gap:20px;align-items:center}
.thumb-header-icons span{display:flex;align-items:center}
.thumb-chips{display:flex;gap:8px;padding:6px 12px 10px;overflow-x:auto;scrollbar-width:none}
.thumb-chips::-webkit-scrollbar{display:none}
.thumb-chip{padding:6px 12px;border-radius:8px;background:#f2f2f2;font-size:14px;font-weight:500;color:#0f0f0f;white-space:nowrap;display:flex;align-items:center;gap:4px;flex-shrink:0}
.thumb-chip.active{background:#0f0f0f;color:#fff}
.thumb-video-section{margin-bottom:12px}
.thumb-thumbnail{position:relative;width:100%;background:#fff}
.thumb-duration{position:absolute;bottom:8px;right:8px;z-index:2;background:#000000cc;color:#fff;font-size:12px;padding:3px 6px;border-radius:4px;font-weight:500}
.thumb-video-info{display:flex;gap:12px;padding:12px 12px 8px;align-items:flex-start}
.thumb-video-avatar{width:36px;height:36px;border-radius:50%;background:#ccc;flex-shrink:0}
.thumb-video-text{flex:1}
.thumb-video-title{font-size:15px;font-weight:500;color:#0f0f0f;line-height:1.4;margin-bottom:4px}
.thumb-video-meta{font-size:12px;color:#606060}
.thumb-video-more{flex-shrink:0;padding:4px;display:flex;align-items:flex-start}
.thumb-shorts-section{padding:0 12px;margin-bottom:12px}
.thumb-shorts-header{display:flex;align-items:center;gap:8px;padding:8px 0}
.thumb-shorts-title{font-size:18px;font-weight:700;color:#0f0f0f}
.thumb-shorts-grid{display:flex;gap:8px}
.thumb-short-item{flex:1}
.thumb-short-placeholder{aspect-ratio:9/16;background:#e5e5e5;border-radius:12px}
.thumb-bottom{position:fixed;bottom:0;left:0;right:0;display:flex;justify-content:space-around;align-items:center;padding:6px 0 4px;padding-bottom:calc(env(safe-area-inset-bottom,0px) + 4px);background:#fff;border-top:1px solid #e5e5e5;z-index:100}
.thumb-nav{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-size:9px;color:#606060;width:64px}
.thumb-nav svg{display:block;margin:0 auto}
.thumb-nav.active{color:#0f0f0f}
.thumb-nav.active span{font-weight:600}
