/* PDF mail merge: site + tool styles. No external fonts; system font stack. */

:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f0f2f8;
  --text: #1a1e29;
  --muted: #555e70;
  --border: #d9dde7;
  --border-strong: #b9c0cf;
  --primary: #3245cc;
  --primary-hover: #2735a8;
  --primary-soft: #eceffd;
  --on-primary: #ffffff;
  --accent: #0e6f68;
  --accent-soft: #e3f4f2;
  --danger: #b4232f;
  --danger-soft: #fcebed;
  --warning: #7a4d00;
  --warning-soft: #fff4d9;
  --ok: #166c43;
  --ok-soft: #e4f5ec;
  --focus: #1b66e0;
  --stage-bg: #e4e7ef;
  --shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 4px 16px rgb(16 24 40 / 6%);
  --radius: 12px;
  --radius-sm: 8px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1117;
    --surface: #161a22;
    --surface-2: #1d2230;
    --text: #e7eaf1;
    --muted: #a6aebf;
    --border: #2b3242;
    --border-strong: #3f4860;
    --primary: #8b9dff;
    --primary-hover: #a8b6ff;
    --primary-soft: #232a45;
    --on-primary: #0b0f1a;
    --accent: #5fd0c4;
    --accent-soft: #15302e;
    --danger: #ff8a93;
    --danger-soft: #3a1c21;
    --warning: #f2c46b;
    --warning-soft: #3a2f16;
    --ok: #6fd6a2;
    --ok-soft: #16301f;
    --focus: #8fb4ff;
    --stage-bg: #0a0d12;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 6px 20px rgb(0 0 0 / 30%);
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

img,
svg,
canvas {
  max-width: 100%;
}

a {
  color: var(--primary);
  text-underline-offset: 2px;
}
a:hover {
  color: var(--primary-hover);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 0 0 0.5em;
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--surface-2);
  padding: 0.05em 0.35em;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -48px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  z-index: 100;
  box-shadow: var(--shadow);
}
.skip-link:focus {
  top: 8px;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- header / footer ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  min-height: 60px;
  padding-top: 8px;
  padding-bottom: 8px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  font-size: 1.05rem;
}
.brand img {
  width: 28px;
  height: 28px;
}
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
}
.site-nav a {
  color: var(--muted);
  text-decoration: none;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
}

.site-footer {
  margin-top: 64px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  font-size: 0.92rem;
  color: var(--muted);
}
.site-footer .container {
  display: grid;
  gap: 16px;
  padding-top: 28px;
  padding-bottom: 36px;
}
.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.site-footer a {
  color: var(--muted);
}
.site-footer p {
  margin: 0;
}

/* ---------- hero ---------- */
.hero {
  padding: 28px 0 8px;
}
.hero h1 {
  font-size: clamp(1.6rem, 1.1rem + 2.2vw, 2.4rem);
  letter-spacing: -0.01em;
  max-width: 24ch;
}
.hero .lede {
  font-size: 1.08rem;
  color: var(--muted);
  max-width: 62ch;
  margin: 0 0 12px;
}
.trust {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  font-size: 0.92rem;
  color: var(--muted);
}
.trust li::before {
  content: "✓";
  color: var(--ok);
  font-weight: 700;
  margin-right: 6px;
}

/* ---------- tool ---------- */
.tool {
  margin: 12px 0 0;
  /* Reserve roughly the height of the rendered tool so content below doesn't jump. */
  min-height: 1150px;
}
@media (min-width: 860px) {
  .tool {
    min-height: 800px;
  }
}
.tool:not(.is-ready) .tool-loading {
  display: block;
}
.tool-loading {
  display: none;
  padding: 32px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.tool-inner {
  display: grid;
  gap: 16px;
}
.tool-privacy {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0;
  padding: 10px 14px;
  background: var(--ok-soft);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-size: 0.93rem;
}
.tool-privacy svg {
  flex: none;
  margin-top: 3px;
  color: var(--ok);
}

.grid-2 {
  display: grid;
  gap: 16px;
}
@media (min-width: 860px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  min-width: 0;
}
@media (min-width: 700px) {
  .panel {
    padding: 20px;
  }
}
.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  margin-bottom: 14px;
}
.step {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 0.9rem;
  font-weight: 700;
  flex: none;
}

.muted {
  color: var(--muted);
}
.small {
  font-size: 0.88rem;
}
.empty {
  margin: 0;
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}
.busy {
  color: var(--muted);
}
.busy::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--primary);
  border-radius: 50%;
  vertical-align: -1px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .busy::before {
    animation: none;
  }
  * {
    scroll-behavior: auto !important;
  }
}

