:root{
  /* 전문성과 따뜻함의 조화 */
  --research-navy:#374151;
  --mom-pink:#FEE2E2;
  --mom-accent:#F87171;
  --bg-light:#FAFAFA;
  
  /* Legacy 변수 호환성 */
  --bg:var(--bg-light);
  --surface:#ffffff;
  
  --primary:var(--research-navy);
  --primary-dark:#1f2937;
  --primary-light:#f3f4f6;
  
  --accent:var(--mom-accent);
  --accent-dark:#ef4444;
  --accent-light:var(--mom-pink);
  
  --ink:var(--research-navy);
  --muted:#6b7280;
  --muted-light:#9ca3af;
  
  --accent-color:var(--accent);
  --accent-hover:var(--accent-dark);
  --accent-light-color:var(--accent-light);
  
  --border:#e5e7eb;
  --border-strong:#d1d5db;
  
  --warm-yellow:#fef3c7;
  --warm-accent:#f59e0b;
  
  --shadow-sm:0 1px 2px rgba(55,65,81,0.05);
  --shadow-md:0 4px 12px rgba(55,65,81,0.08);
  --shadow-lg:0 8px 24px rgba(55,65,81,0.12);
  --shadow-soft:0 2px 8px rgba(55,65,81,0.06);
  --shadow-mom:0 10px 15px -3px rgba(248,113,113,0.1);
  
  --radius-lg:20px;
  --radius-md:12px;
  --radius-sm:8px;
  --radius-full:100px;
  --radius-asymmetric:20px 20px 20px 4px;
  
  /* Typography (원래대로: Pretendard 기반, 폰트 변화 없이) */
  --font-sans:'Pretendard', 'Noto Sans KR', ui-sans-serif, system-ui, -apple-system, sans-serif;
  /* 기존 코드가 --font-serif를 참조하더라도 실제 표시는 동일하게 유지 */
  --font-serif:var(--font-sans);
}

*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  font-family:var(--font-sans);
  color:var(--research-navy);
  background-color:var(--bg-light);
  line-height:1.7;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

a{color:inherit;text-decoration:none}

.container{max-width:900px;margin:0 auto;padding:0 20px}

.header{
  position:sticky;
  top:0;
  z-index:20;
  height:72px;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:16px;
  padding:0 32px;
  background:var(--surface);
  border-bottom:2px solid var(--border-strong);
  box-shadow:var(--shadow-sm);
}

.brand{display:flex;gap:14px;align-items:center}
.brand:hover{
  opacity:0.8;
  cursor:pointer;
}
.brand .logo{
  width:clamp(120px, 26vw, 240px);
  height:auto;
  max-width:100%;
  border-radius:0;
  background:none;
  display:block;
  overflow:visible;
}
.brand .logo img{
  width:100%;
  height:auto;
  object-fit:contain;
  display:block;
}
.brand .logo::before{
  content:"";
  font-size:24px;
  font-weight:700;
}
.brand .logo.logo-fallback::before{
  content:"B";
}
.brand .title{
  font-family:var(--font-serif);
  font-weight:700;
  letter-spacing:-0.3px;
  font-size:1.25rem;
  color:var(--ink);
}

.nav{display:flex;gap:10px}
.nav a{
  padding:12px 18px;
  border-radius:999px;
  font-weight:600;
  font-size:0.95rem;
  background:var(--surface);
  box-shadow:var(--shadow-light), var(--shadow-dark);
  transition:transform .18s ease, box-shadow .18s ease;
}
.nav a:hover{transform:translateY(-2px)}
.nav a.active{
  background:var(--accent-soft);
  color:var(--accent-strong);
}

.page-title{
  margin:56px 20px 12px;
  font-family:var(--font-serif);
  font-size:36px;
  font-weight:700;
  letter-spacing:-0.5px;
  color:var(--ink);
  line-height:1.4;
}
.subtitle{
  margin:0 20px 40px;
  color:var(--muted);
  font-size:20px;
  font-weight:400;
  line-height:1.6;
}

.section-heading{
  margin:26px 20px 16px;
  font-size:20px;
  font-weight:700;
  color:var(--muted);
}

.main{padding:32px 0 64px}

