/* HairGrowth OS — base：reset、排版、焦點、無障礙工具類。依賴 tokens.css。 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--font-size-md);
  line-height: var(--line-height-normal);
  overflow-wrap: anywhere; /* 長店名／長地址不撐破版面 */
}

h1, h2, h3, h4 {
  margin: 0 0 var(--space-2);
  line-height: var(--line-height-tight);
  font-weight: var(--font-weight-bold);
}
h1 { font-size: var(--font-size-xl); }
h2 { font-size: var(--font-size-lg); }
h3 { font-size: var(--font-size-md); }

p { margin: 0 0 var(--space-3); }

a {
  color: var(--color-primary);
  text-underline-offset: 0.2em;
}

img, svg { max-width: 100%; }

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

button, [role="button"], a, label, select, summary {
  touch-action: manipulation;
}

:focus { outline: none; }
:focus-visible {
  outline: var(--focus-width) solid var(--focus-color);
  outline-offset: var(--focus-offset);
}

table { border-collapse: collapse; }

.icon {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}
.icon--lg { width: 1.5rem; height: 1.5rem; }
.icon--xl { width: 2.5rem; height: 2.5rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  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: var(--z-toast);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}
.skip-link:focus { top: var(--space-2); }

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

[hidden] { display: none !important; }

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

/* 一般頁面列印時隱藏導覽與互動區 */
@media print {
  .sidebar, .bottom-nav, .topbar, .context-bar, .offline-banner, .toast-region, .skip-link, .action-bar { display: none !important; }
  body { background: #fff; }
}
