/* =====================================================
   FUNDII Design System
   Version: 2.0
   ===================================================== */

@import url(fontawesome-all.min.css);

@font-face {
  font-family: 'Pretendard';
  src: url('/assets/fonts/pretendard/Pretendard-Regular.woff2') format('woff2'),
       url('/assets/fonts/pretendard/Pretendard-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Pretendard';
  src: url('/assets/fonts/pretendard/Pretendard-Regular.woff2') format('woff2'),
       url('/assets/fonts/pretendard/Pretendard-Regular.woff') format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Pretendard';
  src: url('/assets/fonts/pretendard/Pretendard-Bold.woff2') format('woff2'),
       url('/assets/fonts/pretendard/Pretendard-Bold.woff') format('woff');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Pretendard';
  src: url('/assets/fonts/pretendard/Pretendard-Bold.woff2') format('woff2'),
       url('/assets/fonts/pretendard/Pretendard-Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Pretendard';
  src: url('/assets/fonts/pretendard/Pretendard-Bold.woff2') format('woff2'),
       url('/assets/fonts/pretendard/Pretendard-Bold.woff') format('woff');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* =====================================================
   1. CSS Variables
   ===================================================== */
:root {
  /* Brand Colors */
  --primary:        #f27a5e;
  --primary-dark:   #d95f46;
  --primary-light:  #fff0df;
  --secondary:      #3f3530;
  --accent:         #f6b26b;
  --danger:         #EF5350;

  /* Text */
  --text:           #3f3530;
  --text-sub:       #5a4b44;
  --text-muted:     #7b706a;
  --text-faint:     #AAAAAA;
  --text-white:     #FFFFFF;

  /* Background */
  --bg:             #fffdf9;
  --bg-soft:        #fff8ef;
  --bg-mid:         #fff0df;
  --bg-dark:        #3f3530;
  --bg-darker:      #2E2D2D;
  --footer-bg:      #3f3530;
  --footer-border:  rgba(255, 255, 255, 0.07);
  --footer-text:    #f7e6dc;
  --footer-muted:   #e8cfc2;

  /* Border */
  --border:         #eedfd5;
  --border-mid:     #e2cfc3;

  /* Category */
  --cat-medical:    #FF6F61;
  --cat-emergency:  #FF8A65;
  --cat-education:  #f6b26b;
  --cat-animal:     #f27a5e;
  --cat-family:     #d98f72;
  --cat-volunteer:  #e8909f;

  /* Font */
  --font: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;

  /* Border Radius */
  --r-sm:   6px;
  --r-md:   8px;
  --r-lg:   8px;
  --r-xl:   8px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 3px rgba(31,59,54,0.06);
  --shadow-sm: 0 2px 8px rgba(31,59,54,0.07);
  --shadow-md: 0 4px 16px rgba(31,59,54,0.08);
  --shadow-lg: 0 8px 32px rgba(31,59,54,0.10);
  --shadow-xl: 0 16px 48px rgba(31,59,54,0.12);

  /* Layout */
  --nav-h:        64px;
  --max-w:        1200px;
  --sidebar-w:    240px;
  --admin-side-w: 220px;

  /* Transition */
  --t: 0.2s ease;
}

/* =====================================================
   2. Reset
   ===================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-top: var(--nav-h);
}

img  { max-width: 100%; height: auto; display: block; }
a    { color: var(--primary); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--primary-dark); }
ul, ol { list-style: none; }

h1 { font-size: 2.25rem; font-weight: 800; line-height: 1.2; color: var(--text); }
h2 { font-size: 1.75rem; font-weight: 700; line-height: 1.3; color: var(--text); }
h3 { font-size: 1.25rem; font-weight: 700; line-height: 1.4; color: var(--text); }
h4 { font-size: 1.0625rem; font-weight: 600; color: var(--text); }
p  { line-height: 1.75; color: var(--text-muted); }

input, select, textarea, button {
  font-family: var(--font);
  font-size: 1rem;
  -moz-appearance: none;
  -webkit-appearance: none;
  appearance: none;
}
table { border-collapse: collapse; border-spacing: 0; }

/* =====================================================
   3. Container
   ===================================================== */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}
.container-sm { max-width: 720px; }
.container-xs { max-width: 480px; }

/* =====================================================
   4. Header / Navbar
   ===================================================== */
#site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--nav-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: box-shadow var(--t);
}
#site-header.scrolled { box-shadow: var(--shadow-md); }

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 0;
}

/* Logo */
.header-logo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 100%;
  flex: 0 0 180px;
  min-width: 180px;
  position: relative;
  z-index: 2;
}
.header-logo a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  margin: 0;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: 0;
  line-height: 1;
  border-bottom: 0;
}
.header-logo a:hover { color: var(--primary-dark); }

/* Desktop Nav */
.header-nav {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  pointer-events: none;
}
.header-nav > ul {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: auto;
  height: 100%;
  max-width: calc(100% - 420px);
  margin: 0;
  padding-left: 0;
  pointer-events: auto;
}
.header-nav > ul > li {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
}
.header-nav > ul > li > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 0.65rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-sub);
  border-radius: var(--r-sm);
  border-bottom: 0;
  line-height: 1;
  transition: background var(--t), color var(--t);
  white-space: nowrap;
}
.header-nav > ul > li > a:hover,
.header-nav > ul > li.active > a {
  background: var(--bg-soft);
  color: var(--primary);
}

/* Dropdown */
.header-nav .has-dropdown { position: relative; }
.header-nav .has-dropdown > a::after {
  content: '';
  display: inline-block;
  width: 5px; height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  margin-left: var(--sp-2);
  vertical-align: middle;
}
.header-nav .dropdown-menu {
  position: absolute;
  top: calc(100% - 1px);
  left: 0;
  min-width: 180px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-2) 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--t), visibility var(--t), transform var(--t);
  z-index: 200;
}
.header-nav .dropdown-menu::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -8px;
  height: 8px;
}
.header-nav .has-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.header-nav .dropdown-menu a {
  display: block;
  padding: var(--sp-2) var(--sp-4);
  font-size: 0.9rem;
  color: var(--text-sub);
  border-bottom: 0;
  line-height: 1.5;
  transition: background var(--t);
}
.header-nav .dropdown-menu a:hover { background: var(--bg-soft); color: var(--primary); }

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 0.625rem;
  flex: 0 0 180px;
  min-width: 180px;
  position: relative;
  z-index: 2;
}
.header-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  transition: all var(--t);
  background: none;
  border: none;
  cursor: pointer;
}
.header-icon-btn:hover { background: var(--bg-soft); color: var(--primary); }
.header-icon-btn i { font-size: 1rem; }