/* Statistics Widget */
.stats-widget{
  background:var(--surface);
  border:1px solid var(--border-strong);
  border-radius:var(--radius-lg);
  padding:24px 28px;
  margin-bottom:40px;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  box-shadow:var(--shadow-sm);
}
.stats-widget .stat-item{
  display:flex;
  flex-direction:column;
  gap:4px;
  flex:1 1 220px;
  min-width:0;
}
.stats-widget .stat-label{
  font-size:13px;
  color:var(--muted);
  font-weight:500;
  text-transform:uppercase;
  letter-spacing:0.5px;
}
.stats-widget .stat-value{
  font-family:var(--font-serif);
  font-size:28px;
  font-weight:700;
  color:var(--ink);
  line-height:1;
}
.stats-widget .stat-value .unit{
  font-size:16px;
  color:var(--muted);
  font-weight:400;
  margin-left:4px;
}

.intro-banner{
  padding:40px 32px;
  margin-bottom:40px;
  color:var(--ink);
  background:linear-gradient(135deg, rgba(252,165,165,0.05), rgba(245,245,244,0.3));
  border-radius:var(--radius-lg);
  border:1px solid var(--border);
  box-shadow:var(--shadow-soft);
  position:relative;
  overflow:hidden;
}
.intro-banner::before{
  content:"";
  position:absolute;
  top:0;
  right:0;
  width:200px;
  height:200px;
  background:radial-gradient(circle, rgba(252,165,165,0.08), transparent 70%);
  border-radius:50%;
  transform:translate(30%, -30%);
  pointer-events:none;
}
.intro-banner h2{
  font-family:var(--font-serif);
  font-size:28px;
  font-weight:700;
  letter-spacing:-0.4px;
  margin:0 0 12px 0;
  color:var(--ink);
  line-height:1.4;
  position:relative;
  z-index:1;
}
.intro-banner p{
  position:relative;
  z-index:1;
}
.intro-banner p{
  margin:0;
  color:var(--muted);
  font-size:16px;
  line-height:1.7;
}
.month-entry{
  margin-top:20px;
  display:flex;
  flex-direction:column;
  gap:14px;
  position:relative;
  z-index:1;
}
.month-entry-row{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.month-entry-row label{
  font-size:13px;
  font-weight:600;
  color:var(--ink);
}
.month-entry-inline{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.month-entry-inline .input{
  flex:1 1 180px;
  min-width:0;
}
.month-entry-inline .btn{
  min-width:150px;
  flex:0 1 180px;
}
.month-hint{
  margin:2px 0 0 0;
  font-size:13px;
  color:var(--muted);
}

.card,
.clay{
  background:var(--surface);
  border-radius:var(--radius-lg);
  border:1px solid var(--border);
  transition:all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.card:hover,
.clay:hover{
  transform:translateY(-2px);
  box-shadow:var(--shadow-md);
  border-color:var(--accent);
}

.survey-container{max-width:820px}
.survey-shell{
  display:flex;
  flex-direction:column;
  gap:26px;
}
.survey-head{
  background:white;
  border-bottom:4px solid var(--mom-pink);
  padding:40px 24px;
  text-align:center;
  display:flex;
  flex-direction:column;
  gap:16px;
  align-items:center;
}
.survey-title{
  margin:15px 0 0 0;
  font-family:var(--font-sans);
  font-size:1.8rem;
  font-weight:700;
  letter-spacing:-0.5px;
  color:var(--research-navy);
  line-height:1.4;
}
.survey-desc{
  margin:0;
  color:var(--muted);
  font-size:20px;
  line-height:1.6;
}
.survey-progress{
  margin-top:8px;
  padding:12px 16px;
  background:var(--warm-yellow);
  border-radius:var(--radius-sm);
  font-size:14px;
  color:var(--warm-accent);
  border:1px solid #ffe0b2;
  display:flex;
  align-items:center;
  gap:8px;
}
.survey-progress .progress-text{
  display:flex;
  align-items:center;
  gap:4px;
  font-weight:500;
}
.survey-progress strong{
  font-family:var(--font-sans);
  font-weight:700;
  color:var(--warm-accent);
  font-size:16px;
}
.survey-tag{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 16px;
  border-radius:100px;
  font-size:0.8rem;
  font-weight:700;
  color:var(--mom-accent);
  background:var(--mom-pink);
  letter-spacing:0.05em;
  font-family:var(--font-sans);
  border:none;
}
.survey-body{
  padding:28px;
  display:flex;
  flex-direction:column;
  min-height:400px;
}
.survey-body .checklist{margin-top:0}

.grid{
  display:grid;
  gap:16px;
}
@media(min-width:700px){
  .grid{grid-template-columns:repeat(2,1fr)}
}
@media(min-width:1024px){
  .grid{grid-template-columns:repeat(3,1fr)}
}

.age-tile{
  display:flex;
  flex-direction:column;
  gap:20px;
  padding:28px;
  border-radius:var(--radius-asymmetric);
  background:var(--surface);
  border:1px solid var(--border);
  transition:all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
  position:relative;
  overflow:hidden;
  box-shadow:var(--shadow-sm);
}
.age-tile::before{
  content:"";
  position:absolute;
  top:0;
  left:0;
  right:0;
  height:3px;
  background:linear-gradient(90deg, var(--accent), var(--accent-dark));
  transform:scaleX(0);
  transition:transform 0.3s ease;
}
.age-tile:hover{
  border-color:var(--primary);
  box-shadow:var(--shadow-md);
}
.age-tile:hover::before{
  transform:scaleX(1);
}
.age-tile:active{
  transform:scale(0.98);
}
.age-tile .tile-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
}
.age-tile .tile-copy{display:flex;flex-direction:column;gap:8px;flex:1}
.age-tile .age{
  font-family:var(--font-serif);
  font-size:26px;
  font-weight:700;
  letter-spacing:-0.3px;
  color:var(--ink);
  line-height:1.3;
}
.age-tile .hint{
  color:var(--muted);
  font-size:14px;
  font-weight:500;
  margin-top:4px;
}
.age-tile .tile-badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 12px;
  background:var(--accent-light);
  color:var(--accent-dark);
  border-radius:var(--radius-full);
  font-size:11px;
  font-weight:500;
  letter-spacing:0.3px;
  margin-top:12px;
  align-self:flex-start;
  border:1px solid rgba(252,165,165,0.2);
  font-family:var(--font-sans);
}
.age-tile .tile-badge::before{
  content:"📊";
  font-size:12px;
}
.age-tile .tile-arrow{
  font-size:20px;
  color:var(--accent);
  align-self:flex-end;
  padding:10px;
  border-radius:var(--radius-sm);
  background:var(--accent-light);
  transition:all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display:flex;
  align-items:center;
  justify-content:center;
  width:40px;
  height:40px;
  flex-shrink:0;
}
.age-tile:hover{
  border-color:var(--accent);
  box-shadow:var(--shadow-md);
}
.age-tile:hover .tile-arrow{
  transform:translateX(3px);
  background:var(--accent);
  color:#fff;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-width:120px;
  height:48px;
  padding:0 28px;
  border-radius:var(--radius-md);
  border:none;
  font-weight:600;
  font-size:15px;
  cursor:pointer;
  background:var(--surface);
  color:var(--ink);
  border:2px solid var(--border-strong);
  transition:all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
  font-family:var(--font-sans);
}
.btn:hover{
  transform:translateY(-2px);
  box-shadow:var(--shadow-md);
  border-color:var(--primary);
}
.btn:active{
  transform:translateY(0);
}
.btn.brand{
  background:var(--primary);
  color:#fff;
  border-color:var(--primary);
  font-weight:600;
}
.btn.brand:hover{
  background:var(--primary-dark);
  border-color:var(--primary-dark);
  box-shadow:var(--shadow-lg);
}
.btn.brand:active{
  transform:translateY(0);
}
.btn:disabled{
  opacity:0.5;
  cursor:not-allowed;
  pointer-events:none;
}
.btn.ghost{
  background:transparent;
  color:var(--muted);
  border-color:var(--border-strong);
}
.btn.ghost:hover{
  background:var(--bg);
  color:var(--ink);
  border-color:var(--accent);
}
.btn.secondary{
  background:var(--accent-soft);
  color:var(--accent-strong);
}
.btn.success{
  background:linear-gradient(140deg,#7de5c1,#56d1ff);
  color:#1f2a3d;
  box-shadow:-10px -10px 22px rgba(255,255,255,0.78), 12px 12px 22px rgba(68,140,160,0.3);
}
.btn-move-up,
.btn-move-down{
  min-width:36px;
  padding:8px 12px;
  font-size:16px;
  font-weight:600;
  line-height:1;
}

.input,
textarea{
  width:100%;
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  padding:12px 16px;
  font-size:15px;
  background:var(--surface);
  color:var(--ink);
  transition:all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family:inherit;
}
.input:focus,
textarea:focus{
  outline:none;
  border-color:var(--accent);
  box-shadow:0 0 0 3px var(--accent-light);
}
textarea{min-height:120px;resize:vertical}

label{font-weight:600}
.small{color:var(--muted);font-size:12px}
.footer-space{height:40px}

/* Ad Slots */
.ad-section{
  margin:24px 0;
}
.ad-section-top{
  margin-top:8px;
}
.ad-section-bottom{
  margin-top:28px;
}
.adsense-slot{
  width:100%;
  min-height:0;
  background:#f8fafc;
  border:1px solid var(--border);
  border-radius:var(--radius-md);
}
.adsense-slot[data-ad-status="unfilled"]{
  display:none !important;
}

/* Data Source Footer */
.data-source{
  background:#F3F4F6;
  padding:30px;
  border-radius:24px;
  margin-top:40px;
  text-align:center;
}
.data-source-text{
  font-size:0.85rem;
  line-height:1.6;
  color:#6B7280;
}
.data-source-text strong{
  color:var(--research-navy);
  font-weight:600;
}

/* Progress Bar */
.progress-bar{
  margin-top:24px;
  padding:18px 18px;
  background:var(--surface);
  border:none;
  border-radius:16px;
  box-shadow:none;
}
.progress-steps{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:40px;
  position:relative;
  width:100%;
}
.progress-steps::before{
  content:"";
  position:absolute;
  top:24px;
  left:24px;
  right:24px;
  height:3px;
  background:var(--border-strong);
  z-index:0;
  border-radius:999px;
}
.progress-step{
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  position:relative;
  z-index:1;
  min-width:120px;
}
.progress-step-number{
  width:48px;
  height:48px;
  border-radius:50%;
  background:var(--surface);
  border:2px solid var(--border-strong);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  color:var(--muted);
  font-size:15px;
}
.progress-step.active .progress-step-number{
  background:var(--surface);
  border-color:var(--accent);
  color:var(--accent);
  box-shadow:0 8px 16px rgba(248, 113, 113, 0.18);
}
.progress-step.completed .progress-step-number{
  background:var(--surface);
  border-color:var(--border-strong);
  color:var(--muted);
}
.progress-step-label{
  font-size:13px;
  color:var(--muted);
  font-weight:600;
  text-align:center;
  letter-spacing:0.02em;
  line-height:1.2;
}
.progress-step.active .progress-step-label{
  color:var(--muted);
  font-weight:600;
}
.progress-step.completed .progress-step-label{
  color:var(--muted);
  font-weight:600;
}

.checklist{
  display:flex;
  flex-direction:column;
  gap:16px;
  margin-top:24px;
}
.category-header{
  padding:16px 20px;
  background:var(--primary-light);
  border-left:4px solid var(--primary);
  border-radius:var(--radius-md);
  font-weight:600;
  font-size:17px;
  color:var(--ink);
  margin-top:8px;
  margin-bottom:4px;
}
.category-header:first-child{
  margin-top:0;
}
.checklist:empty::before{
  content:"No items available for selection.";
  display:block;
  padding:40px 20px;
  text-align:center;
  color:var(--muted);
  font-size:15px;
}
.check-card{
  background:white;
  border:1px solid #E5E7EB;
  border-radius:20px;
  padding:20px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  transition:all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor:pointer;
  position:relative;
  box-shadow:var(--shadow-sm);
}
.check-card::before{
  content:"";
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  right:0;
  background:linear-gradient(90deg, rgba(248,113,113,0.08), rgba(248,113,113,0));
  opacity:0;
  transition:opacity 0.3s ease;
  border-radius:20px;
  pointer-events:none;
}
.check-card:hover{
  transform:translateY(-2px);
  box-shadow:var(--shadow-md);
  border-color:var(--mom-accent);
}
.check-card:hover::before{
  opacity:1;
}
.check-card.active{
  border-color:var(--mom-accent);
  background:#FFFBFB;
  box-shadow:var(--shadow-mom);
}
.check-card.active::before{
  opacity:1;
  background:linear-gradient(90deg, rgba(248,113,113,0.12), rgba(248,113,113,0));
}
.check-card:active{
  transform:scale(0.98);
}
.check-info{
  display:flex;
  gap:0;
  align-items:center;
}
.check-label{
  font-weight:500;
  font-size:16px;
  color:var(--ink);
  line-height:1.5;
}
.check-card .small{
  margin-top:4px;
  font-size:12px;
  opacity:0.6;
}

.switch{
  position:relative;
  width:52px;
  height:32px;
  border-radius:var(--radius-full);
  background:var(--border-strong);
  transition:all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor:pointer;
  flex-shrink:0;
  touch-action:manipulation;
}
.switch::after{
  content:"";
  position:absolute;
  width:24px;
  height:24px;
  border-radius:50%;
  top:4px;
  left:4px;
  background:#ffffff;
  box-shadow:0 2px 4px rgba(0,0,0,0.15);
  transition:all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.switch.on{
  background:var(--accent);
}
.switch.on::after{
  left:24px;
  background:#ffffff;
  box-shadow:0 2px 8px rgba(252,165,165,0.3);
}
.switch:hover{
  opacity:0.9;
}
.switch.on:hover{
  background:var(--accent-dark);
}

.actions{
  display:flex;
  gap:12px;
  justify-content:flex-end;
  margin-top:32px;
  padding-top:24px;
  border-top:2px solid var(--border-strong);
  flex-wrap:wrap;
}
@media(max-width:640px){
  .ad-section{
    margin:16px 0;
  }
  .adsense-slot{
    min-height:0;
  }
  .header{
    height:64px;
    padding:0 16px;
  }
  .brand{
    gap:10px;
  }
  .brand .logo{
    width:clamp(100px, 42vw, 180px);
    height:auto;
  }
  .brand .logo::before{
    font-size:20px;
  }
  .brand .title{
    font-size:1.05rem;
  }
  .page-title{
    margin:34px 16px 10px;
    font-size:30px;
  }
  .subtitle{
    margin:0 16px 28px;
    font-size:14px;
  }
  .main{
    padding:24px 0 48px;
  }
  .container{
    padding:0 16px;
  }
  .stats-widget{
    flex-direction:column;
    gap:14px;
    padding:16px;
    text-align:center;
  }
  .stats-widget .stat-item{
    width:100%;
    text-align:center;
    flex:none;
  }
  .stats-widget .stat-label{
    font-size:11px;
    letter-spacing:0.3px;
  }
  .stats-widget .stat-value{
    font-size:24px;
  }
  .stats-widget .stat-value .unit{
    font-size:13px;
  }
  .intro-banner{
    padding:28px 20px;
    margin-bottom:28px;
  }
  .intro-banner h2{
    font-size:22px;
  }
  .intro-banner p{
    font-size:14px;
  }
  .month-entry-inline{
    flex-direction:column;
    align-items:stretch;
  }
  .month-entry-inline .input{
    flex:none;
    height:44px;
    padding:10px 12px;
    font-size:14px;
  }
  .month-entry-inline .btn{
    flex:none;
    width:100%;
    min-width:0;
    height:44px;
    font-size:14px;
    padding:0 14px;
  }
  .age-tile{
    padding:20px;
  }
  .age-tile .age{
    font-size:22px;
  }
  .survey-container{
    max-width:100%;
    padding:0;
  }
  .survey-shell{
    gap:20px;
  }
  .survey-head{
    padding:28px 20px;
    text-align:center;
    align-items:center;
  }
  .survey-title{
    font-size:1.5rem;
    margin:12px 0 0 0;
  }
  .survey-desc{
    font-size:17px;
  }
  .survey-body{
    padding:24px 20px;
  }
  .progress-bar{
    padding:16px 12px;
  }
  .progress-steps{
    flex-wrap:nowrap;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    gap:28px;
    padding-bottom:6px;
    justify-content:flex-start;
  }
  .progress-steps::before{
    left:24px;
    right:24px;
  }
  .progress-step{
    min-width:100px;
    flex-shrink:0;
  }
  .progress-step-number{
    width:44px;
    height:44px;
    font-size:14px;
  }
  .progress-step-label{
    font-size:11px;
  }
  .check-card{
    padding:18px 16px;
    flex-direction:column;
    align-items:flex-start;
    gap:16px;
  }
  .check-info{
    width:100%;
  }
  .switch{
    align-self:flex-end;
  }
  .actions{
    position:sticky;
    bottom:0;
    background:var(--surface);
    padding:16px 0;
    margin:24px -20px -20px;
    padding-left:20px;
    padding-right:20px;
    box-shadow:0 -4px 12px rgba(0,0,0,0.04);
    flex-direction:column;
  }
  .actions .btn{
    width:100%;
    min-width:0;
  }
  .data-source{
    padding:20px 16px;
    margin-top:40px;
    border-radius:16px;
  }
  .data-source-text{
    font-size:12px;
  }
}

.empty{
  padding:64px 28px;
  border-radius:var(--radius-lg);
  background:var(--surface);
  text-align:center;
  color:var(--muted);
  border:2px solid var(--border-strong);
  line-height:1.7;
}
.empty::before{
  content:"📊";
  display:block;
  font-size:48px;
  margin-bottom:20px;
  opacity:0.6;
}

.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0 16px;
  margin-top:24px;
}
.table th{
  text-align:left;
  font-weight:700;
  color:var(--muted);
  font-size:14px;
  padding:0 20px 6px;
}
.table td{
  background:var(--surface);
  padding:20px;
  border-radius:var(--radius-md);
  border:1px solid var(--border);
  vertical-align:top;
}
.table tr{transition:transform .18s ease}
.table tr:hover td{
  transform:translateY(-1px);
  box-shadow:var(--shadow-sm);
}

.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 12px;
  border-radius:var(--radius-full);
  background:var(--surface);
  color:var(--muted);
  border:1px solid var(--border);
  font-size:13px;
  font-weight:500;
}

.toolbar{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin:20px 0;
}
.toolbar .btn,
.toolbar .input{height:48px}
.file-pill{
  position:relative;
  overflow:hidden;
}
.file-pill input{
  position:absolute;
  inset:0;
  opacity:0;
  cursor:pointer;
}

.age-label{
  font-weight:700;
  font-size:18px;
  margin-bottom:8px;
}

.responsive-list{
  display:grid;
  gap:14px;
  grid-template-columns:repeat(auto-fill,minmax(240px,1fr));
}
.question-card{
  padding:18px;
}
.question-row{
  display:flex;
  gap:12px;
  align-items:center;
}
.question-copy{flex:1 1 auto;min-width:0}

.question-form{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin-top:16px;
}
.question-form .input:first-child{
  flex:1 1 220px;
}
.category-select-wrapper{
  display:flex;
  gap:8px;
  align-items:center;
  width:100%;
  max-width:280px;
}
.category-select-wrapper select{
  flex:1;
}
.category-select-wrapper .btn-add-category{
  min-width:36px;
  height:36px;
  padding:0;
  font-size:20px;
  font-weight:700;
  display:flex;
  align-items:center;
  justify-content:center;
}
.category-list{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  width:100%;
  margin-top:8px;
  padding:8px;
  background:var(--primary-light);
  border-radius:var(--radius-sm);
}
.category-tag{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 12px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  font-size:13px;
  color:var(--ink);
}
.category-tag .btn-remove-category{
  background:none;
  border:none;
  color:var(--muted);
  cursor:pointer;
  font-size:18px;
  line-height:1;
  padding:0;
  width:18px;
  height:18px;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:color 0.2s ease;
}
.category-tag .btn-remove-category:hover{
  color:var(--accent);
}
.row-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

/* Admin Tabs */
.admin-tabs{
  display:flex;
  gap:8px;
  border-bottom:2px solid var(--border);
  margin-bottom:24px;
}
.admin-tab{
  padding:12px 24px;
  background:none;
  border:none;
  border-bottom:3px solid transparent;
  cursor:pointer;
  font-size:15px;
  font-weight:600;
  color:var(--muted);
  transition:all 0.2s ease;
  margin-bottom:-2px;
}
.admin-tab:hover{
  color:var(--ink);
}
.admin-tab.active{
  color:var(--accent);
  border-bottom-color:var(--accent);
}
.admin-tab-content{
  display:none;
}
.admin-tab-content.active{
  display:block;
}

/* Category Meta Management */
.category-meta-list{
  display:grid;
  gap:20px;
}
.category-meta-card{
  padding:24px;
}
.category-meta-title{
  font-size:18px;
  font-weight:700;
  margin-bottom:16px;
  color:var(--ink);
}
.category-meta-form{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.category-meta-form label{
  font-size:14px;
  font-weight:600;
  color:var(--ink);
}

/* Practice Admin */
.practice-admin-section{
  display:flex;
  flex-direction:column;
  gap:24px;
}
.practice-category-selector{
  display:flex;
  align-items:center;
  gap:12px;
}
.practice-category-selector label{
  font-weight:600;
  color:var(--ink);
}
.practice-admin-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:20px;
}
.practice-admin-header h3{
  font-size:20px;
  font-weight:700;
  color:var(--ink);
}
.practice-admin-cards{
  display:grid;
  gap:20px;
}
.practice-admin-card{
  padding:20px;
}
.practice-admin-card-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:16px;
}
.practice-admin-card-header h4{
  font-size:16px;
  font-weight:700;
  color:var(--ink);
}
.practice-admin-form{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.practice-admin-meta{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}

/* Result Page */
.loading-message,
.error-message{
  text-align:center;
  padding:40px;
  font-size:16px;
  color:var(--muted);
}
.error-message{
  color:var(--accent);
}
.result-section{
  margin-bottom:48px;
}
.result-header{
  text-align:center;
  margin-bottom:32px;
}
.result-title{
  font-size:28px;
  font-weight:700;
  color:var(--ink);
  margin-bottom:16px;
}
.result-stats{
  display:flex;
  justify-content:center;
}
.stat-badge{
  display:flex;
  align-items:baseline;
  gap:8px;
  padding:16px 32px;
  background:var(--primary-light);
  border-radius:var(--radius-md);
  font-size:24px;
  font-weight:700;
}
.stat-number{
  color:var(--accent);
  font-size:32px;
}
.stat-separator{
  color:var(--muted);
}
.stat-total{
  color:var(--ink);
}
.stat-percent{
  color:var(--muted);
  font-size:18px;
  margin-left:4px;
}
.category-summary-list{
  display:grid;
  gap:16px;
}
.category-summary-card{
  padding:20px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-md);
  transition:box-shadow 0.2s ease;
}
.category-summary-card:hover{
  box-shadow:var(--shadow-md);
}
.category-summary-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:12px;
}
.category-summary-title{
  font-size:18px;
  font-weight:700;
  color:var(--ink);
}
.practice-label{
  padding:4px 12px;
  background:var(--accent-light);
  color:var(--accent);
  border-radius:var(--radius-full);
  font-size:12px;
  font-weight:700;
}
.category-summary-stats{
  margin-bottom:12px;
}
.category-stat{
  font-size:16px;
  font-weight:600;
  color:var(--muted);
}
.category-description-toggle{
  margin-top:12px;
}
.btn-info{
  background:none;
  border:none;
  color:var(--accent);
  cursor:pointer;
  font-size:14px;
  font-weight:600;
  padding:8px 0;
  display:flex;
  align-items:center;
  gap:6px;
}
.btn-info:hover{
  opacity:0.8;
}
.btn-info span{
  font-size:18px;
}
.category-description-content{
  margin-top:12px;
  padding:16px;
  background:var(--primary-light);
  border-radius:var(--radius-sm);
}
.category-description-content p{
  margin:0 0 8px 0;
  line-height:1.6;
  color:var(--ink);
}
.category-description-content p:last-child{
  margin-bottom:0;
}
.category-note{
  font-size:13px;
  color:var(--muted);
  font-style:italic;
}

