.neurokone-audio {
  border-radius: 30px;
  width: 100%;
}

.neurokone-speedwrap {
  margin-top: -10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.neurokone-speak {
  background-color: #51ac05;
  color: #fff;
  border: 0px;
  border-radius: 999px;
  padding: 10px 16px;
}

.neurokone-stop {
  background-color: #c00;
  color: #fff;
  border: 0px;
  border-radius: 999px;
  padding: 10px 16px;
}


.neurokone-save {
  background-color: #ddd;
  color: #000;
  border: 0px;
  border-radius: 999px;
  padding: 10px 16px;
}

.neurokone-listen {
  background-color: #0052ff;
  color: #fff;
  border: 0px;
  border-radius: 999px;
  padding: 10px 16px;
}

.neurokone-box {
  max-width: 100% !important;
  width: 100%;
  box-sizing: border-box;
  height: auto !important;
  background-color: #fff;
  margin: 0 !important;
  padding: 20px;
  border-radius: 20px;
  border: 10px solid #ddd;
  overflow: hidden;
}

.neurokone-topbar{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items: center;
  margin-bottom:25px;
}

/* --- DESKTOP LAYOUT ---
   Rida 1: speaker + speed
   Rida 2: chapter + (speak/stop kõrvuti)
*/

/* järjestus */
.neurokone-speaker      { order: 10; }
.neurokone-speedwrap    { order: 20; }
.neurokone-chapterwrap  { order: 30; }
.neurokone-save         { order: 40; }
.neurokone-listen       { order: 41; }
.neurokone-speak        { order: 42; }
.neurokone-stop         { order: 43; }

/* sund-reavahetus peale speed'i (et chapter + nupud läheks 2. reale) */
.neurokone-topbar::after{
  content:"";
  flex: 0 0 100%;
  order: 25;
margin-top: 15px;
}

/* Speaker */
.neurokone-speaker {
  width: 25vw;
  padding: 10px;
  border-radius: 10px;
}

/* Speed input */
.neurokone-speed {
  width: 80px;
  padding: 10px;
  border-radius: 10px;
}

/* Chapter + nupud samal real: chapter võtab ülejäänud ruumi */
.neurokone-chapterwrap{
  flex: 1 1 0;
  min-width: 260px;
  max-width: 100%;
  box-sizing: border-box;
margin-top: -24px;
}

.neurokone-chapter{
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 10px;
  border-radius: 10px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Nupud teisel real kõrvuti */
.neurokone-save,
.neurokone-listen,
.neurokone-speak,
.neurokone-stop{
  flex: 0 0 160px;
  width: 160px;
  box-sizing: border-box;
}

/* kui ekraan kitsas, lase nuppudel vajadusel kokku tõmbuda */
@media screen and (max-width: 980px) {
  .neurokone-speak,
  .neurokone-stop{
    flex: 0 0 140px;
    width: 140px;
  }
}

.neurokone-text {
  height: 60vh;
  font-size: 16px !important;
  letter-spacing: 0.02em;
  width: 100%;
  padding: 30px;
  border-radius: 12px;
}

textarea, .neurokone-text {
  color:#000;
}

.neurokone-status{
font-size:14px;
  opacity:.8;
}

/* --- MOBILE LAYOUT ---
   Rida 1: speaker
   Rida 2: speed (täislaius) + chapter (täislaius)
   Rida 3: nupud alati kõrvuti
*/
@media screen and (max-width: 720px) {
  /* 1. rida: speaker + kiirus (joondatud samale reale) */
  .neurokone-speaker {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    box-sizing: border-box;
  }

  .neurokone-speedwrap{
    flex: 0 0 auto;
    width: auto;
  }

  /* 2. rida: peatükk täislaiuses */
  .neurokone-topbar::after{
    content:"";
    flex: 0 0 100%;
    order: 25;
  }

  .neurokone-chapterwrap{
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .neurokone-chapter{
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding-right: 40px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* 3. rida: 4 nuppu kõrvuti (Kuula lõiku / Räägi / Stopp / Salvesta) */
  .neurokone-listen,
  .neurokone-speak,
  .neurokone-stop,
  .neurokone-save{
    flex: 0 0 calc((100% - 30px) / 4);
    width: calc((100% - 30px) / 4);
    padding-left: 0;
    padding-right: 0;
    text-align: center;
    font-size: 12px;
  }
}

@media screen and (min-width: 721px) {
  /* Desktop: joonda 2. rea elemendid ideaalselt ühele horisontaalsele joonele */
  .neurokone-topbar {
    align-items: center;
  }

  /* Ühtlusta chapter select + nupud */
  .neurokone-chapter,
  .neurokone-listen,
  .neurokone-speak,
  .neurokone-stop,
  .neurokone-save {
    height: 44px;
    line-height: 44px;
    padding-top: 0;
    padding-bottom: 0;
  }

  /* Selecti puhul hoiab teksti vertikaalselt keskel ja jätab noolele ruumi */
  .neurokone-chapter {
    padding-left: 10px;
    padding-right: 40px;
  }
}


.neurokone-text::selection {
  background: #ffe680;
  color: #000;
}
.neurokone-text::-moz-selection {
  background: #ffe680;
  color: #000;
}
