/* Theme Builder structured-control field primitives — shared by the panels
   (docs/chart-theming-scope.md §5). */

.hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.field {
  display: grid;
  grid-template-columns: 132px 1fr;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--control-height);
}

.fieldLabel {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.control {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.number {
  width: 88px;
  height: var(--control-height);
  padding: 0 var(--space-3);
  font-size: 13px;
}

.text {
  flex: 1 1 140px;
  max-width: 220px;
  height: var(--control-height);
  padding: 0 var(--space-3);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.unit {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Quick-fill format presets (Formats panel) — a wrapping row of chips. */
.presets {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-left: 132px; /* align under the control column, past the label */
}

.defaultNote {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Caret for a custom SelectControl trigger (e.g. the Type panel's in-face font). */
.caret {
  margin-left: var(--space-3);
  font-size: 10px;
  color: var(--text-secondary);
}

/* Managed list of user-uploaded fonts under the Type panel's font control. */
.fontList {
  display: grid;
  gap: var(--space-2);
  margin: var(--space-2) 0 0;
  padding: 0;
  list-style: none;
}

.fontItem {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: var(--space-3);
}

.fontNameWrap {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.fontName {
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* "Variable" tag on a variable-font row in the managed list — passive chrome,
   bordered rather than filled (arch 09 §4). */
.fontBadge {
  flex: none;
  padding: 1px var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.fontMeta {
  font-size: 12px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* Accordion (Marks panel) — single-expand per-mark-type sections. */
.accordion {
  display: grid;
  padding: var(--space-5);
  gap: 0;
}

.accSection {
  border-bottom: var(--border-width) solid var(--border);
}

.accSection:first-child {
  border-top: var(--border-width) solid var(--border);
}

.accHeading {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.accHeader {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-1);
  appearance: none;
  background: none;
  border: none;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.accHeader:hover {
  color: var(--accent);
}

.accCaret {
  flex: none;
  width: 1em;
  font-size: 10px;
  color: var(--text-secondary);
}

.accTitle {
  flex: 1 1 auto;
}

/* Count of set properties — bordered chip, passive chrome (arch 09 §4). */
.accBadge {
  flex: none;
  min-width: 18px;
  padding: 0 var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.accPanel {
  padding: var(--space-2) 0 var(--space-4) var(--space-5);
}

/* Grid only when open: author `display` would otherwise beat the UA
   `[hidden] { display: none }` rule and leave a collapsed panel visible. */
.accPanel:not([hidden]) {
  display: grid;
  gap: var(--space-3);
}
