:root {
  color-scheme: light;
  --ink: #192a21;
  --forest: #16372a;
  --forest-deep: #102c22;
  --paper: #fffefa;
  --wash: #f1f2eb;
  --sage: #dbe8cd;
  --sage-ink: #284422;
  --muted: #57675d;
  --border: #d8e0d3;
  --gold: #f6e8bf;
  --gold-ink: #614916;
  --red: #8f2725;
  --red-wash: #fff0ef;
  --radius: 19px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--wash);
  line-height: 1.45;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
h1, h2, h3, p, dl, dd, ol, ul { margin: 0; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button, .button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid #80aa6a; outline-offset: 3px; }
[hidden] { display: none !important; }
.visually-hidden, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 10; padding: 10px 14px; background: var(--paper); }
.loading, .noscript { padding: 36px 20px; text-align: center; color: var(--muted); }

.topbar { border-bottom: 1px solid var(--border); background: var(--paper); }
.topbar-inner { max-width: 1020px; min-height: 72px; margin: 0 auto; padding: 10px 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 19px; font-weight: 730; letter-spacing: -.045em; color: var(--forest); }
.brandmark { position: relative; display: inline-grid; place-items: center; width: 35px; height: 35px; flex: 0 0 35px; color: var(--forest); background: var(--sage); border-radius: 11px; }
.brandmark::before { content: ""; width: 14px; height: 14px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg) translate(1px,-2px); border-radius: 2px; }
.brandmark::after { content: ""; position: absolute; top: 12px; left: 16px; width: 8px; height: 6px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); }
.topbar .quiet { white-space: nowrap; }
.topbar-nav { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; justify-content: flex-end; }
.topbar-nav > a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 9px; border-radius: 9px; text-decoration: none; font-size: 13px; font-weight: 680; color: var(--forest); }
.topbar-nav > a[aria-current="page"] { background: var(--sage); }
.topbar-nav .quiet { font-size: 13px; }
.shell { width: min(calc(100% - 36px), 900px); margin: 0 auto; padding: 42px 0 54px; }
.shell.narrow { max-width: 680px; }
.stack { display: grid; gap: 16px; }
.screen-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
h1 { font-size: clamp(30px, 6vw, 46px); font-weight: 690; line-height: 1.04; letter-spacing: -.065em; overflow-wrap: anywhere; }
h2 { font-size: 20px; font-weight: 700; letter-spacing: -.04em; line-height: 1.2; }
h3 { font-size: 15px; line-height: 1.3; }
.lede { color: var(--muted); font-size: 15px; margin-top: 7px; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.eyebrow { font-size: 12px; font-weight: 740; color: var(--muted); letter-spacing: .045em; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.card { padding: 22px; border: 1px solid var(--border); background: var(--paper); border-radius: var(--radius); min-width: 0; }
.card-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; }
.quiet, .back { font-size: 14px; font-weight: 650; color: var(--forest); display: inline-flex; align-items: center; justify-content: center; min-height: 44px; text-underline-offset: 3px; }
.quiet { padding: 0 4px; border: 0; background: transparent; text-decoration: underline; }
.back { margin: -14px 0 6px; text-decoration: none; }
.back::before { content: "←"; margin-right: 8px; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 48px; border: 1px solid transparent; padding: 9px 17px; gap: 7px; border-radius: 12px; text-decoration: none; font-size: 14px; font-weight: 680; line-height: 1.3; text-align: center; }
.primary { color: var(--paper); background: var(--forest); }
.primary:hover { background: var(--forest-deep); }
.secondary { color: var(--forest); border-color: var(--border); background: var(--paper); }
.secondary:hover { border-color: #9bad99; }
.button[disabled] { cursor: wait; opacity: .64; }
.actions { display: flex; flex-wrap: wrap; gap: 9px 12px; align-items: center; }
.actions > .button { flex: 1 1 auto; }
.pill { display: inline-flex; align-items: center; width: fit-content; gap: 6px; min-height: 26px; padding: 4px 9px; border-radius: 99px; color: var(--sage-ink); background: var(--sage); font-size: 11px; line-height: 1.2; font-weight: 720; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.pending { color: var(--gold-ink); background: var(--gold); }
.pill.neutral { color: var(--muted); background: var(--wash); }
.error { color: var(--red); background: var(--red-wash); border-radius: 10px; padding: 10px 12px; font-size: 14px; overflow-wrap: anywhere; }
.notice { color: var(--forest); background: var(--sage); border-radius: 11px; padding: 10px 12px; font-size: 14px; overflow-wrap: anywhere; }

.login { max-width: 440px; padding-top: clamp(40px, 12vh, 110px); }
.login .card { padding: 28px; }
.login h1 { margin: 1px 0 4px; }
.login .intro { margin-bottom: 22px; }
.login form { display: grid; gap: 14px; }
label.field { display: grid; gap: 6px; font-size: 13px; font-weight: 670; min-width: 0; }
.optional { font-size: 12px; font-weight: 450; color: var(--muted); }
input:not([type="checkbox"]), textarea, select { min-height: 47px; width: 100%; min-width: 0; padding: 10px 11px; color: var(--ink); border: 1px solid #c9d5c5; background: #fff; border-radius: 10px; font-size: 16px; line-height: 1.35; }
::placeholder { color: #66756b; opacity: 1; }
textarea { resize: vertical; min-height: 74px; }
input[type="checkbox"] { width: 20px; height: 20px; margin: 0; accent-color: var(--forest); }
input[type="file"] { max-width: 100%; font-size: 14px; }
input[type="file"]::file-selector-button { appearance: none; margin-right: 10px; padding: 6px 10px; border: 0; border-radius: 6px; background: var(--sage); color: var(--forest); cursor: pointer; font: inherit; font-weight: 650; }
.check { min-height: 44px; display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 650; }
.fields, .item-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.fields .full { grid-column: 1 / -1; }
.business-actions { display: flex; justify-content: flex-end; margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--border); }
.save-business-link { text-align: right; }
.quote-draft { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; }
fieldset { margin: 0; padding: 0; border: 0; min-inline-size: 0; }
legend { padding: 0; margin-bottom: 13px; font-size: 20px; font-weight: 700; letter-spacing: -.04em; }
.form-card { display: grid; gap: 14px; }
.form-card .rule-top { border-top: 1px solid var(--border); padding-top: 13px; }
.item-grid { grid-template-columns: minmax(0, 1fr) minmax(65px, 80px) minmax(94px, 115px) minmax(74px, auto); align-items: end; gap: 8px 11px; }
.item-total { display: grid; justify-items: end; gap: 6px; font-size: 13px; font-weight: 670; }
.item-total span { color: var(--muted); }
.item-total output { display: flex; align-items: center; min-height: 47px; font-size: 16px; }
.item-grid .remove-item { grid-column: 1 / -1; justify-self: end; min-height: 44px; }
.item-grid + .item-grid { padding-top: 14px; border-top: 1px solid var(--border); }
.amount-entry { position: relative; }
.amount-entry::before { content: "$"; position: absolute; left: 11px; top: 12px; color: var(--muted); font-size: 15px; pointer-events: none; }
.amount-entry input { padding-left: 25px; }
.summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 0 1px; border-top: 1px solid var(--border); font-size: 14px; font-weight: 650; }
.summary strong { font-size: 24px; letter-spacing: -.05em; }
.summary.balance { border: 0; padding: 12px; background: var(--sage); border-radius: 10px; }
.business-identity { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.business-copy { min-width: 0; overflow-wrap: anywhere; }
.business-copy > strong { display: block; line-height: 1.3; }
.business-contact { display: flex; flex-wrap: wrap; margin-top: 4px; gap: 4px 12px; color: var(--muted); font-style: normal; font-size: 13px; line-height: 1.45; }
.business-contact > span { white-space: pre-line; overflow-wrap: anywhere; }
.business-logo { display: block; width: 70px; height: 60px; flex: 0 0 70px; padding: 5px; border: 1px solid var(--border); border-radius: 9px; background: #fff; object-fit: contain; }
.logo-setting { display: grid; grid-template-columns: 126px minmax(0, 1fr); align-items: start; gap: 15px; }
.logo-preview { display: grid; place-items: center; min-height: 108px; overflow: hidden; background: #fff; border: 1px solid var(--border); border-radius: 10px; }
.logo-preview .business-logo { width: 100%; height: 108px; padding: 7px; border: 0; border-radius: 0; }
.logo-controls { display: grid; gap: 5px; min-width: 0; }
.logo-controls .quiet { justify-self: start; }

.job-list { display: grid; gap: 10px; list-style: none; padding: 0; }
.job-row { background: var(--paper); border: 1px solid var(--border); border-radius: 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 15px; padding: 15px 16px; text-decoration: none; color: inherit; }
.job-row:hover { border-color: #9bad99; }
.job-row strong, .job-row small { display: block; overflow-wrap: anywhere; }
.job-row strong { font-size: 16px; line-height: 1.35; }
.job-row small { color: var(--muted); font-size: 13px; margin-top: 3px; }
.draft-resume { color: var(--forest); font-size: 13px; font-weight: 680; white-space: nowrap; }
.job-row .job-right { display: grid; justify-items: end; align-content: center; gap: 5px; }
.empty { display: grid; align-content: start; justify-items: start; gap: 11px; padding: 30px 24px; }
.detail { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr); align-items: start; gap: 15px; }
.detail > :only-child { grid-column: 1 / -1; }
.detail-status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.pricelist { display: grid; }
.price-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: baseline; gap: 9px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.price-row dt { min-width: 0; overflow-wrap: anywhere; }
.line-math { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.price-row:last-child { border-bottom: 0; }
.price-row.total { padding-top: 13px; font-weight: 700; }
.price-row.total dd { font-size: 25px; letter-spacing: -.045em; }
.breakable, .extra h3, .prewrap { overflow-wrap: anywhere; }
.prewrap { white-space: pre-wrap; }
.inset { padding: 13px 14px; background: var(--wash); border: 1px solid var(--border); border-radius: 12px; }
.extras-list { display: grid; gap: 11px; }
.extra { display: grid; gap: 10px; padding-top: 13px; border-top: 1px solid var(--border); }
.extra .line { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.extra .meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 5px 10px; }
.keyline { border-top: 1px solid var(--border); padding-top: 12px; }
.share-links { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.share-links > * { flex: 1 1 auto; }
.share-copy { margin-top: 9px; }
.share-copy input { font-size: 14px; }

.customer-shell { padding-top: clamp(22px, 7vw, 60px); width: min(calc(100% - 28px), 600px); }
.document { padding: 0; overflow: hidden; }
.document-head { background: var(--forest); color: var(--paper); padding: 23px; display: grid; gap: 5px; }
.document-head .eyebrow { color: #cde4d1; }
.document-head .business-identity { margin-top: 3px; }
.document-head .business-copy > strong { font-weight: 670; font-size: 19px; letter-spacing: -.03em; }
.document-head .business-contact { color: #d5e6d7; }
.document-body { display: grid; gap: 14px; padding: clamp(16px, 5vw, 26px); }
.document-body h1 { font-size: clamp(30px, 7vw, 43px); }
.document-body .pricelist { padding: 3px 13px; }
.document-body .acceptance { display: grid; gap: 9px; }
.document-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 135px), 1fr)); gap: 10px 14px; padding: 10px 0; border-block: 1px solid var(--border); font-size: 13px; }
.document-meta dt { margin-bottom: 1px; font-weight: 680; }
.document-meta dd { color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.document-notes { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.document-notes p { margin-top: 3px; color: var(--muted); font-size: 14px; }
.showcase-id { font-size: 13px; color: var(--muted); font-weight: 640; overflow-wrap: anywhere; min-width: 0; }
.included { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
@media (max-width: 700px) {
  .detail { grid-template-columns: 1fr; }
  .topbar-inner { min-height: 63px; padding: 7px 16px; }
  .shell { padding-top: 28px; }
}
@media (max-width: 420px) {
  .shell { width: calc(100% - 26px); padding-bottom: max(34px, env(safe-area-inset-bottom)); }
  .card { padding: 16px; }
  .document { padding: 0; }
  .screen-heading { align-items: flex-start; }
  .fields { grid-template-columns: 1fr; gap: 12px; }
  .form-card .item-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .item-grid .item-description { grid-column: 1 / -1; }
  .item-grid .item-total { display: flex; align-items: baseline; gap: 8px; grid-column: 1 / -1; }
  .item-grid .item-total output { min-height: 0; }
  .item-grid:has(.remove-item:not([hidden])) .item-total { grid-column: 1; flex-wrap: wrap; }
  .item-grid .remove-item { grid-column: 2; }
  .login .card { padding: 20px; }
  .logo-setting { grid-template-columns: 1fr; gap: 10px; }
  .logo-preview { width: 126px; }
}
@media (max-width: 360px) {
  .topbar-inner { flex-wrap: wrap; gap: 0; }
  .topbar-nav { justify-content: flex-start; width: 100%; }
  .topbar-nav > a:first-child { margin-left: -5px; }
}
@media print { .topbar, .actions, .back { display: none; } .shell { width: 100%; padding: 0; } }
