@font-face {
  font-family: "Teko";
  src: url("fonts/Teko.ttf") format("truetype");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --red: #a4463e;
  --red-hover: #c65349;
  --bg: #fff;
  --fg: #000;
  --muted: #6b6b6b;
  --panel: #f3f3f3;
  --line: #e2e2e2;
  --card: #fff;
}
body.darkbackground {
  --bg: #181818;
  --fg: #fff;
  --muted: #a0a0a0;
  --panel: #222;
  --line: #333;
  --card: #1f1f1f;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
}
body {
  font-family: "Teko", sans-serif;
  background: var(--bg);
  color: var(--fg);
  transition: background 0.3s ease, color 0.3s ease;
}
body.modal-open {
  overflow: hidden;
}
button,
select,
input {
  font-family: inherit;
}

#app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 1rem 0;
}

.eyebrow {
  margin: 0;
  color: var(--red);
  font-size: 1.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1;
}
#timer {
  margin: 0.1rem 0 1.2rem;
  font-size: 4.6rem;
  font-weight: 400;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* record button */
.rec {
  position: relative;
  width: 112px;
  height: 112px;
  border: none;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 18px rgba(164, 70, 62, 0.35);
  transition: transform 0.2s ease-in-out, background-color 0.2s ease-in-out, box-shadow 0.2s;
}
.rec:hover:not(:disabled) {
  background: var(--red-hover);
  transform: translateY(-2px);
}
.rec:active:not(:disabled) {
  transform: scale(0.97);
}
.rec:disabled {
  background: #9a9a9a;
  box-shadow: none;
  cursor: default;
}
.rec:focus-visible,
.actions button:focus-visible,
.card button:focus-visible,
.gear:focus-visible,
.tools button:focus-visible {
  outline: 3px solid var(--fg);
  outline-offset: 3px;
}
.rec svg {
  width: 46px;
  height: 46px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.rec .ic-stop {
  display: none;
  fill: currentColor;
  stroke: none;
}
.rec.on .ic-mic {
  display: none;
}
.rec.on .ic-stop {
  display: block;
}
.rec.on::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid var(--red);
  animation: pulse 1.6s ease-out infinite;
}
@keyframes pulse {
  from {
    transform: scale(1);
    opacity: 0.8;
  }
  to {
    transform: scale(1.45);
    opacity: 0;
  }
}
.rec-label {
  margin-top: 0.5rem;
  font-size: 1.6rem;
  line-height: 1;
}

.status {
  margin: 0.8rem 0 0;
  min-height: 1.6rem;
  font-size: 1.4rem;
  line-height: 1.1;
  color: var(--muted);
  text-align: center;
}
.status[data-kind="live"] {
  color: var(--red);
}
.status[data-kind="error"] {
  color: var(--red);
  font-weight: 500;
}

/* transcript */
.tbox {
  position: relative;
  width: 100%;
  margin-top: 1.4rem;
}
.transcript {
  position: relative;
  width: 100%;
  height: clamp(220px, 40vh, 440px);
  padding: 1rem 3.4rem 1rem 1.1rem;
  overflow-y: auto;
  background: var(--panel);
  border-radius: 8px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.05rem;
  line-height: 1.55;
  user-select: text;
}
.transcript p {
  margin: 0 0 0.55rem;
}
.transcript .ts {
  color: var(--red);
  font-family: "Teko", sans-serif;
  font-size: 1.15rem;
  margin-right: 0.3rem;
}
.transcript.empty-unused::before {
  content: "Your words will appear here.";
  color: var(--muted);
  font-family: "Teko", sans-serif;
  font-size: 1.4rem;
}
.is-recording .transcript {
  box-shadow: inset 0 0 0 2px var(--red);
}

