:root {
  color-scheme: light;
  --hr-brand: #2563eb;
  --hr-brand-strong: #1d4ed8;
  --hr-bg: #f6f8fb;
  --hr-surface: #ffffff;
  --hr-text: #111827;
  --hr-muted: #64748b;
  --hr-border: #e2e8f0;
  --hr-ring: rgba(37, 99, 235, 0.18);
  --hr-shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
  --hr-shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.06);
  --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:
    linear-gradient(180deg, rgba(37, 99, 235, 0.04), transparent 260px),
    var(--hr-bg);
}

#root {
  min-width: 0;
}

#root * {
  min-width: 0;
}

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

/* Modern app refresh for the built HR interface */
main {
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.07), transparent 280px),
    transparent;
}

.bg-white.rounded-lg,
.bg-white.rounded-xl,
.bg-white.rounded-2xl,
.bg-white.border,
.shadow-sm.border {
  border-color: rgba(226, 232, 240, 0.9) !important;
  box-shadow: var(--hr-shadow-soft) !important;
}

.bg-white.rounded-lg,
.bg-white.rounded-xl,
.bg-white.rounded-2xl {
  border-radius: 14px !important;
}

.shadow-xl,
.shadow-2xl {
  box-shadow: var(--hr-shadow) !important;
}

aside.bg-gradient-to-b {
  background:
    linear-gradient(180deg, #111827 0%, #0f172a 58%, #082f49 100%) !important;
  border-right-color: rgba(148, 163, 184, 0.18) !important;
}

aside nav a {
  border: 1px solid transparent;
}

aside nav a:hover {
  border-color: rgba(255, 255, 255, 0.08);
}

aside nav a.bg-blue-600 {
  background: rgba(37, 99, 235, 0.95) !important;
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.28) !important;
}

input,
select,
textarea {
  border-radius: 12px !important;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 4px var(--hr-ring) !important;
}

button,
a[role="button"] {
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, color 160ms ease;
}

button:hover,
a[role="button"]:hover {
  transform: translateY(-1px);
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

thead tr {
  background: #f8fafc;
}

th:first-child {
  border-top-left-radius: 12px;
}

th:last-child {
  border-top-right-radius: 12px;
}

#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;
  top: 18px;
  right: 18px;
  bottom: auto;
  left: auto;
  z-index: 75;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: auto;
  min-width: 74px;
  height: 34px;
  margin-top: 0;
  padding: 5px 7px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(14px);
}

.hr-theme-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.hr-theme-track {
  position: relative;
  display: block;
  width: 38px;
  height: 18px;
  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: 12px;
  height: 12px;
  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(18px);
}

@media (min-width: 1024px) {
  main {
    padding-inline: clamp(20px, 2vw, 32px) !important;
  }

  main > div {
    width: min(100%, 1180px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .hr-theme-toggle {
    top: 18px !important;
    right: 18px !important;
    bottom: auto !important;
    left: auto !important;
    min-width: 48px !important;
    width: 48px !important;
    height: 28px !important;
    padding: 4px 5px !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12) !important;
  }

  .hr-theme-toggle .hr-theme-label {
    display: none !important;
  }

  .hr-theme-track {
    width: 36px;
    height: 18px;
  }
}

#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-tools {
  display: none;
}

.hr-more-menu-tools .hr-theme-toggle {
  display: none;
}

.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-gray-400,
html.dark .text-slate-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 .bg-gray-50,
html.dark .bg-slate-50,
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-amber-50,
html.dark .bg-rose-50 {
  color: var(--hr-dark-text) !important;
}

html.dark p,
html.dark label,
html.dark td,
html.dark th,
html.dark li {
  color: inherit;
}

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 button:disabled,
html.dark button[disabled],
html.dark .disabled\:opacity-50:disabled,
html.dark .disabled\:pointer-events-none:disabled {
  background-color: #334155 !important;
  border-color: #475569 !important;
  color: #cbd5e1 !important;
  opacity: 1 !important;
}

html.dark button.bg-gray-100,
html.dark button.bg-gray-200,
html.dark button.hover\:bg-gray-200,
html.dark button.hover\:bg-gray-300,
html.dark a.bg-gray-100,
html.dark a.bg-gray-200,
html.dark .hr-doc-download {
  background-color: #243044 !important;
  border-color: #475569 !important;
  color: #f8fafc !important;
}

