.scrim {
  position: absolute;
  inset: 0;
  background: rgba(1, 4, 9, .65);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  z-index: 80;
  animation: fadein .25s both;
}

.scrim.out {
  animation: fadeout .25s both;
}

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--kb, 0px);
  z-index: 81;
  touch-action: pan-y;
  background: linear-gradient(#0a121c, #060b12);
  border-top: 1px solid var(--line-2);
  padding: 10px 18px calc(var(--sb) + 8px);
  box-shadow: 0 -20px 50px rgba(0, 0, 0, .5);
  animation: sheetin .38s cubic-bezier(.2, .9, .25, 1) both;
  max-height: 88%;
  overflow: auto;
  scrollbar-width: none;
}

.sheet.out {
  animation: sheetout .26s ease-in both;
}

@keyframes sheetin {
  from {
    transform: translateY(100%);
  }
}

@keyframes sheetout {
  to {
    transform: translateY(100%);
  }
}

.sheet .grab {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .2);
  margin: 0 auto 16px;
  box-shadow: 0 0 0 14px transparent;
}

.sheet.drag {
  animation: none;
  transition: none;
}

.sheet.snap {
  transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}

.sheet textarea.err {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(255, 77, 106, .12);
}

.sheet h3 {
  font-size: 20px;
  font-weight: 700;
  margin: 6px 0 4px;
}

.sheet .x {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-dim);
  color: var(--muted);
}

.sheet textarea {
  width: 100%;
  min-height: 120px;
  resize: none;
  border: 1px solid var(--line);
  background: rgba(3, 8, 18, .7);
  padding: 12px 14px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text);
  outline: none;
  margin-top: 14px;
}

.sheet textarea:focus {
  border-color: var(--cyan);
}

.qs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 12px -18px 0;
  padding: 0 18px;
  scrollbar-width: none;
}

.qs::-webkit-scrollbar {
  display: none;
}

.mic-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0 16px;
}

.mic {
  width: 46px;
  height: 46px;
  flex: none;
  border: 1px solid var(--line-2);
  display: grid;
  place-items: center;
  color: var(--cyan-soft);
  position: relative;
}

.mic svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}

.mic.rec {
  border-color: var(--red);
  color: var(--red);
}

.mic.rec::after {
  content: "";
  position: absolute;
  inset: -1px;
  border: 1px solid var(--red);
  animation: ringpulse 1.2s ease-out infinite;
  border-radius: 0;
}

.wave-bars {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 24px;
}

.wave-bars i {
  width: 3px;
  background: var(--red);
  border-radius: 2px;
  animation: wv .8s ease-in-out infinite;
  animation-delay: calc(var(--i) * -.11s);
  height: 6px;
}

@keyframes wv {
  50% {
    height: 22px;
  }
}

.ai-box {
  margin-top: 14px;
  border: 1px dashed rgba(130, 231, 238, .4);
  background: rgba(34, 211, 238, .04);
  padding: 14px;
  min-height: 150px;
}

.ai-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--cyan-soft);
  text-transform: uppercase;
}

.ai-tag img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.ai-text {
  font-size: 14.5px;
  line-height: 1.55;
  margin: 10px 0 0;
  color: var(--text-2);
  white-space: pre-line;
  position: relative;
}

.ai-text .ghost {
  visibility: hidden;
}

.ai-text .typed {
  position: absolute;
  inset: 0;
}

.caret {
  display: inline-block;
  width: 7px;
  height: 15px;
  background: var(--cyan);
  vertical-align: -2px;
  margin-left: 2px;
  animation: blink .8s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.typing {
  display: flex;
  gap: 5px;
  margin-top: 14px;
}

.typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan-soft);
  animation: tdot 1s infinite;
  animation-delay: calc(var(--i) * .15s);
}

@keyframes tdot {
  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
  0%, 60%, 100% {
    opacity: .4;
  }
}

.ai-box + .btn {
  margin-top: 16px;
}

/* Утренний чек-ин */
.ci-moods {
  margin-top: 12px;
}

.ci-scale {
  display: block;
  margin-top: 18px;
}

.ci-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-2);
}

.ci-val {
  letter-spacing: .02em;
  color: var(--muted);
}

.ci-val b {
  font-size: 15px;
  color: var(--cyan-soft);
  font-variant-numeric: tabular-nums;
}

.ci-scale input {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 28px;
  margin: 6px 0 0;
  background: transparent;
  cursor: pointer;
}

.ci-scale input::-webkit-slider-runnable-track {
  height: 4px;
  background: linear-gradient(90deg, var(--cyan) var(--fill), rgba(244, 247, 251, .12) var(--fill));
}

.ci-scale input::-moz-range-track {
  height: 4px;
  background: linear-gradient(90deg, var(--cyan) var(--fill), rgba(244, 247, 251, .12) var(--fill));
}

.ci-scale input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -7px;
  border: 2px solid var(--cyan);
  background: var(--bg);
  box-shadow: 0 0 12px -2px rgba(34, 211, 238, .8);
}

.ci-scale input::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 2px solid var(--cyan);
  border-radius: 0;
  background: var(--bg);
  box-shadow: 0 0 12px -2px rgba(34, 211, 238, .8);
}

.ci-scale input:focus-visible {
  outline: 1px solid var(--cyan);
  outline-offset: 2px;
}

.ci-ends {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
}

.ci-moods.locked,
.ci-scale.locked {
  opacity: .6;
}

#ciSummary {
  margin-top: 16px;
}

#ciSave,
#ciSummary + .btn {
  margin-top: 18px;
}

/* Планирование действия */
.plan-days {
  margin: 14px 0 12px;
}

/* Значение фиксированной ширины: ползунок не сдвигается при смене 9 → 10 */
.ci-val b {
  display: inline-block;
  min-width: 2ch;
  text-align: right;
}

.ci-val {
  white-space: nowrap;
}

/* ---------- Листы в стиле концепта: скругления, подсказки переносятся, а не обрезаются ---------- */
.sheet {
  border-radius: 18px 18px 0 0;
}

.sheet .x,
.mic {
  border-radius: 10px;
}

.sheet textarea {
  border-radius: 10px;
}

.qs {
  flex-wrap: wrap;
  overflow: visible;
  margin: 12px 0 0;
  padding: 0;
}