.header-auth-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  margin: 0;
  padding-top: 0.375rem;
  padding-bottom: 0.375rem;
  line-height: 1.2;
}

/* 일부 페이지의 `body.xxx a { border-bottom: 0 }`(main.css 링크 밑줄 제거용) 규칙이
   헤더 버튼의 아래 테두리까지 지워 버튼이 잘려 보이는 문제를 막는다. */
#site-header .header-auth-link.btn-outline {
  border-bottom-width: 2px;
  border-bottom-style: solid;
  border-bottom-color: var(--primary);
}
#site-header .header-auth-link.btn-primary {
  border-bottom-width: 2px;
  border-bottom-style: solid;
  border-bottom-color: transparent;
}

.theme-switcher {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(39, 73, 68, 0.18);
  border-radius: var(--r-sm);
  background: rgba(243, 248, 247, 0.72);
  color: var(--primary-dark);
}

.theme-switcher::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary-dark);
  box-shadow: 0 0 0 3px rgba(39, 73, 68, 0.1);
}

.theme-switcher-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: currentColor;
}

.theme-switcher-select {
  height: 28px;
  min-width: 78px;
  padding: 0 22px 0 0;
  border: 0;
  background:
    linear-gradient(45deg, transparent 50%, currentColor 50%) right 7px center / 5px 5px no-repeat,
    linear-gradient(135deg, currentColor 50%, transparent 50%) right 2px center / 5px 5px no-repeat;
  color: var(--text-sub);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.theme-switcher-select:focus {
  outline: none;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 36px; height: 36px;
  cursor: pointer;
  border: none;
  background: none;
  border-radius: var(--r-sm);
  gap: 5px;
  padding: 4px;
  margin: 0;
}
.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s ease;
}
.hamburger.is-active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.is-active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.is-active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile Menu */
#mobile-menu {
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0; bottom: 0;
  background: var(--bg);
  z-index: 999;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  padding: var(--sp-4) var(--sp-6);
  padding-bottom: calc(var(--sp-16) + env(safe-area-inset-bottom, 0px));
  -webkit-overflow-scrolling: touch;
}
#mobile-menu.is-open { transform: translateX(0); }

.mobile-nav {
  margin: 0 0 var(--sp-6) 0;
  padding-left: 0;
  list-style: none;
}
.mobile-nav li {
  border-bottom: 1px solid var(--border);
}
.mobile-nav li:last-child { border-bottom: none; }
.mobile-nav li > a,
.mobile-nav-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-3);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  background: none;
  border: none;
  border-radius: var(--r-md);
  box-shadow: none;
  width: 100%;
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.4;
  appearance: none;
  -webkit-appearance: none;
  transition: color var(--t), background var(--t);
}
.mobile-nav li > a:hover,
.mobile-nav li.active > a,
.mobile-nav-toggle:hover {
  color: var(--primary);
  background: var(--bg-soft);
}
.mobile-nav li > a:focus,
.mobile-nav-toggle:focus { outline: none; }
.mobile-nav li > a:focus-visible,
.mobile-nav-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}
.mobile-nav-toggle span {
  display: block;
  flex: 1;
  font: inherit;
  letter-spacing: 0;
  text-transform: none;
}
.mobile-nav-toggle i {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform var(--t), color var(--t);
}
.mobile-nav-toggle.is-open {
  color: var(--primary);
}
.mobile-nav-toggle.is-open i {
  transform: rotate(180deg);
  color: var(--primary);
}

/* Mobile submenu — animated accordion card */
.mobile-sub-menu {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  background: var(--bg-soft);
  border-radius: var(--r-md);
  margin: 0;
  padding: 0 var(--sp-2);
  transition: max-height 0.3s ease, opacity 0.25s ease,
              margin 0.3s ease, padding 0.3s ease;
}
.mobile-sub-menu.is-open {
  max-height: 460px;
  opacity: 1;
  margin: 0 0 var(--sp-3);
  padding: var(--sp-2);
}
.mobile-sub-menu a {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  margin-bottom: 2px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-sub);
  border-radius: var(--r-sm);
  transition: background var(--t), color var(--t);
}
.mobile-sub-menu a:last-child { margin-bottom: 0; }
.mobile-sub-menu a::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border-mid);
  flex-shrink: 0;
  transition: background var(--t);
}
.mobile-sub-menu a:hover {
  background: var(--bg-mid);
  color: var(--primary);
}
.mobile-sub-menu a:hover::before { background: var(--primary); }
.mobile-menu-actions { display: flex; flex-direction: column; gap: var(--sp-3); }

/* =====================================================
   5. Footer
   ===================================================== */
#site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: var(--sp-12) 0 0;
}
.footer-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-6) var(--sp-10);
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr));
  gap: var(--sp-10);
}
.footer-brand .footer-logo {
  font-size: 1.5rem;
  font-weight: 900;
  color: #fff;
  display: block;
  margin-bottom: var(--sp-4);
}
.footer-brand p {
  font-size: 0.875rem;
  color: var(--footer-text);
  line-height: 1.75;
  margin-bottom: var(--sp-4);
}
.footer-brand .biz-info {
  font-size: 0.8rem;
  color: var(--footer-muted);
  line-height: 1.9;
}
.footer-col h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: var(--sp-4);
}
.footer-col ul li { margin-bottom: var(--sp-2); }
.footer-col ul li a {
  font-size: 0.875rem;
  color: var(--footer-text);
  transition: color var(--t);
}
.footer-col ul li a:hover { color: #fff; }
.footer-social { display: flex; gap: var(--sp-3); margin-top: var(--sp-4); }
.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.08);
  border-radius: var(--r-sm);
  color: var(--footer-text);
  font-size: 0.875rem;
  transition: all var(--t);
}
.footer-social a:hover { background: var(--primary); color: #fff; }

.footer-bottom {
  border-top: 1px solid var(--footer-border);
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--sp-4) var(--sp-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-3);
}
.footer-bottom p { font-size: 0.8125rem; color: var(--footer-muted); }
.footer-bottom-links { display: flex; gap: var(--sp-4); }
.footer-bottom-links a {
  font-size: 0.8125rem;
  color: var(--footer-text);
  transition: color var(--t);
}
.footer-bottom-links a:hover { color: #fff; }

/* Header/footer responsive rules live here so they are parsed before page-specific blocks. */
@media (max-width: 1100px) {
  .header-inner {
    width: 100%;
    padding: 0 var(--sp-5);
  }
  .header-logo,
  .header-actions {
    flex-basis: auto;
    min-width: 0;
    transform: none;
  }
  .header-nav { display: none; }
  .hamburger { display: flex; }
}

@media (max-width: 1023px) {
  .footer-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: var(--sp-8);
  }
}

