/* 1. 테마 변수 및 초기화 */
:root {
  --bg-page: #f3f5f8;
  --bg-card: #ffffff;
  --text-main: #191f28;
  --text-sub: #4e5968;
  --text-muted: #8b95a1;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --border-color: #e5e8eb;
  --danger-bg: #fef2f2;
  --danger-text: #dc2626;
  --kakao-yellow: #fee500;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
}

a {
  text-decoration: none;
  color: inherit;
}

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

.font-receipt {
  font-family: 'JetBrains Mono', 'Pretendard', monospace;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 16px;
}

/* 2. 상단 고정 헤더 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
}

.header-inner {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-icon {
  background-color: var(--primary);
  color: #ffffff;
  font-weight: 800;
  font-size: 14px;
  padding: 3px 8px;
  border-radius: 6px;
}

.brand-title {
  font-weight: 800;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background-color: var(--primary-light);
  padding: 2px 6px;
  border-radius: 4px;
}

.main-nav {
  display: none;
  align-items: center;
  gap: 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-sub);
}

@media (min-width: 768px) {
  .main-nav {
    display: flex;
  }
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--primary);
}

.urgent-link {
  display: flex;
  align-items: center;
  gap: 4px;
}

.red-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #ef4444;
}

.btn-share-top {
  font-size: 12px;
  font-weight: 700;
  background-color: #f2f4f6;
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 8px;
}

.btn-share-top:hover {
  background-color: #e5e8eb;
}

/* 3. 광고 슬롯 */
.top-ad-wrap {
  padding-top: 16px;
}

.ad-slot {
  background: repeating-linear-gradient(
    45deg,
    #f8fafc,
    #f8fafc 10px,
    #f1f5f9 10px,
    #f1f5f9 20px
  );
  border: 1px dashed #cbd5e1;
  color: #64748b;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 12px;
  padding: 12px;
}

.ad-slot strong {
  color: #475569;
  margin-bottom: 2px;
}

.ad-leaderboard { height: 80px; }
.ad-infeed { height: 110px; }
.ad-skyscraper { height: 320px; }
.ad-modal { height: 76px; margin: 16px 0; }

/* 4. 메인 3단 그리드 레이아웃 */
.main-grid {
  padding-top: 24px;
  padding-bottom: 40px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}

@media (min-width: 1024px) {
  .main-grid {
    grid-template-columns: 280px 1fr 280px;
  }
  .sticky-box {
    position: sticky;
    top: 76px;
  }
}

.panel-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

/* 5. 좌측 필터 사이드바 */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-title {
  font-size: 16px;
  font-weight: 700;
}

.btn-reset {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: underline;
}

.filter-group {
  margin-bottom: 16px;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.form-select {
  width: 100%;
  background-color: #f9fafb;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
}

.job-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.job-btn {
  padding: 9px 8px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background-color: #ffffff;
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 500;
}

.job-btn.active {
  border-color: var(--primary);
  background-color: var(--primary-light);
  color: var(--primary-hover);
  font-weight: 700;
}

.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

/* 6. 중앙 영수증 위젯 */
.center-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.receipt-wrapper {
  padding-top: 8px;
}

.receipt-paper {
  position: relative;
  background-color: #ffffff;
  max-width: 440px;
  margin: 0 auto;
  padding: 28px 24px;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.08));
}

.receipt-paper::before,
.receipt-paper::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 10px;
  background-size: 20px 10px;
}

.receipt-paper::before {
  top: -10px;
  background-image: radial-gradient(circle at 10px 0, transparent 10px, #ffffff 10.5px);
}

.receipt-paper::after {
  bottom: -10px;
  background-image: radial-gradient(circle at 10px 10px, transparent 10px, #ffffff 10.5px);
}

.receipt-head {
  text-align: center;
  border-bottom: 2px dashed #d1d5db;
  padding-bottom: 16px;
}

.receipt-eng {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.receipt-title {
  font-size: 20px;
  font-weight: 800;
  margin-top: 4px;
}

.receipt-meta {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 6px;
}

.receipt-body {
  padding: 16px 0;
  border-bottom: 2px dashed #d1d5db;
}

.receipt-col-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.receipt-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.receipt-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  padding: 5px 6px;
  border-radius: 6px;
  cursor: pointer;
}

.receipt-item-row:hover {
  background-color: var(--primary-light);
}

.receipt-item-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 8px;
}

.receipt-item-price {
  font-weight: 700;
  flex-shrink: 0;
}

.receipt-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  padding: 16px 0;
}

