:root{
  --bg:#0b1020;
  --panel:#0f172a;
  --line:rgba(148,163,184,.18);
  --text:#e5e7eb;
  --muted:rgba(226,232,240,.75);
  --primary:#2563eb;
  --primary2:#1d4ed8;
  --danger:#dc2626;
  --radius:16px;
  --shadow:0 14px 40px rgba(0,0,0,.35);
  --topbar-h:62px;

  /* Botões padronizados (base do “lápis”) */
  --btn-h:40px;
  --btn-w:42px;
  --btn-r:12px;
  --btn-bg:rgba(15,23,42,.55);

  /* Ícone padronizado */
  --ico:20px;

  /* Player */
  --player-bg: rgba(15,23,42,.40);
  --player-border: rgba(148,163,184,.22);
  --seek-track: rgba(148,163,184,.22);
  --seek-fill: rgba(37,99,235,.95);
  --seek-thumb: rgba(226,232,240,.95);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:var(--bg);
  color:var(--text);
}

.hidden{display:none!important}
.mt{margin-top:14px}
.small{font-size:12px}
.muted{color:var(--muted)}
.err{color:#fecaca;font-size:12px}
.row{display:flex}
.gap{gap:10px}
.center{align-items:center}
.space{justify-content:space-between}
.stack{display:grid;gap:10px}

.h1{font-size:20px;font-weight:900}
.h2{font-size:18px;font-weight:900}
.h3{font-size:14px;font-weight:900}

.topbar{
  position:fixed;
  top:0;left:0;right:0;
  height:var(--topbar-h);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 14px;
  background:rgba(15,23,42,.92);
  border-bottom:1px solid var(--line);
  z-index:20;
}
.brand__title{font-weight:900;letter-spacing:.4px}
.brand__sub{font-size:12px;color:var(--muted)}
.topbar__actions{display:flex;gap:10px;align-items:center}

.main{ padding-top:calc(var(--topbar-h) + 10px); min-height:100%; }
.page{ max-width:980px; margin:0 auto; padding:12px; }

.toast{
  position:fixed;
  left:12px; right:12px; bottom:12px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  font-size:13px;
  background:rgba(2,6,23,.95);
  z-index:60;
}
.toast.is-error{border-color:var(--danger);color:#fecaca}

.card{
  background:#020617;
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:14px;
  box-shadow:var(--shadow);
}

.label{font-size:12px;color:var(--muted)}
.input,.textarea,select{
  width:100%;
  border-radius:12px;
  border:1px solid var(--line);
  background:#020617;
  color:var(--text);
  padding:10px;
}
.textarea{resize:vertical}

.btn{
  height:40px;
  padding:0 14px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#111827;
  color:var(--text);
  font-weight:800;
  cursor:pointer;
}
.btn.primary{background:linear-gradient(180deg,var(--primary),var(--primary2))}
.btn.ghost{background:transparent}
.btn.danger{background:rgba(220,38,38,.2);border-color:rgba(220,38,38,.6)}
.btn:disabled{opacity:.55;cursor:not-allowed}

/* Icon buttons (PADRÃO) */
.ibtn{
  height:var(--btn-h);
  width:var(--btn-w);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:var(--btn-r);
  border:1px solid var(--line);
  background:var(--btn-bg);
  cursor:pointer;
  color:var(--text);
}
.ibtn:active{transform:translateY(1px)}
.ibtn.primary{border-color:rgba(37,99,235,.55);background:rgba(37,99,235,.18)}
.ibtn.danger{border-color:rgba(220,38,38,.55);background:rgba(220,38,38,.15)}
.ibtn svg{width:var(--ico);height:var(--ico);display:block}
.ibtn:disabled{opacity:.55;cursor:not-allowed}

/* Botão de gravação (microfone) - padrão do projeto */
.ibtn.rec{
  border-color:rgba(37,99,235,.60);
  background:rgba(37,99,235,.10);
}
.ibtn.rec.is-rec{
  border-color:rgba(220,38,38,.70);
  background:rgba(220,38,38,.14);
}

/* HOME */
.homeMenuBar{
  width:100%;
  display:flex;
  gap:10px;
  padding:10px;
  border-radius:16px;
  border:1px solid var(--line);
  background:rgba(15,23,42,.45);
}
.homeMenuBtn{
  flex:1;
  height:44px;
  border-radius:14px;
  border:1px solid var(--line);
  background:rgba(15,23,42,.55);
  color:var(--text);
  font-weight:900;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
}
.homeMenuBtn svg{width:22px;height:22px}
.homeMenuBtn:active{transform:translateY(1px)}

.projectList{display:grid;gap:10px}
.pcard{
  border:1px solid var(--line);
  background:rgba(15,23,42,.55);
  border-radius:14px;
  padding:12px;
  cursor:pointer;
}
.pcard__t{font-weight:900}
.pcard__s{font-size:12px;color:var(--muted);margin-top:4px}

/* Tabs (Projeto) */
.tabs{
  display:flex;
  gap:8px;
  padding:8px;
  background:rgba(15,23,42,.45);
  border:1px solid var(--line);
  border-radius:14px;
}
.tab{
  flex:1;
  height:38px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#111827;
  color:var(--text);
  font-weight:900;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
}
.tab svg{width:20px;height:20px}
.tab.active{background:rgba(37,99,235,.25);border-color:rgba(37,99,235,.6)}

.ptab{display:none}
.ptab.active{display:block}

/* Player */
.player{
  border:1px solid var(--player-border);
  border-radius:18px;
  padding:12px;
  background:var(--player-bg);
}
.audio{width:100%}

.seekRow{
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:10px;
  width:100%;
}
.time{
  font-size:12px;
  color:var(--muted);
  min-width:52px;
  text-align:center;
  flex:0 0 auto;
}

/* range */
.seek{
  -webkit-appearance:none;
  appearance:none;
  width:100%;
  height:10px;
  border-radius:999px;
  background:linear-gradient(90deg,var(--seek-fill) 0%, var(--seek-track) 0%);
  outline:none;
  border:1px solid rgba(148,163,184,.18);
}
.seek::-webkit-slider-thumb{
  -webkit-appearance:none;
  appearance:none;
  width:18px;height:18px;border-radius:50%;
  background:var(--seek-thumb);
  border:2px solid rgba(2,6,23,.35);
}
.seek::-moz-range-thumb{
  width:18px;height:18px;border-radius:50%;
  background:var(--seek-thumb);
  border:2px solid rgba(2,6,23,.35);
}
.seek::-moz-range-track{
  height:10px;border-radius:999px;background:transparent;
}

/* Controls (padronizados, centralizados) */
.controls{
  display:flex;
  justify-content:center;
  gap:10px;
  margin-top:12px;
  width:100%;
}

.cbtn{
  height:var(--btn-h);
  width:var(--btn-w);
  border-radius:var(--btn-r);
  border:1px solid var(--line);
  background:#111827;
  color:var(--text);
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}
.cbtn svg{width:22px;height:22px;display:block}

/* Player sizing (consistência visual) */
.controls .cbtn{height:52px;width:52px;border-radius:16px}
.controls .cbtn svg{width:26px;height:26px}
/* manter o botão principal coerente com os demais (sem distorção visual) */
.controls .cbtn--main{height:52px;width:52px;border-radius:16px}
.controls .cbtn--main svg{width:26px;height:26px}


.cbtn--main{
  border-color:rgba(37,99,235,.55);
  background:linear-gradient(180deg,var(--primary),var(--primary2));
}
.cbtn.repeat-on{
  background:rgba(37,99,235,.20);
  border-color:rgba(37,99,235,.60);
}
.cbtn:active{transform:translateY(1px)}
.cbtn:disabled{opacity:.55;cursor:not-allowed}

/* Sound items */
.soundItem{
  border:1px solid var(--line);
  border-radius:14px;
  padding:10px;
  background:rgba(15,23,42,.35);
}
.soundTop{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
}
.soundInfo{flex:1;min-width:160px}
.soundName{font-weight:900}
.soundMeta{font-size:12px;color:var(--muted);margin-top:4px}

/* Ações */
.soundActions{
  display:flex;
  gap:8px;
  flex-wrap:nowrap;
  justify-content:flex-end;
}
.soundActions .ibtn{
  width:var(--btn-w);
  height:var(--btn-h);
}

/* Dialogs */
.dialog{
  position:fixed;
  inset:0;
  background:rgba(2,6,23,.72);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:12px;
  z-index:80;
}
.dialog__box{max-width:520px;width:100%}

/* Boot */
.boot{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(2,6,23,.85);
  z-index:90;
}
.boot__box{
  background:#020617;
  padding:20px;
  border-radius:16px;
  border:1px solid var(--line);
  text-align:center;
}
.boot__spinner{
  width:28px;height:28px;
  border-radius:50%;
  border:3px solid #334155;
  border-top-color:var(--primary);
  animation:spin 1s linear infinite;
  margin:0 auto 10px;
}
@keyframes spin{to{transform:rotate(360deg)}}

/* Mobile */
@media (max-width:420px){
  :root{ --ico:19px; }
  .time{min-width:46px;font-size:11px}
  .controls{gap:8px}
  .cbtn svg{width:21px;height:21px}
}


/* ======================================================
 * V7 - picker compacto e acessível
 * ====================================================== */
.projRow .label{ margin-bottom:6px; }
.input--compact{ min-width: 260px; }
@media (max-width: 520px){
  .input--compact{ min-width: 0; width: 100%; }
}

/* Player buttons (padronizados com os demais ícones/botões) */
.cbtn{
  min-width: var(--btn-w);
  min-height: var(--btn-h);
  width: var(--btn-w);
  height: var(--btn-h);
  border-width: 1px;
  border-radius: 14px;
}
.cbtn svg{ width: calc(var(--ico) + 4px); height: calc(var(--ico) + 4px); }

/* Botão principal (Play/Stop) um pouco maior, mas proporcional */
.cbtn--main{
  min-width: calc(var(--btn-w) + 12px);
  min-height: calc(var(--btn-h) + 12px);
  width: calc(var(--btn-w) + 12px);
  height: calc(var(--btn-h) + 12px);
}
.cbtn--main svg{ width: calc(var(--ico) + 10px); height: calc(var(--ico) + 10px); }