/* footer (same as NoSleep) */
.foot {
  margin-top: auto;
  padding: 1.2rem 0 0.6rem;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.4rem 1rem;
  font-weight: bold;
  font-size: 1.15rem;
}
.foot p {
  margin: 0;
}
.foot-a {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.5rem;
  align-items: center;
}
.foot-b {
  display: flex;
  gap: 4px;
  justify-content: center;
}
.foot-c {
  display: flex;
  justify-content: flex-end;
}
.foot a {
  color: var(--red);
}
@media (max-width: 640px) {
  .foot {
    grid-template-columns: 1fr auto;
  }
  .foot-a {
    grid-column: 1 / -1;
    justify-content: center;
    order: -1;
  }
  .foot-b {
    justify-content: flex-start;
  }
  .settings {
    right: 0.6rem;
  }
  #timer {
    font-size: 3.4rem;
  }
}

/* link hover effect from NoSleep */
.ti_hover_effect {
  background: linear-gradient(to right, #a4463e, #a4463e 50%, #000 50%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% 100%;
  background-position: 100%;
  transition: background-position 275ms ease;
  text-decoration: none;
}
.ti_hover_effect:hover {
  background-position: 0 100%;
}
body.darkbackground .ti_hover_effect {
  background-image: linear-gradient(to right, #a4463e, #a4463e 50%, #fff 50%);
}
.sep {
  color: var(--muted);
}

/* switch (same as NoSleep) */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
  cursor: pointer;
  border-radius: 34px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.switch.small {
  transform: scale(0.8);
}
.switch:hover {
  box-shadow: 0 0 12px rgba(164, 70, 62, 0.2);
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  inset: 0;
  background-color: #ccc;
  border-radius: 34px;
  transition: background-color 0.4s ease;
}
.slider.round:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: #fff;
  border-radius: 50%;
  transition: transform 0.4s ease, box-shadow 0.3s ease;
}
input:checked + .slider {
  background-color: var(--red);
}
input:checked + .slider:before {
  transform: translateX(26px);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
}
input:focus-visible + .slider {
  box-shadow: 0 0 0 3px var(--fg);
}

/* modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.6);
  overflow-y: auto;
}
.modal[hidden] {
  display: none;
}
.card {
  width: 100%;
  max-width: 400px;
  margin: auto;
  padding: 1.5rem 1.4rem 1.2rem;
  background: var(--card);
  color: var(--fg);
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.card h2 {
  margin: 0 0 0.6rem;
  font-size: 2.4rem;
  font-weight: 500;
  line-height: 1;
}
.agree {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 1.25rem;
  line-height: 1.15;
  cursor: pointer;
}
.agree input {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.1rem;
  accent-color: var(--red);
}
.agree a {
  color: var(--red);
}
.card button {
  display: block;
  width: 100%;
  margin: 1rem 0 0;
  padding: 0.35rem 1rem;
  font-size: 1.6rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%) scale(0.95);
  background: #222;
  color: #fff;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 1.2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 60;
}
.toast.visible {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.visually-hidden {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .rec.on::after {
    animation: none;
  }
}

/* tools inside the transcript box */
.tools {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.tools[hidden] {
  display: none;
}
.tbox:hover .tools,
.tbox:focus-within .tools {
  opacity: 1;
}
@media (hover: none) {
  .tools {
    opacity: 0.85;
  }
}
.tools button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  transition: color 0.2s, background-color 0.2s, transform 0.2s;
}
.tools button:hover {
  color: #fff;
  background: var(--red);
  transform: translateY(-1px);
}
.tools button.armed {
  color: #fff;
  background: var(--red);
}
.tools svg,
.gear svg,
.steps svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* start popup */
.card {
  text-align: center;
}
.card .eyebrow {
  font-size: 1.2rem;
}
.card h2 {
  margin: 0.2rem 0 1rem;
  font-size: 2.6rem;
}
.steps {
  margin: 0 0 1.2rem;
  padding: 0;
  list-style: none;
  text-align: left;
}
.steps li {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  padding: 0.55rem 0;
  font-size: 1.35rem;
  line-height: 1.1;
}
.steps li + li {
  border-top: 1px solid var(--line);
}
.steps svg {
  flex: none;
  box-sizing: content-box;
  width: 20px;
  height: 20px;
  padding: 7px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
}
.steps b {
  display: block;
  font-weight: 600;
  font-size: 1.5rem;
}
.agree {
  text-align: left;
}

/* footer icons */
.iconbtn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, background-color 0.2s;
}
.iconbtn:hover {
  color: var(--red);
  background: var(--panel);
}
.iconbtn:focus-visible {
  outline: 3px solid var(--fg);
}
.iconbtn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.foot-c {
  gap: 0.3rem;
  align-items: center;
}

