:root { color-scheme:light; font:16px system-ui,sans-serif; background:#f5f6f8; color:#202733; }
* { box-sizing:border-box; }
[hidden] { display:none !important; }
html,body { width:100%; height:100%; margin:0; overflow:hidden; }
button,input,select { font:inherit; }
button { border:1px solid #d0d7df; border-radius:9px; background:#ffffffd9; color:#283443; min-height:38px; padding:7px 12px; cursor:pointer; touch-action:manipulation; }
button:disabled { opacity:.5; cursor:wait; }
button:hover { background:#fff; border-color:#abb8c6; }
input,select { border:1px solid #c9d1da; border-radius:8px; background:#fff; color:#202733; padding:9px 11px; min-height:40px; }
input:focus-visible,button:focus-visible,select:focus-visible { outline:2px solid #4989b8; outline-offset:2px; }
.entry { min-height:100%; display:grid; place-items:center; padding:20px; overflow:auto; background:#f5f6f8; }
#login-panel { height:100dvh; }
.card { width:min(100%,410px); padding:30px; border:1px solid #e0e4e9; border-radius:15px; background:#fff; box-shadow:0 6px 28px #24334a08; }
h1 { font-size:24px; font-weight:600; line-height:1.3; margin:0 0 24px; letter-spacing:-.025em; }
.muted { color:#657184; line-height:1.5; }
.fine { font-size:12px; color:#697789; line-height:1.45; margin:10px 0 0; }
#login-form { display:grid; gap:9px; }
#login-form>label:not(.check) { font-size:13px; margin-top:4px; }
.password-field { display:flex; min-width:0; gap:6px; }
.password-field input { flex:1; min-width:0; }
#show-password { min-width:85px; font-size:12px; }
.check { display:flex; gap:9px; align-items:center; font-size:14px; margin:10px 0 12px; }
.check input { min-height:auto; width:17px; height:17px; accent-color:#427ca8; }
.primary { background:#386f99; border-color:#386f99; color:#fff; font-weight:600; }
.primary:hover { background:#2b5c82; border-color:#2b5c82; }
.error { color:#a23540; font-size:14px; }
#browser-shell { height:100dvh; display:grid; grid-template-rows:auto minmax(0,1fr); }
#toolbar { display:flex; gap:5px; align-items:center; padding:max(4px,env(safe-area-inset-top)) max(5px,env(safe-area-inset-right)) 4px max(5px,env(safe-area-inset-left)); background:#eef1f5ed; border-bottom:1px solid #cfd7e1; z-index:8; }
#toolbar button,#floating-controls button { min-width:36px; height:36px; min-height:36px; padding:5px 9px; background:#ffffffc9; border:1px solid #bfcad8b3; color:#29394b; box-shadow:0 1px 4px #1c304515; backdrop-filter:blur(9px); }
#toolbar button:hover,#floating-controls button:hover { background:#fff; }
#navigation { display:flex; gap:4px; min-width:0; flex:1; }
#address { width:100%; min-width:0; font-size:16px; min-height:36px; height:36px; padding:6px 9px; }
#workspace { position:relative; min-height:0; background:#000; }
#stream { display:block; width:100%; height:100%; min-height:0; border:0; background:#000; }
#session-panel { position:absolute; inset:0; }
.compact { text-align:center; }
.compact h1 { margin-bottom:14px; }
.compact button { margin:6px; }
.menu { position:fixed; z-index:9; top:max(51px,calc(env(safe-area-inset-top) + 46px)); right:max(8px,env(safe-area-inset-right)); width:min(300px,calc(100vw - 16px)); max-height:calc(100dvh - 65px - env(safe-area-inset-top)); overflow:auto; padding:17px; background:#fffffff5; border:1px solid #ccd5df; border-radius:13px; box-shadow:0 12px 38px #26374c29; backdrop-filter:blur(14px); }
.account-line { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:14px; overflow-wrap:anywhere; }
.account-line strong { min-width:0; }
.account-line button { flex-shrink:0; }
.bookmark-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:9px; color:#5b6878; font-size:13px; }
#bookmarks-edit { padding:4px 8px; min-height:30px; font-size:12px; }
.quick-links { display:flex; flex-wrap:wrap; gap:8px; }
.quick-links button { flex:1 1 105px; min-width:0; background:#f2f5f8; overflow-wrap:anywhere; }
.bookmark-load-state { margin-bottom:19px; }
#bookmarks-retry { padding:5px 8px; font-size:12px; margin-top:7px; }
.menu label { display:block; font-size:13px; margin-bottom:6px; color:#5b6878; }
.menu select,.menu .logout { width:100%; }
.menu .logout { margin-top:20px; background:#f8f9fb; }
#floating-controls { display:flex; flex:0 0 auto; gap:5px; }
#floating-controls button { width:36px; min-width:36px; flex:0 0 36px; opacity:.82; }
#floating-controls button:focus-visible,#floating-controls button:active { opacity:1; }
#show-controls { display:none; font-size:25px; line-height:1; }
.immersive #browser-shell { grid-template-rows:minmax(0,1fr); }
.immersive #show-controls { display:block; }
.immersive:not(.controls-open) #toolbar { position:fixed; top:0; right:0; background:transparent; border-bottom-color:transparent; }
.immersive:not(.controls-open) #back,.immersive:not(.controls-open) #navigation { display:none; }
.immersive.controls-open #browser-shell { grid-template-rows:auto minmax(0,1fr); }
#notice { position:fixed; z-index:10; top:max(54px,calc(env(safe-area-inset-top) + 50px)); left:8px; right:8px; margin:auto; max-width:680px; background:#fff2e8; border:1px solid #e6cab6; color:#67482f; padding:10px 14px; border-radius:9px; font-size:13px; box-shadow:0 8px 30px #26374c20; }
dialog { max-width:min(430px,calc(100vw - 32px)); padding:24px; border:1px solid #ccd5df; border-radius:14px; background:#fff; color:#202733; box-shadow:0 18px 60px #16273a40; }
dialog::backdrop { background:#1b2b4066; }
dialog h2 { font-size:21px; margin:0 0 13px; font-weight:600; }
dialog p { color:#5b6878; line-height:1.5; margin:0 0 24px; }
.dialog-actions { display:flex; justify-content:flex-end; gap:8px; }
#bookmarks-dialog { width:580px; max-height:calc(100dvh - 30px); overflow:auto; }
#bookmark-rows { display:grid; gap:13px; margin-bottom:14px; }
.bookmark-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:7px; border:1px solid #e0e5eb; border-radius:10px; padding:10px; }
.bookmark-row label { display:grid; gap:4px; font-size:12px; color:#5b6878; min-width:0; }
.bookmark-row input { width:100%; min-width:0; font-size:14px; }
.bookmark-url-label { grid-column:1/-1; }
.bookmark-remove { align-self:end; min-width:38px; }
#bookmarks-form .dialog-actions { margin-top:22px; }
#bookmarks-reload { max-width:100%; font-size:13px; }
@media(max-width:480px) { .card { padding:24px; } #toolbar { gap:3px; } #toolbar button { min-width:32px; padding:5px 7px; } }
@media(max-height:510px) { #login-panel { place-items:start center; } .card { padding:20px; } }
.clipboard-menu { width:100%; margin:0 0 18px; }
#clipboard-dialog { width:540px; max-height:calc(100dvh - 24px); overflow:auto; }
#clipboard-dialog label { display:block; font-size:13px; color:#5b6878; margin:16px 0 6px; }
#clipboard-dialog textarea { display:block; width:100%; resize:vertical; min-height:76px; max-height:200px; border:1px solid #c9d1da; border-radius:8px; padding:9px; font:14px system-ui,sans-serif; color:#202733; background:#fff; }
#clipboard-dialog textarea:focus-visible { outline:2px solid #4989b8; outline-offset:2px; }
#clipboard-dialog .fine { margin:10px 0; }
.clipboard-actions { display:flex; flex-wrap:wrap; gap:8px; margin:8px 0; }
#clipboard-copy { margin-top:8px; }
#clipboard-dialog .dialog-actions { margin-top:18px; }