@media (max-width: 767px) {
  :root { --nav-h: 56px; }

  .header-inner { padding: 0 var(--sp-4); }
  .header-logo a { font-size: 1.2rem; }
  .theme-switcher { display: none; }
  .header-auth-link { display: none; }
  #mobile-menu {
    padding: var(--sp-4) var(--sp-4);
    padding-bottom: calc(var(--sp-16) + env(safe-area-inset-bottom, 0px));
  }

  #site-footer { padding-top: var(--sp-8); }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-7);
    padding: 0 var(--sp-4) var(--sp-8);
  }
  .footer-brand p,
  .footer-brand .biz-info,
  .footer-col ul li a {
    overflow-wrap: anywhere;
    word-break: keep-all;
  }
  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
    padding: var(--sp-4);
    text-align: left;
    gap: var(--sp-3);
  }
  .footer-bottom-links {
    flex-wrap: wrap;
    gap: var(--sp-2) var(--sp-4);
  }
}

/* =====================================================
  Template-like Home (main.jsp only)
   ===================================================== */
.template-home.page-main {
  padding-bottom: 0;
  background: #ffffff;
}
.template-home .template-wrap {
  width: 90%;
  max-width: 1400px;
  margin: 0 auto;
}
.template-home .main-visual {
  box-shadow: 0 3px 13px rgba(0, 0, 0, 0.06);
}
.template-home .main-visual-link {
  display: block;
}
.template-home .main-visual-link img {
  width: 100%;
  display: block;
}
.template-home .main-category {
  background: #f4f6f5;
  padding: 90px 0 50px;
}
.template-home .main-category ul {
  display: flex;
  gap: 14px;
}
.template-home .main-category ul li {
  flex: 0 0 calc((100% - 14px * 5) / 6);
}
.template-home .main-category ul li img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 20px;
}
.template-home .main-category ul li p {
  width: 100%;
  height: 55px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  font-size: 24px;
  color: #3f3530;
  font-weight: 500;
}
.template-home .main-medical {
  padding: 80px 0 130px;
}
.template-home .main-medical .medical-tit {
  margin-bottom: 50px;
}
.template-home .main-medical .medical-tit .line {
  width: 30px;
  height: 5px;
  background: #3f3530;
  margin-bottom: 20px;
  display: block;
}
.template-home .main-medical .medical-tit p {
  color: #3f3530;
  font-size: 50px;
  font-weight: 600;
}
.template-home .main-medical .medical-list {
  display: flex;
  gap: 57px;
}
.template-home .main-medical .medical-list li {
  flex: 0 0 calc((100% - 57px * 2) / 3);
}
.template-home .main-medical .medical-list a {
  color: inherit;
}
.template-home .main-medical .img-wrap {
  display: block;
  width: 100%;
  aspect-ratio: 429 / 382;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 25px;
}
.template-home .main-medical .img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.template-home .main-medical .medical-name {
  font-size: 26px;
  color: #2c2c2c;
  font-weight: 600;
  margin-bottom: 15px;
  line-height: 1.4;
}
.template-home .main-medical .percent {
  display: block;
  margin-bottom: 15px;
  width: 100%;
  height: 16px;
  border-radius: 8px;
  background: #f1f1f1;
  overflow: hidden;
}
.template-home .main-medical .percent .active {
  height: 100%;
  background: #3f3530;
  display: block;
}
.template-home .main-medical .medical-price {
  font-size: 22px;
  color: #3f3530;
}

@media screen and (max-width: 980px) {
  .template-home .main-category ul {
    gap: 20px 10px;
    flex-wrap: wrap;
  }
  .template-home .main-category ul li {
    flex: 0 0 calc((100% - 10px * 2) / 3);
  }
  .template-home .main-category ul li p {
    font-size: 18px;
    height: 48px;
  }
  .template-home .main-medical .medical-tit p {
    font-size: 42px;
  }
  .template-home .main-medical .medical-list {
    gap: 24px;
  }
  .template-home .main-medical .medical-list li {
    flex: 0 0 calc((100% - 24px * 2) / 3);
  }
  .template-home .main-medical .medical-name {
    font-size: 20px;
  }
  .template-home .main-medical .medical-price {
    font-size: 18px;
  }
}
@media screen and (max-width: 720px) {
  .template-home .main-category {
    padding: 40px 0;
  }
  .template-home .main-category ul li {
    flex: 0 0 calc((100% - 10px) / 2);
  }
  .template-home .main-category ul li p {
    font-size: 14px;
    height: 40px;
  }
  .template-home .main-medical {
    padding: 50px 0 70px;
  }
  .template-home .main-medical .medical-tit p {
    font-size: 34px;
  }
  .template-home .main-medical .medical-list {
    flex-wrap: wrap;
  }
  .template-home .main-medical .medical-list li {
    flex: 0 0 100%;
  }
}

/* =====================================================
   6. Buttons
   ===================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0.625rem 1.375rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--r-md);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--t);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
  -webkit-appearance: none;
}
.btn:hover { text-decoration: none; }

.btn-primary  { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }

.btn-outline  { background: #fff; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }

.btn-dark     { background: var(--text); color: #fff; border-color: var(--text); }
.btn-dark:hover { background: #374151; border-color: #374151; color: #fff; }

.btn-light    { background: var(--bg-soft); color: var(--text); border-color: var(--border); }
.btn-light:hover { background: var(--bg-mid); }

.btn-danger   { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #DC2626; color: #fff; }

.btn-white    { background: #fff; color: var(--primary); border-color: #fff; }
.btn-white:hover { background: var(--primary-light); }

.btn-sm  { padding: 0.375rem 0.875rem; font-size: 0.8125rem; border-radius: var(--r-sm); }
.btn-lg  { padding: 0.875rem 2rem; font-size: 1.0625rem; border-radius: var(--r-lg); }
.btn-xl  { padding: 1rem 2.5rem; font-size: 1.125rem; border-radius: var(--r-lg); }
.btn-full { width: 100%; }
.btn:disabled, .btn[disabled] { opacity: 0.55; cursor: not-allowed; pointer-events: none; }

/* =====================================================
   7. Campaign Cards
   ===================================================== */
.campaign-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-6);
}

