:root {
  --bg: #f3efe7;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: #fffdf8;
  --ink: #1f1a17;
  --muted: #6f655d;
  --line: rgba(31, 26, 23, 0.1);
  --brand: #b75f3b;
  --brand-deep: #8e4324;
  --success: #234b38;
  --shadow: 0 24px 80px rgba(50, 36, 26, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Pretendard", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(183, 95, 59, 0.12), transparent 30%),
    radial-gradient(circle at top right, rgba(35, 75, 56, 0.12), transparent 22%),
    linear-gradient(180deg, #f8f4ee 0%, #f3efe7 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

.page-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 24px;
  margin-bottom: 24px;
}

.ad-section {
  margin-bottom: 24px;
}

.ad-slot-card {
  padding: 14px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
}

.hero-copy,
.hero-panel,
.panel {
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 40px;
  border-radius: var(--radius-xl);
}

.eyebrow,
.section-label {
  margin: 0 0 10px;
  color: var(--brand-deep);
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1,
.panel h2,
.print-header h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 0.98;
}

.hero h1 {
  font-size: clamp(2.7rem, 5vw, 5rem);
  letter-spacing: -0.04em;
}

.hero-text {
  max-width: 58ch;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.primary-action,
.secondary-action,
.ghost-action,
.toggle-button,
.remove-item {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 140ms ease, opacity 140ms ease, background 140ms ease;
}

.primary-action:hover,
.secondary-action:hover,
.ghost-action:hover,
.toggle-button:hover,
.remove-item:hover {
  transform: translateY(-1px);
}

.primary-action {
  padding: 14px 20px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
}

.secondary-action,
.ghost-action {
  padding: 14px 20px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(31, 26, 23, 0.08);
}

.hero-panel {
  display: grid;
  gap: 14px;
  padding: 24px;
  border-radius: var(--radius-xl);
}

.hero-stat {
  padding: 18px 18px 20px;
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 248, 0.84);
  border: 1px solid var(--line);
}

.hero-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.hero-stat strong {
  display: block;
  margin-top: 8px;
  font-size: 1.8rem;
  letter-spacing: -0.04em;
}

.app-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 24px;
  align-items: start;
}

.panel {
  padding: 28px;
  border-radius: var(--radius-xl);
}

.panel-heading,
.print-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 20px;
}

.panel-heading.compact {
  margin-top: 28px;
}

.chip,
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.84rem;
}

.chip {
  background: rgba(183, 95, 59, 0.12);
  color: var(--brand-deep);
}

.status-badge {
  color: var(--success);
  background: rgba(35, 75, 56, 0.12);
}

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

label {
  display: grid;
  gap: 8px;
}

label span {
  font-size: 0.92rem;
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
}

textarea {
  resize: vertical;
  min-height: 132px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(183, 95, 59, 0.18);
  border-color: rgba(183, 95, 59, 0.36);
}

.items-head,
.line-item {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) 0.6fr 0.8fr 56px;
  gap: 10px;
  align-items: center;
}

.items-head {
  padding: 0 4px 10px;
  color: var(--muted);
  font-size: 0.85rem;
}

.line-items {
  display: grid;
  gap: 10px;
}

.line-item {
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.72);
  border: 1px solid var(--line);
}

.remove-item {
  width: 42px;
  height: 42px;
  color: var(--brand-deep);
  background: rgba(183, 95, 59, 0.1);
}

.pricing-grid {
  align-items: stretch;
}

.toggle-card {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.toggle-button {
  width: 88px;
  padding: 10px 14px;
  color: var(--muted);
  background: rgba(31, 26, 23, 0.06);
}

.toggle-button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--success) 0%, #2f6e54 100%);
}

.partner-cta {
  margin-top: 28px;
  padding: 32px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.5);
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.94) 0%, rgba(250, 244, 236, 0.92) 100%),
    radial-gradient(circle at top right, rgba(183, 95, 59, 0.1), transparent 28%);
  box-shadow: var(--shadow);
}

.partner-cta-text {
  margin-top: 14px;
  max-width: 60ch;
}

.partner-cta-actions {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-top: 24px;
}

.partner-cta-note {
  max-width: 42ch;
  text-align: right;
}

.partner-form-wrap {
  margin-top: 24px;
  padding: 24px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
}

.partner-form-heading {
  margin-top: 0;
}

.partner-form {
  display: grid;
  gap: 18px;
  margin-top: 4px;
}

.field-span-2 {
  grid-column: 1 / -1;
}

