/* Pikkola Invoice: paper and lamplight */

:root {
  --bg: #f4f1e8;
  --bg-2: #efeade;
  --surface: #fffdf8;
  --surface-2: #faf7ef;
  --surface-3: #f3efe4;
  --line: rgba(23, 24, 26, .10);
  --line-2: rgba(23, 24, 26, .17);
  --line-3: rgba(23, 24, 26, .26);
  --ink: #17181a;
  --ink-2: #3a3c3f;
  --muted: #6d6b64;
  --faint: #93908a;
  --accent: #2f5d4f;
  --accent-ink: #fdfcf6;
  --accent-soft: rgba(47, 93, 79, .09);
  --accent-line: rgba(47, 93, 79, .28);
  --seal: #9d5433;
  --good: #2c7355;
  --warn: #9a6417;
  --bad: #9c3a33;
  --shadow: 0 1px 2px rgba(23, 24, 26, .04), 0 18px 40px -30px rgba(23, 24, 26, .5);
  --shadow-paper: 0 1px 1px rgba(23, 24, 26, .06), 0 26px 50px -34px rgba(23, 24, 26, .55);
  --radius: 14px;
  --radius-sm: 9px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, "Apple SD Gothic Neo", "Noto Sans KR", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #14140f;
  --bg-2: #191913;
  --surface: #1c1c16;
  --surface-2: #21211a;
  --surface-3: #262620;
  --line: rgba(240, 236, 224, .09);
  --line-2: rgba(240, 236, 224, .16);
  --line-3: rgba(240, 236, 224, .26);
  --ink: #edeae0;
  --ink-2: #cfcbc0;
  --muted: #a3a093;
  --faint: #7d7a6f;
  --accent: #8ec4ab;
  --accent-ink: #12211b;
  --accent-soft: rgba(142, 196, 171, .12);
  --accent-line: rgba(142, 196, 171, .32);
  --seal: #c98a63;
  --good: #7cc4a1;
  --warn: #d9ad63;
  --bad: #e08d84;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 22px 44px -32px rgba(0, 0, 0, .9);
  --shadow-paper: 0 24px 60px -30px rgba(0, 0, 0, .85);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.62;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  word-break: keep-all;
  overflow-wrap: break-word;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(760px 380px at 12% -6%, rgba(157, 84, 51, .055), transparent 70%),
    radial-gradient(900px 420px at 82% 0%, rgba(47, 93, 79, .07), transparent 72%);
}
[data-theme="dark"] body::before {
  background:
    radial-gradient(760px 380px at 12% -6%, rgba(201, 138, 99, .07), transparent 70%),
    radial-gradient(900px 420px at 82% 0%, rgba(142, 196, 171, .06), transparent 72%);
}

.wrap { width: min(1200px, 100% - 40px); margin-inline: auto; position: relative; z-index: 1; }
.narrow { width: min(780px, 100% - 40px); }

a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.028em; line-height: 1.14; }
p { margin: 0; }
button { font: inherit; color: inherit; }
svg { display: block; }
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute; 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: 12px; top: -70px; z-index: 60;
  background: var(--ink); color: var(--bg); padding: 10px 16px;
  border-radius: 8px; font-size: 13px; font-weight: 600;
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------------- header ---------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(120%) blur(14px);
  -webkit-backdrop-filter: saturate(120%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  height: 62px;
}
.brand { display: flex; align-items: baseline; gap: 9px; flex: none; }
.brand-mark { width: 22px; height: 22px; align-self: center; color: var(--accent); }
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.brand-tool {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.site-nav { display: flex; gap: 22px; margin-left: 12px; font-size: 13.5px; color: var(--muted); }
.site-nav a:hover { color: var(--ink); }
.header-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.lang-field {
  display: flex; align-items: center; gap: 4px;
  border: 1px solid var(--line-2); border-radius: 999px;
  padding: 0 6px 0 9px; height: 32px; color: var(--muted);
  background: var(--surface);
}
.lang-globe { width: 14px; height: 14px; }
.lang-field select {
  appearance: none; border: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: 12.5px; padding: 0 4px 0 2px; height: 30px;
  cursor: pointer; outline: none;
}
.lang-field:focus-within { border-color: var(--accent-line); }

.icon-btn {
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--surface); cursor: pointer; color: var(--ink-2);
}
.icon-btn:hover { border-color: var(--line-3); color: var(--ink); }
.icon-btn svg { width: 16px; height: 16px; }
.ico-sun { display: none; }
[data-theme="dark"] .ico-sun { display: block; }
[data-theme="dark"] .ico-moon { display: none; }

