.template-view {
  max-width: 760px;
  color: var(--strata-ink);
  background: var(--strata-canvas);
  font: var(--strata-text-body)/1.5 var(--strata-font);
}
.template-view, .template-view * { box-sizing: border-box; }
.template-view [hidden] { display: none !important; }
.template-view :where(p, pre) { margin: 0; }
.template-view .ui-page-title { margin-bottom: 30px; font-size: var(--strata-text-title); }
.template-view .ui-page-title:focus { outline: none; }

.template-view .template-toolbar,
.template-view .template-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.template-view .template-toolbar { justify-content: space-between; align-items: end; margin-bottom: 20px; }
.template-view .template-toolbar .template-field { flex: 1 1 180px; max-width: 340px; }
.template-view .template-action {
  min-height: 34px;
  padding: 7px 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--strata-ink);
  font: inherit;
  font-weight: 500;
  text-align: start;
}
.template-view > .template-action { margin-bottom: 20px; }
.template-view .template-action:hover,
.template-view .template-row:hover { background: var(--strata-hover); }
.template-view .template-primary {
  background: var(--strata-button-fill);
  color: var(--strata-button-text);
}
.template-view .template-primary:hover { background: var(--strata-hover); }

.template-view .template-list > li { padding: 0; }
.template-view .template-row {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 15px 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  overflow-wrap: anywhere;
  text-align: start;
}
.template-view .template-row:focus-visible { position: relative; z-index: 1; }
.template-view .template-muted { color: var(--strata-muted); font-size: var(--strata-text-small); }
.template-view .template-empty {
  border: 0;
  padding: 12px;
  color: var(--strata-muted);
}

.template-view .template-form,
.template-view .template-preview {
  display: grid;
  gap: 22px;
  max-width: 540px;
}
.template-view .template-field {
  display: grid;
  gap: 8px;
  min-width: 0;
  font-weight: 400;
}
.template-view .template-field :is(input, textarea) {
  min-width: 0;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 0;
  border: var(--strata-input-border); background: var(--strata-input-fill);
  color: inherit;
  font: inherit;
  font-weight: 400;
}
.template-view .template-field textarea { resize: vertical; }
.template-view .template-field .template-variables { font: var(--strata-text-small)/1.6 ui-monospace, monospace; }
.template-view .template-message { border: 0; padding: 12px; }
.template-view .template-message h2 { margin-bottom: 6px; overflow-wrap: anywhere; }
.template-view .template-message pre { font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; }
.template-view .template-error { color: #982e1a; }
.template-view :is(.template-error, .template-feedback):empty { margin: 0; height: 0; }
.template-view .template-form :is(.template-error, .template-feedback):empty,
.template-view .template-preview :is(.template-error, .template-missing):empty { position: absolute; }

.template-view .template-form > button,
.template-view .template-preview > button { justify-self: start; }
.template-view > .template-action,
.template-view button.template-action:not(.template-primary) { color: var(--strata-muted); font-weight: 500; }
.template-view .template-field select.template-action { border: var(--strata-input-border); background: var(--strata-input-fill); }
.template-view .template-empty { padding: 16px 0; }
.template-message iframe {
  display: block;
  width: 100%;
  min-height: 19rem;
  border: 0;
  background: white;
}
