/* Editor hierarchy. Scoped to the workbench so previews and approval dialogs
   retain their own layout, sizing and interaction contracts. */
:root {
  --editor-surface: color-mix(in srgb, var(--panel) 94%, transparent);
  --editor-inset: color-mix(in srgb, var(--input-bg) 60%, var(--panel));
  --editor-line: color-mix(in srgb, var(--border) 80%, var(--muted) 20%);
}
.content { min-width: 0; padding: 16px clamp(16px, 2vw, 28px) 32px; scrollbar-gutter: stable; }
:root:not([data-theme="anime"]) .content { background: color-mix(in srgb, var(--bg) 97%, transparent); }
.content > .panel { max-width: 1360px; }
.editor-location {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1360px; margin: 0 auto 12px; padding-bottom: 10px;
  border-bottom: 1px solid var(--editor-line);
}
.editor-location-title { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; min-width: 0; font-size: 13px; }
.editor-location-title span { color: var(--muted); }
.editor-location-title strong { font-weight: 650; overflow-wrap: anywhere; }
.editor-location-title span::after { content: "/"; margin-left: 10px; opacity: .5; }
.editor-section-jump { display: flex; align-items: center; gap: 10px; margin: 0; flex: 0 1 350px; min-width: 0; }
.editor-section-jump > span { flex: none; font-size: 12px; }
.editor-section-jump select { min-width: 0; min-height: 38px; background: var(--editor-surface); }
.editor-location[hidden] { display: none; }
.editor-location #appLocaleControl { position: static; flex: 0 0 auto; z-index: auto; padding: 4px 8px; border-radius: 8px; background: var(--editor-surface); color: var(--text); box-shadow: none; backdrop-filter: none; }
.editor-location #appLocaleControl select { min-height: 30px; max-width: 100px; color: inherit; }
.content .panel h2 { font-size: 22px; line-height: 1.3; letter-spacing: -.4px; margin-bottom: 6px; }
.content .panel :is(h2, h3, h4) { text-wrap: pretty; overflow-wrap: anywhere; }
.content .panel h3 { font-size: 17px; line-height: 1.5; letter-spacing: -.15px; }
.content .panel h4 { font-size: 14px; line-height: 1.5; }
.content .panel > .hint, .content .subpage > .hint { max-width: 90ch; line-height: 1.8; margin-bottom: 24px; }
.content .hint { line-height: 1.75; }
.content .page-eyebrow, .content .section-kicker { letter-spacing: .12em; line-height: 1.6; }
.content :is(.system-heading, .guide-top, .wbx-heading, .global-agent-heading, .script-creator-heading, .moyue-heading) {
  gap: 14px; margin-bottom: 16px; padding: 10px 0 16px;
  border: 0; border-bottom: 1px solid var(--border); border-radius: 0;
  background: transparent; box-shadow: none;
}
.content .card {
  min-width: 0; padding: 18px; margin-bottom: 16px; border-radius: 12px;
  border-color: var(--editor-line); background: var(--editor-surface);
  backdrop-filter: none; -webkit-backdrop-filter: none;
  box-shadow: none;
}
.content .card::after { display: none; }
.content .card .card {
  padding: 14px; margin-bottom: 12px; border-radius: 9px;
  background: var(--editor-inset); box-shadow: none;
}
.content .card .card .card { background: transparent; }
.content .card > h3 {
  display: flex; align-items: center; gap: 8px; padding-bottom: 10px; margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.content .card .card h3 { font-size: 15px; }
.content .card > h4 { margin-top: 20px; padding-left: 10px; border-left: 3px solid var(--accent); }
.content .card > h4:first-child { margin-top: 0; }
.content :is(.wf-panel-head, .studio-heading) { gap: 16px; flex-wrap: wrap; }
.content .card > :is(.wf-panel-head, .studio-heading) { padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.content .card > :is(.wf-panel-head, .studio-heading) h3 { margin-bottom: 4px; }
.content .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.content .form-row.split { gap: 18px; }
.content .form-row.split > div { min-width: 0; }
.content .form-card .form-row { margin-bottom: 18px; }
.content label:not(.btn):not(:has(input[type="checkbox"], input[type="radio"])) { line-height: 1.6; }
.content .form-card > label, .content .form-row > div > label { font-size: 13px; font-weight: 600; color: var(--text); margin: 14px 0 7px; }
.content :is(input, textarea, select) { max-width: 100%; }
.content textarea { line-height: 1.75; }
.content input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
.content select { min-height: 40px; }
.content :is(button, a, summary, input, select, textarea):focus-visible { outline: 2px solid var(--accent2); outline-offset: 3px; }
.content .btn { min-height: 38px; font-weight: 550; line-height: 1.45; }
.content .btn.small { min-height: 32px; }
.content .btn-row { align-items: center; row-gap: 10px; }
.content .card > .btn-row.end { padding-top: 16px; margin-top: 20px; border-top: 1px solid var(--border); }
.content .card > .btn-row:first-child { margin-top: 0; }
.content details.card > summary {
  cursor: pointer; font-size: 16px; font-weight: 650; line-height: 1.6;
  color: var(--text); padding-block: 2px;
}
.content details.card[open] > summary { padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.content :is(.steps-nav, .subtabs, .export-steps-nav) {
  gap: 8px; padding: 10px; border: 1px solid var(--editor-line);
  border-radius: 14px; background: var(--editor-inset); margin-bottom: 24px;
}
.content :is(.wf-dot, .step-dot, .subtab, .exp-step-dot) { line-height: 1.5; border-radius: 9px; }
.content :is(.wf-dot, .step-dot, .subtab, .exp-step-dot).active {
  box-shadow: 0 3px 10px color-mix(in srgb, var(--accent) 18%, transparent);
  font-weight: 700;
}
.content :is(.wf-preview, .output-area) { border-radius: 12px; }
.content :is(pre, .code-editor) { tab-size: 2; }
.content :is(h3, h4, details.card > summary) { scroll-margin-block: 80px 20px; }
.content :is(h3, h4):focus { outline: 2px solid var(--accent2); outline-offset: 5px; border-radius: 3px; }
.sidebar .tab-group-label { padding-top: 14px; margin-top: 8px; border-top: 1px solid var(--border); letter-spacing: .12em; font-size: 10px; }
.sidebar .tab-group-label:first-child { border-top: 0; }
.sidebar .tab { border-radius: 10px; }
.sidebar .tab.active { box-shadow: inset 3px 0 0 var(--accent2); }
/* Let specialist canvases retain the space their editors and previews need. */
.content :is(.wbx-layout, .global-agent-layout, .sl-ed-layout, .regex-editor-layout) { min-width: 0; }
@media (min-width: 961px) and (max-width: 1200px) {
  .content { padding: 24px 20px 40px; }
  .content .card { padding: 20px; }
  .content .grid-2 { gap: 16px; }
}
@media (max-width: 960px) {
  .content :is(.btn, .btn.small) { min-height: 44px; }
  .content input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
  .content select { min-height: 44px; }
  .content { padding: 18px 16px max(30px, env(safe-area-inset-bottom)); }
  .editor-location { margin-bottom: 18px; gap: 12px; }
  .content .card { padding: 18px; margin-bottom: 18px; }
  .content .card .card { padding: 14px; }
  .content :is(.system-heading, .guide-top, .wbx-heading, .global-agent-heading, .script-creator-heading, .moyue-heading) { padding: 18px; margin-bottom: 18px; }
}
@media (max-width: 720px) {
  .editor-location:has(#appLocaleControl) .editor-section-jump { flex: 1; }
  .editor-location:has(#appLocaleControl) .editor-location-title { flex-basis: 100%; }
  .editor-location #appLocaleControl { padding: 0 6px; }
  .editor-location #appLocaleControl select { min-height: 44px; max-width: 76px; }
  .content { padding-inline: 12px; }
  .editor-location { flex-wrap: wrap; gap: 10px; padding-bottom: 12px; }
  .editor-location-title { font-size: 12px; }
  .editor-section-jump { flex-basis: 100%; }
  .editor-section-jump select { flex: 1; min-height: 44px; font-size: 16px; }
  .content .panel h2 { font-size: 22px; }
  .content .panel h3 { font-size: 16px; }
  .content .card { padding: 16px; border-radius: 14px; }
  .content .card .card { padding: 12px; border-radius: 10px; }
  .content .grid-2 { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .content .form-row.split { gap: 12px; }
  .content .card > h3 { padding-bottom: 12px; margin-bottom: 14px; }
  .content :is(.steps-nav, .subtabs, .export-steps-nav) { padding: 8px; margin-bottom: 18px; }
  .content :is(.btn, .btn.small) { min-height: 44px; }
  .content .btn-row { gap: 8px; }
  .content .btn-row > .btn { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) {
  .content *, .sidebar * { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