/* ---------------- buttons ---------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 9px; border: 1px solid transparent;
  padding: 10px 17px; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: background .14s ease, border-color .14s ease, color .14s ease, transform .1s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, black); }
.btn-quiet { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn-quiet:hover { border-color: var(--line-3); background: var(--surface-3); }
.btn-small { padding: 7px 13px; font-size: 13px; border-radius: 8px; }
.ico-sm { width: 14px; height: 14px; }
.link-btn {
  background: none; border: 0; padding: 0; color: var(--muted);
  font-size: 12.5px; text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.link-btn:hover { color: var(--ink); }

/* ---------------- hero ---------------- */

.hero { padding: 62px 0 26px; }
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 372px;
  gap: 56px;
  align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11.5px; font-weight: 500; letter-spacing: .13em; text-transform: uppercase;
  color: var(--muted);
}
.dot { width: 5px; height: 5px; border-radius: 50%; background: var(--seal); }
.hero h1 {
  margin: 18px 0 20px;
  font-size: clamp(30px, 3.9vw, 46px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -.035em;
  max-width: 17em;
}
.lede { font-size: 16.5px; color: var(--ink-2); max-width: 34em; line-height: 1.62; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.hero-facts {
  list-style: none; display: flex; flex-wrap: wrap; gap: 26px;
  margin: 34px 0 0; padding: 22px 0 0; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted);
}
.hero-facts b { display: block; color: var(--ink); font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.hero-facts span { font-size: 11.5px; letter-spacing: .04em; }

.hero-stamp { position: relative; }
.stamp-paper {
  position: relative;
  aspect-ratio: 210 / 236;
  background: #fffef9;
  color: #1b1c1e;
  border: 1px solid rgba(23, 24, 26, .12);
  border-radius: 4px;
  padding: 24px 24px 20px;
  box-shadow: 0 2px 3px rgba(23, 24, 26, .05), 0 30px 60px -36px rgba(23, 24, 26, .7);
  transform: rotate(-1.4deg);
  font-size: 11px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.stamp-paper::after {
  content: "";
  position: absolute; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(0deg, rgba(23, 24, 26, .022) 0 1px, transparent 1px 3px);
}
.stamp-line { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; font-variant-numeric: tabular-nums; font-size: 9.5px; }
.stamp-head { font-size: 13px; font-weight: 600; letter-spacing: .06em; padding-top: 0; }
.stamp-meta { font-size: 8.5px; color: #8c887e; margin: 1px 0 14px; letter-spacing: .01em; }
.stamp-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.stamp-parties div { display: grid; gap: 1px; }
.stamp-label { font-size: 7px; letter-spacing: .15em; text-transform: uppercase; color: #a8a397; font-weight: 600; }
.stamp-parties b { font-size: 9.5px; font-weight: 600; }
.stamp-parties div span:last-child { font-size: 8.5px; color: #8c887e; }
.stamp-thead { display: flex; justify-content: space-between; font-size: 7px; letter-spacing: .15em; text-transform: uppercase; color: #a8a397; font-weight: 600; padding-bottom: 4px; }
.stamp-rule { height: 1px; background: rgba(23, 24, 26, .16); margin: 6px 0; }
.stamp-total { font-size: 12px; font-weight: 600; padding: 4px 0 0; }
.stamp-pay { font-size: 8.5px; color: #8c887e; margin-top: 12px; }
.stamp-thanks { margin-top: auto; font-size: 8.5px; color: #8c887e; padding-right: 104px; }
.stamp-seal {
  position: absolute; right: 20px; bottom: 18px;
  font-size: 8px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--seal); border: 1px solid rgba(157, 84, 51, .5);
  border-radius: 2px; padding: 4px 7px; transform: rotate(-5deg); opacity: .85;
}

/* ---------------- sections ---------------- */

.section { padding: 58px 0; position: relative; z-index: 1; }
.section-head { max-width: 640px; }
.section-head h2 {
  margin: 14px 0 16px;
  font-size: clamp(23px, 2.5vw, 31px);
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.16;
}
.how .section-head h2 { margin-bottom: 0; }
.section-head .lede { font-size: 15.5px; }

/* ---------------- tool ---------------- */

.tool-section { padding-top: 34px; }
.tool-bar {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 18px;
  padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 22px;
  flex-wrap: wrap;
}
.tool-bar h2 { font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.tool-bar-title { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.save-state { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.save-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--good); transition: background .2s; }
.save-state.is-saving .save-dot { background: var(--warn); }
.save-state.is-error { color: var(--bad); }
.save-state.is-error .save-dot { background: var(--bad); }
.tool-bar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 604px;
  gap: 34px;
  align-items: start;
}
.editor { min-width: 0; display: grid; gap: 14px; }

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  min-width: 0;
  margin: 0;
  padding: 0;
}
.card-title {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px; font-weight: 600; letter-spacing: -.005em;
  background: var(--surface-2);
  border-radius: var(--radius) var(--radius) 0 0;
}
.card-num {
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  color: var(--faint); letter-spacing: .06em;
}
.card-body { padding: 16px 18px 18px; }

.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.fields-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.f-2 { grid-column: span 2; }
.lab { font-size: 11.5px; font-weight: 500; color: var(--muted); letter-spacing: .01em; }
.hint { font-size: 11.5px; color: var(--faint); line-height: 1.45; margin: 0; }

input[type="text"], input[type="email"], input[type="date"], textarea, select {
  width: 100%;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  min-height: 36px;
  transition: border-color .12s ease, background .12s ease;
}
[data-theme="dark"] input, [data-theme="dark"] textarea, [data-theme="dark"] select { background: var(--bg-2); }
textarea { resize: vertical; min-height: 54px; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--faint); opacity: .85; }
input:hover, textarea:hover, select:hover { border-color: var(--line-3); }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
select { appearance: none; background-image: none; cursor: pointer; padding-right: 26px; }
.f.select-wrap { position: relative; }

.check { display: flex; align-items: flex-start; gap: 9px; margin-top: 14px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.check input { margin: 3px 0 0; accent-color: var(--accent); width: 15px; height: 15px; }

/* logo */
.logo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.logo-preview {
  width: 96px; height: 54px; border: 1px dashed var(--line-2); border-radius: 8px;
  display: grid; place-items: center; color: var(--faint); font-size: 10.5px;
  background: var(--bg); overflow: hidden; flex: none;
}
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.logo-actions { display: flex; align-items: center; gap: 12px; }
.file-btn { position: relative; }
.file-btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-file { position: absolute; width: 1px; height: 1px; padding: 0; opacity: 0; pointer-events: none; }
.logo-row .hint { flex: 1 1 100%; }

/* items */
.items { display: grid; gap: 4px; }
.item-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 54px 80px 84px 62px;
  grid-template-areas:
    "h desc desc desc amount act"
    "h detail detail qty rate act";
  gap: 6px 8px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.item-row:last-child { border-bottom: 0; }
.item-row.is-dragging { opacity: .45; }
.item-row.is-target { box-shadow: inset 0 2px 0 var(--accent); }
.handle {
  grid-area: h; align-self: stretch; width: 18px;
  display: grid; place-items: center;
  color: var(--faint); cursor: grab; background: none; border: 0; padding: 0;
}
.handle:active { cursor: grabbing; }
.handle svg { width: 12px; height: 12px; }
.item-row input { min-height: 33px; padding: 6px 9px; }
.it-desc { grid-area: desc; font-weight: 500; }
.it-detail { grid-area: detail; font-size: 12.5px; color: var(--ink-2); }
.it-qty { grid-area: qty; text-align: right; font-variant-numeric: tabular-nums; }
.it-rate { grid-area: rate; text-align: right; font-variant-numeric: tabular-nums; }
.item-amount {
  grid-area: amount; text-align: right; font-size: 12.5px; font-variant-numeric: tabular-nums;
  color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.item-actions { grid-area: act; display: flex; gap: 1px; justify-content: flex-end; }
.icon-mini {
  width: 20px; height: 28px; display: grid; place-items: center;
  border: 1px solid transparent; border-radius: 5px; background: none; cursor: pointer;
  color: var(--faint); padding: 0;
}
.icon-mini:hover { color: var(--ink); border-color: var(--line-2); background: var(--bg); }
.icon-mini svg { width: 12px; height: 12px; }
.items-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; }

/* payment segments */
.seg {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 9px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.seg-item { position: relative; cursor: pointer; }
.seg-item input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.seg-item span {
  display: block; padding: 6px 12px; font-size: 12.5px; color: var(--muted);
  border-radius: 6px; transition: background .12s, color .12s;
}
.seg-item input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.07); font-weight: 500; }
.seg-item input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.pay-block { margin-bottom: 2px; }
.pay-block .fields { margin-bottom: 12px; }

/* ---------------- preview ---------------- */

.preview-col { position: sticky; top: 82px; min-width: 0; }
.preview-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-bottom: 10px;
}
.preview-title { font-size: 12px; font-weight: 500; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); }
.fit-state { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.fit-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--good); }
.fit-state.is-over { color: var(--warn); }
.fit-state.is-over .fit-dot { background: var(--warn); }

.paper-stage {
  position: relative;
  width: 100%;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  overflow: hidden;
  background-image: radial-gradient(var(--line-2) .7px, transparent .7px);
  background-size: 9px 9px;
}
.paper-stage .paper { transform-origin: top left; }
.paper-stage > .print-area { line-height: 0; }

.preview-note { font-size: 11.5px; color: var(--faint); margin-top: 9px; line-height: 1.5; }
.preview-print { margin-top: 12px; width: 100%; }

/* the A4 sheet */
.paper {
  --p-ink: #1a1a1c;
  --p-mute: #6f6d67;
  --p-faint: #9a978f;
  --p-line: #e4e0d6;
  --p-accent: #2f5d4f;
  width: 794px;
  min-height: 1123px;
  background: #ffffff;
  color: var(--p-ink);
  padding: 54px 52px 40px;
  font-size: 12px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 2px rgba(23, 24, 26, .1);
  font-variant-numeric: tabular-nums;
}
.paper * { box-sizing: border-box; }

.p-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 36px; }
.p-brand { min-width: 0; max-width: 52%; }
.p-logo { max-height: 46px; max-width: 210px; object-fit: contain; display: block; }
.p-wordmark { font-size: 15px; font-weight: 700; letter-spacing: -.02em; color: var(--p-ink); }
.p-brand-sub { font-size: 10.5px; color: var(--p-mute); margin-top: 3px; }

.p-doc { text-align: right; flex: none; }
.p-doc-title {
  font-size: 25px; font-weight: 600; letter-spacing: -.025em; line-height: 1.1;
  color: var(--p-ink); margin: 0 0 10px; text-transform: none;
}
.p-meta { display: grid; gap: 3px; font-size: 10.5px; color: var(--p-mute); }
.p-meta-row { display: flex; justify-content: flex-end; gap: 12px; }
.p-meta-row dt { color: var(--p-faint); }
.p-meta-row dd { margin: 0; color: var(--p-ink); min-width: 0; }

.p-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 40px; }
.p-label {
  font-size: 8.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--p-faint); margin-bottom: 7px;
}
.p-party-name { font-size: 12.5px; font-weight: 600; color: var(--p-ink); margin-bottom: 2px; }
.p-party-line { font-size: 10.8px; color: var(--p-mute); white-space: pre-line; line-height: 1.55; }
.p-party-line + .p-party-line { margin-top: 2px; }

