@tailwind base;
@tailwind components;
@tailwind utilities;

/* UI standard: light default, primary #3b82f6, accent #10b981 */
@layer base {
  :root {
    --primary: #3b82f6;
    --accent: #10b981;
    --background: #f8fafc;
    --foreground: #0f172a;
    --card: #ffffff;
    --card-foreground: #0f172a;
    --border: #e2e8f0;
    --muted: #64748b;
  }
  .dark {
    --background: #0f172a;
    --foreground: #f1f5f9;
    --card: #1e293b;
    --card-foreground: #f1f5f9;
    --border: #334155;
    --muted: #94a3b8;
  }
}

html,
body {
  overscroll-behavior: none;
}

/* /po/workbench: lock document scroll (see `data-po-workbench-layout` on route layout). */
/* Intentionally no `scrollbar-gutter: stable` on html/body: document does not scroll here, */
/* and the gutter would inset the app from the viewport edge for no benefit. */
html:has([data-po-workbench-layout]) {
  overflow: hidden;
}
html:has([data-po-workbench-layout]) body {
  overflow: hidden;
}

/* Tablet/mobile: stable layout when virtual keyboard opens */
html {
  /* Prefer dynamic viewport height so layout can adapt to keyboard (if browser resizes) */
  height: 100%;
  /* Base font size: slightly larger for readability */
  font-size: 16px;
}
@media (min-width: 640px) {
  html {
    font-size: 17px;
  }
}
@media (min-width: 1024px) {
  html {
    font-size: 18px;
  }
}
body {
  min-height: 100%;
  min-height: 100dvh;
  background-color: var(--background);
  color: var(--foreground);
  font-size: 1rem;
  line-height: 1.6;
}

/* Full-height containers: use dvh so keyboard doesn’t squash the layout when overlay is used */
@media (max-width: 1024px) {
  .min-h-screen {
    min-height: 100dvh;
  }
}

/* Avoid iOS zoom on input focus (keep inputs ≥16px where possible) */
@media (max-width: 1024px) {
  input,
  select,
  textarea {
    font-size: max(16px, 1rem);
  }
}

.app-search-criteria {
  border-radius: 8px;
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-left-color: var(--primary);
  background-color: var(--card);
  box-shadow:
    0 1px 3px 0 rgb(0 0 0 / 0.1),
    0 1px 2px -1px rgb(0 0 0 / 0.1);
}

.app-search-criteria-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
