/* Nurse Clock OS3 — reset, typography, layout primitives */
*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  font: 400 16px/1.5 var(--font); color: var(--text);
  background-color: var(--bg); background-image: var(--pattern); background-size: 120px 120px;
  overflow-x: hidden; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
}
h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
h1 { font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 20px; line-height: 1.3; font-weight: 650; letter-spacing: -.01em; }
h3 { font-size: 15px; line-height: 1.35; font-weight: 600; color: var(--sub); }
small { font-size: 13px; }
a { color: var(--accent); text-decoration: none; }
img, svg, video { display: block; max-width: 100%; }
svg.i { flex: none; display: inline-block; vertical-align: middle; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; touch-action: manipulation; }
button:disabled, input:disabled, select:disabled, textarea:disabled { opacity: .45; cursor: default; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); }
[hidden], .hide { display: none !important; }

/* ---------- ตัวเลขใหญ่ (เลข 600 + หน่วยเล็ก 45% สี sub) ---------- */
.num { font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.03em; line-height: 1; }
.num small, .num .u { font-size: .45em; font-weight: 500; color: var(--sub); letter-spacing: 0; margin-left: .12em; }
.num-xl { font-size: 64px; }
.num-l { font-size: 44px; }
.num-m { font-size: 30px; }
.num-s { font-size: 22px; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- ข้อความ ---------- */
.sub { color: var(--sub); }
.mut { color: var(--mut); }
.muted { color: var(--sub); font-size: 14px; }
.small { font-size: 13px; color: var(--sub); }
.label { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--sub); }
.acc { color: var(--accent); }
.ok-t { color: var(--ok); } .warn-t { color: var(--warn); } .danger-t { color: var(--danger); }
.ellip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.center { text-align: center; }
.b { font-weight: 600; }

/* ---------- เลย์เอาต์ ---------- */
#app { min-height: 100vh; min-height: 100dvh; }
.view {
  max-width: 680px; margin: 0 auto;
  padding: calc(12px + var(--safe-t)) var(--pad) calc(var(--nav-h) + 32px + var(--safe-b));
}
.view.wide { max-width: 1180px; }
.view.full { padding-bottom: calc(24px + var(--safe-b)); }
.app.nonav .view { padding-bottom: calc(24px + var(--safe-b)); }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row.top { align-items: flex-start; }
.row.base { align-items: baseline; }
.col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sp { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }
.stack > * + * { margin-top: var(--gap); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.hscroll { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--pad)); padding: 0 var(--pad); scroll-snap-type: x proximity; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { flex: none; scroll-snap-align: start; }
.mt0 { margin-top: 0 !important; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }
.divider { height: 1px; background: var(--line); margin: 12px 0; border: 0; }

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