.receipt-total-box {
  padding: 16px 0;
  border-bottom: 2px dashed #d1d5db;
}

.receipt-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.receipt-total-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-sub);
}

.receipt-total-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
}

.receipt-total-unit {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
}

.receipt-note {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
  margin-top: 4px;
}

.receipt-foot {
  padding-top: 16px;
  text-align: center;
}

.receipt-barcode {
  height: 32px;
  width: 80%;
  margin: 0 auto;
  opacity: 0.75;
  background: repeating-linear-gradient(
    90deg,
    #111 0px, #111 2px,
    transparent 2px, transparent 5px,
    #111 5px, #111 6px,
    transparent 6px, transparent 9px
  );
}

.receipt-serial {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 6px;
  letter-spacing: 0.1em;
}

.receipt-actions {
  max-width: 440px;
  margin: 20px auto 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-action {
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.btn-dark {
  background-color: #191f28;
  color: #ffffff;
}

.btn-kakao {
  background-color: var(--kakao-yellow);
  color: #191919;
}

/* 7. 제휴(CPA) 배너 */
.monetize-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cpa-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #2563eb 0%, #4338ca 100%);
  color: #ffffff;
  padding: 16px 20px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.cpa-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  background-color: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 4px;
}

.cpa-title {
  font-size: 15px;
  font-weight: 700;
  margin-top: 6px;
}

.cpa-sub {
  font-size: 12px;
  color: #dbeafe;
  margin-top: 2px;
}

.cpa-emoji {
  font-size: 28px;
  margin-left: 12px;
}

/* =========================================
   8. 상세 지원금 카드 리스트 (PC·모바일 완벽 정렬)
   ========================================= */
.list-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
}

.list-title {
  font-size: 17px;
  font-weight: 800;
}

.text-primary {
  color: var(--primary);
}

.sort-group {
  display: flex;
  gap: 6px;
}

.sort-btn {
  padding: 6px 12px;
  border-radius: 8px;
  background-color: #f2f4f6;
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 600;
}

.sort-btn.active {
  background-color: #191f28;
  color: #ffffff;
  font-weight: 700;
}

.grant-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.grant-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 16px 18px;
  background-color: #ffffff;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
    min-width: 0;
  overflow: hidden;
}

