:root {
  --ink: #13222e;
  --paper: #f9f6ef;
  --line: #c8c2b8;
  --tone: #f2efe5;
  --accent: #0d8f8b;
  --accent-strong: #046d6a;
  --highlight: #ed6a4f;
  --warning-bg: #ffe5c8;
  --warning-ink: #7e3b00;
  --error-bg: #f8d7da;
  --error-ink: #7f1d1d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans KR", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 20%, #f4d6a8 0%, rgba(244, 214, 168, 0) 40%),
    radial-gradient(circle at 90% 10%, #a7e1dd 0%, rgba(167, 225, 221, 0) 42%),
    linear-gradient(130deg, #f8f3ea, #f2f6f8);
}

.noise-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.3;
  background-image: repeating-radial-gradient(circle at 0 0, transparent 0, rgba(0, 0, 0, 0.03) 1px, transparent 2px);
}

.app-shell {
  width: min(1100px, calc(100vw - 2.2rem));
  margin: 1.2rem auto 2.5rem;
  position: relative;
  z-index: 1;
}

.hero {
  background: linear-gradient(145deg, rgba(19, 34, 46, 0.95), rgba(6, 77, 74, 0.88));
  color: #f8fcff;
  border-radius: 20px;
  padding: 1.8rem 1.6rem;
  box-shadow: 0 20px 40px rgba(6, 18, 24, 0.25);
}

.hero h1 {
  margin: 0.35rem 0;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  font-family: "Do Hyeon", sans-serif;
  letter-spacing: 0.03em;
}

.hero p {
  margin: 0;
  line-height: 1.5;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.78rem;
  opacity: 0.9;
}

.status-banner {
  margin-top: 0.9rem;
  border: 1px solid var(--line);
  background: var(--tone);
  border-radius: 14px;
  padding: 0.72rem 0.9rem;
  font-size: 0.95rem;
}

.status-banner.error {
  background: var(--error-bg);
  border-color: #e7b6bb;
  color: var(--error-ink);
}

.policy-note {
  margin-top: 0.9rem;
  border: 1px solid #b7d3d2;
  background: #eef8f7;
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  font-size: 0.9rem;
}

.policy-note a {
  color: #0b6a67;
  font-weight: 700;
}

.panel {
  background: rgba(249, 246, 239, 0.92);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 10px 20px rgba(35, 42, 44, 0.08);
}

.form-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.help-links {
  display: flex;
  gap: 0.6rem;
  font-size: 0.78rem;
}

.help-links a {
  color: #0d8f8b;
  text-decoration: none;
  font-weight: 600;
  opacity: 0.85;
}

.help-links a:hover {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.field span,
.toggle span {
  font-size: 0.9rem;
  font-weight: 600;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  border: 1px solid #b9c2c8;
  background: #ffffff;
  border-radius: 10px;
  padding: 0.62rem 0.7rem;
}

.toggle {
  grid-column: 1 / -1;
  display: inline-flex;
  gap: 0.6rem;
  align-items: center;
}

.actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 0.62rem 1.1rem;
  font-weight: 700;
  cursor: pointer;
}

button[type="submit"] {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
}

button[type="button"] {
  background: #fff;
  border: 1px solid #adb8bf;
  color: var(--ink);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.results {
  margin-top: 1rem;
}

.top-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 1rem;
}

.card.accent {
  background: linear-gradient(130deg, #0d8f8b, #056666);
  color: #fff;
  border-color: #055c5a;
}

.card h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.card strong {
  display: block;
  margin-top: 0.4rem;
  font-size: clamp(1.35rem, 2.8vw, 2rem);
  font-family: "Do Hyeon", sans-serif;
}

.warning-banner {
  margin-top: 0.8rem;
  border: 1px solid #f0bf7f;
  background: var(--warning-bg);
  color: var(--warning-ink);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
}

.table-grid {
  margin-top: 0.85rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.full {
  grid-column: 1 / -1;
}

h3 {
  margin: 0 0 0.65rem;
}

table {
  width: 100%;
  border-collapse: collapse;
}

td {
  border-top: 1px dashed #c9c3ba;
  padding: 0.56rem 0.2rem;
  font-size: 0.92rem;
}

td.amount {
  text-align: right;
  font-weight: 700;
}

.legal-notice {
  margin: 0.95rem 0 0;
  font-size: 0.84rem;
  color: #4a5861;
}

.site-footer {
  margin-top: 1rem;
  padding: 0.7rem 0.2rem 0;
  border-top: 1px dashed #b9c0c4;
}

.site-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.site-links a {
  color: #0d585f;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(13, 88, 95, 0.35);
}

.site-links a:hover {
  border-bottom-color: rgba(13, 88, 95, 0.9);
}

.pdf-sheet {
  background: #fff;
  color: #111;
  width: 794px;
  min-height: 1123px;
  padding: 32px;
  margin: 0 auto;
  font-family: "Noto Sans KR", sans-serif;
}

.pdf-sheet h1 {
  margin-top: 0;
  font-size: 28px;
}

.pdf-sheet h2 {
  margin: 20px 0 10px;
  font-size: 18px;
}

.pdf-sheet table {
  width: 100%;
  border-collapse: collapse;
}

.pdf-sheet td {
  border: 1px solid #ddd;
  padding: 8px 10px;
}

.pdf-sheet .legal {
  margin-top: 20px;
  padding: 10px;
  border: 1px solid #ddd;
  font-size: 13px;
}

@media (max-width: 860px) {
  .form-grid,
  .top-cards,
  .table-grid {
    grid-template-columns: 1fr;
  }

  .actions {
    justify-content: stretch;
  }

  .actions button {
    flex: 1;
  }
}

@media print {
  body > :not(.pdf-sheet) {
    display: none !important;
  }
}
