:root {
  --title-highlight: #F3DEAF;
  --calculate-button: #F3DEAF;
  --add-button-border: #D7BB84;
  --section-line: #A6A6A6;
  --notice-border: #EAD9B8;
  --notice-icon: #E56152;
  --notice-bg: #FFF8E7;
  --notice-red: #EA5353;
  --guide-border: #D3AE92;
  --guide-bg: #FFF6EE;
  --guide-title: #E8833A;
}

body {
  font-family: 'Noto Sans KR', sans-serif;
  text-align: center;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  display: flex;
  /* flexbox를 사용하여 자식 요소들을 중앙 정렬 */
  justify-content: center;
  /* 수평 방향으로 중앙 정렬 */
  align-items: center;
  /* 수직 방향으로 중앙 정렬 */
}


.hr-sect {
  display: flex;
  flex-basis: 100%;
  align-items: center;
  color: var(--section-line);
  font-size: 1.2em;
  margin: 8px 0px;
}

.hr-sect::before,
.hr-sect::after {
  content: "";
  flex-grow: 1;
  background: var(--section-line);
  height: 1px;
  font-size: 0px;
  line-height: 0px;
  margin: 0px 16px;
}



.highlight {
  display: inline;
  box-shadow: inset 0 -10px 0 var(--title-highlight);
  /* 텍스트 하이라이트 효과 */
}

#container {
  display: block;
  /* 컨테이너를 블록 레벨 요소로 변경 */
  text-align: center;
  margin-top: 20px;
  padding: 0 20px;
}

.label,
.unit,
button,
input {
  font-size: 1.5em;
  font-family: 'Noto Sans KR', sans-serif;
}

button {
  display: block;
  margin: 20px auto;
  background-color: var(--calculate-button);
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 15px;
  font-size: 1em;
  color: black;
}

#result_calculator {
  width: 90%;
  margin: 10px;
  /* 컨테이너의 상하 마진 */
  padding: 10px;
  /* 내부 여백 */
  text-align: left;
  /* 내부 내용을 왼쪽으로 정렬 */
}


#canvasContainer canvas {
  display: block;
  /* 캔버스를 블록 레벨 요소로 명시적으로 설정 */
  margin: 0 auto;
  /* 상하 마진 0, 좌우 마진 자동으로 설정하여 가운데 정렬 */
  /*max-width: 100%;*/
}

#canvasContainer {
  text-align: center;
  /* 캔버스 컨테이너를 가운데 정렬 */
}

input[type="text"] {
  font-size: 1em;
  width: 100px;
  /* 입력칸의 너비를 고정 */
  max-width: 100%;
  /* 최대 너비를 100%로 설정하여 화면 너비를 초과하지 않도록 함 */
}

.notice {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 12px 16px;
  border: 2px solid var(--notice-border);
  border-radius: 10px;
  background-color: var(--notice-bg);
  text-align: left;
}

.notice-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  line-height: 28px;
  border-radius: 50%;
  background-color: var(--notice-icon);
  color: white;
  font-weight: 900;
  text-align: center;
}

.notice p {
  margin: 0;
  line-height: 1.6;
  /* 줄바꿈은 <br> 에서만 나오게 좁은 화면은 글자를 줄인다.
     그래도 모자라면(휴대폰 글자 키우기 설정 등) 넘치지 않고 단어 단위로 줄바꿈
     116px = 컨테이너 좌우여백 40 + 박스 여백,테두리 36 + 아이콘,간격 40
     17.5 = 가장 긴 줄 글자폭 / 글자크기 (실측 17.0, 여유 포함). 문구,크기 바꾸면 다시 잴 것 */
  word-break: keep-all;
  font-size: min(1.2em, calc((100vw - 116px) / 17.5));
}

.notice strong {
  /* 첫 줄은 아래 두 줄 1.2배 키우기 전 크기 유지 (1.15 / 1.2) */
  font-size: 0.96em;
}

.notice-red {
  color: var(--notice-red);
}

/* 가운데 정렬은 x 버튼을 뺀 폭 기준. x 는 그 오른쪽에 붙인다 */
.wall-row {
  position: relative;
  width: fit-content;
  margin: 6px auto 0;
}

.wall-label {
  font-size: 1.1em;
}

.wall-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 20px 0;
}

.wall-actions button {
  margin: 0;
  white-space: nowrap;
}

#addWallButton {
  background-color: white;
  border: 1px solid var(--add-button-border);
}

.wall-remove {
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin: 0 0 0 6px;
  padding: 0 8px;
  background: none;
  border: 1px solid var(--section-line);
  border-radius: 6px;
  font-size: 1em;
  line-height: 1.5;
}

.guide-box {
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid var(--guide-border);
  border-radius: 10px;
  background-color: var(--guide-bg);
  text-align: left;
  word-break: keep-all;
  /* 긴 안내 문장이 화면 전체 폭을 넓히지 않게 한다 */
  contain: inline-size;
}

.guide-box p {
  margin: 0 0 10px;
}

.guide-box p:last-child {
  margin-bottom: 0;
}

.guide-box > p:first-child {
  color: var(--guide-title);
}

.input-toast {
  position: absolute;
  bottom: 100%;
  padding: 4px 10px;
  border-radius: 6px;
  background-color: #333;
  color: white;
  font-size: 0.85em;
  white-space: nowrap;
  z-index: 1;
}
