:root {
  color-scheme: light;
  --hr-brand: #2563eb;
  --hr-brand-strong: #1d4ed8;
  --hr-bg: #f8fafc;
  --hr-surface: #ffffff;
  --hr-text: #111827;
  --hr-muted: #64748b;
  --hr-border: #e2e8f0;
  --hr-dark-bg: #0f172a;
  --hr-dark-surface: #172033;
  --hr-dark-surface-2: #1e293b;
  --hr-dark-text: #f8fafc;
  --hr-dark-muted: #cbd5e1;
  --hr-dark-border: #334155;
}

html {
  min-height: 100%;
  background: var(--hr-bg);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  overflow-x: hidden;
  background: var(--hr-bg);
}

#root {
  min-width: 0;
}

#root * {
  min-width: 0;
}

button,
select,
input,
textarea {
  font-size: 16px;
}

#pwa-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 15%, rgba(37, 99, 235, 0.26), transparent 32%),
    radial-gradient(circle at 80% 85%, rgba(16, 185, 129, 0.22), transparent 34%),
    linear-gradient(135deg, #0f172a 0%, #172554 52%, #0f766e 100%);
  color: #ffffff;
  transition: opacity 260ms ease, visibility 260ms ease;
}

#pwa-splash.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.pwa-splash-card {
  display: flex;
  align-items: center;
  gap: 18px;
  width: min(360px, calc(100% - 48px));
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(18px);
}

.pwa-splash-icon {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
}

.pwa-splash-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
  font-weight: 800;
}

.pwa-splash-subtitle {
  margin: 6px 0 0;
  color: #dbeafe;
  font-size: 14px;
}

#hr-install-banner {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(640px, calc(100% - 32px));
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.2);
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
  backdrop-filter: blur(16px);
}

#hr-install-banner.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.hr-install-copy {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.hr-install-copy img {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
}

.hr-install-copy strong,
.hr-install-copy span {
  display: block;
}

.hr-install-copy strong {
  color: #0f172a;
  font-size: 15px;
  line-height: 1.2;
}

.hr-install-copy span {
  color: #64748b;
  font-size: 13px;
  line-height: 1.35;
}

.hr-install-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.hr-install-primary,
.hr-install-secondary {
  border: 0;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  padding: 11px 14px;
}

.hr-install-primary {
  background: var(--hr-brand);
  color: #ffffff;
}

.hr-install-secondary {
  background: #f1f5f9;
  color: #334155;
}

.hr-theme-toggle {
  position: fixed;
  left: 18px;
  top: 86px;
  z-index: 75;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 104px;
  height: 44px;
  padding: 7px 10px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(14px);
}

.hr-theme-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.hr-theme-track {
  position: relative;
  display: block;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #dbeafe;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.18);
  transition: background 180ms ease, box-shadow 180ms ease;
}

.hr-theme-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #2563eb;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.32);
  transition: transform 180ms ease, background 180ms ease;
}

html.dark .hr-theme-track {
  background: #334155;
  box-shadow: inset 0 0 0 1px rgba(203, 213, 225, 0.16);
}

html.dark .hr-theme-thumb {
  background: #f8fafc;
  transform: translateX(16px);
}

html.dark .hr-theme-moon,
html:not(.dark) .hr-theme-sun {
  color: #2563eb;
}

#hr-mobile-menu {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 70;
  display: none;
  width: min(760px, calc(100% - 24px));
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

#hr-mobile-menu a,
#hr-mobile-menu button {
  display: flex;
  min-width: 0;
  min-height: 54px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: #64748b;
  text-decoration: none;
}

#hr-mobile-menu span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 20px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
}

#hr-mobile-menu strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

#hr-mobile-menu a.is-active {
  background: #dbeafe;
  color: #1d4ed8;
}

#hr-more-menu {
  position: fixed;
  left: 50%;
  bottom: calc(max(12px, env(safe-area-inset-bottom)) + 86px);
  z-index: 74;
  display: none;
  width: min(420px, calc(100% - 24px));
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.2);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

#hr-more-menu.is-open {
  display: block;
}

.hr-more-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 10px;
  color: #0f172a;
}

.hr-more-menu-header strong {
  font-size: 15px;
}

.hr-more-menu-header button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 12px;
  background: #f1f5f9;
  color: #334155;
  font-size: 20px;
  line-height: 1;
}

.hr-more-menu-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.hr-more-menu-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 16px;
  background: #f8fafc;
  color: #334155;
  text-decoration: none;
}

