/* /var/www/pozdravlyayka-stage/current/public/styles/voice.css */

/* ───────────────────────── anti-overflow fixes (mobile) ───────────────────────── */
.voice-page,
.page-main,
.col-right,
.voice-card,
.voice-history,
.voice-card *,
.voice-history *{
  box-sizing: border-box;
}

.voice-page{ overflow-x: hidden; }
html, body{ overflow-x: hidden; }

.col-right,
.voice-card,
.voice-history{
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 900px){
  .two-col.page-main{ display:block !important; }
  .two-col.page-main .col-left{ display:none !important; }
  .two-col.page-main .col-right{ width:100% !important; max-width:100% !important; }
}

/* ───────────────────────── base ───────────────────────── */

.voice-card{
  padding: 18px;
  color: var(--text);
}

.voice-title{ letter-spacing: -0.2px; }
.voice-sub{ margin: 8px 0 0; max-width: 62ch; }

/* ───────────────────────── hero ───────────────────────── */

.voice-hero{
  padding: 14px 14px 12px;
  border-radius: 18px;
  border: 1px solid color-mix(in oklab, var(--border) 55%, transparent);
  background: color-mix(in oklab, var(--surface-2) 88%, var(--surface) 12%);
  box-shadow: var(--shadow-sm, 0 10px 26px rgba(15, 23, 42, .06));
}

.voice-hero-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

/* timer */
.voice-timer{
  height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 6px;

  font-variant-numeric: tabular-nums;
  padding: 0 14px;
  border-radius: 999px;

  border: 1px solid color-mix(in oklab, var(--border) 55%, transparent);
  background: color-mix(in oklab, var(--surface) 78%, var(--surface-2) 22%);
  box-shadow: var(--shadow-sm, 0 10px 26px rgba(15, 23, 42, .06));
}

/* ───────────────────────── steps ───────────────────────── */

.voice-step{
  margin-top: 16px; /* было 14px */
  padding: 14px;
  border-radius: 18px;
  border: 1px solid color-mix(in oklab, var(--border) 55%, transparent);
  background: var(--surface);
  box-shadow: var(--shadow-sm, 0 12px 30px rgba(15, 23, 42, .06));
}

.voice-step-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.voice-step-kicker{
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .25px;
  text-transform: uppercase;
  color: var(--muted);
}

.voice-step-title{
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.2px;
  color: var(--heading);
  margin-top: 2px;
}

.voice-step-sub{ margin-top: 6px; } /* было 4px */

.voice-step-actions{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items:center;
}

.voice-recbtn{ min-width: 190px; }

/* inside step blocks */
.voice-block{
  padding: 12px;
  border-radius: 16px;
  border: 1px solid color-mix(in oklab, var(--border) 55%, transparent);
  background: color-mix(in oklab, var(--surface) 86%, var(--surface-2) 14%);
  min-width: 0;
}

.voice-block-title{
  font-weight: 900;
  margin-bottom: 10px;
  color: var(--heading);
}

.voice-hint{ margin-top: 10px; }

/* ───────────────────────── details: "Как это работает" ───────────────────────── */

.voice-how{
  margin-top: 16px;
  border-radius: 18px;
  border: 1px solid color-mix(in oklab, var(--border) 55%, transparent);
  background: color-mix(in oklab, var(--surface-2) 88%, var(--surface) 12%);
  box-shadow: var(--shadow-sm, 0 10px 26px rgba(15, 23, 42, .06));
  overflow: hidden;
}

.voice-how > summary{
  list-style: none;
  cursor: pointer;

  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;

  padding: 12px 14px;
  font-weight: 900;
  color: var(--heading);

  background: color-mix(in oklab, var(--surface-2) 86%, var(--surface) 14%);
  border-bottom: 1px solid color-mix(in oklab, var(--border) 55%, transparent);
}

.voice-how > summary::-webkit-details-marker{ display:none; }

.voice-how > summary::after{
  content: "▾";
  opacity: .8;
  transform: translateY(-1px);
  transition: transform .18s ease;
}

.voice-how[open] > summary::after{
  transform: rotate(180deg);
}

.voice-how > ol{
  margin: 0;
  padding: 12px 16px 14px 22px;
}

