/* 살림집 — 공통 토큰과 기본 스타일 (공개 화면 + 관리자) */
:root {
  --color-bg: #ffffff;
  --color-surface: #f8f5f1;
  --color-surface-2: #f2ede7;
  --color-fg: #221b17;
  --color-fg-2: #4d4540;
  --color-muted: #766d67;
  --color-border: #ece6df;
  --color-brand: #5a3a2c;
  --color-brand-hover: #462c21;
  --color-on-brand: #ffffff;
  --color-accent: #fcb84c;
  --color-accent-soft: #fff3dc;
  --color-danger: #c2412d;
  --color-success: #2f7a4f;
  --color-ring: #5a3a2c;

  --font-body: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 999px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 150ms;
  --dur-base: 250ms;

  --gutter: 16px;
  --shadow-float: 0 6px 20px rgba(34, 27, 23, 0.14);
}

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

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  word-break: keep-all;
  overflow-wrap: anywhere;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

img {
  display: block;
  max-width: 100%;
}

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

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

:focus-visible {
  outline: 2px solid var(--color-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.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;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -48px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--color-brand);
  color: var(--color-on-brand);
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.skip-link:focus {
  top: 8px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  color: var(--color-fg-2);
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast);
}
.icon-btn:hover {
  background: var(--color-surface);
}
.icon-btn--sm {
  width: 36px;
  height: 36px;
}
.icon-btn--sm svg {
  width: 18px;
  height: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast), opacity var(--dur-fast);
}
.btn svg {
  width: 18px;
  height: 18px;
}
.btn--primary {
  background: var(--color-brand);
  color: var(--color-on-brand);
}
.btn--primary:hover {
  background: var(--color-brand-hover);
}
.btn--ghost {
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-fg-2);
}
.btn--ghost:hover {
  border-color: var(--color-muted);
}
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 60;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: var(--radius-full);
  background: var(--color-fg);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.toast.is-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

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