*{box-sizing:border-box}
html{scroll-behavior:smooth}

.wrapper{
  width:min(100%,1200px);
  margin:0 auto;
  padding:15px;
}
.card,.result-card{
  background:var(--bg-card);
  border:1px solid var(--primary-border);
  border-radius:18px;
  padding:24px;
}
.app-tag{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  background:var(--primary-soft);
  color:var(--primary);
  border-radius:999px;
  font-size:13px;
  font-weight:700;
  margin-bottom:14px;
}
.intro{
  margin:0 0 18px;
  color:var(--text-secondary);
  line-height:1.6;
  font-size:15px;
}
.notice{
  margin-bottom:22px;
  padding:14px 16px;
  border-radius:14px;
  background:#fff5dd;
  border:1px solid #f0d7a1;
  color:#825a10;
  line-height:1.55;
  font-size:14px;
}
.block{
  margin-top:22px;
}
.block-label{
  font-size:14px;
  font-weight:700;
  margin-bottom:14px;
  color:var(--text-primary);
}
.grid{
  display:grid;
  gap:16px;
}
.grid-2{
  grid-template-columns:repeat(2,minmax(0,1fr));
}
.field label{
  display:block;
  font-size:14px;
  font-weight:700;
  margin-bottom:8px;
  color:var(--text-primary);
}
.field input,
.field select{
  width:100%;
  height:52px;
  border:1px solid var(--primary-border);
  border-radius:12px;
  padding:0 14px;
  font-size:15px;
  color:var(--text-primary);
  background-color:var(--bg-card);
  appearance:none;
  -webkit-appearance:none;
  -moz-appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%23152033' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 14px center;
  background-size:16px;
  transition:border-color .2s ease, box-shadow .2s ease;
}
.field input:focus,
.field select:focus{
  outline:none;
  border-color:var(--primary);
  box-shadow:0 0 0 4px var(--primary-soft);
}
.field.has-error input,
.field.has-error select{
  border-color:#c62828;
  background:#fff8f8;
}
.hint,
.error-text{
  font-size:13px;
  margin-top:7px;
  line-height:1.45;
}
.hint{
  color:var(--text-muted);
}
.error-text{
  min-height:18px;
  color:#c62828;
}
.actions{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin-top:18px;
}
.btn{
  appearance:none;
  border:none;
  border-radius:12px;
  padding:14px 18px;
  min-height:52px;
  font-size:15px;
  font-weight:700;
  cursor:pointer;
  transition:transform .15s ease;
}
.btn:hover{
  transform:translateY(-1px);
}
.btn-primary{
  background:var(--primary);
  color:#fff;
}
.btn-secondary{
  background:var(--primary-soft);
  color:var(--text-primary);
}
.drinks-wrap{
  margin-top:18px;
  border:1px solid var(--primary-border);
  border-radius:16px;
  padding:16px;
  background:var(--bg-page);
}
.drinks-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:12px;
}
.drinks-total{
  font-size:13px;
  color:var(--text-muted);
  background:var(--primary-soft);
  border-radius:999px;
  padding:6px 10px;
}
.drinks-list{
  list-style:none;
  margin:0;
  padding:0;
  display:grid;
  gap:10px;
}
.drink-item{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  border:1px solid var(--primary-border);
  background:var(--bg-card);
  border-radius:14px;
  padding:12px 14px;
}
.drink-title{
  font-weight:700;
  margin-bottom:4px;
  font-size:15px;
  color:var(--text-primary);
}
.drink-meta{
  color:var(--text-muted);
  font-size:13px;
  line-height:1.4;
}
.remove-btn{
  border:none;
  background:#ffe8e8;
  color:#b42318;
  border-radius:10px;
  padding:10px 12px;
  font-weight:700;
  cursor:pointer;
  white-space:nowrap;
}
.empty-state{
  font-size:14px;
  color:var(--text-muted);
  text-align:center;
  padding:12px 0 2px;
}
.result-card{
  margin-top:22px;
  display:none;
  scroll-margin-top:18px;
}
.result-card.is-visible{
  display:block;
}
.result-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  margin-bottom:20px;
}
.result-title{
  font-size:20px;
  font-weight:700;
  color:var(--text-primary);
}
.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  padding:9px 12px;
  font-size:13px;
  font-weight:700;
  background:#fff5dd;
  color:#8a6116;
}
.result-summary{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
  margin-bottom:18px;
}
.summary-card{
  background:var(--bg-page);
  border:1px solid var(--primary-border);
  border-radius:16px;
  padding:18px;
}
.summary-label{
  font-size:13px;
  color:var(--text-muted);
  margin-bottom:10px;
  line-height:1.4;
}
.summary-value{
  font-size:34px;
  font-weight:700;
  line-height:1.05;
  margin-bottom:10px;
  color:var(--text-primary);
}
.summary-note{
  color:var(--text-muted);
  font-size:14px;
  line-height:1.45;
}
.section-box{
  border:1px solid var(--primary-border);
  border-radius:16px;
  background:var(--bg-card);
  padding:18px;
  margin-top:16px;
}
.box-title{
  font-size:16px;
  font-weight:700;
  margin-bottom:12px;
  color:var(--text-primary);
}
.gauge-track{
  position:relative;
  height:16px;
  border-radius:999px;
  background:linear-gradient(90deg,#d7f3e3 0%,#ffe8aa 38%,#ffc48b 68%,#f3a2a2 100%);
  overflow:visible;
}
.gauge-marker{
  position:absolute;
  top:50%;
  width:18px;
  height:18px;
  border-radius:50%;
  background:var(--text-primary);
  border:3px solid #fff;
  box-shadow:0 8px 18px rgba(21,32,51,.18);
  transform:translate(-50%,-50%);
  left:0%;
}
.gauge-labels{
  display:flex;
  justify-content:space-between;
  gap:8px;
  margin-top:10px;
  color:var(--text-muted);
  font-size:12px;
}
.gauge-caption,
.explanation-text,
.footer-note,
.details-text{
  color:var(--text-secondary);
  line-height:1.6;
  font-size:14px;
}
.chart-wrap{
  width:100%;
  height:300px;
  margin-top:8px;
  background:var(--bg-page);
  border:1px solid var(--primary-border);
  border-radius:14px;
  overflow:hidden;
}
.chart-wrap canvas{
  width:100%;
  height:100%;
  display:block;
}
.footer-note{
  margin:18px 0 0;
}
@media (max-width:720px){
  .card,.result-card{
    padding:18px;
  }
  .grid-2,.result-summary{
    grid-template-columns:1fr;
  }
  .result-top,.drinks-head,.drink-item{
    flex-direction:column;
    align-items:stretch;
  }
  .summary-value{
    font-size:30px;
  }
  .chart-wrap{
    height:250px;
  }
}