/* drop zones */
.drop {
  position: relative;
}
.drop-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.drop-label {
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
  padding: 26px 16px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.drop-icon {
  color: var(--primary);
}
.drop:hover .drop-label,
.drop.is-over .drop-label {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.drop-input:focus-visible + .drop-label {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.or {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.85rem;
  margin: 12px 0;
}
.or::before,
.or::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--border);
}

details.paste {
  margin-top: 12px;
}
details summary {
  cursor: pointer;
  color: var(--primary);
  font-size: 0.93rem;
}
details.paste[open] summary {
  margin-bottom: 8px;
}

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 16px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover {
  background: var(--surface-2);
  color: var(--text);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}
.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: var(--on-primary);
}
.btn-secondary {
  background: var(--primary-soft);
  border-color: transparent;
  color: var(--primary);
}
.btn-secondary:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.btn-danger {
  color: var(--danger);
}
.btn-small {
  min-height: 34px;
  padding: 5px 12px;
  font-size: 0.88rem;
}
.btn-large {
  min-height: 50px;
  padding: 12px 24px;
  font-size: 1.05rem;
}
.btn-block {
  width: 100%;
}
.btn-link {
  font: inherit;
  color: var(--primary);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.icon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* form controls */
label,
.label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin: 10px 0 4px;
}
input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  min-height: 38px;
}
textarea {
  resize: vertical;
  line-height: 1.45;
  font-family: var(--mono);
  font-size: 0.88rem;
}
input[type="color"] {
  width: 100%;
  height: 38px;
  padding: 2px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 400;
  margin: 8px 0;
}
.check input {
  margin-top: 0.3em;
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  flex: none;
}
fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
legend {
  padding: 0;
}

.file-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}
.file-badge {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}
.file-badge-data {
  background: var(--accent-soft);
  color: var(--accent);
}
.file-text {
  min-width: 0;
}
.file-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.note {
  margin: 10px 0 0;
  padding: 8px 12px;
  background: var(--warning-soft);
  color: var(--text);
  border-radius: var(--radius-sm);
}
.mode-switch {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.mode-switch legend {
  font-weight: 600;
  padding: 0 4px;
}
.field-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.field-inline label {
  margin: 0;
}
.field-inline select {
  width: auto;
  max-width: 100%;
}

/* data table */
.table-wrap {
  margin-top: 12px;
  overflow: auto;
  max-height: 290px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.data-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.85rem;
}
.data-table caption {
  caption-side: bottom;
  text-align: left;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 0.82rem;
}
.data-table th,
.data-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.data-table th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  font-weight: 600;
}
.data-table .rownum {
  color: var(--muted);
  width: 1%;
}
.data-table tr.is-current td {
  background: var(--primary-soft);
}

/* alerts, notices, issues */
.alert {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}
.alert-error {
  background: var(--danger-soft);
  color: var(--text);
  border-left: 4px solid var(--danger);
}
.notice {
  padding: 12px 14px;
  background: var(--primary-soft);
  border-radius: var(--radius-sm);
  font-size: 0.93rem;
}
.notice p {
  margin: 0 0 4px;
}
.issues {
  margin: 14px 0 0;
}
.issue-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.issue {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  border-left: 4px solid;
}
.issue-error {
  background: var(--danger-soft);
  border-color: var(--danger);
}
.issue-warning {
  background: var(--warning-soft);
  border-color: var(--warning);
}
.issue-todo {
  background: var(--surface-2);
  border-color: var(--border-strong);
}
.issue .btn-link,
.issue label.btn-link {
  display: inline;
  font-weight: 600;
  margin: 0 0 0 6px;
  font-size: inherit;
}
.ok {
  color: var(--ok);
  font-weight: 600;
  margin: 0;
}
.inline-issue {
  margin: 6px 0;
  padding: 6px 10px;
  font-size: 0.86rem;
  background: var(--danger-soft);
  border-radius: 6px;
}
mark.bad {
  background: transparent;
  color: var(--danger);
  font-family: var(--mono);
  font-weight: 700;
  text-decoration: wavy underline;
}