.p-items { margin-top: 34px; flex: 1 0 auto; }
.p-table { width: 100%; border-collapse: collapse; }
.p-table thead th {
  font-size: 8.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--p-faint); text-align: left; padding: 0 0 8px;
  border-bottom: 1px solid var(--p-ink);
}
.p-table thead th.num { text-align: right; }
.p-table td { padding: 10px 0 9px; border-bottom: 1px solid var(--p-line); vertical-align: top; font-size: 12px; }
.p-table td.num { text-align: right; white-space: nowrap; }
.p-table td.qty { width: 62px; }
.p-table td.rate { width: 104px; }
.p-table td.amount { width: 108px; font-weight: 500; }
.p-item-name { font-weight: 500; color: var(--p-ink); }
.p-item-detail { font-size: 10px; color: var(--p-mute); margin-top: 2px; white-space: pre-line; }
.p-empty { padding: 16px 0; border-bottom: 1px solid var(--p-line); color: var(--p-faint); font-size: 11px; font-style: italic; }

.p-totals { margin-top: 18px; margin-left: auto; width: 268px; }
.p-total-row { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; font-size: 11.5px; color: var(--p-mute); }
.p-total-row dd { margin: 0; color: var(--p-ink); }
.p-total-row.discount dd { color: var(--p-accent); }
.p-total-final {
  margin-top: 8px; padding-top: 9px; border-top: 1px solid var(--p-ink);
  font-size: 14px; font-weight: 600; color: var(--p-ink);
}
.p-total-final dd { font-size: 15px; }

