:root {
  --color-primary: #3182F6;
  --color-primary-hover: #1B64DA;
  --color-background: #F2F4F6;
  --color-surface: #FFFFFF;
  --color-text-title: #191F28;
  --color-text-body: #4E5968;
  --color-text-caption: #8B95A1;
  --color-border: #E5E8EB;
  --color-input-bg: #F9FAFB;
  --color-error: #F04452;
  --color-highlight: #E8F3FF;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-up: 0 -4px 16px rgba(0, 0, 0, 0.05);
  
  --font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: var(--font-family);
  background-color: var(--color-background);
  color: var(--color-text-title);
  line-height: 1.5;
  font-size: 16px;
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

.app-container {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background-color: var(--color-background);
  display: flex;
  flex-direction: column;
  position: relative;
}

.app-header {
  padding: 32px 24px 16px;
  background-color: var(--color-background);
  transition: all 0.3s ease;
}

.app-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text-title);
  margin-bottom: 4px;
}

.app-header p {
  font-size: 14px;
  color: var(--color-text-caption);
}

.calculator-card {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 24px;
  flex: 1;
  box-shadow: var(--shadow-md);
  margin-top: 8px;
}

.calc-section {
  display: none;
  animation: fadeIn 0.3s ease;
}

.calc-section.active {
  display: block;
}

/* Form Styles */
.input-group { margin-bottom: 24px; }
.input-group label {
  display: block; font-size: 14px; font-weight: 600; color: var(--color-text-body); margin-bottom: 8px;
}

.input-wrapper { position: relative; display: flex; align-items: center; }
.input-wrapper input {
  width: 100%; padding: 16px 48px 16px 16px; font-size: 18px; font-weight: 600;
  color: var(--color-text-title); background-color: var(--color-input-bg);
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  outline: none; transition: all 0.2s ease; font-family: var(--font-family);
}
.input-wrapper input:focus {
  border-color: var(--color-primary); background-color: var(--color-surface); box-shadow: 0 0 0 4px var(--color-highlight);
}
.input-wrapper input::placeholder { color: var(--color-border); font-weight: 400; }
.input-wrapper .currency { position: absolute; right: 16px; color: var(--color-text-caption); font-weight: 500; }

.quick-add {
  display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none;
}
.quick-add::-webkit-scrollbar { display: none; }
.quick-add button {
  white-space: nowrap; padding: 8px 12px; font-size: 13px; font-weight: 500; color: var(--color-text-body);
  background-color: var(--color-background); border: none; border-radius: var(--radius-sm); cursor: pointer;
}
.quick-add button:active { background-color: var(--color-border); }
.quick-add .btn-clear { margin-left: auto; color: var(--color-text-caption); background-color: transparent; border: 1px solid var(--color-border); }

.radio-group { display: flex; background-color: var(--color-input-bg); border-radius: var(--radius-md); padding: 4px; gap: 4px; }
.radio-group input[type='radio'] { display: none; }
.radio-group label {
  flex: 1; text-align: center; padding: 12px 0; font-size: 14px; font-weight: 600; color: var(--color-text-caption);
  border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s;
}
.radio-group input[type='radio']:checked + label {
  background-color: var(--color-surface); color: var(--color-primary); box-shadow: var(--shadow-sm);
}

.help-text { font-size: 13px; color: var(--color-text-caption); margin-top: 8px; }

/* Result Area */
.result-area {
  margin-top: 32px; padding-top: 32px; border-top: 1px dashed var(--color-border); animation: fadeIn 0.4s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.result-area h2 { font-size: 18px; margin-bottom: 16px; color: var(--color-text-title); }
.result-box { border-radius: var(--radius-md); padding: 20px; margin-bottom: 12px; }
.result-box.primary {
  background-color: var(--color-primary); color: white; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; box-shadow: var(--shadow-sm);
}
.result-box.primary .result-label { font-size: 14px; opacity: 0.9; margin-bottom: 8px; }
.result-box.primary .result-value { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; }
.result-box.primary .unit { font-size: 18px; font-weight: 500; }

.result-box.secondary { background-color: var(--color-input-bg); border: 1px solid var(--color-border); }
.result-box.secondary .row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; }
.result-box.secondary .row:not(:last-child) { border-bottom: 1px solid var(--color-border); }
.result-box.secondary .result-label { font-size: 14px; color: var(--color-text-body); }
.result-box.secondary .result-value { font-size: 15px; font-weight: 600; color: var(--color-text-title); }

.notice { font-size: 12px; color: var(--color-text-caption); margin-top: 16px; text-align: center; }

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background-color: var(--color-surface);
  display: flex; justify-content: space-around;
  padding: 12px 8px;
  box-shadow: var(--shadow-up);
  border-top: 1px solid var(--color-border);
  z-index: 100;
}

.nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-decoration: none; color: var(--color-text-caption);
  flex: 1; transition: all 0.2s;
}

.nav-item .nav-icon { font-size: 24px; margin-bottom: 4px; filter: grayscale(100%); opacity: 0.6; transition: all 0.2s; }
.nav-item .nav-text { font-size: 11px; font-weight: 600; }

.nav-item.active { color: var(--color-primary); }
.nav-item.active .nav-icon { filter: grayscale(0%); opacity: 1; transform: translateY(-2px); }

.app-footer { padding: 24px; text-align: center; background-color: var(--color-surface); color: var(--color-text-caption); font-size: 12px; }

/* Pay Stub Styles */
.pay-stub {
  background-color: var(--color-input-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
  font-family: var(--font-family);
}

.stub-section {
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.stub-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.stub-section h3 {
  font-size: 13px;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.pay-stub .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

.pay-stub .row.sub {
  padding-left: 12px;
  color: var(--color-text-caption);
}

.pay-stub .label {
  font-size: 14px;
  color: var(--color-text-body);
}

.pay-stub .value {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-title);
}

.pay-stub .row.total {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px dashed var(--color-border);
}

.pay-stub .row.total .label {
  font-weight: 700;
  color: var(--color-text-title);
}

.pay-stub .row.total .value {
  color: var(--color-error);
}

.pay-stub .net-pay {
  background-color: var(--color-highlight);
  margin: 0 -20px -20px -20px;
  padding: 20px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  border-top: 1px solid var(--color-primary);
}

.pay-stub .net-pay .label {
  font-weight: 700;
  color: var(--color-primary);
}

.pay-stub .net-pay .value {
  font-size: 20px;
  font-weight: 800;
  color: var(--color-primary);
}

/* Blog Styles */
.blog-container { display: flex; flex-direction: column; gap: 24px; }
.blog-post { padding-bottom: 24px; border-bottom: 1px solid var(--color-border); }
.blog-title { font-size: 18px; font-weight: 700; color: var(--color-text-title); margin-bottom: 12px; }
.blog-content { font-size: 14px; color: var(--color-text-body); line-height: 1.7; margin-bottom: 16px; }
.history-table { background: var(--color-input-bg); border-radius: var(--radius-sm); overflow: hidden; }
.history-table .row { display: flex; border-bottom: 1px solid var(--color-border); }
.history-table .row.header { background: var(--color-border); font-weight: 700; }
.history-table .row span { flex: 1; padding: 8px 12px; font-size: 12px; text-align: center; }

/* Policy Styles */
.policy-container h2 { font-size: 20px; font-weight: 700; margin-bottom: 16px; }
.policy-container h3 { font-size: 16px; font-weight: 600; margin-top: 20px; margin-bottom: 8px; }