/* Practice Recommendations */
.practice-section{
  background:var(--primary-light);
  padding:32px;
  border-radius:var(--radius-lg);
}
.practice-header{
  text-align:center;
  margin-bottom:32px;
}
.practice-title{
  font-size:24px;
  font-weight:700;
  color:var(--ink);
  margin-bottom:8px;
}
.practice-subtitle{
  font-size:15px;
  color:var(--muted);
}
.practice-list{
  display:flex;
  flex-direction:column;
  gap:32px;
}
.practice-category-group{
  background:var(--surface);
  padding:24px;
  border-radius:var(--radius-md);
}
.practice-category-title{
  font-size:20px;
  font-weight:700;
  color:var(--ink);
  margin-bottom:20px;
}
.practice-cards{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(280px,1fr));
  gap:16px;
}
.practice-card{
  padding:20px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-md);
  transition:box-shadow 0.2s ease;
}
.practice-card:hover{
  box-shadow:var(--shadow-md);
}
.practice-card-title{
  font-size:16px;
  font-weight:700;
  color:var(--ink);
  margin-bottom:8px;
}
.practice-card-desc{
  font-size:14px;
  color:var(--muted);
  line-height:1.6;
  margin-bottom:12px;
}
.practice-meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  font-size:13px;
  color:var(--muted);
}
.no-practices{
  text-align:center;
  padding:24px;
  color:var(--muted);
  font-style:italic;
}