.p-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; margin-top: 34px; }
.p-bottom-single { grid-template-columns: 1fr; }
.p-notes { display: grid; gap: 16px; align-content: start; }
.p-block-title { font-size: 8.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--p-faint); margin-bottom: 7px; }
.p-block-line { font-size: 10.8px; color: var(--p-mute); line-height: 1.6; white-space: pre-line; }
.p-block-line b { font-weight: 500; color: var(--p-ink); }
.p-pay-row { display: flex; gap: 8px; font-size: 10.5px; }
.p-pay-row dt { color: var(--p-faint); min-width: 62px; }
.p-pay-row dd { margin: 0; color: var(--p-ink); }

.p-thanks { margin-top: 30px; font-size: 11px; color: var(--p-mute); }
.p-foot {
  margin-top: auto; padding-top: 16px; border-top: 1px solid var(--p-line);
  display: flex; justify-content: space-between; gap: 16px;
  font-size: 8.5px; color: var(--p-faint); letter-spacing: .02em;
}

/* ---------------- below sections ---------------- */

.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 30px; }
.feature {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 22px 22px 20px;
  box-shadow: var(--shadow);
}
.feature-mark { display: block; width: 30px; height: 30px; color: var(--accent); margin-bottom: 13px; }
.feature-mark svg { width: 26px; height: 26px; }
.feature h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.feature p { font-size: 13.5px; color: var(--muted); line-height: 1.62; }

