/* Chill Typing: a calm, minimal typing mode. Uses the app's existing tokens
   (--zoom, --busy, --border-soft, --text-muted) and fonts. */
.chill{max-width:880px;margin:0 auto}

/* ---------- start screen ---------- */
.chill-start{max-width:440px;margin:clamp(1rem,5vh,3rem) auto 0}
.chill-start h1{font-size:clamp(1.9rem,4vw,2.4rem);margin-bottom:.35rem;display:flex;align-items:center;gap:.6rem}
.chill-start h1 .chill-kb{font-size:.8em;line-height:1;opacity:.85}
.chill-sub{color:var(--text-muted);margin-bottom:1.6rem}
.chill-field{display:block;margin-bottom:1rem}
.chill-field span{display:block;font-size:.8rem;font-weight:700;letter-spacing:.02em;color:var(--text-muted);margin-bottom:.35rem}
.chill-select{width:100%;appearance:none;-webkit-appearance:none;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236b7280' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 1rem center;
  border:1.5px solid var(--border-soft);border-radius:14px;padding:.7rem 2.4rem .7rem 1rem;font-size:1rem;color:var(--text-main);cursor:pointer;transition:border-color .15s ease}
.chill-select:hover{border-color:#cfcfe6}
.chill-select:focus{outline:none;border-color:var(--zoom);box-shadow:0 0 0 4px rgba(63,34,236,.1)}
.chill-select:disabled{opacity:.55;cursor:default}
.chill-go{display:flex;flex-wrap:wrap;gap:.6rem;margin-top:1.5rem}
.chill-go .btn-primary{flex:1 1 auto;justify-content:center}

/* ---------- typing screen ---------- */
.chill-run{position:relative;padding-top:clamp(.5rem,4vh,2.5rem)}
.chill-top{position:relative;display:flex;justify-content:center;margin-bottom:clamp(1.2rem,5vh,2.6rem)}
.chill-scope{display:inline-block;text-align:center;line-height:1.5;font-size:.88rem;color:var(--text-muted);padding:.4rem .9rem;border-radius:999px;
  border:1px solid transparent;transition:border-color .15s ease,background .15s ease;max-width:100%;min-height:36px}
.chill-scope b{color:var(--text-main);font-weight:600}
.chill-scope:hover,.chill-scope[aria-expanded=true]{border-color:var(--border-soft);background:#fff}
.chill-scope .chev{font-size:.7rem;opacity:.7;margin-left:.3rem}
.chill-pop{position:absolute;top:calc(100% + .4rem);left:50%;transform:translateX(-50%);z-index:30;width:min(360px,calc(100vw - 32px));
  background:#fff;border:1px solid var(--border-soft);border-radius:18px;box-shadow:var(--shadow-md);padding:1rem}
.chill-pop .chill-field{margin-bottom:.7rem}
.chill-pop .chill-select{padding:.55rem 2.2rem .55rem .85rem;font-size:.92rem;border-radius:12px}
.chill-pop-row{display:flex;gap:.5rem;margin-top:.9rem}
.chill-pop-row .btn{flex:1;justify-content:center}

.chill-stage{position:relative;cursor:text}
.chill-text{position:relative;font-family:'JetBrains Mono',ui-monospace,monospace;font-size:clamp(1.12rem,2.6vw,1.5rem);line-height:1.85;
  color:#b3b6c0;white-space:pre-wrap;overflow-wrap:normal;word-break:normal;letter-spacing:0;user-select:none;-webkit-user-select:none;
  transition:opacity .2s ease,filter .2s ease;min-height:5.55em}
.chill-text .w{display:inline-block;white-space:pre}
.chill-text i{font-style:normal}
.chill-text i.c{color:var(--text-main)}
.chill-text i.x{color:var(--busy);text-decoration:underline;text-decoration-color:rgba(250,88,167,.45);text-underline-offset:.22em}
.chill-text i.s{color:#e98bb6;text-decoration:underline dotted rgba(250,88,167,.5);text-underline-offset:.22em}
.chill-text i.sp.x,.chill-text i.sp.s{background:rgba(250,88,167,.16);border-radius:3px;text-decoration:none}
.chill-text i.no{animation:chill-no .16s ease}
@keyframes chill-no{0%,100%{background:transparent}40%{background:rgba(250,88,167,.22)}}
.chill-text.enter{animation:chill-in .22s ease}
@keyframes chill-in{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
.chill-caret{position:absolute;left:0;top:0;width:2px;height:1.3em;margin-top:.27em;border-radius:2px;background:var(--zoom);pointer-events:none;
  will-change:transform;transition:transform 70ms ease-out}
.chill-caret.jump{transition:none}
.chill-caret.idle{animation:chill-blink 1.05s steps(1) infinite}
@keyframes chill-blink{50%{opacity:0}}
.chill-input{position:absolute;inset:0;width:100%;height:100%;opacity:0;font-size:16px;color:transparent;caret-color:transparent;background:transparent;border:0;
  padding:0;margin:0;resize:none;z-index:2;cursor:text;min-height:0!important}
.chill-input:focus-visible{outline:none!important}
.chill-blur{position:absolute;inset:0;display:none;align-items:center;justify-content:center;z-index:1;pointer-events:none;
  font-size:.92rem;color:var(--text-muted);font-weight:600}
.chill-stage.blurred .chill-text{opacity:.35;filter:blur(1.5px)}
.chill-stage.blurred .chill-caret{opacity:0}
.chill-stage.blurred .chill-blur{display:flex}

.chill-stats{display:flex;flex-wrap:wrap;justify-content:center;gap:.4rem 1.6rem;margin-top:clamp(1.4rem,5vh,2.6rem);font-size:.92rem;color:var(--text-muted);
  font-variant-numeric:tabular-nums}
.chill-stats b{color:var(--text-main);font-weight:600;font-size:1.05rem;margin-right:.2rem}
.chill-opts{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:.5rem 1.1rem;margin-top:clamp(1.6rem,6vh,3.4rem);font-size:.82rem;color:var(--text-muted)}
.chill-seg{display:inline-flex;gap:.1rem;align-items:center}
.chill-opts button{min-height:32px;padding:.25rem .6rem;border-radius:999px;color:var(--text-muted);font-weight:500;transition:color .15s ease,background .15s ease}
.chill-opts button:hover{color:var(--text-main)}
.chill-opts button.on{color:var(--zoom);background:rgba(63,34,236,.07);font-weight:600}
.chill-opts .dot{opacity:.35}
.chill-hint{text-align:center;margin-top:.9rem;font-size:.75rem;color:#a3a7b1}
.chill-hint kbd{font-family:'JetBrains Mono',monospace;font-size:.72rem;border:1px solid var(--border-soft);border-radius:5px;padding:.02rem .3rem;background:#fff}

.chill-done{text-align:center;padding:1.5rem 0}
.chill-done h2{font-size:1.6rem;margin-bottom:.4rem}
.chill-done p{color:var(--text-muted)}
.chill-done .chill-go{justify-content:center}
.chill-done .chill-go .btn-primary{flex:0 1 auto}

/* ---------- focus mode: only the paragraph, the caret and quiet stats ---------- */
body.chill-focus .nav,body.chill-focus #saleBanner,body.chill-focus .sale-bar,body.chill-focus .coach,
body.chill-focus .chill-top,body.chill-focus .chill-opts,body.chill-focus .chill-hint,body.chill-focus .footer{display:none!important}
body.chill-focus .chill-run{padding-top:clamp(2rem,16vh,9rem)}
body.chill-focus .chill-text{font-size:clamp(1.2rem,2.9vw,1.75rem)}
body.chill-focus .chill-stats{opacity:.7}
.chill-focus-exit{display:none}
body.chill-focus .chill-focus-exit{display:block;position:fixed;top:12px;right:16px;font-size:.75rem;color:#a3a7b1;min-height:32px;padding:.3rem .7rem;border-radius:999px;z-index:40}
body.chill-focus .chill-focus-exit:hover{color:var(--text-main);background:#fff}

@media (max-width:640px){
  .chill-stats{gap:.3rem 1.1rem;font-size:.85rem}
  .chill-opts{gap:.3rem .5rem}
  .chill-opts .dot{display:none}
  .chill-hint{display:none}
}
@media (prefers-reduced-motion:reduce){
  .chill-caret{transition:none}
  .chill-text.enter,.chill-text i.no{animation:none}
}

/* ---------- entry strip on the subject page ---------- */
.chill-entry{display:flex;align-items:center;gap:.9rem;width:100%;text-align:left;margin:0 0 1.2rem;padding:.8rem 1.1rem;border-radius:16px;
  background:#fff;border:1px solid var(--border-soft);box-shadow:var(--shadow-sm);transition:border-color .15s ease,box-shadow .2s ease}
.chill-entry:hover{border-color:#cfcfe6;box-shadow:var(--shadow-md)}
.chill-entry .ce-ic{font-size:1.5rem;line-height:1;color:var(--zoom)}
.chill-entry .ce-body{flex:1;min-width:0;display:flex;flex-direction:column}
.chill-entry .ce-body b{font-family:'Manrope',sans-serif;font-size:1rem}
.chill-entry .ce-body span{font-size:.86rem;color:var(--text-muted)}
.chill-entry .ce-go{font-size:.86rem;font-weight:600;color:var(--zoom);white-space:nowrap}