.hr-more-menu-links a.is-active {
  background: #dbeafe;
  color: #1d4ed8;
}

.hr-more-menu-links span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  font-weight: 800;
}

.hr-more-menu-links strong {
  font-size: 13px;
  line-height: 1;
}

html.dark {
  color-scheme: dark;
  background: var(--hr-dark-bg);
}

html.dark body,
html.dark .bg-gray-50,
html.dark .bg-slate-50,
html.dark .from-slate-50,
html.dark .to-white {
  background: var(--hr-dark-bg) !important;
}

html.dark .bg-white,
html.dark .bg-gray-100,
html.dark .bg-blue-50,
html.dark .bg-green-50,
html.dark .bg-yellow-50,
html.dark .bg-red-50,
html.dark .bg-emerald-50,
html.dark .bg-rose-50,
html.dark .bg-amber-50,
html.dark .bg-pink-50,
html.dark .bg-orange-50,
html.dark .bg-purple-100,
html.dark .bg-blue-100,
html.dark .bg-green-100,
html.dark .bg-yellow-100,
html.dark .bg-red-100 {
  background-color: var(--hr-dark-surface) !important;
}

html.dark .text-gray-900,
html.dark .text-gray-800,
html.dark .text-slate-900,
html.dark .text-blue-900,
html.dark .text-green-900,
html.dark .text-yellow-900,
html.dark .text-red-800,
html.dark .text-amber-900,
html.dark .text-orange-900,
html.dark .text-pink-900 {
  color: var(--hr-dark-text) !important;
}

html.dark .text-gray-700,
html.dark .text-gray-600,
html.dark .text-gray-500,
html.dark .text-slate-700,
html.dark .text-slate-600,
html.dark .text-blue-700,
html.dark .text-green-700,
html.dark .text-yellow-700,
html.dark .text-amber-700 {
  color: var(--hr-dark-muted) !important;
}

html.dark .border-gray-100,
html.dark .border-gray-200,
html.dark .border-gray-300,
html.dark .divide-gray-200 > :not([hidden]) ~ :not([hidden]),
html.dark .border-blue-200,
html.dark .border-green-200,
html.dark .border-yellow-200,
html.dark .border-red-200,
html.dark .border-amber-200 {
  border-color: var(--hr-dark-border) !important;
}

html.dark input,
html.dark select,
html.dark textarea {
  background-color: var(--hr-dark-surface-2) !important;
  border-color: var(--hr-dark-border) !important;
  color: var(--hr-dark-text) !important;
}

html.dark input::placeholder,
html.dark textarea::placeholder {
  color: #94a3b8 !important;
}

html.dark table,
html.dark tbody,
html.dark thead,
html.dark tr {
  color: var(--hr-dark-text);
}

html.dark tr:hover,
html.dark .hover\:bg-gray-50:hover,
html.dark .hover\:bg-gray-100:hover {
  background-color: rgba(51, 65, 85, 0.55) !important;
}

html.dark #hr-install-banner {
  background: rgba(15, 23, 42, 0.94);
  border-color: var(--hr-dark-border);
}

html.dark .hr-install-copy strong {
  color: var(--hr-dark-text);
}

html.dark .hr-install-copy span {
  color: var(--hr-dark-muted);
}

html.dark .hr-install-secondary {
  background: #1e293b;
  color: #e2e8f0;
}

html.dark .hr-theme-toggle {
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  border-color: var(--hr-dark-border);
}

html.dark #hr-mobile-menu,
html.dark #hr-more-menu {
  background: rgba(15, 23, 42, 0.94);
  border-color: var(--hr-dark-border);
}

html.dark #hr-mobile-menu a,
html.dark #hr-mobile-menu button {
  color: #cbd5e1;
}

html.dark #hr-mobile-menu a.is-active,
html.dark .hr-more-menu-links a.is-active {
  background: rgba(37, 99, 235, 0.24);
  color: #bfdbfe;
}

html.dark .hr-more-menu-header {
  color: #f8fafc;
}

html.dark .hr-more-menu-header button,
html.dark .hr-more-menu-links a {
  background: #1e293b;
  color: #e2e8f0;
}

@media (max-width: 1023px) {
  body {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  main {
    padding: 16px !important;
  }

  aside {
    max-width: min(88vw, 320px);
  }

  .max-w-7xl,
  .max-w-5xl,
  .max-w-4xl,
  .max-w-2xl {
    max-width: 100% !important;
  }

  #hr-mobile-menu {
    display: grid;
  }

  .hr-theme-toggle {
    left: auto;
    right: max(18px, env(safe-area-inset-right));
    top: auto;
    bottom: calc(max(12px, env(safe-area-inset-bottom)) + 88px);
  }
}

