:root{--bg: #0f172a;--surface: #1e293b;--surface-2: #273548;--surface-pc: #17253a;--border: #334155;--border-pc: rgba(56, 189, 248, .28);--text: #f8fafc;--text-muted: #94a3b8;--accent: #10b981;--accent-strong: #059669;--sky: #38bdf8;--warn: #f59e0b;--danger: #ef4444;--vv-height: 100dvh;--vv-top: 0px}*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}html,body{margin:0;padding:0;width:100%;height:100%;overflow:hidden;background:var(--bg);color:var(--text);font-family:-apple-system,BlinkMacSystemFont,SF Pro Text,PingFang SC,Segoe UI,Roboto,sans-serif;overscroll-behavior:none}.hidden{display:none!important}.app-shell{position:fixed;left:0;right:0;top:var(--vv-top);height:var(--vv-height);display:flex;flex-direction:column;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px);border:2px solid transparent;transition:border-color .15s ease-out;overflow:hidden}.app-shell.pulse-success{border-color:var(--accent);box-shadow:inset 0 0 0 2px #10b98173}.app-shell.pulse-error{border-color:var(--danger)}.topbar{flex:0 0 auto;height:44px;background:#0f172af5;border-bottom:1px solid var(--border);padding:2px 10px;display:flex;align-items:center;justify-content:space-between;gap:8px}.app-shell.compact .topbar{height:34px;padding:1px 10px}.topbar-left{display:flex;align-items:center;gap:6px;flex:0 0 auto;min-width:0}.status-dot{width:9px;height:9px;border-radius:50%;flex:0 0 auto}.status-dot.online{background:var(--accent);box-shadow:0 0 6px var(--accent)}.status-dot.locked{background:var(--warn)}.status-dot.offline{background:var(--danger)}.status-text{font-size:13px;font-weight:600;color:var(--text);white-space:nowrap}.mode-chip{border:1px solid rgba(16,185,129,.45);background:#10b98124;color:#6ee7b7;border-radius:999px;font-size:11px;font-weight:600;padding:3px 8px;line-height:1.2;cursor:pointer;white-space:nowrap;user-select:none;touch-action:manipulation}.topbar-right{display:flex;align-items:center;justify-content:flex-end;gap:6px;flex:1 1 auto;min-width:0}.delivery-badge{font-size:12px;color:var(--accent);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;flex:1 1 auto;text-align:right}.delivery-badge.warn{color:var(--warn)}.delivery-badge.error{color:var(--danger)}.topbar-btn{flex:0 0 auto;min-width:44px;min-height:40px;padding:0 10px;border:1px solid var(--border);background:var(--surface);color:var(--text);border-radius:10px;font-size:13px;font-weight:500;cursor:pointer;user-select:none;touch-action:manipulation;display:inline-flex;align-items:center;justify-content:center;white-space:nowrap}.app-shell.compact .topbar-btn{min-height:30px;padding:0 8px;font-size:12px}.topbar-btn:active{opacity:.78;transform:scale(.97)}.composer-area{position:relative;flex:1 1 auto;min-height:0;padding:6px 10px;display:flex}.input-box{width:100%;height:100%;resize:none;border:1px solid var(--border);border-radius:14px;background:var(--surface);color:var(--text);font-size:17px;line-height:1.55;padding:12px 14px;outline:none;-webkit-appearance:none}.input-box.has-content{padding-right:78px}.input-box:focus{border-color:var(--sky)}.input-box::placeholder{color:var(--text-muted)}.clear-draft-fab{position:absolute;top:12px;right:16px;z-index:5;min-width:44px;min-height:40px;padding:0 12px;border-radius:999px;border:1px solid rgba(148,163,184,.32);background:#0f172ac7;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);color:var(--text-muted);font-size:13px;font-weight:500;cursor:pointer;user-select:none;touch-action:manipulation;display:inline-flex;align-items:center;justify-content:center}.clear-draft-fab.pressed,.clear-draft-fab:active{color:var(--text);border-color:var(--text-muted);transform:scale(.96)}.toolbar{flex:0 0 auto;display:flex;flex-direction:column;gap:8px;padding:8px 10px;background:#0f172afa;border-top:1px solid var(--border)}.app-shell.compact .toolbar{gap:6px;padding:5px 10px 6px}.remote-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.remote-btn{min-height:46px;height:46px;border-radius:12px;border:1px solid var(--border-pc);background:var(--surface-pc);color:var(--text);font-size:15px;font-weight:500;cursor:pointer;user-select:none;touch-action:manipulation;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 8px}.remote-icon{color:var(--sky);font-size:16px;line-height:1}.remote-btn.pressed,.remote-btn:active{background:#38bdf829;transform:scale(.97)}.primary-row{display:flex;align-items:stretch;gap:8px}.quick-toggle-btn{flex:0 0 34%;min-width:112px;min-height:52px;height:52px;border-radius:12px;border:1px solid var(--border);background:var(--surface);color:var(--text-muted);cursor:pointer;user-select:none;touch-action:manipulation;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:0 8px}.quick-label{font-size:12px;line-height:1.1}.quick-state{font-size:14px;font-weight:700;line-height:1.1;color:var(--text)}.quick-toggle-btn.active{background:#10b9812e;border-color:var(--accent);color:#a7f3d0}.quick-toggle-btn.active .quick-state{color:#6ee7b7}.quick-toggle-btn.pressed,.quick-toggle-btn:active{opacity:.82;transform:scale(.97)}.send-btn{flex:1 1 auto;min-width:0;min-height:52px;height:52px;border:none;border-radius:12px;background:var(--accent);color:#022c22;font-weight:700;font-size:17px;letter-spacing:.3px;padding:0 16px;cursor:pointer;user-select:none;touch-action:manipulation;display:inline-flex;align-items:center;justify-content:center;white-space:nowrap}.send-btn:active,.send-btn.pressed{background:var(--accent-strong);transform:scale(.98)}.modal-backdrop{position:fixed;inset:0;background:#020617c7;display:flex;align-items:flex-end;justify-content:center;padding:12px 12px calc(12px + env(safe-area-inset-bottom,0px));z-index:100}@media(min-height:620px){.modal-backdrop{align-items:center;padding:16px}}.modal-card{width:100%;max-width:420px;max-height:85vh;overflow-y:auto;background:var(--surface);border:1px solid var(--border);border-radius:18px;padding:16px;display:flex;flex-direction:column;gap:14px}.modal-header-row{display:flex;align-items:center;justify-content:space-between;gap:10px}.modal-card h2{margin:0;font-size:18px;font-weight:700}.modal-close-btn{min-width:56px;min-height:40px;padding:0 14px;border-radius:10px;border:1px solid var(--border);background:var(--surface-2);color:var(--text);font-size:14px;font-weight:600;cursor:pointer}.setting-block{display:flex;flex-direction:column;gap:8px}.setting-block-title{font-size:14px;font-weight:600;color:var(--text)}.segment-group{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;background:var(--bg);padding:4px;border-radius:12px;border:1px solid var(--border)}.segment-btn{min-height:46px;border:1px solid transparent;border-radius:9px;background:transparent;color:var(--text-muted);font-size:14px;font-weight:600;cursor:pointer;padding:0 6px;white-space:nowrap}.segment-btn.active{background:#10b98138;border-color:var(--accent);color:#6ee7b7}.setting-hint{margin:0;font-size:12px;color:var(--text-muted);line-height:1.45}.setting-list{display:flex;flex-direction:column;gap:8px}.setting-row{width:100%;min-height:54px;padding:10px 14px;border-radius:12px;border:1px solid var(--border);background:var(--bg);color:var(--text);display:flex;align-items:center;justify-content:space-between;gap:12px;cursor:pointer;text-align:left}.setting-row-text{font-size:15px;font-weight:500}.switch-track{position:relative;flex:0 0 auto;width:48px;height:28px;border-radius:999px;background:var(--surface-2);border:1px solid var(--border);transition:background-color .15s ease,border-color .15s ease}.switch-thumb{position:absolute;top:2px;left:2px;width:22px;height:22px;border-radius:50%;background:var(--text-muted);transition:transform .15s ease,background-color .15s ease}.setting-row.active .switch-track{background:#10b98147;border-color:var(--accent)}.setting-row.active .switch-thumb{transform:translate(20px);background:var(--accent)}.setting-action-btn{width:100%;min-height:48px;border-radius:12px;border:1px solid var(--border);background:var(--surface-2);color:var(--sky);font-size:15px;font-weight:600;cursor:pointer}.setting-action-primary{border-color:#10b98173;background:#10b98124;color:#6ee7b7}.qr-box{display:flex;align-items:center;justify-content:center;background:#fff;border-radius:14px;padding:12px;margin:0 auto;width:min(100%,280px)}.qr-canvas{display:block;width:100%;height:auto;max-width:256px;image-rendering:pixelated;image-rendering:crisp-edges}.qr-hint{text-align:center}.qr-unpaired{margin:8px 0;padding:16px 12px;border-radius:12px;border:1px solid var(--border);background:var(--bg);color:var(--text-muted);font-size:14px;line-height:1.5;text-align:center}.qr-feedback{margin:0;min-height:16px;font-size:12px;color:var(--accent);text-align:center}.qr-feedback.error{color:var(--danger)}.modal-desc{margin:0;font-size:13px;color:var(--text-muted);line-height:1.5}.modal-input{width:100%;min-height:46px;padding:10px 12px;border-radius:10px;border:1px solid var(--border);background:var(--bg);color:var(--text);font-size:15px}.field-stack{display:flex;flex-direction:column;gap:10px}.field-group{display:flex;flex-direction:column;gap:6px}.field-label{font-size:12px;font-weight:600;color:var(--text-muted)}.input-with-btn{display:flex;align-items:stretch;gap:8px}.input-with-btn .modal-input{flex:1 1 auto;min-width:0}.inline-action-btn{flex:0 0 auto;min-height:46px;padding:0 12px;border-radius:10px;border:1px solid var(--border);background:var(--surface-2);color:var(--sky);font-size:13px;font-weight:600;cursor:pointer;white-space:nowrap}.modal-error{margin:0;min-height:16px;font-size:12px;color:var(--danger)}.modal-actions{display:flex;justify-content:space-between;gap:10px}.modal-secondary-btn,.modal-primary-btn{flex:1 1 0;min-height:46px;border-radius:12px;font-size:15px;font-weight:600;cursor:pointer}.modal-secondary-btn{border:1px solid var(--border);background:transparent;color:var(--text-muted)}.modal-primary-btn{border:none;background:var(--accent);color:#022c22;font-weight:700}.history-list{display:flex;flex-direction:column;gap:8px}.history-item{display:flex;align-items:center;justify-content:space-between;gap:10px;background:var(--bg);border:1px solid var(--border);border-radius:12px;padding:10px 12px}.history-text{font-size:14px;line-height:1.45;word-break:break-all;flex:1 1 auto}.history-resend-btn{flex:0 0 auto;min-width:56px;min-height:40px;padding:0 12px;border-radius:10px;border:1px solid var(--border);background:var(--surface);color:var(--text);font-size:13px;font-weight:600;cursor:pointer}.history-empty{font-size:14px;color:var(--text-muted);text-align:center;padding:20px 0}