/* Result Actions */
.result-actions{
  display:flex;
  gap:12px;
  justify-content:center;
  margin-top:48px;
  padding-top:32px;
  border-top:2px solid var(--border);
}

/* Mobile Responsive for Result Page */
@media(max-width:768px){
  .result-title{
    font-size:24px;
  }
  .chart-container{
    padding:16px;
  }
  .chart-title{
    font-size:16px;
    margin-bottom:14px;
  }
  .stat-badge{
    font-size:20px;
    padding:12px 24px;
  }
  .stat-number{
    font-size:28px;
  }
  .practice-section{
    padding:24px 16px;
  }
  .practice-cards{
    grid-template-columns:1fr;
  }
  .result-actions{
    flex-direction:column;
  }
  .result-actions .btn{
    width:100%;
  }
  .admin-tabs{
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }
  .admin-tab{
    white-space:nowrap;
    flex-shrink:0;
  }
}

/* Chart Styles */
.chart-container{
  background:var(--surface);
  padding:24px;
  border-radius:var(--radius-md);
  margin-bottom:24px;
  text-align:center;
}
.chart-title{
  font-size:18px;
  font-weight:700;
  color:var(--ink);
  margin-bottom:20px;
}
#overall-chart{
  max-width:100%;
  height:auto;
}
#category-chart{
  max-width:100%;
  height:auto;
}