.partner-form-actions {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.form-status {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.form-status.is-success {
  color: var(--success);
}

.form-status.is-error {
  color: #9f2f2f;
}

.summary-panel {
  position: sticky;
  top: 18px;
}

.summary-card,
.deposit-card,
.note-card,
.print-items-wrap {
  padding: 18px 18px 20px;
  border-radius: 22px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.summary-card-main {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.summary-company {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.summary-doc-meta {
  text-align: right;
}

.summary-doc-label {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.summary-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.summary-meta,
.deposit-card p,
.strongish {
  margin: 8px 0 0;
  color: var(--muted);
}

.print-items-wrap {
  margin-top: 18px;
}

.print-items-table {
  width: 100%;
  border-collapse: collapse;
}

.print-items-table th,
.print-items-table td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 0.94rem;
}

.print-items-table th:last-child,
.print-items-table td:last-child,
.print-items-table th:nth-child(2),
.print-items-table td:nth-child(2),
.print-items-table th:nth-child(3),
.print-items-table td:nth-child(3) {
  text-align: right;
}

.total-list {
  display: grid;
  gap: 14px;
  margin: 18px 0;
}

.total-list div,
.grand-total,
.print-grid-two {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.total-list span,
.grand-total span {
  color: var(--muted);
}

.grand-total {
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.grand-total strong,
.deposit-card strong {
  font-size: 2rem;
  letter-spacing: -0.04em;
}

.deposit-card {
  margin-top: 18px;
}

.print-meta-box {
  text-align: right;
}

.note-card {
  margin-top: 18px;
}

.note-card ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 920px) {
  .hero,
  .app-grid {
    grid-template-columns: 1fr;
  }

  .summary-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 1200px);
    padding-top: 16px;
  }

  .ad-slot-card {
    padding: 10px;
    border-radius: 18px;
  }

  .hero-copy,
  .panel,
  .hero-panel {
    padding: 20px;
  }

  .field-grid,
  .items-head,
  .line-item,
  .summary-card-main,
  .print-grid-two {
    grid-template-columns: 1fr;
    display: grid;
  }

  .partner-cta {
    padding: 22px;
  }

  .partner-cta-actions,
  .partner-form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .partner-cta-note {
    max-width: none;
    text-align: left;
  }

  .field-span-2 {
    grid-column: auto;
  }

  .hero-actions {
    flex-direction: column;
  }

  .items-head {
    display: none;
  }

  .summary-doc-meta,
  .print-meta-box {
    text-align: left;
  }
}

@page {
  size: A4;
  margin: 10mm;
}

@media print {
  html,
  body {
    width: 210mm;
    min-height: 297mm;
    background: #fff;
    font-size: 10.5pt;
    line-height: 1.28;
  }

  .page-shell {
    width: auto;
    margin: 0;
    padding: 0;
  }

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

  .app-grid {
    display: block;
  }

  .summary-panel.print-sheet {
    position: static;
    top: auto;
    padding: 0;
    border: 0;
    background: #fff;
    box-shadow: none;
    backdrop-filter: none;
    border-radius: 0;
  }

  .print-header,
  .summary-card,
  .deposit-card,
  .note-card,
  .print-items-wrap,
  .grand-total,
  .total-list,
  .print-grid-two {
    break-inside: avoid;
    background: #fff;
    margin-top: 0;
  }

  .print-header {
    margin-bottom: 10px;
    align-items: start;
  }

  .print-header h2 {
    font-size: 26pt;
    letter-spacing: -0.03em;
  }

  .section-label,
  .eyebrow {
    margin-bottom: 4px;
    font-size: 7.5pt;
    letter-spacing: 0.16em;
  }

  .summary-card,
  .deposit-card,
  .note-card,
  .print-items-wrap {
    padding: 10px 12px 11px;
    border-radius: 12px;
  }

  .summary-card + .summary-card,
  .print-items-wrap,
  .deposit-card,
  .note-card {
    margin-top: 10px;
  }

  .summary-company,
  .summary-doc-label,
  .summary-title {
    font-size: 12.5pt;
    line-height: 1.2;
    letter-spacing: -0.015em;
  }

  .summary-meta,
  .deposit-card p,
  .strongish,
  .total-list span,
  .grand-total span,
  .print-items-table th,
  .print-items-table td,
  .note-card ul {
    font-size: 9pt;
    line-height: 1.25;
  }

  .summary-meta,
  .deposit-card p,
  .strongish {
    margin-top: 4px;
  }

  .print-items-table th,
  .print-items-table td {
    padding: 7px 6px;
  }

  .print-items-table thead th {
    font-size: 8.5pt;
    letter-spacing: 0.02em;
  }

  .total-list {
    gap: 8px;
    margin: 10px 0;
  }

  .grand-total {
    padding: 10px 0;
  }

  .grand-total strong,
  .deposit-card strong {
    font-size: 18pt;
    letter-spacing: -0.03em;
  }

  .deposit-card {
    align-items: start;
  }

  .note-card ul {
    margin-top: 6px;
    padding-left: 16px;
  }

  .status-badge {
    min-height: 26px;
    padding: 0 10px;
    border: 1px solid #9eb8aa;
    font-size: 8pt;
  }
}