/* editor */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.tb-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.tb-group label {
  margin: 0;
}
#row-input {
  width: 72px;
  min-height: 32px;
  padding: 4px 8px;
}
.tb-check {
  margin: 0;
}
#add-box {
  margin-left: auto;
}
.seg {
  position: relative;
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.seg label {
  margin: 0;
  padding: 5px 12px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
  background: var(--surface);
  border-right: 1px solid var(--border);
}
.seg label:last-of-type {
  border-right: 0;
}
.seg input:checked + label {
  background: var(--primary);
  color: var(--on-primary);
}
.seg input:focus-visible + label {
  outline: 3px solid var(--focus);
  outline-offset: -3px;
}
.seg-full {
  display: flex;
}
.seg-full label {
  flex: 1;
  text-align: center;
}

.editor-body {
  display: grid;
  gap: 16px;
}
@media (min-width: 1000px) {
  .editor-body {
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
  }
  .side {
    position: sticky;
    top: 12px;
    max-height: calc(100vh - 24px);
    overflow: auto;
  }
}
.stage-col {
  min-width: 0;
  background: var(--stage-bg);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.stage {
  position: relative;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 2px 12px rgb(0 0 0 / 18%);
  max-width: 100%;
  user-select: none;
  -webkit-user-select: none;
}
.stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.stage canvas[hidden] {
  display: none;
}
.overlay {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.overlay.is-placing {
  cursor: crosshair;
}
.stage-status {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  max-width: calc(100% - 20px);
  padding: 6px 12px;
  font-size: 0.85rem;
  color: #fff;
  background: rgb(20 24 34 / 88%);
  border-radius: 999px;
  text-align: center;
  z-index: 5;
}
.hint {
  margin: 10px 2px 0;
}

.tbox {
  position: absolute;
  cursor: move;
  touch-action: none;
  outline: 1px dashed rgb(50 69 204 / 55%);
  outline-offset: 0;
  background: rgb(50 69 204 / 4%);
  white-space: pre;
  line-height: 1.2;
  font-kerning: none;
}
.tbox:hover {
  outline-color: rgb(50 69 204 / 85%);
}
.tbox.is-selected {
  outline: 2px solid #3245cc;
  background: rgb(50 69 204 / 8%);
  z-index: 2;
}
.tbox:focus-visible {
  outline: 3px solid #1b66e0;
  outline-offset: 1px;
}
.tbox.has-issue {
  outline: 2px solid #c42535;
  background: rgb(196 37 53 / 8%);
}
.tline {
  position: absolute;
  white-space: pre;
  line-height: 1.2;
  pointer-events: none;
}
.tline-empty {
  position: static;
  color: #6b7384;
  font-family: var(--font);
  font-style: italic;
  font-weight: 400;
  padding: 2px 4px;
}
.tbox-handle {
  position: absolute;
  top: 50%;
  right: -7px;
  width: 12px;
  height: 22px;
  margin-top: -11px;
  background: #fff;
  border: 2px solid #3245cc;
  border-radius: 4px;
  cursor: ew-resize;
  opacity: 0;
}
.tbox:hover .tbox-handle,
.tbox.is-selected .tbox-handle {
  opacity: 1;
}
@media (pointer: coarse) {
  /* Big invisible touch target, slim visible grip, only on the selected box. */
  .tbox-handle {
    width: 28px;
    right: -15px;
    height: 36px;
    margin-top: -18px;
    background: transparent;
    border: 0;
  }
  .tbox-handle::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 8px;
    height: 20px;
    margin: -10px 0 0 -4px;
    background: #fff;
    border: 2px solid #3245cc;
    border-radius: 4px;
  }
  .tbox:hover .tbox-handle {
    opacity: 0;
  }
  .tbox.is-selected .tbox-handle {
    opacity: 1;
  }
}
.guide {
  position: absolute;
  pointer-events: none;
  z-index: 3;
}
.guide-v {
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 1px dashed #e0247a;
}
.frect {
  position: absolute;
  border: 1.5px solid rgb(14 111 104 / 70%);
  background: rgb(14 111 104 / 8%);
  border-radius: 2px;
  cursor: pointer;
}
.frect.is-unmapped {
  border-style: dashed;
  border-color: rgb(120 128 145 / 70%);
  background: transparent;
}
.frect.is-highlighted {
  border: 2px solid #e0247a;
  background: rgb(224 36 122 / 10%);
}
.frect-tag {
  position: absolute;
  left: -1px;
  bottom: 100%;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 4px;
  font: 600 10px/1.5 var(--font);
  color: #fff;
  background: rgb(14 111 104 / 90%);
  border-radius: 3px 3px 0 0;
  opacity: 0;
}
.frect:hover .frect-tag,
.frect.is-highlighted .frect-tag {
  opacity: 1;
}

.side {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.side-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.side-card p {
  margin: 4px 0 8px;
}
.side-title {
  font-size: 1rem;
  margin: 0 0 6px;
}
.grid-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 10px;
}
.grid-fields.three {
  grid-template-columns: 1fr 1fr 1fr;
}
.grid-fields .span-2 {
  grid-column: span 2;
}
details.position {
  margin-top: 8px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  font: inherit;
  font-size: 0.84rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.font-list {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
}
.font-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.fields-list {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}
.field-row {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.field-row label {
  margin-top: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.field-row p {
  margin: 4px 0 0;
}
.field-row.is-disabled {
  opacity: 0.7;
}
.field-row.has-issue {
  border-color: var(--danger);
}
.field-name {
  font-family: var(--mono);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}
.badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
}

/* generate */
.choices {
  display: grid;
  gap: 10px;
}
@media (min-width: 700px) {
  .choices {
    grid-template-columns: 1fr 1fr;
  }
}
.choice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-weight: 400;
  cursor: pointer;
}
.choice > span {
  display: grid;
}
.choice input {
  margin-top: 0.35em;
  accent-color: var(--primary);
}
.choice:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.out-options {
  margin-top: 12px;
  max-width: 560px;
}
.input-suffix {
  display: flex;
  align-items: stretch;
}
.input-suffix input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.input-suffix span {
  display: grid;
  place-items: center;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.9rem;
}
#file-example {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
}
.generate-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.progress-wrap {
  margin-top: 14px;
  max-width: 560px;
}
progress {
  width: 100%;
  height: 12px;
  accent-color: var(--primary);
}
.progress-wrap p {
  margin: 6px 0 0;
}
.result {
  margin-top: 14px;
  padding: 14px;
  background: var(--ok-soft);
  border-radius: var(--radius-sm);
}
.result-title {
  margin: 0 0 10px;
  font-weight: 700;
}
.result p:last-child {
  margin: 8px 0 0;
}
.reset-row {
  margin: 18px 0 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 50;
  max-width: min(560px, calc(100vw - 32px));
  padding: 10px 16px;
  color: #fff;
  background: #1c2130;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgb(0 0 0 / 25%);
  font-size: 0.92rem;
}
.toast .btn-link {
  color: #b9c6ff;
  font-weight: 700;
  margin-left: 8px;
}

/* ---------- content ---------- */
.content-layout {
  display: grid;
  gap: 32px;
  margin-top: 8px;
}
@media (min-width: 1100px) {
  .content-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
  }
}
.prose {
  max-width: 74ch;
}
.prose h2 {
  font-size: 1.45rem;
  margin-top: 1.8em;
}
.prose h3 {
  font-size: 1.12rem;
  margin-top: 1.4em;
}
.prose p,
.prose li {
  color: var(--text);
}
.prose ul,
.prose ol {
  padding-left: 1.3em;
}
.prose li {
  margin: 0.3em 0;
}
.steps-list {
  counter-reset: s;
  list-style: none;
  padding: 0 !important;
  display: grid;
  gap: 12px;
}
.steps-list li {
  counter-increment: s;
  position: relative;
  padding: 12px 14px 12px 52px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.steps-list li::before {
  content: counter(s);
  position: absolute;
  left: 14px;
  top: 12px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.9rem;
}
.cards {
  display: grid;
  gap: 12px;
  padding: 0 !important;
  list-style: none;
}
@media (min-width: 640px) {
  .cards {
    grid-template-columns: 1fr 1fr;
  }
}
.cards li {
  margin: 0;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.cards strong {
  display: block;
  margin-bottom: 2px;
}
.faq details {
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.faq summary {
  font-weight: 600;
  color: var(--text);
  font-size: 1.02rem;
}
.faq details p {
  margin: 8px 0 0;
}
.callout {
  padding: 14px 16px;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
}
.page-simple {
  padding-top: 28px;
}
.page-simple h1 {
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem);
}
.updated {
  color: var(--muted);
  font-size: 0.92rem;
}
.related {
  display: grid;
  gap: 8px;
  list-style: none;
  padding: 0 !important;
}

/* ---------- ad slots (placeholders; see README) ---------- */
.ad-slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 40px auto;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.ad-slot::before {
  content: "Advertisement";
  position: absolute;
  top: 4px;
  left: 8px;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.ad-slot--wide {
  max-width: 970px;
  min-height: 280px;
}
.ad-slot--inline {
  max-width: 728px;
  min-height: 280px;
}
.ad-slot--sidebar {
  display: none;
}
@media (min-width: 1100px) {
  .ad-slot--sidebar {
    display: flex;
    position: sticky;
    top: 16px;
    width: 300px;
    min-height: 600px;
    margin: 0;
  }
}

@media print {
  .site-header,
  .site-footer,
  .ad-slot,
  .tool {
    display: none;
  }
}
