/* ===== Layout ===== */
.wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.lead {
  text-align: center;
  color: var(--muted-color);
  font-size: 1rem;
  margin: -8px 0 0;
}

/* ===== Section header ===== */
.sec-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.sec-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  color: #1a202c;
  letter-spacing: 0;
  text-shadow: none;
  text-align: left;
}

/* ===== Badges ===== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
}

.dia-badge   { background: #dbeafe; color: #1e40af; }
.circ-badge  { background: #fee2e2; color: #991b1b; }
.ratio-badge { background: #d1fae5; color: #065f46; }

/* ===== Concept text ===== */
.concept-desc {
  color: #374151;
  line-height: 1.75;
  margin-bottom: 8px;
}

/* ===== Concept note ===== */
.concept-note {
  background: #f0f9ff;
  border-left: 4px solid var(--brand);
  border-radius: 0 8px 8px 0;
  padding: 10px 14px;
  font-size: .9rem;
  color: #374151;
  margin-top: 14px;
  line-height: 1.6;
}

/* ===== Canvas ===== */
.canvas-wrap {
  margin: 12px 0 4px;
  display: flex;
  justify-content: center;
}

canvas {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

/* ===== Controls ===== */
.controls-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.ctrl-lbl {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .9rem;
  color: var(--muted-color);
}

.range-input {
  width: 140px;
  accent-color: var(--brand);
  cursor: pointer;
}

.action-btn {
  padding: 9px 20px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform .1s, filter .15s;
}

.action-btn:active { transform: scale(.97); }

.circ-btn  { background: #ef4444; color: #fff; }
.circ-btn:hover  { filter: brightness(1.1); }
.reset-btn { background: #e2e8f0; color: #475569; }
.reset-btn:hover { filter: brightness(.95); }

/* ===== Ratio comparison ===== */
.ratio-wrap {
  margin: 16px 0 4px;
}

.ratio-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  flex-wrap: nowrap;
}

.ratio-lbl {
  width: 72px;
  font-size: .78rem;
  font-weight: 600;
  color: #6b7280;
  text-align: right;
  flex-shrink: 0;
  line-height: 1.3;
}

.ratio-bars {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.ratio-bar {
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 700;
}

.d-bar {
  width: 100px;
  background: #bfdbfe;
  color: #1e40af;
  border: 2px solid #3b82f6;
}

.c-bar {
  width: 340px;
  background: #fecaca;
  border: 2px solid #ef4444;
}

.ratio-num {
  font-size: .82rem;
  color: #6b7280;
  flex-shrink: 0;
  margin-left: 4px;
}

.c-num { color: #dc2626; font-weight: 700; }

.ratio-hint {
  font-size: .82rem;
  color: #059669;
  font-weight: 600;
  margin-top: 8px;
  margin-left: 82px;
}

/* ===== Mobile ===== */
@media (max-width: 480px) {
  .ratio-row { flex-wrap: wrap; }
  .d-bar  { width: 76px; }
  .c-bar  { width: 259px; }
  .ratio-hint { margin-left: 0; }
}
