/* Memoair – a nagyszülő felülete. Elv: egy képernyőn egy dolog, nagy betű, nagy gomb, erős kontraszt. */
:root{
  --bg:#f6efe6; --paper:#fffaf3; --ink:#2b2420; --soft:#6b5e55; --line:#e4d7c8;
  --acc:#a4553a; --acc-2:#c97b5d; --sage:#5f7a5e; --focus:#1d5fd6;
  --serif:'Lora',Georgia,'Times New Roman',serif; --sans:'Nunito Sans',system-ui,-apple-system,'Segoe UI',sans-serif;
}
*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
html,body{height:100%}
body{background:var(--bg);color:var(--ink);font:400 20px/1.5 var(--sans);-webkit-font-smoothing:antialiased;overflow-x:hidden}
button,input,textarea{font:inherit;color:inherit}
:focus-visible{outline:3px solid var(--focus);outline-offset:3px}
#app{min-height:100%;max-width:560px;margin:0 auto;padding:calc(18px + env(safe-area-inset-top)) 22px calc(22px + env(safe-area-inset-bottom))}
.scr{display:none;min-height:calc(100dvh - 40px - env(safe-area-inset-top) - env(safe-area-inset-bottom));flex-direction:column;gap:18px;animation:in .45s ease}
.scr.on{display:flex}
@keyframes in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
h1{font:500 34px/1.2 var(--serif);letter-spacing:-.01em;margin-top:6px}
.big{font-size:22px;line-height:1.55}
.soft{color:var(--soft);font-size:18px}
.brand{display:flex;align-items:center;gap:10px;font:500 17px var(--serif);color:var(--soft);letter-spacing:.02em;margin-bottom:8px}
.brand .mark{width:26px;height:26px;border-radius:50%;background:radial-gradient(circle at 35% 35%,var(--acc-2),var(--acc));box-shadow:inset 0 0 0 3px rgba(255,255,255,.25)}
.btn{display:flex;align-items:center;justify-content:center;width:100%;min-height:68px;padding:14px 22px;border-radius:20px;border:2px solid var(--ink);background:transparent;font-weight:700;font-size:21px;cursor:pointer;transition:transform .15s,background .2s}
.btn:active{transform:scale(.98)}
.btn.primary{background:var(--ink);color:var(--paper);border-color:var(--ink)}
.btn.ghost{border-color:transparent;color:var(--soft);text-decoration:underline;text-underline-offset:4px;min-height:56px}
.link{background:none;border:0;color:var(--soft);text-decoration:underline;text-underline-offset:4px;font-size:18px;padding:12px;cursor:pointer;align-self:center}
#codeIn{width:100%;text-align:center;font:600 40px/1 var(--sans);letter-spacing:.14em;padding:18px 10px;border-radius:20px;border:2px solid var(--line);background:var(--paper)}
#codeIn:focus{border-color:var(--ink);outline:none}
#codeForm{display:flex;flex-direction:column;gap:14px;margin-top:6px}
.msg{min-height:1.5em;color:#a3261d;font-weight:600;text-align:center}
.tip{display:flex;gap:12px;align-items:center;background:var(--paper);border:1px solid var(--line);border-radius:18px;padding:14px 16px;font-size:18px;color:var(--soft)}
#s-code form{margin-top:auto}
#s-welcome .strong{margin-top:auto;font-weight:700}
.btn.primary.alt{background:var(--acc);border-color:var(--acc)}

/* könyv illusztráció */
.book-ill{width:150px;height:110px;margin:26px auto 4px;position:relative;perspective:600px}
.book-ill i{position:absolute;top:0;width:50%;height:100%;background:var(--paper);border:2px solid var(--ink);border-radius:6px 2px 2px 6px}
.book-ill i:first-child{left:0;transform-origin:right center}
.book-ill i:last-child{right:0;border-radius:2px 6px 6px 2px;background:linear-gradient(180deg,transparent 24%,var(--line) 24% 27%,transparent 27% 42%,var(--line) 42% 45%,transparent 45% 60%,var(--line) 60% 63%,transparent 63%),var(--paper)}
.book-ill.writing i:last-child{animation:pageflip 1.8s ease-in-out infinite}
@keyframes pageflip{0%,100%{opacity:1}50%{opacity:.55}}

/* beszélgetés */
#s-talk{gap:14px}
.talk-top{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.talk-top small{display:block;font-size:15px;color:var(--soft);letter-spacing:.04em}
.talk-top b{font:500 19px/1.3 var(--serif)}
.dots{display:flex;gap:6px;padding-top:8px}
.dots i{width:9px;height:9px;border-radius:50%;background:var(--line)}
.dots i.done{background:var(--sage)}.dots i.cur{background:var(--acc)}
.q-wrap{flex:1;display:flex;flex-direction:column;justify-content:center;gap:14px;min-height:180px}
.q{font:400 29px/1.42 var(--serif)}
.heard{font-size:17px;color:var(--soft);font-style:italic;max-height:5.2em;overflow:hidden}
.heard:not(:empty)::before{content:attr(data-pre);font-style:normal;font-weight:600;margin-right:6px}
.state{display:flex;align-items:center;justify-content:center;gap:12px;min-height:34px;color:var(--soft);font-size:18px;font-weight:600}
.waves{display:none;gap:4px;align-items:center;height:24px}
.waves i{width:5px;height:8px;border-radius:3px;background:var(--acc);animation:wv 1s ease-in-out infinite}
.waves i:nth-child(2){animation-delay:.12s}.waves i:nth-child(3){animation-delay:.24s}.waves i:nth-child(4){animation-delay:.36s}.waves i:nth-child(5){animation-delay:.48s}
@keyframes wv{0%,100%{height:6px}50%{height:24px}}
.state.listen .waves,.state.speak .waves{display:flex}
.state.speak .waves i{background:var(--sage)}
.state.think .waves{display:flex}.state.think .waves i{background:var(--soft);animation-duration:1.6s}
.live{font-size:18px;color:var(--ink);opacity:.75;text-align:center;min-height:0;max-height:4.6em;overflow:hidden}
.mic-wrap{display:flex;flex-direction:column;align-items:center;gap:8px;margin-top:4px}
.mic{width:128px;height:128px;border-radius:50%;border:0;background:var(--acc);color:#fff;display:grid;place-items:center;cursor:pointer;box-shadow:0 14px 34px -10px rgba(164,85,58,.65);transition:transform .2s,background .2s}
.mic:active{transform:scale(.96)}
.mic.rec{background:#b3261e;animation:pulse 1.6s ease-in-out infinite}
.mic:disabled{background:#cdbfb3;box-shadow:none}
@keyframes pulse{0%,100%{box-shadow:0 0 0 0 rgba(179,38,30,.45)}50%{box-shadow:0 0 0 22px rgba(179,38,30,0)}}
.mic-lbl{font-weight:700;font-size:21px}
.tools{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:6px}
.tools button{display:flex;flex-direction:column;align-items:center;gap:6px;padding:12px 6px;min-height:84px;border-radius:18px;border:1.5px solid var(--line);background:var(--paper);font-size:17px;font-weight:600;cursor:pointer}
.tools button.hint{border-color:var(--acc);box-shadow:0 0 0 4px rgba(164,85,58,.15);animation:hint 2s ease-in-out infinite}
@keyframes hint{50%{box-shadow:0 0 0 9px rgba(164,85,58,.06)}}
.type-box{display:flex;flex-direction:column;gap:10px}
.type-box textarea{width:100%;border-radius:16px;border:2px solid var(--line);background:var(--paper);padding:14px;font-size:20px;resize:vertical}

/* ikonok (CSS maszk, külső fájl nélkül) */
.ico{display:inline-block;width:28px;height:28px;background:currentColor;-webkit-mask:var(--m) center/contain no-repeat;mask:var(--m) center/contain no-repeat;flex:none}
.mic-i{width:48px;height:48px;--m:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Crect x='9' y='3' width='6' height='11' rx='3'/%3E%3Cpath d='M5 11a7 7 0 0 0 14 0M12 18v3'/%3E%3C/svg%3E")}
.mic.rec .mic-i{--m:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='6' y='6' width='12' height='12' rx='2'/%3E%3C/svg%3E")}
.rep{--m:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 12a8 8 0 1 0 2.5-5.8M4 4v5h5'/%3E%3C/svg%3E")}
.cam{--m:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M3 8h4l2-3h6l2 3h4v11H3z'/%3E%3Ccircle cx='12' cy='13' r='4'/%3E%3C/svg%3E")}
.pause{--m:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='6' y='5' width='4' height='14' rx='1'/%3E%3Crect x='14' y='5' width='4' height='14' rx='1'/%3E%3C/svg%3E")}
.vol{color:var(--acc);--m:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9v6h4l5 4V5L8 9z'/%3E%3Cpath d='M16 9a4 4 0 0 1 0 6M19 6a8 8 0 0 1 0 12'/%3E%3C/svg%3E")}

#s-pause,#s-confirm,#s-done,#s-share,#s-writing{justify-content:center}
#s-pause .btn,#s-confirm .btn,#s-done .btn,#s-share .btn{margin-top:4px}
.link-box{background:var(--paper);border:1px dashed var(--line);border-radius:16px;padding:14px;font-size:16px;word-break:break-all;color:var(--soft)}
.toast{position:fixed;left:50%;bottom:calc(24px + env(safe-area-inset-bottom));transform:translate(-50%,20px);background:var(--ink);color:var(--paper);padding:14px 20px;border-radius:16px;font-weight:600;font-size:18px;opacity:0;pointer-events:none;transition:.3s;max-width:calc(100% - 32px);text-align:center}
.toast.on{opacity:1;transform:translate(-50%,0)}
@media (max-height:700px){.q{font-size:25px}.mic{width:108px;height:108px}h1{font-size:30px}}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

/* csend utáni együttérző megszólítás */
.care{display:flex;flex-direction:column;gap:12px;background:var(--paper);border:1.5px solid var(--line);border-radius:22px;padding:18px;animation:in .5s ease}
.care p{font:400 21px/1.5 var(--serif)}
.care[hidden]{display:none}
.type-box[hidden],.mic-wrap[hidden]{display:none}
#s-welcome .book-ill{margin:6px auto 0;width:120px;height:86px}
a.btn{text-decoration:none;color:var(--ink)}
.consent{font-size:15px;line-height:1.5;color:var(--soft);text-align:center;margin-top:4px}.consent a{color:inherit}
