/* Explicit product-UI opt-ins. No canvas, SVG artwork, export, or global token rules. */
input.merlin-range[type="range"] {
  appearance:none; box-sizing:border-box; display:block; width:100%; min-width:0;
  height:44px; min-height:44px; padding:0; margin:0; border:0; border-radius:8px;
  background:transparent; box-shadow:none; cursor:pointer; accent-color:var(--accent);
}
input.merlin-range[type="range"]::-webkit-slider-runnable-track {
  height:4px; border-radius:4px;
  background:linear-gradient(to right,var(--accent) 0 var(--range-progress,0%),var(--line-strong) var(--range-progress,0%) 100%);
}
input.merlin-range[type="range"]::-moz-range-track {
  height:4px; border-radius:4px;
  background:linear-gradient(to right,var(--accent) 0 var(--range-progress,0%),var(--line-strong) var(--range-progress,0%) 100%);
}
input.merlin-range[type="range"]::-moz-range-progress { background:transparent; }
input.merlin-range[type="range"]::-webkit-slider-thumb {
  appearance:none; box-sizing:border-box; width:16px; height:16px; margin-top:-6px;
  border:3px solid var(--accent); border-radius:50%; background:var(--panel); box-shadow:none;
}
input.merlin-range[type="range"]::-moz-range-thumb {
  box-sizing:border-box; width:16px; height:16px;
  border:3px solid var(--accent); border-radius:50%; background:var(--panel); box-shadow:none;
}
input.merlin-range[type="range"]:hover:not(:disabled) { --accent:var(--accent-hover); }
input.merlin-range[type="range"]:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
input.merlin-range[type="range"]:disabled { opacity:.5; filter:grayscale(1); cursor:not-allowed; }