.campaign-card {
  background: var(--bg);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: transform var(--t), box-shadow var(--t);
  display: flex;
  flex-direction: column;
}
.campaign-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.card-img-wrap {
  position: relative;
  overflow: hidden;
  padding-top: 56.25%;
}
.card-img-wrap img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.campaign-card:hover .card-img-wrap img { transform: scale(1.04); }

.card-category-badge {
  position: absolute;
  top: var(--sp-3);
  left: var(--sp-3);
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
}
.cat-medical    { background: var(--cat-medical); }
.cat-emergency  { background: var(--cat-emergency); }
.cat-education  { background: var(--cat-education); }
.cat-animal     { background: var(--cat-animal); }
.cat-family     { background: var(--cat-family); }
.cat-volunteer  { background: var(--cat-volunteer); }
.cat-default    { background: var(--text-muted); }

.card-body {
  padding: var(--sp-5);
  flex: 1;
  display: flex;
  flex-direction: column;
}
.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--sp-2);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-title a { color: inherit; }
.card-title a:hover { color: var(--primary); }

.card-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: var(--sp-4);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.card-progress { margin-bottom: var(--sp-3); }
.progress-track {
  height: 6px;
  background: var(--bg-mid);
  border-radius: var(--r-full);
  overflow: hidden;
  margin-bottom: var(--sp-2);
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: var(--r-full);
  transition: width 0.8s ease;
}
.card-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
}
.card-raised { font-weight: 700; color: var(--text); }
.card-pct    { font-size: 0.8rem; font-weight: 600; color: var(--secondary); }
.card-dday   { font-size: 0.8rem; color: var(--text-faint); }

/* =====================================================
   8. Page Banner
   ===================================================== */
.page-banner {
  background: linear-gradient(135deg, #8f4f3f 0%, #f6b26b 100%);
  padding: var(--sp-12) 0;
  text-align: center;
  color: #fff;
  margin-bottom: var(--sp-10);
}
.page-main { padding-bottom: var(--sp-16); }
.page-banner h1 { font-size: 2rem; font-weight: 800; color: #fff; margin-bottom: var(--sp-3); }
.page-banner p  { font-size: 1.0625rem; color: rgba(255,255,255,0.82); max-width: 540px; margin: 0 auto; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.875rem;
  color: rgba(255,255,255,0.65);
  justify-content: center;
  margin-top: var(--sp-3);
}
.breadcrumb a   { color: rgba(255,255,255,0.65); }
.breadcrumb a:hover { color: #fff; }
.breadcrumb-sep { opacity: 0.45; }

/* =====================================================
   9. Section Headers
   ===================================================== */
.sec-header {
  text-align: center;
  margin-bottom: var(--sp-10);
}
.sec-header h2 { font-size: 1.875rem; font-weight: 800; margin-bottom: var(--sp-3); }
.sec-header p  { color: var(--text-muted); max-width: 500px; margin: 0 auto; }
.sec-bar {
  width: 44px; height: 4px;
  background: var(--primary);
  border-radius: var(--r-full);
  margin: var(--sp-3) auto 0;
}

/* =====================================================
   10. Forms
   ===================================================== */
.form-group { margin-bottom: var(--sp-5); }
.form-label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--sp-2);
}
.form-label .req { color: var(--danger); margin-left: 2px; }

.form-control {
  display: block;
  width: 100%;
  padding: 0.6875rem 1rem;
  font-size: 0.9375rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border-mid);
  border-radius: var(--r-md);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.form-control::placeholder { color: var(--text-faint); }
textarea.form-control { resize: vertical; min-height: 120px; line-height: 1.65; }
select.form-control {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236B7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  padding-right: 2.5rem;
}
.form-help  { font-size: 0.8125rem; color: var(--text-faint); margin-top: var(--sp-2); }
.form-error { font-size: 0.8125rem; color: var(--danger); margin-top: var(--sp-2); }

.form-inline { display: flex; gap: var(--sp-3); align-items: flex-start; }
.form-inline .form-control { flex: 1; }
.form-inline .btn { flex-shrink: 0; height: 46px; }

/* Status badges inside form */
.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--r-full);
  font-size: 0.75rem;
  font-weight: 600;
}
.status-ok { background: var(--primary-light); color: var(--primary-dark); }
.status-no { background: #FEF2F2; color: #991B1B; }

/* Form card wrapper */
.form-card {
  background: var(--bg);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-10) var(--sp-8);
  max-width: 480px;
  margin: var(--sp-10) auto;
}

/* =====================================================
   11. Tables
   ===================================================== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
.data-table thead tr {
  background: var(--bg-soft);
  border-bottom: 2px solid var(--border);
}
.data-table th {
  padding: var(--sp-3) var(--sp-4);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: left;
  white-space: nowrap;
}
.data-table th.text-center,
.data-table td.text-center { text-align: center; }

.data-table td {
  padding: var(--sp-4);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.data-table tbody tr:hover { background: var(--bg-soft); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table a { color: var(--text); font-weight: 500; }
.data-table a:hover { color: var(--primary); }

/* Table wrapper for scroll on mobile */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); }

/* =====================================================
   12. Pagination
   ===================================================== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
  padding: var(--sp-8) 0;
}
.pagination a,
.pagination span,
.pagination strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  box-sizing: border-box;
  min-height: 36px;
  padding: 0 10px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  text-decoration: none;
  transition: all var(--t);
}
.pagination .page-num {
  width: 36px;
  min-width: 36px;
  padding: 0;
}
.pagination .page-nav {
  min-width: 4.75rem;
  padding: 0 12px;
}
.pagination a:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.pagination strong.page-num,
.pagination .current {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.pagination .page-nav.disabled,
.pagination span.page-nav:not(.page-num) {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
.pagination .disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* =====================================================
   13. Alerts
   ===================================================== */
