.order-form-designer-screen {
  position: fixed;
  inset: 56px 0 0 280px;
  z-index: 18;
  display: grid;
  grid-template-rows: 58px auto minmax(0, 1fr) 72px;
  background: #f4f6f9;
  color: var(--text);
}

.shell.subnav-collapsed .order-form-designer-screen { left: 128px; }

.order-form-designer-head,
.order-form-designer-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.order-form-designer-head strong { font-size: 18px; }
.order-form-designer-head .muted { margin-left: auto; }

.order-form-back {
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--primary);
}

.order-form-designer-meta {
  display: grid;
  grid-template-columns: 170px minmax(260px, 1fr) minmax(320px, 1.4fr);
  gap: 24px;
  padding: 18px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.order-form-designer-meta > label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}
.order-form-designer-meta > .wide { grid-column: 1 / -1; }

.order-form-designer-meta input:not([type='checkbox']) {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.order-form-binding { display:grid;grid-template-columns:auto minmax(0,1fr);align-items:start;gap:12px; }
.order-form-binding > div { display:grid;grid-template-columns:auto auto minmax(260px,1fr);align-items:center;gap:12px 18px; }
.order-form-binding label { display:flex;align-items:center;gap:7px;white-space:nowrap; }
.order-form-binding input[type='radio'] { width:auto;height:auto;padding:0; }
.order-form-binding small { grid-column:1 / -1;color:var(--muted);line-height:1.5; }

.order-form-status { position: relative; }
.order-form-status input { position: absolute; opacity: 0; pointer-events: none; }
.order-form-status i {
  position: relative;
  width: 46px;
  height: 24px;
  border-radius: 12px;
  background: #cbd5e1;
  transition: .18s ease;
}
.order-form-status i::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: .18s ease;
}
.order-form-status input:checked + i { background: var(--primary); }
.order-form-status input:checked + i::after { transform: translateX(22px); }

.order-form-designer-body {
  min-height: 0;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 22px;
  padding: 22px 24px;
  overflow: hidden;
}

.order-form-palette,
.order-form-canvas {
  min-height: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.order-form-palette { overflow: auto; }
.order-form-palette-title {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 16px 18px;
  font-weight: 700;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.order-form-palette-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 16px;
}
.order-form-palette-list button {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid #dbe3ee;
  border-radius: 5px;
  background: #f8fafc;
  color: #27364b;
}
.order-form-palette-list button:hover { border-color: var(--primary); color: var(--primary); background: #eef6ff; }
.order-form-palette-list button span { color: #94a3b8; }

.order-form-canvas {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.order-form-canvas-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
}
.order-form-canvas-head > div { display: flex; align-items: center; gap: 10px; }
.order-form-canvas-head > div span { color: var(--muted); font-size: 13px; }
.order-form-field-list {
  flex: 1 1 auto;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
  overflow: auto;
  background: #f7f8fa;
}
.order-form-field-card {
  width: min(820px, 100%);
  margin: 0 auto;
  padding: 20px 24px;
  background: #fff;
  border: 1px solid #e5eaf1;
  border-radius: 6px;
}
.order-form-field-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.order-form-required,
.order-form-type-chip,
.order-form-field-actions button {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
}
.order-form-required.active { border-color: var(--primary); color: var(--primary); background: #edf6ff; }
.order-form-required:disabled { cursor: default; opacity: .65; }
.order-form-type-chip { display: inline-flex; align-items: center; background: #f6f7f9; color: #64748b; }
.order-form-field-actions { display: flex; gap: 7px; margin-left: auto; }
.order-form-field-actions button { width: 34px; padding: 0; }
.order-form-field-actions button.danger { color: #ff5b5b; border-color: #ffdcdc; background: #fff2f2; }
.order-form-field-actions button:disabled { opacity: .35; cursor: default; }
.order-form-field-settings { display: grid; gap: 14px; }
.order-form-setting-row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}
.order-form-setting-row > span { text-align: right; color: #526078; }
.order-form-setting-row input:not([type='radio']),
.order-form-setting-row textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  resize: vertical;
}
.order-form-time-settings { display: grid; gap: 14px; }
.order-form-time-range,
.order-form-choice-row { display: flex; align-items: center; gap: 18px; }
.order-form-time-range input { flex: 1 1 0; }
.order-form-time-range em { font-style: normal; }
.order-form-choice-row label { display: flex; align-items: center; gap: 6px; }
.order-form-field-hint { margin: 0 0 0 118px; color: var(--muted); font-size: 13px; }
.order-form-empty {
  min-height: 280px;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  color: var(--muted);
}
.order-form-designer-footer {
  justify-content: center;
  border-top: 1px solid var(--line);
  border-bottom: 0;
  box-shadow: 0 -8px 22px rgba(15, 23, 42, .05);
}
.order-form-designer-footer .btn { min-width: 112px; }
.order-form-list-tools { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.order-form-list-tools .search { width: min(420px, 100%); }

@media (max-width: 1180px) {
  .order-form-designer-meta { grid-template-columns: 150px minmax(220px, 1fr); }
  .order-form-designer-meta .wide { grid-column: 1 / -1; }
  .order-form-designer-body { grid-template-columns: 210px minmax(0, 1fr); }
  .order-form-palette-list { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .order-form-designer-screen,
  .shell.subnav-collapsed .order-form-designer-screen { left: 64px; }
}

@media (max-width: 720px) {
  .order-form-designer-screen { left: 0 !important; grid-template-rows: 54px auto minmax(0, 1fr) 64px; }
  .order-form-designer-meta { grid-template-columns: 1fr; gap: 12px; padding: 14px; }
  .order-form-designer-meta .wide { grid-column: auto; }
  .order-form-designer-body { display: block; padding: 12px; overflow: auto; }
  .order-form-palette { margin-bottom: 12px; overflow: visible; }
  .order-form-palette-list { grid-template-columns: repeat(2, 1fr); }
  .order-form-canvas { overflow: visible; }
  .order-form-field-list { overflow: visible; }
  .order-form-field-card { padding: 16px; }
  .order-form-setting-row { grid-template-columns: 1fr; gap: 6px; }
  .order-form-setting-row > span { text-align: left; }
  .order-form-field-hint { margin-left: 0; }
}
