[hidden] { display: none !important; }
h1, h2, h3, p, span, strong, code, label { overflow-wrap: anywhere; }
.flush { margin-top: 0; }
.card { margin-bottom: 20px; min-width: 0; }
.top-gap { margin-top: 12px; }

.studio-grid { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
@media (min-width: 860px) {
  .studio-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .stage-card { position: sticky; top: 12px; }
}

.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 10px; margin-bottom: 10px; }
.field { min-width: 0; }
.field-wide { grid-column: 1 / -1; }
input, select, textarea { max-width: 100%; }

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

code { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.num { font-family: var(--mono); }

.guides-group { margin: 12px 0; }
.guides-title { margin: 0 0 8px; font-weight: 600; }
.toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 8px;
}
.toggle-btn {
  justify-content: flex-start;
  text-align: left;
  padding: 8px 12px;
  border-radius: 9px;
  border: 1px solid var(--field-line);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
}
.toggle-btn[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--chip);
  font-weight: 600;
}
.tog-dot {
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  border-radius: 99px;
  border: 2px solid var(--field-line);
  background: transparent;
}
.toggle-btn[aria-pressed="true"] .tog-dot {
  border-color: var(--accent);
  background: var(--accent);
}

.spec-bar {
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.spec-bar-lbl { font-size: 13px; font-weight: 700; color: var(--muted); }
.spec-val { font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }

.stage-top { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.stage-mount {
  width: 100%;
  max-width: 100%;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--chip);
  padding: 8px;
}
.stage-svg {
  width: 100%;
  max-width: 100%;
  max-height: 580px;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 6px;
}

.swatch-panel {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--chip);
}
.swatch-lbl { display: block; margin-bottom: 8px; font-weight: 600; }
.swatch-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 135px), 1fr));
  gap: 8px;
}
.swatch-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  min-width: 0;
}
.swatch-chip-svg { flex: 0 0 22px; width: 22px; height: 22px; display: block; border-radius: 4px; }
.swatch-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.swatch-hex { font-family: var(--mono); font-size: 13px; font-weight: 700; }
.swatch-role { font-size: 11px; color: var(--muted); }

.status-line { margin: 8px 0 0; min-height: 1.2em; }
.err-msg { color: var(--warn); font-weight: 600; margin: 10px 0 0; overflow-wrap: anywhere; }
.warn-box { background: var(--chip); border: 1px solid var(--warn); color: var(--warn); padding: 10px 12px; border-radius: 8px; overflow-wrap: anywhere; }

.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: 700; overflow-wrap: anywhere; flex: 1 1 160px; min-width: 0; }
.list .meta { flex: 1 1 100%; font-size: 13px; color: var(--muted); font-family: var(--mono); overflow-wrap: anywhere; }

.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; }
  .proof-header { border-bottom: 2px solid #000; padding-bottom: 10px; margin-bottom: 14px; }
  .proof-title { font-size: 22px; font-weight: 800; margin: 0 0 4px; }
  .proof-sub { font-size: 13px; color: #333; margin: 0; font-family: ui-monospace, Menlo, monospace; }
  .proof-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; align-items: start; }
  .proof-svg-box { border: 1px solid #bbb; border-radius: 6px; padding: 8px; break-inside: avoid; }
  .proof-svg-box .stage-svg { max-height: 460px; }
  .proof-section-h { font-size: 15px; font-weight: 700; margin: 14px 0 6px; }
  .proof-section-h:first-child { margin-top: 0; }
  .proof-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 10px; }
  .proof-table th, .proof-table td { border-bottom: 1px solid #ccc; padding: 5px 6px; text-align: left; }
  .proof-swatch-cell { display: flex; align-items: center; gap: 6px; }
}
