:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --muted: #5b6876;
  --text: #0b0c0f;
  --primary: #1fcf7c; /* 초록 포인트 */
  --primary-600: #12b26a;
  --ring: rgba(31, 207, 124, 0.3);
  --border: #e6e8ec;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans KR', ui-sans-serif, -apple-system, Segoe UI, Roboto, "Apple SD Gothic Neo", Pretendard, Arial, sans-serif;
  line-height: 1.6;
}

.container {
  width: 100%;
  max-width: 980px;
  padding: 0 20px;
  margin: 0 auto;
}

.app-header {
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}
.app-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.brand { color: var(--text); text-decoration: none; font-weight: 700; }
.nav .home { color: var(--text); text-decoration: none; opacity: .8; }

.hero { padding: 40px 0 24px; }
.hero h1 { margin: 0 0 8px; font-size: 28px; }
.hero p { margin: 0; color: var(--muted); }

.manual { padding: 12px 0 8px; }
.manual h2 { margin: 0 0 8px; font-size: 20px; }
.manual-desc { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.manual-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  margin-bottom: 10px;
}
@media (min-width: 640px) {
  .manual-form { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.field { display: grid; gap: 6px; }
.field span { font-size: 13px; color: var(--muted); }
.field input[type="number"] {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}
.field input[type="number"]:focus { outline: none; box-shadow: 0 0 0 3px var(--ring); border-color: var(--border); }

.dropzone, .dz-inner { display: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  color: #02140a;
  font-weight: 600;
  background: linear-gradient(180deg, var(--primary), var(--primary-600));
  border: none;
  cursor: pointer;
}
.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn:disabled { opacity: .6; cursor: not-allowed; }

.progress { display: none; }

.progress-hint { display: none; }

.results { padding: 28px 0; }
.cards { display: grid; grid-template-columns: 1fr; gap: 16px; }
/* 항상 세로 스택(1열) 유지 */
@media (min-width: 860px) { .cards { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.card h3 { margin: 0 0 8px; }

.chart-box {
  position: relative;
  width: 100%;
  /* 정사각형 비율 유지 */
  aspect-ratio: 1 / 1;
}

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-weight: 500; }

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

.app-footer { border-top: 1px solid var(--border); padding: 18px 0; margin-top: 40px; color: var(--muted); }
.app-footer .container { display: flex; align-items: center; justify-content: space-between; }
.app-footer .home { color: var(--text); text-decoration: none; opacity: .8; }

canvas { max-width: 100%; height: auto; }
/* 차트 선명도 확보를 위해 높이 고정 */
#chart { width: 100%; height: 100%; display: block; }


