/* JARVIS Study Mode - calm: deep navy + sage + warm light. Own file (other sessions edit styles.css). */
:root {
  --bg: #0e1726; --bg2: #13203a; --card: rgba(255, 255, 255, .045); --line: rgba(190, 215, 205, .14);
  --ink: #e9e4d8; --dim: #9fb0ad; --sage: #8fbf9f; --sage2: #6fa487; --warm: #f2c98b; --rose: #e79a8f;
  --paper: #16233b; --pink: #f7b7a3;
  --rad: 16px; --ui: 'Nunito', system-ui, sans-serif; --read: 'Literata', Georgia, serif;
  --fs: 19px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: radial-gradient(1200px 700px at 15% -10%, #1b2c4a 0%, transparent 60%), radial-gradient(900px 600px at 110% 110%, #1a3330 0%, transparent 55%), var(--bg);
  color: var(--ink); font: 15px/1.5 var(--ui); -webkit-tap-highlight-color: transparent; min-height: 100%; }
body.in-app { overflow: hidden; height: 100%; }
#app { height: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

/* slow floating light */
.orbs { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.orbs i { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(70px); opacity: .16; animation: drift 38s ease-in-out infinite alternate; }
.orbs i:nth-child(1) { background: #6fa487; left: -12vmax; top: 30%; }
.orbs i:nth-child(2) { background: #f2c98b; right: -16vmax; top: -18vmax; opacity: .09; animation-duration: 46s; }
.orbs i:nth-child(3) { background: #5b7fb8; left: 40%; bottom: -26vmax; animation-duration: 54s; }
@keyframes drift { to { transform: translate(6vmax, -5vmax) scale(1.1); } }

/* ---------- top bar ---------- */
.top { position: relative; z-index: 3; display: flex; align-items: center; gap: 14px; padding: 10px 18px; border-bottom: 1px solid var(--line);
  background: rgba(14, 23, 38, .7); backdrop-filter: blur(10px); }
.back { color: var(--dim); text-decoration: none; font-weight: 700; padding: 6px 10px; border-radius: 10px; }
.back:hover { background: var(--card); color: var(--ink); }
.brand { font-weight: 800; letter-spacing: .14em; font-size: 13px; color: var(--dim); display: flex; align-items: center; gap: 10px; }
.brand b { color: var(--sage); letter-spacing: .08em; font-size: 16px; }
.halo { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--sage); box-shadow: 0 0 12px rgba(143, 191, 159, .6); animation: breathe 6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(.75); opacity: .6; } }
.session { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.ctl { display: flex; gap: 8px; }
.pill { border: 1px solid var(--line); background: var(--card); padding: 8px 14px; border-radius: 999px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px;
  transition: background .3s, border-color .3s, transform .2s; white-space: nowrap; }
.pill:hover:not(:disabled) { background: rgba(255, 255, 255, .09); }
.pill:active:not(:disabled) { transform: scale(.97); }
.pill.hot { background: linear-gradient(135deg, #8fbf9f, #6fa487); color: #0e1f1a; border-color: transparent; }
.pill.on { border-color: var(--sage); color: var(--sage); box-shadow: 0 0 0 3px rgba(143, 191, 159, .12) inset; }
.pill:disabled { opacity: .4; cursor: not-allowed; }
.pill.icon { padding: 8px 11px; }
.pill.ready { background: linear-gradient(135deg, #f2c98b, #e7ae6a); color: #2a1c08; border-color: transparent; animation: glow 2.8s ease-in-out infinite; }
.pill b:empty { display: none; }
.pill b { background: rgba(0, 0, 0, .25); border-radius: 999px; padding: 0 7px; font-size: 12px; }
@keyframes glow { 50% { box-shadow: 0 0 22px rgba(242, 201, 139, .55); } }
.mini { border: 1px solid var(--line); background: transparent; padding: 5px 10px; border-radius: 10px; color: var(--dim); font-weight: 700; font-size: 13px; }
.mini:hover { color: var(--ink); background: var(--card); }
.ringbox { position: relative; width: 44px; height: 44px; display: grid; place-items: center; }
.ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3.5; }
.ring .track { stroke: rgba(255, 255, 255, .08); }
.ring .prog { stroke: var(--sage); stroke-linecap: round; stroke-dasharray: 119.4; stroke-dashoffset: 119.4; transition: stroke-dashoffset 1s linear, stroke .6s; }
.ringbox.full .prog { stroke: var(--warm); }
#ringTxt { font-size: 10.5px; font-weight: 800; color: var(--dim); }

/* ---------- layout ---------- */
.wrap { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 18px; padding: 18px; height: calc(100% - 65px); }
.panel { min-height: 0; }
.deskp, .reader { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--rad); overflow: hidden; position: relative; }
.side { display: flex; flex-direction: column; min-height: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--rad); overflow: hidden; }
.tabs { display: flex; padding: 6px; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; border: 0; background: transparent; padding: 8px 4px; border-radius: 10px; color: var(--dim); font-weight: 700; font-size: 13.5px; }
.tabs button.on { background: rgba(143, 191, 159, .14); color: var(--sage); }
.side > .panel { display: none; flex: 1; flex-direction: column; padding: 14px; overflow: auto; }
.side > .panel.on { display: flex; }
.dock { display: none; }

/* ---------- study desk ---------- */
.desk { flex: 1; overflow: auto; padding: 26px clamp(16px, 4vw, 44px) 30px; display: flex; flex-direction: column; gap: 18px; }
.modes { display: flex; gap: 8px; background: rgba(0, 0, 0, .2); padding: 5px; border-radius: 999px; align-self: flex-start; }
.modes button { border: 0; background: transparent; padding: 9px 18px; border-radius: 999px; font-weight: 800; color: var(--dim); transition: background .4s, color .4s; }
.modes button.on { background: linear-gradient(135deg, #8fbf9f, #6fa487); color: #0e1f1a; }
.modes button.locked { opacity: .55; }
.modes button i { font-style: normal; font-size: 10.5px; border: 1px solid currentColor; border-radius: 6px; padding: 0 5px; margin-left: 4px; }
.dgrid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; }
.dgrid > *, .desk { min-width: 0; }
.card { background: rgba(255, 255, 255, .04); border: 1px solid var(--line); border-radius: 20px; padding: 18px; }
.fcard { grid-column: 1 / -1; display: flex; gap: 26px; align-items: center; }
.bigring { position: relative; width: 168px; height: 168px; flex: 0 0 168px; }
.bigring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.bigring circle { fill: none; stroke-width: 7; }
.bigring .track { stroke: rgba(255, 255, 255, .07); }
.bigring .prog { stroke: var(--sage); stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset 1s linear; filter: drop-shadow(0 0 6px rgba(143, 191, 159, .45)); }
.bigtxt { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.bigtxt b { font: 800 34px/1 var(--ui); font-variant-numeric: tabular-nums; }
.bigtxt span { color: var(--dim); font-size: 12.5px; margin-top: 4px; }
.fside h3 { font: 600 24px/1.25 var(--read); color: var(--warm); margin: 0 0 6px; }
.fside .row { margin-top: 14px; }
.fside .small { margin-top: 10px; }
.mcard { display: flex; gap: 16px; align-items: center; }
.art { width: 92px; height: 92px; flex: 0 0 92px; border-radius: 14px; background: linear-gradient(135deg, #24384f, #1c3a33); display: grid; place-items: center; font-size: 34px; color: var(--sage); overflow: hidden; }
.art img { width: 100%; height: 100%; object-fit: cover; }
.mcard.playing .art { animation: spinSlow 30s linear infinite; border-radius: 50%; }
@keyframes spinSlow { to { transform: rotate(360deg); } }
.minfo { min-width: 0; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.minfo small { font-size: 10.5px; letter-spacing: .16em; color: var(--sage); font-weight: 800; }
.minfo b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.minfo > span { color: var(--dim); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mctl { display: flex; gap: 8px; align-items: center; margin: 8px 0 4px; }
.mbtn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: transparent; font-size: 14px; }
.mbtn.big { width: 46px; height: 46px; background: linear-gradient(135deg, #8fbf9f, #6fa487); color: #0e1f1a; border: 0; font-size: 16px; }
.wcard { display: flex; flex-direction: column; gap: 10px; }
.wlab { font: 600 18px var(--read); color: var(--warm); }
.wrow { display: flex; gap: 8px; }
.wrow input { flex: 1; min-width: 0; background: rgba(0, 0, 0, .22); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; outline: none; }
.wrow input:focus { border-color: var(--sage); }
.wchips { display: flex; flex-wrap: wrap; gap: 7px; }
.wchips .chip { padding: 8px 12px; }
.book { display: flex; flex-direction: column; gap: 10px; }
.bsel { display: flex; gap: 12px; align-items: flex-start; }
.bcover { width: 58px; height: 86px; flex: 0 0 58px; border-radius: 6px; background: linear-gradient(135deg, #2c4258, #1f3b34); display: grid; place-items: center; font-size: 24px; overflow: hidden; box-shadow: 0 6px 16px rgba(0, 0, 0, .35); }
.bcover img { width: 100%; height: 100%; object-fit: cover; }
.binfo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.binfo b { font: 600 16px/1.25 var(--read); }
.binfo > span { color: var(--dim); font-size: 13px; }
.bpage { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.bpage .mbtn { width: 30px; height: 30px; }
.bpage label { font-weight: 700; font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.bpage { flex-wrap: nowrap !important; }
.bpage .hint { display: none; }
.bar + .pgof { font-size: 11.5px; color: var(--dim); margin-top: 3px; }
.bpage input { width: 62px; background: rgba(0, 0, 0, .22); border: 1px solid var(--line); border-radius: 10px; padding: 5px 8px; text-align: center; font-weight: 800; }
.bar { height: 5px; border-radius: 9px; background: rgba(255, 255, 255, .07); margin-top: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #8fbf9f, #f2c98b); transition: width .6s; }
.bres { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow: auto; }
.bres button { display: flex; gap: 10px; align-items: center; text-align: left; border: 1px solid transparent; background: rgba(255, 255, 255, .03); border-radius: 10px; padding: 6px; }
.bres button:hover { border-color: var(--sage); }
.bres img, .bres .nc { width: 32px; height: 48px; border-radius: 4px; object-fit: cover; flex: 0 0 32px; background: #24384f; display: grid; place-items: center; font-size: 14px; }
.bres b { display: block; font-size: 14px; }
.bres span { color: var(--dim); font-size: 12.5px; }
.bask { display: flex; gap: 8px; }
.bask input { flex: 1; min-width: 0; background: rgba(0, 0, 0, .22); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; outline: none; }
.bask input:focus { border-color: var(--warm); }
.linkbtn { align-self: center; border: 0; background: transparent; color: var(--dim); font-weight: 700; text-decoration: underline; text-underline-offset: 4px; padding: 6px; }
.linkbtn:hover { color: var(--ink); }
body[data-mode="maths"] .bigring .prog { stroke: #8fb4d8; filter: drop-shadow(0 0 6px rgba(143, 180, 216, .45)); }
body[data-mode="science"] .bigring .prog { stroke: #c7a6e0; }

/* ---------- reader ---------- */
.rtools { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.rtools .sp { flex: 1; }
.intake { padding: 34px clamp(18px, 6vw, 70px); overflow: auto; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.intake h2 { font: 600 26px/1.2 var(--read); margin: 0; color: var(--warm); }
.hint { color: var(--dim); margin: 0; }
.small { font-size: 13px; }
.intake input, .intake textarea, .srch input, .ask input, #trIn, .mbox input[type=number], select {
  background: rgba(0, 0, 0, .22); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; outline: none; transition: border-color .3s; }
.intake input:focus, .intake textarea:focus, .srch input:focus, .ask input:focus, #trIn:focus { border-color: var(--sage); }
.intake textarea { min-height: 220px; flex: 1; resize: vertical; font: 16px/1.6 var(--read); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.msg { color: var(--dim); font-size: 13px; }
.file { cursor: pointer; }
.page { flex: 1; overflow: auto; padding: 36px clamp(20px, 8vw, 110px) 80px; font: var(--fs)/1.8 var(--read); color: var(--ink); outline: none; scroll-behavior: smooth; }
.page h1 { font: 600 1.5em/1.25 var(--read); color: var(--warm); margin: 0 0 .8em; }
.page p { margin: 0 0 1.05em; max-width: 68ch; }
.page.sans { font-family: var(--ui); }
.page ::selection { background: rgba(242, 201, 139, .35); }
.page .hl { background: rgba(143, 191, 159, .28); border-radius: 4px; box-shadow: 0 0 0 2px rgba(143, 191, 159, .28); }
.page .saidw { background: rgba(242, 201, 139, .3); border-radius: 3px; }
body.theme-sepia .reader { background: #f1e6cf; border-color: #d9c9a8; }
body.theme-sepia .page, body.theme-sepia .intake { color: #3d3122; }
body.theme-sepia .page h1, body.theme-sepia .intake h2 { color: #8a5a22; }
body.theme-sepia .rtools { border-color: #d9c9a8; }
body.theme-sepia .rtools .mini { color: #6b5a42; border-color: #d0bf9c; }
body.theme-day .reader { background: #fbfaf6; border-color: #e3e0d6; }
body.theme-day .page, body.theme-day .intake { color: #1f2a33; }
body.theme-day .page h1, body.theme-day .intake h2 { color: #3f7058; }
body.theme-day .rtools { border-color: #e3e0d6; }
body.theme-day .rtools .mini { color: #56636b; border-color: #dad6ca; }
body.theme-sepia .intake textarea, body.theme-day .intake textarea, body.theme-sepia .intake input, body.theme-day .intake input { background: rgba(255, 255, 255, .6); color: #222; }
.trview { position: absolute; inset: 52px 0 0 0; background: var(--bg2); display: flex; flex-direction: column; z-index: 2; }
.trhead { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); color: var(--sage); }
.trbody { flex: 1; overflow: auto; padding: 28px clamp(20px, 8vw, 110px); font: var(--fs)/1.8 var(--read); white-space: pre-wrap; }

/* ---------- Professher ---------- */
.stage { display: flex; align-items: flex-end; gap: 10px; }
.prof-wrap { width: 132px; flex: 0 0 132px; }
.prof-wrap svg { width: 100%; height: auto; display: block; overflow: visible; }
.bubble { position: relative; flex: 1; background: #f4ecdc; color: #2a2a2a; border-radius: 16px; padding: 10px 13px; font-size: 14px; line-height: 1.45; margin-bottom: 40px;
  max-height: 190px; overflow: auto; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
.bubble::before { content: ''; position: absolute; left: -9px; bottom: 16px; border: 9px solid transparent; border-right-color: #f4ecdc; border-left: 0; }
.bubble.think { color: #777; font-style: italic; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.chip { border: 1px solid var(--line); background: transparent; padding: 6px 11px; border-radius: 999px; color: var(--ink); font-weight: 700; font-size: 13px; }
.chip:hover { border-color: var(--sage); }
.chip.off { color: var(--dim); }
.chat { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 2px 8px; min-height: 80px; }
.msgx { max-width: 88%; padding: 8px 12px; border-radius: 14px; font-size: 14px; white-space: pre-wrap; animation: rise .5s ease; }
.msgx.me { align-self: flex-end; background: rgba(143, 191, 159, .18); border-bottom-right-radius: 4px; }
.msgx.pr { align-self: flex-start; background: rgba(255, 255, 255, .06); border-bottom-left-radius: 4px; }
.msgx .src { display: block; font-size: 11px; color: var(--dim); margin-top: 4px; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.ask { display: flex; gap: 8px; }
.ask input { flex: 1; min-width: 0; }
.kbinfo { font-size: 11.5px; color: var(--dim); margin-top: 6px; }

/* Professher SVG animation */
.pf .body { animation: bob 4.5s ease-in-out infinite; transform-origin: 100px 230px; }
@keyframes bob { 50% { transform: translateY(-3px) rotate(-.6deg); } }
.pf .lid { transform-box: fill-box; transform-origin: center top; transform: scaleY(0); animation: blink 5.2s infinite; }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(0); } 95.5% { transform: scaleY(1); } }
.pf .mouth-o { transform-box: fill-box; transform-origin: center top; transform: scaleY(.25); transition: transform .12s; }
.pf.talk .mouth-o { animation: jaw .26s ease-in-out infinite alternate; }
@keyframes jaw { from { transform: scaleY(.3); } to { transform: scaleY(1); } }
.pf .brow { transition: transform .3s; transform-box: fill-box; transform-origin: center; }
.pf.talk .brow { animation: brow 1.3s ease-in-out infinite; }
@keyframes brow { 50% { transform: translateY(-3px); } }
.pf .hand { transform-box: fill-box; transform-origin: 20% 90%; }
.pf.talk .hand { animation: wave 1.6s ease-in-out infinite; }
@keyframes wave { 50% { transform: rotate(-14deg); } }
.pf .shine { animation: shine 7s ease-in-out infinite; }
@keyframes shine { 0%, 80%, 100% { opacity: .55; } 88% { opacity: 1; } }
.pf.think .pupil { animation: lookup 1.4s ease-in-out infinite alternate; }
@keyframes lookup { to { transform: translate(3px, -4px); } }
.pf.yell .body { animation: shake .12s linear infinite; }
.pf.yell .mouth-o { transform: scaleY(1.25); animation: none; }
.pf.angry.talk .mouth-o { animation: shout .16s ease-in-out infinite alternate; }
@keyframes shout { from { transform: scaleY(.9); } to { transform: scaleY(1.5); } }
.pf .rage, .pf .steam, .pf .vein, .pf .abrow { opacity: 0; transition: opacity .2s; }
.pf.angry .abrow { opacity: 1; }
.pf.angry .brow { opacity: 0; }
.pf.angry .rage { opacity: .6; animation: flush .8s ease-in-out infinite; }
@keyframes flush { 50% { opacity: .78; } }
.pf .steam circle { fill: #f3f5f7; stroke: #c9d0d6; stroke-width: 1.5; }
.pf.angry .steam { opacity: 1; }
.pf.angry .steam circle { animation: puff 1s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.pf.angry .steam circle:nth-child(2n) { animation-delay: .5s; }
@keyframes puff { from { transform: translateY(6px) scale(.4); opacity: .9; } to { transform: translateY(-14px) scale(1.4); opacity: 0; } }
.pf.angry .vein { opacity: 1; animation: throb .45s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes throb { 50% { transform: scale(1.3); } }
.pf.angry .pupil { transform: scale(.7); transform-box: fill-box; transform-origin: center; }
body.angry .prof-wrap { animation: none; }
.pf.yell .cheek { opacity: .9; }
.pf.yell .brow-l { transform: rotate(18deg) translateY(4px); }
.pf.yell .brow-r { transform: rotate(-18deg) translateY(4px); }
.pf .cheek { opacity: .35; transition: opacity .3s; }
@keyframes shake { 25% { transform: translate(-2px, 1px) rotate(-1deg); } 75% { transform: translate(2px, -1px) rotate(1deg); } }

/* ---------- dictionary ---------- */
.srch { display: flex; gap: 8px; }
.srch input { flex: 1; min-width: 0; }
.dres { margin-top: 12px; flex: 1; }
.dword { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.dword h3 { font: 600 26px/1.1 var(--read); margin: 0; color: var(--warm); }
.dword .ph { color: var(--dim); }
.pos { margin: 12px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--sage); font-weight: 800; }
.dres ol { margin: 0; padding-left: 20px; }
.dres li { margin: 4px 0; }
.dres .ex { display: block; color: var(--dim); font-style: italic; font-size: 13.5px; }
.syn { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.syn button { border: 0; background: rgba(143, 191, 159, .12); color: var(--sage); border-radius: 999px; padding: 2px 9px; font-size: 12.5px; }
.easy { margin-top: 12px; background: rgba(242, 201, 139, .1); border: 1px solid rgba(242, 201, 139, .3); border-radius: 12px; padding: 10px 12px; font-size: 14.5px; }
.easy b { color: var(--warm); }
.dbtns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.bank h4 { margin: 16px 0 6px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.bankl { display: flex; flex-wrap: wrap; gap: 6px; }
.bankl button { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 3px 10px; font-size: 13px; color: var(--ink); }

/* ---------- translate ---------- */
.trrow { display: flex; gap: 8px; align-items: center; }
.trrow select { flex: 1; min-width: 0; }
#trIn { margin-top: 10px; min-height: 110px; resize: vertical; font-size: 15px; }
.trout { margin-top: 10px; background: rgba(0, 0, 0, .18); border-radius: 12px; padding: 12px; min-height: 60px; white-space: pre-wrap; font: 16px/1.6 var(--read); }
.trout:empty::before { content: 'The translation appears here.'; color: var(--dim); font-family: var(--ui); font-size: 14px; }

/* ---------- calculator ---------- */
.cdisp { background: rgba(0, 0, 0, .25); border-radius: 14px; padding: 12px 14px; text-align: right; }
.cexpr { color: var(--dim); font-size: 14px; min-height: 21px; word-break: break-all; }
.cval { font: 700 32px/1.2 var(--ui); word-break: break-all; }
.ckeys { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin-top: 12px; }
.ckeys button { border: 1px solid var(--line); background: rgba(255, 255, 255, .04); border-radius: 12px; padding: 11px 0; font-weight: 700; font-size: 15px; transition: background .2s, transform .1s; }
.ckeys button:active { transform: scale(.95); }
.ckeys button.fn { color: var(--sage); font-size: 13.5px; }
.ckeys button.op { color: var(--warm); }
.ckeys button.eq { background: linear-gradient(135deg, #8fbf9f, #6fa487); color: #0e1f1a; border-color: transparent; }
.ckeys button.on { border-color: var(--sage); color: var(--sage); }
.chist { margin-top: 10px; font-size: 13px; color: var(--dim); display: flex; flex-direction: column; gap: 3px; }
.chist div { cursor: pointer; text-align: right; }
.chist div:hover { color: var(--ink); }

/* ---------- popover ---------- */
.pop { position: fixed; z-index: 20; width: min(340px, calc(100vw - 20px)); background: #f6efe0; color: #2b2b2b; border-radius: 14px; box-shadow: 0 14px 40px rgba(0, 0, 0, .45);
  padding: 10px 12px; animation: rise .25s ease; }
.poph { display: flex; align-items: baseline; gap: 8px; }
.poph b { font: 600 19px var(--read); color: #5a3d14; }
.poph span { color: #8a7c66; font-size: 13px; flex: 1; }
.x { border: 0; background: transparent; font-size: 20px; line-height: 1; color: #8a7c66; padding: 0 4px; }
.popb { font-size: 14px; margin: 6px 0; max-height: 160px; overflow: auto; }
.popb i { color: #777; }
.popa { display: flex; flex-wrap: wrap; gap: 5px; }
.popa button { border: 1px solid #d8ccb3; background: #fffaf0; border-radius: 999px; padding: 4px 10px; font-size: 12.5px; font-weight: 700; color: #3b4a40; }
.popa button:hover { background: #eaf3ec; }

/* ---------- camera, break, yell ---------- */
.cam { position: fixed; z-index: 6; right: 18px; bottom: 18px; width: 150px; border-radius: 14px; overflow: hidden; border: 2px solid var(--line); background: #000;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .4); transition: border-color .4s; }
.cam.mini-cam video { display: none; }
.cam.mini-cam { width: auto; background: rgba(14, 23, 38, .85); }
.cam { cursor: grab; touch-action: none; user-select: none; }
.cam.dragging { cursor: grabbing; box-shadow: 0 14px 40px rgba(0, 0, 0, .55); transition: none; opacity: .92; }
.camv { position: relative; }
.cam video { width: 100%; display: block; transform: scaleX(-1); }
.cam canvas { position: absolute; inset: 0; width: 100%; height: 100%; transform: scaleX(-1); pointer-events: none; }
.cam.mini-cam .camv { display: none; }
.camb { display: flex; align-items: center; gap: 4px; padding: 3px 4px 3px 8px; }
.cam span { flex: 1; display: block; font-size: 11.5px; color: var(--dim); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cam .mini { padding: 2px 7px; font-size: 11px; }
.cam.seen { border-color: rgba(143, 191, 159, .6); }
.cam.away { border-color: var(--rose); }
.breakov { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(10, 18, 30, .82); backdrop-filter: blur(8px); animation: fade .6s ease; }
@keyframes fade { from { opacity: 0; } }
.bbox { text-align: center; max-width: 420px; padding: 20px; }
.bbox h2 { font: 600 28px var(--read); color: var(--warm); margin: 0; }
.bclock { font: 800 72px/1.1 var(--ui); color: var(--sage); margin: 10px 0; font-variant-numeric: tabular-nums; }
.bbox p { color: var(--dim); }
.breathe { position: relative; width: 130px; height: 130px; margin: 18px auto; display: grid; place-items: center; }
.breathe i { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, rgba(143, 191, 159, .5), rgba(143, 191, 159, .05)); animation: inhale 10s ease-in-out infinite; }
.breathe span { position: relative; color: var(--ink); font-weight: 700; letter-spacing: .2em; font-size: 12px; text-transform: uppercase; }
@keyframes inhale { 0%, 100% { transform: scale(.55); } 45%, 55% { transform: scale(1); } }
.yellov { position: fixed; inset: 0; z-index: 40; pointer-events: none; display: grid; place-items: center; background: radial-gradient(circle, transparent 40%, rgba(231, 154, 143, .35)); animation: fade .2s; }
.ybub { font: 900 clamp(30px, 7vw, 72px)/1 var(--ui); color: #fff; text-shadow: 0 4px 0 #b4473a, 0 10px 30px rgba(0, 0, 0, .5); transform: rotate(-4deg); animation: pop .4s cubic-bezier(.3, 1.6, .5, 1); text-align: center; padding: 0 20px; }
@keyframes pop { from { transform: scale(.3) rotate(-10deg); opacity: 0; } }
.yin { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.yface { width: min(46vw, 300px); }
.yface svg { width: 100%; height: auto; display: block; overflow: visible; filter: drop-shadow(0 12px 30px rgba(0, 0, 0, .5)); }
.yface .pf .hand { animation: shakefist .2s ease-in-out infinite; }
@keyframes shakefist { 50% { transform: rotate(-12deg); } }
body.angry .yellov { animation: redpulse 1s ease-in-out infinite; }
@keyframes redpulse { 50% { background: radial-gradient(circle, rgba(231, 80, 60, .12) 30%, rgba(200, 40, 30, .55)); } }
.yellov.again .ybub { animation: pop .4s cubic-bezier(.3, 1.6, .5, 1), shake .12s linear .4s 6; }
body.angry .ybub { color: #fff; font-size: clamp(34px, 8vw, 80px); text-shadow: 0 4px 0 #b4271a, 0 0 2px #7a1208, 0 10px 30px rgba(0, 0, 0, .6); }
body.angry .yellov { background: radial-gradient(circle, rgba(231, 80, 60, .12) 25%, rgba(190, 35, 25, .5)); }
body.angry .bubble { background: #ffd9d2; color: #8a1c10; font-weight: 800; }

/* ---------- modal / toast ---------- */
.modal { position: fixed; inset: 0; z-index: 35; display: grid; place-items: center; background: rgba(5, 10, 18, .65); padding: 14px; }
.mbox { width: min(520px, 100%); max-height: 90vh; overflow: auto; background: var(--bg2); border: 1px solid var(--line); border-radius: 18px; padding: 16px 20px 20px; }
.mh { display: flex; justify-content: space-between; align-items: center; font-size: 17px; }
.mbox .x { color: var(--dim); }
.mbox h4 { margin: 16px 0 6px; color: var(--sage); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.mbox h4 small { color: var(--dim); text-transform: none; letter-spacing: 0; }
.plrow select { width: 100%; }
.chk { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.chk input { accent-color: var(--sage); width: 17px; height: 17px; }
.cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cols label { font-size: 13px; color: var(--dim); display: flex; flex-direction: column; gap: 4px; }
.cols label span { display: flex; align-items: center; gap: 6px; color: var(--ink); }
.cols input { width: 72px; }
.mbox ul { padding-left: 18px; color: var(--dim); }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 26px; transform: translateX(-50%); background: #f4ecdc; color: #2a2a2a; padding: 10px 16px; border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4); font-weight: 700; font-size: 14px; max-width: calc(100vw - 30px); animation: rise .3s ease; }

/* ---------- phone ---------- */
@media (max-width: 860px) {
  .top { padding: 8px 8px; gap: 5px; padding-top: max(8px, env(safe-area-inset-top)); }
  .back { padding: 6px 6px; }
  .back span, .pill span { display: none; }
  .brand { font-size: 0; gap: 6px; }
  .brand b { font-size: 15px; }
  .halo { width: 11px; height: 11px; }
  .session, .ctl { gap: 4px; }
  .session { margin-left: auto; }
  .top .pill { padding: 7px 9px; }
  .ringbox { width: 38px; height: 38px; }
  #ringTxt { font-size: 9.5px; }
  .rtools { padding: 8px 10px; gap: 4px; }
  .rtools .mini { padding: 4px 8px; }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .desk { padding: 14px 12px 24px; gap: 12px; }
  .modes { align-self: stretch; }
  .modes button { flex: 1; padding: 8px 6px; font-size: 13.5px; }
  .modes button i { display: none; }
  .dgrid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .fcard { flex-direction: column; text-align: center; gap: 12px; }
  .fside .row { justify-content: center; }
  .bigring { width: 150px; height: 150px; flex-basis: 150px; }
  .fside h3 { font-size: 20px; }
  .art { width: 72px; height: 72px; flex-basis: 72px; }
  .wrap { display: block; padding: 10px; height: calc(100% - 58px - 64px); }
  .deskp, .side { height: 100%; }
  .wrap .side { display: none; }
  .wrap.side-on .side { display: flex; }
  .wrap.side-on .deskp { display: none; }
  body.in-app { overflow: hidden; }
  .tabs { display: none; }
  .dock { display: flex; position: fixed; z-index: 5; left: 0; right: 0; bottom: 0; background: rgba(14, 23, 38, .94); border-top: 1px solid var(--line);
    padding: 6px 4px max(6px, env(safe-area-inset-bottom)); backdrop-filter: blur(10px); }
  .dock button { flex: 1; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; font-size: 19px; color: var(--dim); padding: 4px 0; border-radius: 12px; }
  .dock button span { font-size: 11px; font-weight: 700; }
  .dock button.on { color: var(--sage); background: rgba(143, 191, 159, .1); }
  .page { padding: 22px 18px 60px; }
  .intake { padding: 20px 16px; }
  .intake textarea { min-height: 160px; }
  .prof-wrap { width: 104px; flex-basis: 104px; }
  .cam { bottom: 76px; right: 10px; width: 150px; }
  .cols { grid-template-columns: 1fr; }
  .ckeys button { padding: 13px 0; }
  .trview { inset: 46px 0 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ================= Professher Lite additions ================= */
.screen { position: relative; z-index: 1; }
.pill.sm { padding: 6px 13px; font-size: 13.5px; }
.pill.big { padding: 13px 22px; font-size: 16.5px; text-decoration: none; color: inherit; }
a.pill { text-decoration: none; color: var(--ink); }
.mark { display: inline-block; width: 30px; height: 30px; border-radius: 50%; background: #1f3346; overflow: hidden; flex: 0 0 30px; }
.mark svg { width: 100%; height: 100%; display: block; }
/* home */
.nav { display: flex; align-items: center; gap: 14px; max-width: 1120px; margin: 0 auto; padding: 16px 20px; }
.wordmark { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 19px; color: var(--ink); text-decoration: none; letter-spacing: .01em; }
.navlinks { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.navlink { color: var(--dim); text-decoration: none; font-weight: 700; padding: 6px 10px; border-radius: 10px; background: none; border: 0; }
.navlink:hover { color: var(--ink); background: var(--card); }
.hero { max-width: 1120px; margin: 0 auto; padding: 34px 20px 20px; display: grid; grid-template-columns: 1.15fr 1fr; gap: 30px; align-items: center; }
.eyebrow { color: var(--sage); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: 12.5px; margin: 0 0 12px; }
.hero h1 { font: 600 clamp(34px, 5.2vw, 58px)/1.08 var(--read); margin: 0 0 16px; color: #f6efe0; }
.hero h1 em { color: var(--warm); font-style: italic; }
.lede { color: #c7d2cf; font-size: 18px; line-height: 1.6; margin: 0 0 22px; max-width: 56ch; }
.fine { color: var(--dim); font-size: 12.5px; margin: 10px 0 0; }
.hero-art { position: relative; display: grid; place-items: center; }
.hero-prof { width: min(340px, 72vw); animation: floaty 6s ease-in-out infinite; }
.hero-prof svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .45)); }
@keyframes floaty { 50% { transform: translateY(-10px); } }
.hero-bubble { position: absolute; top: 4%; right: 0; max-width: 190px; background: #f4ecdc; color: #2a2a2a; border-radius: 16px; padding: 10px 13px; font-weight: 700; font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); transform: rotate(3deg); }
.features { max-width: 1120px; margin: 20px auto 0; padding: 0 20px 30px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.feat { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.feat b { font-size: 16.5px; }
.feat p { color: var(--dim); margin: 6px 0 0; }
.foot { max-width: 1120px; margin: 0 auto; padding: 22px 20px 40px; display: flex; flex-wrap: wrap; gap: 18px; color: var(--dim); font-size: 13.5px; border-top: 1px solid var(--line); }
.foot a { color: var(--dim); }
/* app top bar */
.top .back { border: 0; background: transparent; font-size: 18px; }
.brand { color: var(--ink); letter-spacing: 0; font-size: 15px; }
.brand b { color: var(--ink); font-size: 16px; letter-spacing: .02em; }
.who { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 5px 11px; color: var(--dim); font-weight: 700; font-size: 13px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who:hover { color: var(--ink); }
/* desk cards */
.card.wide { grid-column: 1 / -1; }
.card[hidden] { display: none !important; }
.ch { margin: 0 0 12px; font: 600 19px var(--read); color: var(--warm); }
.mcard { flex-direction: column; align-items: stretch; gap: 8px; grid-column: 1 / -1; }
.mhead { display: flex; justify-content: space-between; align-items: center; }
.mhead small { font-size: 10.5px; letter-spacing: .16em; color: var(--sage); font-weight: 800; }
.mcard iframe { border-radius: 12px; display: block; }
.topics { display: flex; flex-wrap: wrap; gap: 6px; }
.topics button { border: 1px solid var(--line); background: rgba(255, 255, 255, .03); border-radius: 12px; padding: 7px 11px; font-weight: 700; font-size: 13.5px; display: flex; gap: 7px; align-items: center; }
.topics button i { font-style: normal; color: var(--warm); min-width: 14px; text-align: center; }
.topics button.on, .levels button.on { border-color: var(--sage); background: rgba(143, 191, 159, .14); color: var(--sage); }
.levels { display: flex; gap: 6px; margin: 10px 0 14px; }
.levels button { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 5px 14px; font-weight: 700; font-size: 13px; color: var(--dim); }
.qbox { background: rgba(0, 0, 0, .18); border-radius: 16px; padding: 16px; }
.qhead { display: flex; justify-content: space-between; gap: 10px; color: var(--dim); font-size: 13px; font-weight: 700; }
.qtext { font: 600 clamp(20px, 2.6vw, 28px)/1.35 var(--read); margin: 12px 0 14px; color: #f6efe0; min-height: 1em; }
.ans { display: flex; gap: 8px; }
.ans input { flex: 1; min-width: 0; font-size: 20px; font-weight: 800; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; outline: none; }
.ans input:focus { border-color: var(--sage); }
.fb { margin-top: 10px; }
.fb .ok { color: var(--sage); font-weight: 800; font-size: 17px; margin: 0; }
.fb .no { color: var(--rose); font-weight: 700; margin: 0; }
.steps { margin: 8px 0 0; padding-left: 22px; color: var(--ink); }
.steps li { margin: 5px 0; }
.opts { display: grid; gap: 8px; }
.opts button { display: flex; gap: 12px; align-items: center; text-align: left; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); border-radius: 12px; padding: 11px 14px; font-weight: 700; font-size: 15px; transition: background .2s, border-color .2s; }
.opts button b { width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .08); font-size: 13px; }
.opts button:hover:not(:disabled) { border-color: var(--sage); }
.opts button.right { border-color: var(--sage); background: rgba(143, 191, 159, .2); }
.opts button.wrong { border-color: var(--rose); background: rgba(231, 154, 143, .18); }
.opts button:disabled { cursor: default; }
.journal { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.jq { background: rgba(242, 201, 139, .08); border: 1px solid rgba(242, 201, 139, .25); border-radius: 14px; padding: 12px 14px; }
.jq .tag { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--warm); font-weight: 800; }
.jq p { margin: 6px 0 8px; font: 600 17px/1.45 var(--read); }
.journal textarea { min-height: 90px; resize: vertical; background: rgba(0, 0, 0, .22); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font: 15px/1.55 var(--read); outline: none; }
.journal textarea:focus { border-color: var(--warm); }
.jlist { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow: auto; }
.jent { border-left: 3px solid var(--sage); padding: 4px 10px; }
.jent small { color: var(--dim); display: block; }
.jent i { color: var(--warm); font-size: 13.5px; }
.jent p { margin: 4px 0 0; white-space: pre-wrap; }
.wrow { display: flex; gap: 8px; }
.wrow input { flex: 1; min-width: 0; background: rgba(0, 0, 0, .22); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; outline: none; }
.dw { font: 600 26px/1.1 var(--read); margin: 0; color: var(--warm); }
.easy p { margin: 4px 0; }
.log { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.logx { background: rgba(255, 255, 255, .05); border-radius: 12px; padding: 7px 11px; font-size: 13.5px; color: #cfd8d5; animation: rise .4s ease; }
#trIn { width: 100%; }
.modal input#nameIn, .modal input#musicIn { width: 100%; margin: 10px 0; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; font-size: 16px; outline: none; }
/* angry mode */
.pf .rage, .pf .steam, .pf .vein, .pf .abrow { opacity: 0; }
.pf .steam circle { fill: #f3f5f7; stroke: #c9d0d6; stroke-width: 1.5; }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 10px; text-align: left; }
  .hero-art { order: -1; }
  .hero-prof { width: 210px; }
  .hero-bubble { right: 4%; top: 0; max-width: 150px; font-size: 12.5px; }
  .features { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .lede { font-size: 16px; }
  .top .who { display: none; }
  .brand b { display: none; }
  .qtext { font-size: 21px; }
}

/* info pages */
.markimg { border-radius: 50%; }
.doc { max-width: 760px; margin: 0 auto; padding: 20px 20px 50px; line-height: 1.7; }
.doc h1 { font: 600 clamp(30px, 5vw, 44px)/1.15 var(--read); color: #f6efe0; margin: 10px 0 14px; }
.doc h2 { font-size: 19px; margin: 28px 0 6px; color: var(--warm); }
.doc p, .doc li { color: #cfd8d5; }
.doc a { color: var(--sage); }
.doc ul { padding-left: 22px; }

/* The Cave family strip */
.cave-strip { max-width: 1120px; margin: 40px auto 0; padding: 18px 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; font-size: 14px; color: var(--dim); }
.cave-badge { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink); text-decoration: none; }
.cave-badge img { width: 34px; height: auto; filter: invert(1) brightness(1.7); }
.cave-badge:hover { text-decoration: underline; text-underline-offset: 4px; }
.cave-strip nav { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.cave-strip nav a { color: var(--ink); }
