:root{font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Microsoft YaHei,sans-serif;color:#17202a;background:#f3f5f7;font-synthesis:none;text-rendering:optimizeLegibility;--ink: #17202a;--muted: #66717e;--line: #dce1e6;--soft: #f3f5f7;--surface: #ffffff;--green: #13795b;--green-dark: #0d5f47;--green-soft: #e8f4ef;--amber: #a15c06;--amber-soft: #fff4dd;--red: #b4232f;--red-soft: #fff0f1;--blue: #2563a6}*{box-sizing:border-box;letter-spacing:0}html,body,#root{width:100%;min-width:320px;min-height:100%;margin:0}body{min-height:100dvh;overflow-x:hidden}button,input,textarea{font:inherit}button,label{-webkit-tap-highlight-color:transparent}button:focus-visible,input:focus-visible,textarea:focus-visible,a:focus-visible,label:focus-within{outline:3px solid rgba(37,99,166,.28);outline-offset:2px}button{color:inherit}.app-shell{min-height:100dvh;background:var(--soft)}.app-shell--chat{display:flex;background:#e9edf0}.app-header{height:62px;padding:0 max(20px,env(safe-area-inset-left));display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);background:#fffffff0}.app-brand{color:var(--ink);text-decoration:none;display:inline-flex;align-items:center;gap:10px;font-weight:730}.brand-mark{width:34px;height:34px;display:inline-flex;align-items:center;justify-content:center;border-radius:7px;color:#fff;background:var(--green)}.brand-mark--large{width:48px;height:48px;margin-bottom:18px}.header-security,.secure-pill{display:inline-flex;align-items:center;gap:6px;color:var(--green-dark);font-size:13px;font-weight:650}.header-security{padding:6px 9px;border:1px solid #b9d8cc;border-radius:6px;background:var(--green-soft)}.home-view,.pairing-view,.scanner-view,.trust-view,.status-view{width:min(100%,680px);min-height:calc(100dvh - 62px);margin:0 auto;padding:72px 28px 48px}.home-view{display:flex;flex-direction:column;justify-content:center}.home-heading h1,.pairing-heading h1,.trust-view h1,.status-view h1{margin:0;font-size:32px;line-height:1.18;font-weight:760}.eyebrow,.step-label{margin:0 0 10px;color:var(--green-dark);font-size:12px;font-weight:760;text-transform:uppercase}.home-subtitle,.pairing-heading p,.trust-description,.status-view p{color:var(--muted);line-height:1.65}.home-subtitle{max-width:480px;margin:14px 0 0;font-size:16px}.start-actions{display:grid;gap:12px;margin-top:38px}.start-action{width:100%;min-height:78px;padding:15px 18px;display:grid;grid-template-columns:46px minmax(0,1fr) 24px;align-items:center;gap:14px;border:1px solid #cfd6dc;border-radius:8px;background:var(--surface);cursor:pointer;text-align:left;transition:border-color .16s ease,background-color .16s ease,transform .16s ease}.start-action:hover{border-color:#9ca8b4;background:#fbfcfc;transform:translateY(-1px)}.start-action--primary{color:#fff;border-color:var(--green);background:var(--green)}.start-action--primary:hover{border-color:var(--green-dark);background:var(--green-dark)}.start-action__icon{width:46px;height:46px;display:inline-flex;align-items:center;justify-content:center;border-radius:7px;color:var(--green-dark);background:var(--green-soft)}.start-action--primary .start-action__icon{color:#fff;background:#ffffff24}.start-action__copy{min-width:0;display:flex;flex-direction:column;gap:4px}.start-action__copy strong{font-size:16px}.start-action__copy span{color:var(--muted);font-size:13px}.start-action--primary .start-action__copy span{color:#ffffffc7}.privacy-line{margin-top:22px;display:flex;align-items:center;justify-content:center;gap:8px;color:var(--muted);font-size:13px}.pairing-view,.scanner-view{padding-top:48px}.pairing-heading{text-align:center}.pairing-heading p{max-width:500px;margin:12px auto 0;font-size:14px}.step-label{display:inline-flex;padding:5px 8px;border-radius:5px;background:var(--green-soft)}.qr-tool,.scanner-tool{margin:30px auto 0;display:flex;flex-direction:column;align-items:center}.qr-canvas,.qr-frame-note{width:min(380px,calc(100vw - 48px))}.qr-canvas{aspect-ratio:1;padding:8px;display:flex;align-items:center;justify-content:center;border:1px solid #cfd6dc;border-radius:8px;background:#fff;box-shadow:0 12px 30px #1e2a3412}.qr-canvas img{width:100%;height:100%;display:block}.qr-placeholder{width:100%;height:100%;background:#eef1f3}.qr-frame-note{margin-bottom:14px;display:grid;gap:4px;text-align:center}.qr-frame-note strong{font-size:14px;font-weight:700}.qr-frame-note span{color:var(--muted);font-size:13px;line-height:1.55}.frame-controls{min-height:52px;margin-top:12px;padding:4px;display:flex;align-items:center;gap:4px;border:1px solid var(--line);border-radius:7px;background:#fff}.frame-controls .icon-button{width:44px;height:44px}.frame-counter{min-width:116px;text-align:center;color:var(--muted);font-size:13px;font-variant-numeric:tabular-nums}.route-hint,.scan-progress{min-height:34px;margin-top:14px;padding:7px 10px;display:inline-flex;align-items:center;gap:7px;border-radius:6px;color:var(--green-dark);background:var(--green-soft);font-size:13px;font-weight:620}.route-hint--warn{color:var(--amber);background:var(--amber-soft)}.pairing-actions{margin-top:26px;display:flex;flex-direction:column;align-items:center;gap:10px}.pairing-actions--row{flex-direction:row;justify-content:center}.button{min-height:44px;padding:0 17px;display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid transparent;border-radius:7px;font-size:14px;font-weight:690;cursor:pointer}.button:disabled{cursor:not-allowed;opacity:.55}.button--primary{color:#fff;border-color:var(--green);background:var(--green)}.button--primary:hover:not(:disabled){background:var(--green-dark)}.button--secondary{color:var(--ink);border-color:#bfc7ce;background:#fff}.button--ghost,.button--danger-ghost{color:var(--muted);background:transparent}.button--danger-ghost{color:var(--red)}.button--danger{color:#fff;background:var(--red)}.icon-button{width:38px;height:38px;padding:0;display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:6px;background:transparent;cursor:pointer}.icon-button:hover:not(:disabled){background:#edf0f2}.icon-button--border{border:1px solid var(--line);background:#fff}.text-button{margin:18px auto 0;display:block;border:0;color:var(--muted);background:transparent;cursor:pointer}.scanner-viewport{position:relative;width:min(430px,calc(100vw - 40px));aspect-ratio:4 / 3;overflow:hidden;border-radius:8px;background:#19232b}.scanner-viewport video{width:100%;height:100%;display:block;object-fit:cover}.scan-corner{position:absolute;width:34px;height:34px;border-color:#fff;border-style:solid;pointer-events:none}.scan-corner--tl{top:18px;left:18px;border-width:3px 0 0 3px}.scan-corner--tr{top:18px;right:18px;border-width:3px 3px 0 0}.scan-corner--bl{bottom:18px;left:18px;border-width:0 0 3px 3px}.scan-corner--br{right:18px;bottom:18px;border-width:0 3px 3px 0}.camera-fallback{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;color:#fff;background:#24313a}.inline-error{width:min(430px,100%);margin-top:10px;padding:10px 12px;display:flex;align-items:flex-start;gap:8px;border-radius:6px;color:var(--red);background:var(--red-soft);font-size:13px;line-height:1.45}.file-button{position:relative;cursor:pointer}.file-button input{position:absolute;width:1px;height:1px;opacity:0}.status-view,.trust-view{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}.status-orbit,.trust-icon{width:64px;height:64px;margin-bottom:22px;display:flex;align-items:center;justify-content:center;border-radius:50%;color:var(--green-dark);background:var(--green-soft)}.status-orbit--error,.trust-icon--danger{color:var(--red);background:var(--red-soft)}.status-view p{max-width:430px;margin:12px 0 24px}.trust-description{max-width:480px;margin:12px 0 24px}.safety-code{width:min(100%,470px);padding:18px;display:flex;align-items:flex-start;justify-content:center;gap:12px;border:1px solid #c6ced5;border-radius:8px;background:#fff}.safety-code>div{display:grid;grid-template-columns:repeat(3,minmax(48px,1fr));gap:9px 14px}.safety-code span{font-family:SFMono-Regular,Consolas,Liberation Mono,monospace;font-size:18px;font-weight:730;font-variant-numeric:tabular-nums}.fingerprint-line{max-width:100%;margin-top:13px;display:flex;align-items:center;gap:8px;color:var(--muted);font-family:SFMono-Regular,Consolas,monospace;font-size:12px}.trust-actions{margin-top:26px;display:flex;flex-direction:column;gap:8px}.chat-view{width:min(100%,980px);height:100dvh;margin:0 auto;display:grid;grid-template-rows:64px minmax(0,1fr) auto;position:relative;overflow:hidden;border-right:1px solid #d6dce1;border-left:1px solid #d6dce1;background:#f7f8f9}.chat-header{min-width:0;padding:0 14px;display:flex;align-items:center;gap:11px;border-bottom:1px solid var(--line);background:#fffffff5}.peer-avatar{width:38px;height:38px;flex:0 0 auto;display:flex;align-items:center;justify-content:center;border-radius:7px;color:var(--green-dark);background:var(--green-soft)}.chat-peer{min-width:0;flex:1;display:flex;flex-direction:column;gap:2px}.chat-peer strong{overflow:hidden;font-size:14px;text-overflow:ellipsis;white-space:nowrap}.connection-label{display:inline-flex;align-items:center;gap:5px;color:var(--green-dark);font-size:11px;font-weight:620}.connection-label--warn{color:var(--amber)}.secure-pill{flex:0 0 auto;padding:5px 7px;border-radius:5px;background:var(--green-soft);font-size:11px}.message-list{min-height:0;padding:24px 24px 18px;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.empty-chat{min-height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;color:var(--muted);text-align:center}.empty-chat div{width:46px;height:46px;margin-bottom:5px;display:flex;align-items:center;justify-content:center;border-radius:50%;color:var(--green-dark);background:var(--green-soft)}.empty-chat strong{color:var(--ink);font-size:14px}.empty-chat span{font-size:13px}.message-row{width:100%;margin:8px 0;display:flex;flex-direction:column;align-items:flex-start}.message-row--outgoing{align-items:flex-end}.message-bubble{position:relative;min-width:104px;max-width:min(76%,680px);padding:10px 12px 7px;border:1px solid #d9dfe4;border-radius:8px 8px 8px 2px;background:#fff}.message-row--outgoing .message-bubble{border-color:#bcd9ce;border-radius:8px 8px 2px;background:#e9f5f0}.message-bubble p{margin:0;overflow-wrap:anywhere;white-space:pre-wrap;font-size:15px;line-height:1.55}.message-bubble footer{min-height:16px;margin-top:5px;display:flex;align-items:center;justify-content:flex-end;gap:4px;color:#77818c;font-size:10px;font-variant-numeric:tabular-nums}.copy-message{position:absolute;top:5px;right:calc(100% + 7px);width:32px;height:32px;display:flex;align-items:center;justify-content:center;border:0;border-radius:6px;color:var(--muted);background:transparent;cursor:pointer;opacity:0}.message-row--incoming .copy-message{right:auto;left:calc(100% + 7px)}.message-bubble:hover .copy-message,.copy-message:focus-visible{opacity:1;background:#fff}.retry-message{margin-top:3px;display:inline-flex;align-items:center;gap:4px;border:0;color:var(--red);background:transparent;font-size:11px;cursor:pointer}.new-message-button{position:absolute;right:20px;bottom:88px;min-height:34px;padding:0 12px;border:1px solid #b8c2ca;border-radius:7px;color:var(--blue);background:#fff;box-shadow:0 6px 20px #1a27301f;cursor:pointer}.composer{padding:10px 14px calc(10px + env(safe-area-inset-bottom));border-top:1px solid var(--line);background:#fff}.composer-row{display:grid;grid-template-columns:minmax(0,1fr) 44px;align-items:end;gap:8px}.composer textarea{width:100%;min-height:44px;max-height:144px;padding:10px 12px;resize:none;overflow-y:auto;border:1px solid #cbd2d8;border-radius:7px;color:var(--ink);background:#f9fafb;font-size:16px;line-height:1.45}.composer textarea:focus{border-color:var(--green);background:#fff}.send-button{width:44px;height:44px;padding:0;display:flex;align-items:center;justify-content:center;border:0;border-radius:7px;color:#fff;background:var(--green);cursor:pointer}.send-button:disabled{color:#919ba5;background:#e4e8eb;cursor:not-allowed}.composer-error,.byte-counter{margin-bottom:6px;color:var(--red);font-size:12px}.byte-counter{margin:5px 52px 0 0;color:var(--muted);text-align:right;font-variant-numeric:tabular-nums}.byte-counter--error{color:var(--red)}.dialog-backdrop{position:fixed;z-index:20;top:0;right:0;bottom:0;left:0;padding:20px;display:flex;align-items:center;justify-content:center;background:#141d2480}.settings-dialog{width:min(100%,480px);max-height:min(720px,calc(100dvh - 40px));overflow-y:auto;border-radius:8px;background:#fff;box-shadow:0 22px 70px #0f171e3d}.dialog-header{padding:18px 20px;display:flex;align-items:flex-start;justify-content:space-between;border-bottom:1px solid var(--line)}.dialog-header h2{margin:0;font-size:20px}.settings-section{padding:18px 20px;border-bottom:1px solid var(--line)}.settings-section>label{display:block;margin-bottom:8px;color:var(--muted);font-size:12px;font-weight:680}.name-editor{display:grid;grid-template-columns:minmax(0,1fr) 38px;gap:8px}.name-editor input{min-width:0;height:40px;padding:0 11px;border:1px solid #cbd2d8;border-radius:6px;font-size:16px}.field-error{margin-top:7px;color:var(--red);font-size:12px}.peer-summary{display:grid;gap:13px}.setting-row{min-width:0;display:flex;align-items:flex-start;justify-content:space-between;gap:18px;font-size:13px}.setting-row>span{flex:0 0 auto;display:inline-flex;align-items:center;gap:7px;color:var(--muted)}.setting-row strong,.setting-row code{min-width:0;overflow-wrap:anywhere;text-align:right}.setting-row code{font-size:11px}.settings-actions{display:grid}.settings-actions button{min-height:48px;padding:0 20px;display:flex;align-items:center;gap:10px;border:0;border-bottom:1px solid var(--line);background:#fff;cursor:pointer;text-align:left}.settings-actions button:hover{background:#f7f8f9}.confirm-panel{margin:18px;padding:16px;border:1px solid #f0bec2;border-radius:7px;background:var(--red-soft)}.confirm-panel p{margin:7px 0 14px;color:#6f3940;font-size:13px;line-height:1.5}.confirm-panel>div{display:flex;gap:8px}.spin{animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}@media(max-width:640px){.app-header{height:58px;padding-right:14px;padding-left:14px}.home-view,.pairing-view,.scanner-view,.trust-view,.status-view{min-height:calc(100dvh - 58px);padding:38px 18px calc(28px + env(safe-area-inset-bottom))}.home-view{justify-content:flex-start;padding-top:56px}.home-heading h1,.pairing-heading h1,.trust-view h1,.status-view h1{font-size:27px}.start-actions{margin-top:30px}.qr-tool,.scanner-tool{margin-top:22px}.qr-canvas,.qr-frame-note{width:min(340px,calc(100vw - 36px))}.scanner-viewport{width:calc(100vw - 36px)}.chat-view{border:0;grid-template-rows:60px minmax(0,1fr) auto}.chat-header{padding:0 8px 0 10px;gap:8px}.secure-pill{width:30px;height:30px;padding:0;justify-content:center;font-size:0}.message-list{padding:18px 14px 14px}.message-bubble{max-width:84%}.copy-message{position:static;width:28px;height:24px;float:right;margin:2px -5px -3px 5px;opacity:1}.composer{padding-right:10px;padding-left:10px}.dialog-backdrop{padding:0;align-items:flex-end}.settings-dialog{width:100%;max-height:calc(100dvh - 24px);border-radius:8px 8px 0 0;padding-bottom:env(safe-area-inset-bottom)}.safety-code{padding:16px 12px}.safety-code>div{gap:9px}.safety-code span{font-size:16px}}@media(max-width:360px){.home-view,.pairing-view,.scanner-view,.trust-view,.status-view{padding-right:14px;padding-left:14px}.start-action{grid-template-columns:42px minmax(0,1fr) 20px;gap:10px;padding-right:12px;padding-left:12px}.start-action__icon{width:42px;height:42px}.qr-canvas,.qr-frame-note,.scanner-viewport{width:calc(100vw - 28px)}.pairing-actions--row{flex-wrap:wrap}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}
