:root{font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#202124;background:#f2f3f5;font-synthesis:none}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button,a,input,select{-webkit-tap-highlight-color:transparent}button{cursor:pointer;border:1px solid #d7d9dd;background:#fff;color:#242529;border-radius:9px;padding:10px 14px;font-size:14px;transition:background .15s,transform .15s}button:hover{background:#eeeef1}button:active{transform:translateY(1px)}button:disabled{opacity:.45;cursor:wait}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #e74755;outline-offset:3px}header{height:88px;border-bottom:1px solid #dfe0e4;display:flex;align-items:center;gap:28px;max-width:1300px;margin:auto;padding:0 38px}.brand{font-weight:800;font-size:28px;letter-spacing:-1.3px;text-decoration:none;color:#191a1d}.brand-dot{font-size:15px;color:#df263d;margin-left:4px}.tag{font-size:13px;color:#64666b}#logout{margin-left:auto}.quiet{background:transparent;border-color:transparent}main{max-width:1300px;padding:42px 38px 24px;margin:auto}.eyebrow{font-size:12px;letter-spacing:2px;font-weight:650;color:#6c6e73}h1{font-size:44px;letter-spacing:-2px;line-height:1.12;margin:12px 0 28px;font-weight:650}h2{font-size:17px;font-weight:600;letter-spacing:-.3px;margin:0}.workspace-head{display:flex;justify-content:space-between;align-items:center}.sender{font-size:13px;color:#6c6e73;display:flex;align-items:center;gap:12px}select{padding:9px;border:1px solid #d7d9dd;border-radius:8px;background:#fff;color:#26272a}.layout{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(300px,1fr);gap:32px}.panel{border:1px solid #dddfe4;border-radius:18px;background:#fff;padding:25px}.panel-top{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:22px}.meta{font-size:12px;color:#72747a}.canvas-wrap{padding:24px;background:#e8e9ec;border-radius:12px}.canvas-wrap.vertical,.screen.vertical{width:fit-content;margin-inline:auto}.canvas-wrap.vertical #editor{width:auto;height:min(56vh,480px)}.screen.vertical canvas{width:auto;height:min(27vh,205px)}canvas{display:block;width:100%;height:auto;image-rendering:pixelated}#editor{background:#fff;touch-action:none;cursor:crosshair;box-shadow:0 2px 8px #0000000a}.toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:20px 0}.palette{display:flex;gap:8px;margin-right:10px}.swatch{width:28px;height:28px;padding:0;border-radius:50%;border:1px solid #ccc}.swatch.selected{outline:2px solid #85878d;outline-offset:3px}.black{background:#161719!important}.red{background:#d82940!important}.white{background:white!important}.size{display:flex;align-items:center;gap:6px;font-size:12px;margin-right:auto}.size select{font-size:12px;padding:7px}.toolbar>button{font-size:12px;padding:9px}.text-row{display:flex;gap:8px}input{min-width:0;border:1px solid #d7d9dd;border-radius:9px;padding:12px;background:white}.text-row input{flex:1;font-size:14px}.extras{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:14px 0 28px}.extras button,.upload{font-size:13px;padding:8px 10px;border:0;background:#f3f4f6;border-radius:8px;cursor:pointer}.upload input{position:absolute;width:1px;height:1px;opacity:0}.upload:focus-within{outline:3px solid #e74755}.send-row{display:flex;gap:10px}.send-row>*{flex:1}.primary{background:#d82940;color:white;border:0;padding:14px 18px;font-weight:600}.primary:hover{background:#b91e34}.hint{font-size:12px;line-height:1.55;color:#75777d;margin:13px 0 0}.pill{font-size:12px;background:#e2e4e8;border-radius:20px;padding:6px 10px;color:#565960}.devices{padding-top:16px}.device{background:#202125;border-radius:15px;padding:17px 20px 22px;color:#fff}.device-label{display:flex;align-items:center;justify-content:space-between;margin-bottom:13px;font-size:13px}.device-label strong{font-weight:550}.device-label span{font-size:12px;color:#b4b6bd}.screen{background:#111214;padding:8px;border-radius:5px}.screen canvas{background:white}.connection{display:flex;align-items:center;justify-content:center;gap:8px;color:#9a9ca3;padding:12px}.connection span{font-size:12px;color:#6a6c72}.device .quiet{color:#fff;font-size:12px;padding:9px 0 0}.simulation p{font-size:13px;line-height:1.6;color:#686b72}.simulation>div{display:flex;gap:8px}.simulation button{flex:1}.history{margin-top:42px}.history .panel-top{padding-bottom:14px;border-bottom:1px solid #d9dbe0;margin-bottom:0}#history{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-top:18px}.history-item{background:white;padding:14px;border:1px solid #e0e2e5;border-radius:12px}.history-item canvas{border:1px solid #eee;margin-bottom:12px}.history-item p{font-size:12px;color:#777;margin:8px 0 0}.history-item strong{font-size:13px;font-weight:550}.empty{font-size:14px;color:#71747c;grid-column:1/-1}#status{position:fixed;bottom:22px;left:50%;transform:translateX(-50%);background:#202125;color:#fff;padding:14px 22px;border-radius:12px;box-shadow:0 6px 24px #0002;max-width:90vw;font-size:14px;z-index:10}#status:empty{display:none}footer{max-width:1300px;margin:24px auto 0;border-top:1px solid #dfe0e4;padding:24px 38px;display:flex;justify-content:space-between;gap:20px;color:#84878d;font-size:12px}footer span:first-child{letter-spacing:2px}.login{max-width:510px;margin:28px auto 70px}.login h1{font-size:52px}.login p{line-height:1.6;color:#6a6c72}.login form{background:#fff;border:1px solid #dddfe4;padding:28px;border-radius:16px;margin:28px 0 20px}.login label{display:grid;gap:8px;font-size:14px;margin-bottom:18px}.login button{width:100%;display:flex;justify-content:space-between}.login small{font-size:12px;color:#85878d}#loginError{color:#b91e34;margin-bottom:0;font-size:14px}[hidden]{display:none!important}@media(max-width:980px){.layout{grid-template-columns:1fr}.devices{display:grid;grid-template-columns:1fr 1fr;gap:16px}.devices>.panel-top,.simulation{grid-column:1/-1}.devices>.panel-top{margin-bottom:0}.connection{display:none}.device-label{gap:8px}#history{grid-template-columns:repeat(3,1fr)}}@media(max-width:600px){header{height:70px;padding:0 20px}.tag{display:none}main{padding:28px 16px}h1{font-size:35px}.workspace-head{display:block}.sender{margin-bottom:22px;justify-content:space-between}.panel{padding:16px}.canvas-wrap{padding:12px}.panel-top{gap:8px}.panel-top h2{font-size:15px}.meta{font-size:11px}.text-row{flex-wrap:wrap}.text-row input{width:100%;flex-basis:100%}.text-row button{width:100%}.send-row{flex-direction:column}.devices{grid-template-columns:1fr}.devices>.panel-top,.simulation{grid-column:auto}.device{padding:16px}.connection{display:flex;padding:0}#history{grid-template-columns:repeat(2,minmax(0,1fr))}.login{margin:20px 0}.login h1{font-size:44px}footer{padding:20px;flex-direction:column;gap:8px}.toolbar{gap:10px}.size{margin-right:0}}

header{height:60px}main{padding-top:28px}.devices{display:flex;flex-direction:column;gap:16px}.devices>.panel-top{margin-bottom:0}.account-settings{margin-top:30px;max-width:440px}.account-settings summary{cursor:pointer;font-size:14px}.account-settings form{display:grid;gap:16px;margin-top:20px}.account-settings label{display:grid;gap:7px;font-size:14px}#accountError{color:#b91e34}#accountName{font-size:14px;color:#666}

.size input{width:72px;padding:8px;font-size:14px}.preview-toggle{display:flex;align-items:center;gap:8px;font-size:14px}.preview-toggle input{accent-color:#d82940;width:18px;height:18px}.history-item button{margin-top:10px;padding:6px 9px;font-size:12px}.devices{padding-top:0}

.tools{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px}.tools .selected{background:#202125;color:#fff;border-color:#202125}#undo{display:inline-flex;gap:7px;align-items:center}#undo svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

/* Black working surface; canvas colors remain the actual e-paper palette. */
:root{color-scheme:dark;background:#090909;color:#ededed}body{background:#090909}header{border-color:#252525}button{background:#202020;border-color:#383838;color:#ededed}button:hover{background:#303030}button:disabled{opacity:.3;cursor:default;transform:none}button:disabled:hover{background:#202020}input,select{background:#141414;border-color:#404040;color:#ededed}input::placeholder{color:#888}.panel,.login form{background:#111;border-color:#303030}.canvas-wrap{background:#262626}.device{background:#161616;border:1px solid #303030}.screen{background:#080808}.history-item{background:#161616;border-color:#303030}.history-item canvas{border-color:#383838}.history .panel-top{border-color:#303030}.history-item p,.empty,.size,.preview-toggle,#accountName{color:#aaa}.extras button,.upload{background:#252525;color:#ddd}.quiet{background:transparent}.tools .selected{background:#eee;color:#111;border-color:#eee}.tools .selected:hover{background:#fff}.swatch{border-color:#777}.swatch.selected{outline-color:#eee}.primary{background:#c9243c;color:#fff}.primary:hover{background:#e12b46}.text-row input{background:#171717}#status{background:#282828;border:1px solid #444}.icon-button,.toolbar>.icon-button{display:inline-flex;justify-content:center;align-items:center;width:42px;height:42px;padding:9px}.icon-button svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.tools{gap:7px}#undo svg{width:22px;height:22px}.login{color:#eee}.login p{color:#aaa}#loginError{color:#ff7b88}

.mobile-nav,.mobile-size{display:none}
@media(max-width:600px){
header{height:48px;padding:0 16px}main{padding:12px 12px calc(106px + env(safe-area-inset-bottom))}.mobile-nav{display:grid;grid-template-columns:1fr 1fr;gap:4px;background:#141414;padding:4px;border-radius:12px;margin-bottom:12px}.mobile-nav button{border:0;background:transparent;min-height:40px}.mobile-nav button[aria-pressed="true"]{background:#333;color:white}.layout{display:flex;flex-direction:column;gap:12px}.devices{order:-1;display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:0}.device{padding:8px;border-radius:9px;min-width:0}.device-label{margin-bottom:6px}.device-label strong{font-size:12px}.screen{padding:3px}.panel.editor{border:0;border-radius:0;background:transparent;padding:0;display:flex;flex-direction:column}.canvas-wrap{padding:6px;border-radius:8px}.tools{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px;margin:12px 0 0}.canvas-wrap.vertical #editor{height:min(46vh,380px)}.screen.vertical canvas{height:min(21vh,150px)}.tools .icon-button{width:100%;height:46px;padding:10px}.toolbar{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:12px 0 4px;align-items:center}.palette{grid-column:1/3;justify-content:flex-start;gap:14px;margin:0;padding:5px}.swatch{width:34px;height:34px}.size{grid-column:3/5;justify-content:flex-end;font-size:14px}.size input{width:65px;min-height:44px;font-size:16px}.toolbar>.icon-button{width:100%;height:44px}.toolbar>#clear{min-height:44px;padding:5px;font-size:13px}.mobile-size{display:block;width:100%;padding:0;margin:10px 0 18px;accent-color:#e02d47;height:28px;border:0}.text-row{display:block}.text-row input{width:100%;font-size:16px;min-height:46px}.extras{margin:10px 0}.upload{display:flex;align-items:center;justify-content:center;min-height:44px;width:100%;font-size:14px}.send-row{position:fixed;bottom:0;left:0;right:0;z-index:5;background:#111;border-top:1px solid #383838;padding:12px 16px calc(12px + env(safe-area-inset-bottom));display:grid;grid-template-columns:1fr 1fr;align-items:center;gap:12px}.send-row .primary{min-height:48px}.preview-toggle{font-size:13px;min-height:44px}.preview-toggle input{width:22px;height:22px}.history{margin-top:0}#workspace[data-view="draw"]>.history{display:none}#workspace[data-view="history"]>.layout{display:none}#history{gap:10px}.history-item{padding:9px}.history-item button{min-height:42px;width:100%;font-size:14px}#clearHistory{min-height:44px}#status{bottom:calc(90px + env(safe-area-inset-bottom))}.login input{font-size:16px}.login form{padding:20px}.history .panel-top{padding-top:8px}
}

@media(max-width:600px){.toolbar>#clear{grid-column:3/5}}

.size-controls{display:contents}
@media(max-width:600px){
.size-controls{display:flex;grid-column:1/-1;align-items:center;gap:10px;min-width:0}
.size-controls .palette{flex:none;gap:8px;padding:5px;margin:0}
.size-controls .swatch{width:32px;height:32px}
.size-controls .mobile-size{flex:1 1 0;width:0;min-width:0;max-width:none;height:32px;margin:0;padding:0}
.size-controls .size{flex:none;gap:6px;font-size:13px;margin:0}
.size-controls .size input{width:52px;padding:8px;min-height:44px}
.toolbar{margin-bottom:14px}
}

#size{text-align:center;appearance:textfield;-moz-appearance:textfield}#size::-webkit-inner-spin-button,#size::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}

@font-face{font-family:"BDAB Sans";src:url("/fonts/tilda-sans-vf.ttf") format("truetype");font-style:normal;font-weight:250 900;font-display:swap}
@font-face{font-family:"BDAB Display";src:url("/fonts/nunito-black.ttf") format("truetype");font-style:normal;font-weight:900;font-display:swap}
:root{font-family:"BDAB Sans","Avenir Next","Trebuchet MS",sans-serif}
h1,h2{font-family:"BDAB Display","BDAB Sans",sans-serif;font-weight:900}

@font-face{font-family:"Audex";src:url("/fonts/audex-regular.ttf") format("truetype");font-style:normal;font-weight:400;font-display:swap}
@font-face{font-family:"Audex";src:url("/fonts/audex-italic.ttf") format("truetype");font-style:italic;font-weight:400;font-display:swap}
:root{font-family:"Audex","BDAB Sans",sans-serif}
h1,h2{font-family:"Audex","BDAB Sans",sans-serif;font-weight:400}
@media(max-width:600px){
body:has(#login:not([hidden]))>header{display:none}
body:has(#login:not([hidden]))>main{min-height:100svh;min-height:100dvh;display:grid;align-items:center;padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom))}
.login{width:100%;max-width:400px;margin:0 auto}
.login form{margin:0;padding:26px 22px;border-radius:18px}
.login label{font-size:16px;gap:10px;margin-bottom:20px}
.login input{min-height:48px}
.login button{justify-content:center;min-height:48px}
#loginError:empty{display:none}
}

/* Canvas pixels are opaque; avoid white backing bleeding at scaled edges. */
#editor,.screen canvas{background:transparent;box-shadow:none;border:0;outline:0}
.canvas-wrap,.screen{overflow:hidden}
/* Keep the 296x128 pixel grid sharp on mobile Safari too. */
#editor,.screen canvas,.history-item canvas,.binding-editor canvas{image-rendering:crisp-edges;image-rendering:pixelated}

.icon-button svg,#undo svg,.upload svg,.check-box svg{width:22px;height:22px;flex:none;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}
.upload{display:inline-flex;align-items:center;justify-content:center;gap:8px}
.preview-toggle{position:relative;cursor:pointer}
.preview-toggle input{position:absolute;opacity:0;width:22px;height:22px;margin:0}
.check-box{display:inline-flex;align-items:center;justify-content:center;flex:none;width:22px;height:22px;border:1.5px solid #777;border-radius:5px;background:#161616;color:#fff}
.check-box svg{width:20px;height:20px;visibility:hidden}
.preview-toggle input:checked+.check-box{background:#d82940;border-color:#d82940}
.preview-toggle input:checked+.check-box svg{visibility:visible}
.preview-toggle input:focus-visible+.check-box{outline:2px solid #eee;outline-offset:3px}

.bindings-panel{margin:16px 0}.bindings-panel summary{cursor:pointer;padding:10px 0}#bindings{display:grid;gap:12px;margin-top:10px}.binding{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.binding>strong{min-width:28px}.binding canvas{width:120px;height:auto;image-rendering:pixelated;border-radius:4px}.binding button{padding:10px 12px}.history-item button{margin:4px 0 0}

.extras{display:grid;grid-template-columns:auto minmax(0,1fr);gap:12px;align-items:stretch;flex-wrap:nowrap;margin:14px 0}
#bindings{display:flex;gap:6px;margin:0;align-items:stretch}
.extras .bind-key{position:relative;display:grid;place-items:center;width:48px;height:48px;min-width:48px;min-height:48px;max-height:48px;flex:0 0 48px;aspect-ratio:1;padding:0;border:1px solid #383838;background:#202020;border-radius:10px;color:#eee}
.bind-key svg{width:28px;height:28px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.bind-key .key-digit{stroke-width:1.5}.bind-key .key-depth{opacity:.55}
.extras .bind-key[aria-expanded="true"]{background:#eee;color:#171717;border-color:#eee}
.bind-key.assigned:after{content:"";position:absolute;bottom:4px;left:4px;width:4px;height:4px;border-radius:50%;background:#e02d47}
.extras .upload{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-width:0;min-height:48px;border:1px solid #383838;background:#202020;padding:10px 12px;margin:0}
.binding-editor{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:0 0 14px}.binding-editor[hidden]{display:none}.binding-editor canvas{width:120px;height:auto}.binding-editor button{min-height:44px}
@media(max-width:360px){.extras{gap:8px}#bindings{gap:4px}.extras .bind-key{width:44px;height:44px;min-width:44px;min-height:44px;max-height:44px;flex-basis:44px}.extras .upload{padding:8px}}

/* Key face and numerals share the exact (12,12) SVG centre. */
.bind-key svg{width:36px;height:36px;flex:none}
.bind-key .key-face{fill:none;stroke:currentColor;stroke-width:1.5}
.bind-key .key-digit{fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.extras .bind-key[aria-expanded="true"]{background:#383838;border-color:#fff;color:#fff}

/* Undo/redo are momentary actions, not sticky touch-hover controls. */
#undo,#redo{touch-action:manipulation;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;transition:background .1s;transform:none}
#undo:active,#redo:active{transform:none}
@media(hover:none){#undo:hover,#redo:hover{background:#202020}#undo:active:not(:disabled),#redo:active:not(:disabled){background:#383838}}

/* One spacing rhythm across all four upload controls. */
.extras{gap:6px}#bindings{gap:6px}
.tools .icon-button{padding:6px}
.tools .icon-button svg{width:28px;height:28px;flex:none}

.tools .fill-icon{fill:currentColor;stroke:none}

.binding-editor{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;align-items:center;width:100%;padding:12px;background:#202020;border:1px solid #505050;border-radius:10px}
.extras:has(.bind-key:first-child[aria-expanded="true"])+.binding-editor{border-top-left-radius:0}
.binding-preview{min-width:0;padding:6px;border-radius:8px;overflow:hidden}
.binding-preview:empty{visibility:hidden}
.binding-editor .binding-preview canvas{display:block;width:100%;height:auto;background:transparent;border:0;box-shadow:none}
.binding-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;align-self:stretch;align-content:center}
.binding-actions button{width:100%;min-height:44px;margin:0;padding:10px 8px}
.extras{margin-bottom:12px}
.extras .bind-key[aria-expanded="true"]{background:#202020;border-color:#505050;border-bottom-color:transparent;border-radius:10px 10px 0 0;z-index:1}
.extras .bind-key[aria-expanded="true"]::before{content:"";position:absolute;top:100%;left:-1px;right:-1px;height:14px;background:#202020;border-left:1px solid #505050;border-right:1px solid #505050;pointer-events:none}
@media(max-width:360px){.binding-editor{padding:8px;gap:8px}.binding-actions{gap:6px}.binding-actions button{padding:10px 4px;font-size:13px}}

.history-item{content-visibility:auto;contain-intrinsic-size:auto 220px}

/* Кнопка применения текста стоит вплотную к полю и гаснет, когда текст пуст. */
.text-row{display:flex;gap:8px}
.text-row #text{flex:1;min-width:0}
#applyText{flex:none;padding:0 14px;white-space:nowrap}
#applyText:disabled{opacity:.4}

/* Коробка: заряд рядом со своим экраном, сети — в отдельном окне. */
/* Весь сайт шёл на line-height: normal — это ровно бокс шрифта, без запаса.
   У Audex бокс плотно облегает цифры, и на дробном масштабе или в другом
   браузере нижний ряд пикселей срезается. Даём слабину всему разом:
   заголовки и кнопки чуть плотнее, обычный текст свободнее. */
:root{line-height:1.45}
button,input,select,textarea{line-height:1.35}
h1,h2,h3{line-height:1.25}

/* Высоту чипа задаёт значок, а не текст, поэтому запас ничего не сдвигает. */
.chip,.box-open{display:inline-flex;align-items:center;gap:6px;padding:4px 8px;border:1px solid #383838;background:#202020;border-radius:8px;font-size:12px;line-height:1.7;overflow:visible}
/* Запас берём с избытком: у Audex бокс глифа 1,13 em, но на части браузеров
   низ цифр всё равно срезался при полуторном. Высоту чипа задаёт значок
   батарейки, поэтому лишняя высота строки ничего не двигает. */
#boxCharge,#peerCharge{line-height:1.7;padding-block:2px;overflow:visible}
.chip svg,.box-open svg{width:21px;height:21px;flex:none;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
#boxLevel,#peerLevel{fill:currentColor}
.chip{cursor:default;color:#b4b6bd}
.box-panel{width:min(420px,92vw);border:1px solid #383838;border-radius:16px;background:#141414;color:#ededed;padding:20px}
.box-panel::backdrop{background:#000000b3}
.box-panel .panel-top{margin-bottom:16px}
.box-facts{display:grid;grid-template-columns:auto minmax(0,1fr);gap:6px 14px;margin:0 0 18px;font-size:14px}
.box-facts dt{color:#aaa}
.box-facts dd{margin:0;text-align:right}
.box-networks{list-style:none;margin:0 0 18px;padding:0;display:grid;gap:8px}
.box-networks li{display:flex;align-items:center;justify-content:space-between;gap:10px;background:#1d1d1d;border-radius:9px;padding:8px 8px 8px 12px;font-size:14px}
.box-networks li span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.box-networks li.quiet-row span{color:#999}
.box-networks em{font-style:normal;font-size:12px;color:#888;margin-left:auto}
.box-networks button{padding:7px 10px;font-size:13px;flex:none}
.box-networks .empty{justify-content:center;color:#888;background:transparent;font-size:14px}
.net-form{display:grid;gap:12px}
.net-form label{display:grid;gap:7px;font-size:14px}
#netError{color:#ff7b88;font-size:14px;margin:12px 0 0}
#netError:empty{display:none}
@media(max-width:600px){
.box-panel{padding:16px}
.net-form input{min-height:46px;font-size:16px}
.chip,.box-open{padding:3px 6px;gap:4px}
.chip svg,.box-open svg{width:18px;height:18px}
.text-row{display:flex}
.text-row #text{flex:1 1 auto;width:auto;flex-basis:auto}
.text-row #applyText{width:auto;min-height:46px}
}

/* Точка связи у каждого экрана: горит — коробка отвечает, погасла — молчит. */
.live{width:8px;height:8px;border-radius:50%;flex:none;background:#3ddc84;margin-right:7px;
box-shadow:0 0 0 3px #3ddc8426}
.live.off{background:transparent;border:1.5px solid #6a6a6a;box-shadow:none}
.device-label{gap:0}
.device-label strong{margin-right:auto}

/* Сброс — единственное необратимое действие в окне, поэтому отделён и красный. */
.box-reset{margin-top:18px;padding-top:16px;border-top:1px solid #303030}
.box-reset{display:grid;gap:8px}.box-reset .danger{width:100%;background:#2a1618;border-color:#5a2b30;color:#ff8f8f;min-height:46px}
.box-reset .danger:hover{background:#3a1c1f}
#resetNote{font-size:13px;color:#888;margin:10px 0 0}
#resetNote:empty{display:none}

/* Вертикальное полотно на телефоне: узкий холст слева, кнопки и текст рядом. */
@media(max-width:600px){
.panel.editor:has(.canvas-wrap.vertical){display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-rows:auto auto 1fr;column-gap:10px;align-items:start}
.panel.editor:has(.canvas-wrap.vertical)>*{grid-column:1/-1}
.panel.editor:has(.canvas-wrap.vertical)>.canvas-wrap{grid-column:1;grid-row:1/4}
.panel.editor:has(.canvas-wrap.vertical)>.tools{grid-column:2;grid-row:1;grid-template-columns:repeat(3,minmax(0,1fr));margin:0}
.panel.editor:has(.canvas-wrap.vertical)>.text-row{grid-column:2;grid-row:2;align-self:start;margin-top:10px}
.canvas-wrap.vertical #editor{height:min(46vh,370px)}
.screen.vertical canvas{height:min(14vh,110px)}
}

/* Расстановка загруженной картинки поверх полотна. */
.stage{position:relative;display:grid;justify-items:center}
#placeFrame{position:absolute;box-sizing:border-box;border:1px dashed #d82940;background:#d8294014;touch-action:none;cursor:move}
#placeFrame .handle{position:absolute;width:44px;height:44px;touch-action:none;display:grid;place-items:center}
#placeFrame .handle::after{content:"";width:16px;height:16px;border-radius:50%;background:#d82940;box-shadow:0 0 0 2px #fff}
#placeFrame .handle[data-corner="nw"]{left:-22px;top:-22px;cursor:nwse-resize}
#placeFrame .handle[data-corner="ne"]{right:-22px;top:-22px;cursor:nesw-resize}
#placeFrame .handle[data-corner="sw"]{left:-22px;bottom:-22px;cursor:nesw-resize}
#placeFrame .handle[data-corner="se"]{right:-22px;bottom:-22px;cursor:nwse-resize}
.place-bar{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;margin:0 0 14px}
.place-bar button{min-height:46px}
@media(max-width:600px){.place-bar{position:fixed;left:0;right:0;bottom:calc(72px + env(safe-area-inset-bottom));z-index:6;background:#111;border-top:1px solid #383838;padding:10px 16px;margin:0}.place-bar button{min-height:48px}}

/* Заряд на исходе: значок и подпись под экраном. */
.battery-note{margin:9px 0 0;font-size:12px;color:#e0a325}
.battery-note.urgent{color:#ff7b88}
.box-open.low,.chip.low{color:#e0a325}
.box-open.urgent,.chip.urgent{color:#ff7b88}
@media(max-width:600px){.battery-note{margin-top:6px;font-size:11px}}

/* Поиск сетей коробкой. */
.scan-head{display:flex;align-items:center;gap:10px;margin:0 0 10px}
.scan-head button{font-size:13px;padding:9px 12px}
#scanNote{font-size:12px;color:#aaa}
.scan-list{list-style:none;margin:0 0 14px;padding:0;display:grid;gap:6px;max-height:210px;overflow:auto}
.scan-list button{display:flex;align-items:center;gap:10px;width:100%;min-height:44px;text-align:left;background:#1d1d1d;border:0;border-radius:9px;padding:8px 12px;font-size:14px}
.scan-list button:hover{background:#262626}
.scan-list span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.scan-list em{font-style:normal;font-size:12px;color:#aaa}
.signal{width:20px;height:14px;flex:none;fill:currentColor}
.signal .off{opacity:.25}

/* Домашний экран айфона: шапка не должна залезать под часы. */
@media(max-width:600px){
header{padding-top:env(safe-area-inset-top);height:calc(48px + env(safe-area-inset-top))}
}

/* Окно аккаунта. */
#accountPanel h3{font-size:14px;font-weight:600;margin:0}
#accountPanel .panel-top{margin:18px 0 10px}
#passwordError{color:#ff7b88;font-size:13px;margin:0 0 4px}
#sessionList em{font-style:normal;font-size:12px;color:#aaa;white-space:nowrap}
#sessionList span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis}

/* Второй фактор. */
.totp{display:grid;gap:10px;margin-bottom:14px}
.totp-secret{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:15px;letter-spacing:2px;
  background:#1d1d1d;border-radius:9px;padding:12px;word-break:break-all;-webkit-user-select:all;user-select:all}
.totp .upload{text-align:center;text-decoration:none;color:#ddd;min-height:44px;display:flex;align-items:center;justify-content:center}
#totpState{font-size:12px}
#accountPanel .box-reset{border:0;padding:0;margin:10px 0 0}
#accountPanel .box-reset button{min-height:46px}

/* Знак: в шапке рядом с именем, на входе — над формой. */
.mark{display:block;flex:none;border-radius:6px}
.mark.big{width:64px;height:64px;border-radius:12px;margin:0 0 20px}
@media(max-width:600px){.mark{width:22px;height:22px}}

.totp-qr{width:208px;height:208px;margin:0 auto;border-radius:8px;background:#fff;image-rendering:pixelated}
