/* 근로장려금 계산기 — 머스타드 금색 팔레트 */

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

:root {
  --brand:       #CA8A04;
  --brand-dark:  #854D0E;
  --brand-light: #FEF08A;
  --brand-alt:   #EAB308;
  --bg:          #FEFCE8;
  --surface:     #FFFFFF;
  --surface2:    #FAFAFA;
  --border:      #E5E7EB;
  --text:        #1A1A1A;
  --text-muted:  #6B7280;
  --radius:      16px;
  --radius-sm:   10px;
  --shadow:      0 4px 20px rgba(0,0,0,.08);
  --shadow-sm:   0 2px 8px rgba(0,0,0,.06);
  font-family: "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body { background: var(--bg); color: var(--text); min-height: 100dvh; overflow-x: hidden; font-size: 16px; line-height: 1.6; }
button { cursor: pointer; border: none; font-family: inherit; background: none; }
a { text-decoration: none; color: inherit; }
input, select, textarea { font-family: inherit; }

.layout-container {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}
@media (max-width: 800px) {
  .layout-container { grid-template-columns: 1fr; padding: 16px 12px 40px; }
  .app-sidebar { display: none; }
}
@media (max-width: 520px) {
  .hero-title { font-size: 22px !important; }
  .hero-desc { font-size: 13px !important; }
  .hero-amount { font-size: 26px !important; }
  .btn-grid-3 { grid-template-columns: 1fr !important; }
  .amount-value span:first-child { font-size: 24px !important; }
  .total-value span:first-child { font-size: 30px !important; }
}

.ad-container { display: block; width: 100%; text-align: center; }
.top-ad { background: #f9f9f9; padding: 8px 0; border-bottom: 1px solid var(--border); }
.middle-ad { margin: 16px 0; }
.bottom-ad { margin-top: 24px; padding: 16px 0; border-top: 1px solid var(--border); }

.main-header {
  background: linear-gradient(135deg, #854D0E 0%, #CA8A04 55%, #EAB308 100%);
  padding: 18px 16px 30px;
  position: relative; overflow: hidden;
}
.main-header::before { content:''; position:absolute; top:-40px; right:-40px; width:180px; height:180px; border-radius:50%; background: rgba(255,255,255,.08); }
.main-header::after { content:''; position:absolute; bottom:-30px; left:20px; width:110px; height:110px; border-radius:50%; background: rgba(255,255,255,.06); }

.header-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  position: relative; z-index: 1;
}
.header-logo { display: flex; align-items: center; gap: 12px; }
.header-logo-icon {
  font-size: 30px; background: rgba(255,255,255,.2); border-radius: 12px;
  width: 52px; height: 52px; display: flex; align-items: center; justify-content: center;
}
.header-logo h1 { font-size: 22px; font-weight: 800; color: #fff; letter-spacing: -.5px; }
.header-logo h1 a { color: #fff; }
.header-logo p { font-size: 12px; color: rgba(255,255,255,.85); margin-top: 2px; }

.btn-share {
  font-size: 13px; color: #fff;
  padding: 8px 14px; border-radius: 20px;
  background: rgba(255,255,255,.2); border: 1.5px solid rgba(255,255,255,.4);
  font-weight: 600; position: relative; z-index: 1;
}
.btn-share:hover { background: rgba(255,255,255,.3); }

.header-hero { max-width: 1100px; margin: 18px auto 0; position: relative; z-index: 1; }
.hero-title { font-size: 26px; font-weight: 900; color: #fff; letter-spacing: -.5px; }
.hero-amount { font-size: 32px; color: #FEF9C3; display: inline-block; }
.hero-desc { font-size: 15px; color: rgba(255,255,255,.9); margin-top: 6px; }

.app-card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; margin-bottom: 16px;
}
.card-header {
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px; background: #FEFCE8;
}
.card-header-icon { font-size: 18px; }
.card-header-title { font-size: 15px; font-weight: 700; }
.card-body { padding: 22px 20px; }

.screen { display: none; }
.screen.active { display: block; }

.form-section { margin-bottom: 22px; }
.form-label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 10px; color: #1F2937; }
.sub-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.form-input {
  width: 100%; padding: 14px 16px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 15px; background: var(--surface);
}
.form-input:focus { outline: none; border-color: var(--brand); }
.hint-text { font-size: 12px; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }

.btn-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.btn-grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }

.option-btn {
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 8px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); transition: all .15s; text-align: center;
}
.option-btn.small { padding: 12px 4px; font-weight: 700; font-size: 14px; }
.option-btn:hover { border-color: var(--brand-alt); background: #FEFCE8; }
.option-btn.selected {
  border-color: var(--brand); background: var(--brand-light);
  box-shadow: 0 2px 10px rgba(202,138,4,.2);
}
.opt-emoji { font-size: 24px; margin-bottom: 4px; }
.opt-label { font-size: 14px; font-weight: 700; color: #1F2937; }
.opt-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.btn-primary {
  display: block; width: 100%; padding: 16px;
  background: var(--brand); color: #fff;
  border-radius: var(--radius-sm); font-size: 16px; font-weight: 800;
  box-shadow: 0 4px 16px rgba(202,138,4,.3); transition: all .15s; margin-top: 8px;
}
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); transform: translateY(-1px); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }

.btn-outline {
  display: block; width: 100%; padding: 13px; text-align: center;
  border: 1.5px solid var(--brand); color: var(--brand-dark);
  border-radius: var(--radius-sm); font-size: 14px; font-weight: 700;
  background: var(--surface); margin-top: 10px;
}
.btn-outline:hover { background: var(--brand-light); }

.btn-share-result {
  display: block; width: 100%; padding: 14px; margin-bottom: 8px; margin-top: 16px;
  background: var(--brand); color: #fff;
  border-radius: var(--radius-sm); font-size: 15px; font-weight: 700;
}
.btn-restart {
  display: block; width: 100%; padding: 14px;
  border: 1.5px solid var(--brand); color: var(--brand-dark);
  border-radius: var(--radius-sm); font-size: 15px; font-weight: 700;
  background: var(--surface);
}

.result-summary {
  padding: 14px 16px; border-radius: 12px;
  background: var(--brand-light); color: var(--brand-dark);
  font-size: 14px; font-weight: 600; margin-bottom: 16px; line-height: 1.6;
}
.result-amount-box {
  background: #FAFAFA; border: 1px solid var(--border);
  padding: 16px 20px; border-radius: 12px; margin-bottom: 10px;
  display: flex; align-items: center; justify-content: space-between;
}
.result-amount-box.child { background: #FEFCE8; border-color: var(--brand-alt); }
.amount-label { font-size: 13px; font-weight: 700; color: #374151; }
.amount-value { font-size: 22px; font-weight: 900; color: var(--brand-dark); }
.amount-value .won { font-size: 14px; font-weight: 600; margin-left: 2px; }

.result-total-box {
  background: linear-gradient(135deg, #CA8A04 0%, #EAB308 100%);
  color: #fff; padding: 20px 22px; border-radius: 14px; margin: 14px 0 18px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 6px 20px rgba(202,138,4,.25);
}
.total-label { font-size: 14px; font-weight: 700; }
.total-value span:first-child { font-size: 32px; font-weight: 900; letter-spacing: -.5px; }
.won-big { font-size: 16px; font-weight: 700; margin-left: 3px; }

.result-detail {
  background: #FAFAFA; border-radius: 10px; padding: 14px 16px;
  font-size: 13px; color: #374151; line-height: 1.75; margin-bottom: 14px;
}
.result-detail strong { color: var(--brand-dark); }
.result-detail > div { margin-bottom: 6px; }

.apply-guide {
  background: #F8FAFC; border-left: 4px solid var(--brand); border-radius: 8px;
  padding: 16px 18px; margin-top: 14px;
}
.apply-guide h3 { font-size: 15px; font-weight: 800; margin-bottom: 10px; }
.apply-steps { list-style: none; counter-reset: step; }
.apply-steps li {
  position: relative; padding-left: 32px; margin-bottom: 8px;
  font-size: 14px; line-height: 1.6;
}
.apply-steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 2px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--brand); color: #fff;
  font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}

.notice-box {
  background: #FEF3C7; border: 1px solid #FCD34D; color: #92400E;
  padding: 12px 16px; border-radius: 8px;
  font-size: 13px; margin-top: 14px; line-height: 1.6;
}

.info-card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px;
}
.info-card h2 { font-size: 17px; font-weight: 800; margin-bottom: 14px; color: #1F2937; }

.guide-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .guide-grid { grid-template-columns: 1fr; } }
.guide-item {
  background: #FEFCE8; border-radius: 10px; padding: 14px;
  border-left: 3px solid var(--brand);
}
.guide-title { font-size: 13px; font-weight: 800; margin-bottom: 6px; color: var(--brand-dark); }
.guide-text { font-size: 13px; color: #374151; line-height: 1.6; }

.faq-item { border-bottom: 1px solid var(--border); padding: 12px 0; }
.faq-item:last-child { border-bottom: none; }
.faq-item summary {
  font-size: 14px; font-weight: 700; color: #1F2937;
  cursor: pointer; list-style: none; padding: 4px 0;
  position: relative; padding-right: 24px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+'; position: absolute; right: 4px; top: 4px;
  color: var(--brand); font-size: 18px; font-weight: 700;
  transition: transform .2s;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { font-size: 13px; color: #4B5563; line-height: 1.75; margin-top: 8px; padding-right: 20px; }

#random-examples { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 520px) { #random-examples { grid-template-columns: 1fr; } }
.example-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  background: #FAFAFA; border: 1px solid var(--border);
  transition: all .15s;
}
.example-link:hover { background: var(--brand-light); border-color: var(--brand-alt); }
.ex-icon { font-size: 16px; flex-shrink: 0; }
.ex-text { flex: 1; min-width: 0; }
.ex-title { display: block; font-size: 13px; font-weight: 700; color: #1F2937; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-sub { display: block; font-size: 11px; color: var(--text-muted); margin-top: 1px; }

.app-sidebar {
  position: sticky; top: 24px; max-height: calc(100vh - 48px);
  overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none;
}
.app-sidebar::-webkit-scrollbar { display: none; }
.sidebar-card { background: var(--surface); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.sidebar-card h3 { font-size: 14px; font-weight: 700; margin-bottom: 12px; padding-left: 8px; border-left: 3px solid var(--brand); color: var(--text); }
.sidebar-list { list-style: none; padding: 0; margin: 0; }
.sidebar-list li { margin-bottom: 6px; }
.sidebar-list a { display: flex; align-items: flex-start; text-decoration: none; color: var(--text); padding: 7px 8px; border-radius: 8px; transition: background .15s; }
.sidebar-list a:hover { background: var(--brand-light); }
.link-icon { margin-right: 8px; font-size: 15px; flex-shrink: 0; margin-top: 1px; }
.link-content { flex: 1; min-width: 0; }
.link-title { display: block; font-size: 13px; font-weight: 600; color: var(--brand-dark); margin-bottom: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-desc { display: block; font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main-footer {
  border-top: 1px solid var(--border); padding: 20px;
  text-align: center; font-size: 12px; color: var(--text-muted);
}

.share-toast {
  position: fixed; bottom: 80px; left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #1A1F36; color: #fff;
  padding: 12px 22px; border-radius: 99px;
  font-size: 14px; font-weight: 600; white-space: nowrap;
  opacity: 0; transition: opacity .2s, transform .2s;
  z-index: 9999; box-shadow: 0 4px 20px rgba(0,0,0,.25); pointer-events: none;
}
.share-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* === 업그레이드: 소득구간표 / 시나리오 / 관련링크 === */
.section-desc { font-size: 13px; color: var(--text-muted); margin: -4px 0 14px; line-height: 1.6; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 10px; border: 1px solid var(--border); }
.bracket-table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 13px; background: #fff; }
.bracket-table thead th { background: var(--brand-light); color: var(--brand-dark); font-weight: 800; padding: 10px 8px; text-align: center; border-bottom: 2px solid var(--brand); font-size: 12px; line-height: 1.4; }
.bracket-table tbody td { padding: 12px 10px; text-align: center; border-bottom: 1px solid var(--border); color: #374151; }
.bracket-table tbody tr:last-child td { border-bottom: none; }
.bracket-table tbody tr:nth-child(even) { background: #FEFCE8; }
.bracket-table td.amt { font-weight: 800; color: var(--brand-dark); font-size: 14px; }
.bracket-table .muted { font-size: 11px; color: var(--text-muted); font-weight: 400; }
.bracket-note { margin-top: 12px; padding: 12px 14px; background: #FEF9C3; border-left: 4px solid var(--brand); border-radius: 8px; font-size: 12.5px; color: #713F12; line-height: 1.7; }

.scenario-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.scenario-item { background: #FEFCE8; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.scenario-q { font-size: 13px; color: var(--brand-dark); margin-bottom: 6px; line-height: 1.5; }
.scenario-a { font-size: 12.5px; color: #374151; line-height: 1.65; }
@media (max-width: 520px) {
  .scenario-grid { grid-template-columns: 1fr; }
}

.related-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.related-link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #fff; border: 1px solid var(--border); border-radius: 10px; text-decoration: none; transition: all .15s; }
.related-link:hover { background: var(--brand-light); border-color: var(--brand); transform: translateY(-1px); }
.rel-emoji { font-size: 24px; flex-shrink: 0; }
.rel-body { flex: 1; min-width: 0; }
.rel-title { font-size: 13px; font-weight: 700; color: #1F2937; margin-bottom: 2px; }
.rel-desc { font-size: 11.5px; color: var(--text-muted); line-height: 1.5; }
@media (max-width: 520px) {
  .related-grid { grid-template-columns: 1fr; }
}