.alert {
  padding: var(--sp-4);
  border-radius: var(--r-md);
  font-size: 0.9375rem;
  margin-bottom: var(--sp-4);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
}
.alert i { margin-top: 2px; flex-shrink: 0; }
.alert-success { background: var(--primary-light); color: var(--primary-dark); border: 1px solid var(--border-mid); }
.alert-error   { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.alert-info    { background: var(--primary-light); color: var(--primary-dark); border: 1px solid var(--border-mid); }
.alert-warning { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }

/* =====================================================
   14. Badges
   ===================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-blue    { background: var(--primary-light); color: var(--primary); }
.badge-green   { background: var(--primary-light); color: var(--primary-dark); }
.badge-red     { background: #FEF2F2; color: #991B1B; }
.badge-yellow  { background: #FFFBEB; color: #92400E; }
.badge-gray    { background: var(--bg-mid); color: var(--text-muted); }
.badge-success { background: var(--primary-light); color: var(--primary-dark); }
.badge-danger  { background: #FEF2F2; color: #991B1B; }
.badge-warning { background: #FFFBEB; color: #92400E; }
.badge-info    { background: var(--primary-light); color: var(--primary); }

/* =====================================================
   15. Hero Section (Home)
   ===================================================== */
.hero {
  background: linear-gradient(135deg, var(--bg-darker) 0%, var(--primary-dark) 58%, var(--accent) 100%);
  padding: var(--sp-20) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.04) 0%, transparent 70%);
  animation: heroShimmer 8s ease-in-out infinite alternate;
}
@keyframes heroShimmer {
  from { transform: scale(0.8); }
  to   { transform: scale(1.2); }
}
.hero-content { position: relative; z-index: 1; }
.hero h1 {
  font-size: 3rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.2;
  margin-bottom: var(--sp-5);
  letter-spacing: -0.5px;
}
.hero p {
  font-size: 1.125rem;
  color: rgba(255,255,255,0.82);
  max-width: 540px;
  margin: 0 auto var(--sp-8);
  line-height: 1.75;
}
.hero-btns { display: flex; gap: var(--sp-4); justify-content: center; flex-wrap: wrap; }

.hero-stats {
  display: flex;
  justify-content: center;
  gap: var(--sp-12);
  margin-top: var(--sp-12);
  padding-top: var(--sp-8);
  border-top: 1px solid rgba(255,255,255,0.15);
}
.hero-stat .num   { font-size: 2rem; font-weight: 800; color: #fff; }
.hero-stat .label { font-size: 0.875rem; color: rgba(255,255,255,0.68); margin-top: var(--sp-1); }

/* =====================================================
   16. Category Tabs
   ===================================================== */
.cat-tabs { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-8); }
.cat-tab {
  padding: var(--sp-2) var(--sp-5);
  border-radius: var(--r-full);
  font-size: 0.875rem;
  font-weight: 600;
  border: 1.5px solid var(--border-mid);
  color: var(--text-muted);
  cursor: pointer;
  background: #fff;
  transition: all var(--t);
  text-decoration: none;
}
.cat-tab:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.cat-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* =====================================================
   17. Mypage Layout
   ===================================================== */
.mypage-layout {
  display: flex;
  gap: 0;
  min-height: calc(100vh - var(--nav-h));
  align-items: flex-start;
}
.mypage-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg);
  border-right: 1px solid var(--border);
  padding: var(--sp-8) 0;
  min-height: calc(100vh - var(--nav-h));
  position: sticky;
  top: var(--nav-h);
}
.sidebar-user-info {
  padding: 0 var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-4);
}
.sidebar-avatar {
  width: 48px; height: 48px;
  border-radius: var(--r-full);
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--primary);
  margin-bottom: var(--sp-3);
}
.sidebar-username { font-size: 1rem; font-weight: 600; color: var(--text); }
.sidebar-email    { font-size: 0.8125rem; color: var(--text-muted); margin-top: 2px; }

.sidebar-menu-group { padding: 0 var(--sp-3); margin-bottom: var(--sp-4); }
.sidebar-menu-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0 var(--sp-3) var(--sp-2);
}
.sidebar-menu-group a {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0.625rem var(--sp-3);
  border-radius: var(--r-sm);
  font-size: 0.9375rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: all var(--t);
}
.sidebar-menu-group a i { width: 16px; text-align: center; font-size: 0.9rem; }
.sidebar-menu-group a:hover { background: var(--bg-soft); color: var(--primary); }
.sidebar-menu-group a.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }

.mypage-content { flex: 1; padding: var(--sp-8) var(--sp-10); min-width: 0; }
.content-head {
  margin-bottom: var(--sp-8);
  padding-bottom: var(--sp-6);
  border-bottom: 1px solid var(--border);
}
.content-head h1 { font-size: 1.5rem; font-weight: 700; }
.content-head p  { font-size: 0.9375rem; color: var(--text-muted); margin-top: var(--sp-2); }

/* =====================================================
   18. Admin Layout
   ===================================================== */
.admin-layout { display: flex; min-height: calc(100vh - var(--nav-h)); }
.admin-sidebar-nav {
  width: var(--admin-side-w);
  flex-shrink: 0;
  background: var(--bg-darker);
  padding: var(--sp-6) 0;
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
}
.admin-menu-section { padding: 0 var(--sp-4); margin-bottom: var(--sp-6); }
.admin-menu-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #4B5563;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0 var(--sp-2) var(--sp-2);
}
.admin-sidebar-nav a {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  font-size: 0.875rem;
  color: #9CA3AF;
  transition: all var(--t);
}
.admin-sidebar-nav a i { width: 16px; text-align: center; }
.admin-sidebar-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.admin-sidebar-nav a.active { background: rgba(37,99,235,0.2); color: #ffd0c2; }

.admin-body { flex: 1; padding: var(--sp-8); min-width: 0; background: var(--bg-soft); }
.admin-body .content-head { margin-bottom: var(--sp-6); }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-5); margin-bottom: var(--sp-8); }
.stat-card {
  background: var(--bg);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  box-shadow: var(--shadow-sm);
}
.stat-card .stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  background: var(--primary-light);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.125rem;
  margin-bottom: var(--sp-4);
}
.stat-card .stat-label { font-size: 0.875rem; color: var(--text-muted); margin-bottom: var(--sp-2); }
.stat-card .stat-value { font-size: 1.75rem; font-weight: 700; color: var(--text); }
.stat-card .stat-body { flex: 1; }
.stat-card .stat-desc { font-size: 0.8125rem; color: var(--text-muted); margin-top: var(--sp-1); }
.stat-card { display: flex; align-items: center; gap: var(--sp-4); }
.stat-card .stat-icon { margin-bottom: 0; flex-shrink: 0; }
.admin-sidebar-title { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(255,255,255,0.5); padding: var(--sp-4) var(--sp-4) var(--sp-2); }

/* =====================================================
   19. Board (Notice/Inquiry)
   ===================================================== */
.board-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--sp-8) var(--sp-6);
}
.board-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-6);
}
.board-head h2 { font-size: 1.5rem; font-weight: 700; }

.board-card {
  background: var(--bg);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: var(--sp-6);
}
.board-view-header {
  padding: var(--sp-6) var(--sp-8);
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}
.board-view-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--sp-3);
}
.board-view-meta {
  display: flex;
  gap: var(--sp-5);
  font-size: 0.875rem;
  color: var(--text-muted);
}
.board-view-body {
  padding: var(--sp-8);
  line-height: 1.9;
  font-size: 0.9375rem;
  min-height: 240px;
}

