/* Build286 — GyoWeb: Chrome/Google-style browser. Own "gw-" namespace so old gyoweb-* rules never interfere.
   Sizes react to the width of the phone itself (container queries), not the browser window. */
#appContent.app-content:has(>.gw),
#appWindow.app-window:not(.hidden)>#appContent.app-content:has(>.gw){position:relative!important;padding:0!important;overflow:hidden!important;background:var(--bg)!important}

.gw{--gw-bg:#0e1220;--gw-surface:#1c2133;--gw-surface2:#262c42;--gw-text:#e8eaf3;--gw-sub:#aab1c6;--gw-link:#9db4ff;--gw-host:#d3d8e8;--gw-line:rgba(255,255,255,.10);--gw-accent:#a99aff;--gw-pill:#252b40;--gw-pill-border:rgba(255,255,255,.12);--gw-shadow:0 2px 10px rgba(0,0,0,.35);
  position:absolute;inset:0;display:flex;flex-direction:column;overflow:hidden;background:var(--gw-bg);color:var(--gw-text);container:gw/inline-size;font-family:Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif}
body.light-mode .gw{--gw-bg:#fff;--gw-surface:#f1f3f8;--gw-surface2:#e6e9f2;--gw-text:#1f2330;--gw-sub:#4d5566;--gw-link:#1a0dab;--gw-host:#202124;--gw-line:#e3e6ee;--gw-accent:#5b4fd8;--gw-pill:#fff;--gw-pill-border:#dfe1e5;--gw-shadow:0 1px 6px rgba(32,33,36,.18)}
.gw *{box-sizing:border-box}
.gw [hidden]{display:none!important}
:where(.gw) button{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer;-webkit-tap-highlight-color:transparent}
:where(.gw) a{color:inherit;text-decoration:none}

/* ---------- logo ---------- */
.gw-logo{font-weight:800;letter-spacing:-.045em;line-height:1;white-space:nowrap;user-select:none;font-size:clamp(40px,17cqw,76px);background:linear-gradient(90deg,#7fa6ff 0%,#9a86f7 38%,#ec8cbb 62%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;color:transparent}
.gw-logo span{background:none;-webkit-text-fill-color:var(--gw-text);color:var(--gw-text);font-weight:700}
body.light-mode .gw-logo span{-webkit-text-fill-color:#2b3045;color:#2b3045}

/* ---------- search pill (one form, moved between home and result bar) ---------- */
.gw-search{display:flex;align-items:center;gap:6px;width:100%;min-width:0;height:48px;padding:0 6px 0 16px;border-radius:26px;background:var(--gw-pill);border:1px solid var(--gw-pill-border);box-shadow:var(--gw-shadow);transition:box-shadow .15s,border-color .15s}
.gw-search:focus-within{border-color:var(--gw-accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--gw-accent) 28%,transparent)}
.gw-search>i{color:var(--gw-sub);font-size:15px;flex:0 0 auto}
.gw-search input{flex:1 1 auto;min-width:0;height:100%;border:0!important;outline:0!important;background:transparent!important;box-shadow:none!important;color:var(--gw-text)!important;caret-color:var(--gw-accent);font:inherit;font-size:16px!important;padding:0!important;margin:0!important;-webkit-appearance:none;appearance:none}
.gw-search input::placeholder{color:var(--gw-sub);opacity:.85}
.gw-search input::-webkit-search-cancel-button,.gw-search input::-webkit-search-decoration{-webkit-appearance:none;display:none}
.gw-clear,.gw-go{flex:0 0 auto;width:36px;height:36px;border-radius:50%;display:grid;place-items:center;font-size:14px}
.gw-clear{color:var(--gw-sub)}
.gw-clear:hover,.gw-go:hover{background:var(--gw-surface2)}
.gw-go{background:linear-gradient(135deg,#7fa6ff,#9a86f7);color:#fff}
.gw-go:hover{background:linear-gradient(135deg,#7fa6ff,#9a86f7);filter:brightness(1.08)}

/* ---------- home (like Chrome new tab) ---------- */
.gw-home{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;display:flex;flex-direction:column;align-items:center;padding:0 clamp(14px,5cqw,28px) max(20px,env(safe-area-inset-bottom,0px))}
.gw-hero{width:100%;max-width:640px;margin:auto 0;padding:clamp(18px,6vh,56px) 0 clamp(14px,3vh,28px);display:flex;flex-direction:column;align-items:center;gap:clamp(18px,4.5vh,34px)}
.gw-hero .gw-search{height:clamp(48px,7vh,56px)}
.gw-shortcuts{width:100%;max-width:560px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:clamp(8px,2.5cqw,16px) clamp(4px,2cqw,12px);padding:4px 0 8px}
.gw-sc{display:flex;flex-direction:column;align-items:center;gap:7px;min-width:0;padding:6px 2px;border-radius:14px}
.gw-sc:hover{background:var(--gw-surface)}
.gw-sc-i{width:clamp(44px,13cqw,56px);aspect-ratio:1;border-radius:50%;display:grid;place-items:center;background:var(--gw-surface);color:var(--c,#9db4ff);font-size:clamp(18px,5.4cqw,23px);border:1px solid var(--gw-line)}
.gw-sc-t{max-width:100%;font-size:12px;color:var(--gw-sub);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* ---------- results view ---------- */
.gw-results{flex:1 1 auto;min-height:0;display:flex;flex-direction:column}
.gw-bar{flex:0 0 auto;display:flex;align-items:center;gap:10px;padding:10px clamp(10px,3.5cqw,20px) 6px;background:var(--gw-bg)}
.gw-bar .gw-search{height:44px;max-width:720px}
.gw-mark{flex:0 0 auto;width:36px;height:36px;border-radius:50%;display:grid;place-items:center;font-weight:800;font-size:19px;color:#fff;background:linear-gradient(135deg,#7fa6ff,#9a86f7 55%,#ec8cbb)}
.gw-tabs{flex:0 0 auto;display:flex;gap:2px;padding:0 clamp(10px,3.5cqw,20px);border-bottom:1px solid var(--gw-line);overflow-x:auto;scrollbar-width:none}
.gw-tabs::-webkit-scrollbar{display:none}
.gw-tab{flex:0 0 auto;display:flex;align-items:center;gap:7px;padding:10px 14px 9px;font-size:14px;color:var(--gw-sub);border-bottom:3px solid transparent;border-radius:3px 3px 0 0}
.gw-tab.active{color:var(--gw-accent);border-bottom-color:var(--gw-accent);font-weight:600}
.gw-scroll{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:4px clamp(14px,4.5cqw,24px) max(24px,env(safe-area-inset-bottom,0px))}
.gw-col{width:100%;max-width:720px;margin:0 auto;min-width:0}

.gw-r{padding:16px 0 15px;border-bottom:1px solid var(--gw-line);min-width:0}
.gw-r:last-child{border-bottom:0}
.gw-r-site{display:flex;align-items:center;gap:10px;min-width:0;margin-bottom:6px}
.gw-fav{position:relative;flex:0 0 28px;width:28px;height:28px;border-radius:50%;background:var(--gw-surface2);display:grid;place-items:center;font-size:13px;font-weight:700;color:var(--fc,#9db4ff);overflow:hidden;border:1px solid var(--gw-line)}
.gw-fav img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;background:#fff;padding:4px}
.gw-r-names{display:flex;flex-direction:column;min-width:0;line-height:1.3}
.gw-r-host{font-size:14px;color:var(--gw-host);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gw-r-url{font-size:12px;color:var(--gw-sub);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gw-r-title{display:block;font-size:clamp(17px,5.2cqw,20px);line-height:1.3;font-weight:500;color:var(--gw-link);overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.gw-r-title:hover{text-decoration:underline}
.gw-r-snip{margin:6px 0 0;font-size:14px;line-height:1.55;color:var(--gw-sub);overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}

/* images */
.gw-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding-top:12px}
@container gw (min-width:520px){.gw-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}}
@container gw (min-width:820px){.gw-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
.gw-img{position:relative;display:block;width:100%;aspect-ratio:4/3;border-radius:12px;overflow:hidden;background:var(--gw-surface);border:1px solid var(--gw-line);text-align:left}
.gw-img img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;transition:transform .2s}
.gw-img:hover img{transform:scale(1.04)}
.gw-img-cap{position:absolute;left:0;right:0;bottom:0;padding:18px 9px 7px;font-size:11px;line-height:1.3;color:#fff;background:linear-gradient(transparent,rgba(0,0,0,.72));display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}

/* states */
.gw-state{display:flex;flex-direction:column;align-items:center;gap:8px;text-align:center;padding:48px 12px;color:var(--gw-sub)}
.gw-state>i{font-size:30px;color:var(--gw-accent)}
.gw-state strong{color:var(--gw-text);font-size:16px}
.gw-state p{margin:0;font-size:13px;line-height:1.5;max-width:340px;overflow-wrap:anywhere}
.gw-retry{margin-top:6px;padding:9px 18px;border-radius:20px;background:var(--gw-surface2);font-size:13px;font-weight:600}
.gw-sk{padding:18px 0}
.gw-sk i{display:block;height:12px;border-radius:6px;margin:9px 0;background:linear-gradient(90deg,var(--gw-surface) 25%,var(--gw-surface2) 50%,var(--gw-surface) 75%);background-size:200% 100%;animation:gwsh 1.2s linear infinite}
.gw-sk i:nth-child(1){width:38%}.gw-sk i:nth-child(2){width:86%;height:16px}.gw-sk i:nth-child(3){width:96%}.gw-sk i:nth-child(4){width:70%}
.gw-skgrid .gw-img{animation:gwsh 1.2s linear infinite;background:linear-gradient(90deg,var(--gw-surface) 25%,var(--gw-surface2) 50%,var(--gw-surface) 75%);background-size:200% 100%}
@keyframes gwsh{to{background-position:-200% 0}}

/* pagination */
.gw-pager{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:6px;padding:22px 0 6px}
.gw-pg{min-width:40px;height:40px;padding:0 14px;border-radius:20px;display:inline-flex;align-items:center;justify-content:center;gap:6px;font-size:14px;color:var(--gw-link);border:1px solid var(--gw-line);background:var(--gw-surface)}
.gw-pg:hover:not(:disabled){background:var(--gw-surface2)}
.gw-pg.cur{background:var(--gw-accent);border-color:transparent;color:#fff;font-weight:700;cursor:default}
.gw-pg:disabled{opacity:.4;cursor:default}
.gw-pg-nav{font-weight:600}
@container gw (max-width:460px){.gw-pg-num:not(.cur){display:none}.gw-pg{height:42px}}
.gw-end{text-align:center;color:var(--gw-sub);font-size:12px;padding:2px 0 0}

/* ---------- in-app site viewer ---------- */
.gw-viewer{position:absolute;inset:0;z-index:20;display:flex;flex-direction:column;background:var(--gw-bg)}
.gw-v-bar{flex:0 0 auto;display:flex;align-items:center;gap:4px;padding:7px 8px;border-bottom:1px solid var(--gw-line);background:var(--gw-bg)}
.gw-v-btn{flex:0 0 auto;width:38px;height:38px;border-radius:50%;display:grid;place-items:center;font-size:15px;color:var(--gw-text)}
.gw-v-btn:hover{background:var(--gw-surface2)}
.gw-v-addr{flex:1 1 auto;min-width:0;height:38px;display:flex;align-items:center;gap:8px;padding:0 14px;border-radius:19px;background:var(--gw-surface);font-size:13px}
.gw-v-addr i{font-size:11px;color:var(--gw-sub);flex:0 0 auto}
.gw-v-addr span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gw-v-hint{flex:0 0 auto;display:flex;align-items:center;gap:8px;padding:6px 8px 6px 12px;font-size:12px;color:var(--gw-sub);background:var(--gw-surface);border-bottom:1px solid var(--gw-line)}
.gw-v-hint span{flex:1 1 auto;min-width:0;line-height:1.35}
.gw-v-hint button{flex:0 0 auto;padding:5px 10px;border-radius:14px;font-weight:600;font-size:12px;color:var(--gw-link)}
.gw-v-hint .gw-v-x{width:26px;height:26px;padding:0;display:grid;place-items:center;color:var(--gw-sub)}
.gw-v-frame{position:relative;flex:1 1 auto;min-height:0;background:#fff}
.gw-v-frame iframe{position:absolute;inset:0;width:100%;height:100%;border:0;display:block;background:#fff}
.gw-v-load{position:absolute;left:0;top:0;height:3px;width:0;background:linear-gradient(90deg,#7fa6ff,#ec8cbb);transition:width .35s;z-index:2}

/* ---------- image preview ---------- */
.gw-lb{position:absolute;inset:0;z-index:30;display:flex;flex-direction:column;background:rgba(5,7,12,.96);color:#fff}
.gw-lb-top{flex:0 0 auto;display:flex;align-items:center;gap:6px;padding:8px}
.gw-lb-top .gw-v-btn{color:#fff}
.gw-lb-top .gw-lb-t{flex:1;min-width:0;font-size:13px;color:#cfd5e6;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gw-lb-stage{position:relative;flex:1 1 auto;min-height:0;display:flex;align-items:center;justify-content:center;padding:0 4px 8px}
.gw-lb-stage img{max-width:100%;max-height:100%;object-fit:contain;border-radius:6px}
.gw-lb-nav{position:absolute;top:50%;transform:translateY(-50%);width:42px;height:42px;border-radius:50%;background:rgba(255,255,255,.14);display:grid;place-items:center;color:#fff}
.gw-lb-nav:disabled{opacity:.25}
.gw-lb-prev{left:6px}.gw-lb-next{right:6px}

/* fallback glyph when the SVG icon file is missing */
.glyph-gyoweb{background:linear-gradient(145deg,#7fa6ff,#9a86f7 55%,#ec8cbb)}

@container gw (min-width:700px){
  .gw-r-snip{font-size:14.5px}
  .gw-hero{max-width:680px}
}
@media(max-height:520px){.gw-hero{margin:0;padding-top:12px;gap:14px}.gw-logo{font-size:38px}}
@media(prefers-reduced-motion:reduce){.gw *{animation:none!important;transition:none!important}}