@media (max-width: 768px) {
  body {
    width: 100%;
  }

  main > div {
    width: 100% !important;
  }

  .text-4xl {
    font-size: 2rem !important;
    line-height: 2.35rem !important;
  }

  .text-3xl {
    font-size: 1.65rem !important;
    line-height: 2.05rem !important;
  }

  .text-2xl {
    font-size: 1.35rem !important;
    line-height: 1.75rem !important;
  }

  .p-8,
  .p-6 {
    padding: 1rem !important;
  }

  .px-6 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .py-4 {
    padding-top: 0.85rem !important;
    padding-bottom: 0.85rem !important;
  }

  .mb-8 {
    margin-bottom: 1.25rem !important;
  }

  .gap-6 {
    gap: 1rem !important;
  }

  .flex.items-center.justify-between {
    flex-wrap: wrap;
    align-items: flex-start !important;
    gap: 12px;
  }

  .flex.gap-3 {
    flex-wrap: wrap;
    width: 100%;
  }

  .flex.gap-3 > select,
  .flex.gap-3 > input,
  .flex.gap-3 > button,
  .flex.gap-3 > a {
    flex: 1 1 150px;
  }

  .grid.grid-cols-1,
  .md\:grid-cols-2,
  .md\:grid-cols-3,
  .md\:grid-cols-4,
  .lg\:grid-cols-2,
  .lg\:grid-cols-3,
  .lg\:grid-cols-4 {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .grid-cols-2,
  .grid-cols-3 {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .grid-cols-7 {
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  }

  .col-span-2,
  .md\:col-span-2,
  .lg\:col-span-2,
  .lg\:col-span-3 {
    grid-column: auto !important;
  }

  select,
  input[type="month"],
  input[type="date"],
  input[type="text"],
  input[type="email"],
  input[type="password"],
  textarea {
    width: 100% !important;
    max-width: 100%;
  }

  .w-80,
  .w-64,
  .max-w-md,
  .max-w-lg,
  .max-w-xs {
    width: 100% !important;
    max-width: 100% !important;
  }

  table {
    min-width: 720px;
  }

  .overflow-x-auto {
    -webkit-overflow-scrolling: touch;
    max-width: calc(100vw - 24px);
  }

  .fixed.inset-0 .max-w-md,
  .fixed.inset-0 .max-w-2xl,
  .fixed.inset-0 .max-w-4xl,
  .fixed.inset-0 .max-w-5xl {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    max-height: calc(100dvh - 32px) !important;
    overflow-y: auto !important;
  }

  .fixed.bottom-6.right-6 {
    right: 12px !important;
    bottom: calc(96px + env(safe-area-inset-bottom)) !important;
  }

  .fixed.bottom-6.right-6 .absolute.right-0 {
    right: 0 !important;
    width: min(320px, calc(100vw - 24px)) !important;
  }

  #hr-install-banner {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .hr-install-actions {
    width: 100%;
  }

  .hr-install-primary,
  .hr-install-secondary {
    flex: 1 1 0;
  }

  .hr-theme-toggle {
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(max(12px, env(safe-area-inset-bottom)) + 88px);
    min-width: 96px;
    height: 40px;
    padding: 6px 8px;
  }
}

@media (max-width: 480px) {
  main {
    padding: 12px !important;
  }

  .grid {
    min-width: 0;
  }

  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-7 {
    gap: 0.5rem;
  }

  .h-64,
  .h-40,
  .max-h-\[700px\],
  .max-h-\[600px\],
  .max-h-\[500px\] {
    max-height: calc(100dvh - 180px) !important;
  }

  .text-center.p-12,
  .py-12 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }

  .inline-flex,
  .inline-block {
    max-width: 100%;
  }

  button,
  a,
  select {
    white-space: normal;
  }

  .rounded-2xl {
    border-radius: 0.875rem !important;
  }

  .pwa-splash-card {
    flex-direction: column;
    text-align: center;
  }

  #hr-mobile-menu {
    width: calc(100% - 16px);
    gap: 4px;
    padding: 6px;
    border-radius: 18px;
  }

  #hr-mobile-menu a,
  #hr-mobile-menu button {
    min-height: 50px;
    border-radius: 14px;
  }

  #hr-mobile-menu strong {
    font-size: 10px;
  }

  #hr-more-menu {
    width: calc(100% - 16px);
  }
}

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