/* iOS adaptation layer; original feature styles and event handlers remain intact. */
[data-internal-config="true"],#forum-open-api-sheet,#forum-api-sheet,.relation-settings-api,.relation-settings-save-api { display:none!important; }
.ios-settings-hub { display:flex; flex-direction:column; background:var(--ios-surface); border-radius:20px; overflow:hidden; flex-shrink:0; }
body #phone { overflow:clip; }
body #phone #drawer:not(.open) { visibility:hidden!important; pointer-events:none!important; }
body #phone #chat-list-screen .settings-inner { height:100%; box-sizing:border-box; overflow:hidden; }
body #phone #chat-list-screen .chat-list-main { flex:1; min-height:0; overflow:hidden; background:var(--ios-group)!important; }
body #phone #chat-list-screen .chat-list-scroll { height:100%; box-sizing:border-box; overflow-y:auto; background:var(--ios-group)!important; }
body #phone #chat-list-screen :is(.chat-list-below-mask,.chat-list-tab-panels,.chat-list-pane--threads) { background:transparent!important; background-image:none!important; box-shadow:none!important; transform:none; }
body #phone #chat-list-screen .chat-list-scroll::before,body #phone #chat-list-screen .chat-list-scroll::after { display:none; }
.ios-settings-hub[hidden],.ios-detail-back[hidden],#settings-screen .settings-section[hidden],.ios-help[hidden] { display:none!important; }
.ios-setting-row { display:flex; align-items:center; gap:14px; border:0; background:transparent; color:var(--ios-ink); min-height:62px; padding:12px 16px; text-align:left; font:500 16px/1.4 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; cursor:pointer; }
.ios-setting-row+ .ios-setting-row { border-top:1px solid var(--ios-line); }
.ios-setting-row>i:first-child { background:#007aff; color:white; padding:7px; border-radius:9px; font-size:20px; }
.ios-setting-row span { flex:1; }.ios-setting-row>i:last-child { color:var(--ios-secondary); font-size:14px; }
.ios-detail-back { border:0; background:transparent; color:var(--ios-blue); font:500 16px/1.4 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; padding:8px; }
#settings-screen:has(.ios-detail-back:not([hidden])) #settings-close { display:none; }
.ios-help { padding:10px 0; color:var(--ios-secondary); font-size:13px; }.ios-help summary { color:var(--ios-blue); cursor:pointer; padding:5px 0; }
.ios-inbox-head { padding:8px 0 18px; }.ios-inbox-head h1 { margin:0 0 17px; font-size:34px; letter-spacing:-.7px; }
.ios-inbox-search { display:flex; align-items:center; background:rgba(120,120,128,.12); border-radius:13px; padding:0 10px; color:var(--ios-secondary); }
body #phone .ios-inbox-search input { background:transparent!important; flex:1; width:100%; }
body #phone .chat-list-scroll { padding:16px 18px 85px; }
body #phone .chat-list-dock { position:absolute; bottom:25px; left:50%; transform:translateX(-50%); width:calc(100% - 40px); z-index:15; border-radius:30px; background:var(--ios-glass); backdrop-filter:blur(24px); border:0; }
body #phone .chat-list-main { background:var(--ios-group); }
body #phone .chat-thread-list>li { border-radius:0; border:0; border-bottom:1px solid var(--ios-line); background:var(--ios-surface); box-shadow:none; }
body #phone .chat-thread-list>li[hidden] { display:none!important; }
:root { --ios-blue:#007aff; --ios-green:#34c759; --ios-group:#f2f2f7; --ios-surface:#fff; --ios-ink:#1c1c1e; --ios-secondary:#63636a; --ios-line:rgba(60,60,67,.13); --ios-glass:rgba(249,250,255,.76); }
html { font-size:16px; }
body { margin:0; background:#e6e9ef!important; font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important; }
body.dark { --ios-group:#000; --ios-surface:#1c1c1e; --ios-ink:#f5f5f7; --ios-secondary:#a4a4ac; --ios-line:rgba(235,235,245,.15); --ios-glass:rgba(36,38,46,.8); }
body,body.dark { --bg-card:var(--ios-surface); --bg-device:var(--ios-group); --text-main:var(--ios-ink); --text-sub:var(--ios-secondary); --line:var(--ios-line); }
body .stage { min-height:100dvh; padding:24px; box-sizing:border-box; }
body #phone { width:402px; height:min(874px,calc(100dvh - 48px)); max-height:none; border-radius:48px; box-shadow:0 24px 70px #26354f30,0 0 0 7px #1c1d21,0 0 0 9px #a6a9b0; display:block; isolation:isolate; background:var(--ios-group); }
body #phone>.statusbar { height:54px; box-sizing:border-box; padding:18px 28px 6px; color:#fff; z-index:60; font:600 14px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; letter-spacing:0; text-transform:none; pointer-events:none; }
body #phone>.statusbar::after { content:""; position:absolute; top:11px; left:50%; transform:translateX(-50%); width:111px; height:30px; border-radius:22px; background:#101114; }
body #phone.ios-app-open>.statusbar { color:var(--ios-ink); }
body #phone>.topbar,body #phone>.layout-shell,body #phone>.dock-stack,body #phone>.ambience { display:none!important; }
body #boot-splash { display:none!important; }
.ios-home { position:absolute; inset:0; color:white; background:#527ba8 url("vendor/ios-home/wallpaper.webp") center/cover; padding:72px 23px 30px; box-sizing:border-box; display:flex; flex-direction:column; }
.ios-home::before { content:""; position:absolute; inset:0; background:linear-gradient(180deg,#12314b15,#03172b00 50%,#10263c3d); pointer-events:none; }
.ios-home>* { position:relative; }
.ios-widgets { display:grid; grid-template-columns:1fr 1fr; gap:17px; margin:0 3px 32px; }
.ios-widget { min-width:0; aspect-ratio:1; border:0; border-radius:25px; padding:17px; color:#fff; text-align:left; background:rgba(38,70,105,.42); backdrop-filter:blur(22px) saturate(1.4); -webkit-backdrop-filter:blur(22px) saturate(1.4); box-shadow:inset 0 1px 0 #ffffff70,0 5px 16px #00254a12; font:inherit; overflow:hidden; cursor:pointer; }
.ios-widget .ios-widget-date { font-size:13px; font-weight:600; }
.ios-widget-clock { display:block; margin-top:17px; font-size:41px; font-weight:300; letter-spacing:-1.8px; font-variant-numeric:tabular-nums; }
.ios-widget-note { display:block; font-size:12px; margin-top:14px; opacity:.9; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ios-photo-widget { padding:0; background:#e7d3ba; position:relative; }
.ios-photo-widget img { width:100%; height:100%; object-fit:cover; }
.ios-photo-widget span { position:absolute; bottom:12px; left:15px; font-size:13px; font-weight:600; text-shadow:0 1px 5px #000; }
.ios-pages { display:flex; overflow:auto; scroll-snap-type:x mandatory; scrollbar-width:none; min-height:0; flex:1; margin:0 -14px; touch-action:pan-x pan-y; }
.ios-pages::-webkit-scrollbar { display:none; }
.ios-page { flex:0 0 100%; scroll-snap-align:start; padding:0 14px; box-sizing:border-box; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); grid-auto-rows:94px; gap:17px 12px; align-content:start; }
.ios-app { -webkit-tap-highlight-color:transparent; border:0; background:none; color:#fff; padding:0; font:400 12px/1.25 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; display:flex; flex-direction:column; align-items:center; gap:7px; min-width:0; cursor:pointer; text-shadow:0 1px 4px #18355270; }
.ios-app img { width:61px; height:61px; border-radius:16px; object-fit:cover; box-shadow:inset 0 1px 0 #fff6,0 3px 8px #18355220; transition:transform .2s; }
.ios-app:active img { transform:scale(.9); filter:brightness(.88); }
.ios-page-controls { display:flex; align-items:center; justify-content:center; gap:8px; margin:8px 0 14px; }
.ios-page-dot { width:7px; height:7px; border:0; padding:0; border-radius:50%; background:#ffffff60; cursor:pointer; }
.ios-page-dot[aria-current="true"] { background:white; }
.ios-search { border:0; color:white; background:#f1f5ff28; backdrop-filter:blur(12px); border-radius:22px; padding:7px 15px; font:500 12px/1.3 inherit; cursor:pointer; margin-left:9px; }
.ios-dock { display:grid; grid-template-columns:repeat(4,1fr); padding:15px 8px; gap:13px; background:rgba(237,247,255,.27); backdrop-filter:blur(28px) saturate(1.65); -webkit-backdrop-filter:blur(28px) saturate(1.65); border-radius:34px; box-shadow:inset 0 1px 1px #ffffffb0,inset 0 -1px 1px #ffffff4a,0 7px 28px #092e4e20; }
.ios-dock .ios-app { gap:0; }
.ios-dock .ios-app>span { display:none; }
.ios-home-indicator { position:absolute; left:50%; bottom:9px; transform:translateX(-50%); border:0; width:128px; height:5px; border-radius:4px; background:var(--ios-ink); padding:0; cursor:pointer; z-index:70; }
.ios-home-indicator::before { content:""; position:absolute; inset:-10px; }
#phone:not(.ios-app-open)>.ios-home-indicator { background:white; }
.ios-controls-button { position:absolute; right:20px; top:10px; width:65px; height:36px; z-index:65; border:0; background:transparent; cursor:pointer; }
.ios-controls-button:focus-visible { outline:2px solid var(--ios-blue); border-radius:14px; }
/* Restyle the actual application screens, including lazy-loaded modules. */
body #phone [class$="-screen"],body #phone .chat-screen { background:var(--ios-group); color:var(--ios-ink); }
body #phone [class$="-screen"]>.settings-inner,body #phone .settings-inner { padding-top:54px!important; background:var(--ios-group); }
body #phone :is(.settings-ambient,.settings-watermark,.settings-masthead-tape,.settings-sec-tape,.settings-sec-idx,.settings-topbar-meta,.wardrobe-masthead-tape,.my-watermark) { display:none!important; }
body #phone :is(.settings-topbar,.chat-list-topbar,.char-topbar,.world-book-topbar,.chat-topbar) { background:var(--ios-glass); backdrop-filter:blur(22px) saturate(1.5); -webkit-backdrop-filter:blur(22px) saturate(1.5); border:0; min-height:46px; padding:8px 16px; box-sizing:border-box; }
body #phone :is(.settings-body,.char-body,.world-book-body,.chat-list-body) { padding:16px 17px 35px; }
body #phone :is(.settings-masthead,.wardrobe-masthead,.my-masthead,.world-book-masthead,.char-masthead,.chat-list-masthead) { background:transparent!important; border:0!important; box-shadow:none!important; padding:4px 2px 18px; border-radius:0; }
body #phone :is(.settings-masthead-title,.wardrobe-masthead-title,.my-title,.world-book-title,.char-title,.chat-list-title) { font-size:32px!important; font-weight:700; letter-spacing:-.7px!important; color:var(--ios-ink); font-family:inherit!important; }
body #phone :is(.widget-label,.settings-masthead-k,.imgen-eyebrow,.char-kicker,.chat-list-kicker) { letter-spacing:0!important; text-transform:none; font-family:inherit!important; }
body #phone :is(.settings-masthead-k,.settings-topbar-eyebrow,.wardrobe-masthead-k) { display:none; }
body #phone :is(.settings-panel,.my-panel,.char-panel,.wardrobe-panel,.world-book-volume-card,.chat-list-item,.my-card,.my-row,.char-lib-card,.world-book-card) { background:var(--ios-surface)!important; border:0!important; box-shadow:none!important; border-radius:18px; }
body #phone .settings-panel { padding:16px; }
body #phone :is(.settings-api-field,.char-field) { border-color:var(--ios-line); }
body #phone :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),textarea,select):not(:where(.xy-official *)) { border:0!important; border-radius:11px!important; background:var(--ios-group)!important; color:var(--ios-ink)!important; font:400 15px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important; letter-spacing:0!important; padding:11px 12px; min-width:0; box-sizing:border-box; accent-color:var(--ios-blue); }
body #phone input[type="range"] { accent-color:var(--ios-blue); }
body #phone input[type="checkbox"][role="switch"],body #phone input.ios-switch { appearance:none; -webkit-appearance:none; width:49px; height:29px; border:0; border-radius:18px; background:#e5e5ea; position:relative; flex-shrink:0; transition:background .2s; cursor:pointer; }
body #phone input.ios-switch::after { content:""; position:absolute; width:25px; height:25px; border-radius:50%; top:2px; left:2px; background:white; box-shadow:0 2px 4px #0002; transition:transform .2s; }
body #phone input.ios-switch:checked { background:var(--ios-green); }
body #phone input.ios-switch:checked::after { transform:translateX(20px); }
body #phone :is(.chip,.drawer-item) { font:500 14px/1.3 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important; letter-spacing:0!important; text-transform:none!important; border:0; min-height:34px; border-radius:20px; }
body #phone .chip.ghost { background:rgba(120,120,128,.09); color:var(--ios-blue); }
body #phone .chip.solid { background:var(--ios-blue); color:white; }
body #phone .settings-back-chip { background:transparent!important; padding-left:0; font-size:16px!important; }
body #phone .settings-sec-head { margin:0 2px 8px; }
body #phone .settings-body>:is(section,.settings-stack),body #phone .settings-masthead { flex-shrink:0; }
body #phone .settings-masthead-title { font-style:normal; margin:0; line-height:1.2; }
body #phone :is(.settings-ai-blurb,.settings-ai-key-note,.settings-masthead-desc,.char-lead,.world-book-lead) { font-size:13px; line-height:1.6; }
body #phone :is(.settings-api-field-k,.widget-label,.settings-ai-model-tools-k) { font-family:inherit!important; font-size:12px; letter-spacing:0; text-transform:none; line-height:1.5; }
body #phone :is(.settings-stack,.settings-section) { gap:20px; }
body #phone :is(.settings-api-field-k,.minimax-label,.char-field-label) { font:500 14px/1.5 inherit; color:var(--ios-ink); letter-spacing:0; }
body #phone :is(.minimax-card,.chat-send-choice-card,.chat-more-sheet-card,.mask-switch-card,.wallet-bills-card,.sticker-add-card,.sticker-export-card,.char-st-unlock-card,.roam-char-picker-sheet,.forum-sector-sheet,.roam-world-sheet-card,.chat-detail-panel) { background:var(--ios-glass)!important; backdrop-filter:blur(30px) saturate(1.5); -webkit-backdrop-filter:blur(30px) saturate(1.5); border:0!important; border-radius:30px!important; box-shadow:inset 0 1px 0 #ffffff80,0 18px 60px #0002!important; }
body :is(.minimax-sheet,.chat-send-choice,.chat-more-sheet,.mask-switch-modal,.wallet-bills-modal) { font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
body #phone .drawer { border-radius:30px 30px 0 0; background:var(--ios-glass); backdrop-filter:blur(28px); }
body #phone .toast { background:var(--ios-glass); color:var(--ios-ink); backdrop-filter:blur(24px); border-radius:22px; font:500 14px/1.5 inherit; }
.ios26-f7 { position:absolute!important; inset:0; z-index:12000; pointer-events:none; background:transparent!important; font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; --f7-theme-color:#007aff; --f7-dialog-border-radius:30px; --f7-actions-border-radius:28px; }
.ios26-f7 :is(.dialog,.dialog-backdrop,.actions-modal,.actions-backdrop,.sheet-modal,.sheet-backdrop) { pointer-events:auto; }
.ios26-f7 .dialog { max-width:calc(100% - 48px); }
.ios26-f7 .dialog,.ios26-f7 .actions-modal-group { backdrop-filter:blur(28px) saturate(1.5); -webkit-backdrop-filter:blur(28px) saturate(1.5); }
.ios-search-sheet { position:absolute; inset:54px 0 0; z-index:100; background:var(--ios-glass); backdrop-filter:blur(35px); padding:20px; color:var(--ios-ink); }
.ios-search-sheet[hidden] { display:none; }
.ios-search-head { display:flex; gap:12px; align-items:center; margin-bottom:25px; }
.ios-search-head input { flex:1; }
.ios-search-head button { background:none; border:0; color:var(--ios-blue); font:inherit; padding:10px 0; }
.ios-search-results { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:24px 12px; }
.ios-search-results .ios-app { color:var(--ios-ink); text-shadow:none; }
body .ios26-f7 .sheet-modal { max-height:80%; border-radius:32px 32px 0 0; padding:0 20px 22px; box-sizing:border-box; background:var(--ios-glass); color:var(--ios-ink); backdrop-filter:blur(28px); }
.ios26-f7 .ios-control-sheet { height:370px; overflow-y:auto; }
.ios-control-head { display:flex; align-items:center; justify-content:space-between; padding:20px 0; }
.ios-control-head h2 { margin:0; font-size:24px; white-space:nowrap; }
.ios-control-head .chip { width:auto; flex:0 0 auto; padding:9px 15px; }
.ios-control-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.ios-control-grid button { border:0; padding:18px; border-radius:22px; text-align:left; background:var(--ios-surface); color:var(--ios-ink); font-family:inherit; font-size:15px; line-height:1.5; font-weight:600; cursor:pointer; }
.ios-control-grid i { font-size:26px; color:var(--ios-blue); display:block; margin-bottom:8px; }
.ios-control-note { font-size:12px; color:var(--ios-secondary); margin:20px 0 0; }
button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible { outline:3px solid #007aff80!important; outline-offset:3px; }
button:disabled { opacity:.45; }
::selection { background:#007aff33; }
@media(max-width:500px) { body .stage { padding:0; min-height:100dvh; } body #phone { width:100%; height:100dvh; max-height:100dvh; border-radius:0; box-shadow:none; } body #phone>.statusbar { padding-top:calc(18px + env(safe-area-inset-top,0px)); height:calc(54px + env(safe-area-inset-top,0px)); } body #phone>.statusbar::after { top:calc(11px + env(safe-area-inset-top,0px)); } .ios-home { padding-top:calc(72px + env(safe-area-inset-top,0px)); padding-bottom:calc(30px + env(safe-area-inset-bottom,0px)); } .ios-home-indicator { bottom:calc(9px + env(safe-area-inset-bottom,0px)); } }
@media(max-height:760px) { .ios-home { padding-top:64px; } .ios-widgets { margin-bottom:20px; } .ios-widget { aspect-ratio:1.2; } .ios-page { grid-auto-rows:82px; gap:8px 12px; } .ios-app img { width:55px; height:55px; } .ios-widget-clock { font-size:34px; margin-top:7px; } .ios-widget-note { margin-top:6px; } .ios-dock { padding:12px 8px; } }
@media(prefers-reduced-motion:reduce) { #phone *,#phone *::before,#phone *::after { transition-duration:.01ms!important; animation-duration:.01ms!important; scroll-behavior:auto!important; } }
