/* 사이트 공통 디자인 톤(kr-market-forecast 참고): border-radius 6px, Astra 테마 기본값에
   맞춘 회색조(#3a3a3a 계열) 텍스트 계층 + 기본 시스템 폰트 스택. 다른 설치된 플러그인들과
   시각적으로 통일감을 유지한다. */

.hgc-calculator,
.hgc-calculator * {
	box-sizing: border-box;
}

.hgc-calculator {
	width: 100%;
	max-width: 340px;
	font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", "Malgun Gothic", sans-serif;
	border: 1px solid #e1e1e1;
	border-radius: 6px;
	padding: 16px;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
	/* 브라우저의 다크모드/강제 색상 모드가 버튼 색을 자동으로 뒤집어 호버 시
	   글자가 안 보이는 문제를 막기 위해 이 위젯은 항상 라이트 색상으로 고정한다. */
	color-scheme: light;
}

/* 화면이 좁은 모바일에서는 여백/글자 크기를 살짝 줄여, 좌우가 잘리지 않으면서도
   버튼은 터치하기 충분한 크기(약 40px 이상)를 유지하도록 한다. */
@media (max-width: 380px) {
	.hgc-calculator {
		max-width: 100%;
		padding: 12px;
	}

	.hgc-display {
		font-size: 22px;
	}

	.hgc-buttons {
		gap: 6px;
	}

	.hgc-btn {
		padding: 12px 0;
		font-size: 15px;
	}
}

.hgc-calculator:focus {
	outline: 2px solid #0274be;
	outline-offset: 2px;
}

.hgc-screen {
	margin-bottom: 12px;
	padding: 12px 14px;
	border: 1px solid #e1e1e1;
	border-radius: 6px;
	background: #f7f7f7;
	text-align: right;
}

.hgc-display {
	font-size: 28px;
	font-weight: 700;
	color: #3a3a3a;
	line-height: 1.3;
	overflow-x: auto;
	white-space: nowrap;
}

.hgc-korean {
	margin-top: 4px;
	font-size: 13px;
	color: #767676;
	min-height: 16px;
}

.hgc-buttons {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 8px;
}

.hgc-btn {
	-webkit-appearance: none;
	appearance: none;
	padding: 14px 0;
	font-size: 16px;
	font-weight: 600;
	color: #3a3a3a;
	background: #fff;
	border: 1px solid #e1e1e1;
	border-radius: 6px;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.hgc-btn:hover,
.hgc-btn:focus {
	color: #3a3a3a;
	background: #f7f7f7;
}

.hgc-btn-operator {
	color: #fff;
	background: #0274be;
	border-color: #0274be;
}

.hgc-btn-operator:hover,
.hgc-btn-operator:focus {
	color: #fff;
	background: #055a94;
}

.hgc-btn-equals {
	color: #fff;
	background: #3a3a3a;
	border-color: #3a3a3a;
}

.hgc-btn-equals:hover,
.hgc-btn-equals:focus {
	color: #fff;
	background: #545454;
}

.hgc-btn-clear {
	grid-column: span 4;
	color: #b42318;
	border-color: #f3c6c1;
}

.hgc-btn-clear:hover,
.hgc-btn-clear:focus {
	color: #b42318;
	background: #fdf1f0;
}

.hgc-hint {
	margin: 10px 0 0;
	font-size: 12px;
	color: #999999;
	text-align: center;
}