/* Shared form rhythm; widths, scrolling models, validation and close guards stay local. */
.merlin-form-panel {
  font:400 13px/1.65 "Sarasa UI SC","Microsoft YaHei",sans-serif;
  color:var(--ink); border-radius:12px; overflow-wrap:anywhere;
}
.merlin-form-panel :where(h2,h3,h4,p) { margin-top:0; }
.merlin-form-panel :where(h2) { font:600 22px/1.4 "Sarasa UI SC","Microsoft YaHei",sans-serif; color:var(--ink); }
.merlin-form-panel :where(h3,h4,legend) { font:600 15px/1.5 "Sarasa UI SC","Microsoft YaHei",sans-serif; color:var(--ink); }
.merlin-form-panel :where(label) { font-size:13px; font-weight:400; color:var(--ink); }
.merlin-form-panel :where(.muted,small,.account-dialog-note,.space-meta,.dsg-icon-editor-note) { font-size:12px; font-weight:400; line-height:1.6; color:var(--muted); }
.merlin-form-panel :where(input:not([type=range]):not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]):not([type=hidden]),textarea,select) {
  box-sizing:border-box; min-width:0; max-width:100%; min-height:44px;
  font:400 13px/1.5 "Sarasa UI SC","Microsoft YaHei",sans-serif;
  padding:10px 12px; border:1px solid var(--line); border-radius:8px;
  color:var(--ink); background:var(--panel);
}
.merlin-form-panel :where(textarea) { resize:vertical; }
.merlin-form-panel :where(button) { font-family:inherit; font-size:13px; font-weight:500; min-height:44px; min-width:44px; border-radius:8px; }
.merlin-form-panel :where(input[type=checkbox],input[type=radio]) { width:18px; height:18px; flex:none; accent-color:var(--accent); }
.merlin-form-panel :where(button,input,select,textarea,summary,[tabindex]):focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.merlin-form-panel :where(input[aria-invalid=true],textarea[aria-invalid=true]) { border-color:var(--danger); }
.merlin-form-panel :where([role=alert]) { color:var(--danger); }
.merlin-form-panel :where(.cloud-panel-head,header) { gap:16px; }
.merlin-form-panel :where(.account-dialog-close,.form-dialog-close,.merlin-close) { flex:none; display:grid; place-items:center; width:44px; height:44px; padding:0; border:0; background:transparent; color:var(--ink); box-shadow:none; font-size:22px; }
.merlin-form-panel :where(.account-dialog-close,.form-dialog-close,.merlin-close):hover { color:var(--accent); background:var(--accent-soft); }
.merlin-form-panel :where(.account-dialog-close svg) { width:18px; height:18px; }
.merlin-form-panel :is(.account-dialog-close,.form-dialog-close,.merlin-close) svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.65; stroke-linecap:round; }
.merlin-form-panel .mini-button { min-height:44px; min-width:44px; font-family:inherit; font-size:13px; font-weight:500; border:1px solid var(--line); border-radius:8px; background:var(--panel); color:var(--ink); box-shadow:none; transform:none; }
.merlin-form-panel .mini-button:hover:not(:disabled) { color:var(--accent); background:var(--accent-soft); border-color:var(--accent); box-shadow:none; transform:none; }
.merlin-form-panel .mini-button:is(.primary,.primary-action) { background:var(--accent); border-color:var(--accent); color:#fff; }
.merlin-form-panel .mini-button:is(.primary,.primary-action):hover:not(:disabled) { background:var(--accent-hover); border-color:var(--accent-hover); }
.merlin-form-panel :where(.account-dialog-field,.bug-report-field) { gap:8px; }
.product-edit-panel.merlin-form-panel { gap:20px; }
.merlin-form-panel.cloud-panel { box-sizing:border-box; max-height:calc(100dvh - 96px); }
.source-registration-panel.merlin-form-panel { gap:16px; overflow:hidden; }
.source-registration-panel > :not(.source-registration-list) { flex:none; }
.source-registration-panel .source-registration-list { min-height:0; gap:16px; }
.source-registration-panel .source-registration-controls label { gap:8px; color:var(--ink); font-size:13px; }
.source-registration-panel .source-registration-controls label > span { font-weight:400; }
.source-registration-panel .source-registration-advanced summary { font-size:13px; font-weight:500; min-height:44px; display:flex; align-items:center; }
.source-registration-panel .source-registration-row { border-radius:8px; }
.source-registration-panel .source-registration-quickbar { border-radius:8px; background:var(--accent-soft); }
.source-registration-panel .source-registration-polaroid { background:var(--panel); border:0; border-radius:8px; box-shadow:none; min-height:112px; padding:8px; }
.product-edit-panel .product-edit-list { min-height:0; }
.product-edit-list { gap:16px; }
#bugReportOverlay .bug-report-panel { overflow:hidden; }
#bugReportOverlay :is(.cloud-panel-head,.bug-report-view,.bug-report-actions) { flex:none; }
#bugReportForm:not([hidden]) { display:flex; flex-direction:column; min-height:0; overflow:hidden; }
#bugReportForm .merlin-form-body { min-height:0; overflow:auto; overscroll-behavior:contain; padding:4px; }
#bugReportForm .bug-report-actions { margin-top:12px; padding-top:12px; border-top:1px solid var(--line); }
#bugReportHistory { min-height:0; overflow:auto; }
#bugReportOverlay :is(.bug-report-view,.bug-report-kind) { border-radius:8px; padding:4px; box-shadow:none; }
#bugReportOverlay .lib-mode-button { min-height:44px; border:0; background:transparent; box-shadow:none; border-radius:4px; font-size:13px; font-weight:400; }
#bugReportOverlay .lib-mode-button.is-active { color:var(--accent); background:var(--accent-soft); }
.merlin-form-panel :where(.cloud-panel-head h2,header h2) { margin:0; }
.merlin-form-panel .cloud-panel-head h2 { font:600 22px/1.4 "Sarasa UI SC","Microsoft YaHei",sans-serif; }
.merlin-form-panel :is(.account-dialog-field,.bug-report-field) { color:var(--ink); font-size:13px; font-weight:400; }
.merlin-form-panel :is(.account-dialog-close,.form-dialog-close,.merlin-close) { width:44px; min-width:44px; height:44px; padding:0; border:0; background:transparent; color:var(--ink); box-shadow:none; font-size:22px; }
.merlin-form-panel :is(.account-dialog-close,.form-dialog-close,.merlin-close):hover { color:var(--accent); background:var(--accent-soft); }
.merlin-form-panel :where(.account-dialog-actions,.bug-report-actions,.shared-actions,.art-logo-workspace-actions) { gap:12px; flex-wrap:wrap; }

/* Collaboration forms scroll their contents without hiding the close action. */
.collaboration-form-dialog[open] { display:flex; flex-direction:column; gap:16px; max-height:calc(100dvh - 32px); overflow:hidden; }
.collaboration-form-dialog > .cloud-panel-head { flex:none; margin:0; }
.collaboration-form-dialog > .collaboration-dialog-body { min-height:0; overflow:auto; overscroll-behavior:contain; padding:4px; margin:-4px; gap:16px; }
.collaboration-form-dialog .collaboration-invitation { padding:16px; border-radius:8px; }
.collaboration-invitation > strong { font-size:15px; font-weight:600; }
.collaboration-invitation-actions { display:flex; gap:12px; flex-wrap:wrap; margin-top:12px; }
.collaboration-invitation-actions:empty { display:none; }
.collaboration-form-dialog .collaboration-member { padding:8px 0; margin:0; }
.collaboration-form-dialog .collaboration-search { margin:0; gap:12px; }
.collaboration-form-dialog .collaboration-search button { flex:none; }

/* Numeric rows retain their original output/number controls and units. */
.art-calibration-row:has(> .merlin-range) > :is(span,label) { min-width:0; white-space:normal; overflow:visible; text-overflow:clip; color:var(--ink); font-size:13px; font-weight:400; }
.art-calibration-row:has(> .merlin-range) input[type=number] { min-height:44px; border:1px solid var(--line); border-radius:8px; background:var(--panel); color:var(--ink); font-size:13px; font-variant-numeric:tabular-nums; }
.team-logo-editor .team-logo-number { grid-template-columns:minmax(0,1fr) 80px; gap:4px 12px; font-size:13px; }
.team-logo-number > span { overflow-wrap:anywhere; }
.team-logo-number input[type=range] { grid-column:1; grid-row:2; }
.team-logo-number input[type=number] { min-height:44px; font-variant-numeric:tabular-nums; }
.team-logo-editor .team-logo-number:has(.merlin-range) input[type=number] { grid-row:2; }
.team-logo-editor :is(select,textarea) { min-height:44px; }
.team-logo-crop.merlin-form-panel { max-height:calc(100dvh - 32px); overflow:auto; }
.team-logo-crop.merlin-form-panel h2,#workshopMode .team-logo-crop h2 { font-size:22px; line-height:1.4; margin:0; }
.team-logo-crop label:has(.merlin-range) { display:grid; grid-template-columns:auto minmax(0,1fr); width:100%; }
.team-logo-crop label:has(output) { grid-template-columns:auto minmax(0,1fr) 48px; }
.team-logo-crop output { text-align:right; font-variant-numeric:tabular-nums; color:var(--muted); font-size:12px; }
#workshopMode .team-logo-crop label { display:grid; grid-template-columns:auto minmax(0,1fr) 48px; width:100%; gap:12px; }
.art-private-rule-range-controls .art-logo-range-control { display:grid; grid-template-columns:minmax(0,1fr); gap:0; }
.art-private-rule-range-controls .art-logo-range-control > span { display:flex; align-items:center; justify-content:space-between; gap:12px; color:var(--ink); font-size:13px; font-weight:400; }
.art-private-rule-range-controls output { color:var(--muted); font-size:12px; font-variant-numeric:tabular-nums; }

/* The former desktop-only icon dialog contract now applies at every viewport. */
#dsgIconEditor[open] { display:flex; flex-direction:column; max-height:calc(100dvh - 32px); }
#dsgIconEditor .dsg-icon-editor-head,#dsgIconEditor .dsg-icon-editor-footer { flex:none; padding:16px; }
#dsgIconEditor .dsg-icon-editor-layout { flex:1 1 auto; min-height:0; max-height:none; }
#dsgIconEditor .dsg-icon-editor-head h2 { font:600 22px/1.4 "Sarasa UI SC","Microsoft YaHei",sans-serif; }
#dsgIconEditor .dsg-icon-editor-controls fieldset { border:0; padding:0; gap:16px; }
#dsgIconEditor .dsg-icon-editor-effects { border-top:1px solid var(--line); padding-top:16px; }
#dsgIconEditor .dsg-icon-editor-controls legend { font-size:15px; font-weight:600; }
#dsgIconEditor .dsg-icon-editor-mode { border-radius:8px; box-shadow:none; }
#dsgIconEditor .dsg-icon-editor-mode strong { font-size:13px; font-weight:500; }
#dsgIconEditor .dsg-icon-editor-range { display:grid; grid-template-columns:minmax(0,1fr); gap:0; }
#dsgIconEditor .dsg-icon-editor-range > span { font-size:13px; font-weight:400; color:var(--ink); }
#dsgIconEditor .dsg-icon-editor-range output { color:var(--muted); font-size:12px; }
#dsgIconEditor .dsg-icon-editor-selects label { font-size:13px; font-weight:400; }
#dsgIconEditor .dsg-icon-editor-note { padding:0; border-radius:0; background:transparent; }
#dsgIconEditor .dsg-icon-editor-footer > div { flex-wrap:wrap; }
@media(max-width:760px) {
  .merlin-form-panel.cloud-panel { max-width:calc(100vw - 24px); padding:20px; }
  .product-edit-list { grid-template-columns:minmax(0,1fr); }
  #dsgIconEditor .dsg-icon-editor-head { align-items:flex-start; }
  #dsgIconEditor .dsg-icon-editor-preview-card { max-width:100%; }
  #dsgIconEditor .dsg-icon-editor-stage { max-width:280px; margin-inline:auto; }
  #dsgIconEditor .dsg-icon-editor-footer { gap:8px; }
  #dsgIconEditor .dsg-icon-editor-footer .mini-button { padding:8px 10px; }
  .team-logo-properties { gap:16px; }
}

/* SEGMENTED_CONTROL_20261101 */
/* Short view choices only; numeric sliders, navigation and mixed action bars stay separate. */
:is(.plans-audience-switch,.discovery-kind-tabs,.auth-login-methods,.creative-type-switch,.slot-expand-tabs,.designer-preview-tabs,.creator-night-tabs,#bugReportView,#bugReportKind)[data-segment-ready] {
  position:relative; isolation:isolate; display:flex; align-items:stretch; flex-wrap:nowrap;
  min-width:0; max-width:100%; gap:0; padding:4px; border:1px solid var(--line);
  border-radius:8px; background:var(--panel); box-shadow:none; touch-action:pan-y; user-select:none;
  -webkit-tap-highlight-color:transparent;
}
:is(.plans-audience-switch,.discovery-kind-tabs,.auth-login-methods,.creative-type-switch,.slot-expand-tabs,.designer-preview-tabs,.creator-night-tabs,#bugReportView,#bugReportKind)[data-segment-ready]::before {
  content:""; position:absolute; pointer-events:none; z-index:0; left:0; top:0; bottom:auto;
  width:var(--segment-width); height:var(--segment-height); border:1px solid color-mix(in srgb,var(--accent) 20%,transparent);
  box-sizing:border-box; border-radius:6px; background:var(--accent-soft);
  transform:translate(var(--segment-x),var(--segment-y));
  transition:transform 320ms cubic-bezier(.22,1,.36,1),width 320ms cubic-bezier(.22,1,.36,1),height 320ms cubic-bezier(.22,1,.36,1);
}
:is(.plans-audience-switch,.discovery-kind-tabs,.auth-login-methods,.creative-type-switch,.slot-expand-tabs,.designer-preview-tabs,.creator-night-tabs,#bugReportView,#bugReportKind)[data-segment-ready] > :is(button,label) {
  position:relative; z-index:1; flex:1 1 auto; min-width:0; min-height:44px; margin:0;
  border:0; border-radius:6px; background:transparent; box-shadow:none; color:var(--ink);
  font-size:13px; font-weight:500; line-height:1.5; padding:8px 12px; white-space:normal;
  overflow-wrap:anywhere; transform:none; transition:color 160ms ease;
}
:is(.plans-audience-switch,.discovery-kind-tabs,.auth-login-methods,.creative-type-switch,.slot-expand-tabs,.designer-preview-tabs,.creator-night-tabs,#bugReportView,#bugReportKind)[data-segment-ready] > :is(button,label):is(.is-active,[aria-selected=true],[aria-pressed=true],[aria-checked=true],:has(input:checked)) {color:var(--accent);background:transparent;box-shadow:none;border-color:transparent;}
/* Override legacy mode-scoped hover fills without hiding the moving selection surface. */
:is(.plans-audience-switch,.discovery-kind-tabs,.auth-login-methods,.creative-type-switch,.slot-expand-tabs,.designer-preview-tabs,.creator-night-tabs,#bugReportView,#bugReportKind)[data-segment-ready] > :is(button,label):is(:hover,:active):not(:disabled) {background:transparent;box-shadow:none;transform:none;}
:is(.plans-audience-switch,.discovery-kind-tabs,.auth-login-methods,.creative-type-switch,.slot-expand-tabs,.designer-preview-tabs,.creator-night-tabs,#bugReportView,#bugReportKind)[data-segment-ready] > button:focus-visible {outline:2px solid var(--accent);outline-offset:-2px;}
:is(.plans-audience-switch,.discovery-kind-tabs,.auth-login-methods,.creative-type-switch,.slot-expand-tabs,.designer-preview-tabs,.creator-night-tabs,#bugReportView,#bugReportKind)[data-segment-ready]:is(.is-segment-dragging,.is-dragging)::before {transition:none;}
[data-segment-ready].is-segment-dragging,[data-segment-ready].is-segment-dragging > :is(button,label) {cursor:grabbing;}
.auth-login-methods[data-segment-ready] .auth-login-thumb {display:none;}
:is(.plans-audience-switch,.discovery-kind-tabs,.auth-login-methods,.creative-type-switch,.slot-expand-tabs,.designer-preview-tabs,.creator-night-tabs,#bugReportView,#bugReportKind)[data-segment-ready] > label {flex-basis:0;padding:0;}
.auth-login-methods[data-segment-ready] > label > span {min-height:44px;}
[data-segment-ready] > button > span {min-width:0;}
@media(prefers-reduced-motion:reduce) {
  :is(.plans-audience-switch,.discovery-kind-tabs,.auth-login-methods,.creative-type-switch,.slot-expand-tabs,.designer-preview-tabs,.creator-night-tabs,#bugReportView,#bugReportKind)[data-segment-ready]::before {transition:none;}
}
@media(forced-colors:active) {[data-segment-ready]::before {border-color:Highlight;}[data-segment-ready] > button[aria-selected=true] {color:Highlight;}}
