:root { --bg:#f4f6fb; --card:#fff; --text:#1b2330; --muted:#6b778c; --primary:#2563eb; --ok:#16a34a; --bad:#dc2626; --line:#e3e8f0; --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); }
@media (prefers-color-scheme: dark) { :root { --bg:#0f141c; --card:#182130; --text:#e8edf6; --muted:#93a0b6; --line:#263247; } }
* { box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html, body { margin:0; height:100%; }
body { font-family:"Segoe UI", Tahoma, system-ui, Arial, sans-serif; background:var(--bg); color:var(--text); font-size:16px; }
.hidden { display:none !important; }
h1, h2 { margin:0; }
h2 { font-size:16px; margin-bottom:10px; }
.muted { color:var(--muted); font-size:14px; }
.error { color:var(--bad); font-size:14px; white-space:pre-wrap; }
.btn { font-family:inherit; font-size:15px; border:1px solid var(--line); background:var(--card); color:var(--text); border-radius:12px; padding:12px 18px; cursor:pointer; }
.btn.primary { background:var(--primary); border-color:var(--primary); color:#fff; }
.btn.danger { color:var(--bad); border-color:#f0b9b9; }
.btn.link { border:none; background:none; color:var(--primary); }
.btn.small { padding:7px 14px; font-size:14px; border-radius:10px; }
.btn.block { display:block; width:100%; margin-top:10px; }
.btn:disabled { opacity:.55; }
.big-btn { padding:16px; font-size:18px; font-weight:700; }
input[type=text], input[type=email], input[type=password], select { width:100%; padding:13px 14px; font-size:16px; font-family:inherit; border:1px solid var(--line); border-radius:12px; background:var(--card); color:var(--text); }
label { display:flex; flex-direction:column; gap:6px; color:var(--muted); font-size:14px; margin-top:12px; }
.auth { min-height:100%; display:flex; align-items:center; justify-content:center; padding:24px; padding-top:calc(24px + var(--sat)); }
.auth-card { width:100%; max-width:420px; background:var(--card); border-radius:20px; padding:26px 22px; box-shadow:0 8px 30px rgba(0,0,0,.08); }
.auth-card h1 { text-align:center; font-size:26px; }
.logo { text-align:center; margin-bottom:6px; } .logo img { border-radius:18px; }
.sub { text-align:center; color:var(--muted); margin:6px 0 4px; }
details { margin-top:12px; color:var(--muted); font-size:14px; }
.top { position:sticky; top:0; z-index:5; display:flex; align-items:center; justify-content:space-between; padding:calc(12px + var(--sat)) 16px 12px; background:var(--primary); color:#fff; }
.top h1 { font-size:19px; }
.conn { display:flex; align-items:center; gap:6px; font-size:13px; background:rgba(255,255,255,.18); padding:4px 10px; border-radius:999px; }
.conn i { width:9px; height:9px; border-radius:50%; background:#4ade80; display:inline-block; } .conn.off i { background:#f87171; }
main { padding:14px 14px calc(92px + var(--sab)); max-width:640px; margin:0 auto; }
.card { background:var(--card); border:1px solid var(--line); border-radius:16px; padding:14px; margin-bottom:12px; }
.drop { display:flex; flex-direction:column; align-items:center; gap:4px; padding:22px 10px; border:2px dashed #a9bde8; border-radius:14px; cursor:pointer; text-align:center; }
.drop .big { font-size:34px; } .drop small { color:var(--muted); }
.filecard { display:flex; align-items:center; justify-content:space-between; gap:10px; } .filecard b { word-break:break-all; display:block; } .filecard small { color:var(--muted); }
.row { display:flex; align-items:center; justify-content:space-between; padding:10px 0; border-top:1px solid var(--line); gap:10px; } .row:first-of-type { border-top:none; }
.row.col { flex-direction:column; align-items:stretch; }
.stepper { display:flex; align-items:center; gap:14px; } .stepper b { min-width:28px; text-align:center; font-size:18px; }
.seg { display:flex; background:var(--bg); border-radius:12px; padding:3px; gap:3px; margin-top:2px; }
.seg button { flex:1; border:none; background:none; color:var(--text); font-family:inherit; font-size:15px; padding:10px 6px; border-radius:10px; cursor:pointer; }
.seg button.active { background:var(--primary); color:#fff; }
#rangeText { margin-top:6px; }
.switch { position:relative; margin:0; flex-direction:row; } .switch input { position:absolute; opacity:0; width:0; height:0; }
.switch i { width:48px; height:28px; background:#c3ccdb; border-radius:999px; position:relative; transition:.2s; display:block; }
.switch i::after { content:""; position:absolute; top:3px; inset-inline-start:3px; width:22px; height:22px; border-radius:50%; background:#fff; transition:.2s; }
.switch input:checked + i { background:var(--ok); } .switch input:checked + i::after { inset-inline-start:23px; }
.head { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; } .head h2 { margin:0; }
.group { margin-bottom:16px; } .group h3 { margin:0 0 8px; font-size:15px; color:var(--muted); }
.printer { display:flex; align-items:center; justify-content:space-between; gap:10px; background:var(--card); border:1px solid var(--line); border-radius:14px; padding:12px 14px; margin-bottom:8px; }
.printer b { display:block; word-break:break-word; } .printer small { color:var(--muted); }
.badge { padding:3px 10px; border-radius:999px; font-size:12px; font-weight:700; white-space:nowrap; }
.badge.on { background:#dcfce7; color:#166534; } .badge.off { background:#fee2e2; color:#991b1b; }
.job { background:var(--card); border:1px solid var(--line); border-radius:14px; padding:12px 14px; margin-bottom:8px; }
.job .t { display:flex; justify-content:space-between; gap:8px; align-items:flex-start; } .job b { word-break:break-all; }
.job small { color:var(--muted); display:block; margin-top:3px; } .job .err { color:var(--bad); font-size:13px; margin-top:4px; }
.job .act { margin-top:8px; }
.st { padding:3px 10px; border-radius:999px; font-size:12px; font-weight:700; white-space:nowrap; }
.st.queued, .st.downloading, .st.printing { background:#fef3c7; color:#92400e; } .st.completed { background:#dcfce7; color:#166534; } .st.failed { background:#fee2e2; color:#991b1b; }
.bottom { position:fixed; bottom:0; inset-inline:0; display:flex; background:var(--card); border-top:1px solid var(--line); padding-bottom:var(--sab); z-index:6; }
.bottom button { flex:1; border:none; background:none; color:var(--muted); font-family:inherit; font-size:12px; padding:9px 0 8px; display:flex; flex-direction:column; align-items:center; gap:2px; cursor:pointer; }
.bottom button span { font-size:21px; } .bottom button.active { color:var(--primary); font-weight:700; }
.toast { position:fixed; bottom:calc(84px + var(--sab)); inset-inline:16px; margin:auto; max-width:480px; background:#1b2330; color:#fff; padding:12px 16px; border-radius:12px; z-index:20; text-align:center; white-space:pre-wrap; }
.email { font-size:17px; margin:0 0 4px; }

.tiles { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin-bottom:12px; }
.tile { border:1px solid var(--line); background:var(--card); color:var(--text); border-radius:14px; padding:12px 4px; font-family:inherit; font-size:13px; display:flex; flex-direction:column; align-items:center; gap:4px; cursor:pointer; }
.tile span { font-size:26px; }
textarea { width:100%; padding:12px; font-size:16px; font-family:inherit; border:1px solid var(--line); border-radius:12px; background:var(--card); color:var(--text); resize:vertical; }
.preview { margin-bottom:10px; text-align:center; }
.preview img { max-width:100%; max-height:260px; border-radius:12px; border:1px solid var(--line); }
.preview pre { text-align:start; white-space:pre-wrap; word-break:break-word; max-height:180px; overflow:auto; background:var(--bg); padding:10px; border-radius:12px; margin:0; font-family:inherit; font-size:14px; }
.preview .pdf { font-size:46px; }
