/* Batch 2 controls: plain surfaces, readable labels and local editor styling. */
body {
  font-size: 16px;
}
.lucide-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  vertical-align: middle;
}
.diagram-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.page input[type='text'],
.page input[type='date'] {
  font-size: 14pt;
}
.site-header .header-actions {
  align-items: center;
}
.header-actions button,
.file-menu summary {
  font-size: 15px;
}
.save-status {
  color: var(--muted);
  font-size: 12px;
  margin-inline-end: 12px;
}
.file-menu {
  position: relative;
}
.file-menu > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  line-height: 1.5;
  padding: 8px 16px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}
.file-menu > summary::-webkit-details-marker {
  display: none;
}
.file-menu-items {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-end: 0;
  z-index: 40;
  width: 260px;
  max-width: calc(100vw - 32px);
  padding: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 2px 6px #18181b12;
}
.file-menu-items button {
  display: flex;
  justify-content: flex-start;
  width: 100%;
  padding: 8px;
  min-height: 32px;
  font-size: 14px;
  border-radius: 6px;
  background: #fff;
  color: var(--tx);
  font-weight: 400;
  border: 0;
}
.file-menu-items button:hover {
  background: var(--bg);
}
.layout {
  padding-bottom: 40px;
  grid-template-columns: 280px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 24px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
#steps {
  position: static;
  padding: 0;
  border: 0;
}
#steps button {
  font-size: 15px;
  padding: 12px 10px;
  border: 0;
  border-radius: 4px;
  gap: 12px;
}
#steps button.on {
  border: 0;
  background: #edf7f1;
  color: #104631;
}
.step-number {
  font-size: 12px;
}
.step-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding: 16px 8px 8px;
  border-top: 1px solid #e5e7eb;
}
.step-actions button {
  flex: 1;
  padding: 10px;
  font-size: 15px;
}
.row > label {
  font-size: 16px;
  font-weight: 500;
}
.row {
  gap: 9px;
}
.hint {
  font-size: 14px;
}
.box,
.modal-desc {
  border-inline-start: 0;
  background: var(--bg);
}
.modal-desc {
  padding: 0;
  background: none;
  font-size: 15px;
  line-height: 1.9;
}
select,
input[type='date'],
input[type='search'],
.select-trigger {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border: 1px solid #9da4ae;
  border-radius: 4px;
  padding: 10px 12px;
  background: #fff;
  color: var(--tx);
  font: inherit;
}
select {
  cursor: pointer;
}
input[type='date'] {
  direction: ltr;
  text-align: right;
  color-scheme: light;
}
.legacy-date {
  display: block;
  color: var(--muted);
  margin-top: 6px;
}
.select-trigger {
  position: relative;
  justify-content: space-between;
  text-align: right;
  font-weight: 400;
  gap: 12px;
}
.select-trigger:hover {
  background: #fff;
  border-color: var(--g);
}
.product-select {
  position: relative;
}
.select-popover {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 6px);
  z-index: 30;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px;
  box-shadow: 0 2px 6px #18181b12;
}
.product-select .select-trigger,
.file-menu > summary {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  background: #fafafa;
  font-size: 14px;
  line-height: 20px;
}
.product-select .select-trigger {
  width: fit-content;
  min-width: 220px;
  max-width: 100%;
}
.select-popover {
  inset-inline: auto;
  inset-inline-start: 0;
  width: 320px;
  max-width: min(100%, calc(100vw - 32px));
}
.file-menu-items {
  width: 220px;
}
.dropdown-panel {
  padding: 4px;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 6px #18181b12;
}
.dropdown-label {
  padding: 4px 8px;
  color: #71717a;
  font-size: 12px;
  font-weight: 400;
  line-height: 20px;
}
.product-menu-options {
  max-height: 280px;
  overflow-y: auto;
}
.dropdown-panel .dropdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 32px;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: #fff;
  color: #18181b;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  text-align: start;
}
.dropdown-panel .dropdown-item:hover,
.dropdown-panel .dropdown-item:focus {
  outline: 0;
  background: #f4f4f5;
}
.dropdown-item[role='menuitemradio'] .lucide-icon {
  visibility: hidden;
  width: 16px;
  height: 16px;
}
.dropdown-item[aria-checked='true'] .lucide-icon {
  visibility: visible;
}
.other-product {
  display: block;
  margin-top: 16px;
  font-size: 15px;
}
.other-product input {
  display: block;
  margin-top: 8px;
}
.radio-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  padding-block: 8px;
}
.radio-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 16px;
}
.radio-option input[type='radio'] {
  appearance: none;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
  border: 1px solid #d4d4d8;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}
.radio-option input[type='radio']::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--g);
  transform: scale(0);
}
.radio-option input[type='radio']:checked {
  border-color: var(--g);
}
.radio-option input[type='radio']:checked::before {
  transform: scale(1);
}
.radio-option input[type='radio']:focus-visible {
  outline: 3px solid #54c08a80;
  outline-offset: 2px;
}
.legacy-choice {
  display: block;
  color: var(--muted);
  line-height: 1.8;
  margin-top: 8px;
  overflow-wrap: anywhere;
}
.rich-field {
  position: relative;
  min-width: 0;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  background: #fff;
}
.rich-field:focus-within {
  border-color: var(--g);
  box-shadow: 0 0 0 3px rgb(27 131 84 / 0.14);
}
.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 8px;
  border-bottom: 1px solid #e4e4e7;
  background: #fafafa;
  border-radius: 10px 10px 0 0;
}
.rich-toolbar button {
  min-height: 30px;
  min-width: 30px;
  padding: 4px 7px;
  color: #495057;
  background: transparent;
  border: 0;
  border-radius: 6px;
  font:
    14px/1.5 Arial,
    sans-serif;
  font-weight: 600;
}
.rich-toolbar button:hover,
.rich-toolbar button.ql-active {
  background: var(--gs);
  color: var(--gd);
}
.rich-toolbar .ql-italic {
  font-style: italic;
}
.rich-toolbar .ql-underline {
  text-decoration: underline;
}
.rich-toolbar .font-size-trigger {
  width: auto;
  min-height: 30px;
  height: 30px;
  padding: 1px 4px;
  border-color: #e4e4e7;
  border-radius: 6px;
  font-size: 13px;
  margin-inline-start: 6px;
  gap: 6px;
  display: inline-flex;
  align-items: center;
  background: #fff;
  border: 1px solid #e4e4e7;
  padding-inline: 8px;
}
.font-size-control {
  position: relative;
}
.font-size-menu {
  position: absolute;
  top: calc(100% + 4px);
  inset-inline-end: 0;
  z-index: 50;
  width: 120px;
  max-height: 280px;
  overflow: auto;
}
.font-size-trigger .lucide-icon {
  width: 14px;
  height: 14px;
}
.rich-field .ql-container {
  font: inherit;
  border: 0;
}
.rich-field .ql-editor {
  min-height: 110px;
  padding: 12px 14px;
  line-height: 1.9;
  text-align: right;
  direction: rtl;
  font-size: 14pt;
  overflow-wrap: anywhere;
}
.input-group {
  min-width: 0;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px #18181b04;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.input-group:hover {
  border-color: #d4d4d8;
}
.input-group:focus-within {
  border-color: var(--g);
  box-shadow: 0 0 0 3px rgb(27 131 84 / 0.14);
}
.input-group > input[type='text'] {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  border-radius: inherit;
  outline: 0;
  box-shadow: none;
  background: transparent;
}
.input-group > input[type='text']:focus-visible {
  outline: 0;
}
.input-group .ql-editor {
  border-radius: 0 0 10px 10px;
}
.input-group .ql-editor:focus {
  outline: 0;
}
.rich-field .ql-editor p,
.rich-field .ql-editor ol {
  margin: 0;
}
.rich-proxy {
  position: absolute;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
.dyn-head {
  display: none;
}
.dyn-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 16px;
  padding: 20px;
  gap: 20px;
  background: #fff;
}
.dyn-cell {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dyn-cell::before {
  content: attr(data-label);
  font-size: 15px;
  color: var(--tx);
}
.dyn-row input,
.dyn-row textarea {
  font-size: 16px;
}
.dyn-row > button {
  justify-self: end;
  grid-column: 1/-1;
}
.table-versions .dyn-row {
  grid-template-columns: minmax(90px, 0.6fr) minmax(165px, 1fr) minmax(160px, 1.2fr);
}
.table-versions .dyn-cell:nth-child(4) {
  grid-column: 1/-1;
}
.table-versions .rich-field .ql-editor {
  min-height: 80px;
}
.app-dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--tx);
  background: #fff;
  font: inherit;
  box-shadow: 0 20px 60px #10182826;
  animation: dialog-in 0.16s ease-out;
}
.app-dialog::backdrop {
  background: rgb(12 17 27 / 0.42);
  animation: backdrop-in 0.16s ease-out;
}
.dialog-content {
  padding: 24px;
}
.dialog-content h2 {
  margin: 0 0 12px;
  font-size: 21px;
}
.dialog-description {
  margin: 0;
  color: #495057;
  white-space: pre-line;
  line-height: 1.9;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
}
.draft-summary {
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr);
  gap: 12px 16px;
  margin: 20px 0 0;
  padding: 16px 0;
  border-top: 1px solid #e5e7eb;
}
.draft-summary dt {
  color: var(--muted);
  font-size: 14px;
}
.draft-summary dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.json-details > summary {
  padding-block: 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
}
.json-details .modal-code-wrap {
  margin-top: 8px;
}
.advanced-actions {
  margin-top: 12px;
}
.modal-overlay.open .modal-card {
  animation: dialog-in 0.16s ease-out;
}
.toast {
  bottom: 24px;
}
@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }
  .table-versions .dyn-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .table-versions .dyn-cell:nth-child(3),
  .table-versions .dyn-cell:nth-child(4) {
    grid-column: 1/-1;
  }
}
@media (max-width: 760px) {
  .layout {
    display: flex;
    flex-direction: column;
    padding-bottom: 24px;
  }
  .layout > main,
  .sidebar {
    width: 100%;
  }
  .sidebar {
    position: static;
    padding: 8px;
  }
  #steps {
    margin: 0;
  }
  #steps button {
    font-size: 15px;
    border: 0;
  }
  #steps button.on {
    border: 0;
  }
  .step-actions {
    margin-top: 8px;
    padding-top: 12px;
    justify-content: flex-end;
  }
  .step-actions button {
    flex: 0 0 auto;
    min-width: 110px;
  }
  .header-actions {
    display: flex;
    width: auto;
    gap: 8px;
    flex-wrap: wrap;
  }
  .save-status {
    order: 3;
    width: 100%;
    font-size: 12px;
    margin: 0;
  }
  .header-actions button {
    font-size: 15px;
    padding-inline: 16px;
  }
  .dyn-row {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px;
  }
  .table-versions .dyn-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .draft-summary {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .draft-summary dd {
    margin-bottom: 12px;
  }
  .file-menu-items {
    inset-inline-start: auto;
    inset-inline-end: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .app-dialog,
  .app-dialog::backdrop,
  .modal-overlay.open .modal-card {
    animation: none;
  }
}
@media print {
  .sidebar,
  .header-actions,
  .rich-toolbar {
    display: none !important;
  }
  .rich-field {
    border: 0;
  }
}
