* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: lightyell;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

textarea {
  display: block;
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  resize: none;
  background: #fffcf9;
  color: #2e2b27;
  font-family: inherit;
  font-size: 1.15rem;
  line-height: 1.6;
  letter-spacing: 0.01em;
  caret-color: #b0a79b;
  padding: 0;
  margin: 2%;
}

textarea::placeholder {
  color: #c5bdb3;
  font-style: italic;
  font-weight: 300;
}

#saveStatus {
  position: fixed;
  right: 0.75rem;
  bottom: 0.5rem;
  font-size: 0.75rem;
  font-family: ui-monospace, 'SF Mono', monospace;
  color: transparent;
  pointer-events: none;
  transition: color 0.2s;
}
#saveStatus.saving { color: #c9a227; }
#saveStatus.saved  { color: #6a9a5b; }
#saveStatus.error  { color: #c25b5b; }
#micBtn {
  position: fixed;
  right: 0.75rem;
  bottom: 0.5rem;
  width: 2.4rem;
  height: 2.4rem;
  border: none;
  border-radius: 50%;
  background: #f1ede8;
  color: #6b6259;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.55;
}
#micBtn:hover { opacity: 1; }
#micBtn:active { transform: scale(0.92); }

#micBtn.on {
  opacity: 1;
  background: #e26b6b;
  color: #fff;
  animation: micPulse 1.4s ease-in-out infinite;
}

@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(226, 107, 107, 0.55); }
  50%      { box-shadow: 0 0 0 10px rgba(226, 107, 107, 0); }
}

/* push the save-status up a touch so it doesn't collide */
#saveStatus { bottom: 3.25rem; }
/* ---------- block caret ---------- */
#caret {
  position: fixed;
  pointer-events: none;
  z-index: 10;
  background: #ffd93b;
  mix-blend-mode: multiply;
  border-radius: 1px;
  animation: caretBlink 1s steps(1) infinite;
}

#caret {
  position: fixed;
  pointer-events: none;
  z-index: 10;
  background: #e0342c;              /* red */
  border-radius: 2px;
  animation: caretBlink 1s steps(1) infinite;
  will-change: left, top, width, height;
}

/* at end of line / blank line: still a thicker red bar */
#caret.between-lines {
  width: 4px !important;
  background: #e0342c;
}

@keyframes caretBlink {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* hide the real caret so only the yellow block shows */
#noteInput {
  caret-color: transparent;
}