/* Cantoral — layout on top of the FM-1 palette in css/style.css */

.case { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }

.brand {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel);
  position: sticky; top: 0; z-index: 5; flex-wrap: wrap;
}
.brand h1 { font-size: 16px; margin: 0; letter-spacing: .18em; font-weight: 600; }
.brand h1 b { color: var(--accent); }
.brand h1 small { font-size: 10px; letter-spacing: .14em; opacity: .6; margin-left: 10px; }
.dev { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--dim); }
.led {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--line); box-shadow: none; transition: background .2s, box-shadow .2s;
}
.led.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }

.statusrow {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--panel2);
}
.status { font-size: 12px; color: var(--dim); }
.status.ok { color: var(--ok); }
.status.err { color: var(--err); }

.layout {
  flex: 1; min-height: 0; display: grid; gap: 1px; background: var(--line);
  grid-template-columns: 300px minmax(0, 1fr) 260px;
  /* each pane scrolls inside its own box, never the page */
}

/* ---------------------------------------------------------------- browser */
.browser { background: var(--bg); display: flex; flex-direction: column; min-height: 0; padding: 10px; gap: 8px; }
#search {
  width: 100%; padding: 7px 9px; font: inherit; font-size: 12px;
  background: var(--panel); color: var(--fg);
  border: 1px solid var(--line); border-radius: 5px; outline: none;
}
#search:focus { border-color: var(--accent); }

.folders { display: flex; flex-wrap: wrap; gap: 4px; max-height: 30vh; overflow: auto; }
.chip {
  font: inherit; font-size: 10px; letter-spacing: .02em;
  padding: 3px 7px; background: var(--panel); color: var(--dim);
  border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
}
.chip small { opacity: .6; margin-left: 3px; }
.chip:hover { color: var(--fg); }
.chip.on { background: var(--accent); color: #1a1020; border-color: var(--accent); font-weight: 600; }
.chip.on small { opacity: .8; }

.listhead {
  display: flex; justify-content: space-between;
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim);
  padding: 2px 2px 0;
}
.plist { list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1; min-height: 0; }
.item {
  display: flex; justify-content: space-between; gap: 8px; align-items: baseline;
  padding: 5px 7px; font-size: 12px; border-radius: 4px; cursor: pointer;
  border-left: 2px solid transparent;
}
.item:hover { background: var(--panel); }
.item.on { background: var(--panel2); border-left-color: var(--accent); color: var(--fg); }
.item .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .ln { font-size: 10px; color: var(--dim); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ stage */
.stage { background: var(--bg); display: flex; flex-direction: column; padding: 12px 14px; min-width: 0; min-height: 0; gap: 8px; overflow: hidden; }
.stage h2 { font-size: 13px; margin: 0; letter-spacing: .04em; color: var(--fg); font-weight: 600; }
.meta { font-size: 11px; color: var(--dim); }
.meta b { color: var(--fg); font-weight: 600; }
.rollwrap { position: relative; height: clamp(240px, 44vh, 560px); }   /* a definite height: a canvas that sizes itself from its own box feeds back */
#roll {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
}

.transport { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.transport button, .dest button {
  font: inherit; font-size: 12px; padding: 6px 12px; cursor: pointer;
  background: var(--panel2); color: var(--fg); border: 1px solid var(--line); border-radius: 5px;
}
.transport button:hover, .dest button:hover { border-color: var(--accent); }
.transport button:disabled, .dest button:disabled { opacity: .45; cursor: not-allowed; }
#play { background: var(--accent); color: #1a1020; border-color: var(--accent); font-weight: 600; }
.knobline { font-size: 11px; color: var(--dim); display: flex; align-items: center; gap: 5px; }
.knobline input[type=number] {
  width: 62px; font: inherit; font-size: 11px; padding: 3px 5px;
  background: var(--panel); color: var(--fg); border: 1px solid var(--line); border-radius: 4px;
}

/* ------------------------------------------------------------- destination */
.dest { background: var(--bg); padding: 12px; display: flex; flex-direction: column; gap: 9px; min-height: 0; overflow: auto; }
.dest h2 { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin: 0; font-weight: 600; }
.field { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--dim); }
.field select {
  font: inherit; font-size: 13px; padding: 4px 8px; min-width: 82px;
  background: var(--panel2); color: var(--fg); border: 1px solid var(--line); border-radius: 5px;
}
.hint { font-size: 11px; color: var(--dim); margin: 0; }
.hint b { color: var(--accent2); }
#push.big { background: var(--accent); color: #1a1020; border-color: var(--accent); font-weight: 600; }
#push16 { background: var(--panel); }
.dest button.quiet { background: transparent; color: var(--dim); }
.pool {
  font-size: 10.5px; line-height: 1.6; color: var(--dim);
  border-top: 1px solid var(--line); padding-top: 8px; margin-top: 2px;
}
.pool b { color: var(--fg); }
.log { font-size: 10.5px; line-height: 1.5; color: var(--dim); display: flex; flex-direction: column; gap: 3px; }
.logrow.ok { color: var(--ok); }
.logrow.err { color: var(--err); }

/* -------------------------------------------------------------- responsive */
@media (max-width: 900px) {
  /* the phone stacks the panes and scrolls the page: squeezing three panes into
     one screen leaves no room for the phrase list, which is the whole point */
  .case { height: auto; min-height: 100dvh; overflow: visible; }
  .layout { grid-template-columns: 1fr; grid-auto-rows: auto; overflow: visible; }
  .browser { order: 2; }
  .stage { order: 1; overflow: visible; }
  .dest { order: 3; overflow: visible; }
  .rollwrap { height: 30vh; min-height: 180px; }
  .folders { max-height: none; }
  .plist { height: 42vh; flex: none; }
}
}