/* popup modes: first = steps + fields + consent, info = steps, settings = fields */
.card {
  position: relative;
}
.card .close {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  left: auto;
  margin: 0;
  box-shadow: none;
  transform: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.card .close:hover:not(:disabled) {
  color: var(--red);
  background: var(--panel);
  transform: none;
}
.close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.modal[data-mode="first"] .close {
  display: none;
}
.modal[data-mode="info"] .sec-fields,
.modal[data-mode="info"] .sec-agree,
.modal[data-mode="settings"] .sec-steps,
.modal[data-mode="settings"] .sec-agree,
.modal[data-mode="settings"] .sec-info,
.modal[data-mode="first"] .sec-info {
  display: none;
}
.fields {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0 0 1.1rem;
  font-size: 1.4rem;
  line-height: 1;
  text-align: left;
}
.fields label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.fields select {
  font-size: 1.15rem;
  color: var(--fg);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.25rem 0.5rem;
  max-width: 190px;
}
.fields select:disabled {
  opacity: 0.5;
}
.fields .check {
  justify-content: flex-start;
  gap: 0.5rem;
}
.fields .check input {
  accent-color: var(--red);
  width: 1.1rem;
  height: 1.1rem;
}
.more {
  margin: 0.4rem 0 0;
  font-size: 1.25rem;
}
.more a {
  color: var(--red);
}
.modal[data-mode="settings"] .card h2,
.modal[data-mode="info"] .card h2 {
  margin-bottom: 0.8rem;
}

/* ---- clean layout (NoSleep-like): one centred cluster, edge footer, no labels ---- */
#app {
  max-width: none;
  justify-content: center;
  padding: 1rem 1rem 3.2rem;
  position: relative;
}
#timer {
  margin: 0 0 1.6rem;
  font-size: 4rem;
}
.rec {
  width: 96px;
  height: 96px;
  box-shadow: 0 0 0 calc(var(--lvl, 0) * 16px) rgba(164, 70, 62, 0.22), 0 6px 18px rgba(164, 70, 62, 0.3);
}
.rec svg {
  width: 40px;
  height: 40px;
}
.status {
  margin: 1.1rem 0 0;
  min-height: 0;
  font-size: 1.3rem;
}
.status:empty {
  display: none;
}
.bar {
  width: min(220px, 60%);
  height: 6px;
  margin-top: 0.7rem;
  border-radius: 6px;
  background: var(--panel);
  overflow: hidden;
}
.bar[hidden] {
  display: none;
}
.bar div {
  height: 100%;
  width: 0;
  background: var(--red);
  transition: width 0.25s ease;
}
.tbox {
  width: min(640px, 100%);
  margin-top: 2rem;
}
.tbox[hidden] {
  display: none;
}
.transcript {
  height: auto;
  min-height: 3.5rem;
  max-height: min(42vh, 420px);
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line);
  padding: 0.9rem 3.2rem 0.5rem 1.1rem;
}
.is-recording .transcript {
  box-shadow: inset 0 0 0 1px var(--red);
}
.foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 1rem 0.6rem;
  font-size: 1rem;
  font-weight: 400;
}
.foot-a {
  gap: 0.15rem 0.5rem;
}
.foot a,
.ti_hover_effect {
  text-decoration: underline;
}
.iconbtn {
  width: 28px;
  height: 28px;
}
.iconbtn svg {
  width: 18px;
  height: 18px;
}
.foot-c {
  gap: 0.1rem;
}
@media (max-width: 640px) {
  .foot {
    grid-template-columns: 1fr auto;
    row-gap: 0.1rem;
  }
  #timer {
    font-size: 3.4rem;
  }
}

