/* base.css — 리셋과 공용 요소. 컴포넌트별 규칙은 app.css에 둔다. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: var(--step-0) / 1.65 var(--font-ui);
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
p,
figure,
dd {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  line-height: 1.35;
  letter-spacing: -0.02em;
  font-weight: 800;
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }

img {
  max-width: 100%;
}

a {
  color: var(--leaf);
  text-underline-offset: 3px;
}

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

button,
a,
summary,
input,
select,
label {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button,
summary {
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.55;
}

[hidden] {
  display: none !important;
}

/* 포커스 — sanarae-brand-showcase와 동일한 이중링.
   선옐로만으로는 밝은 바탕에서 약해서 포레스트 1px를 덧댄다. */
:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 3px;
  box-shadow: 0 0 0 1px var(--forest-800);
  border-radius: var(--radius);
}

/* --- 숫자 --- */
/* 날짜·건수·희석배수는 자리를 맞춰 손으로 대조할 수 있게 한다. */
.num,
time,
.period-text,
.schedule-number,
.pest-number,
.frac-code {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* --- 버튼 --- */

.button-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--tap);
  padding: 10px 22px;
  border: 1px solid var(--leaf-dark);
  border-radius: var(--radius-pill);
  background: var(--leaf);
  color: #fff;
  font-size: var(--step-0);
  font-weight: 700;
  text-decoration: none;
  transition: background 0.12s ease;
}

.button-primary:hover:not(:disabled) {
  background: var(--leaf-dark);
}

.button-quiet,
.auth-switch,
.medicine-card button,
.catalog-chips button,
.weather-region-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--tap);
  padding: 9px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--step--1);
  font-weight: 600;
  transition: background 0.12s ease;
}

.button-quiet:hover:not(:disabled),
.catalog-chips button:hover:not(:disabled) {
  background: var(--surface-sunk);
}

.auth-switch {
  border: 0;
  background: transparent;
  color: var(--leaf);
  text-decoration: underline;
}

/* --- 입력 --- */

input,
select {
  min-height: var(--tap);
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  /* 모바일 자동 확대를 막으려면 16px 이상이어야 한다. */
  font-size: 1rem;
}

input[type="checkbox"] {
  min-height: 0;
  accent-color: var(--leaf);
}

label {
  display: block;
}

.field-label,
.calc-panel label,
.record-fields label,
.auth-card label,
#weather-location-form > label {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--ink-2);
}

/* --- 공용 텍스트 --- */

/* eyebrow — 브랜드 공통 장치: 짧은 선옐로 선 + 0.2em 자간 라벨. */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--ink-3);
}

.eyebrow::before {
  content: "";
  flex: 0 0 auto;
  width: 20px;
  height: 2px;
  background: var(--sun-deep);
}

.muted,
.page-intro,
.catalog-help,
.candidate-help,
.frequent-description,
.calc-help,
.record-label-note,
.weather-meta,
.weather-disclaimer,
.pest-info-source,
.dialog-source {
  color: var(--ink-3);
  font-size: var(--step--1);
  line-height: 1.75;
}

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

.skip-link {
  position: fixed;
  top: -80px;
  left: var(--space-4);
  z-index: 40;
  padding: var(--space-3) var(--space-4);
  background: var(--ink);
  color: #fff;
  border-radius: 0 0 var(--radius) var(--radius);
}

.skip-link:focus {
  top: 0;
}

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