/* core/components.css
   Structural styling for the shared controls and summary. Color comes only from
   the token variables, so these re-theme automatically and look the same on
   every site that uses the engine. */

.control { margin: 0 0 18px; }
.control-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
}
.control-label { font-size: 14px; font-weight: 500; }
.control-value {
  font-variant-numeric: tabular-nums; font-weight: 600; color: var(--accent);
}
.control-input { display: block; margin-top: 8px; }
.control-input[type="range"] { width: 100%; accent-color: var(--accent); }
.control-input[type="number"] {
  width: 100%; padding: 8px 10px; font: inherit; box-sizing: border-box;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: inherit;
}
.control-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.control-help { margin: 6px 0 0; font-size: 12px; color: var(--muted); }

.summary { display: grid; gap: 12px; margin-top: 8px; }
.summary-item {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface);
}
.summary-label { font-size: 14px; color: var(--muted); }
.summary-value { font-variant-numeric: tabular-nums; }
.summary-primary { border-color: var(--accent); }
.summary-primary .summary-value { color: var(--accent); font-size: 18px; }

/* Theme toggle — shared sun/moon button, fixed top-right. Stateless. */
.theme-toggle {
  position: fixed; top: 16px; right: 16px; z-index: 50;
  width: 40px; height: 40px; padding: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface, #fff); color: var(--fg, #222);
  border: 1px solid var(--border, #e0e0e0); border-radius: 8px;
  cursor: pointer; line-height: 0;
}
.theme-toggle:hover { border-color: var(--accent, #2c6e6a); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .ic-moon { display: none; }
[data-theme="dark"] .theme-toggle .ic-sun { display: none; }
[data-theme="dark"] .theme-toggle .ic-moon { display: inline-block; }
.theme-toggle:focus-visible { outline: 2px solid var(--accent, #2c6e6a); outline-offset: 2px; }
