/* Muir PowerSync styles - extracted from index.html */
/* Night Shift design tokens (Nov 2026). Every colour, size, space and
   radius the app uses should come from here; theme-night-shift.css builds
   the components on top. Contrast is measured against WCAG 2.2 AA:
   body text >= 4.5:1, input borders and focus rings >= 3:1. */
:root {
  /* Safe areas (iPhone notch / Dynamic Island / home indicator). One place
     to read them: env() when WebKit reports it, never less than the
     --safe-*-min floor app.js sets when an installed iOS web app reports 0
     under a black-translucent status bar (the 2.3.63 header-under-the-
     clock bug). Tests set the floor to simulate a notch. */
  --safe-top: max(env(safe-area-inset-top, 0px), var(--safe-top-min, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--safe-bottom-min, 0px));
  --safe-left: max(env(safe-area-inset-left, 0px), var(--safe-left-min, 0px));
  --safe-right: max(env(safe-area-inset-right, 0px), var(--safe-right-min, 0px));
  /* Surfaces */
  --bg-dark: #070b16;
  --card-dark: #111a2c;
  --bg-card: #111a2c;
  --surface-glass: rgba(255, 255, 255, 0.055);
  --surface-glass-strong: rgba(255, 255, 255, 0.085);
  --surface-glass-border: rgba(255, 255, 255, 0.12);
  --input-bg: #0a1120;
  /* Brand + status. Text ON a brand/status fill is always --on-accent
     (dark): white on #38bdf8 measured 2.14:1, #04111f on it 8.87:1. */
  --primary: #38bdf8;
  --primary-2: #818cf8;
  --primary-gradient: linear-gradient(135deg, #38bdf8, #818cf8);
  --on-accent: #04111f;
  /* The one text colour for primary buttons (7.2): dark on the light
     --primary fill, 8.87:1. No other rule or inline style may set a
     primary button's text colour. */
  --on-primary: #04111f;
  --success: #4ade80;
  --warning: #f59e0b;
  --danger: #f87171;
  /* Text */
  --text-main: #f1f5f9;
  --text-muted: #a5b4c8;
  /* Lines. --border is decorative (dividers, card edges); anything a
     user has to find, like an input's edge, uses --input-border. */
  --border: #26344d;
  --input-border: #7186a3;
  --focus-ring: #7dd3fc;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  /* Spacing (4px base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --tap: 48px;
  --ir-accent: #2dd4bf;
  --load-accent: #a884ff;
  --chat-accent: #a855f7;
  --commission-accent: #eab308;
  --daily-accent: #818cf8;
  --notes-accent: #fb7185;
  --parts-accent: #fb923c;
  --gi-accent: #84cc16;
  --job-accent: #f59e0b;
  /* Day-add picker block tiles (2.4.67): the four ways to add to the
     day take colours of their own in the report tiles' style. Like
     --job-accent they stay OUT of the styles-polish unify list, so
     they keep their own hues in the running app. */
  --tower-accent: #60a5fa;
  --travel-accent: #f472b6;
  --standby-accent: #e879f9;
  --stock-accent: #818cf8;
  --pdi-accent: #ec4899;
  --import-accent: #6366f1;
  --workorder-accent: #22d3ee;
  --files-accent: #34d399;
  --timesheet-accent: #c084fc;
  /* Medal language (2.3.98): the Achievements coin, shared app-wide.
     One accent per area, used on a border or a glow — never as a button
     fill. Contrast is against Night Shift (#070b16 page, #141c31 cards),
     WCAG 2.2 AA (normal text >= 4.5:1):
       --kpi-cyan #7ad7f0 on #070b16          12.0:1
       --kpi-cyan-bright #a5e3ff on #141c31   12.1:1
       --medal-gold #fbbf24 on #141c31        10.1:1
       --medal-ink #1c1300 on --medal-gold    11.0:1
       --medal-ink on --medal-gold-lo #d97706  5.8:1
     Cyan is for numbers on the dark surfaces. Text on a gold fill is
     --medal-ink, never cyan (cyan on gold is about 1.2:1). */
  --kpi-cyan: #7ad7f0;
  --kpi-cyan-bright: #a5e3ff;
  --medal-gold-hi: #fef3c7;
  --medal-gold: #fbbf24;
  --medal-gold-lo: #d97706;
  --medal-ink: #1c1300;
  --ring-spectrum: conic-gradient(
    from 210deg,
    #fde68a,
    #f59e0b,
    #fb7185,
    #818cf8,
    #38bdf8,
    #2dd4bf,
    #fde68a
  );
  --glow-cyan: 0 0 18px rgba(56, 189, 248, 0.35);
  --glow-gold: 0 4px 14px rgba(251, 191, 36, 0.4);
  --glow-rose: 0 0 14px rgba(251, 113, 133, 0.35);
  --glow-amber: 0 0 14px rgba(245, 158, 11, 0.35);
  --area-assets: #38bdf8;
  --area-reports: #818cf8;
  --area-manuals: #2dd4bf;
  --area-more: #7dd3fc;
  --area-parts: #fb923c;
  --area-faults: #fb7185;
  --area-ops: #a78bfa;
  --cert-accent: #fbbf24;
  /* Typography scale - consolidates what had drifted into 16+
               near-identical one-off sizes (0.66rem, 0.68rem, 0.72rem...)
               picked ad hoc as features were added over time, with no
               functional difference between neighbors. Deliberately
               doesn't include h1 (1.4rem) or .stat-val (1.8rem) - both
               are intentional standalone "hero" sizes doing a distinct
               job, not part of this small-text scale. */
  /* Night Shift: five steps, nothing on screen below 14px. The two old
     smaller names are kept as aliases so existing rules can't go under. */
  --fs-sm: 0.875rem; /* 14px - captions, hints, meta */
  --fs-md: 1rem; /* 16px - body, inputs, buttons */
  --fs-lg: 1.125rem; /* 18px - card titles, primary buttons */
  --fs-xl: 1.5rem; /* 24px - screen titles */
  --fs-2xl: 2.25rem; /* 36px - landing headline (phone) */
  --fs-2xs: var(--fs-sm);
  --fs-xs: var(--fs-sm);
  /* Border-radius scale - this one was already a mostly-coherent
               progressive system (small elements -> cards -> panels ->
               pills), just not tokenized. Only real fix: 6px and 8px had
               no functional distinction between them and are merged into
               one step. .battery-container's 2px is deliberately left
               alone - a tiny decorative indicator, not part of this
               content-radius scale. */
  --radius-2xs: 4px;
  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 14px;
  --radius-xl: 16px;
  --radius-pill: 20px;
  /* Night Shift component radii */
  --radius-btn: 14px;
  --radius-card: 20px;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  -webkit-tap-highlight-color: transparent;
}
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
/* Safe-area insets are added to the base padding rather than replacing
           it. The previous rule set padding-top to the inset outright, so on
           any device or WebView reporting no inset the top padding collapsed to
           zero and the heading sat against the status bar. The bottom inset is
           new and matters more once this is a native app: without it, content
           and the update banner sit underneath the iOS home indicator.
           These only report a real value when the viewport meta says
           viewport-fit=cover, which it now does. */
body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  padding: 16px;
  padding-top: calc(16px + var(--safe-top));
  padding-bottom: calc(16px + var(--safe-bottom));
  padding-left: calc(16px + var(--safe-left));
  padding-right: calc(16px + var(--safe-right));
  max-width: 600px;
  margin: 0 auto;
  overflow-x: hidden;
  line-height: 1.45;
}

/* Battery Animation */
.battery-container {
  display: inline-block;
  width: 24px;
  height: 12px;
  border: 1px solid currentColor;
  border-radius: 2px;
  position: relative;
  margin-right: 8px;
}
.battery-container::after {
  content: '';
  position: absolute;
  right: -3px;
  top: 2px;
  width: 2px;
  height: 6px;
  background: currentColor;
  border-radius: 1px;
}
.battery-fill {
  height: 100%;
  width: 0%;
  background: currentColor;
  transition: width 0.3s ease;
}
@keyframes charging {
  0% {
    width: 0%;
  }
  50% {
    width: 100%;
  }
  100% {
    width: 0%;
  }
}
@keyframes sync-pulse {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}
.sync-pulse {
  animation: sync-pulse 0.4s ease;
}
.charging .battery-fill {
  animation: charging 1.5s infinite;
}
.warning-highlight {
  border: 2px solid var(--warning) !important;
  box-shadow: 0 0 5px var(--warning);
}
