/* VoIPtoHorns — product layer on YesTechie Labs Style 0.4.0.
   Only what the kit does not ship: HTTPS strip, zone accordion, horn rows,
   and the full-width hold pad (kit pad is a 320px tile). */

.https-bar {
  display: none;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 14px;
  background: var(--accent-yellow-trans);
  color: var(--accent-yellow-ink);
  border-bottom: 1px solid var(--accent-yellow);
  font-size: var(--fs-sm);
  font-weight: bold;
}

.https-bar.show { display: flex; }

/* Kit .err-banner is visible; this page hides it until a zone error is set. */
.err-banner { display: none; }

.zone-grid {
  display: grid;
  grid-template-columns: 1fr 110px;
  gap: 10px;
}

.zone-card { padding: 0; }

.zone-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
}

.zone-summary:hover { background: var(--panel-bg-hover); }

.zone-ext {
  font-weight: bold;
  letter-spacing: var(--track-wide);
  min-width: 42px;
  font-variant-numeric: tabular-nums;
}

.zone-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zone-horns-sum {
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: normal;
  max-width: 42%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zone-chevron {
  color: var(--text-muted);
  font-size: var(--fs-xs);
  transition: transform var(--t-base);
}

.zone-card.open .zone-chevron { transform: rotate(90deg); }

.zone-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.22s ease;
}

.zone-card.open .zone-body { grid-template-rows: 1fr; }

.zone-body-inner {
  overflow: hidden;
  padding: 0 14px;
}

.zone-card.open .zone-body-inner {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--border-main);
}

.spk-row {
  display: flex;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px dotted var(--border-main);
  gap: 8px;
}

.spk-row:last-child { border-bottom: none; }

.sip-ok { color: var(--accent-green-ink); }
.sip-pend { color: var(--accent-yellow-ink); }

.delay-input {
  width: 72px;
  padding: 4px 6px;
  background: var(--surface-input);
  border: 1px solid var(--border-light);
  color: var(--text-dark);
  font-family: inherit;
  font-size: var(--fs-sm);
  text-transform: none;
}

.delay-input:focus {
  border-color: var(--text-dark);
  background: var(--surface-input-focus);
  box-shadow: inset 2px 0 0 var(--accent-blue);
  outline: none;
}

#sec-talk .level-meter { margin-top: 14px; }

/* Kit pad is a 320px demo tile. This console's hold control stays full width
   so the existing Connecting / Live labels fit. Colours and .live stay the kit's. */
#pttBtn.momentary-pad {
  max-width: none;
  aspect-ratio: auto;
  min-height: 76px;
  padding: 18px 40px;
  font-size: 13px;
  letter-spacing: var(--track-wide);
  text-align: center;
  line-height: 1.3;
}

#pttBtn.momentary-pad::before,
#pttBtn.momentary-pad::after { font-size: 22px; }

.toolbar .check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  font-weight: normal;
}

.toolbar .end { margin-left: auto; }

@media (max-width: 768px) {
  .zone-grid { grid-template-columns: 1fr; }
  .zone-horns-sum { display: none; }
  .zone-summary { gap: 8px; padding: 12px; }
  .spk-row { flex-wrap: wrap; }
  .spk-row span:last-child {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }
  .delay-input { font-size: 16px; width: 88px; padding: 8px; }
  .https-bar { padding-top: max(8px, env(safe-area-inset-top)); }

  /* Talk — phone: sticky zone, thumb-sized actions, no iOS zoom on TTS */
  #sec-talk #talkZonePanel {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--panel-bg-solid, var(--panel-bg));
    backdrop-filter: blur(6px);
    margin-bottom: 16px;
  }
  #talkZones {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  #talkZones .chip {
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
    min-height: 44px;
    padding: 12px 10px;
  }
  #pttBtn.momentary-pad {
    min-height: 96px;
    padding: 26px 24px;
    font-size: 16px;
  }
  #ttsPanel textarea {
    font-size: 16px;
    min-height: 88px;
    padding: 12px;
  }
  #ttsPlay,
  #testClipPanel .btn {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }
  #sec-talk #ttsPanel .btn-row,
  #sec-talk #testClipPanel .btn-row {
    flex-direction: column;
    align-items: stretch;
  }
  #ttsStatus { margin-left: 0; margin-top: 8px; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .zone-chevron,
  .zone-body { transition: none; }
}