.how { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg-2); }
.how-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 60px; align-items: start; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.steps li { display: flex; gap: 16px; }
.step-n {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--line-2); display: grid; place-items: center;
  font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 2px;
}
.steps h3 { font-size: 14.5px; font-weight: 600; margin-bottom: 3px; }
.steps p { font-size: 13.5px; color: var(--muted); line-height: 1.62; }

.faq { margin-top: 26px; border-top: 1px solid var(--line); }
.qa { border-bottom: 1px solid var(--line); }
.qa summary {
  cursor: pointer; list-style: none; padding: 16px 30px 16px 0; position: relative;
  font-size: 14.5px; font-weight: 500; letter-spacing: -.01em;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
  content: ""; position: absolute; right: 4px; top: 23px;
  width: 9px; height: 9px; border-right: 1.4px solid var(--muted); border-bottom: 1.4px solid var(--muted);
  transform: rotate(45deg); transition: transform .18s ease;
}
.qa[open] summary::after { transform: rotate(-135deg); top: 26px; }
.qa p { padding: 0 30px 18px 0; font-size: 13.5px; color: var(--muted); line-height: 1.68; }
.contact-line { margin-top: 22px; font-size: 13px; color: var(--muted); }
.contact-line a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

.privacy-strip { border-top: 1px solid var(--line); background: var(--bg-2); }
.privacy-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 26px 0; font-size: 13px; color: var(--muted); flex-wrap: wrap;
}
.privacy-inner strong { color: var(--ink); font-weight: 600; }
.privacy-inner a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }

/* ---------------- footer ---------------- */

.site-footer { border-top: 1px solid var(--line); padding: 34px 0 44px; position: relative; z-index: 1; }
.footer-inner {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 26px;
  font-size: 12.5px; color: var(--muted);
}
.footer-brand .brand-name { font-size: 15px; }
.footer-brand p { margin-top: 5px; max-width: 20em; }
.footer-links { display: grid; gap: 6px; align-content: start; }
.footer-links a:hover { color: var(--ink); }
.footer-fine { grid-column: 1 / -1; margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--faint); }

/* ---------------- toast ---------------- */

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 70; display: flex; align-items: center; gap: 14px;
  background: var(--ink); color: var(--bg); border-radius: 999px;
  padding: 10px 12px 10px 18px; font-size: 13px;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .5);
  max-width: calc(100% - 32px);
}
.toast-undo {
  background: none; border: 0; color: inherit; font-size: 12.5px; font-weight: 600;
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer; padding: 4px 8px;
}

/* ---------------- legal pages ---------------- */

