/* 기본 요소: 본문, 제목, 입력창, 링크 */
* { box-sizing: border-box; }

/* 휴대폰의 상태표시줄·홈바를 피해 위아래 여백을 둡니다(일반 화면에서는 0). */
:root {
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

img { max-width: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  padding: 0;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.3; text-wrap: balance; }
h1 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 14px; font-weight: 600; }
h3 { font-size: 13px; font-weight: 600; }
p { margin: 0; }

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

.mono, .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.label-caps {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; color: var(--muted);
}

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

input, select, textarea, button { font: inherit; color: inherit; }

input[type="password"], input[type="text"], input[type="number"], input[type="date"], input[type="datetime-local"],
input[type="search"], input[type="email"], input[type="url"], input:not([type]), select, textarea {
  width: 100%;
  min-height: 32px;
  padding: 5px 9px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 64px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.8; }
/* 글 칸을 눌렀을 때: 굵은 테두리(outline) 대신 테두리 색과 옅은 빛 띠 하나로 */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):hover:not(:focus):not(:disabled),
select:hover:not(:focus):not(:disabled), textarea:hover:not(:focus):not(:disabled) {
  border-color: color-mix(in srgb, var(--fg) 28%, var(--line-strong));
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):focus,
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):focus-visible,
select:focus, select:focus-visible, textarea:focus, textarea:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--focus) 75%, var(--line-strong));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 14%, transparent);
}
input[type="search"] { -webkit-appearance: none; appearance: none; }
input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; display: none; }
input.num, input[inputmode="decimal"] { font-family: var(--font-mono); }

details > summary { cursor: pointer; }

[hidden] { display: none !important; }

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