:root {
  color-scheme: light;
  --topbar-height: 72px;
  --bg: #f4f6f5;
  --panel: #ffffff;
  --surface: #fbfcfb;
  --surface-raised: #ffffff;
  --surface-muted: #f6f8f7;
  --surface-subtle: #f8fbfa;
  --text: #17201c;
  --strong-text: #33423c;
  --label: #2d3934;
  --muted: #66736d;
  --line: #d9dfdc;
  --line-soft: #c7d8d2;
  --line-subtle: #dfe6e2;
  --accent: #156f62;
  --accent-strong: #0e564c;
  --accent-soft: #f5fbf8;
  --button-fg: #ffffff;
  --warning: #a96800;
  --warning-bg: #fff7da;
  --warning-soft: #fffdfa;
  --warning-line: #e5c76f;
  --warning-strong: #7c5600;
  --danger: #b3261e;
  --danger-bg: #fff7f6;
  --danger-bg-hover: #fff0ee;
  --danger-line: #edb0aa;
  --danger-strong: #8f1f19;
  --success-bg: #e8f5ef;
  --success-line: #9bd2bf;
  --code-bg: #eef4f1;
  --focus-ring: rgba(21, 111, 98, 0.18);
  --modal-backdrop: rgba(23, 32, 28, 0.38);
  --shadow: 0 12px 30px rgba(22, 32, 28, 0.08);
  --shadow-strong: 0 22px 60px rgba(23, 32, 28, 0.24);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1210;
  --panel: #151d19;
  --surface: #111815;
  --surface-raised: #1a2420;
  --surface-muted: #1e2a25;
  --surface-subtle: #17231f;
  --text: #e7efea;
  --strong-text: #edf6f1;
  --label: #d6e2dc;
  --muted: #9aa9a1;
  --line: #2e3d36;
  --line-soft: #3b554c;
  --line-subtle: #31453d;
  --accent: #40c2ad;
  --accent-strong: #85ead8;
  --accent-soft: #112e28;
  --button-fg: #061916;
  --warning: #f1c25f;
  --warning-bg: #302613;
  --warning-soft: #211b10;
  --warning-line: #745821;
  --warning-strong: #ffdc8b;
  --danger: #ff8d83;
  --danger-bg: #321918;
  --danger-bg-hover: #44211f;
  --danger-line: #723935;
  --danger-strong: #ffb4ab;
  --success-bg: #12382f;
  --success-line: #2f725f;
  --code-bg: #101815;
  --focus-ring: rgba(64, 194, 173, 0.28);
  --modal-backdrop: rgba(0, 0, 0, 0.66);
  --shadow: 0 16px 38px rgba(0, 0, 0, 0.34);
  --shadow-strong: 0 22px 70px rgba(0, 0, 0, 0.52);
}

* {
  box-sizing: border-box;
}

