:root {
  color-scheme: light;
  --paper: #fbfaf6;
  --ink: #09090b;
  --muted: #5b5a54;
  --line: #d8d7d1;
  --coral: #f26247;
  font-family: Archivo, Arial, Helvetica, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled { opacity: .55; cursor: not-allowed; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid #8cb8d1; outline-offset: 2px; }
.topbar { min-height: 64px; padding: 0 max(24px, calc((100% - 1200px)/2)); display: flex; align-items: center; justify-content: space-between; gap: 16px; background: #fff; border-bottom: 1px solid var(--line); }
.wordmark { color: var(--ink); font-size: 23px; font-weight: 800; text-decoration: none; }
.wordmark span { color: var(--coral); }
.article-link { color: var(--ink); font-size: 13px; font-weight: 700; text-underline-offset: 3px; }
main { max-width: 1200px; margin: 28px auto; padding: 0 24px; }
.layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 12px; align-items: start; }
.editor { min-width: 0; padding: 24px; background: #fff; border: 1px solid var(--line); }
h1 { font-size: 24px; line-height: 1.2; margin: 0 0 22px; }
.fields { display: grid; gap: 14px; }
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: block; min-width: 0; font-size: 14px; font-weight: 700; }
.limit { display: block; margin: 4px 0 7px; color: var(--muted); font-size: 11px; font-weight: 400; }
input, select { display: block; width: 100%; min-width: 0; min-height: 44px; margin-top: 7px; padding: 9px 10px; border: 1px solid #77756f; border-radius: 0; background: #fff; color: var(--ink); font-size: 14px; }
.limit + input { margin-top: 0; }
input[type=file] { height: auto; padding: 9px; }
.currency-control { max-width: 220px; margin-top: 18px; }
.services { min-width: 0; margin: 20px 0 14px; padding: 20px 0 0; border: 0; border-top: 1px solid var(--line); }
legend { padding: 0 0 12px; font-size: 18px; font-weight: 700; }
legend .limit { display: inline; margin-left: 7px; }
.service-row { margin-bottom: 12px; padding: 14px; border: 1px solid var(--line); }
.row-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; color: var(--muted); font-size: 12px; font-weight: 700; }
.remove-row { padding: 4px; border: 0; background: none; color: #bd4937; text-decoration: underline; }
.row-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.row-fields label { font-size: 12px; }
.row-fields input, .row-fields select { font-size: 13px; }
.text-button, .reset { min-height: 44px; padding: 8px 0; border: 0; background: none; color: var(--ink); font-size: 14px; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.terms-label { margin-top: 18px; }
.business-details { margin-top: 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.business-details summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 17px 0; list-style: none; cursor: pointer; font-size: 17px; font-weight: 700; }
.business-details summary::-webkit-details-marker { display: none; }
.business-details summary span { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 400; }
.business-details summary::after { content: '+'; color: #c54831; font-size: 22px; line-height: 1; }
.business-details[open] summary::after { content: '-'; }
.optional-fields { display: grid; gap: 14px; padding-bottom: 20px; }
.input-note { margin: 15px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.form-error { min-height: 1.5em; margin: 8px 0; color: #a51d16; font-size: 13px; font-weight: 700; }
.actions { display: flex; align-items: center; gap: 20px; margin-top: 12px; }
.download { min-height: 44px; padding: 10px 16px; border: 1px solid var(--ink); border-radius: 0; background: var(--coral); color: var(--ink); font-size: 14px; font-weight: 700; }
.download:hover { background: #e5553c; }
.preview-wrap { position: sticky; top: 20px; min-width: 0; padding: 14px; background: var(--ink); }
.preview { display: flex; flex-direction: column; min-height: 440px; padding: 26px; background: #fff; color: var(--ink); font-family: 'JetBrains Mono', 'Courier New', monospace; }
.preview-top { display: flex; justify-content: space-between; gap: 16px; min-height: 68px; }
.preview h3 { margin: 0 0 6px; font-size: 18px; }
.preview-studio { margin: 0; font-size: 12px; }
#preview-logo { max-width: 100px; max-height: 58px; object-fit: contain; align-self: start; }
.preview-contact { display: flex; flex-wrap: wrap; gap: 5px 14px; margin: 6px 0 12px; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.preview-contact a { color: inherit; }
.preview-table { margin-top: 24px; font-size: 11px; }
.table-head, .preview-row { display: grid; grid-template-columns: 1.15fr .75fr .75fr 1.6fr; gap: 8px; }
.table-head { padding-bottom: 8px; border-bottom: 1px solid var(--line); color: var(--muted); }
.preview-row { padding: 11px 0; border-bottom: 1px solid #e6e6e3; overflow-wrap: anywhere; }
.preview-terms { margin: 28px 0 0; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.preview-footer { margin-top: auto; padding-top: 14px; text-align: right; color: #767673; font-size: 9px; font-weight: 400; }
.preview-footer a { color: inherit; }
.embed-mode body { background: #fff; }
.embed-mode .topbar { display: none; }
.embed-mode main { max-width: none; margin: 0; padding: 0; }
.embed-mode .layout { gap: 12px; }
.embed-mode .preview-wrap { position: relative; top: auto; }
@media (max-width: 850px) {
  .layout { grid-template-columns: 1fr; }
  .preview-wrap { position: static; }
  .preview { min-height: 360px; }
}
@media (max-width: 560px) {
  .topbar { padding: 0 16px; }
  main { padding: 0 16px; }
  .editor { padding: 18px; }
  .two-col, .row-fields { grid-template-columns: 1fr; }
  .currency-control { max-width: none; }
  .preview-wrap { padding: 14px; }
  .preview { padding: 18px; min-height: 360px; }
  .table-head { display: none; }
  .preview-row { grid-template-columns: 1fr; gap: 4px; }
  .preview-row span::before { display: inline-block; min-width: 96px; color: var(--muted); font-weight: 700; }
  .preview-row span:nth-child(1)::before { content: 'Service'; }
  .preview-row span:nth-child(2)::before { content: 'Unit'; }
  .preview-row span:nth-child(3)::before { content: 'Price'; }
  .preview-row span:nth-child(4)::before { content: 'Details'; }
}
