/* Ellegio UI Alpha v3. One thumb action, two readable language surfaces.
   Sources: packages/ui tokens + Onest; monitor-1419 dark palette. No glow. */
@font-face{font-family:Onest;font-style:normal;font-weight:300 500;font-display:swap;src:url('/fonts/onest-cyrillic.woff2') format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:Onest;font-style:normal;font-weight:300 500;font-display:swap;src:url('/fonts/onest-latin.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
:root{--bg:#22252C;--card:#2B2E36;--line:#3A3E48;--text:#E6E7EC;--muted:#A3A8B5;--action:#7CBCF4;--error:#F2B8B5;--ok:#8FD6A8;--shape-card:18px;--shape-pill:999px;color-scheme:dark;font-family:Onest,system-ui,sans-serif;font-weight:400;background:var(--bg);color:var(--text)}
*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button{cursor:pointer;-webkit-tap-highlight-color:transparent}button,input,select{touch-action:manipulation}button{color:inherit}button:disabled{cursor:default;opacity:.42}button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--action);outline-offset:4px}button svg{width:24px;height:24px;flex:none}svg{fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.symbols{position:absolute;width:0;height:0;overflow:hidden}[hidden]{display:none!important}
.app{max-width:480px;min-height:100svh;margin:auto;padding:calc(16px + env(safe-area-inset-top)) 20px calc(12px + env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:12px}
.topbar{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.brand{font-size:14px;color:var(--muted);line-height:20px}h1{font-size:24px;line-height:32px;font-weight:500;margin:0}h2,p{margin:0}.icon-button{display:grid;place-items:center;border:1px solid var(--line);background:transparent;width:48px;height:48px;border-radius:var(--shape-pill);flex:none}.direction{border:1px solid var(--line);border-radius:var(--shape-pill);display:flex;align-items:center;justify-content:space-between;width:100%;padding:0 20px;min-height:48px;background:transparent;color:var(--text);font-size:16px}.direction svg{color:var(--action);width:22px;height:22px}.phrase{border-radius:var(--shape-card);background:var(--card);padding:16px 20px}.phrase-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.phrase h2{font-size:14px;font-weight:400;color:var(--muted)}.language-tag{font-size:13px;line-height:20px;color:var(--muted)}.phrase p{font-size:24px;line-height:1.32;font-weight:400;overflow-wrap:anywhere;white-space:pre-wrap}.phrase .placeholder{color:var(--muted)}.source{min-height:140px}.target{min-height:164px}.target p{font-size:26px}.text-button{min-height:44px;padding:4px 0;background:transparent;border:0;color:var(--action);display:inline-flex;gap:8px;align-items:center;justify-content:center;font-size:14px}.text-button svg{width:20px;height:20px}.target .text-button{margin-top:12px}.record-area{display:flex;align-items:center;flex-direction:column;padding:8px 0 4px;flex:1;justify-content:center;gap:8px}.status{font-size:16px;line-height:24px;text-align:center;min-height:24px;max-width:100%}.status.error{color:var(--error)}.record-button{width:112px;height:112px;border-radius:50%;border:0;background:var(--action);color:var(--bg);display:grid;place-items:center;flex:none}.record-button svg{width:42px;height:42px;stroke-width:1.6}.record-button.recording{background:var(--card);border:2px solid var(--action);color:var(--action)}.stop-mark{width:30px;height:30px;border-radius:7px;background:var(--action)}.record-button.recording>svg{display:none}.record-hint{color:var(--muted);font-size:14px;line-height:20px;text-align:center}.chip{font-size:13px;border:1px solid var(--line);padding:4px 12px;border-radius:var(--shape-pill);color:var(--muted);line-height:18px}.level{height:3px;width:112px;border-radius:999px;background:var(--line);overflow:hidden}.level span{display:block;height:100%;width:0;background:var(--action)}.history-button{width:100%;min-height:56px;border-radius:var(--shape-card);border:0;background:var(--card);padding:0 16px;display:flex;align-items:center;gap:12px;font-size:16px;text-align:left}.history-button>svg{color:var(--muted);width:22px;height:22px}.count{margin-left:auto;color:var(--muted);font-size:14px}.history-button .chevron{width:18px;height:18px}.disclosure{text-align:center;color:var(--muted);font-size:12px;line-height:18px}
.sheet{background:var(--bg);color:var(--text);border:0;width:min(100%,480px);max-width:100%;height:100svh;max-height:100svh;margin:0 auto;padding:0;border-radius:0}.sheet::backdrop,.confirm::backdrop{background:rgb(0 0 0/.65)}.sheet[open]{display:flex;flex-direction:column}.sheet-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:calc(16px + env(safe-area-inset-top)) 20px 16px;background:var(--bg);flex:none}.sheet-header h2{font-size:24px;font-weight:500;line-height:32px}.sheet-body{overflow-y:auto;overscroll-behavior:contain;padding:0 20px calc(24px + env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:12px;scrollbar-width:thin}.setting-card{padding:16px;border-radius:var(--shape-card);background:var(--card);display:flex;flex-direction:column;gap:12px}.setting-card label{font-size:16px;display:flex;align-items:center;justify-content:space-between;gap:8px;line-height:24px}.setting-card output{color:var(--action);white-space:nowrap;font-size:16px}.setting-card select,.setting-card input[type=password]{width:100%;min-height:48px;padding:10px 14px;background:var(--bg);border:1px solid var(--line);border-radius:14px;color:var(--text);font-size:16px;appearance:none}.select-wrap{position:relative}.select-wrap::after{content:'';position:absolute;right:17px;top:17px;width:8px;height:8px;border-right:1.7px solid var(--muted);border-bottom:1.7px solid var(--muted);transform:rotate(45deg);pointer-events:none}.select-wrap select{padding-right:40px}.outline-button,.primary-button{min-height:44px;border:1px solid var(--line);border-radius:var(--shape-pill);padding:10px 16px;background:transparent;display:flex;align-items:center;justify-content:center;gap:8px;font-size:14px;color:var(--action)}.outline-button svg{width:20px;height:20px}.primary-button{background:var(--action);color:var(--bg);border-color:var(--action)}input[type=range]{accent-color:var(--action);width:100%;min-height:32px;margin:0}.range-ends{display:flex;justify-content:space-between;color:var(--muted);font-size:13px;margin-top:-8px}.help{font-size:14px;line-height:20px;color:var(--muted)}.footer-note{padding:4px}.history-entry{padding:16px;border-radius:var(--shape-card);background:var(--card);margin-bottom:12px;display:flex;flex-direction:column;gap:8px}.history-entry .original{font-size:16px;color:var(--muted);white-space:pre-wrap;overflow-wrap:anywhere}.history-entry .translated{font-size:22px;line-height:1.35;white-space:pre-wrap;overflow-wrap:anywhere}.history-meta{font-size:13px;color:var(--muted);display:flex;justify-content:space-between;align-items:center}.history-entry .text-button{align-self:flex-start}.confirm{width:calc(100% - 40px);max-width:400px;border:1px solid var(--line);border-radius:22px;background:var(--card);color:var(--text);padding:24px}.confirm h2{font-size:22px;font-weight:500;margin-bottom:12px}.confirm p{font-size:16px;line-height:24px;color:var(--muted)}.confirm-actions{display:flex;justify-content:flex-end;gap:12px;margin-top:24px}
@media(min-width:600px){.app{min-height:844px;margin:24px auto}.sheet{top:24px;height:calc(100svh - 48px);border-radius:22px}.sheet-header{padding-top:20px}}
@media(max-height:740px){.app{gap:8px;padding-top:12px}.source{min-height:120px}.target{min-height:140px}.record-button{width:96px;height:96px}.record-area{padding:4px 0}.phrase p{font-size:22px}}
@media(prefers-reduced-motion:no-preference){button{transition:background-color .15s,border-color .15s}button:active{transform:scale(.98)}}
dialog:focus{outline:none}
