/* Final option hierarchy. These tokens style UI labels, never artwork pixels,
   fabric/thread samples, canvas geometry or the selected design's typeface. */
body {
  --option-selected: #96c7cf;
  --option-selected-bg: #96c7cf0e;
  --option-selected-line: #96c7cf80;
  --option-title: #d3d5dc;
  --option-muted: #91939d;
  --option-divider: #ffffff14;
  --option-field-line: #8794a566;
}
body.studio-light {
  --option-selected: #286b75;
  --option-selected-bg: #286b750b;
  --option-selected-line: #286b7580;
  --option-title: #354252;
  --option-muted: #52647a;
  --option-divider: #2435521c;
  --option-field-line: #7e8b9d99;
}

/* One visible grouping level, with quiet dividers instead of nested cards. */
body .studio #sidebar .config-section,
body .studio #sidebar .config-section.is-open,
body .studio #sidebar .finish-toggle-row,
body .studio #sidebar .reference-text-line,
body .studio #sidebar .reference-text-line[open] {
  border: 0;
  border-bottom: 1px solid var(--option-divider);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body .studio #sidebar .config-heading { padding-left: 4px; padding-right: 4px; border-radius: 0; }
body .studio #sidebar .config-heading:has(.config-toggle:hover),
body .studio #sidebar .config-heading:focus-within { background: var(--ui-hover,#2a303c); }
body .studio #sidebar .config-body { padding: 6px 4px 12px; }
body .studio #sidebar .section-label,
body .studio #sidebar .finish-toggle-row strong,
body .studio #sidebar .reference-text-line > summary strong,
body .studio #sidebar .upload-workflow .up-intro h2,
body .studio #sidebar .upload-workflow .up-section h3,
body .studio #design-inspector .panel-heading h2,
body .studio #design-inspector .layers-section h3 { color: var(--option-title); font-size: 13px; font-weight: 500; line-height: 1.35; }
body .studio #sidebar .config-summary,
body .studio #sidebar .finish-toggle-row #mirror-summary,
body .studio #sidebar .text-line-summary,
body .studio #sidebar .reference-line-color-name,
body .studio #sidebar #text-thread-name,
body #template-dialog #template-thread-name { color: var(--option-selected); font-size: 12px; font-weight: 400; line-height: 1.35; }
body #template-dialog h2 { font-size: 18px; font-weight: 500; }
body #template-dialog label { font-size: 13px; font-weight: 500; }
body .studio #sidebar .section-number,
body .studio #sidebar .text-line-number { color: var(--option-muted); border-color: var(--option-field-line); background: transparent; font-weight: 400; }
body .studio #sidebar .config-section.is-open .section-number { color: var(--option-selected); border-color: var(--option-selected-line); background: transparent; }
body .studio #sidebar .finish-toggle-row { padding: 5px 4px; }
body .studio #sidebar .finish-toggle-row small { padding: 0; background: transparent; border-radius: 0; color: var(--option-muted); font-weight: 400; }

/* Option buttons retain a selected surface/underline without another box. */
body .studio #sidebar .config-body .segmented { gap: 4px; padding: 0; background: transparent; }
body .studio #sidebar .towel-size-options button,
body .studio #sidebar .orientation-options button,
body .studio #sidebar .segmented > button,
body .studio #sidebar #embroidery-source [data-source] {
  color: var(--option-muted);
  background: transparent;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 4px 4px 0 0;
  box-shadow: none;
  font-size: 12px;
  font-weight: 400;
}
body .studio #sidebar .towel-size-options button strong { font-size: 12px; font-weight: 400; }
body .studio #sidebar .towel-size-options button span { color: var(--option-muted); font-size: 11px; font-weight: 400; }
body .studio #sidebar .towel-size-options button[aria-pressed="true"],
body .studio #sidebar .orientation-options button[aria-pressed="true"],
body .studio #sidebar .segmented > button.active,
body .studio #sidebar #embroidery-source [data-source][aria-pressed="true"] {
  color: var(--option-selected);
  background: var(--option-selected-bg);
  border-bottom-color: var(--option-selected-line);
  box-shadow: none;
}
body .studio #sidebar .towel-size-options button[aria-pressed="true"] span { color: var(--option-selected); }
body .studio #sidebar .template-category-chips button { color: var(--option-muted); border-color: transparent; background: transparent; font-weight: 400; }
body .studio #sidebar .template-category-chips button[aria-pressed="true"] { color: var(--option-selected); background: var(--option-selected-bg); border-color: var(--option-selected-line); }
body .studio #sidebar #towel-colors .color-swatch { background: transparent; border-color: transparent; }
body .studio #sidebar #towel-colors .color-swatch .color-name { color: var(--option-muted); font-weight: 400; }
body .studio #sidebar #towel-colors .color-swatch.active { background: var(--option-selected-bg); border-color: var(--option-selected-line); }
body .studio #sidebar #towel-colors .color-swatch.active .color-name { color: var(--option-selected); }

