/* ===========================================================
   전기차 보조금 계산기 — 그린 팔레트 (#059669)
   =========================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand:       #059669;
  --brand-dark:  #047857;
  --brand-deep:  #064E3B;
  --brand-light: #D1FAE5;
  --brand-soft:  #ECFDF5;
  --gold:        #F59E0B;
  --bg:          #F0FDF4;
  --surface:     #FFFFFF;
  --surface2:    #F8FAFC;
  --border:      #E2E8F0;
  --text:        #0F172A;
  --text-muted:  #64748B;
  --radius:      16px;
  --radius-sm:   10px;
  --shadow:      0 4px 20px rgba(5,150,105,.10);
  --shadow-sm:   0 2px 8px rgba(0,0,0,.06);
  --danger:      #DC2626;
  --success:     #059669;
  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); line-height: 1.7; min-height: 100vh; padding: 0; }
a { color: var(--brand); text-decoration: none; }

/* ===== Header (풀블리드 · 좌측 정렬) ===== */
.main-header {
  width: 100%;
  background: linear-gradient(135deg, #0D9488 0%, #0F766E 100%);
  color: #fff;
  padding: 2.2rem 1rem 1.8rem;
  text-align: left;
  position: relative;
  overflow: hidden;
}
.main-header::before {
  content: '';
  position: absolute;
  top: -40%; right: -10%;
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(245,158,11,.20), transparent 70%);
  pointer-events: none;
}
.header-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 1rem;
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
}
.header-text { flex: 1; min-width: 0; }
.main-header h1 { font-size: 1.65rem; color: #fff; margin: 0 0 .25rem; font-weight: 800; letter-spacing: -.3px; line-height: 1.25; }
.main-header h1 a.logo-link { color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: .5rem; }
.main-header .logo-emoji { font-size: 1.5rem; }
.main-header .subtitle { font-size: .95rem; color: rgba(255,255,255,.85); margin: 0; }
.btn-share-header {
  background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.25);
  backdrop-filter: blur(4px); padding: .55rem 1rem; font-size: .9rem; font-weight: 600;
  border-radius: 999px; cursor: pointer; flex-shrink: 0; transition: all .15s;
}
.btn-share-header:hover { background: rgba(255,255,255,.28); transform: translateY(-1px); }

