:root {
  --navy: #1e293b;
  --navy-deep: #0f172a;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --bg-page: #f8fafc;
  --bg-subtle: #f1f5f9;
  --bg-paper: #ffffff;
  --emerald: #047857;
  --emerald-hover: #065f46;
  --emerald-tint: #ecfdf5;
  --emerald-border: #a7f3d0;
  --danger: #b91c1c;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-paper: 0 10px 28px rgba(15, 23, 42, 0.1), 0 1px 3px rgba(15, 23, 42, 0.08);
  --font-sans: 'Inter', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--navy);
  background: var(--bg-page);
  overflow-x: clip;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--navy);
}

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

/* Header */
.site-header {
  background: var(--bg-paper);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-inner {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--navy-deep);
  flex-shrink: 0;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--navy);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}

.brand-name {
  font-size: 15px;
  letter-spacing: -0.01em;
}

.header-sep {
  color: var(--slate-400);
}

.header-tool-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--slate-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--emerald-tint);
  border: 1px solid var(--emerald-border);
  color: var(--emerald);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-paper);
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.lang-switch:hover {
  background: var(--bg-subtle);
  border-color: var(--navy);
}

/* Hero & Tabs */
.hero-bar {
  background: var(--bg-paper);
  border-bottom: 1px solid var(--border);
  padding: 24px 0 20px;
}

.hero-copy {
  margin-bottom: 18px;
}

.hero-copy h1 {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--navy-deep);
  line-height: 1.25;
}

.hero-sub {
  margin: 0;
  color: var(--slate-600);
  font-size: 14.5px;
  max-width: 780px;
}

.tab-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.tab-btn {
  text-align: left;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-page);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.tab-btn:hover {
  border-color: var(--border-strong);
  background: var(--bg-paper);
}

.tab-btn.is-active {
  background: var(--bg-paper);
  border-color: var(--emerald);
  box-shadow: 0 0 0 1px var(--emerald);
}

.tab-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--navy-deep);
}

.tab-btn.is-active .tab-title {
  color: var(--emerald);
}

.tab-desc {
  font-size: 12.5px;
  color: var(--slate-500);
  line-height: 1.4;
}

/* Workspace Split */
.workspace-section {
  padding: 24px 0 16px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(440px, 1fr) minmax(460px, 1.08fr);
  gap: 24px;
  align-items: start;
}

/* Form Panel */
.form-panel {
  min-width: 0;
}

.form-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: var(--bg-paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.draft-status {
  font-size: 12.5px;
  color: var(--slate-500);
  font-weight: 500;
}

.form-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.tab-panel.is-active {
  display: flex;
}

.form-group-card {
  margin: 0;
  padding: 16px;
  background: var(--bg-paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-group-card legend {
  float: left;
  width: 100%;
  padding: 0 0 8px;
  margin: 0 0 2px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--navy-deep);
  border-bottom: 1px solid var(--bg-subtle);
  letter-spacing: -0.01em;
}

.form-row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.field > span,
.sig-label-row > span,
.logo-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--slate-700);
}

.field input[type='text'],
.field input[type='number'],
.field input[type='date'],
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-paper);
  color: var(--navy-deep);
  line-height: 1.4;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field textarea {
  resize: vertical;
  min-height: 64px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.12);
}

.input-addon-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  gap: 6px;
}

/* Logo Upload */
.logo-upload-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  background: var(--bg-page);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
}

.logo-thumb-box {
  width: 68px;
  height: 48px;
  border-radius: 6px;
  background: var(--bg-paper);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.logo-thumb-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.logo-empty-text {
  font-size: 11px;
  font-weight: 700;
  color: var(--slate-400);
  letter-spacing: 0.06em;
}

.logo-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.logo-btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.file-btn {
  cursor: pointer;
}

/* Dynamic Line Items Editor */
.items-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px 110px 92px 34px;
  gap: 8px;
  align-items: end;
  padding: 10px;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.item-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.item-cell label {
  font-size: 11px;
  font-weight: 600;
  color: var(--slate-500);
}

.item-cell input {
  width: 100%;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--bg-paper);
  font-size: 13px;
}

.item-cell input:focus {
  outline: none;
  border-color: var(--emerald);
  box-shadow: 0 0 0 2px rgba(4, 120, 87, 0.12);
}

.item-amount-val {
  height: 33px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-remove-row {
  width: 34px;
  height: 33px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--bg-paper);
  color: var(--slate-500);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
}

.btn-remove-row:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: #fef2f2;
}

.btn-add-row {
  align-self: flex-start;
}

.calc-row {
  padding-top: 6px;
  border-top: 1px solid var(--bg-subtle);
}

/* Signature Pad */
.sig-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sig-pad-wrap {
  position: relative;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-paper);
  overflow: hidden;
}

.sig-canvas {
  display: block;
  width: 100%;
  height: 120px;
  cursor: crosshair;
  touch-action: none;
}

.sig-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-size: 12.5px;
  color: var(--slate-400);
}

.sig-placeholder.is-hidden {
  display: none;
}

