[hidden] { display: none !important; }
html, body { max-width: 100%; }
.wrap, section, div { min-width: 0; }
h1, h2, h3, p, span, label, code { overflow-wrap: anywhere; }
.flush { margin-top: 0; }
.card { margin-bottom: 20px; }
.top-gap { margin-top: 12px; }
.num { font-family: var(--mono); }
code { font-family: var(--mono); font-size: 13px; }

button, .btn, label.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  max-width: 100%;
  white-space: normal;
  text-align: center;
  overflow-wrap: anywhere;
}

input:not([type="file"]):not([type="hidden"]), select, textarea {
  min-height: 44px;
  min-width: 44px;
  max-width: 100%;
  font-size: 16px;
}

input[type="range"] {
  display: block;
  width: 100%;
  min-width: 80px;
  max-width: 100%;
  min-height: 46px;
  height: 46px;
  padding: 0;
  margin: 4px 0 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  accent-color: var(--accent);
}

.preset-block { margin-bottom: 14px; }
.preset-lbl { margin: 0 0 6px; font-weight: 600; }
.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 8px;
}
.preset-btn { font-weight: 600; }

.fgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.field { min-width: 0; }
.field label { display: block; margin-bottom: 4px; }

.channel-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ch-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}
.ch-card.is-muted {
  opacity: 0.84;
}
.ch-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.ch-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 130px;
  min-width: 0;
}
.ch-title {
  font-weight: 700;
  font-size: 16px;
  margin: 0;
  cursor: pointer;
}
.ch-desc {
  line-height: 1.35;
}
.ch-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ch-pct {
  font-size: 16px;
  min-width: 44px;
  text-align: right;
}
.ch-card.is-muted .ch-pct {
  color: var(--muted);
}

.toggle-btn {
  min-width: 78px;
  font-weight: 600;
}
.toggle-btn[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.toggle-btn[aria-pressed="false"] {
  background: var(--chip);
  color: var(--muted);
  border-color: var(--line);
}

.ch-param {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.transport-bar {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--chip);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.timer-readout {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.timer-val {
  font-size: 24px;
  line-height: 1.2;
}
.status-line {
  margin: 8px 0 0;
}

.stage-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px 12px;
  margin-bottom: 12px;
}
.stage-mount {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0b1914;
}
.stage-svg {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
}
.acoustic-summary {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--chip);
  border: 1px solid var(--line);
  font-size: 13px;
}

.err-msg {
  color: var(--warn);
  font-weight: 600;
  margin: 10px 0 0;
}
.warn-box {
  background: var(--chip);
  border: 1px solid var(--warn);
  color: var(--warn);
  padding: 10px 12px;
  border-radius: 8px;
}

.list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}
.list li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
}
.list .title {
  font-weight: 600;
  flex: 1 1 150px;
  min-width: 0;
}
.list .meta {
  flex: 1 1 100%;
  font-size: 13px;
  color: var(--muted);
  font-family: var(--mono);
}

.print-only { display: none; }

@media print {
  .no-print, header.top, footer { display: none !important; }
  body { background: #fff; color: #000; }
  .wrap { max-width: 100%; padding: 0; }
  .print-only { display: block !important; }
  .patch-header { border-bottom: 2px solid #000; padding-bottom: 10px; margin-bottom: 14px; }
  .patch-title { font-size: 22px; font-weight: 700; margin: 0 0 4px; }
  .patch-sub { font-size: 13px; color: #333; margin: 0; }
  .patch-svg-wrap { border: 1px solid #bbb; border-radius: 8px; overflow: hidden; margin-bottom: 16px; }
  .patch-table { width: 100%; border-collapse: collapse; margin-bottom: 14px; font-size: 13px; }
  .patch-table th, .patch-table td { border: 1px solid #ccc; padding: 6px 8px; text-align: left; }
  .patch-notes-h { font-size: 15px; font-weight: 700; margin: 0 0 4px; }
  .patch-notes-b { font-size: 13px; margin: 0; }
}