/* popup: lighter */
.card {
  padding: 1.3rem 1.3rem 1.1rem;
}
.card h2 {
  font-size: 2.3rem;
  margin-bottom: 0.7rem;
}
.steps li {
  padding: 0.45rem 0;
  font-size: 1.25rem;
}
.steps li + li {
  border-top: none;
}
.steps b {
  font-size: 1.4rem;
}

/* ---- popup: small and plain ---- */
.modal[data-mode="first"] .sec-fields {
  display: none;
}
.card {
  max-width: 340px;
  padding: 1.3rem 1.4rem 1.2rem;
  text-align: center;
}
.card h2 {
  margin: 0 0 0.7rem;
  font-size: 1.9rem;
  font-weight: 500;
}
.steps {
  margin: 0 0 0.9rem;
  text-align: left;
}
.steps li {
  position: relative;
  display: block;
  padding: 0.15rem 0 0.15rem 1.1rem;
  font-size: 1.2rem;
  line-height: 1.15;
}
.steps li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
}
.agree {
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 1.1rem;
  line-height: 1.1;
}
.agree input {
  width: 1.05rem;
  height: 1.05rem;
}
.card #go {
  display: inline-block;
  width: auto;
  margin: 1rem auto 0;
  padding: 0.25rem 1.8rem;
  font-size: 1.25rem;
}
.fields {
  gap: 0.5rem;
  margin-bottom: 0.3rem;
  font-size: 1.2rem;
}
.fields select {
  font-size: 1rem;
  padding: 0.2rem 0.45rem;
  max-width: 170px;
}
.card .more {
  font-size: 1.1rem;
}

.card #go {
  background-color: var(--red);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease-in-out;
}
.card #go:hover:not(:disabled) {
  background-color: var(--red-hover);
  transform: translateY(-2px);
}
.card #go:disabled {
  background: #9a9a9a;
  cursor: default;
}
.modal[data-mode="settings"] #go,
.modal[data-mode="info"] #go {
  display: none;
}
.card:focus {
  outline: none;
}

/* dots centred on the text line */
.sep {
  display: inline-block;
  flex: none;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
  font-size: 0;
  line-height: 0;
  overflow: hidden;
  align-self: center;
  transform: translateY(-1.5px);
}
.steps li::before {
  top: 0.52em;
}

/* ---- v2: tools above the text, centred text, options, confirm ---- */
.tbox {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.is-recording .tbox {
  box-shadow: inset 0 0 0 1px var(--red);
}
.tbox .tools {
  position: static;
  flex-direction: row;
  justify-content: flex-end;
  gap: 0.1rem;
  padding: 0.35rem 0.45rem 0;
  opacity: 1;
}
.tbox .tools[hidden] {
  display: none;
}
.tbox .tools button {
  width: 30px;
  height: 30px;
  background: transparent;
  box-shadow: none;
}
.tbox .tools button:hover {
  background: var(--red);
  color: #fff;
}
.tbox .tools svg {
  width: 17px;
  height: 17px;
}
.tbox .tools button:disabled {
  opacity: 0.35;
  pointer-events: none;
}
.tbox .transcript {
  box-shadow: none;
  border-radius: 0;
  background: transparent;
  padding: 0.3rem 1.2rem 1rem;
  text-align: center;
}
.is-recording .transcript {
  box-shadow: none;
}

/* popup modes */
.modal[data-mode="first"] .sec-fields {
  display: flex;
}
.modal[data-mode="first"] .opt-adv {
  display: none;
}
.only-info {
  display: none;
}
.modal[data-mode="info"] .only-info {
  display: block;
}
.sec-confirm {
  display: none;
}
.modal[data-mode="confirm"] .sec-confirm {
  display: block;
}
.modal[data-mode="confirm"] .sec-steps,
.modal[data-mode="confirm"] .sec-fields,
.modal[data-mode="confirm"] .sec-agree,
.modal[data-mode="confirm"] .sec-info {
  display: none;
}
.sec-confirm p {
  margin: 0 0 1rem;
  font-size: 1.2rem;
  line-height: 1.15;
}
.confirm-row {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
}
.cbtn {
  padding: 0.25rem 1.5rem;
  border: none;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}
.cbtn:hover {
  background: var(--red-hover);
  transform: translateY(-2px);
}
.cbtn.ghost {
  background: var(--panel);
  color: var(--fg);
}
.cbtn.ghost:hover {
  background: var(--line);
}
.hint {
  margin: 0;
  font-size: 1rem;
  line-height: 1.1;
  color: var(--muted);
}
.storage {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
  font-size: 1.15rem;
}
.storage span {
  flex: 1;
  color: var(--muted);
}
.storage b {
  font-weight: 500;
}
.linkbtn {
  padding: 0;
  border: none;
  background: none;
  color: var(--red);
  font-size: 1.15rem;
  text-decoration: underline;
  cursor: pointer;
}
.fields select option:disabled {
  color: #999;
}

/* small screens */
@media (max-width: 520px) {
  .tbox {
    width: 100%;
  }
  .tbox .transcript {
    padding: 0.3rem 0.9rem 0.9rem;
  }
  .card {
    max-width: 100%;
  }
  .fields select {
    max-width: 150px;
  }
}

/* v2 fixes */
.steps li.only-info {
  display: none;
}
.modal[data-mode="info"] .steps li.only-info {
  display: block;
}
.modal[data-mode="confirm"] #go {
  display: none;
}
.card .cbtn,
.card .linkbtn {
  width: auto;
  margin: 0;
  display: inline-block;
  box-shadow: none;
}
.card .cbtn {
  flex: 1;
  max-width: 160px;
  padding: 0.3rem 1rem;
}
.card .linkbtn {
  padding: 0;
  background: none;
  color: var(--red);
  font-size: 1.15rem;
}
.card .linkbtn:hover {
  background: none;
  transform: none;
  text-decoration: none;
}
.storage span {
  white-space: nowrap;
}

