/* studio area styles: studio home, module editor, form builder, dashboard builder/view. Logical properties + ds.css tokens only. */
.st-apps { display: flex; flex-direction: column; gap: var(--s5); }
.st-app-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--c, var(--accent)) 14%, transparent); color: var(--c, var(--accent)); }
.st-mod-row { display: flex; align-items: center; gap: var(--s3); padding: 12px 14px; border-radius: 14px; background: var(--surface-2); color: var(--text); text-decoration: none !important; flex-wrap: wrap; min-height: 56px; }
.st-mod-row:hover { background: var(--surface-3); }
.st-mod-row .grow { min-width: 140px; }
.st-list { display: flex; flex-direction: column; gap: var(--s2); }
.st-quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--s3); margin-bottom: var(--s6); }
.st-quick a { text-decoration: none !important; color: var(--text); }

/* editor header */
.st-status { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.st-dirty { --c: var(--warning); }
.st-sticky-actions { position: sticky; top: calc(var(--topbar) + 8px); z-index: 6; }

/* builder panels */
.builder > * { min-width: 0; }
.st-panel { position: sticky; top: calc(var(--topbar) + 12px); max-height: calc(100vh - var(--topbar) - 24px); overflow-y: auto; }
@media (max-width: 1200px) { .st-panel { position: static; max-height: none; } }
.st-palette { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
@media (max-width: 1200px) { .st-palette { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
.palette-item { width: 100%; text-align: start; color: var(--text); min-height: 44px; }
.palette-item:focus-visible { box-shadow: var(--focus); }
.palette-item[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.dnd-item { cursor: pointer; min-height: 52px; flex-wrap: wrap; }
.dnd-item:focus-visible { box-shadow: var(--focus); }
.dnd-item .grow { min-width: 120px; }
.dnd-item.archived { opacity: .65; background: var(--surface-2); }
.dnd-tools { display: flex; gap: 2px; margin-inline-start: auto; }
.dnd-tools .btn.sm.icon-only { width: 36px; min-height: 36px; }
.drop-zone.empty-zone::after { content: attr(data-empty); color: var(--subtle); font-size: 14px; text-align: center; padding: 10px; }
.st-key { font-family: var(--mono); font-size: 12.5px; color: var(--subtle); }
.st-props { display: flex; flex-direction: column; gap: var(--s4); }
.st-props h4 { margin-top: var(--s2); }
.st-sub { padding: var(--s4); border-radius: var(--r); background: var(--surface-2); display: flex; flex-direction: column; gap: var(--s3); }
.st-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
@media (max-width: 420px) { .st-two { grid-template-columns: minmax(0, 1fr); } }

/* choices editor */
.st-choice { display: flex; align-items: center; gap: 6px; }
.st-choice .input { min-height: 40px; padding-block: 6px; }
.st-swatch { width: 28px; height: 28px; flex: none; border-radius: 8px; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); background: var(--c); cursor: pointer; padding: 0; }
.st-swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--text); }
.st-swatches { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 0 4px; }
.st-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.st-chips button { min-height: 36px; font-size: 14px; }

/* formula */
.st-code { font-family: var(--mono); font-size: 14px; direction: ltr; text-align: left; }
.st-fns { display: flex; flex-wrap: wrap; gap: 4px; }
.st-fns button { font-family: var(--mono); font-size: 12.5px; min-height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.st-fns button:hover { border-color: var(--accent-line); }

/* screen builder */
.st-section { display: flex; flex-direction: column; gap: var(--s3); }
.st-section-head { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.st-section-head .input { flex: 1 1 180px; min-width: 0; }
.st-preview { pointer-events: none; }
.st-preview .grid-form.one { grid-template-columns: minmax(0, 1fr); }

/* process */
.st-stages { display: flex; flex-wrap: wrap; gap: 6px; }
.st-trans { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.st-trans details summary { cursor: pointer; font-weight: 700; font-size: 14px; min-height: 36px; display: flex; align-items: center; }

/* publish report */
.st-report { display: flex; flex-direction: column; gap: var(--s4); }
.st-diff { display: flex; flex-direction: column; gap: 6px; }
.st-diff-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: 14.5px; }
.st-diff-row.add { background: var(--success-soft); } .st-diff-row.rem { background: var(--danger-soft); } .st-diff-row.chg { background: var(--warning-soft); }
.st-samples { margin: 6px 0 0; padding-inline-start: 18px; font-size: 13.5px; color: var(--muted); }

/* form builder */
.st-form-item-body { width: 100%; display: flex; flex-direction: column; gap: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--line); margin-top: 4px; cursor: default; }
.st-form-preview { pointer-events: auto; }
.st-link-box { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); word-break: break-all; }

/* dashboards */
.w-error { display: flex; gap: 8px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: 14px; }
.w-list-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); color: var(--text); text-decoration: none !important; min-height: 40px; }
.w-list-item:hover { background: var(--surface-3); }
.dash-grid .w { min-width: 0; }
.dash-grid .w.sel { outline: 2px solid var(--accent); outline-offset: 2px; }
.dash-grid .w.dragging { opacity: .45; }
.dash-grid.drop-zone { border-style: dashed; }
.dash-grid .w[draggable="true"] { cursor: grab; }
.st-wtools { display: flex; gap: 2px; }
.st-wtools .btn { width: 32px; min-height: 32px; }
.st-save-state { font-size: 13.5px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
@media (max-width: 640px) { .page-head .row.wrap { width: 100%; } .page-head .row.wrap > .btn { flex: 1 1 auto; } }