/* Summary Text */
.summary-text{
  background:var(--primary-light);
  padding:24px;
  border-radius:var(--radius-md);
  margin-bottom:32px;
}
.summary-title{
  margin:0 0 14px 0;
  font-size:20px;
  font-weight:700;
  color:var(--ink);
}
.summary-text p{
  margin:0 0 12px 0;
  line-height:1.7;
  color:var(--ink);
}
.summary-text p:last-child{
  margin-bottom:0;
}
.summary-strength{
  color:var(--ink);
}
.summary-improvement{
  color:var(--accent-dark);
}
.summary-note{
  font-size:14px;
  color:var(--muted);
}
.analysis-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:14px;
}
.analysis-card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:12px;
  padding:14px;
}
.analysis-card.needs-growth{
  border-left:4px solid #F87171;
}
.analysis-card.achieved{
  border-left:4px solid #10B981;
}
.analysis-card-title{
  margin:0 0 10px 0;
  font-size:15px;
  color:var(--ink);
}
.analysis-list{
  margin:0;
  padding-left:18px;
}
.analysis-list li{
  color:var(--ink);
  line-height:1.5;
  margin-bottom:6px;
}
.analysis-empty{
  margin:0;
  color:var(--muted);
  font-size:14px;
}

/* Unselected Items with Practice Tips */
.unselected-items-list{
  display:flex;
  flex-direction:column;
  gap:24px;
}
.unselected-item-card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-md);
  padding:24px;
  transition:box-shadow 0.2s ease;
}
.unselected-item-card:hover{
  box-shadow:var(--shadow-md);
}
.unselected-item-header{
  margin-bottom:20px;
  padding-bottom:16px;
  border-bottom:2px solid var(--border);
}
.unselected-item-title{
  font-size:18px;
  font-weight:700;
  color:var(--ink);
  margin-bottom:6px;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.unselected-item-linked-question{
  margin:0 0 10px 0;
  color:var(--muted);
  font-size:13px;
  line-height:1.5;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.unselected-item-category{
  display:inline-block;
  padding:4px 12px;
  background:var(--primary-light);
  color:var(--muted);
  border-radius:var(--radius-sm);
  font-size:13px;
  font-weight:600;
}

@media (max-width: 768px){
  .analysis-grid{
    grid-template-columns:1fr;
  }
}
.item-practice-tips{
  display:flex;
  flex-direction:column;
  gap:16px;
}
.practice-tip-card{
  background:var(--primary-light);
  padding:20px;
  border-radius:var(--radius-md);
  border-left:4px solid var(--accent);
}
.tip-title{
  font-size:16px;
  font-weight:700;
  color:var(--ink);
  margin-bottom:12px;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.tip-why{
  font-size:14px;
  color:var(--ink);
  margin-bottom:12px;
  line-height:1.6;
}
.tip-steps{
  margin-bottom:12px;
}
.tip-steps ol{
  margin:8px 0 0 20px;
  padding:0;
}
.tip-steps li{
  margin-bottom:6px;
  line-height:1.6;
  color:var(--ink);
}
.tip-caution{
  background:#FEF3C7;
  padding:12px;
  border-radius:var(--radius-sm);
  font-size:13px;
  color:#92400E;
  margin-bottom:12px;
  line-height:1.6;
}
.tip-meta{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  font-size:13px;
  color:var(--muted);
}
.no-tips-message{
  padding:20px;
  background:var(--primary-light);
  border-radius:var(--radius-sm);
  text-align:center;
  color:var(--muted);
  font-style:italic;
}

/* Item Practice Admin */
.item-practice-admin-section{
  display:flex;
  flex-direction:column;
  gap:24px;
}
.item-practice-selector{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}
.item-practice-selector label{
  font-weight:600;
  color:var(--ink);
}
.item-practice-editor{
  margin-top:24px;
}
.item-practice-header{
  margin-bottom:24px;
  padding-bottom:20px;
  border-bottom:2px solid var(--border);
}
.item-practice-header h3{
  font-size:20px;
  font-weight:700;
  color:var(--ink);
  margin-bottom:8px;
}
.item-practice-meta{
  color:var(--muted);
  font-size:14px;
  margin-bottom:16px;
}
.item-practice-tips-list{
  display:flex;
  flex-direction:column;
  gap:20px;
}
.item-practice-tip-editor{
  padding:20px;
}
.item-tip-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:16px;
}
.item-tip-header h4{
  font-size:16px;
  font-weight:700;
  color:var(--ink);
}
.item-tip-form{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.item-tip-form label{
  font-size:14px;
  font-weight:600;
  color:var(--ink);
}
.item-tip-meta-fields{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}