/* ---- v3: phone footer, centred and tidy ---- */
@media (max-width: 640px) {
  #app {
    padding-bottom: 8rem;
  }
  .foot {
    grid-template-columns: 1fr;
    justify-items: center;
    row-gap: 0.5rem;
    padding: 0 1rem 1rem;
  }
  .foot-c {
    order: 1;
    justify-content: center;
    gap: 0.5rem;
  }
  .foot-a {
    order: 2;
    grid-column: auto;
    justify-content: center;
    gap: 0.15rem 0.7rem;
  }
  .foot-b {
    order: 3;
    justify-content: center;
    opacity: 0.8;
  }
}

/* reset next to the timer */
.timer-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.timer-row .tr {
  position: absolute;
  left: 100%;
  margin-left: 0.4rem;
  margin-top: -1rem;
}
.timer-row .tr[hidden] {
  display: none;
}

/* audio source switches */
.fields label.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.fields .switch.small {
  flex: none;
  transform: scale(0.75);
  transform-origin: right center;
  margin-left: -0.6rem;
}
.fields .switch input:disabled + .slider {
  opacity: 0.45;
  cursor: default;
}

.modal[data-mode="first"] .fields {
  margin-bottom: 1rem;
}

/* box with only the tools (recording kept, no text yet) */
.tbox .transcript.empty {
  min-height: 0;
  height: 0;
  padding: 0;
  overflow: hidden;
}
.tbox .tools {
  padding-bottom: 0.35rem;
}
.tbox .transcript:not(.empty) {
  padding-top: 0.1rem;
}

/* new text fades in */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.transcript .fade-in {
  animation: fadeIn 0.7s ease both;
}
@media (prefers-reduced-motion: reduce) {
  .transcript .fade-in {
    animation: none;
  }
}

/* voices */
.transcript .spk {
  display: inline-block;
  margin-right: 0.35rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  background: var(--spk, var(--red));
  color: #fff;
  font-family: "Teko", sans-serif;
  font-size: 1.05rem;
  line-height: 1.35;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.2s;
}
.transcript .spk:hover {
  opacity: 0.8;
}
.rename {
  width: 100%;
  margin: 0 0 1rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--fg);
  font-family: inherit;
  font-size: 1.2rem;
}
.rename[hidden] {
  display: none;
}

/* Voices is built but hidden for now: remove this rule (and the forced "off" in app.js init) to bring it back */
.voices-off {
  display: none !important;
}
