/* 기본 요소 스타일 */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading);
  color: var(--color-text);
  background: var(--color-bg);
  font-variant-numeric: tabular-nums;   /* 숫자 폭을 맞춰 표·금액·날짜 정렬 */
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;                 /* 한국어 어절 단위 줄바꿈 */
  overflow-wrap: anywhere;              /* 긴 영문·URL·이메일은 넘치지 않게 */
}

h1, h2, h3 { margin: 0 0 var(--space-3); line-height: 1.3; font-weight: var(--weight-bold); }
h1 { font-size: var(--text-2xl); letter-spacing: -0.01em; }
h2 { font-size: var(--text-lg); margin-top: var(--space-8); }
h3 { font-size: var(--text-md); }
p { margin: 0 0 var(--space-3); }
small { font-size: var(--text-sm); }
code { font-family: var(--font-mono); font-size: 0.92em; }

a { color: var(--color-link); text-underline-offset: 2px; }
a:hover { color: var(--color-link-hover); }

/* 키보드 포커스는 항상 보이게(마우스 클릭에는 표시하지 않음) */
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }
h1:focus, h1:focus-visible { box-shadow: none; }   /* FocusOnNavigate가 제목에 포커스를 옮김 */

img { max-width: 100%; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: var(--space-2); top: -100px; z-index: 100;
  padding: var(--space-2) var(--space-4); background: var(--color-surface); border-radius: var(--radius);
}
.skip-link:focus-visible { top: var(--space-2); }

.muted { color: var(--color-text-muted); }
.text-sm { font-size: var(--text-sm); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; text-align: right; }

#blazor-error-ui {
  display: none; position: fixed; inset: auto 0 0 0; z-index: 1000;
  padding: var(--space-3) var(--space-4);
  background: var(--color-warning-soft); color: var(--color-warning-text);
  border-top: 2px solid var(--color-warning);
}
#blazor-error-ui .reload { margin-left: var(--space-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* hidden 속성은 클래스의 display보다 우선(미리보기 전환 등) */
[hidden] { display: none !important; }