.board-nav-item {
  display: flex;
  align-items: center;
  padding: var(--sp-4) var(--sp-6);
  border-bottom: 1px solid var(--border);
  gap: var(--sp-4);
  font-size: 0.9375rem;
}
.board-nav-item:last-child { border-bottom: none; }
.board-nav-label { font-size: 0.8125rem; font-weight: 600; color: var(--text-muted); width: 40px; flex-shrink: 0; }
.board-nav-item a { color: var(--text); }
.board-nav-item a:hover { color: var(--primary); }

/* =====================================================
   20. Campaign Detail
   ===================================================== */
.campaign-detail-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--sp-10) var(--sp-6);
}
.campaign-detail-layout {
  display: flex;
  gap: var(--sp-8);
  align-items: flex-start;
}
.campaign-detail-main { flex: 2; min-width: 0; }
.campaign-detail-aside {
  flex: 0 0 320px;
  position: sticky;
  top: calc(var(--nav-h) + var(--sp-6));
}
.campaign-detail-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: var(--sp-3);
  line-height: 1.3;
}
.campaign-detail-sub { font-size: 1rem; color: var(--text-muted); margin-bottom: var(--sp-6); }
.campaign-detail-img {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
  border-radius: var(--r-lg);
  margin-bottom: var(--sp-6);
}
.campaign-detail-body { font-size: 0.9375rem; color: var(--text-sub); line-height: 1.9; }

/* Donate sidebar card */
.donate-sidebar-card {
  background: var(--bg);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: var(--sp-6);
}
.donate-sidebar-card h3 { font-size: 1.0625rem; font-weight: 700; margin-bottom: var(--sp-5); }
.raised-amount { font-size: 1.75rem; font-weight: 800; color: var(--primary); margin-bottom: var(--sp-2); }
.goal-label    { font-size: 0.875rem; color: var(--text-muted); margin-bottom: var(--sp-4); }
.donor-stats   { display: flex; gap: var(--sp-6); margin-top: var(--sp-4); margin-bottom: var(--sp-5); }
.donor-stat .ds-val   { font-size: 1.125rem; font-weight: 700; color: var(--text); }
.donor-stat .ds-label { font-size: 0.8125rem; color: var(--text-muted); margin-top: 2px; }
.sidebar-share-links  { display: flex; gap: var(--sp-3); margin-top: var(--sp-4); }

/* Comments */
.comment-section {
  margin-top: var(--sp-10);
  padding-top: var(--sp-8);
  border-top: 1px solid var(--border);
}
.comment-section h3 { font-size: 1.125rem; font-weight: 700; margin-bottom: var(--sp-6); }
.comment-form {
  background: var(--bg-soft);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  margin-bottom: var(--sp-6);
}
.comment-item { padding: var(--sp-5) 0; border-bottom: 1px solid var(--border); }
.comment-item:last-child { border-bottom: none; }
.comment-header { display: flex; justify-content: space-between; margin-bottom: var(--sp-2); }
.comment-author { font-weight: 600; font-size: 0.9375rem; }
.comment-date   { font-size: 0.8125rem; color: var(--text-faint); }
.comment-body   { font-size: 0.9375rem; color: var(--text-muted); line-height: 1.7; }

/* Mobile donate bar */
.mobile-donate-bar {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  padding: var(--sp-3) var(--sp-4);
  background: #fff;
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
  gap: var(--sp-3);
  z-index: 100;
}

/* =====================================================
   21. Donate Flow
   ===================================================== */
.donate-page {
  max-width: 560px;
  margin: var(--sp-10) auto;
  padding: 0 var(--sp-6);
}
.donate-brief-card {
  background: var(--bg-soft);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  display: flex;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
  align-items: center;
}
.donate-brief-card img {
  width: 80px; height: 60px;
  object-fit: cover;
  border-radius: var(--r-md);
  flex-shrink: 0;
}
.donate-brief-info h3 { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: var(--sp-1); }
.donate-brief-info p  { font-size: 0.8125rem; color: var(--text-muted); }
.amount-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.amount-btn {
  padding: var(--sp-3);
  border: 1.5px solid var(--border-mid);
  border-radius: var(--r-md);
  font-size: 0.9375rem;
  font-weight: 600;
  background: #fff;
  cursor: pointer;
  text-align: center;
  transition: all var(--t);
}
.amount-btn:hover, .amount-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}
.amount-input-row { display: flex; gap: var(--sp-3); align-items: center; }
.amount-input-row input { flex: 1; }
.amount-unit { font-weight: 700; color: var(--text); white-space: nowrap; }
.amount-helper { font-size: 0.875rem; color: var(--text-muted); margin-top: var(--sp-2); }
.donate-actions { display: flex; gap: var(--sp-3); margin-top: var(--sp-6); }
.donate-actions .btn { flex: 1; }

/* Success page */
.success-wrap { max-width: 520px; margin: var(--sp-12) auto; padding: 0 var(--sp-6); text-align: center; }
.success-icon {
  width: 80px; height: 80px;
  border-radius: var(--r-full);
  background: var(--primary-light);
  color: var(--secondary);
  font-size: 2rem;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto var(--sp-6);
}
.success-card {
  background: var(--bg);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-8);
}

/* Certificate */
.cert-card {
  max-width: 520px;
  margin: var(--sp-8) auto;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-10);
  text-align: center;
}
.cert-card .cert-title { font-size: 1.5rem; font-weight: 700; color: var(--primary); margin-bottom: var(--sp-8); }
.cert-field {
  display: flex;
  justify-content: space-between;
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9375rem;
}
.cert-field:last-child { border-bottom: none; }
.cert-lbl { color: var(--text-muted); font-weight: 500; }
.cert-val { color: var(--text); font-weight: 600; }

/* =====================================================
   22. Auth Pages (Login/Register)
   ===================================================== */
