:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #f0f4ff;
  --text: #111827;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #10b981;
  --tax: #ef4444;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(17, 24, 39, 0.06);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* Header */
.site-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #ffffff;
  padding: 36px 0 32px;
  text-align: center;
}

.badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.16);
  color: #e0e7ff;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.site-header h1 {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.subtitle {
  font-size: 0.96rem;
  color: #dbeafe;
  max-width: 560px;
  margin: 0 auto;
}

/* Ad Slot */
.ad-slot {
  margin: 20px 0;
}

.ad-placeholder {
  background: #eef2f7;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 18px 12px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Calc Card */
.calc-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  border: 1px solid var(--border);
}

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: #f3f4f6;
  padding: 6px;
  border-radius: 12px;
  margin-bottom: 22px;
}

.tab-btn {
  border: none;
  background: transparent;
  padding: 12px 10px;
  border-radius: 9px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.input-group label {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap input {
  width: 100%;
  font-size: 1.5rem;
  font-weight: 800;
  padding: 14px 44px 14px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  outline: none;
  color: var(--text);
  transition: border-color 0.2s;
}

.input-wrap input:focus {
  border-color: var(--primary);
}

.input-wrap .unit {
  position: absolute;
  right: 16px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-muted);
}

.quick-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  border: 1px solid var(--border);
  background: #f9fafb;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.chip:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
}

.chip.reset {
  color: var(--text-muted);
  margin-left: auto;
}

/* Options */
.option-row {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.option-label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.radio-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 8px;
  background: #f9fafb;
  border: 1px solid var(--border);
}

/* Result Panel */
.result-panel {
  margin-top: 22px;
  background: var(--surface-soft);
  border-radius: 14px;
  padding: 20px;
  border: 1px solid #dbeafe;
}

.result-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.result-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e40af;
}

.result-value {
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary-dark);
  letter-spacing: -0.02em;
}

.ratio-bar {
  width: 100%;
  height: 10px;
  background: #fecaca;
  border-radius: 999px;
  overflow: hidden;
  margin: 14px 0 18px;
}

.ratio-net {
  height: 100%;
  background: var(--accent);
  transition: width 0.25s ease;
}

.breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.94rem;
}

.breakdown-item dt {
  color: var(--text-muted);
}

.breakdown-item dd {
  font-weight: 700;
}

.breakdown-item dd.tax {
  color: var(--tax);
}

.breakdown-item.total-tax {
  padding-top: 10px;
  border-top: 1px dashed #bfdbfe;
  font-size: 0.98rem;
}

.actions-row {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.copy-btn {
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.copy-btn:hover {
  background: var(--primary-dark);
}

.copy-feedback {
  font-size: 0.85rem;
  font-weight: 600;
  color: #059669;
}

/* Projection */
.projection-box {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.projection-box h3 {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.projection-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.proj-item {
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

.proj-item span {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.proj-item strong {
  font-size: 0.95rem;
  color: var(--text);
}

/* Guide Section */
.guide-section {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 26px 24px;
  margin-bottom: 28px;
}

.guide-section h2 {
  font-size: 1.3rem;
  margin-bottom: 12px;
}

.guide-section h3 {
  font-size: 1.05rem;
  margin: 22px 0 8px;
}

.guide-section p {
  font-size: 0.95rem;
  color: #374151;
}

.formula-box {
  background: #f8fafc;
  border-left: 4px solid var(--primary);
  padding: 14px 18px;
  border-radius: 8px;
  margin: 16px 0;
}

.formula-box h3 {
  margin-top: 0;
}

.formula-box ul {
  padding-left: 18px;
  font-size: 0.92rem;
  color: #374151;
}

.formula-box li + li {
  margin-top: 4px;
}

.faq-list details {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 10px;
}

.faq-list summary {
  font-weight: 700;
  cursor: pointer;
  font-size: 0.94rem;
}

.faq-list details p {
  margin-top: 8px;
  font-size: 0.9rem;
}

/* Footer */
.site-footer {
  padding: 20px 0 40px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

@media (max-width: 600px) {
  .site-header h1 {
    font-size: 1.4rem;
  }
  .calc-card {
    padding: 18px 16px;
  }
  .result-value {
    font-size: 1.65rem;
  }
  .projection-grid {
    grid-template-columns: 1fr;
  }
}
