@import "tailwindcss";
@import "tw-animate-css";

@custom-variant dark (&:is(.dark *));

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-ring: var(--ring);
  --color-input: var(--input);
  --color-border: var(--border);
  --color-destructive: var(--destructive);
  --color-accent-foreground: var(--accent-foreground);
  --color-accent: var(--accent);
  --color-muted-foreground: var(--muted-foreground);
  --color-muted: var(--muted);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-secondary: var(--secondary);
  --color-primary-foreground: var(--primary-foreground);
  --color-primary: var(--primary);
  --color-popover-foreground: var(--popover-foreground);
  --color-popover: var(--popover);
  --color-card-foreground: var(--card-foreground);
  --color-card: var(--card);
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
}

:root {
  --radius: 0.75rem;
  --background: oklch(0.985 0.004 285);
  --foreground: oklch(0.18 0.02 285);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.18 0.02 285);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.18 0.02 285);
  --primary: oklch(0.55 0.2 280);
  --primary-foreground: oklch(0.99 0 0);
  --secondary: oklch(0.94 0.006 285);
  --secondary-foreground: oklch(0.18 0.02 285);
  --muted: oklch(0.94 0.006 285);
  --muted-foreground: oklch(0.48 0.02 285);
  --accent: oklch(0.94 0.006 285);
  --accent-foreground: oklch(0.18 0.02 285);
  --destructive: oklch(0.55 0.22 25);
  --border: oklch(0.89 0.008 285);
  --input: oklch(0.89 0.008 285);
  --ring: oklch(0.55 0.2 280);
  /* Chart series hue. One sequential blue, picked per mode rather than flipped:
     this step clears 3:1 on the light chart surface (3.54:1) and the dark step
     below clears it on the dark one (6.96:1). Changing either means re-checking
     that contrast, not just picking a nicer blue. */
  --chart-line: #3987e5;
}

.dark {
  --background: oklch(0.16 0.012 285);
  --foreground: oklch(0.94 0.006 285);
  --card: oklch(0.20 0.013 285);
  --card-foreground: oklch(0.94 0.006 285);
  --popover: oklch(0.20 0.013 285);
  --popover-foreground: oklch(0.94 0.006 285);
  --primary: oklch(0.70 0.17 285);
  --primary-foreground: oklch(0.16 0.012 285);
  --secondary: oklch(0.24 0.013 285);
  --secondary-foreground: oklch(0.94 0.006 285);
  --muted: oklch(0.24 0.013 285);
  --muted-foreground: oklch(0.62 0.015 285);
  --accent: oklch(0.26 0.013 285);
  --accent-foreground: oklch(0.94 0.006 285);
  --destructive: oklch(0.65 0.2 25);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 12%);
  --ring: oklch(0.70 0.17 285);
  --chart-line: #6da7ec;
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }
  body {
    @apply bg-background text-foreground;
  }
  /* Prevent iOS auto-zoom on input focus */
  input, select, textarea {
    font-size: 16px;
  }
  @media (min-width: 768px) {
    input, select, textarea {
      font-size: 14px;
    }
  }
}

.safe-bottom {
  padding-bottom: max(env(safe-area-inset-bottom), 0px);
}

.safe-top {
  padding-top: max(env(safe-area-inset-top), 1rem);
}

@media all and (display-mode: standalone) {
  .browser-only { display: none; }
}