.voice-how > ol li{ margin: 6px 0; }

/* ───────────────────────── settings ───────────────────────── */

.voice-settings{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  min-width: 0;
}

.voice-panel{
  padding: 12px;
  border-radius: 16px;
  border: 1px solid color-mix(in oklab, var(--border) 55%, transparent);
  background: color-mix(in oklab, var(--surface) 92%, var(--surface-2) 8%);
  min-width: 0;
}

.voice-panel-head{ margin-bottom: 10px; }
.voice-panel-title{ font-weight: 900; color: var(--heading); }
.voice-panel-sub{ margin-top: 4px; font-size: 13px; color: var(--muted); } /* было 3px */

.voice-divider{
  height: 1px;
  margin: 14px 0; /* было 12px 0 */
  background: color-mix(in oklab, var(--border) 55%, transparent);
}

/* sliders */
.voice-slider{ display:flex; flex-direction:column; gap: 8px; }
.voice-slider-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 10px;
  min-width: 0;
}
.voice-slider-title{ font-weight: 900; }
.voice-slider-sub{ font-size: 12px; color: var(--muted); }
.voice-slider-foot{ font-size: 12px; color: var(--muted); }

.voice-badge{
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 10px;
  border: 1px solid color-mix(in oklab, var(--border) 55%, transparent);
  background: var(--surface);
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  white-space: nowrap;
}

/* unified range */
.voice-range{
  width: 100%;
  appearance: none;
  height: 10px;
  border-radius: 999px;
  border: 0;
  outline: none;

  background:
    linear-gradient(to right,
      var(--brand) 0%,
      color-mix(in oklab, var(--surface) 70%, var(--surface-2) 30%) 100%
    );
}
.voice-range:focus-visible{ box-shadow: var(--focus-ring); }

.voice-range::-webkit-slider-thumb{
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--brand);
  border: 2px solid color-mix(in oklab, var(--brand) 72%, #fff 28%);
  box-shadow: 0 10px 26px rgba(15, 23, 42, .22);
}
.voice-range::-moz-range-thumb{
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--brand);
  border: 2px solid color-mix(in oklab, var(--brand) 72%, #fff 28%);
  box-shadow: 0 10px 26px rgba(15, 23, 42, .22);
}

/* create bar */
.voice-createbar{
  margin-top: 12px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid color-mix(in oklab, var(--border) 55%, transparent);
  background: color-mix(in oklab, var(--surface-2) 88%, var(--surface) 12%);
  box-shadow: var(--shadow-sm, 0 12px 30px rgba(15, 23, 42, .06));

  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}
.voice-create-title{ font-weight: 900; color: var(--heading); }
.voice-create-sub{ font-size: 13px; margin-top: 2px; color: var(--muted); }
.voice-create-btn{ min-width: 260px; }

.voice-status{ margin-top: 10px; min-height: 20px; }

/* ───────────────────────── music pick (spacing fix) ───────────────────────── */

.voice-music-selected{
  display:flex;
  flex-direction:column;
  gap: 16px; /* было 14px */
}

.voice-chip{
  display:flex;
  flex-direction:column;
  gap: 6px; /* было 4px */
  padding: 12px 12px; /* было 10px 12px */
  border: 1px solid color-mix(in oklab, var(--border) 55%, transparent);
  border-radius: 14px;
  background: var(--surface);
}

.voice-music-pick{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  padding-top: 6px;     /* было 2px */
  padding-bottom: 6px;  /* добавили */
  margin-bottom: 10px;  /* главный отступ перед выбранной мелодией */
}

.voice-mini{
  padding: 12px; /* было 10px */
  border-radius: 14px;
  border: 1px solid color-mix(in oklab, var(--border) 55%, transparent);
  background: var(--surface);
  display:flex;
  flex-direction:column;
  gap: 12px; /* было 10px */
  min-width: 0;
}

.voice-mini-top{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
}

.voice-mini-meta{
  display:flex;
  flex-direction:column;
  gap: 2px;
  min-width: 0;
}