/* Buttons */
.btn-primary,
.btn-outline,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 13px;
}

.btn-primary {
  background: var(--emerald);
  border: 1px solid var(--emerald);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--emerald-hover);
  border-color: var(--emerald-hover);
}

.btn-primary:disabled {
  opacity: 0.65;
  cursor: wait;
}

.btn-outline {
  background: var(--bg-paper);
  border: 1px solid var(--border-strong);
  color: var(--navy);
}

.btn-outline:hover {
  background: var(--bg-subtle);
  border-color: var(--navy);
}

.btn-ghost {
  background: transparent;
  border: 1px solid transparent;
  color: var(--slate-600);
}

.btn-ghost:hover {
  background: var(--bg-subtle);
  color: var(--navy-deep);
}

.btn-danger-text {
  color: var(--danger);
}

.btn-danger-text:hover {
  background: #fef2f2;
  color: var(--danger);
}

.btn-link-sm {
  background: none;
  border: none;
  padding: 2px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--slate-500);
  cursor: pointer;
}

.btn-link-sm:hover {
  color: var(--danger);
  text-decoration: underline;
}

/* Preview Panel */
.preview-panel {
  position: sticky;
  top: 72px;
  min-width: 0;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--navy);
  color: #ffffff;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.preview-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.preview-label {
  font-size: 13px;
  font-weight: 600;
  color: #f8fafc;
}

.paper-toggle {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 2px;
}

.paper-btn {
  border: none;
  background: transparent;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 4px;
  cursor: pointer;
}

.paper-btn.is-active {
  background: #ffffff;
  color: var(--navy-deep);
}

.preview-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-toolbar .btn-outline {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.preview-toolbar .btn-outline:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.45);
}

.paper-viewport {
  background: #e2e8f0;
  padding: 20px;
  border: 1px solid var(--border-strong);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.paper-scale-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
}

/* Actual Printable Paper Sheet (Unscaled A4 = 794x1123px, Letter = 816x1056px) */
.paper-sheet {
  position: relative;
  background: #ffffff;
  color: #0f172a;
  box-shadow: var(--shadow-paper);
  transform-origin: top left;
  padding: 48px 52px;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  line-height: 1.5;
}

.paper-sheet.paper-a4 {
  width: 794px;
  min-height: 1123px;
}

.paper-sheet.paper-letter {
  width: 816px;
  min-height: 1056px;
}

/* Document Typography & Layout inside Paper Sheet */
.doc-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding-bottom: 20px;
  border-bottom: 2px solid #1e293b;
  margin-bottom: 24px;
}

.doc-brand-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 58%;
}

.doc-logo-img {
  max-width: 180px;
  max-height: 64px;
  object-fit: contain;
  margin-bottom: 6px;
}

.doc-title {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #0f172a;
  line-height: 1.2;
}

.doc-subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.doc-company-name {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.doc-meta-text {
  font-size: 12.5px;
  color: #475569;
  line-height: 1.5;
  white-space: pre-line;
}

.doc-meta-box {
  text-align: right;
  min-width: 210px;
}

.doc-meta-table {
  margin-left: auto;
  border-collapse: collapse;
  font-size: 12.5px;
}

.doc-meta-table td {
  padding: 3px 0;
}

.doc-meta-table td:first-child {
  color: #64748b;
  padding-right: 14px;
  font-weight: 500;
}

.doc-meta-table td:last-child {
  color: #0f172a;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.doc-paid-stamp {
  position: absolute;
  top: 138px;
  right: 54px;
  border: 3px solid #047857;
  color: #047857;
  padding: 6px 18px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.14em;
  border-radius: 6px;
  transform: rotate(-10deg);
  opacity: 0.88;
  background: rgba(236, 253, 245, 0.85);
  pointer-events: none;
}

.doc-parties-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.doc-party-card {
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.doc-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 6px;
}

.doc-party-name {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.doc-amount-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-left: 5px solid #047857;
  border-radius: 6px;
  margin-bottom: 24px;
}

.doc-amount-label {
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.doc-amount-value {
  font-size: 28px;
  font-weight: 700;
  color: #047857;
  font-variant-numeric: tabular-nums;
}

.doc-detail-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 13.5px;
}

.doc-detail-table th,
.doc-detail-table td {
  padding: 11px 14px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

.doc-detail-table th {
  width: 34%;
  color: #475569;
  font-weight: 600;
  background: #f8fafc;
}

.doc-detail-table td {
  color: #0f172a;
  font-weight: 500;
}

/* Line Items Table on Paper */
.doc-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 13px;
}

.doc-items-table thead th {
  background: #1e293b;
  color: #ffffff;
  font-weight: 600;
  padding: 10px 12px;
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.doc-items-table thead th.num,
.doc-items-table tbody td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.doc-items-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  color: #1e293b;
  vertical-align: top;
}

.doc-items-table tbody tr:nth-child(even) td {
  background: #f8fafc;
}

.doc-totals-wrap {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 24px;
}

.doc-totals-table {
  width: 280px;
  border-collapse: collapse;
  font-size: 13.5px;
}

.doc-totals-table td {
  padding: 6px 8px;
}

.doc-totals-table td:first-child {
  color: #475569;
  font-weight: 500;
}

.doc-totals-table td:last-child {
  text-align: right;
  font-weight: 600;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.doc-totals-table tr.grand-total td {
  padding-top: 10px;
  padding-bottom: 10px;
  border-top: 2px solid #1e293b;
  border-bottom: 2px solid #1e293b;
  font-size: 16px;
  font-weight: 700;
  color: #047857;
}

.doc-notes-box {
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  margin-bottom: 24px;
}

.doc-notes-box p {
  margin: 0;
  font-size: 12.5px;
  color: #334155;
  white-space: pre-line;
  line-height: 1.55;
}

.doc-sig-section {
  margin-top: auto;
  padding-top: 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 36px;
}

.doc-sig-section.single-sig {
  grid-template-columns: minmax(0, 280px);
  justify-content: end;
}

.doc-sig-box {
  display: flex;
  flex-direction: column;
}

.doc-sig-img-wrap {
  height: 76px;
  border-bottom: 1px solid #64748b;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.doc-sig-img {
  max-width: 220px;
  max-height: 68px;
  object-fit: contain;
}

.doc-sig-caption {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  text-align: center;
}

/* AdSense Container */
.ad-wrap {
  margin-top: 24px;
  margin-bottom: 12px;
  min-height: 90px;
  max-width: 100%;
  overflow: hidden;
}
.ad-wrap ins.adsbygoogle,
.ad-wrap iframe {
  max-width: 100% !important;
}
html, body {
  overflow-x: clip;
}

/* Content Sections (Guide & FAQ) */
.content-section {
  padding: 36px 0;
}

.section-head {
  margin-bottom: 22px;
}

.section-head h2 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  color: var(--navy-deep);
  letter-spacing: -0.015em;
}

.section-head p {
  margin: 0;
  color: var(--slate-600);
  font-size: 14.5px;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.guide-card {
  background: var(--bg-paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-card);
}

.guide-badge {
  align-self: flex-start;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--navy);
  font-size: 11.5px;
  font-weight: 700;
}

.guide-card h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--navy-deep);
  line-height: 1.35;
}

