/* «Откуда записывать?» над кнопкой «Записать», выбор строки и отсчёт 3-2-1 (static/recstart.js) */
.rst-pop {
  position: fixed; z-index: 1200; width: 340px; max-width: calc(100vw - 24px); box-sizing: border-box;
  padding: 14px; border-radius: var(--radius); border: 1px solid var(--border-2);
  background: var(--surface-2); color: var(--text); box-shadow: var(--shadow);
  animation: rst-in .16s cubic-bezier(.2, .8, .2, 1);
}
.rst-pop.out { opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; }
.rst-pop::after {
  content: ""; position: absolute; left: var(--arrow, 50%); bottom: -6px; width: 10px; height: 10px; margin-left: -5px;
  background: var(--surface-2); border-right: 1px solid var(--border-2); border-bottom: 1px solid var(--border-2);
  transform: rotate(45deg);
}
.rst-pop.below::after { bottom: auto; top: -6px; transform: rotate(225deg); }

.rst-head { display: flex; align-items: center; gap: 10px; padding: 0 2px 10px; }
.rst-head b { font-size: 15px; line-height: 1.3; }
.rst-ic {
  flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: color-mix(in srgb, var(--miss) 18%, transparent); color: var(--miss);
}
.rst-ic svg { width: 16px; height: 16px; }

.rst-list { display: flex; flex-direction: column; gap: 4px; }
.rst-opt {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; text-align: left;
  border: 0; border-radius: 12px; background: transparent; color: var(--text); font: inherit; cursor: pointer;
  transition: background-color .12s ease;
}
.rst-opt:hover, .rst-opt:focus-visible { background: var(--glass-2); outline: none; }
.rst-opt:first-child { background: var(--glass); }
.rst-opt:first-child:hover, .rst-opt:first-child:focus-visible { background: var(--glass-2); }
.rst-oic {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px;
  background: var(--surface); color: var(--muted);
}
.rst-oic svg { width: 17px; height: 17px; }
.rst-opt:first-child .rst-oic { color: var(--miss); }
.rst-otx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rst-otx b { font-size: 14px; font-weight: 600; }
.rst-sub { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rst-t { font-variant-numeric: tabular-nums; color: var(--faint); }
.rst-lyr { color: var(--muted); }
.rst-note { flex: none; font-size: 11px; color: var(--faint); }
.rst-foot { padding: 8px 4px 0; }
.rst-key { font-size: 11px; color: var(--faint); }

/* выбор строки */
.rst-pick { display: flex; flex-direction: column; gap: 6px; padding: 0 2px; }
.rst-hint { font-size: 13px; line-height: 1.45; color: var(--muted); }
.rst-chosen { display: flex; gap: 8px; align-items: baseline; font-size: 13px; font-weight: 600; margin-top: 2px; }
.rst-chosen .rst-ln { color: var(--miss); }
.rst-lyr.big { font-size: 15px; line-height: 1.35; color: var(--text); }
.rst-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.rst-go svg { width: 14px; height: 14px; margin-right: 6px; color: var(--miss); }
.rst-go:disabled { opacity: .45; cursor: default; }

/* строка, с которой начнётся запись */
.line.rst-mark { box-shadow: inset 3px 0 0 var(--miss); background: color-mix(in srgb, var(--miss) 10%, transparent); }
.line.rst-mark .num { background: var(--miss); color: var(--ink); }

/* отсчёт */
.rst-pop.rst-counting { width: auto; min-width: 260px; padding: 12px 14px; }
.rst-count { display: flex; align-items: center; gap: 14px; }
.rst-num {
  flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  background: var(--miss); color: var(--ink); font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.rst-num.tick { animation: rst-tick .35s cubic-bezier(.2, .8, .2, 1); }
.rst-ctx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rst-ctx b { font-size: 14px; }
#recBtn.rst-arming { background: color-mix(in srgb, var(--miss) 22%, transparent); }

/* телефон: снизу во всю ширину */
.rst-pop.sheet { left: 12px !important; right: 12px; top: auto !important; bottom: 12px; width: auto; max-width: none; }
.rst-pop.sheet::after { display: none; }
.rst-pop.sheet .rst-btns .btn { flex: 1; height: 40px; }
.rst-pop.sheet .rst-foot { display: none; }

@keyframes rst-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes rst-tick { from { transform: scale(1.25); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .rst-pop, .rst-num.tick { animation: none; } .rst-pop.out { transition: none; } }