html {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
  padding-top: var(--topbar-height);
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  max-width: 100%;
  padding: 16px clamp(14px, 4vw, 36px);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.topbar > * {
  min-width: 0;
  max-width: 100%;
}

.topbar-logo {
  flex: 0 0 auto;
  color: var(--accent-strong);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

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

.topbar-actions,
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.topbar-actions {
  flex: 1 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  position: relative;
}

.topbar-actions.has-form-header-actions {
  align-items: center;
}

.topbar-form-actions {
  order: 1;
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.topbar-form-actions[hidden],
.topbar-form-actions .header-total-menu[hidden],
.topbar-form-actions .project-total[hidden],
.topbar-form-actions .header-save-actions[hidden],
.header-status-message[hidden] {
  display: none;
}

.header-total-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.topbar-form-actions .project-total {
  display: inline-grid;
  align-items: center;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 5px 9px;
  border: 1px solid var(--line-subtle);
  border-radius: 8px;
  background: var(--surface-subtle);
  text-align: left;
}

.topbar-form-actions .project-total.is-clickable {
  cursor: pointer;
  user-select: none;
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.topbar-form-actions .project-total.is-clickable:hover,
.topbar-form-actions .project-total.is-clickable:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--focus-ring);
  outline: none;
}

.topbar-form-actions .project-total.is-clickable[aria-busy="true"] {
  cursor: progress;
  opacity: 0.72;
}

.topbar-form-actions .project-total .eyebrow {
  margin: 0;
  font-size: 11px;
  line-height: 1.05;
}

.topbar-form-actions .project-total-value {
  font-size: 18px;
  line-height: 1;
}

.header-total-dropdown {
  position: absolute;
  z-index: 120;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  min-width: 176px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 40px rgba(13, 35, 29, 0.16);
}

.header-total-dropdown[hidden] {
  display: none;
}

.header-total-dropdown button {
  justify-content: flex-start;
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border-color: transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.header-total-dropdown button:hover,
.header-total-dropdown button:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
  outline: none;
}

.header-save-actions {
  display: inline-flex;
  margin: 0;
}

.header-save-actions button {
  min-height: 32px;
  padding: 6px 11px;
}

.header-status-message {
  position: fixed;
  top: calc(var(--topbar-height) + 8px);
  left: 50%;
  z-index: 89;
  width: min(760px, calc(100vw - 24px));
  max-width: calc(100% - 24px);
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--line-subtle);
  border-radius: 8px;
  background: var(--surface-subtle);
  box-shadow: var(--shadow);
  opacity: 0;
  text-align: center;
  transform: translate(-50%, -8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  cursor: pointer;
  user-select: none;
}

.header-status-message.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.header-status-message.is-fading {
  opacity: 0;
  transform: translate(-50%, -8px);
}

.header-status-message[data-type="success"] {
  border-color: var(--success-line);
  background: var(--success-bg);
  color: var(--accent-strong);
}

.header-status-message[data-type="error"] {
  border-color: var(--danger-line);
  background: var(--danger-bg);
  color: var(--danger);
}

.header-status-message[data-type="warning"] {
  border-color: var(--warning-line);
  background: var(--warning-bg);
  color: var(--warning-strong);
}

.role-nav {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 44px;
  z-index: 80;
  flex-direction: column;
  align-items: stretch;
  width: min(280px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.topbar-actions.menu-open .role-nav {
  display: flex;
}

.role-nav-link {
  display: inline-flex;
  align-items: center;
  width: 100%;
  min-height: 42px;
  border-bottom: 0;
  padding: 0 12px;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

button.role-nav-link {
  min-height: 42px;
  border: 0;
  border-radius: 0;
  padding: 0 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.role-nav-link + .role-nav-link {
  border-top: 1px solid var(--line);
}

.role-nav-link:hover {
  color: var(--accent-strong);
}

button.role-nav-link:hover {
  background: transparent;
  color: var(--accent-strong);
}

.role-nav-link.active {
  background: var(--success-bg);
  color: var(--accent-strong);
}

.role-menu-toggle {
  order: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  width: 40px;
  min-height: 38px;
  gap: 4px;
  padding: 0;
  border-color: var(--line);
  background: var(--surface-raised);
  color: var(--text);
}

.role-menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.role-nav-close {
  display: none;
}

.theme-toggle {
  order: 3;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  min-width: 40px;
  min-height: 38px;
  padding: 0;
  border-color: var(--line);
  background: var(--surface-raised);
  color: var(--text);
}

.theme-toggle:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.theme-toggle-icon {
  position: relative;
  display: block;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 999px;
  box-shadow: inset 6px -5px 0 currentColor;
}

:root[data-theme="dark"] .theme-toggle-icon {
  background: currentColor;
  box-shadow: 0 0 0 5px color-mix(in srgb, currentColor 14%, transparent);
}

.inline-select {
  display: grid;
  gap: 4px;
  min-width: 220px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.inline-select select {
  height: 38px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

h2 {
  margin-bottom: 0;
  font-size: 17px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.status {
  flex: 0 0 auto;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--panel);
  font-size: 12px;
}

.status[data-state="ok"] {
  border-color: var(--success-line);
  color: var(--accent-strong);
  background: var(--success-bg);
}

.status[data-state="error"] {
  border-color: var(--danger-line);
  color: var(--danger);
  background: var(--danger-bg);
}

.page-context {
  display: grid;
  gap: 6px;
  width: min(1280px, calc(100% - 24px));
  margin: 14px auto 0;
  padding: 0 2px;
}

.page-breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.page-breadcrumbs a {
  color: var(--accent-strong);
  text-decoration: none;
}

.page-breadcrumbs a:hover {
  text-decoration: underline;
}

.page-breadcrumbs-separator {
  color: var(--muted);
}

.page-context-title {
  margin: 0;
  font-size: 20px;
}

.page-context > h1 {
  margin: 0;
  font-size: 20px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 14px;
  width: min(1280px, calc(100% - 24px));
  margin: 18px auto;
}

.workspace.single-column {
  grid-template-columns: minmax(0, 1040px);
  justify-content: center;
}

.reference-dictionaries-page-context,
.reference-dictionaries-workspace,
.audit-log-page-context,
.audit-log-workspace {
  width: calc(100% - 16px);
  max-width: none;
}

.workspace.single-column.reference-dictionaries-workspace,
.workspace.single-column.audit-log-workspace {
  grid-template-columns: minmax(0, 1fr);
  justify-content: stretch;
  margin-top: 14px;
}

.reference-dictionaries-workspace .panel,
.audit-log-workspace .panel {
  width: 100%;
}

.panel {
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.panel.builder .panel-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}

.builder-heading-title {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.panel.builder .project-total {
  justify-self: start;
  min-width: 150px;
  width: max-content;
  max-width: 100%;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid var(--line-subtle);
  border-radius: 8px;
  background: var(--surface-subtle);
  text-align: left;
}

.panel.builder > .panel-heading > .toolbar {
  grid-column: 1 / -1;
  width: 100%;
  margin-left: 0;
}

.panel.builder > .panel-heading > .editor-toolbar {
  display: grid;
  align-items: stretch;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line-subtle);
}

.editor-toolbar-primary,
.editor-toolbar-actions {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.editor-toolbar-primary {
  grid-template-columns: minmax(170px, 0.75fr) minmax(360px, 1.65fr);
  align-items: end;
}

.editor-toolbar-selects {
  display: grid;
  grid-template-columns: minmax(160px, 0.85fr) minmax(240px, 1.15fr);
  gap: 10px;
  min-width: 0;
}

.editor-toolbar-actions {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "actions publish";
  align-items: center;
}

.editor-toolbar-secondary-actions {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.editor-toolbar-actions #saveForms {
  grid-area: publish;
  justify-self: end;
  min-width: 190px;
}

.panel.builder > .panel-heading > .toolbar #editorEntryHint {
  grid-area: hint;
  min-height: 0;
  align-self: center;
  padding: 8px 10px;
  border: 1px solid var(--line-subtle);
  border-radius: 8px;
  background: var(--surface-subtle);
}

.panel.builder .inline-select {
  min-width: 0;
}

#productTypeDevelopmentVersion {
  align-self: stretch;
  display: grid;
  place-content: center end;
  min-height: 38px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line-subtle);
  border-radius: 8px;
  background: var(--surface-subtle);
  text-align: right;
}

#productTypeDevelopmentVersion[data-type="success"] {
  border-color: var(--success-line);
  background: var(--success-bg);
  color: var(--accent-strong);
}

#productTypeDevelopmentVersion[data-type="muted"] {
  color: var(--muted);
}

.editor-save-feedback {
  flex: 1 0 100%;
  min-height: 24px;
}

.editor-save-feedback .message {
  width: 100%;
}

.project-total {
  min-width: 0;
  max-width: 100%;
  margin-left: auto;
  text-align: right;
}

.project-total-value {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  overflow-wrap: anywhere;
}

.forms-stack,
.editor-stack {
  display: grid;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
  padding: 12px;
}

.dynamic-form,
.editor-form {
  display: grid;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 96%, #2f8f68);
}

.designer-order-items-stack {
  gap: 10px;
}

.designer-order-items-block {
  gap: 10px;
}

.designer-order-items-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.designer-order-items-summary > div {
  min-width: 0;
  max-width: 100%;
}

.order-item-summary-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.order-item-summary-actions > :is(button, .button-link) {
  flex: 0 0 auto;
}

.designer-order-current-total h2 {
  margin: 0;
  font-size: 32px;
  line-height: 1.1;
}

.designer-order-items-toolbar,
.designer-orders-toolbar {
  display: grid;
  grid-template-columns: auto minmax(240px, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.designer-order-items-toolbar > *,
.designer-orders-toolbar > * {
  min-width: 0;
}

.designer-order-items-toolbar .dictionary-pagination,
.designer-orders-toolbar .dictionary-pagination {
  flex-wrap: nowrap;
}

.designer-order-items-toolbar button,
.designer-orders-toolbar button {
  white-space: nowrap;
}

.designer-order-items-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.designer-order-item-card,
.designer-order-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 26px;
  min-width: 0;
  min-height: 160px;
  padding: 24px 28px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 14px 32px rgb(15 23 42 / 0.05);
  cursor: pointer;
}

.designer-order-card {
  grid-template-columns: minmax(0, 1fr);
}

.designer-order-item-card:hover,
.designer-order-card:hover {
  border-color: var(--accent);
  background: var(--surface-raised);
}

.designer-order-item-card:focus-visible,
.designer-order-card:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.designer-list-card-rail {
  display: flex;
  min-width: 0;
  min-height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.designer-list-card-index {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent-soft) 72%, #ffffff), var(--surface-muted));
  color: var(--accent-strong);
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
}

.designer-list-card-index-system {
  background: var(--surface-muted);
  border: 0;
  color: transparent;
}

.designer-list-card-rail-meta {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  width: 100%;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.designer-list-card-rail-meta strong {
  color: var(--strong-text);
  font-size: 16px;
  line-height: 1;
  text-transform: none;
}

.designer-list-card-content {
  display: grid;
  min-width: 0;
  align-content: space-between;
  gap: 22px;
}

.designer-list-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 18px;
  min-width: 0;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.designer-order-item-card-main,
.designer-order-card-main {
  min-width: 0;
}

.designer-order-item-card-title {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.designer-order-item-card-title h3,
.designer-order-card-main h3 {
  margin: 0;
  color: var(--strong-text);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.designer-order-item-card-badges,
.designer-order-item-card-actions,
.designer-order-card-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.designer-order-item-card-actions,
.designer-order-card-actions {
  flex: 0 0 auto;
  justify-content: flex-end;
}

.designer-list-card-details {
  display: grid;
  gap: 24px;
  margin: 0;
  align-items: end;
}

.designer-order-item-card-details {
  grid-template-columns: minmax(220px, 1fr) minmax(140px, 180px) minmax(190px, 220px);
}

.designer-order-item-card-details-system {
  grid-template-columns: minmax(220px, 1fr) minmax(120px, 160px) minmax(190px, 220px);
}

.designer-order-card-details {
  grid-template-columns: minmax(130px, 180px) minmax(190px, 220px) minmax(280px, 1fr);
}

.designer-list-card-details div {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.designer-card-detail-date,
.designer-card-detail-report {
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.designer-order-item-card-details .designer-card-detail-date {
  grid-column: 3;
}

.designer-list-card-details dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.designer-list-card-details dd {
  min-width: 0;
  margin: 0;
  color: var(--strong-text);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.order-item-forms-stack {
  padding: 0;
}

.runtime-data-form {
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.runtime-form-header {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
}

.runtime-data-form > .form-grid {
  padding: 12px;
}

.order-totals-summary-form > .form-grid {
  border-bottom: 1px solid var(--line);
}

.order-totals-breakdown {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: var(--surface-raised);
}

.order-totals-breakdown-header h4,
.order-totals-breakdown-field-header h4 {
  margin: 0;
}

.order-totals-breakdown-header h4 {
  font-size: 16px;
}

.order-totals-breakdown-field {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.order-totals-breakdown-field-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.order-totals-breakdown-field-header h4 {
  font-size: 14px;
}

.order-totals-breakdown-field-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.order-totals-breakdown-items {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.order-totals-breakdown-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 6px 0;
  border-top: 1px solid var(--line-soft);
}

.order-totals-breakdown-item:first-child {
  border-top: 0;
}

.order-totals-breakdown-item-name,
.order-totals-breakdown-item-value {
  min-width: 0;
  overflow-wrap: anywhere;
}

.order-totals-breakdown-item-name {
  color: var(--text);
}

.order-totals-breakdown-item-value {
  color: var(--label);
  font-weight: 700;
  text-align: right;
  white-space: pre-line;
}

.order-item-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

a.button-link.is-disabled {
  pointer-events: none;
  opacity: 0.62;
}

.form-title-row,
.editor-form-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.form-heading-main {
  min-width: 0;
}

.form-heading-main h3 {
  overflow-wrap: anywhere;
}

.form-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-collapsed-price {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.form-hidden-badge {
  display: inline-flex;
  width: fit-content;
  margin-top: 4px;
  padding: 2px 8px;
  border: 1px solid var(--warning-line);
  border-radius: 999px;
  background: var(--warning-bg);
  color: var(--warning-strong);
  font-size: 12px;
  font-weight: 700;
}

.form-hidden-badge[hidden] {
  display: none;
}

.dynamic-form.is-hidden-by-visible-if,
.dynamic-form.is-hidden-by-repeat-count {
  background: var(--warning-soft);
  border-color: var(--warning-line);
}

h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}

.form-grid.form-grid-layout {
  grid-template-columns: repeat(var(--form-layout-columns, 1), minmax(0, 1fr));
  align-items: start;
  grid-auto-rows: auto;
}

.form-grid-layout .runtime-field,
.form-grid-layout .runtime-fieldset {
  min-width: 0;
  align-self: start;
}

.form-grid-layout input:not([type="checkbox"]),
.form-grid-layout select,
.form-grid-layout textarea {
  min-width: 0;
}

.editor-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--label);
  font-size: 13px;
  font-weight: 700;
}

.runtime-link-field,
.runtime-url-field,
.runtime-textarea-field,
.runtime-heading-field {
  display: grid;
  gap: 6px;
  color: var(--label);
  font-size: 13px;
  font-weight: 700;
}

.runtime-textarea-field > label {
  min-width: 0;
}

.runtime-textarea-value {
  min-height: 66px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--text);
  font-weight: 500;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.runtime-textarea-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.runtime-textarea-links[hidden] {
  display: none;
}

.runtime-text-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.runtime-textarea-links .runtime-text-link {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-raised);
}

.runtime-text-link:hover {
  color: var(--accent-strong);
}

.runtime-heading-field {
  padding: 6px 0 2px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 16px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.runtime-link-value {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--accent);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.runtime-link-open {
  width: fit-content;
  max-width: 100%;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.runtime-link-open:hover {
  color: var(--accent-strong);
}

.runtime-link-open[hidden] {
  display: none;
}

.field-name {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

input,
select,
textarea {
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text);
  font: inherit;
  font-weight: 500;
}

input:not([type="checkbox"]),
select,
textarea {
  width: 100%;
}

input:not([type="checkbox"]),
select {
  height: 36px;
  padding: 0 10px;
}

textarea {
  min-height: 84px;
  padding: 10px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid var(--focus-ring);
  border-color: var(--accent);
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

input[readonly],
textarea[readonly],
input[data-runtime-locked="1"],
textarea[data-runtime-locked="1"] {
  background: var(--surface-muted);
  color: var(--muted);
}

input[readonly],
textarea[readonly] {
  cursor: not-allowed;
}

.full,
.actions {
  grid-column: 1 / -1;
}

.hidden {
  display: none !important;
}

[hidden] {
  display: none !important;
}

.checkbox-field,
.checkbox-option {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-field {
  min-height: 44px;
}

.checkbox-field span,
.checkbox-option span {
  font-weight: 500;
}

.checkbox-field input[type="checkbox"]:checked + span,
.checkbox-option input[type="checkbox"]:checked + span {
  font-weight: 700;
}

.runtime-fieldset {
  margin: 0;
  padding: 10px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-raised);
}

.runtime-fieldset legend {
  padding: 0 6px;
  color: var(--label);
  font-size: 14px;
  font-weight: 700;
}

.runtime-fieldset .checkbox-option + .checkbox-option {
  margin-top: 10px;
}

.runtime-field-messages {
  display: grid;
  gap: 6px;
  margin: 0;
}

.checkbox-field {
  flex-wrap: wrap;
}

.checkbox-field .runtime-field-messages {
  flex: 0 0 100%;
  margin-left: 28px;
}

.runtime-field-message {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
}

.runtime-field-message.warning {
  color: var(--warning);
}

.runtime-field-message.error {
  color: var(--danger);
}

.runtime-validation-message {
  margin: 0;
  color: var(--danger);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.dynamic-form.runtime-form-required-error {
  border-color: var(--danger);
  box-shadow: 0 0 0 1px var(--danger);
}

.runtime-required-error input:not([type="checkbox"]),
.runtime-required-error select,
.runtime-required-error textarea,
.runtime-field-error input:not([type="checkbox"]),
.runtime-field-error select,
.runtime-field-error textarea {
  border-color: var(--danger);
  box-shadow: 0 0 0 1px var(--danger);
}

.runtime-field-warning input:not([type="checkbox"]),
.runtime-field-warning select,
.runtime-field-warning textarea {
  border-color: var(--warning);
  outline: 2px solid var(--warning);
  outline-offset: 2px;
}

.checkbox-field.runtime-required-error > input[type="checkbox"],
.checkbox-field.runtime-field-error > input[type="checkbox"] {
  outline: 2px solid var(--danger);
  outline-offset: 2px;
}

.checkbox-field.runtime-field-warning > input[type="checkbox"] {
  outline: 2px solid var(--warning);
  outline-offset: 2px;
}

.runtime-fieldset.runtime-required-error,
.runtime-fieldset.runtime-field-error {
  border-color: var(--danger);
  border-width: 2px;
}

.runtime-fieldset.runtime-field-warning {
  border-color: var(--warning);
  border-width: 2px;
  outline: 2px solid var(--warning);
  outline-offset: 2px;
}

.runtime-fieldset > .runtime-validation-message {
  margin-top: 8px;
}

.checkbox-field.runtime-required-error,
.checkbox-field.runtime-field-error,
.checkbox-field.runtime-field-warning {
  flex-wrap: wrap;
}

.checkbox-field .runtime-validation-message {
  flex: 0 0 100%;
  margin-left: 28px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
}

button {
  min-height: 34px;
  max-width: 100%;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 0 12px;
  background: var(--accent);
  color: var(--button-fg);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

a.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  max-width: 100%;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 0 12px;
  background: var(--accent);
  color: var(--button-fg);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  overflow-wrap: anywhere;
}

a.button-link:hover {
  background: var(--accent-strong);
}

button:hover {
  background: var(--accent-strong);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

button.secondary {
  border-color: var(--line);
  background: var(--surface-raised);
  color: var(--text);
}

button.secondary,
a.button-link.secondary {
  border-color: var(--line);
  background: var(--surface-raised);
  color: var(--text);
}

button.secondary:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

button.secondary:hover,
a.button-link.secondary:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

button.role-menu-toggle:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

button.danger {
  border-color: var(--danger);
  background: var(--danger);
}

button.secondary-danger {
  border-color: var(--danger-line);
  background: var(--danger-bg);
  color: var(--danger);
}

button.secondary-danger:hover {
  border-color: var(--danger);
  background: var(--danger-bg-hover);
  color: var(--danger);
}

button.danger:hover {
  background: var(--danger-strong);
}

button.icon-button {
  display: inline-grid;
  place-items: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-color: var(--danger-line);
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 17px;
  line-height: 1;
}

button.icon-button:hover {
  border-color: var(--danger);
  background: var(--danger-bg-hover);
}

button.edit-form-button {
  border-color: var(--line-soft);
  background: var(--surface-raised);
  color: var(--accent-strong);
}

button.edit-form-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

button.layout-form-button {
  border-color: var(--line-soft);
  background: var(--surface-raised);
  color: var(--accent-strong);
}

button.layout-form-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

button.recalculate-form-button {
  width: 36px;
  min-width: 36px;
  border-color: var(--line-soft);
  background: var(--surface-raised);
  color: var(--accent-strong);
  font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "Arial Unicode MS", sans-serif;
  font-size: 13px;
}

button.recalculate-form-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.layout-form-icon {
  display: block;
  width: 16px;
  height: 11px;
  border: 2px solid currentColor;
}

button.delete-form-button {
  font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "Arial Unicode MS", sans-serif;
}

button.move-form-button {
  border-color: var(--line-soft);
  background: var(--surface-raised);
  color: var(--accent-strong);
  font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "Arial Unicode MS", sans-serif;
  font-size: 15px;
}

button.move-form-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

button.form-collapse-button {
  border-color: var(--line-soft);
  background: var(--surface-raised);
  color: var(--accent-strong);
}

button.form-collapse-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.message {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.message ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.message p {
  margin: 0;
}

.message li + li {
  margin-top: 4px;
}

.message[data-type="success"] {
  color: var(--accent-strong);
}

.message[data-type="error"] {
  color: var(--danger);
}

.form-footer {
  display: grid;
  gap: 10px;
  min-height: 34px;
  padding: 0 24px 20px;
}

.form-footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.editor-fields {
  display: grid;
  gap: 12px;
}

.editor-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.editor-list-item h3 {
  overflow-wrap: anywhere;
}

.editor-meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.editor-bottom {
  display: flex;
  justify-content: center;
  padding: 8px 0 4px;
}

.editor-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}

.editor-form-settings {
  display: grid;
  gap: 12px;
}

.editor-form.editor-layout-enabled .editor-form-settings,
.editor-field.editor-layout-enabled {
  grid-template-columns: repeat(var(--editor-layout-columns, 1), minmax(0, 1fr));
  grid-auto-flow: row dense;
}

.editor-layout-block {
  min-width: 0;
  align-self: start;
}

.editor-action-block {
  display: flex;
  align-items: flex-end;
  min-height: 38px;
}

.editor-action-block > :is(button, .button-link) {
  width: 100%;
}

.form-repeat-mode-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.form-repeat-mode-switch legend {
  margin: 0 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.form-repeat-mode-switch label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.form-repeat-mode-switch input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.form-repeat-mode-switch label:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 56%, var(--line));
  background: var(--success-bg);
  color: var(--success-strong);
}

.editor-field.editor-layout-enabled .editor-field-grid,
.editor-field.editor-layout-enabled .editor-field-technical,
.editor-field.editor-layout-enabled .editor-field-technical .editor-tech-grid {
  display: contents;
}

.editor-field.editor-layout-enabled .editor-tech-notes,
.editor-field.editor-layout-enabled .editor-field-dependencies {
  grid-column: 1 / -1;
}

.editor-technical,
.editor-field-technical {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line-subtle);
  border-radius: 8px;
  background: var(--surface-subtle);
}

.editor-tech-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.editor-tech-notes {
  display: grid;
  gap: 6px;
}

.editor-options-data-block {
  display: grid;
  gap: 10px;
}

.editor-default-value-block {
  display: grid;
  gap: 10px;
}

.field-code-editor {
  display: grid;
  gap: 8px;
}

body.field-code-fullscreen-open {
  overflow: hidden;
}

.field-code-editor.is-code-fullscreen {
  position: fixed;
  top: 12px;
  right: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 120;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  align-self: auto;
  width: calc(100vw - 24px);
  height: calc(100vh - 24px);
  height: calc(100dvh - 24px);
  max-width: none;
  max-height: none;
  min-height: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-strong);
}

.field-code-editor.is-code-fullscreen > label {
  min-height: 0;
}

.field-code-editor.is-code-fullscreen .field-code-codemirror-host {
  min-height: 0;
  height: 100%;
  margin-top: 0;
}

.field-code-editor.is-code-fullscreen .field-code-codemirror-host .cm-editor {
  height: 100%;
}

.field-code-editor.is-code-fullscreen .field-code-codemirror-host .cm-scroller {
  min-height: 0;
  max-height: none;
  height: 100%;
}

.field-code-editor.is-code-fullscreen .field-code-result {
  max-height: 24vh;
  overflow: auto;
}

@media (max-width: 640px) {
  .field-code-editor.is-code-fullscreen {
    inset: auto;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    padding: 10px;
  }
}

.field-code-native-textarea {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.field-code-codemirror-host {
  margin-top: 6px;
}

.field-code-codemirror-host .cm-editor {
  box-sizing: border-box;
}

.field-code-codemirror-host .cm-tooltip {
  border: 1px solid var(--line-subtle);
  border-radius: 6px;
  box-shadow: var(--shadow);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
}

.field-code-codemirror-host .cm-panel.cm-search {
  box-shadow: inset 0 -1px 0 var(--line-subtle);
}

.field-code-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}

.field-code-actions button {
  min-height: 30px;
}

.field-code-result {
  display: grid;
  gap: 6px;
}

.field-code-result-json {
  max-height: 180px;
  margin: 0;
  padding: 8px;
  overflow: auto;
  border: 1px solid var(--line-subtle);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--label);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.editor-tech-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.editor-tech-note code {
  padding: 2px 4px;
  border-radius: 4px;
  background: var(--code-bg);
  color: var(--label);
}

.editor-tech-note.success {
  color: var(--accent-strong);
}

.editor-tech-note.warning {
  color: var(--warning);
}

.editor-tech-note.error {
  color: var(--danger);
}

.editor-field-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.editor-field-tool {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.editor-field-copy-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
}

.editor-field-dependencies {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.editor-field-dependencies.used-by {
  color: var(--accent-strong);
}

.editor-field-dependencies.error {
  color: var(--danger);
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.form-layout-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 16px;
  padding: 14px;
  align-items: stretch;
  overflow: visible;
}

.form-layout-fields-panel,
.form-layout-board-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.form-layout-fields-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-self: stretch;
  min-height: 0;
  overflow: hidden;
}

.form-layout-panel-heading {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.form-layout-panel-heading h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
}

.form-layout-field-search {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.form-layout-field-search input {
  height: 34px;
  font-size: 13px;
}

.form-layout-field-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.form-layout-field-filter input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.form-layout-fields-list {
  display: grid;
  gap: 10px;
  min-height: 0;
  max-height: none;
  padding: 12px;
  overflow-y: auto;
}

.form-layout-field-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.form-layout-field-card:hover {
  border-color: color-mix(in srgb, var(--field-color, var(--accent)) 32%, var(--line));
  background: color-mix(in srgb, var(--field-color, var(--accent)) 4%, var(--surface-raised));
}

.form-layout-field-card.is-selected {
  border-color: color-mix(in srgb, var(--field-color, var(--accent)) 62%, var(--line));
  background: color-mix(in srgb, var(--field-color, var(--accent)) 7%, var(--surface-raised));
  box-shadow:
    inset 4px 0 0 var(--field-color, var(--accent)),
    0 0 0 2px color-mix(in srgb, var(--field-color, var(--accent)) 16%, transparent);
}

.form-layout-field-select {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.form-layout-field-select:hover {
  background: transparent;
}

.form-layout-field-select:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--field-color, var(--accent)) 38%, transparent);
  outline-offset: 4px;
  border-radius: 6px;
  background: transparent;
}

.form-layout-field-swatch {
  width: 16px;
  min-height: 80px;
  border-radius: 4px;
  background: var(--field-color, var(--accent));
}

.form-layout-field-text {
  display: grid;
  gap: 4px;
  min-width: 0;
  font-size: 13px;
  line-height: 1.25;
}

.form-layout-field-text span {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
}

.form-layout-field-text b {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.form-layout-field-color {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.form-layout-field-color input[type="color"] {
  width: 54px;
  height: 32px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-raised);
}

.form-layout-board-panel {
  display: grid;
  align-self: start;
  gap: 16px;
  padding: 14px;
}

.form-layout-viewport-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.form-layout-viewport-switch legend {
  margin: 0 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.form-layout-viewport-switch label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.form-layout-viewport-switch input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.form-layout-viewport-switch label:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 56%, var(--line));
  background: var(--success-bg);
  color: var(--success-strong);
}

.form-layout-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 240px));
  gap: 12px;
  align-items: end;
}

.form-layout-controls-actions {
  display: flex;
  justify-content: flex-start;
}

.form-layout-controls-actions > button {
  min-width: 140px;
}

.form-layout-preview {
  max-width: 100%;
  overflow: auto;
}

.form-layout-table {
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 240px;
  background: var(--surface-raised);
}

.form-layout-table td {
  width: 88px;
  height: 62px;
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 800;
  text-align: center;
  vertical-align: middle;
}

.form-layout-grid-cell.is-assigned {
  border-color: color-mix(in srgb, var(--cell-color, var(--accent)) 42%, var(--line));
  background: color-mix(in srgb, var(--cell-color, var(--accent)) 18%, var(--surface-raised));
}

.form-layout-grid-cell.is-selected-owner {
  outline: 2px solid color-mix(in srgb, var(--cell-color, var(--accent)) 54%, transparent);
  outline-offset: -2px;
}

.form-layout-grid-cell.is-occupied {
  background: color-mix(in srgb, var(--cell-color, var(--accent)) 28%, var(--surface-raised));
}

.form-layout-cell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  padding: 8px;
  cursor: pointer;
}

.form-layout-cell-number {
  min-width: 0;
  overflow-wrap: anywhere;
}

.form-layout-cell input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--cell-color, var(--accent));
}

.form-layout-cell input[type="checkbox"]:disabled {
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .form-layout-workspace {
    grid-template-columns: 1fr;
  }

  .form-layout-fields-panel {
    position: static;
    height: auto;
    max-height: 360px;
  }

  .form-layout-fields-list {
    max-height: 310px;
  }
}

.checkline {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
}

.checkline input {
  width: 18px;
  height: 18px;
}

.editor-empty {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 24px;
}

.request-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.dashboard-links {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.dashboard-link {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.dashboard-link strong {
  color: var(--strong-text);
  font-size: 16px;
}

.dashboard-link span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.dashboard-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.designer-orders-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.designer-order-report-link {
  display: grid;
  gap: 3px;
  min-width: 0;
  color: var(--accent);
  font-weight: 700;
  line-height: 1.25;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.designer-order-report-url {
  min-width: 0;
  overflow-wrap: anywhere;
}

.designer-order-report-empty {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
}

.designer-order-report-link:hover {
  color: var(--accent-strong);
}

.designer-order-card-meta-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 860px) {
  .designer-order-item-card,
  .designer-order-card {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .designer-list-card-rail {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
  }

  .designer-list-card-index {
    width: 62px;
    height: 62px;
    font-size: 24px;
  }

  .designer-list-card-header {
    grid-template-columns: 1fr;
  }

  .designer-order-item-card-actions,
  .designer-order-card-actions {
    justify-content: flex-start;
  }

  .designer-order-item-card-details,
  .designer-order-card-details {
    grid-template-columns: 1fr;
  }

  .designer-order-item-card-details .designer-card-detail-date {
    grid-column: auto;
  }

  .designer-card-detail-date,
  .designer-card-detail-report {
    padding-left: 0;
    border-left: 0;
  }
}

.dictionary-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dictionary-tabs .active-tab {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.dictionary-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  min-width: 0;
}

.dictionary-layout.dictionary-layout-no-filter,
.dictionary-layout.is-filter-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

.dictionary-main {
  display: grid;
  gap: 12px;
  min-width: 0;
  overflow: hidden;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.dictionary-filter-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.dictionary-filter-panel[hidden] {
  display: none;
}

.dictionary-filter-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.dictionary-filter-heading h3 {
  font-size: 13px;
}

.dictionary-filter-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.dictionary-layout.is-filter-collapsed .dictionary-filter-heading {
  justify-content: space-between;
  padding: 10px;
  border-bottom: 0;
}

.dictionary-layout.is-filter-collapsed .dictionary-filter-heading h3 {
  display: block;
}

.dictionary-filter-content {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.dictionary-filter-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.dictionary-filter-field {
  gap: 5px;
  min-width: 0;
}

.dictionary-filter-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dictionary-filter-field .dictionary-filter-input {
  min-width: 0;
}

.dictionary-filter-controls {
  justify-content: flex-start;
  padding-top: 2px;
}

.dictionary-controls,
.dictionary-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dictionary-controls {
  justify-content: space-between;
}

.dictionary-table-footer {
  padding-top: 2px;
}

.dictionary-controls label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dictionary-controls select {
  min-width: 84px;
}

.dictionary-pagination span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dictionary-table-wrap {
  overflow: auto;
}

.dictionary-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.dictionary-table.dictionary-table-resizable {
  table-layout: fixed;
  width: max(100%, var(--dictionary-table-width, 760px));
  min-width: var(--dictionary-table-width, 760px);
}

.dictionary-table.dictionary-table-readonly {
  min-width: 680px;
}

.dictionary-table th,
.dictionary-table td {
  padding: 7px 8px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.dictionary-table .dictionary-col-texture,
.dictionary-table .dictionary-col-active {
  text-align: center;
}

.dictionary-table .dictionary-col-price input[type="number"] {
  width: 100%;
}

.dictionary-table .dictionary-col-unit select {
  width: 100%;
}

.dictionary-readonly-value {
  display: block;
  min-height: 22px;
  overflow: hidden;
  color: var(--text);
  line-height: 1.4;
  text-overflow: ellipsis;
}

.dictionary-readonly-boolean {
  color: var(--muted);
  font-weight: 700;
}

.dictionary-table.dictionary-table-readonly .dictionary-col-active .dictionary-readonly-value {
  text-align: center;
}

.dictionary-table input.dictionary-field-dirty,
.dictionary-table select.dictionary-field-dirty {
  border-color: var(--warning);
  outline: 2px solid var(--warning);
  outline-offset: 2px;
}

.dictionary-table button.dictionary-row-save-dirty {
  border-color: var(--warning);
  outline: 2px solid var(--warning);
  outline-offset: 2px;
}

.dictionary-table th {
  position: relative;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--surface-muted);
  color: var(--label);
  font-size: 12px;
}

.dictionary-header-content {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.dictionary-header-label {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dictionary-sort-button {
  display: inline-flex;
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  min-height: 0;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.dictionary-sort-button:hover {
  background: transparent;
  color: var(--accent-strong);
}

.dictionary-column-resizer {
  position: absolute;
  top: 0;
  right: -4px;
  z-index: 2;
  display: block;
  width: 9px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}

.dictionary-column-resizer::after {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 4px;
  width: 2px;
  border-radius: 999px;
  background: transparent;
  content: "";
}

.dictionary-column-resizer:hover::after,
.dictionary-column-resizer:focus-visible::after,
body.dictionary-column-resizing .dictionary-column-resizer::after {
  background: var(--accent);
}

.dictionary-column-resizer:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: -3px;
}

body.dictionary-column-resizing,
body.dictionary-column-resizing * {
  cursor: col-resize !important;
  user-select: none;
}

.dictionary-sort-symbol {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}

.dictionary-sort-button:hover .dictionary-sort-symbol,
.dictionary-table th[aria-sort="ascending"] .dictionary-sort-symbol,
.dictionary-table th[aria-sort="descending"] .dictionary-sort-symbol {
  color: var(--accent-strong);
}

.dictionary-filter-input {
  width: 100%;
  min-width: 120px;
}

.dictionary-filter-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.dictionary-table td input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.product-type-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.product-type-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 14px;
  min-width: 0;
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}

.product-type-card:hover {
  border-color: var(--accent);
  background: var(--surface-raised);
}

.product-type-card:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-color: var(--accent);
}

.product-type-card-field {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.product-type-card-label {
  color: var(--label);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.product-type-card-value {
  min-width: 0;
  color: var(--strong-text);
  font-size: 14px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.product-type-card-actions {
  justify-items: end;
}

.product-type-row-actions {
  position: relative;
  display: inline-flex;
  justify-content: flex-end;
}

.product-type-action-menu-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  min-width: 38px;
  min-height: 34px;
  gap: 4px;
  padding: 0;
  border-color: var(--line);
  background: var(--surface-raised);
  color: var(--text);
}

.product-type-action-menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.product-type-action-menu-button:hover,
.product-type-action-menu-button[aria-expanded="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.product-type-action-menu {
  position: fixed;
  z-index: 30;
  display: grid;
  min-width: 180px;
  max-height: calc(100vh - 16px);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-strong);
}

.product-type-action-menu[hidden] {
  display: none;
}

.product-type-action-menu-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 36px;
  width: 100%;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
}

.product-type-action-menu-item:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.product-type-action-menu-item:disabled {
  background: transparent;
  color: var(--muted);
  opacity: 0.7;
}

.audit-log-layout {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.audit-log-tabs,
.audit-log-sidebar,
.audit-log-content {
  grid-column: 1 / -1;
}

.audit-log-sidebar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.audit-log-sidebar h3 {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 14px;
}

.audit-log-sidebar label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.audit-log-filter-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.audit-log-filter-actions button {
  justify-content: center;
}

.audit-log-content {
  display: grid;
  gap: 12px;
  min-width: 0;
  overflow: hidden;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.audit-log-content .dictionary-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.variable-catalog-section {
  display: grid;
  gap: 12px;
}

.variable-catalog-section h3 {
  margin: 0;
}

.variable-catalog-groups {
  display: grid;
  gap: 14px;
}

.variable-catalog-group {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.variable-catalog-group h4 {
  margin: 0;
}

.variable-catalog-group .dictionary-table {
  min-width: 680px;
}

.designer-order-item-card-unsaved {
  background: var(--warning-bg);
}

.designer-order-item-unsaved-label {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--warning-line);
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--warning-soft);
  color: var(--warning-strong);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.request-item {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.request-item-compact {
  padding: 10px;
}

.request-item.active-version {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--focus-ring);
}

.request-header,
.request-item footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.request-header {
  align-items: flex-start;
  flex-wrap: wrap;
}

.request-header > div:not(.toolbar) {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.request-header > .toolbar {
  flex: 0 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
}

.request-item strong,
.request-item b {
  overflow-wrap: anywhere;
}

.request-item span,
.request-item time,
.request-item p {
  color: var(--muted);
  font-size: 13px;
}

.request-item p {
  margin: 0;
  line-height: 1.45;
}

.request-item b {
  color: var(--strong-text);
}

.submission-values {
  display: grid;
  gap: 5px;
}

.request-summary-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(104px, 0.45fr);
  gap: 8px;
}

.request-summary-button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  min-height: 38px;
  padding: 8px 10px;
  text-align: left;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.request-summary-static {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text);
}

.request-summary-amount {
  justify-content: flex-end;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.empty {
  margin: 0;
  padding: 20px 8px;
  color: var(--muted);
  text-align: center;
}

body.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: var(--modal-backdrop);
  z-index: 20;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(100%, 390px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel);
  box-shadow: var(--shadow-strong);
}

.modal-wide {
  width: min(100%, 620px);
}

.modal-text {
  margin: 14px 0 22px;
  color: var(--muted);
  line-height: 1.5;
}

.role-switcher-summary {
  margin-bottom: 14px;
}

.role-switcher-field {
  width: 100%;
  min-width: 0;
  margin-bottom: 18px;
}

.role-switcher-field select {
  width: 100%;
}

.modal-error {
  margin: -8px 0 18px;
}

.modal-error[hidden] {
  display: none;
}

.publish-preflight {
  margin-top: 12px;
  font-size: 14px;
  color: var(--muted);
}

.publish-preflight[data-state="success"] {
  color: var(--accent-strong);
}

.publish-preflight[data-state="error"] {
  color: var(--danger);
}

.publish-preflight-results {
  margin-top: 12px;
  max-height: 230px;
  overflow: auto;
}

.publish-preflight-results ul {
  margin: 0;
  padding: 0 0 0 20px;
}

.publish-preflight-results li + li {
  margin-top: 6px;
}

.order-totals-admin-preview-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  margin-top: 12px;
  overflow: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.order-totals-admin-preview-option {
  min-height: 38px;
  padding: 6px 8px;
  border-radius: 6px;
}

.order-totals-admin-preview-option:hover {
  background: var(--surface-muted);
}

.publish-preflight-title {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--text);
}

.publish-preflight-title.error {
  color: var(--danger);
}

.publish-preflight-title.warning {
  color: var(--warning);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

:root[data-theme="dark"] .field-code-codemirror-host .cm-editor {
  background: var(--surface-raised);
  color: var(--text);
}

:root[data-theme="dark"] .field-code-codemirror-host .cm-gutters {
  border-color: var(--line);
  background: var(--surface);
  color: var(--muted);
}

:root[data-theme="dark"] .field-code-codemirror-host .cm-activeLine,
:root[data-theme="dark"] .field-code-codemirror-host .cm-activeLineGutter {
  background: transparent;
}

:root[data-theme="dark"] .field-code-codemirror-host .cm-selectionBackground,
:root[data-theme="dark"] .field-code-codemirror-host .cm-focused .cm-selectionBackground {
  background: #4d8fd6;
}

:root[data-theme="dark"] .field-code-codemirror-host .cm-content ::selection {
  background: #4d8fd6;
  color: #f8fbff;
}

:root[data-theme="dark"] .field-code-codemirror-host .cm-content {
  caret-color: var(--accent-strong);
}

:root[data-theme="dark"] .field-code-codemirror-host .cm-tooltip {
  background: var(--surface-raised);
  color: var(--text);
}

:root[data-theme="dark"] .field-code-codemirror-host .cm-panel.cm-search {
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: inset 0 -1px 0 var(--line);
}

:root[data-theme="dark"] .field-code-codemirror-host .cm-panel.cm-search input:not([type="checkbox"]) {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

:root[data-theme="dark"] .field-code-codemirror-host .cm-panel.cm-search button {
  border-color: var(--line-soft);
  background: var(--surface-muted);
  color: var(--text);
}

:root[data-theme="dark"] .field-code-codemirror-host .cm-panel.cm-search button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

:root[data-theme="dark"] .field-code-codemirror-host .cm-panel.cm-search button[name="close"] {
  border-color: transparent;
  background: transparent;
  color: var(--text);
}

:root[data-theme="dark"] .field-code-codemirror-host .cm-panel.cm-search button[name="close"]:hover {
  border-color: var(--line-soft);
  background: var(--surface-muted);
  color: var(--accent-strong);
}

:root[data-theme="dark"] .field-code-codemirror-host .cm-panel.cm-search label {
  color: var(--label);
}

@media (max-width: 860px) {
  body.role-menu-open {
    overflow: hidden;
  }

  .topbar {
    align-items: flex-start;
    gap: 10px 8px;
    padding: 12px;
  }

  .panel-heading,
  .designer-order-items-summary,
  .toolbar,
  .form-title-row,
  .editor-form-heading,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    align-items: center;
    flex-direction: row;
    justify-content: flex-end;
    flex: 0 1 auto;
  }

  .topbar-actions.has-form-header-actions {
    flex: 1 1 auto;
    align-items: flex-end;
  }

  .topbar-actions.has-form-header-actions {
    display: contents;
  }

  .topbar-form-actions {
    order: 1;
    justify-content: flex-end;
  }

  .topbar-logo {
    display: inline-flex;
    align-items: center;
    font-size: 15px;
    min-height: 38px;
  }

  .topbar-actions.has-form-header-actions > .role-menu-toggle {
    order: 2;
    margin-left: auto;
  }

  .topbar-actions.has-form-header-actions > .theme-toggle {
    order: 3;
  }

  .topbar-actions.has-form-header-actions > .topbar-form-actions {
    order: 4;
    flex: 1 0 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    justify-content: stretch;
    gap: 8px;
    width: 100%;
  }

  .topbar-actions.has-form-header-actions > .topbar-form-actions > .header-save-actions {
    width: 100%;
  }

  .topbar-actions.has-form-header-actions > .topbar-form-actions > .header-save-actions button {
    width: 100%;
    min-height: 38px;
  }

  .topbar-actions.has-form-header-actions > .topbar-form-actions > .header-total-menu,
  .topbar-actions.has-form-header-actions > .topbar-form-actions > .project-total {
    min-width: 108px;
    justify-self: stretch;
  }

  .topbar-actions.has-form-header-actions > .topbar-form-actions > .header-total-menu:only-child,
  .topbar-actions.has-form-header-actions > .topbar-form-actions > .project-total:only-child,
  .topbar-actions.has-form-header-actions > .topbar-form-actions > .header-save-actions:only-child {
    grid-column: 1 / -1;
  }

  .topbar-actions.has-form-header-actions > .topbar-form-actions .project-total {
    min-height: 38px;
    padding: 6px 10px;
  }

  .topbar-actions.has-form-header-actions > .topbar-form-actions .project-total .eyebrow {
    font-size: 10px;
  }

  .topbar-actions.has-form-header-actions > .topbar-form-actions .project-total-value {
    font-size: 16px;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  .role-menu-toggle {
    display: inline-flex;
    order: 2;
  }

  .theme-toggle {
    order: 3;
  }

  .topbar-actions .status {
    flex: 0 1 auto;
    order: 2;
  }

  .role-nav {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    order: 3;
    flex: 0 0 auto;
    align-items: stretch;
    flex-direction: column;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    gap: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    padding: calc(14px + env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    background: var(--surface-raised);
    box-shadow: none;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .topbar-actions.menu-open .role-nav {
    display: flex;
  }

  .role-nav-close {
    display: inline-flex;
    align-self: flex-end;
    gap: 8px;
    min-height: 40px;
    margin: 0 0 12px;
    border-color: var(--line);
    background: var(--surface-raised);
    color: var(--text);
  }

  .role-nav-close:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-strong);
  }

  .role-nav-link {
    width: 100%;
    max-width: 100%;
    min-height: 50px;
    border-bottom: 0;
    padding: 0 10px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  button.role-nav-link {
    width: 100%;
    max-width: 100%;
    border-bottom: 0;
    padding: 0 10px;
  }

  .role-nav-link + .role-nav-link {
    border-top: 1px solid var(--line);
  }

  .role-nav-link.active {
    background: var(--success-bg);
  }

  .workspace,
  .form-grid,
  .editor-field-grid,
  .editor-tech-grid,
  .form-layout-controls,
  .editor-options-filter-row {
    grid-template-columns: 1fr;
  }

  .form-grid.form-grid-layout {
    grid-template-columns: repeat(var(--form-layout-columns, 1), minmax(0, 1fr));
  }

  .editor-form.editor-layout-enabled .editor-form-settings,
  .editor-field.editor-layout-enabled {
    grid-template-columns: repeat(var(--editor-layout-columns, 1), minmax(0, 1fr));
  }

  .workspace {
    width: 100%;
    max-width: 680px;
    margin: 18px auto;
    padding: 0 10px;
  }

  .page-context {
    width: 100%;
    max-width: 680px;
    margin-top: 12px;
    padding: 0 12px;
  }

  .page-context-title {
    font-size: 18px;
  }

  .panel-heading,
  .forms-stack,
  .editor-stack {
    padding: 10px;
  }

  .product-type-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-type-card {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .panel.builder .project-total,
  .project-total {
    margin-left: 0;
    text-align: left;
  }

  .panel.builder .panel-heading {
    grid-template-columns: minmax(0, 1fr);
  }

  .panel.builder .project-total,
  .panel.builder > .panel-heading > .toolbar {
    grid-column: 1;
    justify-self: stretch;
  }

  .editor-toolbar-primary,
  .editor-toolbar-selects,
  .editor-toolbar-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .editor-toolbar-actions {
    grid-template-areas:
      "actions"
      "publish";
    align-items: stretch;
  }

  .editor-toolbar-secondary-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .editor-toolbar-secondary-actions > :is(button, .button-link) {
    justify-content: center;
    width: 100%;
    min-height: 38px;
    white-space: normal;
    text-align: center;
  }

  .editor-toolbar-actions #saveForms {
    justify-self: stretch;
    width: 100%;
    min-width: 0;
  }

  .designer-order-items-toolbar,
  .designer-orders-toolbar {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .designer-order-items-toolbar .dictionary-pagination,
  .designer-orders-toolbar .dictionary-pagination {
    width: 100%;
  }

  .designer-order-items-toolbar .dictionary-pagination:first-child,
  .designer-orders-toolbar .dictionary-pagination:first-child {
    justify-content: stretch;
  }

  .designer-order-items-toolbar .dictionary-pagination:first-child > button,
  .designer-orders-toolbar .dictionary-pagination:first-child > button {
    width: 100%;
  }

  .designer-order-items-toolbar .dictionary-pagination:last-child,
  .designer-orders-toolbar .dictionary-pagination:last-child {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .designer-order-items-toolbar .dictionary-pagination:last-child > button,
  .designer-orders-toolbar .dictionary-pagination:last-child > button {
    justify-content: center;
    width: 100%;
    min-width: 0;
  }

  #productTypeDevelopmentVersion {
    place-content: center start;
    text-align: left;
  }

  .dynamic-form,
  .editor-form {
    padding: 10px;
  }

  .runtime-data-form {
    padding: 0;
  }

  .runtime-form-header,
  .runtime-data-form > .form-grid {
    padding: 10px;
  }

  .designer-order-items-summary .order-item-summary-actions {
    width: 100%;
  }

  .designer-order-items-summary .order-item-summary-actions > :is(button, .button-link),
  .designer-order-items-summary a.button-link {
    width: 100%;
  }

  .editor-field {
    grid-template-columns: 1fr;
  }

  .editor-field .icon-button {
    justify-self: end;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .audit-log-layout {
    grid-template-columns: 1fr;
  }

  .dictionary-layout,
  .dictionary-layout.is-filter-collapsed,
  .dictionary-layout.dictionary-layout-no-filter {
    grid-template-columns: minmax(0, 1fr);
  }

  .dictionary-filter-panel,
  .dictionary-main,
  .dictionary-table-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .dictionary-layout.is-filter-collapsed .dictionary-filter-heading {
    justify-content: space-between;
    padding: 10px;
    border-bottom: 0;
  }

  .dictionary-layout.is-filter-collapsed .dictionary-filter-heading h3 {
    display: block;
  }

  .dictionary-filter-fields {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .dictionary-filter-controls .dictionary-pagination {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .dictionary-filter-controls button {
    justify-content: center;
    width: 100%;
  }

  .dictionary-main .dictionary-table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .dictionary-main .dictionary-table {
    min-width: 720px;
  }

  .dictionary-main .dictionary-table.dictionary-table-readonly {
    min-width: 640px;
  }
}
