:root{
  color-scheme:light dark;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --bg:#f4f6fa;--surface:#fff;--surface-2:#f8f9fc;--text:#171a22;--muted:#727a8a;--line:#e2e6ed;
  --accent:#2f6fed;--accent-strong:#245fd7;--accent-soft:#eaf1ff;--success:#1f9d63;--danger:#d64555;
  --shadow:0 8px 24px rgba(25,36,58,.07);--modal-shadow:0 24px 80px rgba(8,14,28,.28);--radius:16px
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text)}
body{min-height:100vh}
button,input,textarea{font:inherit}
button{-webkit-tap-highlight-color:transparent}
.shell{width:min(620px,100%);margin:0 auto;padding:14px 12px 40px}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 1px 11px}
.brand{display:flex;align-items:center;gap:9px;min-width:0}.brand img{width:36px;height:36px;border-radius:11px;box-shadow:0 4px 12px rgba(0,0,0,.11)}
.brand h1,.brand p,.section-title h2{margin:0}.brand h1{font-size:18px;line-height:1.15;letter-spacing:-.01em}.brand p{font-size:11px;color:var(--muted);margin-top:2px}
.state{display:flex;align-items:center;gap:6px;padding:6px 9px;border:1px solid var(--line);border-radius:999px;background:var(--surface);font-size:10px;white-space:nowrap;box-shadow:0 2px 8px rgba(24,33,51,.03)}
.state span{width:6px;height:6px;border-radius:50%;background:#a8afbd}.state.busy span{background:#d99c2d;box-shadow:0 0 0 3px rgba(217,156,45,.13)}.state.online span,.state.success span{background:var(--success);box-shadow:0 0 0 3px rgba(31,157,99,.13)}.state.error span{background:var(--danger)}
.operation-notice{margin:0 0 9px;padding:8px 10px;border-radius:11px;border:1px solid rgba(31,157,99,.22);background:rgba(31,157,99,.075);color:var(--success);font-size:10.5px;font-weight:650;line-height:1.4}
.operation-notice.error{border-color:rgba(214,69,85,.24);background:rgba(214,69,85,.075);color:var(--danger)}
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:13px;margin-bottom:10px;box-shadow:var(--shadow)}
.section-title{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:9px}.section-title h2{font-size:15px;line-height:1.25;letter-spacing:-.005em}
.eyebrow{display:block;margin-bottom:2px;color:var(--muted);font-size:8.5px;font-weight:850;letter-spacing:.14em}.direct-badge{font-size:9px;font-weight:800;color:var(--success);background:rgba(31,157,99,.09);border:1px solid rgba(31,157,99,.18);border-radius:999px;padding:4px 7px}
textarea,input{width:100%;border:1px solid var(--line);background:var(--surface-2);color:var(--text);border-radius:11px;padding:10px 11px;outline:none}
textarea{min-height:112px;max-height:360px;resize:vertical;line-height:1.42;font-size:13px}textarea:focus,input:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(47,111,237,.11)}
.card-footer{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:9px}.card-footer small{color:var(--muted);font-size:10px;line-height:1.35}.file-actions small{max-width:58%}
button{border:0;border-radius:10px;padding:8px 12px;min-height:36px;font-weight:760;font-size:12px;cursor:pointer;transition:transform .08s ease,background .15s ease,border-color .15s ease}button:active:not(:disabled){transform:translateY(1px)}
.primary{background:var(--accent);color:#fff;box-shadow:0 4px 12px rgba(47,111,237,.17)}.primary:hover{background:var(--accent-strong)}.secondary{background:var(--surface-2);color:var(--text);border:1px solid var(--line)}button:disabled{opacity:.45;cursor:not-allowed;box-shadow:none}
.file-picker{display:flex;align-items:center;gap:10px;border:1px dashed #bcc5d3;border-radius:12px;padding:10px 11px;background:var(--surface-2);cursor:pointer}.file-picker:hover{border-color:#9fb4df}.file-icon{width:32px;height:32px;display:grid;place-items:center;border-radius:9px;background:var(--accent-soft);color:var(--accent);font-size:17px;font-weight:900;flex:0 0 auto}.file-copy{min-width:0}.file-copy span{display:block;font-size:12px;font-weight:760;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.file-copy small{display:block;color:var(--muted);font-size:10px;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.progress-wrap{margin-top:10px}.progress{height:5px;background:var(--surface-2);border:1px solid var(--line);border-radius:999px;overflow:hidden}.progress div{height:100%;width:0;background:var(--accent);transition:width .18s ease}.progress-wrap p{margin:5px 1px 0;color:var(--muted);font-size:10px}
.hidden{display:none!important}
.sheet{position:fixed;inset:0;z-index:60;display:grid;place-items:center;padding:18px;overflow:auto}
.sheet-backdrop{position:absolute;inset:0;background:rgba(6,10,18,.5);backdrop-filter:blur(4px)}
.sheet-panel{position:relative;z-index:1;width:min(500px,100%);max-height:min(76vh,620px);overflow:auto;background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:15px;box-shadow:var(--modal-shadow)}
.code-panel{width:min(430px,100%)}
.sheet-grabber{display:none}.sheet-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.sheet-head h2{font-size:16px;line-height:1.25;margin:0}
.icon-btn{width:30px;height:30px;min-height:30px;padding:0;border-radius:50%;font-size:19px;line-height:1;background:var(--surface-2);color:var(--text);border:1px solid var(--line);flex:0 0 auto}
.muted{color:var(--muted);font-size:11px;line-height:1.45;margin:7px 0 10px}.compact-copy{margin-bottom:9px}.code-input{text-align:center;font-size:22px;font-weight:800;letter-spacing:.32em;padding-left:calc(11px + .32em);height:46px}.field-error{margin:6px 2px 0;color:var(--danger);font-size:10px}.sheet-actions{display:flex;justify-content:flex-end;gap:7px;margin-top:10px}
.route-list{display:grid;gap:7px;margin-top:8px}.route{width:100%;text-align:left;background:var(--surface-2);border:1px solid var(--line);padding:10px 11px;border-radius:11px;color:var(--text)}.route:hover{border-color:#a9bce5;background:var(--surface)}.route-top{display:flex;align-items:center;justify-content:space-between;gap:9px}.route strong{font-size:12px}.route .badge{font-size:8.5px;border-radius:999px;padding:3px 6px;background:rgba(31,157,99,.1);color:var(--success);border:1px solid rgba(31,157,99,.18)}.route .badge.wake{background:#fff7e4;color:#9b6c13;border-color:#f0dfb8}.route code{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--muted);margin-top:4px;font-size:9.5px}.route small{display:block;color:var(--muted);margin-top:2px;font-size:9.5px}
.toast{position:fixed;left:50%;bottom:16px;transform:translateX(-50%);z-index:90;max-width:min(520px,calc(100% - 24px));padding:9px 11px;border-radius:11px;background:#1c2430;color:#fff;font-size:11px;font-weight:700;box-shadow:0 12px 34px rgba(0,0,0,.24)}.toast.error{background:#6d1f2a}
@media(prefers-color-scheme:dark){:root{--bg:#0d0f13;--surface:#15181e;--surface-2:#101319;--text:#f4f6fa;--muted:#969eae;--line:#2a2f39;--accent:#4d83f4;--accent-strong:#5b8df5;--accent-soft:#172746;--shadow:0 8px 24px rgba(0,0,0,.2)}.route .badge.wake{background:#2b2517;color:#e6c96f;border-color:#4d4022}.toast{background:#f4f6fa;color:#171a20}.toast.error{background:#5a222b;color:#ffd7dc}.file-picker{border-color:#39404d}}
@media(max-width:520px){.shell{padding:10px 9px 34px}.topbar{padding-bottom:9px}.brand img{width:34px;height:34px}.brand h1{font-size:17px}.card{padding:11px;border-radius:14px}.card-footer{align-items:flex-end}.file-actions{display:grid;grid-template-columns:1fr}.file-actions small{max-width:none}.file-actions .primary,.text-card .card-footer .primary{width:100%}.text-card .card-footer small{display:none}.state b{font-size:9.5px}.sheet{padding:12px}.sheet-panel{width:min(94vw,500px);max-height:82vh;padding:13px;border-radius:16px}.code-panel{width:min(92vw,430px)}.sheet-actions button{flex:1}.toast{bottom:10px}}
