:root {
  color-scheme: light;
  --ink: #13253b;
  --muted: #506078;
  --line: #d9e1ec;
  --blue: #1c52dd;
  --blue-dark: #1745be;
  --background: #f3f6fa;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--background);
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #4275ff;
  outline-offset: 2px;
}

.shell { width: min(100% - 2.5rem, 71.5rem); margin-inline: auto; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(19rem, .63fr);
  align-items: start;
  gap: 1.25rem;
  padding-block: 1.65rem 3rem;
}
.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 7px 24px #12284408;
}
.form-panel { padding: 1.35rem; }
.panel-heading { margin-bottom: 1rem; }
h2 { margin: 0; font-size: 1.32rem; line-height: 1.2; letter-spacing: -.024em; }
.panel-heading p, .preview-heading p, .preview-note {
  margin: .3rem 0 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: .875rem;
}

#items { display: grid; gap: .9rem; }
.item-card { border: 1px solid var(--line); border-radius: .8rem; padding: 1rem; }
.item-heading {
  display: flex;
  min-height: 1.75rem;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  margin-bottom: .8rem;
}
.item-heading h3 { margin: 0; font-size: .96rem; font-weight: 750; }
.remove-item {
  margin-block: -.65rem;
  border: 0;
  border-radius: .35rem;
  padding: 0 .4rem;
  min-height: 2.75rem;
  background: transparent;
  color: #973047;
  font-size: .875rem;
  font-weight: 650;
}
.remove-item:hover { background: #fff0f3; }

.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem .85rem; }
.field { display: flex; min-width: 0; flex-direction: column; gap: .35rem; }
.field > span { font-size: .875rem; font-weight: 650; line-height: 1.3; }
.field-wide { grid-column: 1 / -1; }
.required { color: #a62942; font-weight: 750; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid #c6d2e1;
  border-radius: .5rem;
  padding: .59rem .7rem;
  background: #fff;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.35;
}
.field input::placeholder, .field textarea::placeholder { color: #626e80; opacity: 1; }
.field select {
  appearance: none;
  padding-right: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%2345536a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .65rem center;
}
.field select:invalid { color: #626e80; }
.field select option { color: var(--ink); }
.field textarea { min-height: 4rem; resize: vertical; }
.field [aria-invalid="true"] { border-color: #a62942; }

.form-actions { margin-top: .9rem; }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: .5rem;
  min-height: 2.85rem;
  border: 1px solid transparent;
  border-radius: .55rem;
  padding: .65rem .9rem;
  font-size: .9375rem;
  font-weight: 700;
}
.button svg, .preview-icon svg { flex: 0 0 auto; width: 1.15rem; height: 1.15rem; }
.button-outline { color: #1944a9; background: #f0f5ff; border-color: #c7d7ff; }
.button-outline:hover { background: #e4edff; }
.button-primary { width: 100%; color: #fff; background: var(--blue); }
.button-primary:hover { background: var(--blue-dark); }

.preview-panel { position: sticky; top: 1.2rem; }
.preview-heading {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.2rem;
  border-bottom: 1px solid var(--line);
  background: #f8faff;
  border-radius: 1rem 1rem 0 0;
}
.preview-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: .55rem;
  color: #244cb0;
  background: #e7efff;
}
.preview-body { padding: 1.15rem; }
.preview-placeholder, .inquiry-output {
  width: 100%;
  min-width: 0;
  border: 1px solid #d9e2f0;
  border-radius: .65rem;
  margin: 0 0 .85rem;
  background: #f6f8fc;
}
.preview-placeholder {
  display: grid;
  place-items: center;
  min-height: 11rem;
  padding: 1rem;
  text-align: center;
  color: var(--muted);
  font-size: .94rem;
}
.preview-placeholder p { max-width: 15rem; margin: 0; line-height: 1.5; }
.inquiry-output {
  display: block;
  resize: vertical;
  min-height: 11rem;
  padding: .85rem;
  color: #223852;
  font: .9rem/1.55 ui-monospace, "Cascadia Code", Consolas, monospace;
}
.preview-note { margin-top: .75rem; }
.copy-status { color: #13623e; margin: .65rem 0 0; font-size: .875rem; line-height: 1.45; }
.copy-status:empty { display: none; }

@media (max-width: 46rem) {
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .preview-panel { position: static; }
}
@media (max-width: 30rem) {
  .shell { width: calc(100% - 1.5rem); }
  .workspace { padding-block: .9rem 1.75rem; }
  .form-panel, .preview-body, .preview-heading { padding: 1rem; }
  .item-card { padding: .8rem; }
  .form-actions .button { width: 100%; }
  .field input, .field select, .field textarea { padding-left: .55rem; }
  .fields { column-gap: .6rem; }
}
@media (max-width: 23rem) {
  .fields { grid-template-columns: minmax(0, 1fr); }
}

.field > .field-error {
  color: #a62942;
  font-weight: 550;
}
