html, body { margin: 0; padding: 0; }
body {
  --side-width: 40vw;
  --form-min: 360px;
  --side-min: 280px;
  font: 16px/1.45 "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  color: #252519;
  background: #f5f5ff;
}
body.is-resizing { cursor: col-resize; user-select: none; }
body.is-resizing iframe { pointer-events: none; }
button, input, textarea { font: inherit; }
.page { width: 100%; display: grid; grid-template-columns: calc(100vw - var(--side-width)) var(--side-width); }
.row { display: contents; }
.formcol {
  grid-column: 1; min-width: 0; padding: 28px 28px 28px 56px;
  background: #f5f5ff; border-right: 1px solid #e5e5ee;
}
.splitter {
  position: fixed;
  top: 0;
  bottom: 0;
  left: calc(100vw - var(--side-width));
  width: 8px;
  margin-left: -4px;
  z-index: 40;
  cursor: col-resize;
  touch-action: none;
}
.splitter::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 3px;
  width: 2px;
  background: transparent;
}
.splitter:hover::after,
body.is-resizing .splitter::after {
  background: #77776c;
}
.hintcol {
  grid-column: 2; min-width: 0; padding: 28px 56px 28px 24px;
  background: #fff; box-sizing: border-box;
}
.page > .row:first-child .formcol, .page > .row:first-child .hintcol { padding-top: 46px; padding-bottom: 38px; }
h1 { margin: 0; font-size: 42px; line-height: 1; font-weight: 400; letter-spacing: -0.03em; }
h2 { margin: 0 0 16px; font-size: 22px; line-height: 1.15; font-weight: 400; }
p { margin: 0 0 12px; }
.muted { color: #6d6d61; }
.rule .formcol, .rule .hintcol { border-top: 1px dotted #aaa; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
label { display: block; }
.label { display: block; margin-bottom: 4px; color: #55554a; font-size: 13px; }
input[type="text"], input[type="date"], textarea {
  width: 100%; box-sizing: border-box; border: 1px solid #cfcfd8; border-radius: 0;
  background: #fff; color: #252519; padding: 7px 8px;
}
textarea { min-height: 78px; resize: vertical; }
input:focus, textarea:focus { outline: 1px solid #77776c; outline-offset: 0; }
input.is-blocked, textarea.is-blocked { outline: 1px solid #b33; background: #fff5f5; }
.optional-block { display: contents; }
.optional-block.is-collapsed { display: none; }
.optional-toggle .label { color: #55554a; }
.wide { grid-column: 1 / -1; }
.subtitle {
  grid-column: 1 / -1;
  margin: 6px 0 0;
  color: #55554a;
  font-size: 14px;
  line-height: 1.35;
}
.check { display: flex; gap: 7px; align-items: flex-start; min-height: 28px; }
.check input { margin-top: 4px; }
.check .label { margin: 0; color: #252519; font-size: 14px; }
label.is-hidden, .subtitle.is-hidden { display: none; }
.hintcol ul { margin: 0; padding-left: 18px; color: #55554a; }
.hintcol li { margin: 0 0 7px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  border: 1px solid #bdbdc8; border-radius: 0; background: #fff; color: #252519;
  padding: 7px 10px; cursor: pointer;
}
.btn.primary { background: #252519; border-color: #252519; color: #fff; }
.btn.is-active { background: #252519; border-color: #252519; color: #fff; }
.file-input { display: none; }
#template, #preview-status { color: #6d6d61; font-size: 14px; }

.about-dialog {
  width: min(640px, calc(100vw - 32px));
  border: 1px solid #cfcfd8;
  padding: 0;
  background: #fff;
  color: #252519;
}
.about-dialog::backdrop { background: rgba(37, 37, 25, 0.35); }
.about-card { margin: 0; padding: 22px 24px; }
.about-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.about-head h2 { margin: 0; }
.about-card p:last-child { margin-bottom: 0; }

.side-toggle { display: flex; flex-wrap: wrap; gap: 8px; }
.side-btn { min-width: 110px; }

.preview-pane {
  grid-column: 2;
  grid-row: 3 / span 999;
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  width: auto;
  height: 100vh;
  background: #f7f7fa;
  border-left: 1px solid #e5e5ee;
  box-sizing: border-box;
}
.preview-pane[hidden] { display: none; }
.preview-toolbar {
  flex: 0 0 auto;
  padding: 12px 16px;
  border-bottom: 1px solid #e5e5ee;
  background: #fff;
}
.preview-pane iframe {
  flex: 1 1 auto;
  width: 100%;
  border: 0;
  background: #d8d8e0;
}

body.side-preview .hintcol { display: none; }
body.side-preview .page > .row:nth-child(-n+2) .hintcol { display: block; }
body.side-preview .formcol { border-right: 0; }
body.side-preview .page > .row:first-child {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
body.side-preview .page > .row:first-child .hintcol { display: block; }
body.side-preview .page > .row:first-child .formcol { border-right: 1px solid #e5e5ee; }

@media (max-width: 820px) {
  body { --side-width: 100%; }
  .splitter { display: none; }
  .page { display: block; }
  .row { display: block; }
  .formcol, .hintcol { padding: 22px; border-right: 0; }
  .hintcol { border-top: 1px dotted #aaa; }
  .fields { grid-template-columns: 1fr; }
  body.side-preview .page { width: 100%; padding-bottom: 55vh; }
  body.side-preview .preview-pane {
    top: auto;
    bottom: 0;
    width: 100%;
    height: 50vh;
    border-left: 0;
    border-top: 1px solid #e5e5ee;
  }
}
