@font-face { font-family: "Cormorant Garamond"; src: url("/fonts/cormorant-garamond-latin-ext-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Cormorant Garamond"; src: url("/fonts/cormorant-garamond-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("/fonts/cormorant-garamond-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("/fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("/fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("/fonts/cormorant-garamond-latin-600-italic.woff2") format("woff2"); font-weight: 600; font-style: italic; font-display: swap; }
@font-face { font-family: "Great Vibes"; src: url("/fonts/great-vibes-latin-ext-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Great Vibes"; src: url("/fonts/great-vibes-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: Outfit; src: url("/fonts/outfit-latin-ext-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Outfit; src: url("/fonts/outfit-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: Outfit; src: url("/fonts/outfit-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  --bg: #e6e1d8;
  --paper: #f7f4ef;
  --ink: #1c1b19;
  --muted: #6f6a62;
  --line: #e0d9ce;
  --script: #3e5c73;
  --panel: #fbfaf7;
  --serif: "Cormorant Garamond", Palatino, "Palatino Linotype", serif;
  --sans: Outfit, "Avenir Next", "Segoe UI", sans-serif;
  --script: "Great Vibes", cursive;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 400px; align-items: start; min-height: 100vh; }
.sheet-wrap { padding: 28px 22px 72px; }
.paper {
  width: min(820px, 100%);
  margin: 0 auto;
  background: var(--paper);
  padding: 52px 58px 48px;
  box-shadow: 0 16px 50px rgba(70, 55, 30, 0.08);
}
.panel {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  background: var(--panel);
  border-left: 1px solid var(--line);
  padding: 20px 18px 48px;
}
.panel-head, .panel-actions, .lines-head, .split { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.panel h1 { font-size: 15px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; margin: 0; }
.panel label, .link-copy { display: block; margin: 12px 0; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.panel input, .panel textarea, .panel select {
  display: block; width: 100%; margin-top: 6px; padding: 8px 10px;
  border: 1px solid #e4dfd6; border-radius: 6px; background: #fff;
  letter-spacing: 0; text-transform: none; font-size: 15px; line-height: 1.4;
}
.panel textarea { resize: vertical; }
.split label { flex: 1; }
.group-label, .saved p, .doc-no { margin: 18px 0 8px; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.doc-no { margin-top: 8px; }
.saved { display: flex; flex-direction: column; gap: 4px; max-height: 148px; overflow: auto; margin-top: 16px; }
.saved a { text-decoration: none; font-size: 13px; letter-spacing: 0; text-transform: none; padding: 4px 0; border-bottom: 1px solid transparent; }
.saved a[aria-current="page"] { border-bottom-color: var(--ink); }
.line-edit { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.line-price { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; }
.locked { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.panel-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin: 8px 0 16px; }
.panel-totals div { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.panel-totals dt { color: var(--muted); }
.panel-totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--ink); background: #fff; color: var(--ink);
  border-radius: 6px; padding: 8px 12px; text-decoration: none;
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
}
.btn.solid { background: var(--ink); color: #fff; }
.btn.wide { width: 100%; margin-top: 8px; }
.btn.ghost { background: transparent; }
.textish { border: 0; background: transparent; padding: 8px 0; color: var(--muted); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.quiet, .fine { color: var(--muted); font-size: 13px; line-height: 1.45; letter-spacing: 0; text-transform: none; }
.banner { width: min(820px, 100%); margin: 0 auto 16px; background: #fff; border: 1px solid #e4c7b0; padding: 12px 14px; border-radius: 8px; font-size: 14px; line-height: 1.45; }
.banner.ok { border-color: #c9d3c4; }
.banner p { margin: 0 0 4px; }
.status { letter-spacing: 0.14em; text-transform: uppercase; font-size: 12px; }
.status.accepted { color: #27553a; }
.after-save { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 8px; }
.links { margin: 10px 0; }
.links .btn { flex: 1; }
.payments { list-style: none; padding: 0; margin: 8px 0; font-size: 13px; }
.payments li { padding: 4px 0; border-bottom: 1px solid var(--line); }

.doc-top { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.meta { margin: 0; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; line-height: 1.85; color: var(--muted); }
.meta b { color: var(--ink); font-weight: 500; letter-spacing: 0.08em; }
.accepted-flag { color: #27553a; }
.brand { display: flex; gap: 10px; align-items: center; text-align: left; }
.brand strong { display: block; font-family: var(--serif); font-weight: 600; letter-spacing: 0.18em; font-size: 18px; }
.brand span { display: block; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.diamond { width: 42px; height: 42px; }
.diamond path { fill: none; stroke: var(--ink); stroke-width: 1.4; }
.script-title { font-family: var(--script); font-size: 84px; font-weight: 400; line-height: 0.8; margin: 28px 0 10px; }
.deck { font-family: var(--serif); font-style: italic; font-size: 22px; margin: 0 0 18px; }
.letter { font-family: var(--serif); font-size: 18px; line-height: 1.45; white-space: pre-wrap; max-width: 62ch; margin: 0 0 8px; }
.signoff { display: flex; flex-direction: column; margin: 8px 0 22px; }
.script-name { font-family: var(--script); font-size: 52px; line-height: 1; }
.signoff span:last-child { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.prepared, .commission h3, .terms h3, .bank h3, .acceptance h3 {
  font-family: var(--sans); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 500; color: var(--muted);
}
.prepared { display: grid; grid-template-columns: 160px 1fr; gap: 12px; border-top: 1px solid var(--line); padding-top: 16px; }
.prepared p { margin: 0; }
.prepared strong, .prepared span { display: block; font-family: var(--serif); font-size: 20px; letter-spacing: 0; text-transform: none; color: var(--ink); font-weight: 500; }
.prepared span { font-size: 16px; font-weight: 400; color: #3c3934; white-space: pre-wrap; }
.commission { margin-top: 28px; }
.commission h3, .terms h3, .bank h3, .acceptance h3 { margin: 0 0 8px; }
.item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 28px; border-top: 1px solid var(--line); padding: 18px 0; }
.item h3 { font-family: var(--serif); font-size: 28px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink); margin: 0; }
.item p { font-family: var(--serif); font-size: 17px; line-height: 1.4; margin: 6px 0 0; white-space: pre-wrap; max-width: 58ch; }
.price { font-family: var(--serif); font-size: 20px; font-variant-numeric: tabular-nums; padding-top: 6px; }
.price.script { font-family: var(--script); font-size: 36px; line-height: 1.4; color: var(--script); padding: 4px 0 10px; }
.totals { width: min(100%, 380px); margin: 12px 0 0 auto; }
.totals div { display: flex; justify-content: space-between; gap: 18px; padding: 4px 0; font-family: var(--serif); font-size: 17px; }
.totals dt { color: #3c3934; }
.totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.totals .grand { border-top: 1px solid var(--ink); margin-top: 6px; padding-top: 8px; font-size: 20px; }
.totals .grand dt, .totals .grand dd { font-weight: 600; }
.terms { margin-top: 36px; }
.terms ol { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 28px; }
.terms li { break-inside: avoid; display: grid; grid-template-columns: 28px 1fr; gap: 8px; margin: 0 0 12px; }
.terms span { font-size: 12px; letter-spacing: 0.08em; color: var(--muted); }
.terms p, .acceptance p, .bank > p { font-family: var(--serif); font-size: 15px; line-height: 1.4; margin: 0; }
.bank { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 18px; }
.bank dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; margin: 14px 0; }
.bank dt { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.bank dd { margin: 2px 0 8px; font-family: var(--serif); font-size: 22px; }
.ozow-button {
  width: 100%; border: 0; border-radius: 999px; background: var(--ink); color: #fff;
  padding: 14px 18px; font-size: 15px; letter-spacing: 0.03em;
}
.acceptance { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 18px; }
.sign-line { display: flex; justify-content: space-between; gap: 24px; margin-top: 28px; border-top: 1px solid var(--ink); padding-top: 8px; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
.colophon { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 36px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.customer .sheet-wrap { max-width: 920px; margin: 0 auto; }
.customer-pdf { text-align: center; }
.customer-pdf a { color: var(--muted); }
.login-page { min-height: 100vh; display: grid; place-items: center; }
.login { width: min(420px, calc(100% - 32px)); background: var(--paper); padding: 36px 32px; box-shadow: 0 16px 50px rgba(70, 55, 30, 0.08); }
.login h1 { font-family: var(--serif); font-weight: 500; font-size: 40px; margin: 8px 0 18px; }
.brand-lockup { display: flex; gap: 8px; align-items: center; letter-spacing: 0.16em; text-transform: uppercase; font-size: 13px; }
.login label { display: block; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.login input { display: block; width: 100%; margin: 6px 0 14px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; letter-spacing: 0; text-transform: none; font-size: 16px; }

@media (max-width: 980px) {
  .workspace { grid-template-columns: 1fr; }
  .panel { position: static; height: auto; border-left: 0; border-bottom: 1px solid var(--line); }
  .paper { padding: 32px 22px; }
  .script-title { font-size: 64px; }
  .doc-top, .prepared, .bank dl { display: grid; grid-template-columns: 1fr; }
  .terms ol { columns: 1; }
  .item { grid-template-columns: 1fr; gap: 4px; }
  .price { padding-top: 0; }
  .line-price { grid-template-columns: 1fr; }
  .sign-line { flex-direction: column; gap: 18px; }
}
@media print {
  body { background: white; }
  .panel, .noprint, .customer-pdf, .banner { display: none !important; }
  .workspace, .sheet-wrap { display: block; padding: 0; }
  .paper { box-shadow: none; width: auto; max-width: none; }
}
