* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: system-ui, sans-serif; font-size: 13px;
  display: flex; flex-direction: column;
}

.topbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 8px 16px; background: #222; color: #eee;
  flex-shrink: 0;
}
.topbar h1 { font-size: 16px; margin: 0; }
.topbar-item { display: flex; align-items: center; gap: 4px; }
.topbar-group { display: flex; align-items: center; gap: 6px; }
.topbar-group label { font-size: 12px; opacity: 0.8; }
.topbar button { padding: 6px 12px; cursor: pointer; }
.topbar select { padding: 4px 6px; }

.units-note { margin: 0 0 10px; padding: 6px 8px; background: #fffbcc; border: 1px solid #e2d97a; font-size: 12px; }

.legend-swatch {
  display: inline-block;
  width: 10px; height: 10px;
  margin-right: 6px; vertical-align: middle;
  border: 1px solid rgba(0,0,0,0.2);
}

main {
  flex: 1; min-height: 0;
  display: flex;
}

.sidebar {
  width: 340px; flex-shrink: 0;
  padding: 12px; background: #f4f4f4;
  overflow-y: auto;
  border-right: 1px solid #ddd;
}
.sidebar fieldset {
  border: 1px solid #ccc; padding: 6px 10px; margin-bottom: 10px; background: #fff;
}
.sidebar legend { font-weight: bold; padding: 0 4px; }
.sidebar .row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; margin: 3px 0;
}
.sidebar .row span { flex: 1; }
.sidebar .row input, .sidebar .row select { width: 110px; }

.previews {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
}
.card {
  background: #fff; border: 1px solid #ddd; margin-bottom: 16px; padding: 8px;
}
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.card-header h3 { margin: 0; font-size: 14px; }
.card-dims { font-weight: normal; color: #666; font-size: 12px; }
.svg-wrap {
  background: #fafafa; border: 1px dashed #ccc;
  display: flex; justify-content: center; align-items: center;
  padding: 8px;
}
.svg-wrap svg {
  display: block;
  max-width: 100%;
  max-height: 70vh;
}