.auth-page {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-soft);
  padding: var(--sp-8) var(--sp-4);
}
.auth-card {
  background: var(--bg);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  padding: var(--sp-10) var(--sp-8);
  width: 100%;
  max-width: 440px;
}
.auth-logo  { display: block; text-align: center; font-size: 1.75rem; font-weight: 900; color: var(--primary); margin-bottom: var(--sp-2); }
.auth-title { text-align: center; font-size: 1.25rem; font-weight: 700; color: var(--text); margin-bottom: var(--sp-8); }
.auth-divider {
  display: flex; align-items: center; gap: var(--sp-4);
  margin: var(--sp-5) 0;
  color: var(--text-faint); font-size: 0.875rem;
}
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.social-login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border-mid);
  border-radius: var(--r-md);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
  background: #fff;
  cursor: pointer;
  transition: all var(--t);
  margin-bottom: var(--sp-3);
  text-decoration: none;
}
.social-login-btn:hover { border-color: var(--primary); background: var(--primary-light); }
.social-login-btn img  { width: 20px; height: 20px; object-fit: contain; }
.auth-footer { text-align: center; margin-top: var(--sp-5); font-size: 0.9375rem; color: var(--text-muted); }
.auth-footer a { color: var(--primary); font-weight: 600; }
.auth-links { display: flex; justify-content: center; gap: var(--sp-4); margin-top: var(--sp-4); font-size: 0.875rem; }
.auth-links a { color: var(--text-muted); }
.auth-links a:hover { color: var(--primary); }

/* =====================================================
   23. Story / Case Pages
   ===================================================== */
.story-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-6); }
.story-card {
  background: #fff;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all var(--t);
}
.story-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.story-img-wrap { position: relative; overflow: hidden; padding-top: 62%; }
.story-img-wrap img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.story-body { padding: var(--sp-5); }
.story-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--sp-3);
  line-height: 1.45;
}
.story-desc { font-size: 0.875rem; color: var(--text-muted); line-height: 1.65; }

/* =====================================================
   24. About / Info Pages
   ===================================================== */
.info-section { padding: var(--sp-16) 0; }
.step-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-8); }
.step-item { text-align: center; padding: var(--sp-6); }
.step-num {
  width: 48px; height: 48px;
  border-radius: var(--r-full);
  background: var(--primary);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto var(--sp-4);
}
.step-item h3 { font-size: 1rem; font-weight: 700; margin-bottom: var(--sp-3); }
.step-item p  { font-size: 0.875rem; color: var(--text-muted); line-height: 1.7; }

/* Feature box */
.feature-box {
  background: var(--bg);
  border-radius: var(--r-lg);
  padding: var(--sp-8);
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--primary);
  margin-bottom: var(--sp-6);
}
.feature-box h3 { font-size: 1.0625rem; font-weight: 700; margin-bottom: var(--sp-3); }
.feature-box p  { font-size: 0.9375rem; color: var(--text-muted); line-height: 1.75; }

/* =====================================================
   25. Rank / Leaderboard
   ===================================================== */
.rank-list { background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.rank-item {
  display: flex;
  align-items: center;
  padding: var(--sp-4) var(--sp-6);
  border-bottom: 1px solid var(--border);
  gap: var(--sp-4);
}
.rank-item:last-child { border-bottom: none; }
.rank-num {
  width: 32px; height: 32px;
  border-radius: var(--r-full);
  background: var(--bg-mid);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.rank-num.r1 { background: #FEF3C7; color: #92400E; }
.rank-num.r2 { background: #F3F4F6; color: #374151; }
.rank-num.r3 { background: #FEE2E2; color: #991B1B; }
.rank-info  { flex: 1; }
.rank-name  { font-weight: 600; font-size: 0.9375rem; }
.rank-desc  { font-size: 0.8125rem; color: var(--text-muted); margin-top: 2px; }
.rank-val   { font-size: 1rem; font-weight: 700; color: var(--primary); }

/* =====================================================
   26. Campaign Form
   ===================================================== */
.campaign-form-wrap {
  max-width: 800px;
  margin: var(--sp-8) auto;
  padding: 0 var(--sp-6);
}
.form-section-card {
  background: var(--bg);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-8);
  margin-bottom: var(--sp-6);
}
.form-section-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--sp-6);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--border);
}

/* =====================================================
   27. Terms / Static Pages
   ===================================================== */
.terms-layout {
  display: flex;
  gap: var(--sp-10);
  align-items: flex-start;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--sp-10) var(--sp-6);
}
.terms-toc {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--nav-h) + var(--sp-6));
  background: var(--bg-soft);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
}
.terms-toc h4 { font-size: 0.9375rem; font-weight: 700; margin-bottom: var(--sp-4); }
.terms-toc ul li { margin-bottom: var(--sp-2); }
.terms-toc ul li a { font-size: 0.875rem; color: var(--text-muted); }
.terms-toc ul li a:hover { color: var(--primary); }
.terms-body { flex: 1; min-width: 0; }
.terms-body h2 { font-size: 1.25rem; font-weight: 700; margin: var(--sp-8) 0 var(--sp-4); padding-top: var(--sp-6); border-top: 1px solid var(--border); }
.terms-body h2:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.terms-body p  { font-size: 0.9375rem; color: var(--text-sub); line-height: 1.85; margin-bottom: var(--sp-4); }
.terms-body ul { margin: var(--sp-4) 0; }
.terms-body ul li { font-size: 0.9375rem; color: var(--text-sub); line-height: 1.8; padding-left: var(--sp-4); position: relative; }
.terms-body ul li::before { content: '-'; position: absolute; left: 0; color: var(--primary); }
.terms-body ul ul { margin: var(--sp-2) 0; padding-left: var(--sp-4); }
.terms-body ul ul li::before { content: '-'; }
.terms-body a { color: var(--primary); }
.terms-body a:hover { text-decoration: underline; }

/* =====================================================
   28. Sections
   ===================================================== */
.section       { padding: var(--sp-16) 0; }
.section-sm    { padding: var(--sp-10) 0; }
.section-light { background: var(--bg-soft); }
.section-white { background: var(--bg); }
.section-dark  { background: var(--bg-darker); }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-dark p { color: rgba(255,255,255,0.68); }

hr.sep { border: none; height: 1px; background: var(--border); margin: var(--sp-6) 0; }

/* =====================================================
   AI Daily Recommendation Popup
   ===================================================== */
.ai-daily-popup {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-5);
  background: rgba(47, 39, 34, 0.38);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t);
}
.ai-daily-popup.is-visible {
  opacity: 1;
  pointer-events: auto;
}
.ai-daily-popup-panel {
  position: relative;
  width: min(480px, 100%);
  max-height: min(640px, calc(100vh - 40px));
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  padding: var(--sp-6);
  transform: translateY(12px);
  transition: transform var(--t);
}
.ai-daily-popup.is-visible .ai-daily-popup-panel {
  transform: translateY(0);
}
.ai-daily-close {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-sizing: border-box;
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
}
.ai-daily-kicker {
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 800;
  margin-bottom: var(--sp-2);
}
.ai-daily-popup h2 {
  max-width: calc(100% - 44px);
  margin-bottom: var(--sp-3);
  font-size: 1.2rem;
  line-height: 1.35;
}
.ai-daily-popup p {
  margin-bottom: var(--sp-4);
  font-size: 0.9rem;
  line-height: 1.6;
}
.ai-daily-list {
  display: grid;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}