/* Talk page stack — Zone → PTT → TTS → Test clip */
#sec-talk > .panel {
  margin-top: 0;
  margin-bottom: 20px;
  clear: both;
}
#sec-talk #pttPanel { margin-bottom: 24px; }
#sec-talk #ttsPanel { margin-bottom: 24px; }
#sec-talk #testClipPanel { margin-bottom: 12px; }

.tts-meta {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}
.tts-count {
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
}
.tts-status {
  align-self: center;
  margin-left: 10px;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: bold;
  letter-spacing: var(--track-tight);
}
.tts-status.ok { color: var(--accent-green); }
.tts-status.fail { color: var(--accent-red); }
#ttsPanel textarea {
  text-transform: none;
  letter-spacing: 0;
  min-height: 72px;
  resize: vertical;
}
#sec-talk #ttsPanel .btn-row,
#sec-talk #testClipPanel .btn-row {
  margin-top: 12px;
  margin-bottom: 0;
  align-items: center;
}


/* Desktop shell: left tabs always fit the viewport; only .main scrolls */
@media (min-width: 769px) {
  html, body {
    height: 100%;
    overflow: hidden;
  }
  .layout {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }
  .sidebar {
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    align-self: stretch;
  }
  .sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
  }
  .sidebar .logo,
  .sidebar-footer {
    flex-shrink: 0;
  }
  .main {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    max-height: 100%;
  }
}

/* Short desktop viewports: tighten nav so all tabs stay visible without chrome scroll */
@media (min-width: 769px) and (max-height: 720px) {
  .sidebar .logo { padding: 10px 12px; }
  .sidebar .logo h1 { font-size: 12px; }
  .sidebar-nav .nav-item {
    padding: 8px 12px;
    font-size: 10px;
  }
  .sidebar-footer { padding: 8px 12px; }
  .sidebar-footer .theme-cycle { margin-bottom: 4px; }
}


/* Config — HTTPS / Microphone: fix orphan | + breathing room */
#sec-config .panel-header {
  justify-content: flex-start;
  gap: 8px;
}
#sec-config .panel-header .ph-title {
  margin: 0;
}
#httpsCertPanel {
  padding: 18px 20px 20px;
}
#httpsCertPanel .panel-header {
  margin-bottom: 16px;
  padding-bottom: 10px;
}
#httpsCertPanel .note {
  margin: 0 0 16px;
  line-height: 1.55;
  max-width: 68ch;
}
#httpsCertPanel .btn-row {
  margin: 0 0 16px;
  gap: 10px;
}
#httpsCertPanel .note-steps {
  margin: 0;
  padding-top: 14px;
  border-top: 1px dashed var(--border-dashed, #c2ccc4);
  line-height: 1.6;
}


/* Logs — match UI-Kit TRM-01 (shell-telemetry Logs) */
#sec-logs .ws-bar {
  margin-bottom: 12px;
}
#sec-logs .term {
  margin-bottom: 0;
}
#sec-logs .term-head {
  gap: 8px 10px;
}
#sec-logs .term-head .chip-list {
  display: inline-flex;
  flex-wrap: wrap;
}
#sec-logs .term .terminal-window {
  max-height: 60vh;
  min-height: 220px;
  padding: 10px 12px;
}
#sec-logs .terminal-line.cols {
  grid-template-columns: 38px 42px 1fr;
}
#sec-logs .terminal-line .src-col {
  align-self: start;
}
@media (max-width: 768px) {
  #sec-logs .term-head .t-tools {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }
  #sec-logs .term .terminal-window {
    max-height: 50vh;
    min-height: 180px;
  }
}


/* PTT — distinct Connecting vs Live (kit .connecting was unused; live was applied early) */
#pttBtn.momentary-pad {
  gap: 8px;
}
#pttBtn .ptt-label {
  display: block;
  font-size: inherit;
  font-weight: bold;
  letter-spacing: inherit;
}
#pttBtn .ptt-sub {
  display: block;
  max-width: 28ch;
  line-height: 1.35;
  opacity: 0.9;
}
#pttBtn.momentary-pad.connecting {
  pointer-events: auto; /* release must still register */
  animation: ptt-connecting 1.1s ease-in-out infinite;
}
#pttPanel .ptt-status {
  margin: 10px 0 0;
  min-height: 1.4em;
  line-height: 1.45;
  max-width: 52ch;
}
#pttPanel .ptt-status:empty {
  display: none;
}
@keyframes ptt-connecting {
  0%, 100% { border-color: var(--border-main); background: var(--surface-well); }
  50% { border-color: var(--accent-blue); background: var(--accent-blue-trans); }
}