.grant-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.card-badges {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.badge-urgent,
.badge-normal,
.badge-always,
.badge-type {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.badge-urgent {
  background-color: var(--danger-bg);
  color: var(--danger-text);
}

.badge-normal {
  background-color: var(--primary-light);
  color: var(--primary);
}

.badge-always {
  background-color: #f2f4f6;
  color: var(--text-sub);
}

.badge-type {
  color: var(--primary);
  background-color: var(--primary-light);
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.card-desc {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.card-footer {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #f2f4f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-sub-amount {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-main-amount {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  flex-shrink: 0;
}

/* =========================================
   9. 우측 사이드바 인기 TOP 5
   ========================================= */
.right-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.popular-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.popular-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  cursor: pointer;
}

.popular-item:hover {
  color: var(--primary);
}

.popular-rank {
  font-weight: 800;
  color: var(--primary);
  margin-right: 6px;
}

.popular-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 8px;
}

.popular-amount {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* =========================================
   10. 하단 푸터 & 상세 페이지 공통 블록
   ========================================= */
.site-footer {
  background-color: #ffffff;
  border-top: 1px solid var(--border-color);
  margin-top: 48px;
  padding: 32px 0;
  font-size: 12px;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-brand {
  font-weight: 700;
  color: var(--text-sub);
}

.footer-links {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-links .bold-link {
  font-weight: 600;
  color: var(--text-sub);
}

/* 상세 HTML 페이지(detail/*.html) 전용 스타일 */
.modal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.modal-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 14px;
}

.modal-highlight {
  background-color: var(--primary-light);
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 16px;
}

.modal-highlight-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}

.modal-highlight-amount {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary-hover);
  margin-top: 2px;
}

.modal-info-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  color: var(--text-sub);
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.btn-gov-apply {
  display: block;
  width: 100%;
  text-align: center;
  background-color: var(--primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
  padding: 14px;
  border-radius: 12px;
}

.btn-gov-apply:hover {
  background-color: var(--primary-hover);
}

.btn-modal-close {
  display: block;
  width: 100%;
  background-color: #f2f4f6;
  color: var(--text-sub);
  font-weight: 600;
  font-size: 13px;
  padding: 12px;
  border-radius: 12px;
}

/* =========================================
   11. 모바일 화면 최적화 (767px 이하)
   ========================================= */
.main-grid > *,
.center-column,
.right-column,
.panel-card {
  min-width: 0;
  width: 100%;
}

@media (max-width: 767px) {
  .container {
    padding: 0 12px;
  }

  .brand-title {
    font-size: 16px;
  }

  .btn-share-top {
    padding: 6px 10px;
    font-size: 11px;
  }

  .main-grid {
    padding-top: 16px;
    gap: 16px;
  }

  .panel-card {
    padding: 16px;
  }

  .receipt-wrapper {
    padding: 10px 4px 0;
  }

  .receipt-paper {
    padding: 22px 16px;
  }

  .receipt-title {
    font-size: 18px;
  }

  .receipt-total-value {
    font-size: 24px;
  }

  .receipt-actions {
    gap: 8px;
    margin-top: 18px;
  }

  .btn-action {
    padding: 12px 8px;
    font-size: 13px;
    white-space: nowrap;
  }

  .cpa-banner {
    padding: 14px 16px;
  }

  .cpa-title {
    font-size: 14px;
    word-break: keep-all;
  }

  .cpa-emoji {
    font-size: 24px;
    margin-left: 8px;
  }

  .list-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .sort-group {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .sort-btn {
    text-align: center;
    padding: 8px;
  }
}

/* =========================================
   12. PC 버전 고밀도 포털 레이아웃 & 사이드바 보호 (1024px 이상)
   ========================================= */
@media (min-width: 1024px) {
  .container {
    max-width: 1320px;
  }

  .sticky-box {
    position: sticky;
    top: 76px;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
  }

  .sticky-box::-webkit-scrollbar {
    width: 4px;
  }

  .sticky-box::-webkit-scrollbar-thumb {
    background-color: #d1d5db;
    border-radius: 4px;
  }

  .receipt-paper,
  .receipt-actions {
    max-width: 100%;
  }

  .receipt-paper {
    padding: 36px 40px;
  }

  .receipt-title {
    font-size: 24px;
  }

  .receipt-item-row {
    font-size: 15px;
    padding: 8px 10px;
  }

  .receipt-total-value {
    font-size: 34px;
  }

  .grant-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
}


/* =========================================
   상세 페이지(detail/*.html) 고품질 SEO 레이아웃
   ========================================= */
.breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.breadcrumb a:hover {
  text-decoration: underline;
  color: var(--primary);
}

.detail-section-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
  margin: 24px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #f2f4f6;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-bottom: 8px;
}

.spec-table th,
.spec-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
  line-height: 1.5;
}

.spec-table th {
  width: 110px;
  background-color: #f9fafb;
  color: var(--text-sub);
  font-weight: 700;
}

.detail-desc-box {
  background-color: #f9fafb;
  padding: 16px;
  border-radius: 12px;
  font-size: 14px;
  color: var(--text-main);
  line-height: 1.65;
}

.step-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.step-item {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px 16px;
  background-color: #ffffff;
}

.step-num {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  color: var(--primary);
  background-color: var(--primary-light);
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.step-item strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.step-item p {
  font-size: 13px;
  color: var(--text-sub);
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background-color: #f9fafb;
  border-radius: 12px;
  padding: 14px 16px;
}

.faq-q {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.faq-a {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.55;
}

.related-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.related-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 14px;
  transition: border-color 0.15s;
}

.related-card:hover {
  border-color: var(--primary);
  background-color: var(--primary-light);
}

.related-title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 10px;
}

.related-amount {
  font-weight: 800;
  color: var(--primary);
  flex-shrink: 0;
}