/* Top AdSense (풀블리드) · middle/bottom는 800px 안 contain */
.ad-container { text-align: center; margin: 1rem auto; max-width: 800px; }
.ad-container.top-ad { width: 100%; max-width: none; background: #f9fafb; padding: 8px 0; border-bottom: 1px solid #e5e7eb; margin: 0; }
.ad-container.bottom-ad,
.ad-container.middle-ad { max-width: 800px; margin: 2rem auto; overflow: hidden; }
.ad-container.bottom-ad ins.adsbygoogle,
.ad-container.middle-ad ins.adsbygoogle { display: block !important; width: 100%; max-width: 800px; }

/* ===== Container ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 1rem; }
.layout-container { display: flex; gap: 1.5rem; max-width: 1100px; margin: 0 auto; }
.main-column { flex: 3; min-width: 0; }
.app-sidebar { flex: 1; min-width: 280px; position: sticky; top: 1.5rem; align-self: flex-start; max-height: calc(100vh - 3rem); overflow-y: auto; scrollbar-width: none; }
.app-sidebar::-webkit-scrollbar { display: none; }
@media (max-width: 1024px) {
  .layout-container { flex-direction: column; }
  .app-sidebar { display: none; }
}

/* ===== controltower sidebar.js inject ===== */
.sidebar-card { background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 14px; box-shadow: 0 2px 8px rgba(0,0,0,.06); border: 1px solid #e5e7eb; }
.sidebar-card h3 { font-size: 14.5px; font-weight: 700; margin: 0 0 10px; color: var(--brand-dark); display: flex; align-items: center; gap: 6px; }
.sidebar-list { list-style: none; padding: 0; margin: 0; }
.sidebar-list li { margin-bottom: 8px; }
.sidebar-list li:last-child { margin-bottom: 0; }
.sidebar-list a { display: flex; align-items: flex-start; gap: 8px; padding: 6px 8px; color: #1e293b; text-decoration: none; border-radius: 8px; transition: background .2s ease; }
.sidebar-list a:hover { background: var(--brand-soft); }
.link-content { flex: 1; min-width: 0; }
.link-title { display: block; font-size: 13.5px; font-weight: 600; color: var(--brand-dark); }
.link-desc { display: block; font-size: 12px; color: #64748b; margin-top: 2px; line-height: 1.4; }

/* ===== Sections ===== */
.calculator-section, .info-section, .scenario-section, .popular-section, .faq-section, .changelog-section, .related-section, .info-section-link {
  background: #fff; padding: 1.8rem; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1.5rem;
}
.calculator-section h2, .info-section h2, .scenario-section h2, .popular-section h2, .faq-section h2, .changelog-section h2, .related-section h2, .info-section-link h2 {
  color: var(--brand-dark); margin: 0 0 12px; font-size: 1.4rem; font-weight: 800;
}
.calculator-section p, .info-section p { color: #334155; margin-bottom: 10px; line-height: 1.8; }
.calculator-section ul, .info-section ul { padding-left: 1.5rem; list-style: disc; margin: 12px 0; }
.calculator-section ul li, .info-section ul li { margin-bottom: 8px; line-height: 1.8; color: #334155; }
.calculator-section ul li::marker, .info-section ul li::marker { color: var(--brand); }
.section-intro { color: #64748b; margin-bottom: 1rem; font-size: 14px; }

/* Bracket Table */
.table-scroll { overflow-x: auto; }
.bracket-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.bracket-table th { background: var(--brand); color: #fff; padding: 10px 12px; text-align: left; font-weight: 700; }
.bracket-table td { padding: 10px 12px; border-bottom: 1px solid #e5e7eb; }
.bracket-table tr:hover { background: var(--brand-soft); }
.bracket-table .amt { font-weight: 800; color: var(--brand-dark); }
.bracket-table .muted { color: #64748b; font-size: 12.5px; display: block; margin-top: 2px; }
.bracket-note { background: var(--brand-soft); border-left: 3px solid var(--brand); padding: 12px 14px; margin: 12px 0; font-size: 13.5px; color: var(--brand-dark); border-radius: 0 8px 8px 0; line-height: 1.7; }

/* Hero stats */
.hero-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 14px 0; }
.hero-stat { background: linear-gradient(135deg, var(--brand-soft), var(--brand-light)); border: 1px solid #99F6E4; border-radius: 12px; padding: 14px; text-align: center; }
.hero-stat-num { font-size: 22px; font-weight: 900; color: var(--brand-dark); }
.hero-stat-lbl { font-size: 13px; color: #475569; margin-top: 2px; }

/* D-day */
.dday-banner { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 50%, var(--brand-deep) 100%); color: #fff; padding: 1.4rem 1.6rem; border-radius: 14px; margin-bottom: 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.dday-label { font-size: 14px; opacity: .9; margin-bottom: 4px; }
.dday-num { font-size: 30px; font-weight: 900; letter-spacing: -.5px; }
.dday-num .unit { font-size: 18px; opacity: .85; margin-left: 4px; }
.dday-info { font-size: 13px; opacity: .9; }
.dday-cta { background: var(--gold); color: #1f2937; padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; text-decoration: none; flex-shrink: 0; }

/* Scenario Grid */
.scenario-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.scenario-card { display: block; padding: 14px 16px; background: linear-gradient(135deg, var(--brand-soft), var(--brand-light)); border: 1px solid #99F6E4; border-radius: 12px; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
.scenario-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(13,148,136,.15); border-color: var(--brand); }
.scenario-head { font-weight: 800; color: var(--brand-dark); font-size: 15px; }
.scenario-sub { font-size: 13px; color: #475569; margin-top: 2px; }
.scenario-note { font-size: 12px; color: #64748b; margin-top: 4px; }

/* Popular Grid */
.popular-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.popular-tag { display: inline-flex; align-items: center; padding: 6px 12px; background: var(--brand-soft); border: 1px solid #99F6E4; border-radius: 999px; font-size: 13px; color: var(--brand-dark); text-decoration: none; transition: all .15s; }
.popular-tag:hover { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Related Grid */
.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 16px 0; }
.related-link { display: flex; gap: 12px; padding: 14px; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; text-decoration: none; color: inherit; transition: box-shadow .15s, transform .15s; }
.related-link:hover { box-shadow: 0 6px 18px rgba(0,0,0,.08); transform: translateY(-1px); border-color: var(--brand); }
.rel-emoji { font-size: 28px; flex-shrink: 0; }
.rel-body { flex: 1; min-width: 0; }
.rel-title { font-size: 14.5px; font-weight: 700; color: var(--brand-dark); margin-bottom: 2px; }
.rel-desc { font-size: 12.5px; color: #64748b; line-height: 1.4; }

/* Info Grid */
.info-grid-link { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.gov-link { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; text-decoration: none; color: var(--brand-dark); font-size: 14px; transition: all .15s; }
.gov-link:hover { background: var(--brand-soft); border-color: var(--brand); }
.gov-emoji { font-size: 22px; flex-shrink: 0; }

/* CTA */
.cta-banner { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%); color: #fff; padding: 1.6rem; border-radius: 14px; margin: 1rem 0 1.5rem; text-align: center; }
.cta-banner h3 { font-size: 1.2rem; font-weight: 800; margin-bottom: 8px; }
.cta-banner p { font-size: 14px; opacity: .92; margin-bottom: 12px; }
.cta-banner a { display: inline-block; background: var(--gold); color: #1f2937; padding: 10px 20px; border-radius: 999px; font-weight: 700; font-size: 14px; text-decoration: none; }

/* Footer */
.main-footer { background: #fff; padding: 1.5rem 1rem; text-align: center; color: #64748b; font-size: 13px; line-height: 1.7; border-top: 1px solid var(--border); margin-top: 2rem; }
.main-footer a { color: var(--brand); margin: 0 6px; }

/* FAQ */
.faq-item { padding: 14px 0; border-bottom: 1px solid #e5e7eb; }
.faq-item:last-child { border-bottom: none; }
.faq-item summary { font-weight: 700; color: var(--brand-dark); cursor: pointer; padding: 6px 0 6px 1.2rem; font-size: 15px; position: relative; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::marker { display: none; content: ""; }
.faq-item summary::before { content: "▶"; position: absolute; left: 0; font-size: .8rem; color: var(--brand); transition: transform .2s; }
.faq-item[open] summary::before { transform: rotate(90deg); }
.faq-item p { color: #475569; padding: 8px 0 4px 1.2rem; line-height: 1.8; font-size: 14px; }

/* ===== 중앙 광고 슬롯 시스템 (W35 표준 · 티얼) ===== */
.ad-slot { display: block; width: 100%; border-radius: 12px; overflow: hidden; background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; position: relative; box-shadow: 0 2px 8px rgba(0,0,0,.08); margin: 12px auto; }
.ad-slot.banner-wide { aspect-ratio: 4/1; max-width: 800px; }
.ad-slot.banner-square { aspect-ratio: 1/1; max-width: 320px; }
.ad-slot .ad-inner { position: absolute; inset: 0; padding: 16px 22px; display: flex; flex-direction: column; justify-content: center; z-index: 1; }
.ad-slot.has-image .ad-inner { background: linear-gradient(90deg, rgba(0,0,0,.55), rgba(0,0,0,0)); }
.ad-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.ad-slot .ad-label { position: absolute; top: 6px; right: 10px; font-size: 10px; opacity: .8; z-index: 2; }
.ad-slot .ad-title { font-size: 18px; font-weight: 800; line-height: 1.3; }
.ad-slot .ad-subtitle { font-size: 13px; opacity: .9; line-height: 1.4; }
.ad-slot .ad-cta { display: inline-block; align-self: flex-start; margin-top: 8px; padding: 6px 14px; background: rgba(255,255,255,.25); border-radius: 20px; font-size: 13px; font-weight: 700; }

.ad-slot.kakao-channel,
.ad-slot[data-ad-type="kakao-channel"] { background: #FEE500; }
.ad-slot.kakao-channel .ad-title,
.ad-slot[data-ad-type="kakao-channel"] .ad-title { color: #3C1E1E; }
.ad-slot.kakao-channel .ad-subtitle,
.ad-slot[data-ad-type="kakao-channel"] .ad-subtitle { color: rgba(60,30,30,.85); }
.ad-slot.kakao-channel .ad-cta,
.ad-slot[data-ad-type="kakao-channel"] .ad-cta { background: #3C1E1E; color: #FEE500; }

@media (max-width: 600px) {
  .header-inner { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .main-header h1 { font-size: 1.4rem; }
  .btn-share-header { align-self: stretch; text-align: center; }
  .dday-banner { flex-direction: column; align-items: stretch; text-align: center; }
}

/* ===========================================================
   ev-subsidy 전용 추가 클래스 (계산기 UI + faq + 광고 정렬)
   =========================================================== */

/* 폼 (제조사·차량·지역 선택) */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 700; color: var(--brand-dark); margin-bottom: .4rem; font-size: .92rem; }
.form-select {
  width: 100%; padding: .8rem .9rem;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 1rem; font-family: inherit; color: var(--text);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23059669'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .6rem center;
  background-size: 1.4rem;
  padding-right: 2.4rem;
  cursor: pointer;
}
.form-select:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
.form-select:disabled { background: var(--surface2); color: #94a3b8; cursor: not-allowed; }
.checkbox-group { display: flex; align-items: flex-start; gap: .6rem; }
.checkbox-group input[type="checkbox"] { width: 1.1rem; height: 1.1rem; accent-color: var(--brand); margin-top: .15rem; flex-shrink: 0; }
.checkbox-group label { font-weight: 500; color: var(--text); font-size: .9rem; line-height: 1.5; margin: 0; }

/* 버튼 */
.btn { padding: .8rem 1.4rem; border-radius: var(--radius-sm); font-size: 1rem; font-weight: 700; cursor: pointer; transition: all .15s; border: none; font-family: inherit; }
.btn-primary { width: 100%; background: var(--brand); color: #fff; padding: 1rem; font-size: 1.05rem; margin-top: .5rem; }
.btn-primary:hover { background: var(--brand-dark); transform: translateY(-1px); }
.btn-secondary { background: var(--surface); color: var(--brand-dark); border: 1.5px solid var(--brand-light); }
.btn-secondary:hover { background: var(--brand-soft); }
.btn-share { background: var(--brand-soft); color: var(--brand-dark); border: 1px solid var(--brand-light); padding: .55rem 1rem; font-size: .85rem; }
.btn-share:hover { background: var(--brand-light); }
.btn-small { padding: .5rem .9rem; font-size: .85rem; }
.btn-outline { background: transparent; color: var(--brand-dark); border: 1.5px solid var(--brand-light); }

/* 결과 섹션 */
.hidden { display: none !important; }
.result-summary { background: linear-gradient(135deg, var(--brand-soft), var(--brand-light)); padding: 1.5rem; border-radius: var(--radius-sm); text-align: center; margin-bottom: 1rem; border-left: 4px solid var(--brand); }
.result-label { color: var(--text-muted); font-size: .92rem; margin-bottom: .4rem; }
.result-label #vehicle-name { font-weight: 800; color: var(--brand-dark); }
.result-value { font-size: 2.2rem; font-weight: 900; color: var(--brand-dark); letter-spacing: -1px; }

.result-table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.result-table th { background: var(--brand-soft); color: var(--brand-dark); text-align: left; padding: .7rem .9rem; font-weight: 700; font-size: .9rem; border-bottom: 1px solid var(--border); }
.result-table td { text-align: right; padding: .7rem .9rem; font-weight: 700; border-bottom: 1px solid var(--border); }
.result-table tr.row-highlight th, .result-table tr.row-highlight td { background: var(--brand-light); color: var(--brand-dark); }
.result-table tr.row-final th, .result-table tr.row-final td { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%); color: #fff; font-size: 1.05rem; font-weight: 900; }

.info-box { background: var(--surface2); padding: 1rem 1.2rem; border-radius: var(--radius-sm); margin: 1rem 0; border-left: 3px solid var(--gold); font-size: .92rem; line-height: 1.7; }
.info-box a { color: var(--brand-dark); text-decoration: underline; font-weight: 700; }

.result-actions { display: flex; gap: .6rem; margin-top: 1rem; flex-wrap: wrap; }
.result-actions .btn { flex: 1; min-width: 140px; }

/* 이력 */
.history-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.history-list li { padding: .6rem .8rem; border-bottom: 1px solid var(--border); font-size: .9rem; color: var(--text-muted); }
.history-list li:last-child { border-bottom: none; }
.history-list li strong { color: var(--brand-dark); }

/* 콘텐츠 섹션 (SEO) */
.content-section h3 { color: var(--brand-dark); margin: 1.2rem 0 .5rem; font-size: 1.05rem; }
.content-section h3:first-child { margin-top: 0; }
.content-section p { color: var(--text-muted); line-height: 1.7; margin-bottom: .6rem; font-size: .92rem; }
.content-section ul { margin: .6rem 0 1rem 1.2rem; color: var(--text-muted); }
.content-section ul li { margin-bottom: .35rem; line-height: 1.7; font-size: .92rem; }
.content-section strong { color: var(--text); }

/* FAQ (faq-item — 기존 60_youth 거 유지하지만 보강) */
.faq-item p a { color: var(--brand-dark); text-decoration: underline; }

/* 광고 정렬 (풀블리드 가운데) */
.ad-container { max-width: 1100px; margin: 1.5rem auto; padding: 0 1rem; }
.ad-container.top-ad { margin: 0 auto; }
.ad-container.middle-ad { margin: 1.5rem 0; }
body > .adsbygoogle { display: block !important; max-width: 1100px; margin: 1.5rem auto; padding: 0 1rem; }

/* card 기본 (input-section, result-section 등) */
.card { background: var(--surface); border-radius: var(--radius); padding: 1.4rem 1.5rem; margin-bottom: 1.4rem; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
@media (max-width: 720px) { .card { padding: 1.1rem 1rem; } }
.section-title { font-size: 1.2rem; font-weight: 800; color: var(--brand-dark); margin-bottom: .8rem; letter-spacing: -.3px; }