.guide-tips {
  margin: 0;
  padding-left: 18px;
  color: var(--slate-700);
  font-size: 13.5px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.checklist-box {
  margin-top: auto;
  padding: 13px 14px;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.checklist-box h4 {
  margin: 0 0 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--emerald);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.checklist-items {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--slate-700);
}

.checklist-items li {
  position: relative;
  padding-left: 18px;
}

.checklist-items li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--emerald);
  font-weight: 700;
}

/* FAQ */
.faq-section {
  background: var(--bg-paper);
  border-top: 1px solid var(--border);
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 860px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-page);
  padding: 14px 18px;
}

.faq-item[open] {
  background: var(--bg-paper);
  border-color: var(--border-strong);
}

.faq-item summary {
  font-size: 15px;
  font-weight: 600;
  color: var(--navy-deep);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '+';
  font-size: 18px;
  font-weight: 500;
  color: var(--slate-500);
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: '−';
  color: var(--emerald);
}

.faq-item p {
  margin: 10px 0 0;
  color: var(--slate-600);
  font-size: 14px;
  line-height: 1.6;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-page);
  padding: 24px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-copy {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
}

.footer-note {
  margin: 0;
  font-size: 12.5px;
  color: var(--slate-500);
}

/* Responsive Breakpoints */
@media (max-width: 1040px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    position: static;
  }

  .guide-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .container {
    padding: 0 14px;
  }

  .header-sep,
  .header-tool-name,
  .privacy-pill {
    display: none;
  }

  .hero-bar {
    padding: 18px 0 16px;
  }

  .hero-copy h1 {
    font-size: 21px;
  }

  .hero-sub {
    font-size: 13.5px;
  }

  .tab-bar {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .tab-btn {
    padding: 11px 13px;
  }

  .tab-desc {
    display: none;
  }

  .form-row-2,
  .form-row-3 {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .form-group-card {
    padding: 14px;
  }

  .item-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .item-row .item-cell-desc {
    grid-column: 1 / -1;
  }

  .item-row .item-cell-amount {
    grid-column: 1 / 2;
  }

  .item-row .item-cell-action {
    grid-column: 2 / 3;
    justify-self: end;
  }

  .preview-toolbar {
    padding: 10px 12px;
  }

  .preview-toolbar-left,
  .preview-toolbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .paper-viewport {
    padding: 10px;
  }
}

/* Dedicated Print Stylesheet */
@media print {
  @page {
    margin: 0;
  }

  body {
    background: #ffffff !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .no-print {
    display: none !important;
  }

  .workspace-section,
  .container,
  .workspace-grid,
  .preview-panel,
  .paper-viewport,
  .paper-scale-frame {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: #ffffff !important;
    overflow: visible !important;
    position: static !important;
  }

  .paper-sheet {
    transform: none !important;
    box-shadow: none !important;
    width: 100% !important;
    min-height: auto !important;
    padding: 14mm 16mm !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}
