:root {
  color-scheme: dark;
  --bg: #111110;
  --panel: #1b1b19;
  --panel2: #242421;
  --ink: #f8f6ef;
  --muted: #a29f97;
  --orange: #ff6a1a;
  --orange2: #ff9b5e;
  --line: rgba(255,255,255,.1);
  --green: #b6ef72;
  --danger: #ff8d78;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: #0b0b0a; }
body { margin: 0; min-height: 100vh; background: #0b0b0a; color: var(--ink); font: 15px/1.45 var(--font); }
button, input, textarea, select { font: inherit; }
button { color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
.ambient { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% -18%, rgba(255,106,26,.17), transparent 44%), radial-gradient(ellipse at 104% 58%, rgba(255,106,26,.055), transparent 32%); }
.app { position: relative; width: min(100%, 520px); min-height: 100svh; margin: 0 auto; overflow: hidden; background: var(--bg); box-shadow: 0 0 70px #0009; }
.topbar { position: sticky; z-index: 10; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(env(safe-area-inset-top) + 12px) 18px 11px; border-bottom: 1px solid rgba(255,255,255,.05); background: rgba(17,17,16,.94); backdrop-filter: blur(16px); }
.brand, .header-actions { display: flex; align-items: center; gap: 9px; }
.brandmark, .mini-logo { display: grid; flex: none; place-items: center; width: 35px; height: 35px; border-radius: 12px; background: var(--orange); color: #17120f; font-size: 23px; font-weight: 950; letter-spacing: -2px; box-shadow: 0 5px 22px #ff6a1a44; }
.brandname { font-size: 19px; font-weight: 900; letter-spacing: -.8px; white-space: nowrap; }
.brandname span { color: var(--orange); }
.netbadge { display: flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 40px; padding: 5px 8px; color: #c7c4bc; font-size: 9px; white-space: nowrap; }
.netdot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px #b6ef7280; }
.netbadge.offline { color: #ffd0b6; border-color: #ff6a1a55; }
.netbadge.offline .netdot { background: var(--orange); box-shadow: none; }
.installbtn, .iconbtn { min-height: 38px; border: 1px solid var(--line); border-radius: 13px; background: #ffffff05; }
.installbtn { padding: 0 10px; color: var(--orange2); font-size: 10px; font-weight: 800; }
.iconbtn { display: grid; width: 38px; place-items: center; }
.iconbtn svg { width: 18px; height: 18px; }
main { min-height: calc(100svh - 115px); }
.screen { display: none; padding: 20px 18px 112px; animation: enter .22s ease; }
.screen.active { display: block; }
@keyframes enter { from { opacity: .5; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.eyebrow { color: var(--orange2); font-size: 10px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.hello { margin: 10px 0 5px; font-size: clamp(25px, 7vw, 31px); font-weight: 900; line-height: 1.12; letter-spacing: -1.2px; }
.orange { color: var(--orange); }
.sub, .page-lead { color: var(--muted); font-size: 12px; }
.sub { margin: 6px 0 0; }
.page-lead { margin: 0 0 20px; }
.langrow { display: flex; gap: 7px; margin-top: 16px; }
.pill { border: 1px solid var(--line); border-radius: 99px; padding: 7px 11px; background: transparent; color: #c1beb6; font-size: 10px; }
.pill.selected { border-color: #ff6a1a80; background: #ff6a1a17; color: white; }
.streak { position: relative; overflow: hidden; margin-top: 19px; padding: 14px 15px; border-radius: 18px; background: linear-gradient(108deg, #ff6a1a, #f45412 63%, #ca3d0b); color: #1a130e; }
.streak::after { position: absolute; top: -15px; right: 15px; color: #fff2; content: "✳"; font-size: 78px; transform: rotate(-14deg); }
.streak b { display: block; font-size: 13px; }
.streak p { max-width: 250px; margin: 4px 0 0; color: #351b0e; font-size: 10px; }
.featureRow { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; margin-top: 13px; }
.feature { min-height: 88px; overflow: hidden; padding: 10px 8px; border: 1px solid var(--line); border-radius: 17px; background: #1d1d1b; text-align: left; transition: transform .15s ease, border-color .15s ease; }
.feature:active { transform: scale(.97); }
.feature .emoji { display: block; margin-bottom: 7px; font-size: 19px; }
.feature strong { display: block; font-size: 10px; line-height: 1.2; }
.feature small { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.2; }
.sectionhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 23px 0 10px; }
.sectionhead h2 { margin: 0; font-size: 15px; letter-spacing: -.3px; }
.small-eyebrow { font-size: 8px; }
.chatbox { padding: 12px; border: 1px solid var(--line); border-radius: 19px; background: var(--panel); }
.botrow { display: flex; align-items: flex-start; gap: 9px; }
.mini-logo { width: 28px; height: 28px; border-radius: 9px; font-size: 17px; }
.botcopy { padding-top: 2px; color: #dedbd3; font-size: 11px; }
.botcopy strong { color: #fff; }
.suggestions { display: flex; gap: 7px; overflow-x: auto; padding: 11px 0 2px; scrollbar-width: none; }
.suggestions::-webkit-scrollbar { display: none; }
.suggestion, .phrasechips button { flex: none; border: 1px solid #ffffff13; border-radius: 99px; background: #ffffff06; color: #d2cfc8; font-size: 9px; white-space: nowrap; }
.suggestion { padding: 7px 9px; }
.chatmessages { display: grid; gap: 8px; max-height: 42vh; overflow-y: auto; padding: 2px 1px; }
.chatbubble { max-width: 93%; padding: 10px 11px; border-radius: 14px; font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; }
.chatbubble.user { justify-self: end; border: 1px solid #ff6a1a48; border-radius: 14px 14px 3px 14px; background: #ff6a1a17; }
.chatbubble.assistant { justify-self: start; border: 1px solid #ffffff0d; border-radius: 14px 14px 14px 3px; background: #252522; }
.bubble-actions { margin-top: 6px; }
.bubble-actions button, .textbtn { border: 0; background: none; color: var(--orange2); font-size: 9px; font-weight: 750; }
.composer { display: flex; align-items: center; gap: 8px; margin-top: 11px; padding: 6px 6px 6px 12px; border: 1px solid #ffffff16; border-radius: 16px; background: #272724; }
.composer:focus-within { border-color: #ff6a1a77; }
.composer input { width: 100%; min-width: 0; border: 0; outline: 0; background: none; color: white; font-size: 11px; }
.composer input::placeholder { color: #929087; }
.send { display: grid; flex: none; width: 36px; height: 36px; place-items: center; border: 0; border-radius: 12px; background: var(--orange); color: #1b120e; }
.send svg { width: 17px; height: 17px; }
.send:disabled, .primary:disabled { cursor: wait; opacity: .55; }
.offline-note { margin: 10px 2px 0; color: #929087; font-size: 9px; }
.page-title { margin: 4px 0 7px; font-size: 27px; font-weight: 900; line-height: 1.08; letter-spacing: -1px; }
.backbtn { display: flex; align-items: center; gap: 7px; margin: 2px 0 15px; padding: 0; border: 0; background: none; color: #aaa79f; font-size: 11px; }
.backbtn b { font-size: 19px; font-weight: 400; }
.fieldlabel { display: block; margin: 16px 0 7px; color: #dedbd3; font-size: 10px; font-weight: 800; }
.optional { color: #858279; font-size: 9px; font-weight: 500; }
.fullselect, .textinput, .textarea { width: 100%; border: 1px solid var(--line); border-radius: 13px; outline: 0; background: #1d1d1b; color: white; }
.fullselect, .textinput { min-height: 43px; padding: 10px 12px; font-size: 11px; }
.textarea { min-height: 86px; padding: 12px; font-size: 11px; resize: vertical; }
.fullselect:focus, .textinput:focus, .textarea:focus { border-color: #ff6a1a88; }
.uploadbox { display: flex; align-items: center; gap: 11px; min-height: 72px; padding: 12px; border: 1px dashed #ff6a1a70; border-radius: 15px; background: #ff6a1a0b; cursor: pointer; }
.uploadicon { display: grid; flex: none; width: 34px; height: 34px; place-items: center; border-radius: 11px; background: #ff6a1a20; color: var(--orange); font-size: 21px; }
.uploadbox strong, .uploadbox small { display: block; }
.uploadbox strong { font-size: 10px; }
.uploadbox small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.visually-hidden { position: absolute; overflow: hidden; width: 1px; height: 1px; clip: rect(0,0,0,0); white-space: nowrap; }
.photopreview { display: flex; align-items: center; gap: 11px; margin-top: 9px; }
.photopreview img { width: 82px; height: 82px; border: 1px solid var(--line); border-radius: 12px; object-fit: cover; }
.primary { display: flex; width: 100%; min-height: 47px; align-items: center; justify-content: center; gap: 7px; margin-top: 14px; padding: 12px 14px; border: 0; border-radius: 14px; background: var(--orange); box-shadow: 0 7px 24px #ff6a1a22; color: #1b130f; font-size: 12px; font-weight: 900; text-align: center; text-decoration: none; }
.primary:active { transform: scale(.99); }
.result { display: none; margin-top: 14px; padding: 13px; border: 1px solid #ffffff13; border-radius: 16px; background: #1e1e1b; }
.result.show { display: block; animation: enter .2s; }
.result h3 { margin: 0; font-size: 12px; }
.result p { margin: 8px 0 0; color: #dedbd3; font-size: 11px; white-space: pre-wrap; }
.result.error { border-color: #ff8d7844; }
.saved-result { margin-top: 8px; }
.translate-box { padding: 13px; border: 1px solid var(--line); border-radius: 18px; background: #1d1d1b; }
.swaprow { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.langselect { min-width: 0; flex: 1; padding: 8px 7px; border: 1px solid var(--line); border-radius: 10px; background: #252522; color: white; font-size: 9px; }
.swap { flex: none; width: 31px; height: 31px; border: 1px solid #ffffff12; border-radius: 50%; background: #ffffff07; color: var(--orange); font-size: 16px; }
.translate-area { width: 100%; min-height: 83px; border: 0; outline: 0; background: transparent; color: white; font-size: 12px; resize: vertical; }
.translate-area::placeholder { color: #8b8980; }
.translate-result { min-height: 38px; padding-top: 10px; border-top: 1px solid var(--line); color: #e1ded6; font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; }
.translate-result.error { color: #ffc1ae; }
.translate-result small { display: block; margin-top: 7px; color: var(--muted); font-size: 8px; }
.phrasechips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.phrasechips button { padding: 7px 9px; }
.lexicon-info, .source-note { color: var(--muted); font-size: 9px; line-height: 1.5; }
.source-note { margin-top: 10px; }
.sources { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 7px; }
.sources a { color: var(--orange2); font-size: 8px; text-underline-offset: 2px; }
.avatarstage { display: grid; min-height: 250px; place-items: center; overflow: hidden; margin: 14px 0; border: 1px solid #ffffff0d; border-radius: 22px; background: radial-gradient(ellipse at 50% 32%, #ffb45e 0%, #ef6a30 28%, #603019 66%, #191513 100%); }
.avatar-placeholder { display: grid; justify-items: center; gap: 5px; color: #fff; text-align: center; }
.avatar-placeholder span { font-size: 34px; }
.avatar-placeholder b { font-size: 11px; }
.avatar-placeholder small { color: #ffe3ca; font-size: 9px; }
#avatarImg { display: block; width: 100%; max-height: 440px; aspect-ratio: 1; object-fit: cover; }
.stylegrid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
.stylecard { min-height: 69px; padding: 8px 5px; border: 1px solid var(--line); border-radius: 13px; background: #1d1d1b; color: #d2cfc8; font-size: 9px; }
.stylecard .sticon { display: block; margin-bottom: 4px; font-size: 18px; }
.stylecard.on { border-color: #ff6a1a88; background: #ff6a1a13; color: white; }
.downloadbtn { cursor: pointer; }
.saved-header { display: flex; align-items: end; justify-content: space-between; gap: 8px; }
.saved-header .page-title { font-size: 24px; }
.clearbtn { border: 0; background: none; color: #aaa79f; font-size: 9px; }
.saveditem { margin-top: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 15px; background: #1d1d1b; }
.saveditem h3 { margin: 0 0 6px; font-size: 11px; }
.saveditem p { margin: 0; color: #d1cec6; font-size: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.saveditem button { margin-top: 8px; padding: 0; border: 0; background: none; color: var(--orange2); font-size: 9px; }
.empty { padding: 35px 15px; color: #96938c; font-size: 11px; text-align: center; }
.footerhint { margin: 13px 0 0; color: #818078; font-size: 8px; text-align: center; }
.nav { position: fixed; z-index: 11; bottom: 0; left: 50%; display: grid; width: min(100%,520px); grid-template-columns: repeat(4,1fr); padding: 9px 9px calc(env(safe-area-inset-bottom) + 7px); border-top: 1px solid #ffffff0d; background: rgba(20,20,19,.97); backdrop-filter: blur(18px); transform: translateX(-50%); }
.navbtn { display: grid; justify-items: center; gap: 3px; padding: 3px 0; border: 0; background: none; color: #818078; font-size: 9px; }
.navbtn svg { width: 19px; height: 19px; stroke-width: 1.8; }
.navbtn.active { color: var(--orange); }
.toast { position: fixed; z-index: 20; bottom: 90px; left: 50%; max-width: calc(100vw - 28px); padding: 10px 15px; border-radius: 99px; background: #f1efe9; box-shadow: 0 8px 25px #0006; color: #171614; font-size: 10px; font-weight: 800; opacity: 0; pointer-events: none; text-align: center; transform: translate(-50%,12px); transition: .2s; }
.toast.show { opacity: 1; transform: translate(-50%,0); }
@media (min-width: 560px) { body { padding: 18px 0; } .app { min-height: calc(100svh - 36px); border: 1px solid #ffffff10; border-radius: 28px; } .topbar { border-radius: 28px 28px 0 0; } .nav { bottom: 18px; border: 1px solid #ffffff0c; border-radius: 0 0 28px 28px; } .screen { padding-right: 22px; padding-left: 22px; } }
