/* ---------- duas telas lado a lado: PEDAL | PAINEL (arrastar para o lado) ---------- */
html, body { height: 100%; }
body { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
.topbar { flex: none; }

/* ---------- topo enxuto: casinha | seletor de tela | menu ---------- */
.topbar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px;
  padding: 7px 12px; position: relative; z-index: 9; flex-wrap: nowrap;
}
.topbar .pgnav { grid-column: 2; }
.tbright { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 8px; }
.tbico {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel);
  color: var(--txt); display: grid; place-items: center; padding: 0; cursor: pointer; position: relative;
}
.tbico svg { width: 20px; height: 20px; }
.tbico:hover { border-color: #555; }
.homebtn { grid-column: 1; justify-self: start; }
.infobtn[aria-expanded="true"] { background: var(--panel2); border-color: #666; }
/* bolinha no menu: verde = áudio ligado, azul = controle remoto, vermelha = algo precisa de atenção */
.infobtn .dot { position: absolute; top: 3px; right: 3px; width: 9px; height: 9px; border-radius: 50%; background: transparent; }
.infobtn .dot.ok { background: var(--play); box-shadow: 0 0 0 2px var(--panel); }
.infobtn .dot.remote { background: #4aa8ff; box-shadow: 0 0 0 2px var(--panel); }
.infobtn .dot.bad { background: var(--rec); box-shadow: 0 0 0 2px var(--panel); animation: dotpulse 1.2s ease-in-out infinite; }
@keyframes dotpulse { 50% { box-shadow: 0 0 0 2px var(--panel), 0 0 0 6px #ff3b3055; } }
/* DAW gravando: bolinha vermelha piscando no botão DAW (não ocupa espaço no topo) */
.recdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #ff3b30; margin-right: 6px; vertical-align: 1px; animation: recblink 1s steps(1) infinite; }
.recdot[hidden] { display: none; }
@keyframes recblink { 50% { opacity: .25; } }

/* menu que abre com as informações */
.infomenu {
  position: absolute; top: calc(100% + 6px); right: 10px; width: min(360px, calc(100vw - 20px));
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 4px 14px 8px;
  box-shadow: 0 14px 40px #000a; display: flex; flex-direction: column;
}
.infomenu[hidden] { display: none; }
.infomenu { max-height: calc(100dvh - 72px); overflow-y: auto; }
/* atalho para Configurações no topo do menu */
.imset {
  display: flex; align-items: center; gap: 12px; width: calc(100% + 28px); margin: -4px -14px 4px; padding: 13px 14px;
  background: none; border: none; border-bottom: 1px solid var(--line); color: var(--txt); text-align: left; cursor: pointer; font: inherit;
}
.imset:hover { background: var(--panel2); }
.imset svg { width: 22px; height: 22px; flex: none; color: var(--txt); }
.imset span { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.imset b { font-size: 14px; font-weight: 600; }
.imset small { font-size: 11px; color: var(--dim); }
.imset i { font-style: normal; font-size: 20px; color: var(--dim); }
.imrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); min-height: 44px; }
.imrow:first-child, .imset + .imrow { border-top: none; }
.imrow[hidden] { display: none; }
.imk { font-size: 12px; color: var(--dim); white-space: nowrap; }
.infomenu .pill { background: none; border: none; padding: 0; font-size: 13px; color: var(--txt); text-align: right; min-width: 0; display: inline-flex; align-items: center; gap: 7px; }
.infomenu .pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: none; opacity: .6; }
.infomenu .pill.ok { color: var(--play); } .infomenu .pill.ok::before { background: var(--play); opacity: 1; }
.infomenu .pill.bad { color: var(--rec); } .infomenu .pill.bad::before { background: var(--rec); opacity: 1; }
.infomenu .pill.remote { color: #7fc8ff; } .infomenu .pill.remote::before { background: #4aa8ff; opacity: 1; }
.infomenu .pill.mono { font-size: 12px; }
.infomenu .pill.mono::before { display: none; }
.themeseg { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.themeseg button { border: none; background: transparent; color: var(--dim); font-size: 12px; font-weight: 700; padding: 7px 11px; cursor: pointer; white-space: nowrap; }
.themeseg button.on { background: var(--txt); color: var(--bg); }
.imkeys { font-size: 11px; color: var(--dim); line-height: 1.5; padding: 10px 0 2px; border-top: 1px solid var(--line); }
.imkeys b { color: var(--txt); font-weight: 700; margin-right: 4px; }
@media (hover: none) { .imkeys { display: none; } }
.imout { margin-top: 10px; align-self: flex-start; background: none; border: none; color: var(--dim); text-decoration: underline; font-size: 12px; padding: 4px 0; cursor: pointer; }
.imout:hover { color: var(--rec); }
html.light .infomenu { box-shadow: 0 14px 40px #0003; }
html.light .infomenu .pill.remote { color: #1f6fb5; }
.pager {
  flex: 1; min-height: 0; display: flex; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scroll-behavior: smooth; overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.pager::-webkit-scrollbar { display: none; }
.pager.dragging { scroll-snap-type: none; scroll-behavior: auto; cursor: grabbing; }
.page {
  flex: 0 0 100%; width: 100%; height: 100%; overflow-y: auto; overflow-x: hidden;
  scroll-snap-align: start; scroll-snap-stop: always; box-sizing: border-box; padding: 0 12px; position: relative;
}
#pgRack .rack { margin-top: 26px; }
/* o painel fica sempre aberto (não existe mais minimizar) */
.racktoggle { display: none !important; }

/* seletor DAW | PEDAL | PAINEL no meio do topo — estilo "Linha": o nome escolhido acende
   e um traço vermelho fino desliza embaixo dele (acompanha o dedo ao arrastar entre as telas) */
.pgnav { --p: 1; --n: 3; position: relative; display: grid; grid-template-columns: repeat(var(--n), 1fr); }
.pgnav button[hidden] { display: none; }
.pgnav button {
  border: none; background: transparent; color: #6f747e; font-weight: 600; font-size: 11px; letter-spacing: .18em; text-indent: .18em;
  padding: 10px 18px 13px; cursor: pointer; min-height: 38px; transition: color .25s; white-space: nowrap;
}
.pgnav button:not(.on):hover { color: #b9bdc5; }
.pgnav button.on { color: #fff; }
html.light .pgnav button { color: #9a9ea6; }
html.light .pgnav button:not(.on):hover { color: #5b616c; }
html.light .pgnav button.on { color: #121212; }
.pgnav .ind { position: absolute; left: 0; bottom: 4px; width: calc(100% / var(--n)); height: 2px; pointer-events: none; transform: translateX(calc(var(--p) * 100%)); }
.pgnav .ind::after { content: ""; position: absolute; left: 50%; width: 18px; height: 2px; margin-left: -9px; border-radius: 2px; background: #e8392c; box-shadow: 0 0 8px #e8392c88; }
@media (max-width: 380px) { .pgnav button { padding: 10px 12px 13px; letter-spacing: .12em; text-indent: .12em; } }

/* aba na borda direita da tela do pedal */
.pgedge {
  position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 3;
  writing-mode: vertical-rl; padding: 14px 6px; border: 1px solid var(--line); border-right: none;
  border-radius: 10px 0 0 10px; background: #000c; color: #cfd3da; font-weight: 800; font-size: 11px; letter-spacing: 2px; cursor: pointer;
  transition: opacity .2s;
}
.pgedge:hover { color: #fff; background: #000; }
.pager:not(.on1) .pgedge { opacity: 0; pointer-events: none; }
.pgedge.left { right: auto; left: 0; border-radius: 0 10px 10px 0; border-left: none; border-right: 1px solid var(--line); writing-mode: vertical-lr; transform: translateY(-50%) rotate(180deg); }
html.light .pgedge { background: #fffc; color: #3a3f48; }

/* telas estreitas (tablet/celular): o pedal mantém o desenho e encolhe para caber inteiro */
@media (max-width: 1040px) { #pgPedal .pedal { width: 1000px; max-width: none; } }

/* enquanto a entrada (Início) ou o painel do administrador estão na tela, o pedal fica escondido por trás:
   não aparece em transições/carregamentos e o aparelho não gasta desenhando o que ninguém vê */
body.covered .pager, body.covered .topbar, body.covered #overlay, body.covered #settings { visibility: hidden; }

/* ---------- Configurações: tela por cima do app (aberta pelo ☰) ---------- */
.settings { position: fixed; inset: 0; z-index: 12; background: #000b; display: flex; justify-content: center; padding: 16px; }
.settings[hidden] { display: none; }
.settings .setbox { width: min(1180px, 100%); max-width: none; height: 100%; margin: 0; display: flex; flex-direction: column; overflow: hidden; }
.sethead { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 4px; }
.settitle { font-size: 19px; font-weight: 600; letter-spacing: .01em; color: var(--txt); }
.setx { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--txt); cursor: pointer; font-size: 14px; }
.setx:hover { border-color: #666; }
/* abas no mesmo estilo "Linha" do seletor do topo */
.setnav { --i: 0; position: relative; display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 10px; border-bottom: 1px solid #ffffff14; }
.setnav button {
  border: none; background: transparent; color: #8b909c; font-weight: 600; font-size: 11px; letter-spacing: .18em; text-indent: .18em;
  padding: 12px 8px 14px; cursor: pointer; transition: color .25s; white-space: nowrap;
}
.setnav button:not(.on):hover { color: #c3c7cf; }
.setnav button.on { color: #fff; }
.setnav .ind { position: absolute; left: 0; bottom: -1px; width: 25%; height: 2px; pointer-events: none; transform: translateX(calc(var(--i) * 100%)); transition: transform .38s cubic-bezier(.22, 1, .36, 1); }
.setnav .ind::after { content: ""; position: absolute; left: 50%; width: 18px; height: 2px; margin-left: -9px; border-radius: 2px; background: #e8392c; box-shadow: 0 0 8px #e8392c88; }
.setbody { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
html.light .setnav { border-bottom-color: #0000000f; }
html.light .setnav button { color: #8a8f99; }
html.light .setnav button:not(.on):hover { color: #4a4f59; }
html.light .setnav button.on { color: #121212; }
@media (max-width: 600px) {
  .settings { padding: 0; }
  .settings .setbox { border-radius: 0; border: none; }
  .setnav button { letter-spacing: .1em; text-indent: .1em; font-size: 10.5px; }
}

/* abas PEDALEIRA | MIXER do Painel no mesmo estilo "Linha" do seletor do topo */
#pgRack .rack .tabs {
  --i: 0; --w: 150px; position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, var(--w))); justify-content: center;
  gap: 0; padding: 6px 12px 0; background: transparent; border-bottom: 1px solid #ffffff12; flex-wrap: nowrap;
}
#pgRack .rack .tabs button {
  flex: none; min-width: 0; padding: 13px 8px 15px; border: none; border-radius: 0; background: transparent; box-shadow: none;
  color: #8b909c; font-weight: 600; font-size: 11.5px; letter-spacing: .18em; text-indent: .18em; text-transform: uppercase; transition: color .25s;
}
#pgRack .rack .tabs button:hover { color: #c3c7cf; }
#pgRack .rack .tabs button.on { background: transparent; border: none; box-shadow: none; color: #fff; }
#pgRack .rack .tabs .ind {
  position: absolute; left: calc(50% - var(--w)); bottom: -1px; width: var(--w); height: 2px; pointer-events: none;
  transform: translateX(calc(var(--i) * 100%)); transition: transform .38s cubic-bezier(.22, 1, .36, 1);
}
#pgRack .rack .tabs .ind::after { content: ""; position: absolute; left: 50%; width: 18px; height: 2px; margin-left: -9px; border-radius: 2px; background: #e8392c; box-shadow: 0 0 8px #e8392c88; }
html.light #pgRack .rack .tabs { background: transparent; border-bottom-color: #0000000f; }
html.light #pgRack .rack .tabs button { background: transparent; border: none; box-shadow: none; color: #8a8f99; }
html.light #pgRack .rack .tabs button:hover { color: #4a4f59; }
html.light #pgRack .rack .tabs button.on { background: transparent; border: none; box-shadow: none; color: #121212; }

/* telas que a conta não usa neste app ficam escondidas (DAW e Pedaleira são apps à parte) */
.page[hidden] { display: none; }
/* DAW: GRAVAÇÃO | MIXER no estilo Linha */
.dawnav { --i: 0; position: relative; display: grid; grid-template-columns: repeat(2, 150px); justify-content: center; margin: 10px auto 2px; }
.dawnav button { border: none; background: transparent; color: #8b909c; font-weight: 600; font-size: 11px; letter-spacing: .18em; text-indent: .18em; padding: 10px 8px 13px; cursor: pointer; transition: color .25s; }
.dawnav button:not(.on):hover { color: #c3c7cf; }
.dawnav button.on { color: #fff; }
.dawnav .ind { position: absolute; left: calc(50% - 150px); bottom: 4px; width: 150px; height: 2px; pointer-events: none; transform: translateX(calc(var(--i) * 100%)); transition: transform .38s cubic-bezier(.22, 1, .36, 1); }
.dawnav .ind::after { content: ""; position: absolute; left: 50%; width: 18px; height: 2px; margin-left: -9px; border-radius: 2px; background: #e8392c; box-shadow: 0 0 8px #e8392c88; }
html.light .dawnav button { color: #8a8f99; } html.light .dawnav button.on { color: #121212; }
.dawrack { margin: 8px 0 18px; }
.dawrack[hidden], #dawRoot[hidden] { display: none; }

/* menu ☰ › ABRIR JUNTO: os outros apps abrem ao lado do que está aberto (Premium + comprou) */
.imapps { display: flex; flex-direction: column; padding: 8px 0 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.imapps:empty { display: none; }
.imapps .imk { padding: 2px 0 4px; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; }
.imapp { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 0; background: none; border: none; color: var(--txt); text-align: left; cursor: pointer; font: inherit; }
.imapp svg { width: 22px; height: 22px; flex: none; }
.imapp span { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.imapp b { font-size: 14px; font-weight: 600; }
.imapp small { font-size: 11px; color: var(--dim); }
.imapp em { font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: .16em; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; }
.imapp:hover em { border-color: #666; }
.imapp.on em { color: #fff; background: #e8392c; border-color: #e8392c; }
.imapp.lk b, .imapp.lk svg { opacity: .6; }
.imapp.lk em { color: #c9a227; border-color: rgba(201, 162, 39, .5); }
.imapps + .imrow { border-top: none; }

