:root{
  --bg:#f7f8fb;
  --card:#ffffff;
  --text:#111827;
  --muted:#6b7280;
  --line:#e5e7eb;
  --brand:#f59e0b;
  --brand2:#10b981;
  --danger:#ef4444;
  --shadow: 0 10px 26px rgba(17,24,39,0.08);
  --radius: 16px;
  --radius2: 12px;
  --pad: 18px;
}

.calorie-wrap{
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 14px 40px;
  color: var(--text);
}

.cal-header{
  background: linear-gradient(180deg, #fff, #fff8ec);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
}

.cal-title h1{
  margin: 0 0 6px 0;
  font-size: 22px;
  letter-spacing: -0.3px;
}
.cal-sub{
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.top-actions{
  margin-top: 12px;
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tabs{
  margin-top: 14px;
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
}
.tab{
  height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-weight: 900;
  font-size: 14px;
}
.tab.active{
  background: #111827;
  color: #fff;
  border-color: #111827;
}
.tab:hover{ border-color:#d1d5db; }

.panel{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 14px;
}

.panel-head{
  padding: 14px var(--pad);
  border-bottom: 1px solid var(--line);
}
.panel-head h2{
  margin:0;
  font-size: 16px;
}
.panel-sub{
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.panel-body{
  padding: var(--pad);
}

.tab-pane{ display:none; }
.tab-pane.active{ display:block; }

.grid-2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.card{
  border: 1px solid var(--line);
  border-radius: 14px;
  background:#fff;
  padding: 14px;
}
.card-head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.card-head h3{
  margin:0;
  font-size: 15px;
}
.mini-badge{
  font-size: 12px;
  color: #92400e;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  padding: 5px 10px;
  border-radius: 999px;
}

.form .row{
  display:flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
label{
  font-size: 13px;
  color: #374151;
}
input, select{
  width: 100%;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 0 12px;
  outline: none;
  font-size: 14px;
  background: #fff;
}
input:focus, select:focus{
  border-color: #fbbf24;
  box-shadow: 0 0 0 4px rgba(245,158,11,0.16);
}

.small-note{
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.small-note.subtle{ opacity: .9; }

.check{
  display:flex;
  align-items:center;
  gap: 8px;
  font-size: 13px;
  color: #374151;
}
.check input{ width: 18px; height: 18px; }

.btn{
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 900;
  font-size: 14px;
}
.btn:hover{ border-color:#d1d5db; }
.btn.primary{
  background: var(--brand);
  border-color: #f59e0b;
  color: #111827;
}
.btn.primary:hover{ filter: brightness(0.98); }
.btn.ghost{ background: transparent; }

.goal-cards{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.goal-card{
  text-align:left;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
  cursor: pointer;
  transition: transform .08s ease, border-color .12s ease, box-shadow .12s ease;
  min-height: 88px;
}
.goal-card:hover{ transform: translateY(-1px); }
.goal-card.active{
  border-color: #fdba74;
  box-shadow: 0 0 0 4px rgba(251,146,60,0.14);
  background: #fff7ed;
}
.gc-top{
  display:flex;
  align-items:center;
  gap: 8px;
  margin-bottom: 6px;
}
.gc-ico{
  width: 26px;
  height: 26px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius: 8px;
  font-weight: 900;
  color: #111827;
}
.gc-ico.down{ background: #fee2e2; }
.gc-ico.up{ background: #dbeafe; }
.gc-ico.flat{ background: #dcfce7; }
.gc-title{
  font-size: 14px;
  font-weight: 900;
}
.gc-desc{
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.result-block{
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  overflow:hidden;
}
.result-head{
  padding: 14px var(--pad);
  border-bottom: 1px solid var(--line);
}
.result-head h3{ margin:0; font-size: 15px; }

.muted{ color: var(--muted); font-size: 13px; margin: 6px 0 0; }

.result-cards{
  padding: var(--pad);
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.result-card{
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}
.result-card.highlight{
  background: #fff7ed;
  border-color: #fdba74;
}
.rc-label{ font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.rc-value{ font-size: 20px; font-weight: 900; letter-spacing: -0.2px; }
.rc-sub{ margin-top: 6px; font-size: 12px; color: var(--muted); }

.notice{
  border: 1px solid #fde68a;
  background: #fffbeb;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.notice b{ display:block; margin-bottom: 6px; }
.notice .muted{ margin:0; }

.exercise-box{
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}
.ex-row{
  display:grid;
  grid-template-columns: 110px 1fr;
  align-items:center;
  gap: 10px;
  margin-bottom: 10px;
}
.ex-actions{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0 8px;
}
.exercise-list{
  margin-top: 10px;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
  display:flex;
  flex-direction: column;
  gap: 8px;
}
.exercise-item{
  display:flex;
  align-items:center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}
.exercise-item .name{ font-weight: 900; font-size: 13px; }
.exercise-item .meta{ font-size: 12px; color: var(--muted); margin-top: 4px; }
.exercise-item .kcal{ font-weight: 900; }
.icon-btn{
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 7px 10px;
  cursor: pointer;
}
.icon-btn:hover{ border-color:#d1d5db; }

.exercise-total{
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  display:flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.big{ font-size: 18px; font-weight: 900; }
.empty{ color: var(--muted); font-size: 13px; padding: 8px 0; }

.meal-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.meal-card{
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}
.meal-title{ font-weight: 900; margin-bottom: 6px; }
.meal-meta{ margin-top: 6px; font-size: 12px; color: var(--muted); }
.meal-list{ margin: 8px 0 0; padding-left: 18px; color:#374151; font-size: 13px; line-height: 1.55; }

.meal-note{
  margin-top: 12px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 12px 14px;
}
.meal-note b{ display:block; margin-bottom: 6px; }
.meal-note ul{ margin:0; padding-left: 18px; color:#374151; line-height: 1.6; }

.sim-box{
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}
.sim-row{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.sim-item{
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 10px;
}

.risk-box{
  margin-top: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 12px 14px;
  background: #f9fafb;
}
.risk-title{ font-weight: 900; margin-bottom: 6px; }
.risk-desc{ color:#374151; line-height: 1.6; font-size: 13px; }

.guide-block{
  padding: 0 var(--pad) var(--pad);
}
.guide-block h3{
  margin: 0 0 10px;
  font-size: 15px;
}
.guide-grid{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.guide-card{
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
}
.guide-card h4{
  margin: 0 0 8px;
  font-size: 14px;
}
.guide-card ul{
  margin: 0;
  padding-left: 18px;
  color:#374151;
  line-height: 1.65;
}
.tip{
  margin-top: 10px;
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  border-radius: 12px;
  padding: 10px 12px;
  color:#065f46;
  line-height: 1.6;
  font-size: 13px;
}
.warn{
  margin-top: 10px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  border-radius: 12px;
  padding: 10px 12px;
  color:#7f1d1d;
  line-height: 1.6;
  font-size: 13px;
}
.checklist{
  list-style: none;
  padding-left: 0 !important;
}
.checklist li{
  display:flex;
  gap: 8px;
  align-items:flex-start;
}
.checklist li span{
  margin-top: 2px;
}

.guide-footer{
  margin-top: 10px;
}
.guide-footer .note{
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.scenario-block{
  padding: 0 var(--pad) var(--pad);
}
.scenario-block h3{
  margin: 0 0 10px;
  font-size: 15px;
}
.scenario-list{
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffbeb;
  padding: 12px;
  display:flex;
  flex-direction: column;
  gap: 10px;
}
.scenario{
  background: #fff;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 12px;
}
.sc-title{
  font-weight: 900;
  margin-bottom: 6px;
  color:#92400e;
}
.sc-desc{
  color:#374151;
  line-height: 1.6;
  font-size: 13px;
}

/* 결과공유 토스트 */
.toast{
  display: none;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #065f46;
  font-weight: 900;
  line-height: 1.5;
}
.toast.show{
  display: block;
}

@media (max-width: 980px){
  .grid-2{ grid-template-columns: 1fr; }
  .result-cards{ grid-template-columns: 1fr; }
  .goal-cards{ grid-template-columns: 1fr; }
  .meal-grid{ grid-template-columns: 1fr; }
  .guide-grid{ grid-template-columns: 1fr; }
  .sim-row{ grid-template-columns: 1fr; }
  .ex-row{ grid-template-columns: 1fr; }
}
.result-copyright{
  text-align:center;
  color:#8b8b99;
  font-size:11.5px;
  margin-top:8px;
}