.voice-mini-seg{
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* result actions */
.voice-actions{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.voice-action{
  min-width: 160px;
  justify-content: center;
}

/* disabled */
.voice-disabled{ pointer-events: none; opacity: .55; }

/* share only mobile */
@media (min-width: 769px){
  .btn-share{ display:none !important; }
}

/* ───────────────────────── audiobox ───────────────────────── */

.audiobox{
  --ab-p: 0%;
  display:flex;
  align-items:center;
  gap: 10px;

  padding: 10px 12px;
  border-radius: 16px;

  border: 1px solid color-mix(in oklab, var(--border) 55%, transparent);
  background: color-mix(in oklab, var(--surface-2) 88%, var(--surface) 12%);
  box-shadow: 0 12px 30px rgba(15, 23, 42, .08);
  color: var(--text);

  min-width: 0;
}

.ab-play{
  width:44px;
  min-width:44px;
  height:44px;
  padding:0;
  border-radius:999px;
}

.audiobox .ab-ico-pause{ display:none; }
.audiobox.is-playing .ab-ico-play{ display:none; }
.audiobox.is-playing .ab-ico-pause{ display:inline-block; }

.ab-mid{ flex:1; min-width: 0; }

.ab-range{
  width:100%;
  appearance:none;
  height:10px;
  border-radius:999px;
  border:0;
  outline:none;

  background:
    linear-gradient(to right,
      var(--brand) 0 var(--ab-p),
      color-mix(in oklab, var(--surface) 70%, var(--surface-2) 30%) var(--ab-p) 100%
    );
}
.ab-range:focus-visible{ box-shadow: var(--focus-ring); }

.ab-range::-webkit-slider-thumb{
  appearance:none;
  width:18px; height:18px;
  border-radius:999px;
  background: var(--brand);
  border: 2px solid color-mix(in oklab, var(--brand) 72%, #fff 28%);
  box-shadow: 0 10px 26px rgba(15, 23, 42, .22);
}
.ab-range::-moz-range-thumb{
  width:18px; height:18px;
  border-radius:999px;
  background: var(--brand);
  border: 2px solid color-mix(in oklab, var(--brand) 72%, #fff 28%);
  box-shadow: 0 10px 26px rgba(15, 23, 42, .22);
}

.ab-time{
  display:flex;
  gap:8px;
  justify-content:flex-end;
  font-variant-numeric: tabular-nums;
  font-size:12px;
  margin-top:6px;
}
.ab-sep{ opacity:.75; }

/* ───────────────────────── inputs fix ───────────────────────── */

.voice-card input,
.voice-card select,
.voice-card textarea,
.voice-card button,
.voice-history input,
.voice-history select,
.voice-history textarea,
.voice-history button{
  color: var(--text);
}

/* ───────────────────────── history (match voice-card) ───────────────────────── */

.voice-history{
  margin-top: 18px; /* было 14px */

  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm, 0 10px 26px rgba(15, 23, 42, .06));
  border-radius: var(--radius-lg, 24px);
  padding: 18px;

  color: var(--text);
  min-width: 0;
}

.vh-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.vh-tabs{
  display:flex;
  gap:8px;
  background: color-mix(in oklab, var(--surface) 86%, var(--surface-2) 14%);
  border: 1px solid color-mix(in oklab, var(--border) 55%, transparent);
  border-radius: 14px;
  padding: 6px;
  min-width: 0;
}

.vh-tab{
  border: 0;
  background: transparent;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--muted);
  font-weight: 900;
}

.vh-tab.is-active{
  background: color-mix(in oklab, var(--surface-2) 86%, var(--surface) 14%);
  color: var(--text);
}

.vh-note{
  color: var(--muted);
  font-size: 13px;
  white-space: normal;
  max-width: 100%;
}

.vh-list{
  display:flex;
  flex-direction:column;
  gap:10px;
  min-width: 0;
}

.vh-empty{
  color: var(--muted);
  padding: 12px;
  border: 1px dashed color-mix(in oklab, var(--border) 65%, transparent);
  border-radius: 16px;
}

/* cards in history */
.vh-card{
  border: 1px solid color-mix(in oklab, var(--border) 55%, transparent);
  background: color-mix(in oklab, var(--surface-2) 92%, var(--surface) 8%);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,.04);
  color: var(--text);
  min-width: 0;
}

.vh-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.vh-title{ font-weight: 900; color: var(--text); }
.vh-meta{ color: var(--muted); font-size: 12px; }

.vh-audiobox{ margin-top: 6px; }

.vh-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  margin-top: 10px;
}