html.dark button.bg-gray-100:hover,
html.dark button.bg-gray-200:hover,
html.dark button.hover\:bg-gray-200:hover,
html.dark button.hover\:bg-gray-300:hover,
html.dark a.bg-gray-100:hover,
html.dark a.bg-gray-200:hover,
html.dark .hr-doc-download:hover {
  background-color: #334155 !important;
  color: #ffffff !important;
}

html.dark button.bg-gray-100 *,
html.dark button.bg-gray-200 *,
html.dark button.hover\:bg-gray-200 *,
html.dark button.hover\:bg-gray-300 *,
html.dark button:disabled *,
html.dark button[disabled] *,
html.dark .hr-doc-download * {
  color: currentColor !important;
  stroke: currentColor !important;
}

html.dark button.text-white.bg-gray-100,
html.dark button.text-white.bg-gray-200,
html.dark button.text-white.hover\:bg-gray-300,
html.dark button.text-white:disabled,
html.dark button.text-white[disabled] {
  color: #f8fafc !important;
}

html.dark select option {
  background: #1e293b !important;
  color: #f8fafc !important;
}

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(112px + env(safe-area-inset-bottom));
  }

  main {
    padding: 16px !important;
  }

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

  aside nav {
    padding-bottom: 96px !important;
  }

  aside .border-t.border-slate-700 {
    padding-bottom: calc(104px + env(safe-area-inset-bottom)) !important;
  }

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

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

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

  /* Hide the built-in Notes widget on mobile/tablet. */
  .fixed.bottom-6.right-6.z-40 {
    display: none !important;
  }
}

@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(106px + env(safe-area-inset-bottom)) !important;
    max-width: calc(100vw - 24px) !important;
  }

  .fixed.bottom-6.right-6 .absolute.right-0 {
    right: 0 !important;
    width: min(360px, calc(100vw - 24px)) !important;
    max-height: calc(100dvh - 170px) !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .fixed.bottom-6.right-6 .absolute.right-0 > .max-h-96,
  .fixed.bottom-6.right-6 .max-h-96 {
    max-height: calc(100dvh - 250px) !important;
  }

  .fixed.bottom-6.right-6 textarea {
    min-height: 110px !important;
    font-size: 16px !important;
  }

  .fixed.bottom-6.right-6 button {
    flex-shrink: 0;
  }

  #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 {
    min-width: 68px;
    height: 32px;
    padding: 5px 7px;
  }

  .hr-doc-card > div {
    padding: 0 !important;
  }

  .hr-doc-card-row {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-areas:
      "content action"
      "meta meta" !important;
    align-items: start !important;
    gap: 12px !important;
    width: 100% !important;
  }

  .hr-doc-left {
    grid-area: content !important;
    min-width: 0 !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }

  .hr-doc-left > .flex-shrink-0 > div {
    width: 44px !important;
    height: 44px !important;
  }

  .hr-doc-main {
    min-width: 0 !important;
  }

  .hr-doc-title {
    font-size: 17px !important;
    line-height: 1.25 !important;
    margin-bottom: 6px !important;
    overflow-wrap: anywhere !important;
  }

  .hr-doc-download {
    grid-area: action !important;
    width: auto !important;
    min-width: 116px !important;
    justify-content: center !important;
    white-space: nowrap !important;
    margin-left: 0 !important;
  }

  .hr-doc-meta {
    grid-area: meta !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) auto !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    padding-left: 56px !important;
    margin-top: 2px !important;
    color: #64748b !important;
  }

  .hr-doc-date,
  .hr-doc-uploader {
    display: flex !important;
    align-items: center !important;
    min-width: 0 !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
    white-space: normal !important;
  }

  .hr-doc-date svg,
  .hr-doc-uploader svg {
    flex: 0 0 auto !important;
  }

  .hr-doc-type {
    justify-self: end !important;
    max-width: 92px !important;
    text-align: center !important;
    line-height: 1.2 !important;
    white-space: normal !important;
  }

  /* Documents section cards: keep title, uploader, date, and category readable on phones. */
  main .space-y-4 > .border,
  main .space-y-3 > .border {
    overflow: hidden !important;
  }

  main .space-y-4 > .border .flex.items-start.justify-between,
  main .space-y-3 > .border .flex.items-start.justify-between {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  main .space-y-4 > .border .text-right,
  main .space-y-3 > .border .text-right {
    text-align: left !important;
    margin-left: 0 !important;
    margin-top: 8px !important;
    width: 100% !important;
  }

  main .space-y-4 > .border .flex.items-center.gap-2,
  main .space-y-3 > .border .flex.items-center.gap-2,
  main .space-y-4 > .border .flex.items-center.gap-3,
  main .space-y-3 > .border .flex.items-center.gap-3 {
    flex-wrap: wrap !important;
    align-items: flex-start !important;
  }

  main .space-y-4 > .border .text-sm,
  main .space-y-3 > .border .text-sm,
  main .space-y-4 > .border .text-xs,
  main .space-y-3 > .border .text-xs {
    line-height: 1.35 !important;
  }

  main .space-y-4 > .border span,
  main .space-y-3 > .border span {
    white-space: normal !important;
  }

  main .space-y-4 > .border a,
  main .space-y-3 > .border a,
  main .space-y-4 > .border button,
  main .space-y-3 > .border button {
    flex-shrink: 0;
  }
}

