:host {
  color-scheme: light;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.fc-root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f5f7;
  color: #1f2937;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.fc-root,
.fc-root *,
.fc-root *::before,
.fc-root *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

h1, h2, h3, p { margin: 0; }

button {
  cursor: pointer;
  border: 1px solid #cfd5df;
  background: #fff;
  color: #1f2937;
  border-radius: 999px;
  padding: 0.42rem 0.78rem;
  font: inherit;
  line-height: 1.2;
  text-decoration: none;
}

button:hover:not(:disabled) { border-color: #1f2937; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
button.active, button.primary { background: #1f2937; color: #fff; border-color: #1f2937; }
.back-button { font-weight: 750; }

.tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
}

.form-component {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.form-instance {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  background: transparent;
}

/* v37: the embeddable component has no outer margin or padding; host controls spacing. */
.form-component-body {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 0;
}

.view { min-height: 100%; }
.hidden { display: none; }
.fields-root { width: 100%; }
.form-field { margin-bottom: 0.85rem; min-width: 0; max-width: 100%; }

.form-field label {
  display: block;
  font-weight: 650;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

.form-field small { display: block; color: #667085; margin-top: 0.25rem; }

input, select, textarea {
  box-sizing: border-box;
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-inline-size: 0;
  max-inline-size: 100%;
  border: 1px solid #cfd5df;
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  font: inherit;
  background: #fff;
}

input[type="date"] {
  display: block;
  inline-size: 100%;
  width: 100%;
  min-inline-size: 0;
  max-inline-size: 100%;
  min-width: 0;
  max-width: 100%;
  height: 2.75rem;
  min-height: 2.75rem;
  line-height: 1.25;
  padding: 0.55rem 0.65rem;
  margin: 0;
  box-sizing: border-box;
  font: inherit;
  overflow: hidden;
  -webkit-appearance: none;
  appearance: none;
}

input[type="date"]::-webkit-date-and-time-value {
  display: block;
  min-width: 0;
  max-width: 100%;
  height: 1.35em;
  line-height: 1.35;
  margin: 0;
  padding: 0;
  text-align: left;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  flex: 0 0 auto;
  width: 1.1em;
  height: 1.1em;
  margin: 0;
  padding: 0;
}

textarea { min-height: 4.5rem; resize: vertical; }

fieldset {
  border: 1px solid #d9dde5;
  border-radius: 12px;
  padding: 0.8rem;
  margin: 0 0 0.9rem;
  background: #fff;
}

legend { font-weight: 750; padding: 0 0.35rem; }

.array-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.array-item {
  border: 1px dashed #cfd5df;
  border-radius: 12px;
  padding: 0.75rem;
  margin-top: 0.6rem;
}

.array-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

pre {
  margin: 0;
  min-height: calc(100svh - 8rem);
  overflow: auto;
  background: #0f172a;
  color: #e5e7eb;
  border-radius: 12px;
  padding: 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
  line-height: 1.55;
  white-space: pre;
}

.view-json pre,
.view-model pre { min-width: max-content; }

.line-items-fieldset {
  margin: 0 0 0.85rem;
  border-width: 2px;
  padding: 0.8rem;
}

.line-items-fieldset legend { font-size: 1.05rem; }

.line-items-scroller {
  width: 100%;
  overflow-x: auto;
  margin-top: 0.7rem;
  padding-bottom: 0.2rem;
}

.line-items-grid {
  display: grid;
  grid-template-columns: var(--line-item-columns);
  gap: 0.45rem;
  min-width: 820px;
  align-items: start;
}

.line-item-heading {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0.35rem 0.25rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: #475467;
  background: #fff;
  border-bottom: 1px solid #edf0f5;
}

.line-item-cell { min-width: 0; max-width: 100%; overflow: hidden; }
.line-item-cell input,
.line-item-cell select,
.line-item-cell textarea { min-height: 2.65rem; }
.line-item-cell textarea { min-height: 2.65rem; resize: vertical; }
.line-item-action { display: flex; align-items: center; justify-content: flex-end; }
.line-item-action button { padding-inline: 0.65rem; }

.compact-section { margin-bottom: 0.85rem; }

.compact-section-grid > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.65rem 0.75rem;
  align-items: start;
}

.compact-section .form-field { margin-bottom: 0; }
.compact-section .form-field small { display: none; }
.compact-section fieldset { margin: 0; }
.compact-section textarea { min-height: 3.1rem; }

.layout-root {
  display: block;
}

.layout-section {
  margin: 0 0 0.9rem;
}

.layout-rows {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.layout-row {
  display: grid;
  grid-template-columns: var(--layout-columns);
  gap: 0.65rem 0.75rem;
  align-items: start;
}

.layout-cell {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

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

.layout-cell .form-field {
  margin-bottom: 0;
}

.layout-cell .form-field small {
  display: none;
}

.layout-cell fieldset {
  margin: 0;
  height: 100%;
}

.layout-spacer {
  min-height: 1px;
}

@media (max-width: 760px) {
  .layout-row {
    grid-template-columns: 1fr !important;
  }
  .layout-spacer {
    display: none;
  }
}

.view-form {
  min-height: 100%;
}

.view-form > .fields-root {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.view-form fieldset,
.view-form .line-items-fieldset,
.view-form .layout-section {
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.display-host,
.display-document {
  width: 100%;
}

.display-document {
  margin: 0;
  background: transparent;
}

.display-section {
  border: 1px solid #d9dde5;
  border-radius: 14px;
  margin: 0 0 1rem;
  overflow: hidden;
  background: #fff;
}

.display-section h3 {
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.075em;
  color: #344054;
  background: #f1f4f8;
  border-bottom: 1px solid #d9dde5;
  padding: 0.62rem 0.8rem;
}

.display-rows {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.8rem;
}

.display-row {
  display: grid;
  grid-template-columns: var(--display-columns);
  gap: 0.65rem 0.75rem;
  align-items: stretch;
}

.display-cell,
.display-field {
  min-width: 0;
}

.display-spacer {
  min-height: 1px;
}

.display-field {
  border: 1px solid #e2e7ef;
  border-radius: 10px;
  background: #fbfcfe;
  padding: 0.58rem 0.68rem;
}

.display-field span {
  display: block;
  color: #667085;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.26rem;
}

.display-field strong {
  display: block;
  min-height: 1.25rem;
  color: #1f2937;
  font-size: 0.98rem;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.display-object-grid,
.display-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.65rem 0.75rem;
  padding: 0.8rem;
}

.display-array-item {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.65rem 0.75rem;
  border: 1px solid #e2e7ef;
  border-radius: 12px;
  padding: 0.75rem;
  background: #fbfcfe;
}

.display-table-scroller {
  width: 100%;
  overflow-x: auto;
}

.display-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.display-table th {
  text-align: left;
  color: #344054;
  background: #f1f4f8;
  border-bottom: 1px solid #cfd5df;
  padding: 0.58rem 0.65rem;
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  white-space: nowrap;
}

.display-table td {
  border-bottom: 1px solid #edf0f5;
  padding: 0.62rem 0.65rem;
  vertical-align: top;
  background: #fff;
}

.display-table tbody tr:nth-child(even) td {
  background: #fbfcfe;
}

.display-empty {
  color: #667085;
  font-style: italic;
}

@media (max-width: 760px) {
  .display-row {
    grid-template-columns: 1fr !important;
  }
  .display-spacer {
    display: none;
  }
}

/* v37: flat single-section forms should not render an extra section header bar. */
.layout-section-bare,
.display-section-bare {
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  box-shadow: none !important;
}

.layout-section-bare .layout-rows,
.display-section-bare .display-rows {
  padding: 0;
}