.vh-btn{
  border: 1px solid color-mix(in oklab, var(--border) 55%, transparent);
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  cursor:pointer;
  font-weight: 900;
}

.vh-btn:disabled{ opacity:.6; cursor: not-allowed; }

.vh-btn-danger{
  border-color: color-mix(in oklab, #ff5c8a 45%, var(--border) 55%) !important;
}

.vh-btn-download{ border-radius: 12px; }

/* ───────────────────────── modal library ───────────────────────── */

html.vz-modal-open, body.vz-modal-open{ overflow:hidden; }

.vm-modal{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display:grid;
  place-items:center;
  padding: 14px;
}
.vm-modal[hidden]{ display:none; }
.vm-backdrop{ position:absolute; inset:0; background: rgba(0,0,0,.45); }

.vm-card{
  position:relative;
  width:min(720px, calc(100vw - 24px));
  max-height: min(78vh, 760px);
  overflow:auto;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 18px 60px rgba(0,0,0,.25);
  padding: 12px;
  color: var(--text);
}

.vm-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding: 6px 4px 10px;
  border-bottom: 1px solid color-mix(in oklab, var(--border) 55%, transparent);
}

.vm-title{ font-weight:900; font-size:18px; color: var(--heading); }

.vm-controls{
  display:flex;
  flex-direction:column;
  gap:10px;
  padding: 10px 4px 10px;
}

.vm-cats{ display:flex; flex-wrap:wrap; gap:8px; }

.vm-cat{
  padding:8px 12px;
  border-radius: 999px;
  border:1px solid color-mix(in oklab, var(--border) 60%, transparent);
  background: color-mix(in oklab, var(--surface-2) 86%, var(--surface) 14%);
  cursor:pointer;
  font-weight: 900;
  color: var(--text);
}
.vm-cat.is-active{
  outline: 2px solid color-mix(in oklab, var(--brand) 55%, transparent 55%);
}

.vm-list{
  display:flex;
  flex-direction:column;
  gap:10px;
  padding: 0 4px 6px;
}

.vm-item{
  border:1px solid color-mix(in oklab, var(--border) 55%, transparent);
  border-radius: 16px;
  background: color-mix(in oklab, var(--surface-2) 92%, var(--surface) 8%);
  padding: 12px;
  display:flex;
  flex-direction:column;
  gap:10px;
  min-width: 0;
  box-shadow: 0 10px 25px rgba(0,0,0,.04);
}

.vm-item-top{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:flex-start;
  flex-wrap: wrap;
}

.vm-item-title{ font-weight:900; }
.vm-item-meta{ color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ───────────────────────── mobile ───────────────────────── */

@media (max-width: 720px){
  .voice-settings{ grid-template-columns: 1fr; }
  .voice-create-btn{ width: 100%; min-width: 0; }
  .voice-step-actions{ width: 100%; }
  .voice-recbtn{ width: 100%; min-width: 0; }
}

@media (max-width: 560px){
  .voice-action{ width: 100%; min-width: 0; }
  .vh-head{ align-items: flex-start; }
}


/* ───────────────────────── vm search (modal) ───────────────────────── */

.vm-card .vm-search{
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border-radius: 14px;

  border: 1px solid color-mix(in oklab, var(--border) 60%, transparent);
  background: color-mix(in oklab, var(--surface) 88%, var(--surface-2) 12%);
  color: var(--text);

  box-shadow: var(--shadow-sm, 0 10px 26px rgba(15, 23, 42, .06));
  outline: none;
}

.vm-card .vm-search::placeholder{
  color: color-mix(in oklab, var(--muted) 82%, transparent);
}

.vm-card .vm-search:focus,
.vm-card .vm-search:focus-visible{
  border-color: color-mix(in oklab, var(--brand) 60%, var(--border) 40%);
  box-shadow: var(--focus-ring);
}