@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);
  }

  .hr-doc-card-row {
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "content"
      "action"
      "meta" !important;
  }

  .hr-doc-download {
    justify-self: stretch !important;
    width: 100% !important;
  }

  .hr-doc-meta {
    grid-template-columns: 1fr !important;
    padding-left: 56px !important;
    align-items: start !important;
  }

  .hr-doc-type {
    justify-self: start !important;
    max-width: 100% !important;
  }

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

  .fixed.bottom-6.right-6 > button {
    min-height: 44px;
  }
}

/* Final mobile Documents card polish. The document metadata lives inside the
   text column, so keep the card anatomy simple and predictable on phones. */
@media (max-width: 768px) {
  .hr-doc-card > div {
    padding: 16px !important;
  }

  .hr-doc-card-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
  }

  .hr-doc-left {
    display: grid !important;
    grid-template-columns: 52px minmax(0, 1fr) !important;
    column-gap: 12px !important;
    align-items: start !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .hr-doc-left > :not([hidden]) ~ :not([hidden]) {
    margin-left: 0 !important;
  }

  .hr-doc-left > .flex-shrink-0 > div {
    width: 52px !important;
    height: 52px !important;
    border-radius: 12px !important;
  }

  .hr-doc-main {
    min-width: 0 !important;
    padding-top: 1px !important;
  }

  .hr-doc-title {
    font-size: 17px !important;
    line-height: 1.28 !important;
    margin-bottom: 5px !important;
  }

  .hr-doc-meta {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 7px !important;
    width: 100% !important;
    padding-left: 0 !important;
    margin-top: 14px !important;
    color: #64748b !important;
  }

  .hr-doc-date,
  .hr-doc-uploader {
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    font-size: 14px !important;
    line-height: 1.25 !important;
    white-space: normal !important;
  }

  .hr-doc-type {
    justify-self: start !important;
    max-width: 100% !important;
    padding: 5px 10px !important;
    line-height: 1.2 !important;
    white-space: normal !important;
  }

  .hr-doc-download {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 42px !important;
    justify-content: center !important;
    border-radius: 12px !important;
    margin-left: 0 !important;
  }

  .hr-theme-toggle {
    min-width: 52px !important;
    height: 34px !important;
    padding: 5px 7px !important;
  }

  .hr-theme-label {
    display: none !important;
  }
}

html.dark thead tr,
html.dark th {
  background: #1e293b !important;
  color: #e2e8f0 !important;
}

html.dark tbody tr {
  background: transparent !important;
}

html.dark td {
  color: #f8fafc !important;
}

html.dark .hr-doc-card,
html.dark .hr-doc-card > div {
  background: #172033 !important;
  border-color: #334155 !important;
}

.hr-doc-card {
  border-radius: 16px !important;
  overflow: hidden !important;
}

.hr-doc-card > div {
  border-radius: inherit !important;
}

html.dark .hr-doc-meta,
html.dark .hr-doc-date,
html.dark .hr-doc-uploader {
  color: #cbd5e1 !important;
}

html.dark .hr-doc-type {
  background: #243044 !important;
  color: #f8fafc !important;
}

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