.doc { padding: 54px 0 20px; }
.doc h1 { font-size: clamp(26px, 3vw, 34px); letter-spacing: -.03em; margin-bottom: 6px; }
.doc .updated { font-size: 12px; color: var(--faint); letter-spacing: .02em; }
.doc .lede-doc { font-size: 15.5px; color: var(--ink-2); margin-top: 16px; }
.doc h2 { font-size: 17px; font-weight: 600; margin: 34px 0 10px; letter-spacing: -.015em; }
.doc h3 { font-size: 14.5px; font-weight: 600; margin: 22px 0 7px; }
.doc p, .doc li { font-size: 14px; color: var(--ink-2); line-height: 1.72; }
.doc p + p { margin-top: 10px; }
.doc ul, .doc ol { margin: 10px 0 0; padding-left: 20px; }
.doc li + li { margin-top: 5px; }
.doc code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }
.doc a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.doc .note-box {
  border: 1px solid var(--line); border-left: 2px solid var(--accent);
  background: var(--surface); border-radius: 6px; padding: 14px 16px; margin-top: 18px;
  font-size: 13.5px; color: var(--muted);
}

/* ---------------- responsive ---------------- */

@media (max-width: 1180px) {
  .tool-grid { grid-template-columns: minmax(0, 1fr) 520px; gap: 26px; }
  .hero-inner { gap: 40px; grid-template-columns: minmax(0, 1fr) 340px; }
}

@media (max-width: 1020px) {
  .tool-grid { grid-template-columns: minmax(0, 1fr); }
  .preview-col { position: static; order: 2; max-width: 640px; }
  .hero-inner { grid-template-columns: minmax(0, 1fr); }
  .hero-stamp { display: none; }
  .how-grid { grid-template-columns: 1fr; gap: 26px; }
  .site-nav { display: none; }
}

@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .wrap, .narrow { width: min(100% - 28px, 1200px); }
  .hero { padding: 38px 0 12px; }
  .hero h1 { font-size: 30px; }
  .lede { font-size: 15px; }
  .hero-facts { gap: 18px; margin-top: 26px; padding-top: 18px; }
  .section { padding: 42px 0; }
  .tool-section { padding-top: 24px; }
  .tool-bar { align-items: flex-start; }
  .tool-bar-actions { width: 100%; }
  .tool-bar-actions .btn { flex: 1 1 auto; }
  .card-body { padding: 14px 14px 16px; }
  .card-title { padding: 12px 14px 11px; }
  .fields { grid-template-columns: minmax(0, 1fr); }
  .f-2 { grid-column: span 1; }
  .fields-3 { grid-template-columns: minmax(0, 1fr); }
  .item-row {
    grid-template-columns: 16px minmax(0, 1fr) minmax(0, 1fr) 72px;
    grid-template-areas:
      "h desc desc act"
      "h detail detail act"
      ". qty rate amount";
    gap: 6px 8px;
    padding: 11px 0;
  }
  .item-row .handle { width: 16px; }
  .item-amount { font-size: 12px; }
  .item-actions { flex-direction: column; gap: 0; }
  .icon-mini { width: 24px; height: 21px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .privacy-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
  .preview-col { max-width: 100%; }
  .paper-stage { padding: 8px; }
}

@media (max-width: 420px) {
  .brand-tool { display: none; }
  .hero-facts b { font-size: 14px; }
  .tool-bar h2 { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* ---------------- print ---------------- */

@media print {
  @page { size: A4; margin: 0; }
  html, body { background: #fff !important; }
  body::before { display: none !important; }
  .site-header, .site-nav, .hero, .tool-bar, .preview-head, .preview-note, .preview-print,
  .below, .section:not(.tool-section), .privacy-strip, .site-footer, .skip-link, .toast,
  .editor, .hero-stamp, .fit-state { display: none !important; }
  .wrap, .tool-section, .tool-grid { width: auto !important; max-width: none !important; margin: 0 !important; padding: 0 !important; display: block !important; }
  .tool-section { border: 0 !important; }
  .preview-col { position: static !important; max-width: none !important; margin: 0 !important; }
  .paper-stage {
    padding: 0 !important; border: 0 !important; border-radius: 0 !important;
    background: #fff !important; overflow: visible !important; height: auto !important;
  }
  .print-area { display: block !important; }
  .paper {
    transform: none !important;
    width: 210mm !important;
    min-height: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 15mm 16mm 12mm !important;
  }
  .p-table td, .p-table th, .p-totals, .p-parties { page-break-inside: avoid; }
  .p-foot { page-break-after: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