.ai-daily-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: var(--sp-2);
  align-items: center;
  width: 100%;
  min-height: 70px;
  padding: var(--sp-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--text);
  text-align: left;
  white-space: normal;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}
.ai-daily-card:hover {
  border-color: var(--primary);
  background: var(--bg-soft);
}
.ai-daily-card img {
  grid-row: span 2;
  width: 58px;
  height: 52px;
  object-fit: cover;
  border-radius: var(--r-sm);
}
.ai-daily-card-title {
  display: block;
  min-width: 0;
  font-weight: 800;
  font-size: 0.92rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.ai-daily-card-reason {
  display: block;
  min-width: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.ai-daily-actions {
  display: flex;
  gap: var(--sp-2);
  justify-content: flex-end;
}
.ai-daily-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: auto;
  min-width: 88px;
  height: 34px;
  min-height: 0;
  padding: 0 16px;
  border-radius: var(--r-sm);
  font-size: 0.86rem;
  line-height: 1;
}

@media (max-width: 560px) {
  .ai-daily-popup {
    align-items: center;
    padding: var(--sp-3);
  }
  .ai-daily-popup-panel {
    width: min(100%, 380px);
    max-height: calc(100vh - 32px);
    padding: var(--sp-6) var(--sp-4);
  }
  .ai-daily-popup h2 {
    font-size: 1.1rem;
  }
  .ai-daily-actions {
    justify-content: stretch;
  }
  .ai-daily-actions .btn {
    flex: 1 1 0;
    width: auto;
    min-height: 44px;
    padding: 0 12px;
    white-space: nowrap;
  }
}

/* =====================================================
   29. Utility
   ===================================================== */
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-primary { color: var(--primary) !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-danger  { color: var(--danger) !important; }
.text-success { color: var(--secondary) !important; }
.fw-bold   { font-weight: 700; }
.fw-medium { font-weight: 500; }
.mt-2 { margin-top: var(--sp-2); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); }
.mt-10 { margin-top: var(--sp-10); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-8 { margin-bottom: var(--sp-8); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.mb-8 { margin-bottom: var(--sp-8); }
.d-flex        { display: flex; }
.align-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.sr-only { position: absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

/* =====================================================
   30. Responsive
   ===================================================== */
/* 1280px+ : 4-col grid */
@media (min-width: 1280px) {
  .campaign-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Nav breakpoint */
@media (max-width: 1100px) {
  .header-inner {
    width: 100%;
    padding: 0 var(--sp-5);
  }
  .header-logo,
  .header-actions {
    flex-basis: auto;
    min-width: 0;
    transform: none;
  }
  .header-nav { display: none; }
  .hamburger   { display: flex; }
}

/* Tablet (768-1023) */
@media (max-width: 1023px) {
  .campaign-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid   { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--sp-8); }

  .campaign-detail-layout { flex-direction: column; }
  .campaign-detail-aside  { flex: none; width: 100%; position: static; }

  .mypage-sidebar { width: 200px; }
  .mypage-content { padding: var(--sp-6); }

  .terms-toc { display: none; }
  .terms-layout { padding: var(--sp-6); }

  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .step-grid { grid-template-columns: 1fr 1fr; }
  .story-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile (max-767) */
@media (max-width: 767px) {
  :root { --nav-h: 56px; }
  .container { padding: 0 var(--sp-4); }

  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.375rem; }

  .campaign-grid { grid-template-columns: 1fr; gap: var(--sp-4); }
  .hero { padding: var(--sp-12) 0; }
  .hero h1 { font-size: 2rem; }
  .hero-stats { gap: var(--sp-8); flex-wrap: wrap; }

  .page-banner { padding: var(--sp-8) 0; }
  .page-banner h1 { font-size: 1.5rem; }

  .header-inner { padding: 0 var(--sp-4); }
  .header-logo a { font-size: 1.2rem; }
  .theme-switcher { display: none; }
  .header-auth-link { display: none; }
  #mobile-menu {
    padding: var(--sp-4) var(--sp-4);
    padding-bottom: calc(var(--sp-16) + env(safe-area-inset-bottom, 0px));
  }

  #site-footer { padding-top: var(--sp-8); }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-7);
    padding: 0 var(--sp-4) var(--sp-8);
  }
  .footer-brand p,
  .footer-brand .biz-info,
  .footer-col ul li a {
    overflow-wrap: anywhere;
    word-break: keep-all;
  }
  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
    padding: var(--sp-4);
    text-align: left;
    gap: var(--sp-3);
  }
  .footer-bottom-links {
    flex-wrap: wrap;
    gap: var(--sp-2) var(--sp-4);
  }

  /* Mypage stack */
  .mypage-layout { flex-direction: column; }
  .mypage-sidebar {
    width: 100%; position: static;
    min-height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: var(--sp-4) 0;
  }
  .mypage-content { padding: var(--sp-5) var(--sp-4); }

  /* Admin stack */
  .admin-layout { flex-direction: column; }
  .admin-sidebar-nav { width: 100%; height: auto; position: static; }
  .admin-body { padding: var(--sp-5) var(--sp-4); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }

  /* Step / story */
  .step-grid  { grid-template-columns: 1fr; }
  .story-grid { grid-template-columns: 1fr; }

  /* Amount presets */
  .amount-presets { grid-template-columns: repeat(2, 1fr); }

  /* Auth */
  .auth-card { padding: var(--sp-6) var(--sp-5); }

  /* Campaign form */
  .campaign-form-wrap { padding: 0 var(--sp-4); }
  .form-section-card  { padding: var(--sp-5); }

  /* Board */
  .board-view-header { padding: var(--sp-5); }
  .board-view-body   { padding: var(--sp-5); }

  /* Table responsive */
  .data-table thead { display: none; }
  .data-table tbody tr {
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    margin-bottom: var(--sp-3);
    padding: var(--sp-4);
  }
  .data-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: var(--sp-2) 0;
    border-bottom: none;
    gap: var(--sp-2);
  }
  .data-table tbody td::before {
    content: attr(data-label);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    flex-shrink: 0;
    min-width: 80px;
  }

  /* Mobile donate bar */
  .mobile-donate-bar { display: flex; }
}

/* Print */
@media print {
  #site-header, #site-footer, .mobile-donate-bar { display: none !important; }
  body { padding-top: 0; padding-bottom: 0; }
}
