* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #fafafa;
  color: #222;
  line-height: 1.55;
}
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 16px; }

.site-header {
  background: #ff6b6b;
  color: #fff;
  padding: 34px 0 26px;
  text-align: center;
}
.site-header h1 { margin: 0 0 6px; font-size: 34px; letter-spacing: 0.5px; }
.tagline { margin: 0; opacity: 0.95; font-size: 16px; }

.tabs {
  display: flex;
  gap: 8px;
  margin: 18px auto 0;
  flex-wrap: wrap;
}
.tab {
  flex: 1 1 0;
  min-width: 130px;
  padding: 13px 10px;
  font-size: 16px;
  font-weight: bold;
  border: 2px solid #e3e3e3;
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  background: #f0f0f0;
  cursor: pointer;
  color: #555;
}
.tab.active { background: #fff; color: #ff6b6b; border-color: #ff6b6b; }

main { padding-bottom: 30px; }
.panel { display: none; background: #fff; border: 2px solid #ff6b6b; border-radius: 0 0 12px 12px; padding: 22px; margin-top: -2px; }
.panel.active { display: block; }

.card {
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 18px;
}
.card h2 { margin-top: 0; font-size: 21px; }
.hint { color: #777; font-size: 14px; }

.tool-grid { display: grid; grid-template-columns: 300px 1fr; gap: 18px; }
@media (max-width: 760px) { .tool-grid { grid-template-columns: 1fr; } }

.controls label { display: block; margin: 14px 0; font-weight: bold; font-size: 14px; }
.controls input[type="text"], .controls select {
  display: block; width: 100%; margin-top: 6px;
  padding: 10px; font-size: 16px;
  border: 2px solid #ddd; border-radius: 8px;
}
.controls input[type="range"] { display: block; width: 100%; margin-top: 6px; }
.controls label span { font-weight: normal; color: #ff6b6b; }

.btn-row { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.btn-row.center { justify-content: center; }
.btn {
  padding: 11px 16px;
  font-size: 15px; font-weight: bold;
  border: 2px solid #ddd; border-radius: 8px;
  background: #eee; color: #333; cursor: pointer;
}
.btn:hover { background: #e2e2e2; }
.btn.primary { background: #ff6b6b; border-color: #ff6b6b; color: #fff; }
.btn.primary:hover { background: #e85a5a; }

.stage {
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  min-height: 300px;
  padding: 10px;
}
.stage svg { max-width: 100%; height: auto; max-height: 62vh; }
.stage.tall svg { max-height: 78vh; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-top: 12px; }
.g-card {
  border: 2px solid #e6e6e6; border-radius: 10px; padding: 8px;
  cursor: pointer; text-align: center; background: #fff;
}
.g-card:hover { border-color: #ff6b6b; }
.g-card svg { width: 100%; height: auto; display: block; }
.g-card p { margin: 6px 0 2px; font-size: 13px; font-weight: bold; color: #444; }
.hidden { display: none; }

.article h3 { margin-top: 22px; }
.article ol, .article ul { padding-left: 22px; }

.site-footer { text-align: center; color: #999; font-size: 14px; padding: 18px 0 30px; }

/* print: only the artwork */
#print-area { display: none; }
@media print {
  body * { visibility: hidden; }
  #print-area, #print-area * { visibility: visible; }
  #print-area { display: block; position: absolute; top: 0; left: 0; width: 100%; }
  #print-area svg { width: 100%; height: auto; max-height: 100vh; }
  .site-header, nav, main, footer { display: none; }
}
