/* ── Reset & Variables ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand: #00B884;
  --brand-dark: #009E72;
  --brand-light: #E6F9F4;
  --bg: #F4FBF8;
  --surface: #FFFFFF;
  --surface2: #F0FAF6;
  --border: #D6EFE8;
  --text: #1A1A1A;
  --text-muted: #888;
  --tax: #5B5BD6;
  --insurance: #E63946;
  --utility: #F59E0B;
  --welfare: #22C55E;
  --finance: #00B884;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 20px rgba(0,184,132,.10);
  --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; }
a { text-decoration: none; color: inherit; }

/* ── Layout ────────────────────────────────────────────── */
.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; }
  .app-sidebar { display: none; }
}

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

/* ── Header ────────────────────────────────────────────── */
.main-header {
  background: var(--brand);
  padding: 20px 20px 24px;
  position: relative;
  overflow: hidden;
}
.main-header::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
}
.main-header::after {
  content: '';
  position: absolute;
  bottom: -20px; left: 10px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
}
.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: 28px; background: rgba(255,255,255,.2); border-radius: 12px; width: 48px; height: 48px; 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: 13px; color: rgba(255,255,255,.8); margin-top: 2px; }
.header-hero { max-width: 1100px; margin: 16px auto 0; padding: 14px 16px; background: rgba(0,0,0,.15); border-radius: 14px; position: relative; z-index: 1; }
.hero-num { font-size: 28px; font-weight: 900; color: #fff; letter-spacing: -1px; line-height: 1; }
.hero-desc { font-size: 13px; color: rgba(255,255,255,.85); margin-top: 4px; font-weight: 600; }
.btn-share { background: rgba(255,255,255,.2); border: 1.5px solid rgba(255,255,255,.4); color: #fff; border-radius: 20px; padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s; }
.btn-share:hover { background: rgba(255,255,255,.3); }

/* ── App Card ──────────────────────────────────────────── */
.app-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }

/* ── Home Screen ───────────────────────────────────────── */
.home-inner { padding: 24px 20px 28px; display: flex; flex-direction: column; gap: 16px; }

.section-label { font-size: 15px; font-weight: 700; color: var(--text); }
.multi-hint { font-size: 12px; font-weight: 500; color: var(--text-muted); }

.situation-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.sit-btn {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 14px 14px 12px; border-radius: var(--radius); border: 2px solid var(--border);
  background: var(--surface); transition: all .15s; position: relative; text-align: left;
  box-shadow: var(--shadow-sm);
}
.sit-btn.active {
  background: var(--brand); border-color: var(--brand);
  box-shadow: 0 2px 12px rgba(0,184,132,.25);
}
.sit-emoji { font-size: 24px; margin-bottom: 6px; }
.sit-label { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.sit-btn.active .sit-label, .sit-btn.active .sit-desc { color: #fff; }
.sit-desc { font-size: 11px; color: var(--text-muted); line-height: 1.4; }
.sit-btn.active .sit-desc { color: rgba(255,255,255,.8); }
.sit-btn.active::after { content: '✓'; position: absolute; top: 10px; right: 12px; font-size: 14px; font-weight: 800; color: #fff; }

.always-box { display: flex; align-items: flex-start; gap: 8px; background: #FFF9E6; border-radius: 10px; padding: 12px 14px; border: 1px solid #FFE58F; }
.always-icon { font-size: 16px; flex-shrink: 0; }
.always-text { font-size: 12px; color: #7C5C00; line-height: 1.5; }

.submit-btn {
  width: 100%; padding: 17px; background: var(--brand); color: #fff;
  font-size: 17px; font-weight: 700; border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,184,132,.35); letter-spacing: -.3px;
  transition: opacity .15s;
}
.submit-btn:disabled { opacity: .5; cursor: default; }
.submit-btn:not(:disabled):hover { opacity: .9; }

/* ── Result Screen ─────────────────────────────────────── */
.result-header { background: var(--brand); padding: 20px 20px 28px; }
.back-btn { font-size: 14px; color: rgba(255,255,255,.85); font-weight: 600; margin-bottom: 12px; display: block; background: none; }
.result-title { font-size: 13px; color: rgba(255,255,255,.75); font-weight: 600; margin-bottom: 4px; }
.result-count { font-size: 26px; font-weight: 800; color: #fff; letter-spacing: -.5px; line-height: 1.2; }
.count-num { font-size: 36px; color: #fff; }
.result-sub { font-size: 12px; color: rgba(255,255,255,.7); margin-top: 6px; }
.result-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; }

/* ── Refund Card ───────────────────────────────────────── */
.refund-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; border: 1px solid var(--border); }
.card-header { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; gap: 12px; text-align: left; background: none; }
.card-left { display: flex; align-items: flex-start; gap: 12px; flex: 1; min-width: 0; }
.card-emoji { font-size: 28px; flex-shrink: 0; line-height: 1; }
.card-tags { display: flex; gap: 6px; margin-bottom: 4px; flex-wrap: wrap; }
.cat-tag { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; }
.amount-tag { font-size: 11px; font-weight: 600; color: var(--text-muted); padding: 2px 7px; background: var(--bg); border-radius: 99px; }
.card-title { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.3; }
.card-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.chevron { font-size: 18px; color: var(--text-muted); flex-shrink: 0; transition: transform .2s; }
.chevron.open { transform: rotate(180deg); }

.card-detail { border-top: 1px solid var(--border); padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.detail-section { display: flex; flex-direction: column; gap: 6px; }
.detail-label { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.detail-value { font-size: 13px; color: var(--text); line-height: 1.6; }
.cond-row { display: flex; gap: 6px; align-items: flex-start; }
.cond-dot { flex-shrink: 0; color: var(--brand); font-weight: 700; margin-top: 1px; }
.cond-text { font-size: 13px; color: var(--text); line-height: 1.5; }
.link-btn { width: 100%; padding: 13px; background: var(--brand); color: #fff; font-size: 14px; font-weight: 700; border-radius: 10px; letter-spacing: -.2px; }

/* ── Notice ────────────────────────────────────────────── */
.notice-box { background: #FFF8E6; border-radius: 10px; padding: 14px; border: 1px solid #FFE08A; }
.notice-title { font-size: 13px; font-weight: 700; color: #7C5C00; margin-bottom: 6px; }
.notice-text { font-size: 12px; color: #7C5C00; line-height: 1.6; }

/* ── Guide / FAQ ───────────────────────────────────────── */
.guide-section { background: var(--surface); border-radius: var(--radius); padding: 24px 20px; box-shadow: var(--shadow-sm); margin-top: 8px; }
.guide-section h2 { font-size: 18px; font-weight: 800; margin-bottom: 16px; color: var(--text); }
.guide-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 500px) { .guide-grid { grid-template-columns: 1fr; } }
.guide-card { background: var(--surface2); border-radius: var(--radius-sm); padding: 14px; border-left: 4px solid var(--brand); }
.guide-card h3 { font-size: 14px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.guide-card p { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.faq-section { background: var(--surface); border-radius: var(--radius); padding: 24px 20px; box-shadow: var(--shadow-sm); margin-top: 8px; }
.faq-section h2 { font-size: 18px; font-weight: 800; margin-bottom: 16px; color: var(--text); }
.faq-item { border-bottom: 1px solid var(--border); padding: 14px 0; }
.faq-item:last-child { border-bottom: none; }
.faq-q { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.faq-a { font-size: 13px; color: var(--text-muted); line-height: 1.6; }

/* ── Sidebar ───────────────────────────────────────────── */
.app-sidebar { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; scrollbar-width: 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); 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; }

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

/* ── Toast ─────────────────────────────────────────────── */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(40px); background: #1A1A1A; color: #fff; padding: 10px 20px; border-radius: 99px; font-size: 14px; font-weight: 600; opacity: 0; transition: all .3s; z-index: 999; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