/* Text keeps real typeface previews and readable input/focus boundaries. */
body .studio #sidebar .reference-text-line > summary { padding-left: 4px; padding-right: 4px; }
body .studio #sidebar .text-line-content { padding-left: 4px; padding-right: 4px; }
body .studio #sidebar .reference-text-colors { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
body .studio #sidebar .reference-text-colors > summary { padding-left: 0; padding-right: 0; color: var(--option-muted); font-size: 12px; font-weight: 400; }
body .studio #sidebar .text-line-content .text-line-label { color: var(--option-title); font-size: 12px !important; font-weight: 500; }
body .studio #sidebar .reference-text-line.is-unavailable .text-line-summary,
body .studio #sidebar .reference-text-line:has(:is(input,textarea):placeholder-shown) .text-line-summary { color: var(--option-muted); }
body .studio #sidebar .font-card { color: var(--ui-text,#edf0f7); border: 0; border-bottom: 1px solid transparent; border-radius: 4px 4px 0 0; background: transparent; box-shadow: none; }
body .studio #sidebar .font-card small { color: var(--option-muted); font-weight: 400; }
body .studio #sidebar .font-card.active { color: var(--ui-text,#edf0f7); background: var(--option-selected-bg); border-bottom-color: var(--option-selected-line); }
body .studio #sidebar .font-card.active small { color: var(--option-selected); }
body .studio #sidebar .reference-font-preview > summary { color: var(--option-muted); font-weight: 400; }
body .studio #sidebar .tool-content > label,
body .studio #sidebar .label-row > label,
body .studio #design-inspector label { color: var(--option-title); font-size: 12px; font-weight: 500; }
body .studio #sidebar .tool-content :is(input:not([type="checkbox"]):not([type="color"]):not([type="range"]):not([type="file"]),select,textarea),
body .studio #design-inspector :is(input:not([type="checkbox"]):not([type="color"]):not([type="range"]):not([type="file"]),select,textarea) { border-color: var(--option-field-line); border-radius: 5px; font-weight: 400; }

/* Upload preparation uses a single section boundary, not nested choice cards. */
body .studio #sidebar .upload-workflow .up-section { border-top-color: var(--option-divider); }
body .studio #sidebar .upload-workflow .up-choice { border: 0; border-bottom: 1px solid transparent; border-radius: 4px 4px 0 0; background: transparent; box-shadow: none; }
body .studio #sidebar .upload-workflow .up-choice strong { color: var(--option-muted); font-size: 12px; font-weight: 400; }
body .studio #sidebar .upload-workflow .up-choice[aria-pressed="true"] { background: var(--option-selected-bg); border-bottom-color: var(--option-selected-line); }
body .studio #sidebar .upload-workflow .up-choice[aria-pressed="true"] strong { color: var(--option-selected); }
body .studio #sidebar .upload-workflow .up-reduction { border: 0; border-left: 2px solid var(--ui-warning,#edcb94); border-radius: 0; background: transparent; }
body .studio #sidebar .upload-workflow .up-reduction > label:not(.up-approve) { color: var(--option-title); font-size: 12px; font-weight: 500; }
body .studio #sidebar .upload-workflow .up-approve { font-weight: 400; }

/* Details actions remain visibly interactive; field outlines and focus stay. */
body .studio #sidebar .config-note,
body .studio #design-inspector .info-card { color: var(--option-muted); border: 0; border-top: 1px solid var(--option-divider); border-radius: 0; background: transparent; box-shadow: none; }
body .studio #design-inspector .button-grid > button { color: var(--option-muted); background: transparent; border: 0; border-bottom: 1px solid var(--option-divider); border-radius: 4px 4px 0 0; font-size: 12px; font-weight: 400; }
body .studio #design-inspector .button-grid > button:hover { color: var(--option-title); background: var(--ui-hover,#2a303c); }
body .studio #design-inspector .layers button.active { color: var(--option-selected); background: var(--option-selected-bg); }
body .studio #design-inspector .selected-name { color: var(--option-muted); font-size: 12px; font-weight: 400; }

/* Review headings and exports. The id scope also wins over late order CSS. */
body #review .page-title h1 { font-size: 20px; font-weight: 500; line-height: 1.3; }
body #review h2,body #review .towel-order h2 { font-size: 18px; font-weight: 500; line-height: 1.4; letter-spacing: normal; }
body #review h3 { font-size: 13px; font-weight: 500; line-height: 1.4; }
body #review .export-card,
body #review .towel-order { border: 0; border-top: 1px solid var(--option-divider); border-radius: 0; padding: 18px 0; background: transparent; box-shadow: none; }
body #review .button-grid > button,
body #review .button-grid > a { color: var(--option-title); font-size: 12px; font-weight: 400; border-color: var(--option-divider); background: var(--ui-field,#14171e); }
body #review .towel-order-price { font-size: 20px; font-weight: 500; }
body #review .stat-grid strong { font-size: 16px; font-weight: 500; }
body #review .towel-order-approval { font-weight: 400; }

@media (max-width:700px), (max-height:500px) and (pointer:coarse) {
  body .studio #sidebar .config-summary,
  body .studio #sidebar .text-line-summary,
  body .studio #sidebar .reference-line-color-name { font-size: 12px; }
  body #review .review-summary,
  body #review .export-card,
  body #review .towel-order { padding-left: 0; padding-right: 0; }
}
