:root {
  --bg: #f2f2f7;
  --ink: #111827;
  --muted: #6b7280;
  --card: #ffffff;
  --glass: #ffffff;
  --glass-strong: #ffffff;
  --glass-edge: rgba(60, 60, 67, 0.12);
  --line: rgba(60, 60, 67, 0.16);
  --blue: #007aff;
  --blue-2: #0a84ff;
  --green: #34c759;
  --amber: #ff9500;
  --red: #ff3b30;
  --purple: #5856d6;
  --cyan: #5ac8fa;
  --dark: #1c1c1e;
  --soft: #f2f2f7;
  --paper: #ffffff;
  --shadow: 0 18px 42px rgba(17, 24, 39, 0.07);
  --glass-shadow: 0 10px 30px rgba(17, 24, 39, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.88);
  --font-display: "SF Pro Display", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--font-body);
}

/* Crew intro uses real CrewCal UI patterns instead of promotional photography. */
.crew-intro-view {
  min-height: calc(100vh - 40px);
  display: grid;
  align-content: start;
  gap: 16px;
  padding: max(24px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
  color: var(--ink);
  background: var(--cc-fill);
}

.crew-intro-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.crew-intro-header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(32px, 9vw, 48px);
  line-height: .98;
}

.crew-intro-header .text-button { color: var(--cc-muted); }

.crew-intro-view .welcome-carousel {
  display: grid;
  min-height: 430px;
}

.crew-intro-view .welcome-slide {
  display: grid;
  align-content: start;
  gap: 10px;
  animation: onboardingRise 320ms ease both;
}

.crew-intro-view .welcome-slide[hidden] { display: none; }

.crew-intro-view .welcome-slide h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(30px, 8.2vw, 44px);
  line-height: .98;
}

.crew-intro-view .welcome-slide > p:last-child {
  max-width: 36ch;
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.welcome-slide-eyebrow {
  margin: 0;
  color: var(--cc-blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.welcome-ui-preview {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 230px;
  padding: 16px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--cc-card);
  box-shadow: var(--cc-shadow);
}

.preview-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.preview-toolbar i {
  margin-left: auto;
  color: var(--cc-blue);
  font-size: 20px;
  font-style: normal;
}

.preview-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e24747;
}

.preview-dot--blue { background: var(--cc-blue); }
.preview-dot--orange { background: #c87512; }

.preview-file-row,
.preview-alert-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--cc-fill-strong);
  color: var(--ink);
}

.preview-file-row b,
.preview-alert-row b { display: block; font-size: 13px; }

.preview-file-row small,
.preview-alert-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.preview-file-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  color: #c64235;
  background: #fde9e6;
  font-size: 11px;
  font-weight: 900;
}

.preview-file-icon--blue {
  color: var(--cc-blue);
  background: #e4efff;
  font-size: 20px;
}

.preview-upload-arrow,
.preview-check {
  color: var(--cc-blue);
  font-size: 22px;
  font-weight: 900;
}

.preview-check { color: #18845b; }

.preview-calendar-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.preview-calendar-strip span,
.preview-calendar-strip b {
  display: grid;
  place-items: center;
  gap: 5px;
  padding: 10px 4px;
  border-radius: 10px;
  background: var(--cc-fill-strong);
  color: var(--cc-muted);
  font-size: 11px;
  font-weight: 800;
}

.preview-calendar-strip b {
  color: var(--ink);
  background: var(--cc-card);
  box-shadow: 0 5px 12px rgba(15, 23, 42, .08);
}

.preview-calendar-strip b.is-selected {
  outline: 2px solid var(--cc-blue);
  outline-offset: 1px;
}

.preview-calendar-strip small {
  color: var(--cc-blue);
  font-size: 9px;
}

.preview-activity-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-left: 3px solid var(--cc-blue);
  background: #edf5ff;
  color: var(--ink);
  font-size: 11px;
}

.preview-activity-row--purple {
  border-left-color: #7458bd;
  background: #f2effb;
}

.preview-activity-row span,
.preview-activity-row time { color: var(--muted); }

.preview-module-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.preview-module-pills span {
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--cc-blue);
  background: #e5efff;
  font-size: 10px;
  font-weight: 800;
}

.preview-alert-row--red { border-left: 3px solid #e24747; }
.preview-alert-row--orange { border-left: 3px solid #c87512; }

.preview-alert-row > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  background: #18845b;
  font-weight: 900;
}

.preview-alert-row--red > span { background: #e24747; }
.preview-alert-row--orange > span { background: #c87512; }

.welcome-carousel-controls {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 12px;
}

.welcome-carousel-arrow {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--cc-card);
  color: var(--ink);
  font-size: 24px;
}

.welcome-carousel-arrow:disabled { opacity: .35; }

.welcome-carousel-next {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: var(--cc-blue);
  color: #fff;
  font-weight: 800;
}

.welcome-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.welcome-carousel-dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--line);
}

.welcome-carousel-dots button.is-active {
  width: 22px;
  background: var(--cc-blue);
}

.crew-intro-start {
  width: 100%;
  min-height: 52px;
  border-radius: 14px;
}

body.theme-night .crew-intro-view { background: var(--cc-fill); }

body.theme-night .preview-file-icon {
  color: #ff8a7c;
  background: rgba(255, 138, 124, .16);
}

body.theme-night .preview-file-icon--blue,
body.theme-night .preview-module-pills span {
  color: #8fc1ff;
  background: rgba(73, 145, 255, .16);
}

body.theme-night .preview-activity-row { background: rgba(73, 145, 255, .14); }
.theme-night .preview-activity-row--purple { background: rgba(116, 88, 189, .18); }

@media (max-width: 390px) {
  .crew-intro-view { padding-inline: 14px; }
  .crew-intro-view .welcome-carousel { min-height: 400px; }
  .welcome-ui-preview { min-height: 210px; padding: 12px; }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
  color: var(--ink);
}

body::before {
  content: none;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.28);
  outline-offset: 2px;
}

a {
  color: inherit;
  text-decoration: none;
}

.phone-shell {
  position: relative;
  width: min(100%, 460px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 14px 98px;
  background: var(--bg);
  box-shadow: 0 0 0 1px rgba(60, 60, 67, 0.08), 0 24px 70px rgba(17, 24, 39, 0.08);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.view.active > * {
  animation: riseIn 420ms ease both;
}

.view.active > *:nth-child(2) { animation-delay: 35ms; }
.view.active > *:nth-child(3) { animation-delay: 70ms; }
.view.active > *:nth-child(4) { animation-delay: 105ms; }
.view.active > *:nth-child(5) { animation-delay: 140ms; }

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body:has(.view:target) .bottom-nav {
  display: grid;
}

body:has(#familyAccess:target) .bottom-nav {
  display: none;
}

body:has(#familyAccess:target) .bottom-nav {
  display: none;
}

#familyAccess:target {
  display: block;
}

#onboarding {
  min-height: calc(100vh - 116px);
  color: #0f172a;
}

body:has(#onboarding.active) {
  background:
    radial-gradient(circle at 50% -12%, rgba(74, 144, 255, 0.22), transparent 34%),
    linear-gradient(180deg, #f8fbff 0%, #eef6ff 48%, #ffffff 100%);
}

body:has(#onboarding.active) .phone-shell {
  background:
    radial-gradient(circle at 50% -4%, rgba(59, 130, 246, 0.2), transparent 34%),
    radial-gradient(circle at 96% 38%, rgba(12, 154, 199, 0.12), transparent 25%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 251, 255, 0.98));
  box-shadow: none;
}

.onboarding-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  column-gap: 12px;
  padding: 12px 2px 4px;
}

#onboarding .onboarding-hero,
#onboarding .onboarding-preview,
#onboarding .privacy-note,
#onboarding .onboarding-cta,
#onboarding .role-picker {
  animation: onboardingRise 700ms cubic-bezier(.2, .9, .2, 1) both;
}

#onboarding .onboarding-preview { animation-delay: 80ms; }
#onboarding .privacy-note { animation-delay: 150ms; }
#onboarding .onboarding-cta { animation-delay: 210ms; }
#onboarding .role-picker { animation-delay: 280ms; }

@keyframes onboardingRise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.onboarding-hero .trust-chips {
  grid-column: 1 / -1;
}

.onboarding-hero h1 {
  max-width: 100%;
  margin-top: 28px;
  font-family: var(--font-display);
  font-size: clamp(54px, 17vw, 86px);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.86;
}

.onboarding-hero .app-wordmark {
  color: #111827;
  text-transform: uppercase;
  text-wrap: balance;
  filter: drop-shadow(0 18px 34px rgba(13, 44, 90, 0.12));
}

.onboarding-hero p:last-child,
.family-access > p {
  margin-top: 14px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.38;
}

#onboarding .gear-action {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

#onboarding .gear-action:hover {
  transform: translateY(-1px) rotate(4deg);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
}

.trust-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.trust-chips span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(18, 130, 92, 0.13);
  background: rgba(235, 250, 244, 0.86);
  color: #0f684a;
  font-size: 12px;
  font-weight: 850;
}

.onboarding-preview {
  display: grid;
  justify-items: center;
  gap: 14px;
  margin: 24px 0 18px;
}

.preview-phone {
  position: relative;
  width: min(100%, 338px);
  min-height: 368px;
  padding: 14px;
  border-radius: 30px;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.88), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(238, 247, 255, 0.9));
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow:
    0 30px 70px rgba(31, 111, 255, 0.16),
    0 12px 26px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  transform: perspective(820px) rotateX(0deg) rotateY(-2deg);
  animation: previewFloat 5.8s ease-in-out infinite;
}

.preview-phone::before {
  content: "";
  position: absolute;
  inset: 11px;
  border-radius: 24px;
  border: 1px solid rgba(31, 111, 255, 0.11);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  pointer-events: none;
}

.preview-phone::after {
  content: "";
  position: absolute;
  width: 154px;
  height: 154px;
  right: -42px;
  top: -30px;
  border-radius: 50%;
  background: rgba(31, 111, 255, 0.08);
  animation: previewOrb 7s ease-in-out infinite;
}

@keyframes previewFloat {
  0%, 100% { transform: perspective(820px) rotateX(0deg) rotateY(-2deg) translateY(0); }
  50% { transform: perspective(820px) rotateX(1deg) rotateY(2deg) translateY(-8px); }
}

@keyframes previewOrb {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.8; }
  50% { transform: translate3d(-18px, 18px, 0) scale(1.1); opacity: 0.58; }
}

.preview-glow {
  position: absolute;
  inset: auto auto 28px 18px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(31, 111, 255, 0.12), transparent 62%);
  filter: blur(2px);
  animation: glowDrift 6.4s ease-in-out infinite;
}

@keyframes glowDrift {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(62px, -34px, 0); }
}

.preview-topbar,
.preview-route,
.preview-alert-row,
.preview-calendar-strip,
.preview-feature-grid {
  position: relative;
  z-index: 1;
}

.preview-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 42px;
  padding: 0 2px 10px;
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.preview-topbar b {
  padding: 7px 9px;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-size: 10px;
  letter-spacing: 0;
  text-transform: none;
  animation: pillPulse 2.8s ease-in-out infinite;
}

@keyframes pillPulse {
  0%, 100% { transform: scale(1); background: #0f172a; }
  50% { transform: scale(1.04); background: #1f6fff; }
}

.preview-route {
  display: grid;
  grid-template-columns: 1fr 58px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 86px;
  padding: 14px 14px 12px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.62), transparent 28%),
    linear-gradient(145deg, #11243a, #1f6fff 62%, #0e9ac7);
  color: #fff;
  font-size: 34px;
  font-weight: 950;
  letter-spacing: 0;
  box-shadow: 0 18px 38px rgba(31, 111, 255, 0.22);
}

.preview-route span:last-child {
  text-align: right;
}

.preview-route i {
  position: relative;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
  overflow: visible;
}

.preview-route i::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.82);
  transform: translate(-2px, -50%);
  animation: routeDot 2.7s ease-in-out infinite;
}

.preview-route i::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 50%;
  width: 13px;
  height: 13px;
  border-top: 2px solid rgba(255, 255, 255, 0.86);
  border-right: 2px solid rgba(255, 255, 255, 0.86);
  transform: translateY(-50%) rotate(45deg);
}

@keyframes routeDot {
  0% { transform: translate(-2px, -50%) scale(0.82); opacity: 0; }
  16% { opacity: 1; }
  82% { opacity: 1; }
  100% { transform: translate(46px, -50%) scale(0.82); opacity: 0; }
}

.preview-alert-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.preview-alert-row span {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}

.preview-alert-row small,
.preview-calendar-strip small,
.preview-feature-grid small {
  color: #64748b;
  font-size: 8px;
  font-weight: 850;
  line-height: 1.15;
}

.preview-alert-row strong {
  color: #0f172a;
  font-size: 10px;
  font-weight: 950;
}

.preview-calendar-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.preview-calendar-strip span {
  display: grid;
  place-items: center;
  min-height: 48px;
  padding: 7px 4px;
  border-radius: 15px;
  background: rgba(31, 111, 255, 0.08);
  color: #334155;
  font-size: 10px;
  font-weight: 900;
  text-align: center;
  animation: tileIn 720ms cubic-bezier(.2, .9, .2, 1) both;
}

.preview-calendar-strip .is-flight {
  background: #1f6fff;
  color: #fff;
  box-shadow: 0 10px 20px rgba(31, 111, 255, 0.18);
}

.preview-calendar-strip b {
  display: block;
  font-size: 10px;
}

.preview-calendar-strip .is-flight small {
  color: rgba(255, 255, 255, 0.76);
}

.preview-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.preview-feature-grid span {
  min-height: 49px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 8px 7px;
  border-radius: 15px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.preview-feature-grid b {
  color: #0f172a;
  font-size: 10px;
  font-weight: 950;
}

.preview-calendar-strip span:nth-child(1) { animation-delay: 250ms; }
.preview-calendar-strip span:nth-child(2) { animation-delay: 330ms; }
.preview-calendar-strip span:nth-child(3) { animation-delay: 410ms; }
.preview-calendar-strip span:nth-child(4) { animation-delay: 490ms; }

@keyframes tileIn {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.floating-card {
  position: absolute;
  z-index: 2;
  display: grid;
  gap: 3px;
  min-width: 118px;
  padding: 9px 11px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(18px);
  animation: floatingCard 4.8s ease-in-out infinite;
}

.floating-card small {
  color: #64748b;
  font-size: 9px;
  font-weight: 850;
}

.floating-card strong {
  font-size: 11px;
  font-weight: 950;
}

.floating-card-left {
  left: 22px;
  top: 150px;
}

.floating-card-right {
  right: 22px;
  top: 150px;
  bottom: auto;
  animation-delay: 800ms;
}

@keyframes floatingCard {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

.onboarding-benefits {
  width: min(100%, 338px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.onboarding-benefits span {
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 0 8px;
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  color: #334155;
  font-size: 11px;
  font-weight: 850;
  text-align: center;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.onboarding-benefits span:hover {
  transform: translateY(-2px);
  background: #fff;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

.onboarding-story {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(252px, 86%);
  gap: 10px;
  margin: 12px -14px 14px;
  padding: 0 14px 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.onboarding-story::-webkit-scrollbar {
  display: none;
}

.story-panel {
  position: relative;
  min-height: 246px;
  display: grid;
  align-content: end;
  gap: 10px;
  scroll-snap-align: center;
  padding: 22px;
  border-radius: 28px;
  overflow: hidden;
  color: #102033;
  background:
    radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.8), transparent 22%),
    radial-gradient(circle at 20% 10%, rgba(31, 111, 255, 0.24), transparent 28%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.94), rgba(222, 242, 255, 0.82));
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 44px rgba(17, 33, 48, 0.12);
}

.story-panel::before {
  content: "";
  position: absolute;
  top: 28px;
  right: 28px;
  width: 92px;
  height: 92px;
  border-radius: 30px;
  background:
    linear-gradient(145deg, rgba(31, 111, 255, 0.95), rgba(14, 154, 199, 0.86));
  box-shadow:
    -28px 28px 0 rgba(31, 111, 255, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.story-panel::after {
  content: "";
  position: absolute;
  top: 50px;
  right: 52px;
  width: 43px;
  height: 43px;
  border: 4px solid rgba(255, 255, 255, 0.9);
  border-top-color: transparent;
  border-radius: 50%;
}

.story-panel > * {
  position: relative;
  z-index: 1;
}

.primary-story {
  background:
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.76), transparent 22%),
    linear-gradient(145deg, #11243a, #1f6fff 56%, #0f8494);
  color: #fff;
}

.primary-story .story-kicker,
.primary-story p {
  color: rgba(255, 255, 255, 0.75);
}

.family-story::before {
  background: linear-gradient(145deg, #6d5df5, #0e9ac7);
}

.story-kicker {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.story-panel h2 {
  max-width: 214px;
  font-size: 29px;
  line-height: 0.98;
}

.story-panel p {
  max-width: 226px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.38;
}

.story-dots {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 2px;
}

.story-dots span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(17, 33, 48, 0.18);
}

.story-dots span:first-child {
  width: 22px;
  background: var(--blue);
}

.onboarding-flow-card {
  position: relative;
  overflow: hidden;
  margin: 10px 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 20px;
  background:
    radial-gradient(circle at 14% 8%, rgba(255, 255, 255, 0.82), transparent 30%),
    radial-gradient(circle at 88% 18%, rgba(21, 125, 143, 0.24), transparent 28%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(220, 242, 250, 0.82));
  box-shadow: 0 18px 48px rgba(17, 33, 48, 0.11);
}

.onboarding-flow-card::before {
  content: "";
  position: absolute;
  top: -58px;
  right: -46px;
  width: 152px;
  height: 152px;
  border: 1px solid rgba(31, 111, 255, 0.13);
  border-radius: 50%;
  box-shadow: inset 0 0 0 24px rgba(255, 255, 255, 0.16);
}

.flow-card-header {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.flow-card-header .muted-label {
  margin: 0;
}

.flow-card-header strong {
  max-width: 260px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.08;
}

.onboarding-infographic {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 24px 1fr 24px 1fr;
  align-items: stretch;
  gap: 7px;
}

.onboarding-infographic::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 34px;
  height: 42px;
  border-top: 2px dashed rgba(47, 112, 255, 0.28);
  border-radius: 50%;
  pointer-events: none;
}

.flow-node {
  position: relative;
  min-width: 0;
  min-height: 118px;
  padding: 10px 7px 9px;
  border: 1px solid rgba(31, 111, 255, 0.14);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(244, 250, 255, 0.72));
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 8px 18px rgba(17, 33, 48, 0.06);
}

.file-node {
  transform: translateY(-4px);
}

.result-node {
  transform: translateY(6px);
}

.flow-route {
  align-self: center;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(47, 112, 255, 0.22), rgba(10, 143, 186, 0.74));
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.28);
}

.node-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--blue), var(--cyan));
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(38, 103, 255, 0.18);
}

.node-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin: 3px auto 8px;
  border-radius: 15px;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.8), transparent 34%),
    linear-gradient(145deg, rgba(47, 112, 255, 0.16), rgba(10, 143, 186, 0.16));
  color: var(--blue);
}

.node-icon svg {
  width: 28px;
  height: 28px;
}

.node-icon svg * {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.flow-node strong,
.flow-node small {
  display: block;
}

.flow-node strong {
  color: var(--ink);
  font-size: 13px;
}

.flow-node small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.18;
}

.flow-feature-strip {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
}

.flow-feature-strip span {
  min-height: 52px;
  padding: 9px 8px;
  border-radius: 16px;
  border: 1px solid rgba(17, 33, 48, 0.06);
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.2;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.flow-feature-strip b {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
}

.privacy-note {
  position: relative;
  max-width: 338px;
  min-height: 58px;
  display: block;
  margin: 0 auto 10px;
  padding: 7px;
  border: 2px solid #0f172a;
  border-radius: 16px;
  background:
    repeating-linear-gradient(135deg, #facc15 0 9px, #0f172a 9px 18px);
  color: #0f172a;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
}

.privacy-note span {
  position: relative;
  z-index: 1;
  min-height: 40px;
  display: grid;
  place-items: center;
  padding: 9px 12px 9px 43px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.privacy-note::after {
  content: "!";
  position: absolute;
  left: 17px;
  top: 50%;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #0f172a;
  color: #facc15;
  font-size: 17px;
  font-weight: 950;
  transform: translateY(-50%);
  z-index: 1;
}

.privacy-note {
  isolation: isolate;
}

.onboarding-cta {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin: 16px 0 12px;
  text-align: center;
}

.onboarding-cta p {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.privacy-link {
  justify-self: center;
}

.onboarding-start-button {
  max-width: 338px;
  min-height: 54px;
  margin-top: 0;
  border-radius: 18px;
  background: #0f172a;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.onboarding-start-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.22);
}

.role-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 10px 0 12px;
}

.role-picker[hidden] {
  display: none;
}

.role-picker.is-revealed {
  animation: onboardingRise 520ms cubic-bezier(.2, .9, .2, 1) both;
}

.role-picker > .muted-label {
  grid-column: 1 / -1;
  text-align: center;
  letter-spacing: 0.1em;
}

.role-card {
  position: relative;
  min-height: 138px;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  justify-items: center;
  gap: 8px;
  padding: 12px 8px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
  text-align: center;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(16px);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.onboarding-paths {
  align-items: stretch;
}

.onboarding-route-card {
  min-height: 230px;
  align-content: stretch;
  justify-items: stretch;
  gap: 14px;
  padding: 20px;
  text-align: left;
  overflow: hidden;
}

.onboarding-route-card .role-icon {
  justify-self: start;
}

.route-pill {
  width: fit-content;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.78);
  color: #0f2e57;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96), 0 10px 24px rgba(17, 33, 48, 0.08);
}

.onboarding-route-card strong {
  font-size: 29px;
  letter-spacing: 0;
  line-height: 1;
}

.onboarding-route-card small {
  display: block;
  min-height: 58px;
  font-size: 13.5px;
  max-width: 34ch;
}

.crew-route {
  background:
    radial-gradient(circle at 84% 0%, rgba(31, 111, 255, 0.2), transparent 32%),
    radial-gradient(circle at 16% 100%, rgba(8, 145, 178, 0.12), transparent 34%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.98), rgba(235, 244, 255, 0.96));
}

.family-route {
  background:
    radial-gradient(circle at 82% 0%, rgba(31, 111, 255, 0.18), transparent 32%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.98), rgba(235, 244, 255, 0.96));
}

.onboarding-upload-actions {
  display: grid;
  gap: 9px;
  align-self: end;
}

.onboarding-upload-actions .start-button,
.onboarding-upload-actions .secondary,
.family-access-toggle {
  width: 100%;
  min-height: 48px;
}

@media (max-width: 520px) {
  .role-picker.onboarding-paths {
    grid-template-columns: 1fr;
  }

  .onboarding-route-card {
    min-height: 0;
  }

  .onboarding-route-card small {
    min-height: 0;
  }
}

.role-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(17, 33, 48, 0.1);
}

.role-card.selected {
  border-color: rgba(31, 111, 255, 0.5);
  box-shadow: inset 0 0 0 1px rgba(31, 111, 255, 0.58), 0 18px 38px rgba(31, 111, 255, 0.14);
}

.role-card::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  pointer-events: none;
}

.role-icon {
  grid-row: auto;
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: #eef2ff;
  color: var(--blue);
  font-size: 21px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 18px 36px rgba(17, 33, 48, 0.12);
}

.role-icon svg {
  width: 42px;
  height: 42px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.role-icon .crew-avatar-icon {
  width: 40px;
  height: 40px;
  fill: none;
  stroke: none;
}

.role-icon .crew-avatar-icon .avatar-fill {
  fill: currentColor;
}

.role-icon .crew-avatar-icon .avatar-skin {
  fill: rgba(255, 255, 255, 0.86);
}

.role-icon .crew-avatar-icon .avatar-cut {
  fill: none;
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pilot-cap-icon,
.cabin-crew-icon,
.pilot-object-icon,
.cabin-object-icon {
  width: 54px;
  height: 54px;
}

.pilot-object-icon .pilot-shoulders,
.pilot-object-icon .pilot-cap-top,
.pilot-object-icon .pilot-cap-band,
.cabin-object-icon .cabin-hair,
.cabin-object-icon .cabin-shoulders {
  fill: #262626;
}

.pilot-object-icon .pilot-face,
.cabin-object-icon .cabin-face {
  fill: #f8fbff;
}

.pilot-object-icon .pilot-shirt,
.cabin-object-icon .cabin-collar,
.cabin-object-icon .cabin-scarf-left,
.cabin-object-icon .cabin-scarf-right {
  fill: #ffffff;
}

.pilot-object-icon .pilot-tie {
  fill: #1f6fff;
}

.pilot-object-icon .pilot-wing-mark,
.pilot-object-icon .pilot-stripe,
.pilot-object-icon .pilot-blue-line,
.pilot-object-icon .pilot-epaulette,
.cabin-object-icon .cabin-nameplate {
  fill: none;
  stroke: #1f6fff;
  stroke-width: 2.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pilot-object-icon .pilot-wing-mark {
  stroke: #ffffff;
  stroke-width: 3;
}

.pilot-object-icon .pilot-ear-left,
.pilot-object-icon .pilot-ear-right {
  fill: none;
  stroke: #262626;
  stroke-width: 2.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pilot-cap-icon .pilot-shoulders,
.pilot-cap-icon .pilot-cap,
.pilot-cap-icon .pilot-cap-top {
  fill: #0f172a;
}

.pilot-cap-icon .pilot-face {
  fill: #f7fbff;
}

.pilot-cap-icon .pilot-shirt {
  fill: #ffffff;
}

.pilot-cap-icon .pilot-tie {
  fill: #1f6fff;
}

.pilot-cap-icon .pilot-wing {
  fill: none;
  stroke: #ffffff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cabin-crew-icon .cabin-body,
.cabin-crew-icon .cabin-hair,
.cabin-crew-icon .cabin-hat {
  fill: #0f172a;
}

.cabin-crew-icon .cabin-face {
  fill: #f7fbff;
}

.cabin-crew-icon .cabin-blouse {
  fill: #ffffff;
}

.cabin-crew-icon .cabin-scarf {
  fill: #1f6fff;
}

.cabin-crew-icon .cabin-wing {
  fill: none;
  stroke: #ffffff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pilot-role-icon {
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.88), transparent 42%),
    linear-gradient(180deg, #f8fbff 0%, #dbe9ff 100%);
  color: #17212b;
}

.cabin-role-icon {
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.88), transparent 42%),
    linear-gradient(180deg, #f8fdff 0%, #dbeeff 100%);
  color: #17212b;
}

.role-card strong,
.role-card small {
  display: block;
}

.role-card small {
  display: none;
  color: var(--muted);
  line-height: 1.35;
}

.role-card em {
  display: none;
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(238, 244, 255, 0.88);
  color: var(--blue);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.pilot-profile,
.crew-residence,
.family-access {
  display: none;
}

.pilot-profile.visible,
.crew-residence.visible,
.family-access.visible {
  display: block;
}

.pilot-profile h2,
.crew-residence h2,
.family-access h2 {
  margin-top: 3px;
}

.pilot-profile p:not(.muted-label),
.crew-residence p:not(.muted-label) {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.pilot-profile-grid {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.import-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.import-actions .print-export {
  grid-column: 1 / -1;
}

.export-copy {
  margin-top: -6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.secondary,
.start-button {
  border: 0;
  min-height: 44px;
  border-radius: 8px;
  font-weight: 850;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-align: center;
}

.secondary {
  color: var(--blue);
  background: linear-gradient(145deg, rgba(239, 246, 255, 0.96), rgba(224, 238, 255, 0.96));
}

.start-button {
  width: 100%;
  margin-top: 12px;
  color: #fff;
  background: linear-gradient(145deg, #111c27, #1f6fff);
}

.code-entry {
  display: none;
  gap: 6px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.code-entry.visible {
  display: grid;
}

.code-entry input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
}

.home-header,
.screen-header,
.section-title,
.month-controls,
.stats-row,
.legend-row,
.list-row,
.settings-row,
.pay-line {
  display: flex;
  align-items: center;
}

.home-header,
.screen-header {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

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

.subtle-action {
  width: 46px;
  height: 46px;
  padding: 0;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.48)) padding-box,
    linear-gradient(135deg, rgba(38, 103, 255, 0.92), rgba(13, 148, 136, 0.58), rgba(255, 193, 85, 0.78)) border-box;
  color: #12335c;
  border: 1px solid transparent;
  box-shadow:
    0 14px 28px rgba(23, 33, 43, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.subtle-action::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 7px;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.85), transparent 34%);
  pointer-events: none;
}

.subtle-action:active {
  transform: translateY(1px) scale(0.98);
  box-shadow:
    0 8px 18px rgba(23, 33, 43, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.64);
}

.gear-action svg {
  position: relative;
  z-index: 1;
  width: 26px;
  height: 26px;
  fill: #111c27;
  stroke: none;
  filter: drop-shadow(0 3px 6px rgba(17, 28, 39, 0.2));
}

.gear-action:hover svg {
  transform: rotate(18deg);
  transition: transform 180ms ease;
}

.settings-image-action {
  padding: 0;
  overflow: hidden;
  border-radius: 8px;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.settings-image-action::before {
  content: none;
}

.settings-image-action .settings-icon-image {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  transform: scale(1.08);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 0;
}

.muted-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.pdf-button,
.icon-action,
.text-button,
.primary {
  border: 0;
  min-height: 40px;
  border-radius: 8px;
  font-weight: 850;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-align: center;
}

.pdf-button,
.icon-action {
  padding: 0 14px;
  background: linear-gradient(145deg, #111c27, #21364b);
  color: #fff;
  box-shadow: 0 9px 18px rgba(23, 33, 43, 0.16);
}

.icon-action.subtle-action {
  padding: 0;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.5)) padding-box,
    linear-gradient(135deg, rgba(38, 103, 255, 0.92), rgba(13, 148, 136, 0.58), rgba(255, 193, 85, 0.78)) border-box;
  color: #12335c;
  border: 1px solid transparent;
  box-shadow:
    0 14px 28px rgba(23, 33, 43, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.text-button {
  background: transparent;
  color: var(--blue);
  padding: 0 6px;
}

.print-month-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(38, 103, 255, 0.24);
  border-radius: 8px;
  background: #eef4ff;
  color: var(--blue);
  font-weight: 850;
  box-shadow: 0 1px 0 rgba(38, 103, 255, 0.08);
}

.print-month-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.primary {
  width: 100%;
  background: linear-gradient(145deg, var(--blue), var(--blue-2));
  color: #fff;
}

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

.card,
.next-flight-card {
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.38));
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(26px) saturate(1.28);
  -webkit-backdrop-filter: blur(26px) saturate(1.28);
}

.card {
  position: relative;
  overflow: hidden;
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.64);
}

.card::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto;
  height: 44%;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.36), transparent);
  pointer-events: none;
}

.soft-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(239, 248, 255, 0.42));
}

.next-flight-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 188px;
  padding: 18px;
  margin-bottom: 12px;
  color: #fff;
  background:
    radial-gradient(circle at 92% 8%, rgba(255, 255, 255, 0.18), transparent 32%),
    linear-gradient(145deg, #12243a 0%, #1f6fff 52%, #0f8494 100%);
  box-shadow: var(--shadow);
}

.next-flight-card::after {
  content: "";
  position: absolute;
  width: 170px;
  height: 170px;
  right: -70px;
  top: -48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.13);
}

.next-flight-card .top-line,
.next-flight-card .chips {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.next-flight-card .top-line {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.next-flight-card h2 {
  position: relative;
  z-index: 2;
  margin-top: 30px;
  font-size: 37px;
  letter-spacing: 0;
}

.next-flight-card p {
  position: relative;
  z-index: 2;
  margin-top: 8px;
  margin-bottom: 18px;
  color: rgba(255, 255, 255, 0.78);
}

.next-flight-card.is-empty {
  min-height: 258px;
}

.next-flight-card.is-empty h2 {
  margin-top: 34px;
}

.next-flight-card.is-empty p {
  max-width: 92%;
  margin-bottom: 22px;
  line-height: 1.22;
}

.next-flight-card .chips {
  position: relative;
  z-index: 2;
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  justify-content: stretch;
  gap: 6px;
}

.chip {
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 31px;
  padding: 5px 10px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.09));
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.chip small,
.chip strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.chip strong {
  margin-top: 1px;
  color: #fff;
  font-size: 11.5px;
}

.stats-row {
  gap: 8px;
  margin-bottom: 12px;
}

.stat {
  flex: 1;
  min-height: 72px;
  border-radius: 8px;
  padding: 11px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 24px rgba(17, 33, 48, 0.06);
}

.stat strong {
  display: block;
  font-size: 24px;
  line-height: 1;
}

.stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.section-title {
  justify-content: space-between;
  margin-bottom: 14px;
}

.selected-day-card {
  scroll-margin-top: 18px;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.calendar-status-card {
  display: grid;
  gap: 16px;
  margin: -2px 0 18px;
  padding: 20px;
  border-radius: 30px;
  color: #ffffff;
  background:
    radial-gradient(circle at 16% 0%, rgba(255, 255, 255, 0.2), transparent 28%),
    linear-gradient(145deg, #111820 0%, #1d2733 52%, #080b0f 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 22px 54px rgba(10, 14, 20, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.calendar-status-card[hidden] {
  display: none;
}

.calendar-status-card.is-top {
  margin: 0 0 18px;
}

.calendar-status-card.is-flight {
  background:
    radial-gradient(circle at 16% 0%, rgba(255, 255, 255, 0.22), transparent 28%),
    linear-gradient(145deg, #093b82 0%, #1167df 52%, #071526 100%);
}

.calendar-status-card.is-away {
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.22), transparent 30%),
    linear-gradient(145deg, #35280e 0%, #8a6218 48%, #11100d 100%);
}

.calendar-status-card.is-base {
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.24), transparent 30%),
    linear-gradient(145deg, #102818 0%, #157245 50%, #07110c 100%);
}

.family-switch-crew-button {
  justify-self: start;
  border: 1px solid rgba(255, 255, 255, 0.45);
  min-height: 40px;
  border-radius: 999px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.family-switch-crew-button:active {
  transform: translateY(1px);
}

.welcome-header {
  justify-items: center;
  gap: 14px;
  margin-bottom: 20px;
  text-align: center;
}

.welcome-app-icon {
  width: clamp(96px, 28vw, 132px);
  height: clamp(96px, 28vw, 132px);
  border-radius: 28px;
  box-shadow: 0 18px 42px rgba(0, 105, 255, 0.22);
}

.welcome-header > p {
  max-width: 320px;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.32;
}

.calendar-status-main p {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.calendar-status-main h2 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(31px, 8.5vw, 52px);
  line-height: 0.94;
  letter-spacing: 0;
}

.calendar-status-main span {
  display: block;
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 17px;
  font-weight: 760;
  line-height: 1.32;
}

.calendar-status-chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.calendar-status-chips span {
  min-width: 0;
  padding: 11px 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.calendar-status-chips small,
.calendar-status-chips strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-status-chips small {
  color: rgba(255, 255, 255, 0.62);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.calendar-status-chips strong {
  margin-top: 3px;
  color: #fff;
  font-size: 13px;
  font-weight: 950;
}

.selected-day-card.attention {
  border-color: rgba(38, 103, 255, 0.42);
  background: rgba(247, 250, 255, 0.98);
  box-shadow: 0 0 0 3px rgba(38, 103, 255, 0.12), 0 14px 32px rgba(23, 33, 43, 0.08);
}

.mini-calendar,
.full-calendar,
.weekday-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.weekday-row {
  margin: 10px 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.day-cell {
  min-height: 44px;
  border: 1px solid rgba(17, 33, 48, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  padding: 6px;
  display: grid;
  place-items: center;
  gap: 3px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.62);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.day-cell:hover {
  transform: translateY(-1px);
  border-color: rgba(31, 111, 255, 0.28);
}

.full-calendar .day-cell {
  min-height: 58px;
  place-items: start;
  text-align: left;
}

.day-cell.muted {
  opacity: 0.35;
}

.day-cell.today {
  background: linear-gradient(160deg, #111c27, #1b3148);
  color: #fff;
}

.day-cell.selected {
  border-color: rgba(31, 111, 255, 0.92);
  box-shadow: 0 0 0 3px rgba(31, 111, 255, 0.1), inset 0 0 0 1px var(--blue);
}

.day-number {
  font-size: 12px;
  font-weight: 900;
}

.event-mark {
  min-width: 24px;
  max-width: 100%;
  display: block;
  border-radius: 5px;
  padding: 2px 3px;
  color: #fff;
  font-size: 8px;
  font-weight: 900;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.flight,
.event-flight { background: var(--blue); }
.off,
.event-off { background: var(--green); }
.sim,
.event-sim { background: var(--purple); }
.hotel,
.event-hotel { background: var(--amber); }
.reserve,
.event-reserve { background: #ff3b30; }
.oncall,
.event-oncall { background: #d8f0f7; color: #0a536c; }
.transport,
.event-transport { background: #0f9f95; }

.legend-row {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.legend-row.expanded {
  padding-top: 6px;
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 5px;
}

.list {
  display: grid;
  gap: 8px;
}

.list-row {
  gap: 12px;
  min-height: 64px;
  padding: 11px;
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.38));
  border: 1px solid rgba(255, 255, 255, 0.58);
  box-shadow: 0 12px 30px rgba(17, 33, 48, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(18px) saturate(1.18);
  -webkit-backdrop-filter: blur(18px) saturate(1.18);
}

.row-icon {
  width: 42px;
  height: 42px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  font-weight: 900;
  background:
    radial-gradient(circle at 32% 22%, rgba(255, 255, 255, 0.46), transparent 34%),
    linear-gradient(145deg, #101b33 0%, #1f6fff 76%, #12a6c4 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.52),
    inset 0 -1px 0 rgba(255, 255, 255, 0.18),
    0 12px 24px rgba(17, 33, 48, 0.1);
}

.row-icon svg {
  width: 24px;
  height: 24px;
}

.row-icon svg * {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.05;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.row-icon-text {
  line-height: 1;
}

.row-icon.ok {
  background:
    radial-gradient(circle at 32% 22%, rgba(255, 255, 255, 0.44), transparent 34%),
    linear-gradient(145deg, #0f766e, #16a34a);
}

.row-icon.warn {
  background:
    radial-gradient(circle at 32% 22%, rgba(255, 255, 255, 0.46), transparent 34%),
    linear-gradient(145deg, #92400e, #f59e0b);
}

.row-icon.danger {
  background:
    radial-gradient(circle at 32% 22%, rgba(255, 255, 255, 0.42), transparent 34%),
    linear-gradient(145deg, #991b1b, #ef4444);
}

.row-main {
  min-width: 0;
  flex: 1;
}

.row-main strong,
.row-main span {
  display: block;
}

.row-main strong {
  font-size: 15px;
}

.row-main span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.row-right {
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.action-row {
  align-items: center;
}

.empty-upload-row {
  width: 100%;
  cursor: pointer;
  text-align: left;
  color: inherit;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.empty-upload-row:hover {
  transform: translateY(-1px);
  border-color: rgba(38, 103, 255, 0.42);
  box-shadow: 0 14px 30px rgba(38, 103, 255, 0.12);
}

.empty-upload-row:focus-visible {
  outline: 3px solid rgba(38, 103, 255, 0.35);
  outline-offset: 3px;
}

.row-action {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 11px;
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(145deg, rgba(239, 246, 255, 0.98), rgba(222, 236, 255, 0.98));
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.badge.ok {
  color: var(--green);
  background: #dcfce7;
}

.badge.warn {
  color: var(--amber);
  background: #fef3c7;
}

.badge.danger {
  color: var(--red);
  background: #fee2e2;
}

.doc-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
  flex: 0 0 auto;
}

.doc-upload-btn {
  border: 0;
  min-height: 34px;
  border-radius: 8px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(145deg, rgba(239, 246, 255, 0.98), rgba(222, 236, 255, 0.98));
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
}

.document-timeline {
  margin: -4px 0 14px;
  padding-bottom: 4px;
}

.timeline-next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 82px;
  padding: 14px;
  border: 1px solid rgba(38, 103, 255, 0.26);
  border-radius: 8px;
  background: rgba(38, 103, 255, 0.08);
}

.timeline-next.warn {
  border-color: rgba(201, 133, 36, 0.32);
  background: rgba(201, 133, 36, 0.1);
}

.timeline-next.danger {
  border-color: rgba(211, 69, 69, 0.32);
  background: rgba(211, 69, 69, 0.1);
}

.timeline-next span,
.timeline-next strong,
.timeline-next small {
  display: block;
}

.timeline-next span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.timeline-next strong {
  margin-top: 3px;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.15;
}

.timeline-next small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.timeline-track {
  position: relative;
  display: flex;
  gap: 10px;
  margin-top: 12px;
  padding: 12px 4px 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.timeline-track::-webkit-scrollbar {
  display: none;
}

.timeline-track::before {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  top: 29px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(211, 69, 69, 0.85), rgba(201, 133, 36, 0.78) 44%, rgba(22, 138, 98, 0.68) 100%);
}

.timeline-item {
  position: relative;
  z-index: 1;
  flex: 0 0 136px;
  min-height: 112px;
  min-width: 0;
  padding: 32px 12px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  scroll-snap-align: start;
  box-shadow: 0 8px 20px rgba(23, 33, 43, 0.06);
}

.timeline-item.danger {
  border-color: rgba(211, 69, 69, 0.28);
  background: linear-gradient(180deg, #fff 0%, #fff2f2 100%);
}

.timeline-item.warn {
  border-color: rgba(201, 133, 36, 0.28);
  background: linear-gradient(180deg, #fff 0%, #fff8e9 100%);
}

.timeline-item.ok {
  border-color: rgba(22, 138, 98, 0.24);
  background: linear-gradient(180deg, #fff 0%, #edf9f4 100%);
}

.timeline-dot {
  position: absolute;
  top: 8px;
  left: 14px;
  width: 20px;
  height: 20px;
  border: 4px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(23, 33, 43, 0.15);
}

.timeline-dot.ok { background: var(--green); }
.timeline-dot.warn { background: var(--amber); }
.timeline-dot.danger { background: var(--red); }

.timeline-item em {
  position: absolute;
  top: 8px;
  right: 10px;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.timeline-item strong,
.timeline-item small,
.timeline-status {
  display: block;
}

.timeline-item strong {
  font-size: 12px;
  line-height: 1.15;
  min-height: 28px;
}

.timeline-item small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.timeline-status {
  width: fit-content;
  margin-top: 8px;
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(100, 112, 125, 0.11);
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.timeline-item.danger .timeline-status {
  background: rgba(211, 69, 69, 0.12);
  color: var(--red);
}

.timeline-item.warn .timeline-status {
  background: rgba(201, 133, 36, 0.14);
  color: var(--amber);
}

.timeline-item.ok .timeline-status {
  background: rgba(22, 138, 98, 0.12);
  color: var(--green);
}

.month-controls {
  justify-content: space-between;
  gap: 10px;
}

.month-controls button {
  border: 0;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #eef2ff;
  color: var(--blue);
  font-size: 24px;
}

.payroll-card {
  background: #111827;
  color: #fff;
}

.payroll-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.payroll-status-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.payroll-status-badge.estimated {
  background: rgba(213, 165, 29, 0.18);
  color: #f7d96a;
}

.payroll-status-badge.real {
  background: rgba(36, 180, 126, 0.18);
  color: #86efac;
}

.payroll-source-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.payroll-source-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.salary-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.salary-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 12px;
}

.salary-table th,
.salary-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

.salary-table th:first-child,
.salary-table td:first-child {
  text-align: left;
}

.salary-table th {
  color: var(--muted);
  background: #f8fafc;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.salary-table tr.selected td {
  background: rgba(38, 103, 255, 0.08);
  color: var(--blue);
  font-weight: 900;
}

.salary-table tr:last-child td {
  border-bottom: 0;
}

.payroll-upload-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  overflow: hidden;
  border-color: rgba(38, 103, 255, 0.22);
  background: rgba(255, 255, 255, 0.86);
}

.payroll-upload-card > div {
  min-width: 0;
  max-width: 100%;
}

.payroll-upload-card[hidden] {
  display: none;
}

.payroll-upload-card h2 {
  margin-top: 4px;
}

.payroll-upload-card p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.payroll-upload-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 750;
  overflow-wrap: anywhere;
}

.payroll-upload-card .badge {
  flex: 0 0 auto;
}

.field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  padding: 14px 12px;
  font-size: 16px;
  font-weight: 750;
  text-transform: none;
  letter-spacing: 0;
}

.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  padding: 14px 12px;
  font-size: 16px;
  font-weight: 750;
  text-transform: none;
  letter-spacing: 0;
}

.field textarea {
  width: 100%;
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  padding: 14px 12px;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.25;
  resize: vertical;
  text-transform: none;
  letter-spacing: 0;
}

.payroll-card .muted-label {
  color: rgba(255, 255, 255, 0.65);
}

.payroll-total strong {
  display: block;
  margin-top: 8px;
  font-size: 38px;
}

.payroll-total span {
  color: rgba(255, 255, 255, 0.68);
}

.payroll-bars {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.year-payroll-total strong {
  display: block;
  font-size: 30px;
}

.year-payroll-total span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.3;
}

.year-payroll-chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
  gap: 8px;
  align-items: end;
  margin-top: 16px;
}

.year-payroll-chart article {
  display: grid;
  gap: 5px;
  min-width: 0;
  text-align: center;
}

.year-payroll-chart .year-empty {
  grid-column: 1 / -1;
  min-height: 86px;
  place-content: center;
  border: 1px dashed rgba(100, 112, 125, 0.32);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
}

.year-bar {
  height: 110px;
  display: flex;
  align-items: end;
  border-radius: 8px;
  background: #eef2ff;
  overflow: hidden;
}

.year-bar span {
  width: 100%;
  display: block;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #2667ff, #157d8f);
}

.year-bar span.estimated {
  background: linear-gradient(180deg, #c98524, #f59e0b);
}

.year-payroll-chart strong {
  font-size: 11px;
}

.year-payroll-chart small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.sevenp-card {
  border-color: #fed7aa;
  background: #fff7ed;
}

.sevenp-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.sevenp-summary article {
  min-height: 72px;
  padding: 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #fed7aa;
}

.sevenp-summary strong {
  display: block;
  font-size: 18px;
}

.sevenp-summary span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
}

.pay-line {
  justify-content: space-between;
  gap: 12px;
}

.bar {
  height: 8px;
  margin-top: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #60a5fa;
}

.settings-list {
  display: grid;
  gap: 18px;
}

.settings-section h2 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.settings-note {
  margin: -2px 0 8px;
  padding: 10px 12px;
  border: 1px solid rgba(38, 103, 255, 0.16);
  border-radius: 8px;
  background: rgba(38, 103, 255, 0.07);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.settings-row {
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-bottom: 0;
}

.settings-row:first-of-type {
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.settings-row:last-of-type {
  border-bottom: 1px solid var(--line);
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

.settings-row button {
  border: 0;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(145deg, rgba(239, 246, 255, 0.98), rgba(222, 236, 255, 0.98));
  color: var(--blue);
  font-weight: 850;
}

.account-setup-hint,
.account-error {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.account-check-button {
  justify-self: start;
  margin-top: -4px;
}

.account-error {
  color: #b42318;
  font-weight: 750;
}

.account-actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.account-provider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 8px;
}

.auth-brand-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.google-auth-button {
  background: #ffffff;
  color: var(--ink);
}

.apple-auth-button {
  background: #ffffff;
  color: var(--ink);
}

.email-auth-button {
  background: #ffffff;
  color: var(--ink);
}

.email-auth-icon {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.15;
}

.apple-auth-button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.auth-provider-text {
  display: grid;
  gap: 1px;
  text-align: center;
}

.auth-provider-label {
  font: inherit;
  font-weight: 850;
}

.auth-provider-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
}

.account-email-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.82);
}

.account-email-panel[hidden] {
  display: none;
}

.account-email-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.account-email-actions .text-button {
  grid-column: 1 / -1;
  justify-self: center;
}

.danger-button {
  border: 0;
  min-height: 44px;
  border-radius: 8px;
  background: #fee4e2;
  color: #b42318;
  font-weight: 850;
}

.logbook-world-card {
  overflow: hidden;
  padding-bottom: 12px;
  background:
    radial-gradient(circle at 20% 14%, rgba(31, 111, 255, 0.28), transparent 26%),
    radial-gradient(circle at 84% 22%, rgba(229, 21, 47, 0.16), transparent 22%),
    linear-gradient(180deg, #05070c, #0a1020 58%, #05070c);
  border-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.logbook-world-card h2 {
  color: #ffffff;
}

.logbook-world-card .muted-label {
  color: rgba(255, 255, 255, 0.58);
}

.route-badge {
  background: rgba(229, 21, 47, 0.18);
  color: #ff4d62;
  border: 1px solid rgba(255, 77, 98, 0.24);
}

.logbook-globe {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  margin-top: 10px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 16% 18%, rgba(255, 255, 255, 0.75) 0 1px, transparent 2px),
    radial-gradient(circle at 82% 22%, rgba(255, 255, 255, 0.5) 0 1px, transparent 2px),
    radial-gradient(circle at 72% 72%, rgba(255, 255, 255, 0.45) 0 1px, transparent 2px),
    radial-gradient(circle at 50% 46%, rgba(28, 88, 180, 0.24), transparent 34%),
    radial-gradient(circle at 50% 82%, rgba(255, 255, 255, 0.08), transparent 24%),
    linear-gradient(180deg, #020409, #050816);
  perspective: 700px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.local-world-map {
  width: 100%;
  height: auto;
  aspect-ratio: 950 / 620;
  display: block;
  border-radius: 22px;
  overflow: hidden;
}

.world-space {
  fill: #020712;
}

.world-shadow {
  fill: rgba(0, 0, 0, 0.48);
  filter: blur(12px);
}

.world-sphere {
  clip-path: inset(0 round 34px);
}

.world-grid path {
  fill: none;
  stroke: rgba(191, 219, 254, 0.16);
  stroke-width: 1;
}

.world-base-map {
  opacity: 0.86;
  filter:
    sepia(0.18)
    saturate(0.85)
    hue-rotate(92deg)
    brightness(1.08)
    contrast(1.06)
    drop-shadow(0 10px 16px rgba(0, 0, 0, 0.26));
}

.world-route {
  fill: none;
  stroke: #ff243a;
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-dasharray: 12 10;
  opacity: 0.96;
  animation: world-route-dash 2.8s linear infinite;
  animation-delay: calc(var(--route-index, 0) * -0.35s);
}

.world-airport circle:first-child {
  fill: rgba(255, 36, 58, 0.2);
  stroke: rgba(255, 255, 255, 0.8);
  stroke-width: 1.6;
  animation: airport-pulse 2.2s ease-in-out infinite;
}

.world-airport circle:nth-child(2) {
  fill: #ff243a;
  stroke: #ffffff;
  stroke-width: 1.4;
}

.world-airport text {
  fill: #ffffff;
  paint-order: stroke;
  stroke: rgba(2, 7, 18, 0.86);
  stroke-width: 4;
  font-size: 23px;
  font-weight: 950;
  letter-spacing: 0.05em;
}

.world-shine {
  fill: rgba(255, 255, 255, 0.04);
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 2;
  pointer-events: none;
}

@keyframes world-route-dash {
  to { stroke-dashoffset: -44; }
}

@keyframes airport-pulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.7); opacity: 0.18; }
}

.logbook-ledger-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 252, 255, 0.98)),
    repeating-linear-gradient(0deg, transparent 0 33px, rgba(39, 53, 70, 0.04) 34px 35px);
}

.logbook-ledger-title {
  padding-bottom: 12px;
  border-bottom: 2px solid #17212b;
}

.logbook-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 14px 0 12px;
}

.logbook-stat {
  min-height: 64px;
  padding: 10px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #d7dde6;
}

.logbook-stat strong {
  display: block;
  font-size: 18px;
}

.logbook-stat span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.duty-limit-bars {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.duty-bar-row {
  padding: 10px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.duty-bar-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.duty-bar-head strong {
  font-size: 13px;
}

.duty-bar-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.duty-bar {
  height: 9px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.duty-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.duty-note {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.logbook-table-wrap {
  overflow-x: auto;
  border: 1px solid #cfd7e3;
  border-radius: 8px;
  background: #fff;
}

.logbook-table {
  width: 100%;
  min-width: 1320px;
  border-collapse: collapse;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.logbook-table th,
.logbook-table td {
  padding: 6px 6px;
  border-right: 1px solid #dbe2ec;
  border-bottom: 1px solid #dbe2ec;
  text-align: left;
  white-space: nowrap;
}

.logbook-table th {
  color: #253246;
  background: #eef3fa;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.logbook-table td strong,
.logbook-table td span {
  display: block;
}

.logbook-table td span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.logbook-table tbody tr:nth-child(even) {
  background: #fbfdff;
}

.logbook-read-row {
  cursor: pointer;
}

.logbook-read-row:hover {
  background: #eef6ff;
}

.logbook-edit-btn {
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid #bcd5ff;
  border-radius: 8px;
  background: #f4f8ff;
  color: var(--blue);
  font-size: 11px;
  font-weight: 850;
}

.logbook-cell-input {
  width: 100%;
  min-width: 0;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #1f2329;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
  padding: 3px 5px;
}

.logbook-cell-input:focus {
  outline: 0;
  border-color: rgba(11, 111, 255, 0.38);
  background: #eef5ff;
  box-shadow: 0 0 0 2px rgba(11, 111, 255, 0.12);
}

.logbook-cell-input.calculated-input {
  background: #f3f7fb;
  color: #475569;
  font-weight: 850;
}

.logbook-table .date-input {
  width: 122px;
}

.logbook-table .flight-input,
.logbook-table .aircraft-input {
  width: 112px;
}

.logbook-table .airport-input {
  width: 54px;
  display: inline-block;
  text-transform: uppercase;
}

.logbook-table .time-input {
  width: 76px;
  display: inline-block;
}

.logbook-table .numeric-input,
.logbook-table .landing-input {
  width: 56px;
  text-align: right;
}

.logbook-table .pic-input {
  width: 210px;
}

.logbook-table .function-input,
.logbook-table .approach-input {
  width: 82px;
}

.logbook-table .remarks-input {
  width: 220px;
}

.logbook-table tfoot td {
  color: #111827;
  background: #f1f5f9;
  font-weight: 850;
  border-bottom: 0;
}

.switch {
  position: relative;
  width: 44px;
  height: 26px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #cbd5e1;
}

.switch span::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: #fff;
  transition: transform 150ms ease;
}

.switch input:checked + span {
  background: var(--blue);
}

.switch input:checked + span::after {
  transform: translateX(18px);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 10px;
  z-index: 10;
  width: min(calc(100% - 22px), 438px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  padding: 8px 10px max(8px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 16% 0%, rgba(255, 255, 255, 0.92), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.68), rgba(234, 245, 255, 0.36));
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 28px;
  backdrop-filter: blur(34px) saturate(1.36);
  -webkit-backdrop-filter: blur(34px) saturate(1.36);
  box-shadow:
    0 -1px 0 rgba(255, 255, 255, 0.72),
    0 22px 52px rgba(21, 45, 72, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset 0 -1px 0 rgba(255, 255, 255, 0.3);
  overflow: visible;
}

.bottom-nav::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto;
  height: 42%;
  border-radius: 27px 27px 18px 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.46), transparent);
  pointer-events: none;
}

.bottom-nav.is-hidden {
  display: none;
}

.bottom-nav button,
.bottom-nav a {
  border: 0;
  border-radius: 22px;
  min-height: 66px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  background: transparent;
  color: #6b7581;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  transition: transform 180ms ease, color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.bottom-nav button:hover,
.bottom-nav a:hover {
  transform: translateY(-1px);
}

.bottom-nav button span,
.bottom-nav a span {
  line-height: 1;
}

.bottom-nav .tab-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background:
    radial-gradient(circle at 32% 22%, rgba(255, 255, 255, 0.95), transparent 38%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(225, 239, 255, 0.38));
  color: #657284;
  border: 1px solid rgba(255, 255, 255, 0.58);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    inset 0 -1px 0 rgba(255, 255, 255, 0.25),
    0 10px 22px rgba(17, 33, 48, 0.08);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  transition: color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.bottom-nav .tab-icon svg {
  width: 25px;
  height: 25px;
}

.bottom-nav .tab-icon svg * {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom-nav button.active,
.bottom-nav a.active {
  color: var(--blue);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.52), rgba(31, 111, 255, 0.1));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 12px 28px rgba(31, 111, 255, 0.12);
}

.bottom-nav a.active .tab-icon {
  color: #fff;
  background:
    radial-gradient(circle at 32% 22%, rgba(255, 255, 255, 0.54), transparent 32%),
    linear-gradient(145deg, #101b33 0%, #1f6fff 72%, #14a6c4 100%);
  border-color: rgba(255, 255, 255, 0.44);
  box-shadow:
    0 16px 30px rgba(31, 111, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 0 rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
}

.bottom-nav .nav-upload {
  position: static;
  width: auto;
  height: auto;
  min-height: 66px;
  border: 0;
  border-radius: 20px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  background: transparent;
  color: var(--blue);
  box-shadow: none;
}

.bottom-nav .nav-upload .upload-glyph {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background:
    radial-gradient(circle at 32% 22%, rgba(255, 255, 255, 0.58), transparent 34%),
    linear-gradient(145deg, #101b33 0%, #1f6fff 64%, #11a3c1 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow:
    0 18px 36px rgba(31, 111, 255, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -1px 0 rgba(255, 255, 255, 0.18);
  transform: none;
}

.bottom-nav .nav-upload .upload-glyph svg {
  width: 29px;
  height: 29px;
}

.bottom-nav .nav-upload .upload-glyph svg * {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom-nav .nav-upload small {
  display: block;
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
}

body:has(.view:target) .bottom-nav.is-hidden {
  display: none;
}

body:has(#familyAccess:target) .bottom-nav.is-hidden {
  display: none;
}

dialog {
  width: min(420px, calc(100vw - 28px));
  border: 0;
  border-radius: 24px;
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
}

.sheet {
  position: relative;
  padding: 20px;
}

.sheet h2 {
  margin: 4px 0 8px;
  padding-right: 52px;
  font-size: 24px;
  line-height: 1.08;
  overflow-wrap: normal;
}

.upload-helper {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--ink);
  font-size: 24px;
  font-weight: 750;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

#mcduDialog .sheet h2 {
  max-width: calc(100% - 46px);
  font-size: clamp(29px, 8vw, 39px);
  line-height: 1;
  letter-spacing: 0;
}

#mcduDialog .muted-label {
  padding-right: 52px;
}

.guide-sheet {
  display: grid;
  gap: 14px;
  padding: 24px;
}

.guide-sheet h2 {
  margin-bottom: 0;
  padding-right: 38px;
  font-size: 30px;
  letter-spacing: 0;
}

.guide-visual {
  position: relative;
  min-height: 178px;
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 72% 18%, rgba(31, 111, 255, 0.24), transparent 34%),
    linear-gradient(150deg, #f8fbff 0%, #eaf3ff 100%);
  border: 1px solid rgba(31, 111, 255, 0.12);
}

.guide-visual::before,
.guide-visual::after {
  content: "";
  position: absolute;
  border-radius: 999px;
}

.guide-visual::before {
  width: 74%;
  height: 18px;
  left: 13%;
  top: 46px;
  background: rgba(15, 23, 42, 0.12);
  box-shadow:
    0 42px 0 rgba(31, 111, 255, 0.16),
    0 84px 0 rgba(15, 23, 42, 0.09);
}

.guide-visual::after {
  width: 88px;
  height: 88px;
  right: 22px;
  bottom: 18px;
  background:
    linear-gradient(135deg, rgba(31, 111, 255, 0.92), rgba(20, 155, 205, 0.92));
  box-shadow: 0 18px 40px rgba(31, 111, 255, 0.22);
}

.guide-visual.is-family {
  background:
    radial-gradient(circle at 78% 18%, rgba(91, 69, 217, 0.18), transparent 34%),
    linear-gradient(150deg, #fbfbff 0%, #f1ecff 100%);
  border-color: rgba(91, 69, 217, 0.12);
}

.guide-visual.is-family::before {
  width: 58%;
  left: 21%;
  background: rgba(91, 69, 217, 0.14);
  box-shadow:
    0 42px 0 rgba(15, 23, 42, 0.1),
    0 84px 0 rgba(91, 69, 217, 0.12);
}

.guide-visual.is-family::after {
  right: calc(50% - 44px);
  background: linear-gradient(135deg, rgba(91, 69, 217, 0.9), rgba(31, 111, 255, 0.82));
}

.onboarding-guide-visual {
  min-height: 196px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  padding: 18px;
}

.onboarding-guide-visual::before,
.onboarding-guide-visual::after {
  content: none;
}

.onboarding-guide-visual strong {
  position: relative;
  z-index: 2;
  color: #173153;
  font-size: 15px;
  text-align: center;
}

.mini-device,
.mini-code-card,
.mini-privacy-card,
.mini-shared-calendar {
  position: relative;
  width: min(100%, 310px);
  height: 130px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 16% 18%, rgba(255, 255, 255, 0.9), transparent 18%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(210, 229, 255, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 18px 38px rgba(31, 111, 255, 0.16);
  overflow: hidden;
}

.mini-file-card,
.mini-doc-card {
  position: absolute;
  left: 24px;
  top: 25px;
  width: 138px;
  height: 82px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
  animation: mini-card-float 2.8s ease-in-out infinite;
}

.mini-file-card i,
.mini-doc-card i {
  position: absolute;
  left: 20px;
  right: 20px;
  height: 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.14);
}

.mini-file-card i:nth-child(1),
.mini-doc-card i:nth-child(1) {
  top: 20px;
}

.mini-file-card i:nth-child(2),
.mini-doc-card i:nth-child(2) {
  top: 38px;
}

.mini-file-card i:nth-child(3),
.mini-doc-card i:nth-child(3) {
  top: 56px;
}

.mini-file-card i.blue,
.mini-doc-card i:nth-child(2) {
  background: rgba(31, 111, 255, 0.28);
}

.mini-upload-orb {
  position: absolute;
  right: 34px;
  top: 34px;
  width: 74px;
  height: 74px;
  border-radius: 24px;
  background: linear-gradient(145deg, #16345b, #2472ff 74%, #10a6c8);
  box-shadow: 0 18px 36px rgba(31, 111, 255, 0.26);
  animation: mini-upload-pulse 2.4s ease-in-out infinite;
}

.mini-upload-label,
.mini-ok {
  position: absolute;
  right: 43px;
  top: 58px;
  color: #fff;
  font-weight: 900;
}

.mini-scan-line {
  position: absolute;
  left: 28px;
  top: 24px;
  width: 132px;
  height: 3px;
  border-radius: 999px;
  background: #1f6fff;
  box-shadow: 0 0 18px rgba(31, 111, 255, 0.55);
  animation: mini-scan 2.4s ease-in-out infinite;
}

.mini-chip {
  position: absolute;
  right: 22px;
  height: 28px;
  min-width: 76px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #173153;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.1);
  animation: mini-chip-pop 2.7s ease-in-out infinite;
}

.chip-one { top: 25px; animation-delay: 0.1s; }
.chip-two { top: 56px; animation-delay: 0.34s; }
.chip-three { top: 87px; animation-delay: 0.58s; }

.mini-result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: min(100%, 320px);
}

.mini-result-grid span,
.mini-shared-calendar span {
  min-height: 74px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.1);
  animation: mini-card-float 3s ease-in-out infinite;
}

.mini-result-grid span:nth-child(2) {
  animation-delay: 0.18s;
}

.mini-result-grid span:nth-child(3) {
  animation-delay: 0.36s;
}

.mini-result-grid b {
  color: #0f2340;
  font-size: 20px;
}

.mini-result-grid small {
  color: #66758a;
  font-size: 11px;
  font-weight: 850;
}

.mini-tab-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  width: min(100%, 320px);
}

.mini-tab-strip i {
  padding: 8px 6px;
  border-radius: 999px;
  background: rgba(31, 111, 255, 0.14);
  color: #1f6fff;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  text-align: center;
}

.mini-key-ring {
  position: absolute;
  left: 28px;
  top: 34px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 12px solid #1f6fff;
  box-shadow: 42px 18px 0 -17px #1f6fff;
  animation: mini-card-float 2.5s ease-in-out infinite;
}

.mini-code-dots {
  position: absolute;
  right: 28px;
  top: 48px;
  display: flex;
  gap: 8px;
}

.mini-code-dots i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #16345b;
  animation: mini-chip-pop 1.8s ease-in-out infinite;
}

.mini-code-dots i:nth-child(2) { animation-delay: 0.15s; }
.mini-code-dots i:nth-child(3) { animation-delay: 0.3s; }
.mini-code-dots i:nth-child(4) { animation-delay: 0.45s; }

.mini-ok {
  right: 36px;
  top: 78px;
  color: #118061;
}

.mini-shield {
  position: absolute;
  left: 28px;
  top: 28px;
  width: 64px;
  height: 76px;
  border-radius: 28px 28px 34px 34px;
  background: linear-gradient(145deg, #16345b, #2472ff);
  clip-path: polygon(50% 0, 100% 16%, 92% 70%, 50% 100%, 8% 70%, 0 16%);
  animation: mini-upload-pulse 2.8s ease-in-out infinite;
}

.mini-hidden-line {
  position: absolute;
  left: 118px;
  right: 24px;
  top: 38px;
  height: 16px;
  border-radius: 999px;
  background: repeating-linear-gradient(135deg, rgba(15, 23, 42, 0.16) 0 7px, rgba(15, 23, 42, 0.04) 7px 14px);
}

.mini-hidden-line.short {
  right: 64px;
  top: 66px;
}

.mini-visible-pill {
  position: absolute;
  left: 118px;
  bottom: 22px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #dff8ed;
  color: #118061;
  font-size: 12px;
  font-weight: 900;
}

.mini-shared-calendar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  gap: 10px;
  padding: 20px;
}

.mini-shared-calendar span {
  min-height: 62px;
  color: #173153;
  font-weight: 900;
}

.mini-shared-calendar b {
  grid-column: 1 / -1;
  justify-self: center;
  padding: 8px 22px;
  border-radius: 999px;
  background: #dff8ed;
  color: #118061;
  animation: mini-chip-pop 2s ease-in-out infinite;
}

@keyframes mini-card-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes mini-upload-pulse {
  0%, 100% { transform: scale(1); filter: saturate(1); }
  50% { transform: scale(1.06); filter: saturate(1.2); }
}

@keyframes mini-scan {
  0%, 100% { transform: translateY(0); opacity: 0.55; }
  50% { transform: translateY(76px); opacity: 1; }
}

@keyframes mini-chip-pop {
  0%, 100% { transform: scale(1); opacity: 0.82; }
  50% { transform: scale(1.06); opacity: 1; }
}

.feature-tour-visual {
  min-height: 156px;
}

.feature-tour-visual video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  z-index: 2;
}

.feature-tour-visual.is-calendar {
  background:
    linear-gradient(90deg, rgba(31, 111, 255, 0.14) 1px, transparent 1px),
    linear-gradient(180deg, rgba(31, 111, 255, 0.12) 1px, transparent 1px),
    linear-gradient(150deg, #fbfdff 0%, #eaf3ff 100%);
  background-size: 25% 33%, 25% 33%, auto;
}

.feature-tour-visual.is-upload {
  background:
    radial-gradient(circle at 50% 48%, rgba(31, 111, 255, 0.24), transparent 26%),
    linear-gradient(150deg, #f8fbff 0%, #eaf3ff 100%);
}

.feature-tour-visual.is-documents {
  background:
    linear-gradient(90deg, transparent 20%, rgba(255, 255, 255, 0.8) 20% 78%, transparent 78%),
    linear-gradient(150deg, #f9fbff 0%, #eef7ff 100%);
}

.feature-tour-visual.is-logbook {
  background:
    radial-gradient(circle at 50% 50%, transparent 0 34%, rgba(31, 111, 255, 0.16) 35% 36%, transparent 37%),
    linear-gradient(150deg, #f8fbff 0%, #eaf3ff 100%);
}

.feature-tour-visual.is-payroll {
  background:
    linear-gradient(180deg, transparent 0 42%, rgba(31, 111, 255, 0.18) 42% 58%, transparent 58%),
    linear-gradient(90deg, rgba(31, 111, 255, 0.12) 0 18%, transparent 18% 100%),
    linear-gradient(150deg, #fbfdff 0%, #eaf3ff 100%);
}

.feature-tour-visual.is-settings {
  background:
    radial-gradient(circle at 28% 50%, rgba(15, 23, 42, 0.16) 0 14%, transparent 15%),
    radial-gradient(circle at 72% 50%, rgba(31, 111, 255, 0.18) 0 14%, transparent 15%),
    linear-gradient(150deg, #fbfdff 0%, #eef4ff 100%);
}

.guide-progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.guide-progress span {
  height: 5px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.18);
}

.guide-progress span.is-active {
  background: var(--blue);
}

.choice-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

#quickUploadDialog {
  width: min(404px, calc(100vw - 28px));
}

.quick-upload-sheet {
  display: grid;
  gap: 12px;
  max-height: min(84vh, 680px);
  overflow-y: auto;
  padding: 22px;
  scroll-padding-bottom: 86px;
}

.quick-upload-sheet h2 {
  margin: 0;
  padding-right: 0;
  font-size: clamp(30px, 8.5vw, 42px);
  letter-spacing: 0;
}

.quick-upload-sheet .upload-helper {
  margin-bottom: 2px;
  font-size: 15px;
}

#quickUploadDialog .choice-list {
  grid-template-columns: 1fr;
  gap: 10px;
}

.compact-choice-list {
  grid-template-columns: 1fr;
}

.choice {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 8px;
  width: 100%;
  min-height: 142px;
  padding: 13px;
  border: 1px solid rgba(17, 33, 48, 0.12);
  border-radius: 18px;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.92), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(245, 250, 255, 0.72));
  text-align: left;
  align-items: start;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

#quickUploadDialog .choice {
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: none;
  gap: 13px;
  min-height: 82px;
  padding: 12px;
  border-radius: 20px;
  align-items: center;
}

#accountTypeDialog .choice {
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: none;
  gap: 12px;
  min-height: 82px;
  align-items: center;
}

.role-choice-card,
#accountTypeDialog .role-choice-card {
  overflow: hidden;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto;
  align-items: end;
  min-height: 132px;
  padding: 20px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 86% 36%, rgba(11, 107, 255, 0.12), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 250, 255, 0.84));
}

.role-choice-card .choice-copy {
  position: relative;
  z-index: 1;
  max-width: min(68%, 360px);
}

.role-choice-card .choice-copy strong {
  font-size: clamp(23px, 6.1vw, 30px);
  line-height: 1.02;
}

.role-choice-card .choice-copy small {
  font-size: 14px;
  line-height: 1.28;
}

#accountTypeDialog .choice-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

#accountTypeDialog .choice-copy strong,
#accountTypeDialog .choice-copy small {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: break-word;
}

#accountTypeDialog .choice-copy strong {
  line-height: 1.02;
}

#accountTypeDialog .choice-copy small {
  line-height: 1.28;
}

#quickUploadDialog .email-import-choice {
  border-color: rgba(10, 108, 255, 0.24);
  background:
    radial-gradient(circle at 10% 8%, rgba(255, 255, 255, 0.96), transparent 36%),
    linear-gradient(180deg, rgba(239, 247, 255, 0.98), rgba(255, 255, 255, 0.82));
}

#quickUploadDialog .email-import-choice .choice-icon {
  background:
    radial-gradient(circle at 32% 22%, rgba(255, 255, 255, 0.72), transparent 34%),
    linear-gradient(145deg, rgba(0, 119, 255, 0.2), rgba(0, 143, 153, 0.13));
}

.email-import-sheet {
  display: grid;
  gap: 14px;
}

.email-import-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.email-import-preview span {
  display: grid;
  min-height: 42px;
  place-items: center;
  padding: 8px;
  border: 1px solid #dce7f5;
  border-radius: 8px;
  color: var(--blue);
  background: #ffffff;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.1;
  text-align: center;
}

.email-import-note {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid #dce7f5;
  border-radius: 8px;
  background: #f8fafc;
}

.email-import-note strong,
.email-import-note p {
  margin: 0;
}

.email-import-note strong {
  color: #151922;
  font-size: 14px;
}

.email-import-note p {
  color: #667085;
  font-size: 13px;
  line-height: 1.35;
}

.email-provider-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.email-provider-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 10px 8px;
  border: 1px solid #dce7f5;
  border-radius: 8px;
  background: #fff;
  color: #151922;
  text-align: center;
  box-shadow: none;
}

.email-provider-card.selected {
  border-color: rgba(10, 108, 255, 0.5);
  background: #f5f9ff;
}

.email-provider-card strong {
  font-size: 13px;
  line-height: 1.1;
}

.email-provider-card small {
  color: #667085;
  font-size: 10px;
  line-height: 1.2;
}

.email-provider-mark {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  justify-self: center;
  border: 1px solid #cfe0f8;
  border-radius: 8px;
  color: var(--blue);
  background: #ffffff;
  font-size: 16px;
  font-weight: 900;
}

.google-mark { color: #1a73e8; }
.outlook-mark { color: #0067b8; }
.apple-mark { color: #151922; }

.email-import-actions {
  display: grid;
  gap: 8px;
}

.email-results-list {
  display: grid;
  gap: 8px;
}

.email-result-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #dce7f5;
  border-radius: 8px;
  background: #fff;
}

.email-result-row strong,
.email-result-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-result-row small {
  color: #667085;
  font-size: 12px;
}

.family-login-panel {
  display: grid;
  gap: 12px;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid #e1e7f0;
}

.crew-role-panel {
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding: 14px;
  border: 1px solid #dce7f5;
  border-radius: 8px;
  background: #f8fbff;
}

.crew-role-panel .dialog-actions {
  margin: 0;
}

.crew-role-panel[hidden],
.family-login-panel[hidden] {
  display: none !important;
}

.choice > span:not(.choice-copy),
.choice-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 32% 22%, rgba(255, 255, 255, 0.62), transparent 34%),
    linear-gradient(145deg, rgba(47, 112, 255, 0.18), rgba(14, 154, 199, 0.12));
  color: var(--blue);
  font-size: 25px;
  line-height: 1;
}

.choice > .mcdu-choice-icon {
  border: 2px solid rgba(0, 119, 255, 0.24);
  background:
    radial-gradient(circle at 32% 22%, rgba(255, 255, 255, 0.72), transparent 34%),
    linear-gradient(145deg, rgba(0, 119, 255, 0.2), rgba(0, 143, 153, 0.13));
}

.mcdu-choice-icon svg {
  width: 28px;
  height: 28px;
}

.mcdu-choice-icon svg * {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.role-choice-icon {
  position: absolute;
  z-index: 0;
  right: 8px;
  top: 50%;
  width: min(42%, 172px);
  height: 88%;
  display: block;
  border-radius: 0;
  object-fit: cover;
  object-fit: contain;
  object-position: center;
  background: transparent;
  box-shadow: none;
  opacity: 0.46;
  transform: translateY(-50%);
  pointer-events: none;
}

#accountTypeDialog .role-choice-icon {
  width: min(42%, 164px);
  height: 88%;
  border-radius: 0;
}

.role-choice-card--family .role-choice-icon {
  opacity: 0.36;
}

.role-profile-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice-icon {
  border-radius: 17px;
  background:
    radial-gradient(circle at 32% 22%, rgba(255, 255, 255, 0.62), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(234, 241, 250, 0.82));
  color: #202124;
  font-size: initial;
  line-height: normal;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 10px 22px rgba(20, 24, 31, 0.08);
}

.choice-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.15;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.choice-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.choice strong,
.choice small {
  display: block;
}

.choice strong {
  font-size: 16px;
  line-height: 1.08;
}

.choice small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.quick-upload-cancel {
  position: static;
  margin-top: 2px;
  min-height: 54px;
  border-radius: 18px;
}

.logbook-completion-sheet {
  max-width: 720px;
}

.logbook-completion-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.logbook-completion-grid .field.full {
  grid-column: 1 / -1;
}

@media (max-width: 720px) {
  .logbook-completion-grid {
    grid-template-columns: 1fr;
  }
}

/* Revision deck and old-document confirmation. */
.schedule-change-card-list {
  gap: 8px;
}

.schedule-change-day-group {
  overflow: hidden;
  border: 1px solid var(--cc-line);
  border-radius: 12px;
  background: var(--cc-card);
}

.schedule-change-day-group > h3 {
  margin: 0;
  padding: 9px 12px;
  border-bottom: 1px solid var(--cc-line);
  color: var(--cc-muted);
  background: var(--cc-fill);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.schedule-change-day-group .schedule-change-card {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.schedule-change-day-group .schedule-change-card + .schedule-change-card {
  border-top: 1px solid var(--cc-line);
}

.schedule-change-card.is-status-applied .schedule-change-date span {
  color: var(--cc-ok-ink, #176b37);
  background: var(--cc-ok-soft, #e8f6ed);
}

.schedule-change-card.is-status-kept .schedule-change-date span {
  color: var(--cc-warn-ink, #8a4b08);
  background: var(--cc-warn-soft, #fff2df);
}

.schedule-change-card.is-status-expired .schedule-change-date span {
  color: var(--cc-danger-ink, #a82b23);
  background: var(--cc-danger-soft, #fdebea);
}

#documentAgeDialog .document-age-sheet {
  width: min(calc(100vw - 28px), 440px) !important;
  padding: 20px !important;
}

#documentAgeDialog .document-age-sheet h2 {
  margin-bottom: 6px;
  color: var(--cc-ink) !important;
  font-size: clamp(22px, 6vw, 28px) !important;
  line-height: 1.1;
}

.document-age-summary {
  overflow: hidden;
  margin: 14px 0 4px;
  border: 1px solid var(--cc-line);
  border-radius: 12px;
  background: var(--cc-card);
}

.document-age-summary > div {
  display: grid;
  grid-template-columns: minmax(90px, 0.8fr) minmax(0, 1.2fr);
  gap: 12px;
  padding: 10px 12px;
}

.document-age-summary > div + div {
  border-top: 1px solid var(--cc-line);
}

.document-age-summary dt,
.document-age-summary dd {
  margin: 0;
  color: var(--cc-ink) !important;
  font-size: 14px;
}

.document-age-summary dt {
  color: var(--cc-muted) !important;
  font-weight: 700;
}

.document-age-summary dd {
  text-align: right;
  font-weight: 800;
}

body.theme-night .schedule-change-day-group,
body.theme-night .document-age-summary {
  border-color: var(--cc-line) !important;
  background: var(--cc-card) !important;
}

body.theme-night .schedule-change-day-group > h3 {
  border-color: var(--cc-line) !important;
  color: var(--cc-muted) !important;
  background: var(--cc-fill) !important;
}

/* Compact, divided logbook export picker. */
#logbookExportDialog .logbook-export-sheet {
  width: min(calc(100vw - 28px), 460px) !important;
  padding: 20px !important;
}

#logbookExportDialog .logbook-export-sheet h2 {
  margin: 2px 0 14px;
  color: var(--cc-ink) !important;
  font-size: 26px !important;
  line-height: 1.1;
}

#logbookExportDialog .logbook-export-options {
  display: block;
  overflow: hidden;
  border: 1px solid var(--cc-line);
  border-radius: 12px;
  background: var(--cc-card);
}

.logbook-export-row {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 8px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--cc-ink);
  text-align: left;
}

.logbook-export-row + .logbook-export-row {
  border-top: 1px solid var(--cc-line);
}

.logbook-export-row .row-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.logbook-export-row .row-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.logbook-export-row .row-main strong,
.logbook-export-row .row-main small {
  overflow: hidden;
  color: var(--cc-ink) !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logbook-export-row .row-main strong {
  font-size: 15px;
}

.logbook-export-row .row-main small {
  color: var(--cc-muted) !important;
  font-size: 12px;
}

.logbook-export-row-action {
  color: var(--cc-blue) !important;
  font-size: 20px;
  font-weight: 800;
}

.logbook-export-row[aria-busy="true"] .logbook-export-row-action {
  width: 18px;
  height: 18px;
  overflow: hidden;
  border: 2px solid var(--cc-line);
  border-top-color: var(--cc-blue);
  border-radius: 50%;
  color: transparent !important;
  animation: crewcal-export-spin 0.8s linear infinite;
}

.logbook-export-row:disabled {
  cursor: wait;
  opacity: 0.72;
}

@keyframes crewcal-export-spin {
  to { transform: rotate(360deg); }
}

body.theme-night #logbookExportDialog .logbook-export-options,
body.theme-night .logbook-export-row {
  border-color: var(--cc-line) !important;
  background: var(--cc-card) !important;
  color: var(--cc-ink) !important;
}

/* Synthetic, private family-invite walkthrough. */
.family-invite-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  margin: 14px 0;
  border: 1px solid var(--cc-line);
  border-radius: 12px;
  background: var(--cc-card);
}

.family-invite-preview article {
  position: relative;
  min-width: 0;
  padding: 10px;
}

.family-invite-preview article + article {
  border-left: 1px solid var(--cc-line);
}

.family-preview-step {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--cc-blue);
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
}

.family-preview-screen {
  display: grid;
  gap: 5px;
  min-height: 82px;
  padding: 30px 8px 8px;
  border: 1px solid var(--cc-line);
  border-radius: 9px;
  background: var(--cc-fill);
}

.family-preview-screen small,
.family-preview-screen strong,
.family-invite-preview p {
  color: var(--cc-ink) !important;
}

.family-preview-screen small {
  color: var(--cc-muted) !important;
  font-size: 9px;
}

.family-preview-screen strong {
  overflow-wrap: anywhere;
  font-size: 11px;
  line-height: 1.2;
}

.family-invite-preview p {
  margin: 7px 2px 0;
  color: var(--cc-muted) !important;
  font-size: 11px;
  line-height: 1.25;
}

body.theme-night .family-invite-preview,
body.theme-night .family-preview-screen {
  border-color: var(--cc-line) !important;
  background: var(--cc-card) !important;
}

body.theme-night .family-preview-screen {
  background: var(--cc-fill) !important;
}

.choice em {
  position: absolute;
  right: 12px;
  top: 12px;
  border-radius: 999px;
  padding: 4px 8px;
  background: #eef2ff;
  color: var(--blue);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.mcdu-manual-form {
  display: grid;
  gap: 12px;
}

.mcdu-manual-form[hidden] {
  display: none;
}

.time-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mcdu-result {
  padding: 12px;
  border: 1px solid rgba(38, 103, 255, 0.18);
  border-radius: 8px;
  background: #eef4ff;
  color: var(--blue);
  font-weight: 850;
  text-align: center;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 10px;
}

.selected-day-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.icon-text-button {
  border: 1px solid rgba(0, 119, 255, 0.18);
  border-radius: 999px;
  background: rgba(0, 119, 255, 0.08);
  color: var(--blue);
  padding: 10px 13px;
  font-size: 15px;
  font-weight: 850;
  line-height: 1;
}

#manualEventDialog {
  width: min(420px, calc(100vw - 28px));
}

#manualEventDialog .manual-event-sheet {
  display: grid;
  gap: 14px;
  max-height: min(82vh, 690px);
  overflow-y: auto;
  padding: 24px;
  scroll-padding-bottom: 110px;
}

#manualEventDialog .manual-event-sheet h2,
#manualEventDialog .manual-event-sheet .upload-helper,
#manualEventDialog .manual-event-sheet .field {
  margin: 0;
}

#manualEventDialog .manual-event-sheet .field {
  gap: 9px;
}

#manualEventDialog .manual-event-sheet .dialog-actions {
  position: static;
  grid-template-columns: 0.9fr 1.1fr 1.1fr;
  margin: 18px -4px 0;
  padding-top: 0;
  background: transparent;
}

#manualEventDialog .manual-event-sheet .dialog-actions button {
  min-height: 58px;
}

#sharedAccessDialog .shared-access-sheet {
  position: relative;
  width: min(420px, calc(100vw - 28px));
  max-height: min(720px, calc(100dvh - 32px));
  padding: 20px;
  overflow: auto;
}

#sharedAccessDialog .shared-access-sheet h2 {
  margin: 3px 52px 5px 0;
  font-size: 28px;
  line-height: 1.04;
}

#sharedAccessDialog .shared-access-sheet > .upload-helper {
  margin: 0 0 12px;
  max-width: 34ch;
  font-size: 14px;
  line-height: 1.35;
}

.shared-access-create {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(246, 248, 252, 0.88);
}

.shared-access-create .field {
  gap: 5px;
  margin: 0;
  font-size: 12px;
}

.shared-access-create .field > span {
  float: right;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
}

.shared-access-create input {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  background: #fff;
}

.shared-access-create .primary {
  min-height: 44px;
  margin-top: 2px;
  border-radius: 12px;
}

.shared-access-create.is-busy .primary {
  opacity: 0.72;
}

.shared-access-status {
  margin: 0;
  padding: 8px 2px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.shared-access-status[data-tone="success"] {
  color: #18794e;
}

.shared-access-status[data-tone="error"] {
  color: #b42318;
}

.shared-access-create > small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.shared-access-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 2px 7px;
}

.shared-access-heading strong {
  font-size: 15px;
}

.shared-access-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.shared-access-list {
  display: grid;
  gap: 8px;
  max-height: 244px;
  overflow-y: auto;
  padding-right: 2px;
}

.shared-access-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.shared-access-person {
  min-width: 0;
}

.shared-access-person strong,
.shared-access-person span,
.shared-access-person small {
  display: block;
}

.shared-access-person strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shared-access-person span {
  margin-top: 2px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
}

.shared-access-person small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.shared-access-row.revoked .shared-access-person {
  opacity: 0.55;
}

.shared-access-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.shared-access-row button {
  min-height: 34px;
  border: 0;
  border-radius: 10px;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 800;
}

.shared-access-row .share-access-button {
  background: rgba(0, 122, 255, 0.09);
  color: var(--blue);
}

.shared-access-row .revoke-access-button {
  background: rgba(255, 59, 48, 0.09);
  color: var(--red);
}

.shared-access-row.revoked .revoke-access-button {
  background: rgba(0, 122, 255, 0.09);
  color: var(--blue);
}

.shared-access-row button:disabled {
  opacity: 0.38;
}

.shared-access-empty {
  display: grid;
  gap: 3px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

.shared-access-empty strong {
  color: var(--ink);
  font-size: 14px;
}

.shared-access-empty span {
  font-size: 12px;
}

@media (max-width: 360px) {
  .shared-access-row {
    grid-template-columns: 1fr;
  }

  .shared-access-actions {
    justify-content: flex-start;
  }
}

.first-run-view {
  min-height: calc(100vh - 116px);
  padding-top: clamp(36px, 12vh, 92px);
}

.welcome-header {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.welcome-header h1 {
  margin: 0;
  color: #151922;
  font-family: var(--font-display);
  font-size: clamp(48px, 16vw, 76px);
  line-height: 0.94;
  letter-spacing: 0;
}

.welcome-header p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.3;
}

.welcome-header .muted-label {
  color: #697386;
  font-size: 12px;
}

.welcome-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(17, 33, 48, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 16px 46px rgba(17, 33, 48, 0.08);
}

.first-run-family-panel {
  margin-top: 0;
}

.first-run-panel {
  display: grid;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid #e1e7f0;
}

.first-run-panel[hidden] {
  display: none !important;
}

.sync-note {
  display: grid;
  gap: 6px;
  padding: 13px 14px;
  border: 1px solid rgba(17, 33, 48, 0.1);
  border-radius: 8px;
  background: rgba(245, 248, 252, 0.92);
}

.sync-note strong {
  color: #151922;
  font-size: 15px;
  line-height: 1.1;
}

.sync-note p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.welcome-panel-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.welcome-panel-actions button {
  min-height: 52px;
}

.welcome-login-link {
  justify-self: center;
  min-height: 38px;
}

.upload-box {
  position: relative;
  min-height: 140px;
  display: grid;
  place-items: center;
  gap: 6px;
  text-align: center;
  border: 2px dashed #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: var(--blue);
  margin-bottom: 12px;
}

.upload-box small {
  color: var(--muted);
}

.upload-box input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(247, 250, 252, 0.68);
  backdrop-filter: blur(18px);
}

.loading-overlay[hidden] {
  display: none;
}

.loading-card {
  width: 148px;
  height: 148px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 22px 60px rgba(23, 33, 43, 0.18);
}

.loading-ring {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #2667ff, #70d6ff, #f7c948, #2667ff);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 0);
  animation: loading-spin 900ms linear infinite;
}

.loading-card strong {
  color: var(--ink);
  font-size: 14px;
  animation: loading-blink 1.25s ease-in-out infinite;
}

@keyframes loading-spin {
  to { transform: rotate(360deg); }
}

@keyframes loading-blink {
  0%, 100% { opacity: 0.36; }
  50% { opacity: 1; }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 86px;
  z-index: 20;
  width: min(390px, calc(100vw - 32px));
  transform: translate(-50%, 12px);
  padding: 13px 14px;
  border-radius: 16px;
  background: #111827;
  color: #fff;
  font-weight: 750;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease, transform 150ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (min-width: 720px) {
  .phone-shell {
    width: min(100%, 980px);
    padding: 28px 28px 110px;
  }

  .view:not(#onboarding) {
    max-width: 920px;
    margin: 0 auto;
  }

  #calendar.view.active,
  #calendar.view:target,
  #payroll.view.active,
  #payroll.view:target,
  #documents.view.active,
  #documents.view:target,
  #logbook.view.active,
  #logbook.view:target,
  #settings.view.active,
  #settings.view:target {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.86fr);
    gap: 14px;
    align-items: start;
  }

  .home-header,
  .screen-header {
    grid-column: 1 / -1;
  }

  .next-flight-card {
    min-height: 260px;
  }

  .bottom-nav {
    width: min(100%, 980px);
    max-width: 760px;
    bottom: 12px;
    border-radius: 30px;
  }
}

@media (max-width: 380px) {
  .phone-shell {
    padding-inline: 10px;
  }

  .bottom-nav {
    padding-inline: 6px;
  }

  .bottom-nav button,
  .bottom-nav a {
    font-size: 10px;
  }

  .payroll-total strong,
  .next-flight-card h2 {
    font-size: 30px;
  }

  .next-flight-card {
    min-height: 214px;
  }

  .next-flight-card .chips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chip:last-child {
    grid-column: 1 / -1;
  }

  .time-grid,
  .dialog-actions,
  .choice-list {
    grid-template-columns: 1fr;
  }

  .action-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .row-action {
    margin-left: 52px;
  }
}

@media (min-width: 760px) {
  body {
    padding: 24px;
  }

  .phone-shell {
    min-height: calc(100vh - 48px);
    border-radius: 34px;
    overflow-x: hidden;
    overflow-y: visible;
  }

  .bottom-nav {
    bottom: 24px;
    border-radius: 32px;
  }
}


/* ============================================================
   CrewCal · Reskin estilo "Azul" (Apple claro)
   Pegado al final: sobrescribe los tokens y superficies clave.
   Para revertir, borra desde este comentario hasta el final.
   ============================================================ */
:root{
  --bg:#f4f4f6; --ink:#1d1d1f; --muted:#86868b;
  --card:rgba(255,255,255,0.58);
  --glass:rgba(255,255,255,0.5); --glass-strong:rgba(255,255,255,0.72); --glass-edge:rgba(255,255,255,0.85);
  --line:#ebebed;
  --blue:#0a6cff; --blue-2:#3a93ff; --blue-soft:#6fb0ff;
  --green:#2e7d5b; --amber:#9a6b12; --red:#c0392b; --purple:#5b53b0;
  --dark:#1c1c1e; --dark-2:#3a3a3c;
  --shadow:0 6px 22px rgba(28,28,30,0.09);
  --glass-shadow:inset 0 1px 0 rgba(255,255,255,0.65),0 6px 22px rgba(28,28,30,0.09);
  --font-display:"SF Pro Display",-apple-system,BlinkMacSystemFont,sans-serif;
  --font-body:"SF Pro Text",-apple-system,BlinkMacSystemFont,sans-serif;
}
body{
  background:
    radial-gradient(135% 110% at 6% -12%, #f1ece0 0%, rgba(241,236,224,0) 48%),
    radial-gradient(120% 100% at 104% -4%, #eaebf0 0%, rgba(234,235,240,0) 46%),
    #f4f4f6;
  color:var(--ink);
}
body::before{ display:none; }

.phone-shell{
  background:
    radial-gradient(135% 110% at 6% -12%, #f1ece0 0%, rgba(241,236,224,0) 48%),
    radial-gradient(120% 100% at 104% -4%, #eaebf0 0%, rgba(234,235,240,0) 46%),
    #f4f4f6;
  box-shadow:0 0 0 1px rgba(28,28,30,0.05);
}

/* Tarjetas glass claras */
.card, .next-flight-card{
  border-radius:18px;
  background:rgba(255,255,255,0.58);
  border:0.5px solid var(--glass-edge);
  box-shadow:var(--glass-shadow);
  backdrop-filter:blur(22px) saturate(1.8);
  -webkit-backdrop-filter:blur(22px) saturate(1.8);
}
.card::before{ display:none; }
.soft-card{ background:rgba(255,255,255,0.58); }

/* Tarjetas "hero" oscuras (proximo vuelo, total nomina, logbook) */
.next-flight-card, .payroll-card, .logbook-world-card{
  background:linear-gradient(150deg, var(--dark-2), var(--dark));
  color:#fff;
  border:0;
}
.next-flight-card::after{ background:rgba(111,176,255,0.12); }
.next-flight-card .muted-label,
.payroll-card .muted-label,
.logbook-world-card .muted-label{ color:var(--blue-soft); }

/* Botones */
.primary, .start-button{
  border-radius:14px;
  background:linear-gradient(180deg, var(--blue-2), var(--blue));
  color:#fff; font-weight:600;
}
.start-button{ background:var(--dark); }        /* primario solido negro */
.secondary{
  border-radius:14px;
  background:#fff; color:var(--ink); font-weight:600;
  box-shadow:inset 0 0 0 1px var(--line);
}

/* Barra de navegacion inferior (glass pill) */
.bottom-nav{
  border-radius:30px;
  background:rgba(255,255,255,0.5);
  border:0.5px solid var(--glass-edge);
  backdrop-filter:blur(32px) saturate(2);
  -webkit-backdrop-filter:blur(32px) saturate(2);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.85), 0 10px 30px rgba(28,28,30,0.18);
}
.bottom-nav a.active, .bottom-nav button.active{ color:var(--blue); }

/* Tipografia display plana (sin Rounded) */
h1, h2, .app-wordmark, .title{ font-family:var(--font-display); }
/* ===== fin reskin Azul ===== */

/* ============================================================
   CrewCal · Apple Airline Pro
   Capa final de direccion visual: sobria, operativa y limpia.
   ============================================================ */
:root {
  --bg: #f5f5f7;
  --ink: #17181c;
  --muted: #6e737d;
  --muted-2: #8a9099;
  --card: rgba(255, 255, 255, 0.74);
  --glass: rgba(255, 255, 255, 0.58);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --glass-edge: rgba(255, 255, 255, 0.88);
  --line: rgba(60, 60, 67, 0.14);
  --blue: #007aff;
  --blue-2: #0a84ff;
  --blue-soft: #b8d8ff;
  --green: #248a55;
  --amber: #a86f12;
  --red: #d12f35;
  --purple: #635bff;
  --dark: #111216;
  --dark-2: #25272d;
  --shadow: 0 14px 38px rgba(20, 24, 31, 0.08);
  --glass-shadow: 0 18px 44px rgba(20, 24, 31, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.82);
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
}

html {
  background: #eef2f6;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(820px 520px at 18% -14%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 64%),
    radial-gradient(760px 560px at 106% 6%, rgba(193, 221, 255, 0.42), rgba(193, 221, 255, 0) 58%),
    linear-gradient(180deg, #f7f8fb 0%, #eef3f7 48%, #f6f7f9 100%);
  color: var(--ink);
  font-family: var(--font-body);
  letter-spacing: 0;
}

.phone-shell {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0.12)),
    #f5f6f8;
  box-shadow: 0 0 0 1px rgba(20, 24, 31, 0.045);
}

.view {
  gap: 18px;
}

.home-header,
.screen-header,
.onboarding-hero {
  align-items: flex-start;
  padding-top: 6px;
}

.muted-label,
.route-pill {
  color: #737985;
  font-size: 12px;
  font-weight: 820;
  letter-spacing: 0.17em;
}

h1,
h2,
.app-wordmark,
.title {
  color: var(--ink);
  font-family: var(--font-display);
  letter-spacing: 0;
}

.home-header h1,
.screen-header h1 {
  font-size: clamp(40px, 10vw, 58px);
  line-height: 0.94;
}

.onboarding-hero h1,
.app-wordmark {
  font-size: clamp(58px, 17vw, 88px);
  line-height: 0.84;
  letter-spacing: 0;
}

.onboarding-hero p:not(.muted-label),
.onboarding-cta p,
.card > p,
.list-row small,
.settings-row small {
  color: var(--muted);
  line-height: 1.36;
}

.card,
.soft-card,
.list-row,
.settings-row,
.crew-residence,
.pilot-profile,
.family-access,
.document-card,
.upload-zone,
.onboarding-route-card {
  border: 0.5px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.64));
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(24px) saturate(1.55);
  backdrop-filter: blur(24px) saturate(1.55);
}

.card,
.list-row,
.settings-row {
  overflow: hidden;
}

.icon-action,
.row-action,
.secondary,
.text-button,
.family-access-toggle {
  border-radius: 16px;
  border: 0.5px solid rgba(60, 60, 67, 0.1);
  background: rgba(255, 255, 255, 0.68);
  color: var(--blue);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.icon-action {
  width: 54px;
  height: 54px;
}

.primary,
.start-button,
.onboarding-upload-actions .start-button {
  min-height: 54px;
  border-radius: 16px;
  background: linear-gradient(180deg, #1f8cff, #006ef5);
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 122, 255, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.onboarding-upload-actions .secondary,
.secondary {
  min-height: 54px;
  background: rgba(238, 245, 255, 0.74);
  color: #1468e8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.privacy-note {
  border: 1px solid rgba(20, 24, 31, 0.85);
  border-radius: 19px;
  background:
    repeating-linear-gradient(135deg, #ffd60a 0 12px, #15171b 12px 24px);
  box-shadow: 0 16px 34px rgba(20, 24, 31, 0.14);
}

.privacy-note span {
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.88);
  color: #16181d;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.onboarding-cta {
  padding: 0 6px;
  text-align: center;
}

.onboarding-paths {
  gap: 16px;
}

.onboarding-route-card {
  padding: 24px 20px 20px;
  gap: 16px;
  color: var(--ink);
}

.onboarding-route-card::before {
  display: none;
}

.onboarding-route-card.selected,
.role-card.selected,
.role-card:focus-within {
  border-color: rgba(0, 122, 255, 0.52);
  box-shadow: 0 18px 46px rgba(0, 122, 255, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.route-pill {
  align-self: flex-start;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #1f3d68;
  letter-spacing: 0.2em;
}

.onboarding-route-card strong {
  color: #111827;
  font-size: clamp(38px, 10vw, 48px);
  line-height: 0.98;
  letter-spacing: 0;
}

.onboarding-route-card small {
  display: block;
  max-width: 35rem;
  color: #59616d;
  font-size: 15px;
  font-weight: 650;
}

.family-route {
  background:
    radial-gradient(360px 240px at 92% 4%, rgba(0, 122, 255, 0.08), rgba(0, 122, 255, 0) 66%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(249, 251, 255, 0.82));
}

.crew-route {
  background:
    radial-gradient(360px 240px at 90% 0%, rgba(0, 122, 255, 0.1), rgba(0, 122, 255, 0) 66%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.84));
}

.onboarding-upload-actions {
  margin-top: 2px;
}

.next-flight-card,
.payroll-card,
.logbook-world-card {
  border: 0.5px solid rgba(255, 255, 255, 0.16);
  border-radius: 26px;
  background:
    radial-gradient(520px 280px at 84% 0%, rgba(0, 122, 255, 0.42), rgba(0, 122, 255, 0) 58%),
    linear-gradient(145deg, #2b2d34 0%, #15171d 52%, #0f1117 100%);
  color: #f8fbff;
  box-shadow: 0 22px 54px rgba(15, 17, 23, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.next-flight-card h2,
.payroll-total strong,
.logbook-world-card h2 {
  color: #fff;
}

.next-flight-card p,
.payroll-card p,
.logbook-world-card p {
  color: rgba(248, 251, 255, 0.72);
}

.next-flight-card .chip,
.pay-line,
.payroll-card .secondary {
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
}

.pay-line .pay-line-bar {
  background: rgba(255, 255, 255, 0.14);
}

.pay-line .pay-line-fill {
  background: linear-gradient(90deg, #65aaff, #0a84ff);
}

.logbook-map-shell,
.local-world-map {
  border-radius: 24px;
  background: #07090f;
}

.local-world-map {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.world-base-map {
  opacity: 0.82;
  filter: saturate(0.78) contrast(1.02) brightness(0.9);
}

.duty-bar-row,
.document-row,
.calendar-card,
.day-details-card {
  border: 0.5px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 28px rgba(20, 24, 31, 0.055);
}

.row-icon,
.tab-icon,
.upload-glyph {
  border: 0.5px solid rgba(255, 255, 255, 0.42);
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0) 34%),
    linear-gradient(160deg, #243044, #0a84ff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 10px 24px rgba(20, 24, 31, 0.13);
}

.row-icon svg *,
.tab-icon svg *,
.upload-glyph svg * {
  stroke-width: 1.9;
}

.bottom-nav {
  left: 50%;
  bottom: max(10px, env(safe-area-inset-bottom));
  width: min(100% - 22px, 720px);
  padding: 9px 12px 10px;
  border-radius: 30px;
  border: 0.5px solid rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 18px 46px rgba(20, 24, 31, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(34px) saturate(1.85);
  backdrop-filter: blur(34px) saturate(1.85);
}

.bottom-nav::before {
  display: none;
}

.bottom-nav a,
.bottom-nav button {
  gap: 4px;
  min-height: 60px;
  color: #6d7480;
  font-size: 12px;
  font-weight: 740;
}

.bottom-nav .tab-icon {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.54);
  color: #68717c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.bottom-nav a.active,
.bottom-nav button.active {
  color: var(--blue);
}

.bottom-nav a.active .tab-icon,
.bottom-nav button.active .tab-icon {
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 34%),
    linear-gradient(160deg, #1b56c9, #0a84ff);
  color: #fff;
  box-shadow: 0 12px 24px rgba(0, 122, 255, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.bottom-nav .nav-upload {
  transform: translateY(-10px);
}

.bottom-nav .nav-upload .upload-glyph {
  width: 58px;
  height: 58px;
  border-radius: 21px;
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0) 34%),
    linear-gradient(155deg, #234073 0%, #0a84ff 62%, #15a7cc 100%);
}

.bottom-nav .nav-upload small {
  color: #0a6cff;
  font-weight: 820;
}

dialog::backdrop {
  background: rgba(18, 21, 27, 0.42);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.sheet,
.guide-sheet {
  border: 0.5px solid rgba(255, 255, 255, 0.78);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 30px 80px rgba(20, 24, 31, 0.22);
}

input,
select,
textarea {
  border: 0.5px solid rgba(60, 60, 67, 0.14);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

@media (max-width: 460px) {
  .phone-shell {
    padding-inline: 14px;
    padding-bottom: 104px;
  }

  .view {
    gap: 16px;
  }

  .onboarding-hero h1,
  .app-wordmark {
    font-size: clamp(54px, 18vw, 76px);
  }

  .card,
  .onboarding-route-card {
    border-radius: 22px;
  }

  .bottom-nav {
    width: calc(100% - 18px);
    padding-inline: 8px;
  }

  .bottom-nav .tab-icon {
    width: 38px;
    height: 38px;
    border-radius: 15px;
  }

  .bottom-nav .nav-upload .upload-glyph {
    width: 56px;
    height: 56px;
  }
}

/* ============================================================
   CrewCal · Privilege Cockpit
   Estilo tomado de las referencias: claro, compacto, operativo,
   con modulos carbon y acento amarillo Privilege.
   ============================================================ */
:root {
  --bg: #efeeeb;
  --ink: #202124;
  --muted: #777b83;
  --muted-2: #a0a3aa;
  --card: #fbfbfa;
  --glass: rgba(255, 255, 255, 0.86);
  --glass-strong: rgba(255, 255, 255, 0.96);
  --glass-edge: rgba(0, 0, 0, 0.06);
  --line: rgba(24, 24, 27, 0.08);
  --blue: #0b6fff;
  --blue-2: #2d8cff;
  --blue-soft: #d8e9ff;
  --green: #28a66a;
  --amber: #d5a51d;
  --red: #d7372f;
  --purple: #6761d9;
  --dark: #1d1f24;
  --dark-2: #2c2f35;
  --shadow: 0 16px 38px rgba(21, 22, 25, 0.08);
  --glass-shadow: 0 14px 34px rgba(21, 22, 25, 0.075), inset 0 1px 0 rgba(255, 255, 255, 0.78);
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
}

html {
  background: #e9e8e4;
}

body {
  background:
    radial-gradient(720px 480px at 50% -12%, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0) 68%),
    linear-gradient(180deg, #f4f3f0 0%, #eeedea 52%, #f7f7f6 100%);
  color: var(--ink);
}

.phone-shell {
  max-width: 437px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.08)),
    #f4f3f0;
  box-shadow: 0 22px 70px rgba(31, 31, 31, 0.12);
}

.view {
  gap: 12px;
}

.home-header,
.screen-header,
.onboarding-hero {
  min-height: auto;
  padding: 6px 2px 0;
  align-items: center;
}

.home-header h1,
.screen-header h1,
.onboarding-hero h1,
.app-wordmark {
  color: #202124;
  font-size: clamp(28px, 8.8vw, 42px);
  line-height: 1.02;
  letter-spacing: 0;
}

.onboarding-hero h1,
.app-wordmark {
  font-size: clamp(44px, 13vw, 62px);
}

.muted-label,
.route-pill {
  color: #777b83;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.16em;
}

.onboarding-hero p:not(.muted-label),
.onboarding-cta p,
.card > p,
.export-copy,
.list-row small,
.settings-row small {
  color: #747982;
  font-size: 14px;
  line-height: 1.34;
}

.card,
.soft-card,
.list-row,
.settings-row,
.document-row,
.duty-bar-row,
.calendar-card,
.day-details-card,
.crew-residence,
.pilot-profile,
.family-access,
.upload-zone,
.onboarding-route-card {
  border: 1px solid rgba(24, 24, 27, 0.06);
  border-radius: 14px;
  background: rgba(251, 251, 250, 0.94);
  box-shadow: 0 14px 34px rgba(22, 24, 28, 0.075);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  backdrop-filter: blur(18px) saturate(1.1);
}

.card::before,
.role-card::after {
  display: none;
}

.section-title {
  gap: 10px;
}

.section-title h2,
.card h2 {
  color: #202124;
  font-size: 20px;
  letter-spacing: 0;
}

.icon-action,
.row-action,
.secondary,
.text-button,
.family-access-toggle {
  min-height: 38px;
  border: 1px solid rgba(24, 24, 27, 0.07);
  border-radius: 12px;
  background: #f8f8f6;
  color: #202124;
  box-shadow: 0 8px 22px rgba(22, 24, 28, 0.055), inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.icon-action {
  width: 52px;
  height: 52px;
}

.subtle-action,
.gear-action {
  border-color: rgba(24, 24, 27, 0.08);
  background: #f8f8f6;
  color: #202124;
  box-shadow: 0 10px 22px rgba(22, 24, 28, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.primary,
.start-button,
.onboarding-upload-actions .start-button {
  min-height: 48px;
  border-radius: 12px;
  background: #1e2025;
  color: #fff;
  box-shadow: 0 12px 26px rgba(22, 24, 28, 0.17), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.onboarding-upload-actions .secondary,
.secondary {
  min-height: 48px;
  background: #f2f2f0;
  color: #202124;
}

.badge,
.chip,
.route-pill {
  border-radius: 999px;
}

.badge.ok,
.badge.route-badge,
.route-badge {
  border: 0;
  background: rgba(213, 165, 29, 0.18);
  color: #9b7100;
}

.badge.warn {
  border: 0;
  background: rgba(213, 165, 29, 0.16);
  color: #9b7100;
}

#documentsAlerts .list-row:has(.row-icon.ok) {
  background:
    linear-gradient(145deg, rgba(232, 248, 239, 0.96), rgba(245, 253, 248, 0.88));
  border-color: rgba(36, 138, 85, 0.28);
  box-shadow: 0 14px 34px rgba(36, 138, 85, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

#documentsAlerts .row-icon.ok {
  color: #ffffff;
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0) 34%),
    linear-gradient(160deg, #0f6b43, #28a66a);
}

#documentsAlerts .list-row:has(.row-icon.ok) strong {
  color: #145c3a;
}

#documentsAlerts .list-row:has(.row-icon.ok) span {
  color: #2e7d5b;
}

#logbook .logbook-world-card {
  margin-top: 18px;
}

#logbook .logbook-world-card .section-title {
  margin-bottom: 18px;
}

#logbook .logbook-globe {
  margin-top: 18px;
}

.mcdu-scan-action {
  min-height: 54px;
  padding: 7px 10px 7px 8px;
  border: 0.5px solid rgba(32, 33, 36, 0.08);
  border-radius: 16px;
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.9), transparent 32%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(246, 246, 244, 0.82));
  color: #202124;
  box-shadow: 0 12px 26px rgba(22, 24, 28, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.mcdu-scan-action > span:last-child {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
}

.mcdu-action-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 28% 20%, rgba(255, 255, 255, 0.85), transparent 36%),
    linear-gradient(150deg, #eef4ff, #f8fbff);
  color: #202124;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.mcdu-action-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.calendar-view-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 12px 0 14px;
  padding: 4px;
  border: 0.5px solid rgba(32, 33, 36, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.calendar-view-toggle button {
  min-height: 38px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #777b83;
  font-weight: 850;
}

.calendar-view-toggle button.active {
  background: #202124;
  color: #fff;
  box-shadow: 0 10px 20px rgba(22, 24, 28, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.13);
}

.calendar-list-view {
  display: grid;
  gap: 6px;
}

.calendar-list-view[hidden] {
  display: none;
}

.full-calendar[hidden],
.weekday-row[hidden],
.calendar-list-view[hidden] {
  display: none !important;
}

.calendar-list-day {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 0.5px solid rgba(32, 33, 36, 0.1);
  border-radius: 12px;
  padding: 7px 8px;
  background: rgba(255, 255, 255, 0.78);
  color: #202124;
  text-align: left;
  box-shadow: 0 6px 14px rgba(22, 24, 28, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.calendar-list-day.selected {
  border-color: rgba(0, 122, 255, 0.72);
  box-shadow: 0 8px 18px rgba(0, 122, 255, 0.1), inset 0 0 0 1px rgba(0, 122, 255, 0.4);
}

.calendar-list-date {
  min-height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  align-content: center;
  background: #f5f5f4;
}

.calendar-list-date strong {
  font-size: 19px;
  line-height: 1;
}

.calendar-list-date small {
  color: #777b83;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.calendar-list-items {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.calendar-list-item {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(82px, max-content) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 5px 8px;
  border-radius: 9px;
  background: rgba(32, 33, 36, 0.04);
}

.calendar-list-item::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  justify-self: start;
  grid-column: 1;
  grid-row: 1;
}

.calendar-list-item b {
  min-width: 0;
  overflow: hidden;
  color: #202124;
  font-size: 13px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-left: 12px;
  grid-column: 1;
  grid-row: 1;
}

.calendar-list-item small,
.calendar-list-empty span {
  color: #747982;
  font-size: 11px;
  line-height: 1.15;
}

.calendar-list-item small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  grid-column: 2;
  grid-row: 1;
}

.calendar-list-item.is-flight {
  background: rgba(0, 122, 255, 0.1);
  color: #0b68e5;
}

.calendar-list-item.is-off {
  background: rgba(28, 137, 105, 0.1);
  color: #168a62;
}

.calendar-list-item.is-hotel {
  background: rgba(213, 165, 29, 0.13);
  color: #c18a06;
}

.calendar-list-item.is-sim {
  background: rgba(89, 83, 214, 0.1);
  color: #6257d7;
}

.calendar-list-item.is-reserve {
  background: rgba(255, 59, 48, 0.1);
  color: #d92d20;
}

.calendar-list-item.is-oncall {
  background: #e3f3f8;
  color: #0a5e78;
}

.calendar-list-item.is-transport {
  background: rgba(15, 159, 149, 0.1);
  color: #087f76;
}

.calendar-list-empty {
  display: grid;
  gap: 5px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
}

.privacy-note {
  padding: 3px;
  border: 0;
  border-radius: 14px;
  background: #1e2025;
  box-shadow: 0 12px 24px rgba(22, 24, 28, 0.14);
}

.privacy-note span {
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.94);
  color: #202124;
  font-size: 12px;
}

.onboarding-route-card {
  padding: 18px;
  gap: 13px;
}

.route-pill {
  padding: 7px 12px;
  background: #fff;
  color: #202124;
  box-shadow: 0 8px 18px rgba(22, 24, 28, 0.055);
}

.onboarding-route-card strong {
  color: #202124;
  font-size: clamp(28px, 8vw, 36px);
  letter-spacing: 0;
}

.onboarding-route-card small {
  color: #666b74;
  font-size: 13px;
  font-weight: 600;
}

.crew-route,
.family-route {
  background:
    radial-gradient(280px 220px at 84% 0%, rgba(213, 165, 29, 0.12), transparent 62%),
    #fbfbfa;
}

.onboarding-route-card.selected,
.role-card.selected,
.role-card:focus-within {
  border-color: rgba(213, 165, 29, 0.42);
  box-shadow: 0 14px 34px rgba(22, 24, 28, 0.08), inset 0 0 0 1px rgba(213, 165, 29, 0.18);
}

.next-flight-card,
.payroll-card,
.logbook-world-card {
  border: 0;
  border-radius: 16px;
  background:
    radial-gradient(320px 160px at 92% 8%, rgba(88, 94, 105, 0.38), transparent 60%),
    linear-gradient(145deg, #303238 0%, #1f2127 56%, #15171c 100%);
  color: #fff;
  box-shadow: 0 18px 42px rgba(22, 24, 28, 0.18);
}

.next-flight-card::after {
  background:
    linear-gradient(135deg, transparent 0 45%, rgba(255, 255, 255, 0.05) 46% 55%, transparent 56%),
    radial-gradient(circle at 86% 20%, rgba(213, 165, 29, 0.11), transparent 36%);
}

.next-flight-card h2,
.payroll-total strong,
.logbook-world-card h2 {
  color: #fff;
}

.next-flight-card p,
.payroll-card p,
.logbook-world-card p {
  color: rgba(255, 255, 255, 0.72);
}

.next-flight-card .muted-label,
.payroll-card .muted-label,
.logbook-world-card .muted-label {
  color: #82b7ff;
}

.next-flight-card .chip,
.pay-line,
.payroll-card .secondary {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.92);
}

.pay-line .pay-line-fill {
  background: linear-gradient(90deg, #d5a51d, #f0d56c);
}

.logbook-globe {
  border-radius: 14px;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.08) 0 1px, transparent 2px),
    linear-gradient(180deg, #111318, #0b0d11);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.local-world-map {
  border-radius: 14px;
}

.world-route {
  stroke: #4d9aff;
  stroke-width: 3.6;
  stroke-dasharray: 7 7;
}

.world-airport circle:first-child {
  fill: rgba(255, 255, 255, 0.18);
  stroke: rgba(255, 255, 255, 0.82);
}

.world-airport circle:nth-child(2) {
  fill: #fff;
  stroke: #4d9aff;
}

.world-airport text {
  fill: #fff;
  stroke: rgba(17, 19, 24, 0.9);
  font-size: 20px;
}

.mini-calendar,
.full-calendar {
  gap: 6px;
}

.mini-day,
.calendar-day,
.day-cell {
  border-radius: 9px;
  background: #fbfbfa;
  border: 1px solid rgba(24, 24, 27, 0.06);
  box-shadow: 0 6px 14px rgba(22, 24, 28, 0.045);
}

.calendar-day.is-selected,
.mini-day.active,
.day-cell.active {
  border-color: rgba(11, 111, 255, 0.42);
  background: #eef5ff;
  box-shadow: inset 0 0 0 1px rgba(11, 111, 255, 0.18);
}

.row-icon,
.tab-icon,
.upload-glyph {
  border: 1px solid rgba(24, 24, 27, 0.07);
  background:
    radial-gradient(circle at 30% 18%, rgba(255, 255, 255, 0.88), transparent 34%),
    linear-gradient(145deg, #f8f8f6, #ebebe8);
  color: #202124;
  box-shadow: 0 8px 18px rgba(22, 24, 28, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.row-icon svg *,
.tab-icon svg *,
.upload-glyph svg * {
  stroke: currentColor;
}

.bottom-nav {
  width: min(100% - 28px, 390px);
  padding: 8px 10px 9px;
  border-radius: 22px;
  border: 1px solid rgba(24, 24, 27, 0.08);
  background: rgba(251, 251, 250, 0.92);
  box-shadow: 0 16px 36px rgba(22, 24, 28, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  backdrop-filter: blur(18px) saturate(1.1);
}

.bottom-nav a,
.bottom-nav button {
  min-height: 54px;
  color: #777b83;
  font-size: 11px;
  font-weight: 720;
}

.bottom-nav .tab-icon {
  width: 34px;
  height: 34px;
  border-radius: 13px;
  background: #f4f4f2;
  color: #6f747d;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.bottom-nav a.active,
.bottom-nav button.active {
  color: #202124;
}

.bottom-nav a.active .tab-icon,
.bottom-nav button.active .tab-icon {
  background: #202124;
  color: #fff;
  box-shadow: 0 10px 20px rgba(22, 24, 28, 0.16);
}

.bottom-nav .nav-upload {
  transform: translateY(-2px);
}

.bottom-nav .nav-upload .upload-glyph {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  background: #202124;
  color: #fff;
  box-shadow: 0 12px 24px rgba(22, 24, 28, 0.2);
}

.bottom-nav .nav-upload small {
  color: #202124;
}

.sheet,
.guide-sheet {
  border-radius: 22px;
  background: #fbfbfa;
}

.logbook-export-summary {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 14px;
  background:
    radial-gradient(220px 150px at 92% 0%, rgba(213, 165, 29, 0.12), transparent 62%),
    #fbfbfa;
}

.logbook-export-summary strong,
.logbook-export-summary span {
  display: block;
}

.logbook-export-summary strong {
  margin-top: 4px;
  color: #202124;
  font-size: 22px;
  line-height: 1.04;
  letter-spacing: 0;
}

.logbook-export-summary span {
  margin-top: 5px;
  color: #686d75;
  font-size: 13px;
  line-height: 1.34;
  font-weight: 620;
}

.logbook-export-open-btn {
  width: 100%;
}

.logbook-export-sheet {
  max-height: min(82vh, 680px);
  overflow: hidden;
}

.logbook-export-options {
  max-height: min(55vh, 430px);
  overflow-y: auto;
  padding-right: 2px;
}

.logbook-export-options .list-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-areas:
    "icon text"
    "button button";
  align-items: start;
  gap: 10px;
  min-height: 0;
  padding: 13px;
}

.logbook-export-options .row-icon,
.logbook-export-sheet .row-icon {
  grid-area: icon;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  border-radius: 11px;
  font-size: 12px;
  line-height: 1;
}

.logbook-export-options .row-icon svg,
.logbook-export-sheet .row-icon svg {
  width: 17px !important;
  height: 17px !important;
}

.logbook-export-options .row-main,
.logbook-export-sheet .row-main {
  grid-area: text;
  min-width: 0;
  width: 100%;
}

.logbook-export-options .row-main strong,
.logbook-export-options .row-main span {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.logbook-export-options .row-main strong {
  font-size: 16px;
  line-height: 1.12;
}

.logbook-export-options .row-main span {
  margin-top: 4px;
  font-size: 12.5px;
  line-height: 1.32;
}

.logbook-export-options .row-action,
.logbook-export-sheet .row-action {
  position: static !important;
  grid-area: button;
  width: 100%;
  margin-left: 0;
  transform: none !important;
  min-height: 42px;
  border-radius: 12px;
  background: #202124;
  color: #fff;
}

/* CrewCal icon system: glossy rounded app-style icons. */
.row-icon,
.choice-icon,
.mcdu-action-icon,
.bottom-nav .tab-icon,
.bottom-nav .nav-upload .upload-glyph,
.icon-action.subtle-action,
.mcdu-scan-action {
  position: relative;
  overflow: hidden;
  border: 0.5px solid rgba(255, 255, 255, 0.72);
  background:
    radial-gradient(circle at 27% 18%, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0) 32%),
    linear-gradient(150deg, #0b6fff 0%, #0066ff 58%, #004ec7 100%);
  color: #fff;
  box-shadow:
    0 14px 28px rgba(0, 102, 255, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.68),
    inset 0 -1px 0 rgba(0, 23, 87, 0.2);
}

.row-icon::before,
.choice-icon::before,
.mcdu-action-icon::before,
.bottom-nav .tab-icon::before,
.bottom-nav .nav-upload .upload-glyph::before,
.icon-action.subtle-action::before,
.mcdu-scan-action::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto;
  height: 45%;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.row-icon svg,
.choice-icon svg,
.mcdu-action-icon svg,
.bottom-nav .tab-icon svg,
.bottom-nav .nav-upload .upload-glyph svg,
.icon-action svg {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 1px 1px rgba(0, 20, 80, 0.16));
}

.row-icon svg *,
.choice-icon svg *,
.mcdu-action-icon svg *,
.bottom-nav .tab-icon svg *,
.bottom-nav .nav-upload .upload-glyph svg *,
.icon-action svg * {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom-nav .tab-icon {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  color: #6f7a89;
  background:
    radial-gradient(circle at 27% 18%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 34%),
    linear-gradient(150deg, #ffffff, #f4f7fb);
  box-shadow:
    0 9px 18px rgba(20, 24, 31, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.bottom-nav a[data-view="calendar"].active .tab-icon {
  background:
    radial-gradient(circle at 27% 18%, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0) 32%),
    linear-gradient(150deg, #1677ff, #0066ff 62%, #004ec7);
}

.bottom-nav a[data-view="documents"].active .tab-icon {
  background:
    radial-gradient(circle at 27% 18%, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0) 32%),
    linear-gradient(150deg, #2f8cff, #0b6fff 62%, #0950bd);
}

.bottom-nav a[data-view="logbook"].active .tab-icon {
  background:
    radial-gradient(circle at 27% 18%, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0) 32%),
    linear-gradient(150deg, #8e5cff, #6438df 62%, #4421a8);
}

.bottom-nav a[data-view="payroll"].active .tab-icon {
  background:
    radial-gradient(circle at 27% 18%, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0) 32%),
    linear-gradient(150deg, #27c46a, #13a64d 62%, #087737);
}

.bottom-nav .nav-upload .upload-glyph,
.row-icon.flight,
.choice[data-quick-upload="schedule"] .choice-icon {
  background:
    radial-gradient(circle at 27% 18%, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0) 32%),
    linear-gradient(150deg, #1677ff, #0066ff 58%, #004ec7);
}

.choice[data-quick-upload="payroll"] .choice-icon,
.row-icon.ok {
  background:
    radial-gradient(circle at 27% 18%, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0) 32%),
    linear-gradient(150deg, #27c46a, #13a64d 58%, #087737);
}

.choice[data-quick-upload="prepayroll"] .choice-icon,
.row-icon.sim {
  background:
    radial-gradient(circle at 27% 18%, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0) 32%),
    linear-gradient(150deg, #9a66ff, #6b3ce6 58%, #4522ad);
}

.choice[data-quick-upload="mcdu"] .choice-icon,
.mcdu-action-icon,
.mcdu-scan-action {
  background:
    radial-gradient(circle at 27% 18%, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0) 32%),
    linear-gradient(150deg, #18c4bd, #08a9aa 58%, #08787f);
}

.row-icon.off {
  background:
    radial-gradient(circle at 27% 18%, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0) 32%),
    linear-gradient(150deg, #46d76f, #20b853 58%, #0d8a38);
}

.row-icon.hotel {
  background:
    radial-gradient(circle at 27% 18%, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0) 32%),
    linear-gradient(150deg, #ffb238, #ff8a00 58%, #c76100);
}

.row-icon.reserve {
  background: linear-gradient(150deg, #ff6b61, #ff3b30 58%, #c8241a);
}

.row-icon.oncall {
  background: #d8f0f7;
  color: #0a5e78;
}

.row-icon.transport {
  background: linear-gradient(150deg, #27c9bd, #0f9f95 58%, #08766f);
}

.row-icon.warn {
  background:
    radial-gradient(circle at 27% 18%, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0) 32%),
    linear-gradient(150deg, #ffbd38, #ff9500 58%, #ce6f00);
}

.row-icon.danger {
  background:
    radial-gradient(circle at 27% 18%, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0) 32%),
    linear-gradient(150deg, #ff5a68, #ff303d 58%, #c91522);
}

.choice-icon {
  color: #fff;
}

.mcdu-scan-action {
  gap: 8px;
  color: #fff;
}

.mcdu-scan-action > span:last-child {
  position: relative;
  z-index: 1;
  color: #fff;
}

.icon-action.subtle-action.gear-action {
  background:
    radial-gradient(circle at 27% 18%, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0) 34%),
    linear-gradient(150deg, #ffffff, #f5f7fb);
  color: #21a453;
  box-shadow:
    0 12px 26px rgba(20, 24, 31, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

/* Icon polish: keep app-style color without glow halos. */
.row-icon,
.choice-icon,
.mcdu-action-icon,
.bottom-nav .tab-icon,
.bottom-nav .nav-upload .upload-glyph,
.icon-action.subtle-action,
.mcdu-scan-action {
  box-shadow:
    0 6px 14px rgba(22, 24, 28, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.42) !important;
}

.bottom-nav a.active .tab-icon,
.bottom-nav button.active .tab-icon,
.bottom-nav .nav-upload .upload-glyph {
  box-shadow:
    0 7px 16px rgba(22, 24, 28, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.42) !important;
}

.row-icon::before,
.choice-icon::before,
.mcdu-action-icon::before,
.bottom-nav .tab-icon::before,
.bottom-nav .nav-upload .upload-glyph::before,
.icon-action.subtle-action::before,
.mcdu-scan-action::before {
  content: none !important;
}

.row-icon svg,
.choice-icon svg,
.mcdu-action-icon svg,
.bottom-nav .tab-icon svg,
.bottom-nav .nav-upload .upload-glyph svg,
.icon-action svg {
  filter: none !important;
}

input,
select,
textarea {
  border: 1px solid rgba(24, 24, 27, 0.08);
  border-radius: 11px;
  background: #f8f8f6;
  color: #202124;
}

@media (min-width: 720px) {
  .phone-shell {
    max-width: 437px;
    width: min(100%, 437px);
    padding: 20px 14px 96px;
    border-radius: 34px;
  }

  #calendar.view.active,
  #calendar.view:target,
  #payroll.view.active,
  #payroll.view:target,
  #documents.view.active,
  #documents.view:target,
  #logbook.view.active,
  #logbook.view:target,
  #settings.view.active,
  #settings.view:target {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media (max-width: 460px) {
  .phone-shell {
    padding-inline: 14px;
    padding-bottom: 96px;
  }

  .bottom-nav {
    width: calc(100% - 20px);
    border-radius: 22px;
  }

  .onboarding-hero h1,
  .app-wordmark {
    font-size: clamp(42px, 14vw, 58px);
  }
}

/* Clean outline icon system inspired by the CrewCal design board. */
.row-icon,
.choice-icon,
.mcdu-action-icon,
.bottom-nav .tab-icon,
.bottom-nav .nav-upload .upload-glyph,
.icon-action.subtle-action,
.mcdu-scan-action {
  overflow: visible;
  color: var(--blue);
  background: rgba(255, 255, 255, 0.92) !important;
  border: 1px solid rgba(0, 102, 255, 0.18) !important;
  box-shadow:
    0 8px 22px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.92) !important;
}

.row-icon::before,
.choice-icon::before,
.mcdu-action-icon::before,
.bottom-nav .tab-icon::before,
.bottom-nav .nav-upload .upload-glyph::before,
.icon-action.subtle-action::before,
.mcdu-scan-action::before {
  content: none !important;
}

.row-icon svg,
.choice-icon svg,
.mcdu-action-icon svg,
.bottom-nav .tab-icon svg,
.bottom-nav .nav-upload .upload-glyph svg,
.icon-action svg {
  filter: none !important;
}

.row-icon svg *,
.choice-icon svg *,
.mcdu-action-icon svg *,
.bottom-nav .tab-icon svg *,
.bottom-nav .nav-upload .upload-glyph svg *,
.icon-action svg * {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom-nav {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow:
    0 18px 44px rgba(15, 23, 42, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.bottom-nav::before {
  content: none;
}

.bottom-nav a,
.bottom-nav button {
  color: #667085;
  letter-spacing: 0;
}

.bottom-nav a.active,
.bottom-nav button.active {
  color: var(--blue);
  background: rgba(0, 102, 255, 0.06);
  box-shadow: none;
}

.bottom-nav a.active .tab-icon,
.bottom-nav button.active .tab-icon,
.bottom-nav .nav-upload .upload-glyph {
  color: var(--blue);
  background: #fff !important;
  border-color: rgba(0, 102, 255, 0.32) !important;
  box-shadow:
    0 8px 20px rgba(0, 102, 255, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
  transform: none;
}

.bottom-nav .nav-upload {
  color: var(--blue);
}

.bottom-nav .nav-upload .upload-glyph {
  width: 52px;
  height: 52px;
  border-radius: 20px;
}

.row-icon.flight,
.choice[data-quick-upload="schedule"] .choice-icon {
  color: var(--blue);
  background: rgba(0, 102, 255, 0.07) !important;
  border-color: rgba(0, 102, 255, 0.24) !important;
}

.row-icon.ok,
.row-icon.off,
.choice[data-quick-upload="payroll"] .choice-icon {
  color: #17a34a;
  background: rgba(23, 163, 74, 0.08) !important;
  border-color: rgba(23, 163, 74, 0.24) !important;
}

.row-icon.sim,
.choice[data-quick-upload="prepayroll"] .choice-icon {
  color: #6750d8;
  background: rgba(103, 80, 216, 0.08) !important;
  border-color: rgba(103, 80, 216, 0.24) !important;
}

.row-icon.hotel,
.row-icon.warn {
  color: #f28a00;
  background: rgba(242, 138, 0, 0.1) !important;
  border-color: rgba(242, 138, 0, 0.28) !important;
}

.row-icon.danger {
  color: #e02020;
  background: rgba(224, 32, 32, 0.08) !important;
  border-color: rgba(224, 32, 32, 0.24) !important;
}

.choice[data-quick-upload="mcdu"] .choice-icon,
.mcdu-action-icon,
.mcdu-scan-action {
  color: #008f99;
  background: rgba(0, 143, 153, 0.08) !important;
  border-color: rgba(0, 143, 153, 0.24) !important;
}

.icon-action.subtle-action.gear-action {
  color: var(--blue);
}

.mcdu-scan-action > span:last-child {
  color: inherit;
}

#logbook .screen-header {
  gap: 10px;
}

#logbook .screen-header > div:first-child {
  min-width: 0;
}

#logbook .screen-header h1 {
  max-width: calc(100vw - 150px);
  overflow: hidden;
  text-overflow: ellipsis;
}

#logbook .header-actions {
  gap: 6px;
  max-width: 108px;
}

#logbook .header-actions .icon-action {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  min-height: 46px;
}

#logbook .mcdu-scan-action {
  padding: 0;
  border-radius: 17px;
}

#logbook .mcdu-scan-action::before {
  content: none;
}

#logbook .mcdu-action-image {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  transform: scale(1.16);
}

#logbook .mcdu-action-icon {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent !important;
  box-shadow: none;
}

#logbook .mcdu-action-icon svg {
  width: 25px;
  height: 25px;
}

/* CrewCal Pro visual refresh: Executive cockpit + Operations Pro */
:root {
  --bg: #f3f6f9;
  --ink: #172033;
  --muted: #667386;
  --card: #ffffff;
  --glass: rgba(255, 255, 255, 0.94);
  --glass-strong: #ffffff;
  --glass-edge: #d8e0ea;
  --line: #d9e1eb;
  --blue: #0b64d8;
  --blue-2: #007f9f;
  --green: #12805c;
  --amber: #b57a09;
  --red: #c93535;
  --purple: #5f54c8;
  --cyan: #087c8d;
  --dark: #10233f;
  --paper: #ffffff;
  --shadow: 0 8px 22px rgba(16, 35, 63, 0.08);
  --glass-shadow: 0 8px 22px rgba(16, 35, 63, 0.08);
}

html,
body {
  background: var(--bg);
  color: var(--ink);
}

body {
  background:
    linear-gradient(180deg, #f7f9fc 0%, #eef3f8 100%);
  font-family: var(--font-body);
}

body::before {
  display: none;
}

.phone-shell,
main,
.view {
  background: transparent;
}

.screen-header {
  gap: 12px;
  margin-bottom: 14px;
}

.screen-header .muted-label,
.muted-label {
  color: #737d8b;
  letter-spacing: 0.08em;
}

.screen-header h1 {
  color: #171b24;
  letter-spacing: 0;
  text-wrap: balance;
}

.screen-header .icon-action,
.icon-action,
.secondary,
.primary,
.ghost-button,
.danger-button {
  border-radius: 8px;
  box-shadow: none;
}

.icon-action {
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--blue);
}

.primary {
  background: #0f3d70;
  color: #ffffff;
}

.secondary,
.ghost-button {
  background: #ffffff;
  color: #172033;
  border: 1px solid var(--line);
}

.card,
.soft-card,
.settings-row,
.list-row,
.choice,
.payroll-upload-card,
.logbook-stat,
.duty-bar-row,
.salary-table-wrap,
.logbook-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.card::before,
.bottom-nav::before,
.row-icon::before,
.choice-icon::before,
.bottom-nav .tab-icon::before,
.bottom-nav .nav-upload .upload-glyph::before {
  display: none;
}

.card h2,
.section-title h2,
.list-row strong,
.settings-row strong,
.choice strong {
  color: #171b24;
  letter-spacing: 0;
}

.card > p,
.list-row small,
.list-row span,
.settings-row small,
.settings-row span,
.choice small,
.choice-copy,
.document-timeline small {
  color: var(--muted);
}

.next-flight-card,
.payroll-card,
.logbook-world-card {
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, #15365e 0%, #10233f 100%);
  box-shadow: 0 12px 28px rgba(16, 35, 63, 0.18);
}

.next-flight-card::after {
  display: none;
}

.next-flight-card h2,
.payroll-card h2,
.logbook-world-card h2 {
  color: #ffffff;
  letter-spacing: 0;
}

.next-flight-card p,
.payroll-card p,
.logbook-world-card p {
  color: rgba(255, 255, 255, 0.76);
}

.next-flight-card .muted-label,
.payroll-card .muted-label,
.logbook-world-card .muted-label {
  color: #9cc8ff;
}

.next-flight-card .chip,
.payroll-card .secondary,
.logbook-world-card .route-badge,
.payroll-status-badge {
  border-radius: 999px;
  box-shadow: none;
}

.payroll-card .secondary {
  color: #d7e8ff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.payroll-status-badge.estimated,
.route-badge {
  color: #f5c542;
  background: rgba(245, 197, 66, 0.14);
  border-color: rgba(245, 197, 66, 0.28);
}

.payroll-status-badge.real {
  color: #7ee2aa;
  background: rgba(126, 226, 170, 0.14);
  border-color: rgba(126, 226, 170, 0.28);
}

.badge,
.tag,
.flight-code,
.day-pill {
  border-radius: 999px;
  letter-spacing: 0;
  box-shadow: none;
}

.badge.ok,
.badge.route-badge {
  color: var(--green);
  background: rgba(18, 128, 92, 0.09);
  border-color: rgba(18, 128, 92, 0.22);
}

.badge.warn {
  color: var(--amber);
  background: rgba(181, 122, 9, 0.1);
  border-color: rgba(181, 122, 9, 0.22);
}

.badge.danger {
  color: var(--red);
  background: rgba(201, 53, 53, 0.09);
  border-color: rgba(201, 53, 53, 0.22);
}

.calendar-day,
.day-cell,
.mini-day {
  border: 1px solid #dfe6ef;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: none;
}

.calendar-day.is-selected,
.calendar-day.selected,
.day-cell.active,
.day-cell.selected {
  outline: 2px solid rgba(11, 100, 216, 0.42);
  outline-offset: 2px;
  border-color: rgba(11, 100, 216, 0.44);
  background: #f7fbff;
}

.day-cell.today,
.calendar-day.today {
  border-color: rgba(11, 100, 216, 0.34);
  background: #eef6ff;
}

.row-icon,
.choice-icon,
.mcdu-action-icon,
.mcdu-scan-action,
.bottom-nav .tab-icon,
.bottom-nav .nav-upload .upload-glyph {
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--line);
  box-shadow: none;
}

.row-icon svg *,
.choice-icon svg *,
.mcdu-action-icon svg *,
.bottom-nav .tab-icon svg *,
.bottom-nav .nav-upload .upload-glyph svg * {
  stroke-width: 1.9;
}

.row-icon.flight,
.choice[data-quick-upload="schedule"] .choice-icon {
  color: var(--blue);
  background: #eef6ff !important;
  border-color: #bfd8fb !important;
}

.row-icon.ok,
.row-icon.off,
.choice[data-quick-upload="payroll"] .choice-icon {
  color: var(--green);
  background: #eefaf4 !important;
  border-color: #bfe7d1 !important;
}

.row-icon.sim,
.choice[data-quick-upload="prepayroll"] .choice-icon {
  color: var(--purple);
  background: #f2f0ff !important;
  border-color: #d7d2ff !important;
}

.row-icon.hotel,
.row-icon.warn {
  color: var(--amber);
  background: #fff8e8 !important;
  border-color: #efd69e !important;
}

.row-icon.danger {
  color: var(--red);
  background: #fff0f0 !important;
  border-color: #f0c4c4 !important;
}

.choice[data-quick-upload="mcdu"] .choice-icon,
.mcdu-action-icon,
.mcdu-scan-action {
  color: var(--cyan);
  background: #edf9fb !important;
  border-color: #b9e4ea !important;
}

.bottom-nav {
  width: min(calc(100% - 24px), 430px);
  gap: 6px;
  padding: 7px 8px max(7px, env(safe-area-inset-bottom));
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #d8e0ea;
  box-shadow: 0 -8px 24px rgba(16, 35, 63, 0.1);
  backdrop-filter: blur(18px) saturate(1.05);
  -webkit-backdrop-filter: blur(18px) saturate(1.05);
}

.bottom-nav button,
.bottom-nav a {
  min-height: 60px;
  border-radius: 8px;
  color: #6b7685;
  letter-spacing: 0;
  font-size: 11px;
  background: transparent;
  box-shadow: none;
}

.bottom-nav .tab-icon {
  width: 38px;
  height: 38px;
  color: #627085;
}

.bottom-nav a.active,
.bottom-nav button.active,
.bottom-nav .nav-upload {
  color: var(--blue);
  background: #eef6ff;
  box-shadow: none;
}

.bottom-nav a.active .tab-icon,
.bottom-nav button.active .tab-icon,
.bottom-nav .nav-upload .upload-glyph {
  color: var(--blue);
  background: #ffffff !important;
  border-color: #a9cdfc !important;
  box-shadow: none !important;
  transform: none;
}

.bottom-nav .nav-upload {
  min-height: 60px;
}

.bottom-nav .nav-upload .upload-glyph {
  width: 44px;
  height: 44px;
}

.bottom-nav .nav-upload small {
  color: var(--blue);
  letter-spacing: 0;
}

.logbook-globe,
.local-world-map {
  border-radius: 8px;
}

.logbook-world-card .logbook-globe {
  background:
    linear-gradient(180deg, #102a49 0%, #0a1a2e 100%);
  border-color: rgba(255, 255, 255, 0.12);
}

.world-route {
  stroke: #7db8ff;
  stroke-width: 3.6;
}

.world-airport circle:nth-child(2) {
  fill: #7db8ff;
}

.world-airport text {
  letter-spacing: 0;
}

.logbook-ledger-card {
  background: #ffffff;
}

.logbook-ledger-title {
  border-bottom: 2px solid #203044;
}

.logbook-table-wrap,
.salary-table-wrap {
  overflow-x: auto;
}

.logbook-table,
.salary-table {
  background: #ffffff;
}

.logbook-table th,
.salary-table th {
  color: #203044;
  background: #eef3f8;
  letter-spacing: 0.04em;
}

.logbook-table td,
.salary-table td {
  color: #1d2530;
}

.logbook-table tbody tr:nth-child(even),
.salary-table tbody tr:nth-child(even) {
  background: #f9fbfd;
}

.logbook-cell-input,
.logbook-table input,
.logbook-table select,
.salary-table input,
.salary-table select {
  border-radius: 6px;
  background: #ffffff;
}

.calculated-input {
  background: #f2f6fb;
  color: #203044;
}

#logbook .header-actions {
  max-width: 102px;
}

#logbook .header-actions .icon-action {
  flex-basis: 44px;
  width: 44px;
  height: 44px;
  min-height: 44px;
}

#logbook .logbook-settings-action {
  padding: 0;
  border-radius: 8px;
}

#logbook .logbook-settings-action::before {
  content: none;
}

#logbook .logbook-settings-action img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  transform: scale(1.16);
}

#logbook .mcdu-scan-action {
  border-radius: 8px;
}


/* CrewCal Clean System refresh: closer to the reference sheet */
:root {
  --bg: #f8fafc;
  --ink: #121826;
  --muted: #667085;
  --card: #ffffff;
  --line: #dfe6f0;
  --blue: #0066ff;
  --blue-2: #0a84ff;
  --green: #18a05e;
  --amber: #f59e0b;
  --red: #ef4444;
  --purple: #6d5dfc;
  --cyan: #0891b2;
  --dark: #111827;
  --shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
  --glass-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

body {
  background: #f8fafc;
  color: var(--ink);
}

.phone-shell,
.app-shell,
main,
.view {
  background: #f8fafc;
}

.screen-header {
  align-items: flex-start;
  padding-top: 10px;
}

.screen-header h1 {
  color: #151922;
  font-size: clamp(38px, 8vw, 56px);
  font-weight: 950;
  line-height: 0.96;
  letter-spacing: 0;
}

.screen-header .muted-label,
.muted-label {
  color: #667085;
  letter-spacing: 0.06em;
}

.card,
.soft-card,
.list-row,
.settings-row,
.choice,
.payroll-upload-card,
.logbook-ledger-card,
.salary-table-card,
.payroll-source-card,
.payroll-year-card {
  background: #ffffff;
  border: 1px solid #e1e7f0;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.card h2,
.section-title h2,
.list-row strong,
.settings-row strong,
.choice strong {
  color: #151922;
}

.card > p,
.list-row span,
.list-row small,
.settings-row span,
.settings-row small,
.choice small,
.choice-copy {
  color: #667085;
}

.icon-action,
.row-icon,
.choice-icon,
.bottom-nav .tab-icon,
.bottom-nav .nav-upload .upload-glyph,
.mcdu-action-icon,
.mcdu-scan-action {
  background: #ffffff !important;
  border: 1.5px solid #b9d4ff !important;
  color: var(--blue) !important;
  border-radius: 8px;
  box-shadow: none !important;
}

.icon-action svg,
.row-icon svg,
.choice-icon svg,
.bottom-nav .tab-icon svg,
.bottom-nav .nav-upload .upload-glyph svg,
.mcdu-action-icon svg {
  width: 25px;
  height: 25px;
}

.icon-action svg *,
.row-icon svg *,
.choice-icon svg *,
.bottom-nav .tab-icon svg *,
.bottom-nav .nav-upload .upload-glyph svg *,
.mcdu-action-icon svg * {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.primary {
  background: var(--blue);
  border: 1px solid var(--blue);
  color: #ffffff;
}

.secondary,
.ghost-button,
.settings-row button {
  background: #f3f8ff;
  border: 1px solid #cfe1ff;
  color: var(--blue);
  border-radius: 8px;
  box-shadow: none;
}

.next-flight-card,
.payroll-card {
  background: #ffffff;
  color: #151922;
  border: 1px solid #dbe7fb;
  box-shadow: 0 5px 18px rgba(0, 102, 255, 0.07);
}

.next-flight-card h2,
.payroll-card h2,
.next-flight-card p,
.payroll-card p,
.next-flight-card .muted-label,
.payroll-card .muted-label {
  color: inherit;
}

.next-flight-card .muted-label,
.payroll-card .muted-label,
#payrollCardEyebrow {
  color: var(--blue) !important;
}

.payroll-total strong {
  color: #151922;
  font-size: 44px;
  letter-spacing: 0;
}

.payroll-total span {
  color: #667085 !important;
}

.payroll-bars {
  gap: 10px;
  margin-top: 16px;
}

.pay-line {
  padding: 8px 0;
  border-bottom: 1px solid #edf1f6;
}

.pay-line:last-child {
  border-bottom: 0;
}

.pay-line span {
  color: #475467;
}

.pay-line strong {
  color: #151922;
}

.bar,
.pay-line .pay-line-bar {
  height: 6px;
  background: #e8eef6;
}

.bar span,
.pay-line .pay-line-fill {
  background: var(--blue);
}

.payroll-status-badge {
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.04em;
}

.payroll-status-badge.estimated {
  background: #fff7e6;
  border-color: #ffd89a;
  color: #b76b00;
}

.payroll-status-badge.real {
  background: #ecfdf3;
  border-color: #abe7c2;
  color: #087443;
}

.logbook-world-card {
  background: #ffffff;
  color: #151922;
  border: 1px solid #e1e7f0;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.logbook-world-card h2,
.logbook-world-card .muted-label,
.logbook-world-card p {
  color: inherit;
}

.logbook-world-card .muted-label {
  color: var(--blue) !important;
}

.logbook-world-card .route-badge,
.badge,
.tag,
.flight-code,
.day-pill {
  border-radius: 999px;
  box-shadow: none;
}

.calendar-day,
.day-cell,
.mini-day {
  background: #ffffff;
  border: 1px solid #e1e7f0;
  box-shadow: none;
}

.calendar-day.is-selected,
.calendar-day.selected,
.day-cell.active,
.day-cell.selected,
.day-cell.today,
.calendar-day.today {
  background: #f3f8ff;
  border-color: #9cc5ff;
  outline: 2px solid rgba(0, 102, 255, 0.18);
}

.bottom-nav {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #e1e7f0;
  border-radius: 8px;
  box-shadow: 0 -5px 18px rgba(15, 23, 42, 0.08);
}

.bottom-nav a,
.bottom-nav button {
  color: #667085;
  font-weight: 800;
  letter-spacing: 0;
}

.bottom-nav a.active,
.bottom-nav button.active,
.bottom-nav .nav-upload {
  background: #f3f8ff;
  color: var(--blue);
}

.bottom-nav a.active .tab-icon,
.bottom-nav button.active .tab-icon,
.bottom-nav .nav-upload .upload-glyph {
  background: #ffffff !important;
  color: var(--blue) !important;
  border-color: #9cc5ff !important;
}

.salary-table th,
.logbook-table th {
  background: #f3f8ff;
  color: #344054;
  border-color: #d9e7fb;
}

.salary-table td,
.logbook-table td {
  border-color: #e1e7f0;
}

.salary-table tbody tr:nth-child(even),
.logbook-table tbody tr:nth-child(even) {
  background: #fbfdff;
}

.year-bar {
  background: #e8eef6;
}

.year-bar span,
.year-bar span.estimated {
  background: var(--blue);
}

/* Clean button backgrounds: keep blue as line/icon color, not as filled button chrome. */
.bottom-nav a.active,
.bottom-nav button.active,
.bottom-nav .nav-upload {
  background: transparent !important;
  color: var(--blue) !important;
  box-shadow: none !important;
}

.bottom-nav a.active .tab-icon,
.bottom-nav button.active .tab-icon,
.bottom-nav .nav-upload .upload-glyph {
  background: #ffffff !important;
  border-color: #bdd6ff !important;
  color: var(--blue) !important;
  box-shadow: none !important;
}

.bottom-nav .nav-upload {
  transform: none !important;
}

.bottom-nav .nav-upload .upload-image-glyph {
  padding: 0 !important;
  overflow: hidden;
  background: #ffffff !important;
  border-color: #bdd6ff !important;
}

.bottom-nav .nav-upload .upload-image-glyph::before {
  display: none !important;
}

.bottom-nav .nav-upload .upload-image-glyph img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  transform: scale(1.2);
  filter: contrast(1.12) saturate(1.08);
}

.bottom-nav .tab-image-icon {
  padding: 0 !important;
  overflow: hidden;
  background: #ffffff !important;
  border-color: #bdd6ff !important;
}

.bottom-nav .tab-image-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  transform: scale(1.2);
  filter: contrast(1.12) saturate(1.08);
}

.icon-text-button {
  background: #ffffff !important;
  border-color: #bdd6ff !important;
  box-shadow: none !important;
}

/* Calendar list rows must stay compact buttons, never native browser buttons. */
#calendarListView.calendar-list-view {
  display: grid !important;
  gap: 8px !important;
}

#calendarListView.calendar-list-view[hidden] {
  display: none !important;
}

#calendarListView .calendar-list-day {
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 100% !important;
  display: grid !important;
  grid-template-columns: 48px minmax(0, 1fr) !important;
  gap: 10px !important;
  align-items: stretch !important;
  min-height: 58px !important;
  margin: 0 !important;
  padding: 8px !important;
  border: 1px solid #dce7f5 !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  color: var(--ink) !important;
  font: inherit !important;
  text-align: left !important;
  box-shadow: none !important;
}

#calendarListView .calendar-list-day.selected {
  border-color: #0a6cff !important;
  box-shadow: inset 0 0 0 1px rgba(10, 108, 255, 0.36) !important;
}

#calendarListView .calendar-list-date {
  display: grid !important;
  place-items: center !important;
  align-content: center !important;
  min-width: 0 !important;
  min-height: 42px !important;
  border-radius: 8px !important;
  background: #f3f7ff !important;
}

#calendarListView .calendar-list-date strong,
#calendarListView .calendar-list-date small {
  display: block !important;
  margin: 0 !important;
  text-align: center !important;
}

#calendarListView .calendar-list-date strong {
  font-size: 19px !important;
  line-height: 1 !important;
}

#calendarListView .calendar-list-date small {
  color: #667085 !important;
  font-size: 10px !important;
  font-weight: 850 !important;
  line-height: 1 !important;
  text-transform: uppercase !important;
}

#calendarListView .calendar-list-items {
  min-width: 0 !important;
  display: grid !important;
  gap: 6px !important;
}

#calendarListView .calendar-list-item {
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 3px !important;
  padding: 6px 8px !important;
  border-radius: 8px !important;
  background: #f8fafc !important;
}

#calendarListView .calendar-list-item::before {
  display: none !important;
}

#calendarListView .calendar-list-item b,
#calendarListView .calendar-list-item small {
  display: block !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

#calendarListView .calendar-list-item b {
  color: #151922 !important;
  font-size: 15px !important;
  font-weight: 900 !important;
  line-height: 1.1 !important;
}

#calendarListView .calendar-list-item small {
  color: #667085 !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
}

/* Calendar status follows the same clean button/card color system. */
.calendar-status-card,
.calendar-status-card.is-flight,
.calendar-status-card.is-away,
.calendar-status-card.is-base {
  color: var(--ink) !important;
  background: #ffffff !important;
  border: 1px solid #dce7f5 !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}

.calendar-status-main p {
  color: #667085 !important;
  letter-spacing: 0.12em;
}

.calendar-status-main h2 {
  color: #151922 !important;
  letter-spacing: 0 !important;
}

.calendar-status-main span {
  color: #475467 !important;
}

.calendar-status-chips span {
  background: #ffffff !important;
  border: 1px solid #bdd6ff !important;
  box-shadow: none !important;
}

.calendar-status-chips small {
  color: #667085 !important;
}

.calendar-status-chips strong {
  color: var(--blue) !important;
}

.context-onboarding-popover {
  position: fixed;
  z-index: 80;
  display: grid;
  gap: 12px;
  padding: 14px;
  color: #151922;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #dce7f5;
  border-radius: 8px;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.16);
}

.context-onboarding-popover p {
  margin: 0;
  color: #475467;
  font-size: 15px;
  line-height: 1.35;
}

.context-onboarding-popover button {
  justify-self: end;
  min-height: 38px;
  padding: 0 16px;
  color: var(--blue);
  font: inherit;
  font-weight: 900;
  background: #ffffff;
  border: 1px solid #bdd6ff;
  border-radius: 8px;
}

/* Settings actions keep a single visual rhythm regardless of label length. */
.settings-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(96px, 112px);
  align-items: center !important;
  column-gap: 14px !important;
}

.settings-row .row-main {
  min-width: 0;
}

.settings-row button {
  justify-self: end;
  width: 112px !important;
  min-width: 112px !important;
  min-height: 42px !important;
  padding: 0 10px !important;
  white-space: nowrap;
}

.settings-row .switch {
  justify-self: end;
}

@media (max-width: 380px) {
  .settings-row {
    grid-template-columns: minmax(0, 1fr) 96px;
    column-gap: 10px !important;
  }

  .settings-row button {
    width: 96px !important;
    min-width: 96px !important;
    font-size: 14px;
  }
}

/* Quick upload choices reuse the same visual icon language as the bottom nav. */
#quickUploadDialog .choice-image-icon {
  position: relative;
  padding: 0 !important;
  overflow: hidden !important;
  background: #ffffff !important;
  border-color: #bdd6ff !important;
  box-shadow: none !important;
}

#quickUploadDialog .choice-image-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  transform: scale(1.2);
  filter: contrast(1.12) saturate(1.08);
}

#quickUploadDialog .choice-image-icon--prepayroll span {
  position: absolute;
  right: 4px;
  bottom: 4px;
  min-width: 24px;
  height: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: #0066ff;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
}

/* Calendar/List segmented control follows the lighter blue app chrome. */
.calendar-view-toggle {
  border-color: #cfe0ff !important;
  background: linear-gradient(180deg, #ffffff, #f3f8ff) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 10px 26px rgba(31, 111, 255, 0.07) !important;
}

.calendar-view-toggle button {
  color: #65758f !important;
}

.calendar-view-toggle button.active {
  color: #075edb !important;
  background: linear-gradient(180deg, #eaf3ff, #dceaff) !important;
  border: 1px solid #9fc3ff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96), 0 8px 18px rgba(31, 111, 255, 0.16) !important;
}

/* CrewCal iOS Design System baseline.
   Keep this block last so the new visual language wins over legacy refreshes. */
:root {
  --bg: #f2f2f7;
  --ink: #111827;
  --muted: #6b7280;
  --card: #ffffff;
  --line: rgba(60, 60, 67, 0.16);
  --blue: #007aff;
  --blue-2: #0a84ff;
  --green: #34c759;
  --amber: #ff9500;
  --red: #ff3b30;
  --purple: #5856d6;
  --cyan: #5ac8fa;
  --shadow: 0 20px 52px rgba(17, 24, 39, 0.08);
  --glass-shadow: 0 16px 42px rgba(17, 24, 39, 0.07);
}

body,
.phone-shell,
.view {
  background: var(--bg) !important;
  color: var(--ink) !important;
}

.phone-shell {
  width: min(100%, 460px);
  padding: 20px 16px 112px;
  box-shadow: 0 0 0 1px rgba(60, 60, 67, 0.08), 0 28px 80px rgba(17, 24, 39, 0.08) !important;
}

.card,
.soft-card,
.list-row,
.settings-row,
.choice,
.sheet,
.payroll-upload-card,
.payroll-source-card,
.payroll-year-card,
.logbook-ledger-card,
.salary-table-card,
.calendar-status-card,
.selected-day-card {
  background: #ffffff !important;
  border: 1px solid rgba(60, 60, 67, 0.14) !important;
  border-radius: 26px !important;
  box-shadow: var(--glass-shadow) !important;
}

.card,
.soft-card,
.selected-day-card {
  padding: 24px !important;
}

.screen-header,
.home-header {
  align-items: flex-start;
  margin: 0 0 18px !important;
  padding: 10px 4px 0 !important;
}

.screen-header h1,
.home-header h1 {
  color: var(--ink) !important;
  font-family: var(--font-display);
  font-size: clamp(48px, 13vw, 72px) !important;
  font-weight: 800 !important;
  line-height: 0.96 !important;
  letter-spacing: 0 !important;
}

.muted-label,
.screen-header .muted-label,
.home-header .muted-label {
  color: #6e7787 !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  letter-spacing: 0.16em !important;
}

.primary,
.start-button {
  min-height: 56px;
  border-radius: 18px !important;
  background: var(--blue) !important;
  border: 1px solid var(--blue) !important;
  color: #ffffff !important;
  box-shadow: 0 14px 26px rgba(0, 122, 255, 0.2) !important;
}

.secondary,
.text-button,
.icon-text-button,
.settings-row button {
  min-height: 52px;
  border-radius: 18px !important;
  background: #f4f8ff !important;
  border: 1px solid #c7dcff !important;
  color: var(--blue) !important;
  box-shadow: none !important;
}

.icon-action,
.dialog-close,
.row-icon,
.choice-icon,
.bottom-nav .tab-icon,
.bottom-nav .nav-upload .upload-glyph,
.mcdu-scan-action {
  border-radius: 18px !important;
  background: #ffffff !important;
  border: 1.5px solid #bcd5ff !important;
  color: var(--blue) !important;
  box-shadow: none !important;
}

.dialog-close {
  width: 48px !important;
  height: 48px !important;
  min-height: 48px !important;
  background: #f5f7fb !important;
  color: #111827 !important;
  border: 0 !important;
}

dialog::backdrop {
  background: rgba(28, 28, 30, 0.42);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

dialog .sheet {
  width: min(100% - 28px, 420px);
  padding: 28px 24px 24px !important;
}

dialog .sheet h2 {
  margin: 2px 0 10px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(34px, 10vw, 48px);
  line-height: 0.98;
  letter-spacing: 0;
}

dialog .upload-helper {
  color: var(--muted) !important;
  font-size: 17px !important;
  line-height: 1.38 !important;
}

/* Welcome: image-led exception from the design system. */
.phone-shell:has(#welcome.active) {
  padding: 0 !important;
  background: #101827 !important;
}

.first-run-view {
  position: relative;
  min-height: 100vh !important;
  padding: max(30px, env(safe-area-inset-top)) 24px max(28px, env(safe-area-inset-bottom)) !important;
  display: grid;
  align-content: end;
  gap: 18px;
  overflow: hidden;
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(5, 12, 24, 0.12) 0%, rgba(7, 16, 31, 0.24) 35%, rgba(5, 12, 24, 0.84) 100%),
    url("assets/onboarding-wing.jpg"),
    radial-gradient(circle at 18% 12%, rgba(90, 200, 250, 0.34), transparent 34%),
    linear-gradient(145deg, #8fb4d9 0%, #2e5477 42%, #091525 100%) !important;
  background-size: cover, cover, cover, cover !important;
  background-position: center, center, center, center !important;
}

.first-run-view::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, transparent 0 42%, rgba(0, 0, 0, 0.48) 74%, rgba(0, 0, 0, 0.74) 100%);
  pointer-events: none;
}

.first-run-view > * {
  position: relative;
  z-index: 1;
}

.welcome-header {
  display: grid;
  justify-items: center;
  gap: 14px;
  margin: 0 !important;
  text-align: center;
}

.welcome-app-icon {
  width: 112px !important;
  height: 112px !important;
  border-radius: 30px !important;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.28) !important;
}

.welcome-header p {
  max-width: 280px;
  color: rgba(255, 255, 255, 0.86) !important;
  font-size: 17px !important;
  line-height: 1.35 !important;
}

.welcome-card {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.compact-choice-list {
  gap: 12px !important;
}

.role-choice-card,
#accountTypeDialog .role-choice-card {
  position: relative;
  min-height: 154px !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  align-items: end !important;
  padding: 22px !important;
  overflow: hidden;
  border-radius: 28px !important;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 255, 0.94)) !important;
  border: 1px solid rgba(255, 255, 255, 0.64) !important;
  box-shadow: 0 18px 42px rgba(17, 24, 39, 0.1) !important;
}

.first-run-view .role-choice-card {
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.role-choice-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.78) 48%, rgba(255, 255, 255, 0.18) 100%);
  z-index: 0;
}

.role-choice-icon {
  position: absolute !important;
  right: -10px;
  bottom: -18px;
  z-index: 0;
  width: min(52%, 190px) !important;
  height: min(86%, 148px) !important;
  object-fit: contain !important;
  border-radius: 0 !important;
  opacity: 0.36;
  filter: saturate(0.95) contrast(1.08);
  transform: none !important;
  pointer-events: none;
}

.role-choice-card--family .role-choice-icon {
  width: min(48%, 170px) !important;
  height: min(82%, 138px) !important;
  right: -2px;
  bottom: -10px;
}

.role-choice-card .choice-copy {
  position: relative;
  z-index: 1;
  display: grid !important;
  gap: 7px !important;
  max-width: min(72%, 290px) !important;
  min-width: 0;
  color: var(--ink) !important;
}

.role-choice-card .choice-copy strong {
  color: var(--ink) !important;
  font-family: var(--font-display);
  font-size: clamp(25px, 6.8vw, 34px) !important;
  font-weight: 800 !important;
  line-height: 1.02 !important;
  letter-spacing: 0 !important;
}

.role-choice-card .choice-copy small {
  color: var(--muted) !important;
  font-size: 15px !important;
  line-height: 1.28 !important;
}

#crewRoleDialog .role-profile-actions {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

#crewRoleDialog .role-profile-actions button {
  min-height: 86px !important;
  border-radius: 24px !important;
  font-size: 22px;
}

.calendar-view-toggle {
  padding: 6px !important;
  border-radius: 24px !important;
  background: #edf5ff !important;
  border: 1px solid #d4e6ff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

.calendar-view-toggle button {
  min-height: 54px !important;
  border-radius: 18px !important;
  color: #64748b !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  font-weight: 800 !important;
}

.calendar-view-toggle button.active {
  color: #ffffff !important;
  background: var(--blue) !important;
  border: 0 !important;
  box-shadow: 0 12px 22px rgba(0, 122, 255, 0.22) !important;
}

.month-controls {
  margin-bottom: 16px !important;
}

.month-controls button {
  width: 56px !important;
  height: 56px !important;
  border-radius: 18px !important;
  background: #eef5ff !important;
  border: 0 !important;
  color: var(--blue) !important;
}

.full-calendar,
.mini-calendar {
  gap: 8px !important;
}

.calendar-day,
.day-cell,
.mini-day {
  border-radius: 16px !important;
  background: #ffffff !important;
  border: 1px solid rgba(60, 60, 67, 0.13) !important;
  box-shadow: none !important;
}

.calendar-day.is-selected,
.calendar-day.selected,
.calendar-day.today,
.day-cell.active,
.day-cell.selected,
.day-cell.today,
.mini-day.is-selected {
  background: #eef5ff !important;
  border-color: #8bbcff !important;
  outline: 3px solid rgba(0, 122, 255, 0.18) !important;
}

.calendar-status-card,
.calendar-status-card.is-flight,
.calendar-status-card.is-away,
.calendar-status-card.is-base {
  background: #ffffff !important;
  color: var(--ink) !important;
}

.calendar-status-main h2 {
  color: var(--ink) !important;
  font-size: clamp(36px, 11vw, 60px) !important;
  font-weight: 800 !important;
}

.calendar-status-chips span {
  border-radius: 20px !important;
  background: #f7faff !important;
  border-color: #d0e2ff !important;
}

.bottom-nav {
  width: min(calc(100% - 24px), 430px) !important;
  padding: 10px 12px max(10px, env(safe-area-inset-bottom)) !important;
  border-radius: 28px 28px 22px 22px !important;
  background: rgba(255, 255, 255, 0.92) !important;
  border: 1px solid rgba(60, 60, 67, 0.14) !important;
  box-shadow: 0 -16px 44px rgba(17, 24, 39, 0.12) !important;
  backdrop-filter: blur(24px) saturate(1.08);
  -webkit-backdrop-filter: blur(24px) saturate(1.08);
}

.bottom-nav a,
.bottom-nav button {
  min-height: 70px !important;
  border-radius: 20px !important;
  color: #6b7280 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}

.bottom-nav a.active,
.bottom-nav button.active,
.bottom-nav .nav-upload {
  background: #edf5ff !important;
  color: var(--blue) !important;
}

.bottom-nav .tab-icon,
.bottom-nav .nav-upload .upload-glyph {
  width: 42px !important;
  height: 42px !important;
  border-radius: 16px !important;
  overflow: hidden;
}

.bottom-nav .nav-upload .upload-glyph {
  width: 56px !important;
  height: 56px !important;
  border-radius: 20px !important;
}

.bottom-nav .tab-image-icon img,
.bottom-nav .upload-image-glyph img,
#quickUploadDialog .choice-image-icon img {
  object-fit: cover !important;
  transform: scale(1.14) !important;
  filter: contrast(1.16) saturate(1.08) !important;
}

@media (max-width: 390px) {
  .phone-shell {
    padding-inline: 14px;
  }

  .card,
  .soft-card,
  .selected-day-card {
    padding: 20px !important;
  }

  .role-choice-card,
  #accountTypeDialog .role-choice-card {
    min-height: 142px !important;
    padding: 20px !important;
  }

  .role-choice-card .choice-copy {
    max-width: 76% !important;
  }
}

/* Final layout guardrails: keep the first-run cards scoped to welcome only. */
.view.first-run-view:not(.active) {
  display: none !important;
}

.view.first-run-view.active {
  display: grid !important;
}

.logbook-table-wrap,
.salary-table-wrap {
  max-width: 100%;
  overflow-x: auto !important;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  contain: inline-size;
}

/* The supplied PNG icons include generous white padding; crop them in small controls. */
.settings-image-action,
.bottom-nav .tab-image-icon,
.bottom-nav .upload-image-glyph,
#quickUploadDialog .choice-image-icon {
  overflow: hidden !important;
}

.settings-image-action .settings-icon-image {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  transform: scale(1.58) !important;
  filter: contrast(1.22) saturate(1.08) !important;
}

.bottom-nav .tab-image-icon img {
  object-fit: cover !important;
  transform: scale(1.72) !important;
  filter: contrast(1.34) saturate(1.16) brightness(0.96) !important;
}

.bottom-nav .upload-image-glyph img {
  object-fit: cover !important;
  transform: scale(1.48) !important;
  filter: contrast(1.28) saturate(1.12) brightness(0.97) !important;
}

#quickUploadDialog .choice-image-icon img {
  object-fit: cover !important;
  transform: scale(1.52) !important;
  filter: contrast(1.28) saturate(1.12) brightness(0.97) !important;
}

/* CrewCal iOS reference alignment - final product skin. */
:root {
  --cc-bg: #f7f8fb;
  --cc-card: #ffffff;
  --cc-ink: #0f172a;
  --cc-muted: #5f6b7d;
  --cc-subtle: #667085;
  --cc-line: rgba(17, 24, 39, 0.09);
  --cc-blue: #0064c8;
  --cc-primary: #006edc;
  --cc-blue-on-fill: #0064c8;
  --cc-green: #34c759;
  --cc-orange: #ff9500;
  --cc-red: #ff3b30;
  --cc-purple: #5856d6;
  --cc-fill: #f2f5fa;
  --cc-fill-strong: #e7ebf1;
  --cc-selected: #eef6ff;
  --cc-icon-bg: #f2f7ff;
  --cc-glass: rgba(255, 255, 255, 0.78);
  --cc-glass-border: rgba(255, 255, 255, 0.72);
  --cc-ok-ink: #176b37;
  --cc-warn-ink: #925200;
  --cc-error-ink: #b42318;
  --cc-radius-xl: 26px;
  --cc-radius-lg: 20px;
  --cc-shadow: 0 10px 28px rgba(15, 23, 42, 0.055);
  --cc-shadow-soft: 0 3px 12px rgba(15, 23, 42, 0.045);
}

html,
body {
  background: var(--cc-bg) !important;
}

.phone-shell {
  width: min(100%, 430px) !important;
  padding: 18px 14px 108px !important;
  background: var(--cc-bg) !important;
  box-shadow: none !important;
}

.view:not(.first-run-view) {
  color: var(--cc-ink) !important;
}

.view:not(.first-run-view) > header,
.screen-header,
.topbar,
.section-title {
  margin: 0 0 14px !important;
}

.screen-header {
  min-height: 64px;
  align-items: flex-start !important;
}

.muted-label,
.section-title p,
.upload-helper,
.settings-note {
  color: var(--cc-muted) !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

.screen-header .muted-label,
.section-title .muted-label,
.payroll-card-header .muted-label,
.documents-hero .muted-label,
.logbook-card .muted-label {
  color: var(--cc-subtle) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
}

.screen-header h1,
.view:not(.first-run-view) > header h1 {
  color: var(--cc-ink) !important;
  font-size: clamp(34px, 9vw, 44px) !important;
  line-height: 0.98 !important;
  font-weight: 800 !important;
  letter-spacing: 0 !important;
}

h2,
.section-title h2,
.card h2 {
  color: var(--cc-ink) !important;
  font-size: clamp(22px, 6vw, 28px) !important;
  line-height: 1.06 !important;
  letter-spacing: 0 !important;
}

.card,
.soft-card,
.selected-day-card,
.settings-section,
.payroll-card,
.payroll-source-card,
.salary-table-card,
.payroll-year-card,
.payroll-checks-card,
.payroll-upload-card,
.logbook-world-card,
.logbook-card,
.calendar-status-card,
.documents-hero,
.home-hero,
.home-summary-card,
.onboarding-route-card,
.role-card,
.sheet {
  background: var(--cc-card) !important;
  border: 1px solid var(--cc-line) !important;
  border-radius: var(--cc-radius-xl) !important;
  box-shadow: var(--cc-shadow) !important;
  color: var(--cc-ink) !important;
}

.card,
.selected-day-card,
.settings-section,
.payroll-card,
.payroll-source-card,
.salary-table-card,
.payroll-year-card,
.payroll-checks-card,
.payroll-upload-card,
.logbook-card,
.documents-hero {
  padding: 22px !important;
}

.card + .card,
.calendar-status-card + .card,
.selected-day-card + .card,
.settings-section + .settings-section {
  margin-top: 14px !important;
}

.primary,
.start-button,
.button.primary,
.dialog-actions .primary,
.quick-upload-cancel,
.calendar-export-actions button:first-child,
.payroll-action,
.text-button.primary {
  min-height: 52px !important;
  border-radius: 16px !important;
  background: var(--cc-primary) !important;
  border: 0 !important;
  color: #ffffff !important;
  box-shadow: none !important;
  font-weight: 700 !important;
}

.secondary,
.text-button,
.calendar-export-actions button,
.settings-row button,
.pill-button,
.dialog-actions button:not(.primary) {
  min-height: 46px !important;
  border-radius: 16px !important;
  background: var(--cc-card) !important;
  border: 1px solid var(--cc-line) !important;
  color: var(--cc-blue) !important;
  box-shadow: none !important;
  font-weight: 700 !important;
}

.badge,
.status-pill,
.payroll-status-badge,
.calendar-pill,
.document-status,
.flight-status,
.route-count,
.timeline-badge,
.day-chip,
.day-tag {
  border-radius: 999px !important;
  border: 0 !important;
  box-shadow: none !important;
  font-weight: 700 !important;
}

.badge.ok,
.status-pill.ok,
.document-status.valid,
.document-status.ok,
.payroll-status-badge.real,
.payroll-status-badge.confirmed {
  background: rgba(52, 199, 89, 0.14) !important;
  color: var(--cc-ok-ink) !important;
}

.badge.warn,
.status-pill.warn,
.document-status.warning,
.payroll-status-badge.estimated,
.route-count {
  background: rgba(255, 149, 0, 0.14) !important;
  color: var(--cc-warn-ink) !important;
}

.badge.error,
.status-pill.error,
.document-status.expired {
  background: rgba(255, 59, 48, 0.14) !important;
  color: var(--cc-error-ink) !important;
}

.list,
.document-timeline,
#selectedDayList,
#payrollChecks,
#settingsList {
  display: grid;
  gap: 10px !important;
}

.list-row,
.settings-row,
.document-row,
.flight-row,
.calendar-list-item,
.timeline-row,
.pay-line,
.year-payroll-row,
.logbook-export-option {
  min-height: 66px;
  padding: 14px 14px !important;
  border-radius: 18px !important;
  background: var(--cc-card) !important;
  border: 1px solid var(--cc-line) !important;
  box-shadow: none !important;
  color: var(--cc-ink) !important;
}

.list-row strong,
.settings-row strong,
.flight-row strong,
.calendar-list-item strong,
.pay-line strong,
.year-payroll-row strong {
  color: var(--cc-ink) !important;
  font-weight: 750 !important;
  letter-spacing: 0 !important;
}

.list-row span,
.list-row small,
.settings-row span,
.flight-row span,
.calendar-list-item span,
.pay-line span,
.year-payroll-row span {
  color: var(--cc-muted) !important;
}

.row-icon,
.choice-icon,
.icon-action,
.settings-image-action,
.mcdu-scan-action,
.document-icon {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  border-radius: 14px !important;
  background: var(--cc-icon-bg) !important;
  border: 0 !important;
  color: var(--cc-blue) !important;
  box-shadow: none !important;
}

.row-icon svg,
.choice-icon svg,
.icon-action svg,
.bottom-nav svg,
.upload-glyph svg,
.mcdu-scan-action svg {
  width: 24px;
  height: 24px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.row-icon.off,
.row-icon.free,
.row-icon.ok,
.choice-icon.ok {
  background: rgba(52, 199, 89, 0.14) !important;
  color: var(--cc-green) !important;
}

.row-icon.warn,
.row-icon.hotel,
.choice-icon.warn {
  background: rgba(255, 149, 0, 0.14) !important;
  color: var(--cc-orange) !important;
}

.row-icon.sim,
.choice-icon.sim {
  background: rgba(88, 86, 214, 0.14) !important;
  color: var(--cc-purple) !important;
}

.month-controls {
  display: grid !important;
  grid-template-columns: 40px minmax(0, 1fr) 40px !important;
  align-items: center !important;
  gap: 4px !important;
  width: 100% !important;
  max-width: 360px !important;
  margin: 0 auto 14px !important;
  padding: 4px !important;
  border-radius: 16px !important;
  background: var(--cc-fill) !important;
  border: 1px solid rgba(148, 163, 184, 0.2) !important;
  box-shadow: none !important;
}

.month-controls strong {
  color: var(--cc-ink) !important;
  font-size: 17px !important;
  font-weight: 720 !important;
}

.month-controls > button:not(.calendar-date-picker-trigger) {
  width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
  justify-self: center !important;
  border-radius: 12px !important;
  background: transparent !important;
  color: var(--cc-blue) !important;
  font-size: 26px !important;
  font-weight: 500 !important;
  line-height: 1 !important;
}

.month-controls > button:not(.calendar-date-picker-trigger):active {
  background: rgba(0, 122, 255, 0.08) !important;
}

.calendar-view-toggle {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  align-items: center !important;
  gap: 3px !important;
  margin: 12px 0 !important;
  padding: 4px !important;
  border-radius: 15px !important;
  background: var(--cc-fill-strong) !important;
  border: 1px solid rgba(60, 60, 67, 0.08) !important;
  box-shadow: none !important;
}

.calendar-view-toggle button {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 38px !important;
  padding: 0 6px !important;
  border-radius: 12px !important;
  font-size: 13px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.calendar-view-toggle button.active {
  background: var(--cc-card) !important;
  color: var(--cc-blue) !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1) !important;
}

.full-calendar,
.mini-calendar {
  padding: 12px !important;
  border-radius: 24px !important;
  background: var(--cc-card) !important;
  border: 1px solid var(--cc-line) !important;
  box-shadow: var(--cc-shadow) !important;
}

.calendar-grid,
.full-calendar {
  gap: 7px !important;
}

.calendar-day,
.day-cell,
.mini-day {
  min-height: 64px !important;
  border-radius: 14px !important;
  background: var(--cc-card) !important;
  border: 1px solid rgba(17, 24, 39, 0.07) !important;
  box-shadow: none !important;
}

.calendar-day.is-selected,
.calendar-day.selected,
.day-cell.active,
.day-cell.selected,
.mini-day.is-selected {
  background: var(--cc-selected) !important;
  border-color: var(--cc-blue) !important;
  outline: 0 !important;
  box-shadow: inset 0 0 0 1.5px var(--cc-blue) !important;
}

.calendar-day.today,
.day-cell.today,
.mini-day.today {
  border-color: rgba(0, 122, 255, 0.36) !important;
}

.calendar-legend,
.legend-row {
  color: var(--cc-muted) !important;
}

.calendar-status-card {
  background: var(--cc-card) !important;
  border-radius: 24px !important;
  box-shadow: var(--cc-shadow) !important;
}

.calendar-status-main h2 {
  font-size: clamp(26px, 7.4vw, 34px) !important;
  letter-spacing: 0 !important;
}

.selected-day-card .list-row,
#selectedDayList .list-row {
  display: grid !important;
  grid-template-columns: 46px minmax(0, 1fr) auto !important;
  gap: 12px !important;
  align-items: center !important;
}

#selectedDayList .list-row.is-flight,
#selectedDayList .list-row.flight {
  border-color: rgba(0, 122, 255, 0.18) !important;
}

.payroll-card {
  background: var(--cc-card) !important;
  color: var(--cc-ink) !important;
}

.payroll-total,
#payrollTotal {
  color: var(--cc-ink) !important;
}

.payroll-total strong,
#payrollTotal strong {
  font-size: clamp(42px, 13vw, 58px) !important;
  color: var(--cc-ink) !important;
  letter-spacing: 0 !important;
}

.payroll-bars {
  display: grid !important;
  gap: 11px !important;
}

.pay-line {
  display: grid !important;
  gap: 8px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--cc-line) !important;
  border-radius: 0 !important;
  padding: 10px 0 !important;
}

.pay-line:last-child {
  border-bottom: 0 !important;
}

.pay-line .bar,
.pay-line > div:last-child,
.duty-bar-row .bar,
.year-payroll-bar {
  height: 6px !important;
  border-radius: 999px !important;
  background: var(--cc-fill-strong) !important;
  overflow: hidden;
}

.pay-line .bar span,
.duty-bar-row .bar span,
.year-payroll-bar span {
  border-radius: inherit !important;
  background: var(--cc-blue) !important;
}

.logbook-world-card {
  background: var(--cc-card) !important;
  color: var(--cc-ink) !important;
}

.logbook-world-card .local-world-map,
#logbookGlobe {
  border-radius: 22px !important;
  background: var(--cc-fill) !important;
  border: 1px solid var(--cc-line) !important;
}

.logbook-table,
.salary-table {
  background: var(--cc-card) !important;
  border: 1px solid var(--cc-line) !important;
  border-radius: 18px !important;
  overflow: hidden;
}

.logbook-table th,
.salary-table th {
  background: var(--cc-fill) !important;
  color: var(--cc-muted) !important;
  font-size: 12px !important;
  letter-spacing: 0.06em !important;
}

.logbook-table td,
.salary-table td {
  border-color: var(--cc-line) !important;
  color: var(--cc-ink) !important;
}

dialog .sheet {
  width: min(100% - 28px, 390px) !important;
  max-height: min(82vh, 720px) !important;
  padding: 24px 20px 20px !important;
  border-radius: 30px !important;
  background: var(--cc-glass) !important;
  border: 1px solid var(--cc-glass-border) !important;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.22) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  scrollbar-width: none !important;
  -webkit-overflow-scrolling: touch;
}

dialog .sheet::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

dialog .sheet h2 {
  font-size: clamp(28px, 7.4vw, 34px) !important;
  line-height: 1.05 !important;
}

#quickUploadDialog {
  overflow: visible !important;
}

#quickUploadDialog .sheet {
  width: min(calc(100vw - 32px), 390px) !important;
  max-height: min(78vh, 680px) !important;
  background: var(--cc-glass) !important;
}

.dialog-close {
  position: absolute !important;
  top: 16px !important;
  right: 16px !important;
  width: 42px !important;
  height: 42px !important;
  min-height: 42px !important;
  border-radius: 999px !important;
  background: var(--cc-fill) !important;
  color: var(--cc-ink) !important;
  z-index: 5;
}

.choice-list {
  gap: 10px !important;
}

.choice {
  grid-template-columns: 46px minmax(0, 1fr) 16px !important;
  min-height: 72px !important;
  padding: 12px !important;
  border-radius: 18px !important;
  background: var(--cc-card) !important;
  border: 1px solid var(--cc-line) !important;
  box-shadow: none !important;
}

.choice::after {
  content: "›";
  color: #c4cad4;
  font-size: 24px;
  line-height: 1;
  justify-self: end;
}

.choice-copy strong {
  font-size: 17px !important;
  color: var(--cc-ink) !important;
}

.choice-copy small {
  color: var(--cc-muted) !important;
  font-size: 13px !important;
}

.bottom-nav {
  left: 50% !important;
  transform: translateX(-50%) !important;
  bottom: max(10px, env(safe-area-inset-bottom)) !important;
  width: min(calc(100% - 28px), 404px) !important;
  height: auto !important;
  padding: 8px 8px !important;
  border-radius: 26px !important;
  background: var(--cc-glass) !important;
  border: 1px solid var(--cc-glass-border) !important;
  box-shadow:
    0 12px 34px rgba(15, 23, 42, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.72) !important;
  backdrop-filter: blur(28px) saturate(1.35) !important;
  -webkit-backdrop-filter: blur(28px) saturate(1.35) !important;
}

.bottom-nav a,
.bottom-nav button {
  min-height: 58px !important;
  gap: 5px !important;
  border-radius: 18px !important;
  color: var(--cc-muted) !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 11px !important;
  font-weight: 650 !important;
}

.bottom-nav a.active,
.bottom-nav button.active,
.bottom-nav .nav-upload.active {
  color: var(--cc-blue) !important;
  background: transparent !important;
}

.bottom-nav .nav-upload {
  color: var(--cc-muted) !important;
  background: transparent !important;
}

.bottom-nav .tab-icon,
.bottom-nav .nav-upload .upload-glyph {
  width: 25px !important;
  height: 25px !important;
  min-width: 25px !important;
  border-radius: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: currentColor !important;
}

.bottom-nav .nav-upload .upload-glyph {
  width: 30px !important;
  height: 30px !important;
}

.bottom-nav .tab-icon svg,
.bottom-nav .upload-glyph svg {
  width: 24px !important;
  height: 24px !important;
  stroke-width: 1.75 !important;
}

.bottom-nav a.active .tab-icon::after,
.bottom-nav button.active .tab-icon::after {
  content: "";
  display: block;
  width: 16px;
  height: 3px;
  margin: 4px auto 0;
  border-radius: 999px;
  background: var(--cc-blue);
}

.first-run-view {
  padding: max(26px, env(safe-area-inset-top)) 28px max(28px, env(safe-area-inset-bottom)) !important;
  align-content: end !important;
  background-position: center !important;
}

.welcome-app-icon {
  width: 96px !important;
  height: 96px !important;
  border-radius: 26px !important;
}

.welcome-header h1 {
  color: #ffffff !important;
  font-size: 44px !important;
  letter-spacing: 0 !important;
}

.welcome-header strong {
  display: block;
  color: rgba(255, 255, 255, 0.94) !important;
  font-size: 21px !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
}

.welcome-header p {
  color: rgba(255, 255, 255, 0.88) !important;
}

.welcome-card {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 10px !important;
  justify-items: stretch !important;
  margin-top: 8px !important;
}

.welcome-crew-button {
  width: 100% !important;
  min-height: 58px !important;
  border-radius: 18px !important;
  background: var(--cc-blue) !important;
  color: #ffffff !important;
  font-size: 16px !important;
}

.welcome-family-button {
  width: 100% !important;
  min-height: 58px !important;
  padding: 14px 12px !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.94) !important;
  color: #0f172a !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12) !important;
  font-size: 16px !important;
  font-weight: 700 !important;
}

.welcome-privacy-note {
  max-width: 420px !important;
  margin: 12px auto 0 !important;
  color: rgba(255, 255, 255, 0.82) !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
  text-align: center !important;
}

.welcome-login-link {
  width: 100% !important;
  min-height: 58px !important;
  padding: 14px 12px !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.94) !important;
  color: #0f172a !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12) !important;
  font-size: 16px !important;
  font-weight: 700 !important;
}

#familyIdentityDialog .sheet {
  width: min(calc(100vw - 36px), 374px) !important;
}

#familyIntroDialog .sheet {
  width: min(calc(100vw - 36px), 374px) !important;
}

.family-intro-note {
  display: grid !important;
  gap: 4px !important;
  margin: 0 0 18px !important;
  padding: 12px 14px !important;
  border: 1px solid var(--cc-line, rgba(148, 163, 184, 0.42)) !important;
  border-radius: 12px !important;
  background: var(--cc-fill, #f8fbff) !important;
  color: var(--cc-muted, #64748b) !important;
  font-size: 14px !important;
  line-height: 1.35 !important;
}

.family-intro-note strong {
  color: var(--cc-ink, #10243d) !important;
  font-size: 15px !important;
}

#familyIntroDialog #familyIntroContinueBtn {
  width: 100% !important;
}

#familyIdentityDialog .field {
  display: grid !important;
  gap: 8px !important;
  margin: 0 0 14px !important;
  color: var(--cc-muted, #64748b) !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
}

#familyIdentityDialog .field input {
  width: 100% !important;
  min-height: 52px !important;
  padding: 0 15px !important;
  border: 1px solid var(--cc-line, rgba(148, 163, 184, 0.42)) !important;
  border-radius: 14px !important;
  background: var(--cc-fill, #f8fbff) !important;
  color: var(--cc-ink, #10243d) !important;
  font-size: 16px !important;
}

#familyIdentityDialog #familyIdentityContinueBtn {
  width: 100% !important;
}

body.theme-night #familyIdentityDialog .sheet {
  border-color: var(--cc-line) !important;
  background: var(--cc-card) !important;
  color: var(--cc-ink) !important;
}

body.theme-night #familyIdentityDialog .field input {
  border-color: var(--cc-line) !important;
  background: var(--cc-fill) !important;
  color: var(--cc-ink) !important;
}

.role-choice-card,
#accountTypeDialog .role-choice-card {
  min-height: 120px !important;
  border-radius: 24px !important;
  box-shadow: var(--cc-shadow) !important;
}

@media (min-width: 720px) {
  body {
    background: var(--cc-fill-strong) !important;
  }

  .phone-shell {
    margin-block: 20px;
    min-height: calc(100vh - 40px);
    border-radius: 34px;
    overflow: clip;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.12) !important;
  }
}

@media (max-width: 390px) {
  .phone-shell {
    padding-inline: 12px !important;
  }

  .card,
  .selected-day-card,
  .settings-section,
  .payroll-card,
  .logbook-card {
    padding: 18px !important;
  }

  .bottom-nav {
    width: min(calc(100% - 18px), 390px) !important;
  }

  .bottom-nav a,
  .bottom-nav button {
    font-size: 10.5px !important;
  }
}

/* Hard visibility contract: URL targets must not reveal inactive app screens. */
.phone-shell > .view:not(.active) {
  display: none !important;
}

.phone-shell > .view.active {
  display: block !important;
}

.phone-shell > #welcome.view.active {
  display: grid !important;
}

.phone-shell > #calendar.view.active,
.phone-shell > #payroll.view.active,
.phone-shell > #documents.view.active,
.phone-shell > #logbook.view.active,
.phone-shell > #settings.view.active {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 12px !important;
}

/* Logbook dashboard: added summary metrics without removing the EASA table. */
#logbook .logbook-ledger-card {
  margin-top: 18px !important;
}

#logbook .logbook-ledger-title {
  border-bottom: 0 !important;
}

.logbook-year-dashboard {
  display: block !important;
  margin: 14px 0 0 !important;
  overflow: hidden;
  border: 1px solid rgba(191, 208, 228, 0.9);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
}

.logbook-dashboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 7px 10px;
  color: #60748d;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid rgba(191, 208, 228, 0.8);
  background: rgba(238, 246, 255, 0.86);
}

.logbook-dashboard-head strong {
  color: #102b4d;
  font-size: 14px;
  letter-spacing: 0;
}

.logbook-dashboard-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.logbook-dashboard-table td {
  width: 50%;
  height: 43px;
  padding: 0;
  vertical-align: middle;
  border-bottom: 1px solid rgba(207, 219, 233, 0.74);
}

.logbook-dashboard-metric {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 43px;
  padding: 6px 9px;
}

.logbook-dashboard-table td + td {
  border-left: 1px solid rgba(207, 219, 233, 0.74);
}

.logbook-dashboard-table tr:last-child td {
  border-bottom: 0;
}

.logbook-dashboard-table span:not(.dashboard-glyph) {
  min-width: 0;
  color: #60748d;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.12;
}

.logbook-dashboard-table strong {
  color: #102b4d;
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.dashboard-glyph {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  color: #087bf3;
  background: #e4f1ff;
  border: 1px solid #c7dfff;
  font-style: normal;
}

.dashboard-glyph::before {
  font-size: 13px;
  line-height: 1;
}

.dashboard-glyph-plane::before { content: "✈"; }
.dashboard-glyph-city::before { content: "⌖"; }
.dashboard-glyph-world::before { content: "◎"; }
.dashboard-glyph-takeoff::before { content: "↗"; }
.dashboard-glyph-moon::before { content: "☾"; }
.dashboard-glyph-clock::before { content: "◷"; }

/* Six-feature integration: additive compact intelligence modules */
.crewcal-intelligence-panel {
  display: grid;
  gap: 12px;
  margin: 0 0 14px;
}

.crewcal-brief-card,
.crewcal-checklist-card,
.payroll-confidence-card {
  border-radius: 24px;
  padding: 16px;
  border: 1px solid rgba(216, 224, 234, 0.95);
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(16, 35, 63, 0.07);
}

.crewcal-brief-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
  color: #ffffff;
  background:
    radial-gradient(circle at 88% 0%, rgba(255,255,255,.30), transparent 35%),
    linear-gradient(135deg, #18375f 0%, #0a84ff 62%, #21b7aa 118%);
  border: 0;
}

.crewcal-brief-card .muted-label,
.crewcal-brief-card span {
  color: rgba(255,255,255,.78);
}

.crewcal-brief-card h2 {
  margin: 3px 0 5px;
  font-size: clamp(25px, 7vw, 34px);
  letter-spacing: 0;
}

.crewcal-brief-card > strong {
  max-width: 118px;
  border-radius: 999px;
  padding: 8px 10px;
  text-align: center;
  font-size: 12px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.22);
}

.crewcal-alert-strip {
  display: grid;
  gap: 8px;
}

.crewcal-alert-item {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
}

.crewcal-alert-item b {
  font-size: 14px;
  letter-spacing: 0;
}

.crewcal-alert-item span {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.35;
}

.crewcal-alert-item.is-ok {
  background: #ecfdf5;
  border-color: #bbf7d0;
}

.crewcal-alert-item.is-warn {
  background: #fffbeb;
  border-color: #fde68a;
}

.crewcal-alert-item.is-info {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.crewcal-checklist-card {
  display: grid;
  gap: 12px;
}

.crewcal-checklist-card h2,
.payroll-confidence-card h2 {
  margin: 2px 0 4px;
  font-size: 28px;
  letter-spacing: 0;
}

.crewcal-checklist-card span,
.payroll-confidence-card span {
  color: #6b7280;
  font-size: 13px;
  line-height: 1.35;
}

.crewcal-checklist-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.crewcal-checklist-pills span {
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 800;
  color: #4b5563;
  background: #f3f4f6;
}

.crewcal-checklist-pills span.ok {
  color: #15803d;
  background: #dcfce7;
}

.crewcal-checklist-pills span.pending {
  color: #a16207;
  background: #fef3c7;
}

.calendar-trip-view {
  display: grid;
  gap: 12px;
}

.calendar-trip-card,
.calendar-trip-empty,
.crewcal-trip-mini {
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  background: #ffffff;
  padding: 14px;
}

.calendar-trip-head {
  display: grid;
  gap: 4px;
}

.calendar-trip-head span,
.calendar-trip-head em {
  color: #6b7280;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.calendar-trip-head strong {
  font-size: 20px;
  letter-spacing: 0;
}

.calendar-trip-card.is-open {
  border-color: #fde68a;
  background: #fffbeb;
}

.calendar-trip-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.calendar-trip-meta span {
  border-radius: 14px;
  padding: 9px;
  background: #f8fafc;
}

.calendar-trip-meta small {
  display: block;
  color: #6b7280;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 800;
}

.calendar-trip-meta b {
  display: block;
  margin-top: 3px;
  font-size: 13px;
}

.calendar-trip-line {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.calendar-trip-line span {
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 800;
  color: #0a4f9d;
  background: #eef6ff;
}

.payroll-confidence-card {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  color: #ffffff;
  background:
    radial-gradient(circle at 88% 4%, rgba(255,255,255,.28), transparent 35%),
    linear-gradient(135deg, #1b3b6f 0%, #0a84ff 58%, #20c7b8 120%);
  border: 0;
}

.payroll-confidence-card .muted-label,
.payroll-confidence-card span,
.payroll-confidence-card small {
  color: rgba(255,255,255,.72);
}

.payroll-confidence-card h2 {
  color: #ffffff;
}

.payroll-confidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.payroll-confidence-grid span {
  border-radius: 15px;
  padding: 10px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.18);
}

.payroll-confidence-grid small {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 900;
}

.payroll-confidence-grid strong {
  display: block;
  margin-top: 3px;
  color: #ffffff;
  font-size: 12px;
  line-height: 1.25;
}

.crewcal-trip-strip {
  display: grid;
  gap: 10px;
}

.crewcal-trip-mini {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.crewcal-trip-mini strong {
  display: block;
  font-size: 16px;
  letter-spacing: 0;
}

.crewcal-trip-mini span {
  display: block;
  margin-top: 3px;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.3;
}

.crewcal-trip-mini em {
  font-style: normal;
  border-radius: 999px;
  padding: 7px 9px;
  color: #0a4f9d;
  background: #eef6ff;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.crewcal-trip-mini.is-open em {
  color: #a16207;
  background: #fef3c7;
}

#accountTypeDialog {
  width: fit-content !important;
  max-width: none !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
  scrollbar-width: none !important;
}

#accountTypeDialog::-webkit-scrollbar,
#accountTypeDialog .sheet::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

#accountTypeDialog .sheet {
  width: min(calc(100vw - 44px), 348px) !important;
  margin: 0 !important;
  max-height: min(74vh, 520px) !important;
  padding: 20px 18px 18px !important;
  border-radius: 28px !important;
  background: rgba(255, 255, 255, 0.98) !important;
  border: 1px solid rgba(226, 232, 240, 0.86) !important;
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.26) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

#accountTypeDialog .dialog-close {
  top: 14px !important;
  right: 14px !important;
  width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  background: rgba(241, 245, 249, 0.94) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

#accountTypeDialog .muted-label {
  margin: 0 48px 6px 0 !important;
  font-size: 12px !important;
  letter-spacing: 0.04em !important;
  text-transform: none !important;
  color: #64748b !important;
}

#accountTypeDialog .sheet h2 {
  max-width: 240px !important;
  margin: 0 48px 8px 0 !important;
  font-size: clamp(27px, 7vw, 34px) !important;
  line-height: 0.98 !important;
  letter-spacing: 0 !important;
}

#accountTypeDialog .upload-helper {
  margin: 0 0 14px !important;
  max-width: 290px !important;
  color: #64748b !important;
  font-size: 16px !important;
  line-height: 1.32 !important;
}

#accountTypeDialog .compact-choice-list {
  gap: 9px !important;
  margin-top: 0 !important;
}

#accountTypeDialog .role-choice-card {
  min-height: 96px !important;
  padding: 16px 18px !important;
  border-radius: 20px !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.96)) !important;
  border: 1px solid rgba(226, 232, 240, 0.9) !important;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07) !important;
}

#accountTypeDialog .role-choice-card::after {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.84) 58%, rgba(255, 255, 255, 0.26) 100%) !important;
}

#accountTypeDialog .role-choice-card .choice-copy {
  gap: 4px !important;
  max-width: 70% !important;
}

#accountTypeDialog .role-choice-card .choice-copy strong {
  font-size: clamp(22px, 5.9vw, 28px) !important;
  line-height: 1.02 !important;
}

#accountTypeDialog .role-choice-card .choice-copy small {
  font-size: 13.5px !important;
  line-height: 1.25 !important;
}

#accountTypeDialog .role-choice-icon {
  right: -6px !important;
  bottom: -20px !important;
  width: min(42%, 124px) !important;
  height: min(82%, 104px) !important;
  opacity: 0.28 !important;
}

#accountTypeDialog .role-choice-card--family .role-choice-icon {
  right: -2px !important;
  bottom: -16px !important;
  width: min(40%, 116px) !important;
  height: min(80%, 98px) !important;
}

#crewRoleDialog {
  width: fit-content !important;
  max-width: none !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
  scrollbar-width: none !important;
}

#crewRoleDialog::-webkit-scrollbar,
#crewRoleDialog .sheet::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

#crewRoleDialog .sheet {
  width: min(calc(100vw - 44px), 350px) !important;
  margin: 0 !important;
  max-height: min(70vh, 470px) !important;
  padding: 20px 18px 18px !important;
  border-radius: 28px !important;
  background: rgba(255, 255, 255, 0.98) !important;
  border: 1px solid rgba(226, 232, 240, 0.86) !important;
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.26) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

#crewRoleDialog .dialog-close {
  top: 14px !important;
  right: 14px !important;
  width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  background: rgba(241, 245, 249, 0.94) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

#crewRoleDialog .muted-label {
  margin: 0 48px 6px 0 !important;
  font-size: 12px !important;
  letter-spacing: 0.04em !important;
  text-transform: none !important;
  color: #64748b !important;
}

#crewRoleDialog .sheet h2 {
  max-width: 250px !important;
  margin: 0 48px 8px 0 !important;
  font-size: clamp(27px, 7vw, 34px) !important;
  line-height: 0.98 !important;
  letter-spacing: 0 !important;
}

#crewRoleDialog .upload-helper {
  margin: 0 0 14px !important;
  max-width: 290px !important;
  color: #64748b !important;
  font-size: 16px !important;
  line-height: 1.32 !important;
}

#crewRoleDialog .role-profile-actions {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
  margin-top: 10px !important;
}

#crewRoleDialog .role-profile-button {
  position: relative;
  isolation: isolate;
  min-height: 74px !important;
  padding: 14px 12px !important;
  overflow: hidden;
  border-radius: 21px !important;
  font-size: 20px !important;
  font-weight: 850 !important;
  letter-spacing: 0 !important;
}

#crewRoleDialog .role-profile-button::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: auto -14px -20px auto;
  width: 100px;
  height: 76px;
  background: center / contain no-repeat;
  opacity: 0.2;
  filter: blur(0.8px) saturate(0.9);
}

#crewRoleDialog .role-profile-button::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.72));
  pointer-events: none;
}

#crewRoleDialog .role-profile-button span {
  position: relative;
  z-index: 1;
}

#crewRoleDialog .role-profile-button--pilot {
  background:
    radial-gradient(circle at 16% 10%, rgba(255, 255, 255, 0.72), transparent 36%),
    linear-gradient(135deg, #0a7cff, #0070f0) !important;
  color: #ffffff !important;
  box-shadow: 0 14px 28px rgba(0, 122, 255, 0.22) !important;
}

#crewRoleDialog .role-profile-button--pilot::before {
  background-image: url("assets/profile-pilot-bg.svg");
  filter: blur(0.9px) brightness(0) invert(1);
  opacity: 0.24;
}

#crewRoleDialog .role-profile-button--tcp {
  color: #0a6cff !important;
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 255, 255, 0.94), transparent 36%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(238, 246, 255, 0.92)) !important;
  border: 1px solid rgba(203, 213, 225, 0.9) !important;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.07) !important;
}

#crewRoleDialog .role-profile-button--tcp::before {
  background-image: url("assets/profile-tcp-bg.svg");
  opacity: 0.18;
}

#crewSyncDialog {
  width: fit-content !important;
  max-width: none !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
  scrollbar-width: none !important;
}

#crewSyncDialog::-webkit-scrollbar,
#crewSyncDialog .sheet::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

#crewSyncDialog .sheet {
  width: min(calc(100vw - 44px), 350px) !important;
  margin: 0 !important;
  max-height: min(72vh, 500px) !important;
  padding: 20px 18px 18px !important;
  border-radius: 28px !important;
  background: rgba(255, 255, 255, 0.98) !important;
  border: 1px solid rgba(226, 232, 240, 0.86) !important;
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.26) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

#crewSyncDialog .dialog-close {
  top: 14px !important;
  right: 14px !important;
  width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  background: rgba(241, 245, 249, 0.94) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

#crewSyncDialog .muted-label {
  margin: 0 48px 6px 0 !important;
  font-size: 12px !important;
  letter-spacing: 0.04em !important;
  text-transform: none !important;
  color: #64748b !important;
}

#crewSyncDialog .sheet h2 {
  max-width: 250px !important;
  margin: 0 48px 12px 0 !important;
  font-size: clamp(27px, 7vw, 34px) !important;
  line-height: 0.98 !important;
  letter-spacing: 0 !important;
}

#crewSyncDialog .sync-note {
  margin: 0 0 12px !important;
  padding: 14px !important;
  border-radius: 18px !important;
  border: 1px solid rgba(226, 232, 240, 0.9) !important;
  background:
    radial-gradient(circle at 16% 8%, rgba(255, 255, 255, 0.95), transparent 36%),
    linear-gradient(180deg, rgba(248, 251, 255, 0.98), rgba(255, 255, 255, 0.96)) !important;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06) !important;
}

#crewSyncDialog .sync-note strong {
  display: block;
  color: #10243d !important;
  font-size: 15.5px !important;
  line-height: 1.18 !important;
}

#crewSyncDialog .sync-note p {
  margin-top: 8px !important;
  color: #64748b !important;
  font-size: 14px !important;
  line-height: 1.32 !important;
}

#crewSyncDialog .dialog-actions {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 9px !important;
  margin-top: 0 !important;
}

#crewSyncDialog .sync-action-button {
  min-height: 50px !important;
  padding: 12px 14px !important;
  border-radius: 17px !important;
  font-size: 16px !important;
  font-weight: 850 !important;
  letter-spacing: 0 !important;
}

#crewSyncDialog .sync-action-button--login {
  background: linear-gradient(135deg, #0a7cff, #0070f0) !important;
  color: #ffffff !important;
  box-shadow: 0 12px 24px rgba(0, 122, 255, 0.22) !important;
}

#crewSyncDialog .sync-action-button--skip {
  color: #0a6cff !important;
  background: rgba(239, 246, 255, 0.88) !important;
  border: 1px solid rgba(203, 213, 225, 0.86) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92) !important;
}

#familyAccessDialog {
  width: fit-content !important;
  max-width: none !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
  scrollbar-width: none !important;
}

#familyAccessDialog::-webkit-scrollbar,
#familyAccessDialog .sheet::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

#familyAccessDialog .sheet {
  width: min(calc(100vw - 44px), 350px) !important;
  margin: 0 !important;
  max-height: min(74vh, 520px) !important;
  padding: 20px 18px 18px !important;
  border-radius: 28px !important;
  background: rgba(255, 255, 255, 0.98) !important;
  border: 1px solid rgba(226, 232, 240, 0.86) !important;
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.26) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

#familyAccessDialog .dialog-close {
  top: 14px !important;
  right: 14px !important;
  width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  background: rgba(241, 245, 249, 0.94) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

#familyAccessDialog .muted-label {
  margin: 0 48px 6px 0 !important;
  font-size: 12px !important;
  letter-spacing: 0.04em !important;
  text-transform: none !important;
  color: #64748b !important;
}

#familyAccessDialog .sheet h2 {
  max-width: 250px !important;
  margin: 0 48px 10px 0 !important;
  font-size: clamp(27px, 7vw, 34px) !important;
  line-height: 0.98 !important;
  letter-spacing: 0 !important;
}

#familyAccessDialog .upload-helper {
  margin: 0 0 14px !important;
  color: #64748b !important;
  font-size: 16px !important;
  line-height: 1.32 !important;
}

#familyAccessDialog .field {
  display: grid !important;
  gap: 8px !important;
  margin: 0 0 14px !important;
  color: #64748b !important;
  font-size: 12px !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
}

#familyAccessDialog .field input {
  width: 100% !important;
  min-height: 56px !important;
  padding: 0 16px !important;
  border-radius: 18px !important;
  border: 1px solid rgba(148, 163, 184, 0.42) !important;
  background: #f8fbff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92) !important;
  color: #10243d !important;
  font-size: 18px !important;
  letter-spacing: 0.02em !important;
}

.family-access-status {
  margin: -2px 0 14px;
  padding: 10px 2px 0;
  border-top: 1px solid var(--cc-line, rgba(148, 163, 184, 0.28));
  color: var(--cc-ink, #10243d);
  font-size: 13px;
  font-weight: 720;
  line-height: 1.35;
  letter-spacing: 0;
}

.family-access-status[data-tone="error"] {
  border-top-color: rgba(220, 38, 38, 0.24);
  color: #b42318;
}

.family-access-status[data-tone="warning"] {
  border-top-color: rgba(217, 119, 6, 0.28);
  color: #9a5b00;
}

body.theme-night .family-access-status[data-tone="error"] {
  color: #ff8a80;
}

body.theme-night .family-access-status[data-tone="warning"] {
  color: #ffc46b;
}

#familyCodeStatus {
  margin-top: 0;
}

#familyAccessDialog #familyLoginBtn {
  width: 100% !important;
  min-height: 52px !important;
  border-radius: 18px !important;
  font-size: 16px !important;
  font-weight: 850 !important;
  box-shadow: 0 12px 24px rgba(0, 122, 255, 0.2) !important;
}

.phone-shell > #calendar.view.active,
.phone-shell > #payroll.view.active,
.phone-shell > #documents.view.active,
.phone-shell > #logbook.view.active,
.phone-shell > #settings.view.active {
  background:
    radial-gradient(circle at 86% 2%, rgba(0, 122, 255, 0.08), rgba(0, 122, 255, 0) 34%),
    radial-gradient(circle at 8% 76%, rgba(52, 199, 89, 0.045), rgba(52, 199, 89, 0) 28%),
    linear-gradient(180deg, #fbfdff 0%, #f6f9fd 54%, #f2f5f9 100%) !important;
}

.screen-header .header-actions {
  gap: 8px !important;
}

.screen-header .icon-action.subtle-action.settings-image-action {
  display: grid !important;
  place-items: center !important;
  width: 52px !important;
  height: 52px !important;
  min-width: 52px !important;
  min-height: 52px !important;
  padding: 0 !important;
  overflow: hidden !important;
  border-radius: 18px !important;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(244, 249, 255, 0.66)) padding-box,
    linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(148, 163, 184, 0.28)) border-box !important;
  border: 1px solid transparent !important;
  box-shadow:
    0 10px 24px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.82) !important;
}

.screen-header .settings-image-action .settings-icon-image {
  width: 30px !important;
  height: 30px !important;
  max-width: 30px !important;
  max-height: 30px !important;
  border-radius: 0 !important;
  object-fit: contain !important;
  object-position: center !important;
  transform: none !important;
  filter: none !important;
}

#logbook .header-actions .icon-action {
  width: 52px !important;
  height: 52px !important;
  min-width: 52px !important;
  min-height: 52px !important;
}

@media (max-width: 430px) {
  .calendar-trip-meta,
  .payroll-confidence-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .crewcal-trip-mini {
    grid-template-columns: 1fr;
  }
}

/* CrewCal reference lock: sober iOS visual system from the July design board. */
:root {
  --crewcal-page-bg:
    radial-gradient(circle at 92% -10%, rgba(0, 122, 255, 0.055), transparent 34%),
    radial-gradient(circle at 0% 78%, rgba(52, 199, 89, 0.035), transparent 30%),
    linear-gradient(180deg, #fbfcff 0%, #f7f8fb 54%, #f3f5f8 100%);
  --crewcal-card-bg: rgba(255, 255, 255, 0.86);
  --crewcal-card-border: rgba(210, 218, 230, 0.78);
  --crewcal-blue: #007aff;
  --crewcal-ink: #111827;
  --crewcal-muted: #6b7280;
  --crewcal-shadow: 0 10px 26px rgba(15, 23, 42, 0.055);
}

.phone-shell > #calendar.view.active,
.phone-shell > #payroll.view.active,
.phone-shell > #documents.view.active,
.phone-shell > #logbook.view.active,
.phone-shell > #settings.view.active,
.phone-shell > #home.view.active,
.phone-shell > #onboarding.view.active {
  background: var(--crewcal-page-bg) !important;
}

.screen-header,
.home-header,
.onboarding-hero {
  align-items: flex-start !important;
  gap: 14px !important;
  padding-top: 8px !important;
}

.screen-header h1,
.home-header h1,
.onboarding-hero h1 {
  color: var(--crewcal-ink) !important;
  letter-spacing: 0 !important;
}

.screen-header .muted-label,
.home-header .muted-label,
.onboarding-hero .muted-label {
  color: #98a2b3 !important;
  letter-spacing: 0.12em !important;
}

.card,
.soft-card,
.selected-day-card,
.payroll-confidence-card,
.logbook-card,
.logbook-ledger-card,
.documents-hero,
.settings-section,
.calendar-status-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.78)) padding-box,
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(208, 216, 228, 0.74)) border-box !important;
  border: 1px solid transparent !important;
  box-shadow: var(--crewcal-shadow) !important;
}

.screen-header .icon-action,
.icon-action.subtle-action,
.screen-header .settings-image-action,
#logbook .mcdu-scan-action {
  display: grid !important;
  place-items: center !important;
  width: 46px !important;
  height: 46px !important;
  min-width: 46px !important;
  min-height: 46px !important;
  padding: 0 !important;
  border-radius: 15px !important;
  border: 1px solid rgba(210, 218, 230, 0.82) !important;
  background: rgba(255, 255, 255, 0.72) !important;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.055) !important;
  overflow: hidden !important;
  color: var(--crewcal-ink) !important;
}

.screen-header .settings-image-action .settings-icon-image,
.settings-image-action .settings-icon-image,
#logbook .mcdu-scan-action .mcdu-action-image {
  display: block !important;
  width: 28px !important;
  height: 28px !important;
  max-width: 28px !important;
  max-height: 28px !important;
  object-fit: contain !important;
  object-position: center !important;
  transform: none !important;
  filter: none !important;
  border-radius: 0 !important;
}

#logbook .header-actions {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  max-width: none !important;
}

#logbook .screen-header h1 {
  max-width: calc(100vw - 132px) !important;
}

#logbook .mcdu-scan-action::before {
  content: none !important;
}

.bottom-nav {
  width: min(calc(100% - 28px), 404px) !important;
  padding: 7px 8px max(7px, env(safe-area-inset-bottom)) !important;
  border-radius: 24px !important;
  background: rgba(255, 255, 255, 0.58) !important;
  border: 1px solid rgba(255, 255, 255, 0.78) !important;
  box-shadow: 0 -8px 26px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
  backdrop-filter: blur(28px) saturate(1.24) !important;
  -webkit-backdrop-filter: blur(28px) saturate(1.24) !important;
}

.bottom-nav a,
.bottom-nav button {
  min-height: 56px !important;
  border-radius: 17px !important;
  color: var(--crewcal-muted) !important;
  background: transparent !important;
  box-shadow: none !important;
}

.bottom-nav a.active,
.bottom-nav button.active,
.bottom-nav .nav-upload.active {
  color: var(--crewcal-blue) !important;
  background: transparent !important;
}

.bottom-nav .tab-icon,
.bottom-nav .nav-upload .upload-glyph {
  width: 25px !important;
  height: 25px !important;
  min-width: 25px !important;
  border-radius: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: currentColor !important;
  overflow: visible !important;
}

.bottom-nav .nav-upload .upload-glyph {
  width: 29px !important;
  height: 29px !important;
}

.bottom-nav .tab-icon svg,
.bottom-nav .upload-glyph svg {
  width: 24px !important;
  height: 24px !important;
  stroke-width: 1.8 !important;
}

.bottom-nav .tab-icon svg *,
.bottom-nav .upload-glyph svg * {
  stroke: currentColor !important;
}

dialog,
#quickUploadDialog,
#accountTypeDialog,
#crewRoleDialog,
#crewSyncDialog,
#familyAccessDialog {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
  scrollbar-width: none !important;
}

dialog::-webkit-scrollbar,
dialog .sheet::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

dialog .sheet,
#quickUploadDialog .sheet,
#accountTypeDialog .sheet,
#crewRoleDialog .sheet,
#crewSyncDialog .sheet,
#familyAccessDialog .sheet {
  width: min(calc(100vw - 36px), 374px) !important;
  padding: 22px 20px 20px !important;
  border-radius: 28px !important;
  background: rgba(255, 255, 255, 0.97) !important;
  border: 1px solid rgba(226, 232, 240, 0.88) !important;
  box-shadow: 0 22px 58px rgba(15, 23, 42, 0.22) !important;
  overflow-x: hidden !important;
}

.dialog-close {
  width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  border-radius: 999px !important;
  background: #f3f6fb !important;
  color: var(--crewcal-ink) !important;
  box-shadow: none !important;
}


/* Schedule import review and chronological change cards */
.schedule-change-history-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(0, 122, 255, 0.18);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.10), rgba(52, 199, 89, 0.08)), rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.schedule-change-history-head,
.schedule-review-meta {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 10px;
}

.schedule-change-history-head h2 {
  margin: 2px 0 0;
  font-size: 1.2rem;
}

.schedule-change-history-head > strong {
  display: grid;
  min-width: 48px;
  place-items: center;
  border-radius: 999px;
  color: var(--blue);
  background: rgba(0, 122, 255, 0.10);
}

.schedule-change-card-list {
  display: grid;
  gap: 10px;
  max-height: min(48vh, 480px);
  overflow: auto;
  padding-right: 2px;
}

.schedule-change-card {
  display: grid;
  grid-template-columns: minmax(74px, 0.34fr) 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
}

.schedule-change-card.is-added { border-color: rgba(52, 199, 89, 0.30); }
.schedule-change-card.is-changed { border-color: rgba(0, 122, 255, 0.28); }
.schedule-change-card.is-removed { border-color: rgba(255, 59, 48, 0.26); }

.schedule-change-date {
  display: grid;
  gap: 4px;
}

.schedule-change-date strong {
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.05;
}

.schedule-change-date span {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--blue);
  background: rgba(0, 122, 255, 0.10);
  font-size: 0.74rem;
  font-weight: 800;
}

.schedule-change-card.is-added .schedule-change-date span {
  color: var(--green);
  background: rgba(52, 199, 89, 0.12);
}

.schedule-change-card.is-removed .schedule-change-date span {
  color: var(--red);
  background: rgba(255, 59, 48, 0.10);
}

.schedule-change-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.schedule-change-copy b {
  color: var(--ink);
  font-size: 0.98rem;
}

.schedule-change-copy span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.28;
}

.schedule-change-copy em {
  color: var(--ink);
  font-style: normal;
  font-weight: 800;
}

#scheduleReviewDialog .schedule-review-sheet {
  width: min(92vw, 720px);
  max-height: min(90dvh, 780px) !important;
  display: grid;
  grid-template-rows: auto auto auto auto auto minmax(0, 1fr) auto;
  overflow: hidden !important;
}

#scheduleReviewDialog .schedule-change-card-list {
  min-height: 0;
  max-height: none;
  grid-auto-rows: max-content;
  align-content: start;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#scheduleReviewDialog .dialog-actions {
  margin-top: 0;
  padding-top: 2px;
  background: transparent;
}

.schedule-review-meta article {
  flex: 1;
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
}

.schedule-review-meta small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.schedule-review-meta strong {
  overflow-wrap: anywhere;
}

.schedule-review-summary {
  padding: 12px 14px;
  border-radius: 16px;
  color: var(--blue);
  background: rgba(0, 122, 255, 0.10);
  font-weight: 900;
}

.schedule-change-card.is-review {
  border-radius: 14px;
  background: #ffffff;
}

.schedule-change-card.is-review.is-decision-keep {
  border-color: rgba(100, 116, 139, 0.34);
}

.schedule-change-card.is-review.is-decision-apply {
  border-color: rgba(52, 199, 89, 0.46);
}

.schedule-review-decisions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 5px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  background: #f7f9fc;
}

.schedule-review-decision {
  min-width: 0;
  min-height: 36px;
  padding: 8px 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.15;
}

.schedule-review-decision + .schedule-review-decision {
  border-left: 1px solid rgba(15, 23, 42, 0.12);
}

.schedule-review-decision.is-keep.is-selected {
  background: rgba(100, 116, 139, 0.14);
  color: #334155;
}

.schedule-review-decision.is-apply.is-selected {
  background: rgba(52, 199, 89, 0.16);
  color: #126b32;
}

#applyScheduleReviewBtn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

@media (max-width: 520px) {
  #scheduleReviewDialog .schedule-review-sheet {
    width: min(calc(100vw - 24px), 430px);
    max-height: min(calc(100dvh - 24px), 760px) !important;
    grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
    gap: 8px !important;
    padding: 14px 12px 12px !important;
  }

  #scheduleReviewDialog .schedule-review-sheet > .muted-label {
    display: none;
  }

  #scheduleReviewDialog .schedule-review-sheet > h2 {
    margin: 0 !important;
    padding-right: 36px;
    font-size: 22px !important;
    line-height: 1.1 !important;
  }

  #scheduleReviewDialog .upload-helper {
    margin: 0 !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
  }

  .schedule-review-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .schedule-review-meta article {
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 11px;
  }

  .schedule-review-meta small {
    font-size: 9px;
  }

  .schedule-review-meta strong {
    display: -webkit-box;
    overflow: hidden;
    font-size: 11px;
    line-height: 1.2;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  #scheduleReviewDialog .schedule-review-summary {
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 12px;
  }

  #scheduleReviewDialog .dialog-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  #scheduleReviewDialog .dialog-actions button {
    min-height: 44px !important;
    padding: 7px 9px !important;
    font-size: 12px !important;
  }

  .schedule-change-card.is-review {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 10px;
  }

  .schedule-change-card.is-review .schedule-change-date {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
}


/* Reversible schedule update deck */
.schedule-change-history-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
}

.schedule-change-card.is-hidden-update {
  opacity: 0.74;
  background: rgba(248, 250, 252, 0.86);
}

.schedule-change-card.is-hidden-update .schedule-change-date span {
  color: #6b7280;
  background: rgba(107, 114, 128, 0.12);
}

.schedule-change-copy small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.schedule-change-actions {
  display: flex;
  justify-content: flex-start;
  padding-top: 4px;
}

.schedule-change-toggle {
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 850;
}

.schedule-change-toggle.secondary {
  color: var(--blue);
  background: rgba(0, 122, 255, 0.08);
  border: 1px solid rgba(0, 122, 255, 0.16);
}

.schedule-change-toggle.primary {
  color: #ffffff;
  background: var(--blue);
  border: 1px solid rgba(0, 122, 255, 0.28);
}


/* Manual Privilege activities in calendar */
.manual-time-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.day-cell .event-time {
  display: grid;
  justify-items: center;
  gap: 0;
  margin-top: 3px;
  color: var(--cc-muted, #6b7280);
  font-size: 8px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0;
  overflow: visible;
  white-space: normal;
}

.day-cell .event-time span,
.day-cell .event-time small {
  display: block;
  max-width: 100%;
}

.day-cell .event-time small {
  margin-top: 1px;
  color: inherit;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.full-calendar .day-cell,
.mini-calendar .day-cell {
  min-height: 76px !important;
}

.day-cell .event-mark {
  text-transform: uppercase;
}

.day-cell .event-reserve {
  background: #ff3b30 !important;
}

.day-cell .event-oncall {
  background: #d8f0f7 !important;
  color: #0a536c !important;
}

.day-cell .event-transport {
  background: #0f9f95 !important;
}

.row-icon.reserve {
  background: rgba(255, 59, 48, 0.12) !important;
  color: #d92d20 !important;
}

.row-icon.oncall {
  background: #e3f3f8 !important;
  color: #0a5e78 !important;
}

.row-icon.transport {
  background: rgba(15, 159, 149, 0.12) !important;
  color: #087f76 !important;
}


/* Apple-style exact calendar date picker */
.month-controls > .calendar-date-picker-trigger {
  display: grid;
  gap: 1px;
  justify-items: center;
  align-content: center;
  justify-self: stretch;
  width: 100% !important;
  min-width: 0 !important;
  height: 40px !important;
  min-height: 40px !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--cc-ink, #111827) !important;
  padding: 3px 8px !important;
  border-radius: 12px !important;
  line-height: 1.1 !important;
}

.month-controls > .calendar-date-picker-trigger:active {
  background: rgba(0, 122, 255, 0.08);
}

.month-controls > .calendar-date-picker-trigger strong {
  font: inherit;
  max-width: 100%;
  overflow: hidden;
  font-size: 17px !important;
  font-weight: 720 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.month-controls > .calendar-date-picker-trigger span {
  color: var(--cc-muted, #6b7280);
  font-size: 10px;
  font-weight: 650;
}

#calendarDateDialog .calendar-date-sheet {
  width: min(348px, calc(100vw - 28px)) !important;
  max-height: none !important;
  padding: 18px !important;
  border-radius: 22px !important;
  overflow: hidden !important;
}

#calendarDateDialog .calendar-date-sheet h2 {
  margin: 2px 0 6px !important;
  padding: 0 !important;
  font-size: 24px !important;
  line-height: 1.08 !important;
  letter-spacing: 0 !important;
}

#calendarDateDialog .calendar-date-sheet .muted-label {
  margin-bottom: 2px !important;
  font-size: 11px !important;
}

#calendarDateDialog .calendar-date-sheet .upload-helper {
  margin: 0 !important;
  font-size: 13px !important;
  line-height: 1.35 !important;
}

.calendar-wheel-picker {
  position: relative;
  display: grid;
  grid-template-columns: minmax(52px, 0.72fr) minmax(82px, 1.32fr) minmax(66px, 0.9fr);
  gap: 4px;
  margin: 14px 0 12px;
  padding: 8px;
  border-radius: 18px;
  background: #f5f6f8;
  border: 1px solid rgba(148, 163, 184, 0.22);
  overflow: hidden;
}

.calendar-wheel-picker::before,
.calendar-wheel-picker::after {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  height: 46px;
  content: '';
  pointer-events: none;
}

.calendar-wheel-picker::before {
  top: 30px;
  background: linear-gradient(to bottom, #f5f6f8 8%, rgba(245, 246, 248, 0));
}

.calendar-wheel-picker::after {
  bottom: 0;
  background: linear-gradient(to top, #f5f6f8 8%, rgba(245, 246, 248, 0));
}

.calendar-wheel-highlight {
  position: absolute;
  z-index: 0;
  left: 10px;
  right: 10px;
  top: calc(50% + 8px);
  height: 44px;
  transform: translateY(-50%);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid rgba(148, 163, 184, 0.28);
  border-bottom: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  pointer-events: none;
}

.calendar-wheel-column {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.calendar-wheel-column > span {
  color: var(--cc-muted, #6b7280);
  font-size: 9px;
  font-weight: 750;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.calendar-wheel-scroll {
  position: relative;
  z-index: 1;
  height: 140px;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  padding: 48px 0;
  scrollbar-width: none;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

.calendar-wheel-scroll::-webkit-scrollbar {
  display: none;
}

.calendar-wheel-scroll button {
  width: 100%;
  height: 44px;
  min-height: 44px;
  padding: 0 3px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--cc-muted, #6b7280);
  font-size: 16px;
  font-weight: 620;
  line-height: 44px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

.calendar-wheel-scroll button.active {
  color: var(--cc-ink, #111827);
  font-weight: 760;
}

.calendar-date-actions {
  grid-template-columns: 0.82fr 1.18fr;
  gap: 8px !important;
}

#calendarDateDialog .calendar-date-actions button {
  min-height: 44px !important;
  border-radius: 13px !important;
  font-size: 14px !important;
}


/* Swipe month navigation */
#fullCalendar {
  touch-action: pan-y;
  overscroll-behavior: contain;
}

#fullCalendar.swipe-next {
  animation: calendarSwipeNext 240ms ease-out;
}

#fullCalendar.swipe-prev {
  animation: calendarSwipePrev 240ms ease-out;
}

@keyframes calendarSwipeNext {
  0% { opacity: 0.72; transform: translateX(18px) scale(0.992); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes calendarSwipePrev {
  0% { opacity: 0.72; transform: translateX(-18px) scale(0.992); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}


/* Compact operational cards and FTL evidence */
.calendar-trip-compact {
  padding: 12px 14px;
  border-radius: 18px;
}

.calendar-trip-compact .calendar-trip-head {
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 2px 10px;
}

.calendar-trip-compact .calendar-trip-head span {
  grid-column: 1 / -1;
}

.calendar-trip-compact .calendar-trip-head strong {
  font-size: 18px;
  line-height: 1.05;
}

.calendar-trip-compact .calendar-trip-head em {
  justify-self: end;
}

.calendar-trip-table {
  display: grid;
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 14px;
  background: rgba(255, 255, 255, .58);
}

.calendar-trip-table div {
  display: grid;
  grid-template-columns: .8fr 1fr .8fr 1fr;
  min-height: 34px;
  border-top: 1px solid rgba(148, 163, 184, .22);
}

.calendar-trip-table div:first-child {
  border-top: 0;
}

.calendar-trip-table span,
.calendar-trip-table b {
  display: flex;
  align-items: center;
  padding: 7px 9px;
  font-size: 12px;
}

.calendar-trip-table span {
  color: #64748b;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.calendar-trip-table b {
  color: #0f172a;
  font-weight: 850;
}

.calendar-trip-flights {
  margin: 9px 0 0;
  color: #0b5bb5;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.duty-excess-detail {
  margin: 7px 0 0;
  color: #9f1239;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}


/* Logbook history search */
.logbook-ledger-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.logbook-ledger-count {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.small-button {
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 12px;
}

.logbook-search-sheet {
  max-height: min(82vh, 760px);
  overflow: auto;
}

.logbook-search-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.logbook-search-filters .field:first-child {
  grid-column: 1 / -1;
}

.logbook-search-results {
  display: grid;
  gap: 10px;
}

.logbook-search-result button,
.logbook-search-empty {
  display: grid;
  width: 100%;
  gap: 4px;
  padding: 12px;
  text-align: left;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
}

.logbook-search-result strong {
  color: #0f172a;
  font-size: 15px;
}

.logbook-search-result small,
.logbook-search-date,
.logbook-search-empty span {
  color: #64748b;
  font-weight: 750;
}

.logbook-search-date {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}


/* iOS appearance mode. */
html.theme-night,
body.theme-night {
  --cc-bg: #000000;
  --cc-card: #1c1c1e;
  --cc-ink: #f2f2f7;
  --cc-muted: #c7c7cc;
  --cc-subtle: #aeb4bf;
  --cc-line: rgba(255, 255, 255, 0.12);
  --cc-blue: #0a84ff;
  --cc-primary: #006edc;
  --cc-blue-on-fill: #66b5ff;
  --cc-green: #30d158;
  --cc-orange: #ff9f0a;
  --cc-red: #ff453a;
  --cc-purple: #5e5ce6;
  --cc-fill: #2c2c2e;
  --cc-fill-strong: #3a3a3c;
  --cc-selected: rgba(10, 132, 255, 0.2);
  --cc-icon-bg: rgba(10, 132, 255, 0.17);
  --cc-glass: rgba(28, 28, 30, 0.84);
  --cc-glass-border: rgba(255, 255, 255, 0.12);
  --cc-ok-ink: #7ee2a8;
  --cc-warn-ink: #ffc96b;
  --cc-error-ink: #ff8a83;
  --cc-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  --cc-shadow-soft: 0 3px 12px rgba(0, 0, 0, 0.24);
}

body.theme-night {
  color: var(--cc-ink) !important;
  background: var(--cc-bg) !important;
}

body.theme-night .phone-shell {
  background: var(--cc-bg) !important;
}

body.theme-night .view:not(#welcome) {
  color: var(--cc-ink) !important;
  background: var(--cc-bg) !important;
}

body.theme-night .card,
body.theme-night .soft-card,
body.theme-night .settings-section,
body.theme-night .list-row,
body.theme-night .calendar-trip-card,
body.theme-night .calendar-trip-empty,
body.theme-night .logbook-ledger-card,
body.theme-night .logbook-export-summary,
body.theme-night .logbook-search-result button,
body.theme-night .sheet {
  color: var(--cc-ink);
  border-color: var(--cc-line);
  background: var(--cc-card);
}

body.theme-night .screen-header h1,
body.theme-night .section-title h2,
body.theme-night .sheet > h2,
body.theme-night .row-main strong,
body.theme-night .choice-copy strong,
body.theme-night .list-row strong,
body.theme-night .row-main strong {
  color: var(--cc-ink);
}

body.theme-night .upload-helper,
body.theme-night .muted-label,
body.theme-night .row-main span,
body.theme-night .choice-copy small,
body.theme-night .list-row small {
  color: var(--cc-muted);
}

body.theme-night input,
body.theme-night select,
body.theme-night textarea,
body.theme-night .field input,
body.theme-night .field select {
  color: var(--cc-ink);
  border-color: var(--cc-line);
  background: var(--cc-fill);
}

body.theme-night input::placeholder,
body.theme-night textarea::placeholder {
  color: var(--cc-subtle);
  opacity: 1;
}

body.theme-night .bottom-nav {
  border-color: var(--cc-glass-border);
  background: var(--cc-glass);
  box-shadow: 0 -18px 40px rgba(0, 0, 0, .32);
}

body.theme-night .bottom-nav a,
body.theme-night .bottom-nav button {
  color: var(--cc-muted);
}

body.theme-night .bottom-nav a.active,
body.theme-night .bottom-nav button.active {
  color: var(--cc-blue);
}

.theme-mode-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  margin-top: 12px;
  padding: 4px;
  border: 1px solid var(--cc-line);
  border-radius: 13px;
  background: var(--cc-fill);
}

.theme-mode-options button {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 36px;
  padding: 0 5px;
  text-align: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--cc-muted);
  box-shadow: none;
}

.theme-mode-options button.selected {
  background: var(--cc-card);
  color: var(--cc-blue);
  box-shadow: 0 1px 5px rgba(15, 23, 42, 0.14);
}

.theme-mode-options strong {
  overflow: hidden;
  max-width: 100%;
  color: inherit !important;
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#themeModeDialog .theme-mode-sheet {
  width: min(calc(100vw - 44px), 330px) !important;
  padding: 20px 18px 18px !important;
}

#themeModeDialog .theme-mode-sheet h2 {
  padding-right: 40px;
  font-size: 24px !important;
}

#themeModeDialog .theme-mode-sheet .upload-helper {
  margin: 2px 0 0 !important;
  font-size: 12px !important;
}

/* Compact elapsed-time calculator for flight operations. */
#logbook .header-actions {
  max-width: none !important;
  gap: 6px !important;
}

#logbook .screen-header h1 {
  max-width: calc(100vw - 205px);
}

#logbook .time-calculator-action {
  grid-template-rows: 19px 9px !important;
  align-content: center !important;
  gap: 1px !important;
}

#logbook .time-calculator-action svg {
  width: 19px !important;
  height: 19px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.7 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

#logbook .time-calculator-action span {
  color: currentColor !important;
  font-size: 7.5px !important;
  font-weight: 850 !important;
  line-height: 1 !important;
  letter-spacing: 0.05em !important;
}

#timeCalculatorDialog .time-calculator-sheet {
  display: grid;
  gap: 12px;
  width: min(calc(100vw - 40px), 310px) !important;
  padding: 18px 16px 14px !important;
}

#timeCalculatorDialog h2 {
  margin: 0;
}

#timeCalculatorDialog h2 {
  padding-right: 42px;
  font-size: 21px;
  line-height: 1.15;
  letter-spacing: 0;
}

#timeCalculatorDialog .dialog-close {
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  font-size: 24px;
}

.time-calculator-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 14px minmax(0, 1fr);
  align-items: end;
  gap: 6px;
}

.time-calculator-fields .field {
  min-width: 0;
  gap: 5px;
  color: #667386;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.time-calculator-fields input[type="time"] {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 6px;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 12px;
  background: #f8fafc;
  color: #111827;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0;
  text-align: center;
}

.time-calculator-arrow {
  display: grid;
  place-items: center;
  height: 44px;
  color: #98a2b3;
  font-size: 15px;
  font-weight: 700;
}

.time-calculator-result {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 122, 255, 0.2);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.11), rgba(52, 199, 89, 0.055));
}

.time-calculator-result-label {
  color: #667386;
  font-size: 11px;
  font-weight: 750;
}

.time-calculator-result strong {
  color: #0b64d8;
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0;
}

.time-calculator-summary {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.time-calculator-next-day {
  justify-self: end;
  padding: 5px 7px;
  border-radius: 999px;
  background: rgba(0, 122, 255, 0.11);
  color: #0b64d8;
  font-size: 9px;
  font-weight: 850;
  white-space: nowrap;
}

.time-calculator-next-day[hidden] {
  display: none;
}

#timeCalculatorDialog .time-calculator-clear {
  justify-self: start;
  min-height: 30px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: #667386;
  font-size: 12px;
  box-shadow: none;
}

body.theme-night .time-calculator-fields input[type="time"] {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(2, 6, 23, 0.52);
  color: #f8fafc;
}

body.theme-night .time-calculator-result {
  border-color: rgba(96, 165, 250, 0.34);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.24), rgba(15, 118, 110, 0.13));
}

body.theme-night .time-calculator-result strong,
body.theme-night .time-calculator-next-day {
  color: #60a5fa !important;
}

@media (max-width: 360px) {
  .calendar-view-toggle button {
    padding-inline: 3px !important;
    font-size: 12px !important;
  }

  #logbook .header-actions {
    gap: 4px !important;
  }

  #logbook .header-actions .icon-action,
  #logbook .screen-header .settings-image-action {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
  }

  #logbook .screen-header h1 {
    max-width: calc(100vw - 170px);
  }
}

/* Calendar briefing: one compact card with table-like rows. */
.crewcal-intelligence-panel {
  display: grid !important;
  gap: 0 !important;
  margin: 0 0 14px !important;
  overflow: hidden !important;
  border: 1px solid rgba(60, 60, 67, 0.12) !important;
  border-radius: 20px !important;
  background: rgba(255, 255, 255, 0.94) !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.055) !important;
}

.crewcal-intelligence-panel > .crewcal-brief-card,
.crewcal-intelligence-panel > .crewcal-alert-strip,
.crewcal-intelligence-panel > .schedule-change-history-panel,
.crewcal-intelligence-panel > .crewcal-checklist-card {
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.crewcal-intelligence-panel > .crewcal-brief-card {
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 15px 16px !important;
  color: var(--cc-ink, #111827) !important;
}

.crewcal-intelligence-panel .crewcal-brief-card .muted-label {
  margin: 0 0 3px !important;
  color: var(--cc-muted, #6b7280) !important;
  font-size: 10px !important;
}

.crewcal-intelligence-panel .crewcal-brief-card h2 {
  margin: 0 0 3px !important;
  color: var(--cc-ink, #111827) !important;
  font-size: 23px !important;
  line-height: 1.08 !important;
  letter-spacing: 0 !important;
}

.crewcal-intelligence-panel .crewcal-brief-card span {
  color: var(--cc-muted, #6b7280) !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
}

.crewcal-intelligence-panel .crewcal-brief-card > strong {
  min-width: 0 !important;
  max-width: 96px !important;
  padding: 5px 8px !important;
  border: 1px solid rgba(0, 122, 255, 0.16) !important;
  border-radius: 999px !important;
  background: rgba(0, 122, 255, 0.07) !important;
  color: var(--cc-blue, #007aff) !important;
  font-size: 10px !important;
  font-weight: 750 !important;
  line-height: 1.2 !important;
}

.crewcal-intelligence-panel > .crewcal-alert-strip {
  display: grid !important;
  gap: 0 !important;
}

.crewcal-intelligence-panel .crewcal-alert-item {
  display: grid !important;
  grid-template-columns: 7px minmax(0, 1fr) !important;
  column-gap: 10px !important;
  row-gap: 2px !important;
  padding: 12px 16px !important;
  border: 0 !important;
  border-top: 1px solid rgba(60, 60, 67, 0.10) !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.crewcal-intelligence-panel .crewcal-alert-item::before {
  grid-row: 1 / span 2;
  align-self: start;
  width: 7px;
  height: 7px;
  margin-top: 5px;
  border-radius: 50%;
  background: #8e8e93;
  content: "";
}

.crewcal-intelligence-panel .crewcal-alert-item.is-ok::before {
  background: #34c759;
}

.crewcal-intelligence-panel .crewcal-alert-item.is-warn::before {
  background: #ff9f0a;
}

.crewcal-intelligence-panel .crewcal-alert-item.is-info::before {
  background: #0a84ff;
}

.crewcal-intelligence-panel .crewcal-alert-item b,
.crewcal-intelligence-panel .crewcal-alert-item span {
  grid-column: 2;
}

.crewcal-intelligence-panel .crewcal-alert-item b {
  color: var(--cc-ink, #111827) !important;
  font-size: 13px !important;
  line-height: 1.25 !important;
}

.crewcal-intelligence-panel .crewcal-alert-item span {
  color: var(--cc-muted, #6b7280) !important;
  font-size: 11px !important;
  line-height: 1.35 !important;
}

.crewcal-intelligence-panel > .schedule-change-history-panel,
.crewcal-intelligence-panel > .crewcal-checklist-card {
  padding: 13px 16px !important;
  border-top: 1px solid rgba(60, 60, 67, 0.10) !important;
}

.crewcal-intelligence-panel > .crewcal-checklist-card {
  display: grid !important;
  gap: 9px !important;
}

.crewcal-intelligence-panel .crewcal-checklist-card > div:first-child {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 2px 10px !important;
}

.crewcal-intelligence-panel .crewcal-checklist-card .muted-label {
  grid-column: 1 !important;
  margin: 0 !important;
  font-size: 10px !important;
}

.crewcal-intelligence-panel .crewcal-checklist-card h2 {
  grid-column: 2 !important;
  grid-row: 1 / span 2 !important;
  margin: 0 !important;
  color: var(--cc-ink, #111827) !important;
  font-size: 16px !important;
  letter-spacing: 0 !important;
  white-space: nowrap !important;
}

.crewcal-intelligence-panel .crewcal-checklist-card > div:first-child > span {
  grid-column: 1 !important;
  color: var(--cc-muted, #6b7280) !important;
  font-size: 11px !important;
}

.crewcal-intelligence-panel .crewcal-checklist-pills {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 4px 12px !important;
}

.crewcal-intelligence-panel .crewcal-checklist-pills span {
  padding: 1px 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  font-size: 10px !important;
  font-weight: 750 !important;
  line-height: 1.25 !important;
}

body.theme-night .crewcal-intelligence-panel {
  border-color: rgba(148, 163, 184, 0.22) !important;
  background: rgba(15, 23, 42, 0.78) !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24) !important;
}

body.theme-night .crewcal-intelligence-panel .crewcal-alert-item,
body.theme-night .crewcal-intelligence-panel > .schedule-change-history-panel,
body.theme-night .crewcal-intelligence-panel > .crewcal-checklist-card {
  border-color: rgba(148, 163, 184, 0.18) !important;
}

body.theme-night .crewcal-intelligence-panel .crewcal-brief-card h2,
body.theme-night .crewcal-intelligence-panel .crewcal-alert-item b,
body.theme-night .crewcal-intelligence-panel .crewcal-checklist-card h2 {
  color: #f8fafc !important;
}

/* Apple-style month calendar: compact weekly lanes with real event spans. */
.selected-day-card[hidden] {
  display: none !important;
}

#calendar .soft-card {
  overflow: hidden;
}

#calendar .weekday-row {
  margin: 14px 0 2px;
  padding: 0 2px;
  color: #6b7280;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0;
}

#calendar .full-calendar {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
}

.calendar-week {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: 29px repeat(3, 38px) 17px;
  min-width: 0;
  padding: 2px 0 4px;
  border-bottom: 1px solid rgba(60, 60, 67, 0.11);
  isolation: isolate;
}

.calendar-week:last-child {
  border-bottom: 0;
}

.calendar-week-day {
  position: relative;
  z-index: 1;
  grid-column: var(--calendar-column);
  grid-row: 1 / -1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  padding: 4px 1px 0;
  border: 0;
  border-right: 1px solid rgba(60, 60, 67, 0.065);
  border-radius: 0;
  background: transparent;
  color: #111827;
  box-shadow: none;
}

.calendar-week-day:nth-of-type(7n) {
  border-right: 0;
}

.calendar-week-day span {
  display: grid;
  place-items: center;
  min-width: 21px;
  height: 21px;
  padding: 0 4px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
}

.calendar-week-day.is-outside {
  color: #b4bac4;
  background: rgba(248, 250, 252, 0.62);
}

.calendar-week-day.is-today span {
  background: #ff3b30;
  color: #fff;
}

.calendar-week-day.is-selected::after {
  position: absolute;
  inset: 1px;
  z-index: -1;
  border: 1.5px solid rgba(0, 122, 255, 0.78);
  border-radius: 10px;
  background: rgba(0, 122, 255, 0.045);
  content: "";
}

.calendar-event-bar {
  position: relative;
  z-index: 3;
  grid-column: var(--event-column-start) / var(--event-column-end);
  grid-row: calc(var(--event-lane) + 1);
  align-self: center;
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  height: 32px;
  margin: 2px 1px;
  padding: 3px 5px;
  overflow: hidden;
  border: 0;
  border-radius: 5px;
  background: #e8f2ff;
  color: #075dbd;
  box-shadow: none;
  text-align: left;
  white-space: nowrap;
}

.calendar-event-bar strong,
.calendar-event-bar small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-event-bar strong {
  order: 1;
  font-size: 10px;
  font-weight: 820;
  line-height: 1.05;
}

.calendar-event-bar small {
  order: 2;
  flex: 0 1 auto;
  font-size: 8px;
  font-weight: 720;
  line-height: 1;
  opacity: 0.9;
}

.calendar-event-bar.is-single-day {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: repeat(3, minmax(0, auto));
  align-content: center;
  gap: 1px;
  padding: 2px;
  text-align: center;
}

.calendar-event-bar.is-single-day strong {
  grid-row: 1;
  order: initial;
  font-size: 9px;
}

.calendar-event-bar.is-single-day small {
  order: initial;
  font-size: 7px;
  letter-spacing: 0;
}

.calendar-event-bar.is-single-day small:first-child {
  grid-row: 2;
}

.calendar-event-bar.is-single-day small:last-child {
  grid-row: 3;
}

.calendar-event-bar.continues-before {
  margin-left: 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.calendar-event-bar.continues-after {
  margin-right: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.calendar-event-bar.is-flight {
  background: #dcebff;
  color: #075dbd;
}

.calendar-event-bar.is-off {
  background: #dcf6df;
  color: #187b32;
}

.calendar-event-bar.is-reserve {
  background: #ffe3e2;
  color: #be2421;
}

.calendar-event-bar.is-oncall {
  background: #dff1f7;
  color: #0a5e78;
}

.calendar-event-bar.is-hotel {
  background: #fff0cf;
  color: #9a5b00;
}

.calendar-event-bar.is-sim {
  background: #eee6ff;
  color: #6538bd;
}

.calendar-event-bar.is-transport {
  background: #d8f4f1;
  color: #08756f;
}

.calendar-event-bar.is-other,
.calendar-event-bar.is-admin {
  background: #eceff3;
  color: #4b5563;
}

.calendar-event-overflow {
  position: relative;
  z-index: 4;
  grid-column: var(--calendar-column);
  grid-row: 5;
  align-self: center;
  justify-self: center;
  min-width: 0;
  min-height: 0;
  padding: 0 3px;
  border: 0;
  background: transparent;
  color: #6b7280;
  font-size: 9px;
  font-weight: 750;
  line-height: 1;
  box-shadow: none;
}

/* Day details open as a compact native-looking sheet instead of scrolling. */
#calendarDayDialog {
  width: min(100% - 22px, 430px);
  max-width: 430px;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
}

#calendarDayDialog::backdrop {
  background: rgba(15, 23, 42, 0.32);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}

#calendarDayDialog .calendar-day-sheet {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: 100%;
  max-height: min(82dvh, 720px);
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(60, 60, 67, 0.16);
  border-radius: 22px;
  background: rgba(248, 249, 252, 0.98);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.24);
}

.calendar-day-sheet-header {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 13px 14px 11px;
  border-bottom: 1px solid rgba(60, 60, 67, 0.11);
  background: rgba(255, 255, 255, 0.88);
}

.calendar-day-sheet-header > div {
  min-width: 0;
}

.calendar-day-sheet-header .muted-label {
  margin: 0 0 2px;
  font-size: 9px;
}

.calendar-day-sheet-header h2 {
  margin: 0;
  overflow: hidden;
  color: #111827;
  font-size: 17px;
  line-height: 1.15;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.calendar-day-close {
  position: static !important;
  display: grid;
  place-items: center;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: #e9edf3 !important;
  color: #111827 !important;
  font-size: 22px !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  box-shadow: none !important;
}

.calendar-day-add {
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: rgba(0, 122, 255, 0.1);
  color: #007aff;
  font-size: 12px;
  font-weight: 760;
  box-shadow: none;
  white-space: nowrap;
}

.calendar-day-timeline {
  padding: 10px 14px 9px;
  border-bottom: 1px solid rgba(60, 60, 67, 0.1);
  background: #fff;
}

.calendar-timeline-scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin: 0 0 5px 42px;
  color: #8b93a1;
  font-size: 8px;
  line-height: 1;
}

.calendar-timeline-scale span:last-child {
  text-align: right;
}

.calendar-timeline-rows {
  display: grid;
  gap: 5px;
}

.calendar-timeline-row {
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
}

.calendar-timeline-row strong {
  overflow: hidden;
  color: #475569;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-timeline-track {
  position: relative;
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: repeating-linear-gradient(90deg, #edf0f4 0, #edf0f4 calc(25% - 1px), #d7dce4 calc(25% - 1px), #d7dce4 25%);
}

.calendar-timeline-track i {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--timeline-left);
  width: var(--timeline-width);
  min-width: 4px;
  border-radius: 999px;
  background: #007aff;
}

.calendar-timeline-track i.is-off { background: #34c759; }
.calendar-timeline-track i.is-reserve { background: #ff3b30; }
.calendar-timeline-track i.is-oncall { background: #2386a4; }
.calendar-timeline-track i.is-hotel { background: #ff9f0a; }
.calendar-timeline-track i.is-sim { background: #7656d6; }
.calendar-timeline-track i.is-transport { background: #0aa7a0; }

.calendar-day-event-list {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 8px;
  min-height: 0;
  padding: 10px 12px 14px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
}

.calendar-day-event-list::-webkit-scrollbar {
  display: none;
}

.calendar-day-event {
  position: relative;
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr) auto;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
}

.calendar-day-event.is-focused {
  border-color: rgba(0, 122, 255, 0.55);
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.1);
}

.calendar-day-event-accent {
  background: #007aff;
}

.calendar-day-event.is-off .calendar-day-event-accent { background: #34c759; }
.calendar-day-event.is-reserve .calendar-day-event-accent { background: #ff3b30; }
.calendar-day-event.is-oncall .calendar-day-event-accent { background: #2386a4; }
.calendar-day-event.is-hotel .calendar-day-event-accent { background: #ff9f0a; }
.calendar-day-event.is-sim .calendar-day-event-accent { background: #7656d6; }
.calendar-day-event.is-transport .calendar-day-event-accent { background: #0aa7a0; }

.calendar-day-event-main {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 11px 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #111827;
  box-shadow: none;
  text-align: left;
}

.calendar-day-event-title {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.calendar-day-event-title strong {
  flex: 0 0 auto;
  color: #111827;
  font-size: 13px;
  font-weight: 820;
}

.calendar-day-event-title b {
  min-width: 0;
  overflow: hidden;
  color: #3f4856;
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-day-event-time {
  color: #007aff;
  font-size: 12px;
  font-weight: 760;
}

.calendar-day-event-location,
.calendar-day-event-main small {
  color: #6b7280;
  font-size: 10px;
  line-height: 1.3;
}

.calendar-day-event-content {
  min-width: 0;
}

.calendar-day-event-content .calendar-day-event-main {
  width: 100%;
}

.calendar-flight-crew-table {
  margin: 0 10px 10px;
  overflow: hidden;
  border-top: 1px solid var(--cc-line);
  border-bottom: 1px solid var(--cc-line);
}

.calendar-flight-crew-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  min-width: 0;
  padding: 7px 0;
}

.calendar-flight-crew-row + .calendar-flight-crew-row {
  border-top: 1px solid var(--cc-line);
}

.calendar-flight-crew-row > span {
  color: var(--cc-muted) !important;
  font-size: 9px;
  font-weight: 760;
  line-height: 1.25;
  text-transform: uppercase;
}

.calendar-flight-crew-row > strong {
  min-width: 0;
  color: var(--cc-ink) !important;
  font-size: 10.5px;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.calendar-flight-crew-row.is-function > strong,
.calendar-flight-crew-row.is-checks > strong {
  color: var(--cc-blue) !important;
  font-weight: 800;
}

body.theme-night .calendar-flight-crew-row.is-function > strong,
body.theme-night .calendar-flight-crew-row.is-checks > strong {
  color: var(--cc-blue-on-fill) !important;
}

@media (max-width: 360px) {
  .calendar-flight-crew-row {
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 6px;
  }
}

.calendar-day-event-actions {
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 6px 7px 6px 0;
}

.calendar-day-event-actions button {
  min-height: 27px;
  padding: 0 6px;
  border: 0;
  background: transparent;
  color: #007aff;
  font-size: 10px;
  font-weight: 740;
  box-shadow: none;
}

.calendar-day-event-actions .danger-text {
  color: #d93025;
}

.calendar-day-empty {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 28px 16px;
  border: 1px dashed rgba(60, 60, 67, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.65);
  color: #6b7280;
  text-align: center;
}

.calendar-day-empty strong {
  color: #111827;
  font-size: 15px;
}

.calendar-day-empty span {
  font-size: 11px;
}

.calendar-day-empty button {
  min-height: 32px;
  margin-top: 6px;
  padding: 0 11px;
  border: 0;
  border-radius: 10px;
  background: rgba(0, 122, 255, 0.1);
  color: #007aff;
  font-size: 11px;
  font-weight: 750;
  box-shadow: none;
}

.manual-event-end-date-field input {
  width: 100%;
}

body.theme-night #calendar .full-calendar,
body.theme-night #calendarDayDialog .calendar-day-sheet,
body.theme-night .calendar-day-event-list {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.96);
}

body.theme-night .calendar-week {
  border-color: rgba(148, 163, 184, 0.16);
}

body.theme-night .calendar-week-day {
  border-color: rgba(148, 163, 184, 0.1);
  color: #f8fafc;
}

body.theme-night .calendar-week-day.is-outside {
  color: #64748b;
  background: rgba(2, 6, 23, 0.3);
}

body.theme-night .calendar-day-sheet-header,
body.theme-night .calendar-day-timeline,
body.theme-night .calendar-day-event,
body.theme-night .calendar-day-empty {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(30, 41, 59, 0.95);
}

body.theme-night .calendar-day-sheet-header h2,
body.theme-night .calendar-day-event-title strong,
body.theme-night .calendar-day-event-main,
body.theme-night .calendar-day-empty strong {
  color: #f8fafc;
}

body.theme-night .calendar-day-event-title b,
body.theme-night .calendar-day-event-location,
body.theme-night .calendar-day-event-main small {
  color: #b8c2d1;
}

.documents-detail-card {
  padding-bottom: 18px !important;
}

.documents-detail-card .section-title {
  margin-bottom: 12px;
}

#documentsList {
  display: block !important;
  overflow: hidden;
  border: 1px solid rgba(60, 60, 67, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

#documentsList .document-list-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding: 10px 12px !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(60, 60, 67, 0.12) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#documentsList .document-list-row:last-child {
  border-bottom: 0 !important;
}

#documentsList .row-icon {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  border-radius: 12px !important;
}

#documentsList .row-icon svg {
  width: 21px;
  height: 21px;
}

#documentsList .row-main {
  min-width: 0;
}

#documentsList .row-main strong {
  display: block;
  overflow: hidden;
  color: #111827 !important;
  font-size: 14px;
  font-weight: 780 !important;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#documentsList .row-main span {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: #64748b !important;
  font-size: 12px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#documentsList .doc-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

#documentsList .badge {
  min-height: 24px;
  padding: 0 8px !important;
  font-size: 10px !important;
  line-height: 24px;
  white-space: nowrap;
}

#documentsList .doc-upload-btn {
  min-height: 28px;
  padding: 0 9px;
  border-radius: 9px;
  background: rgba(0, 122, 255, 0.1);
  color: #007aff;
  font-size: 11px;
  font-weight: 780;
  box-shadow: none;
}

body.theme-night #documentsList {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.7);
}

body.theme-night #documentsList .document-list-row {
  border-bottom-color: rgba(148, 163, 184, 0.14) !important;
}

body.theme-night #documentsList .row-main strong {
  color: #f8fafc !important;
}

body:not(.theme-night) #documentsList {
  background: rgba(255, 255, 255, 0.86) !important;
}

body:not(.theme-night) #documentsList .document-list-row {
  color: #111827 !important;
}

body:not(.theme-night) #documentsList .row-main strong {
  color: #111827 !important;
}

body:not(.theme-night) #documentsList .row-main span {
  color: #64748b !important;
}

body.theme-night #documentsList .row-main span {
  color: #d7e4f5 !important;
}

body.theme-night #documentsList .badge.warn {
  background: rgba(255, 149, 0, 0.2) !important;
  color: #ffd28a !important;
}

body.theme-night #documentsList .doc-upload-btn {
  background: rgba(10, 132, 255, 0.18) !important;
  color: #7cc0ff !important;
}

#manualEventDialog {
  width: min(372px, calc(100vw - 28px)) !important;
}

#manualEventDialog .manual-event-sheet {
  gap: 10px !important;
  max-height: min(78vh, 620px) !important;
  padding: 18px 16px 16px !important;
  color: #111827 !important;
  background: rgba(255, 255, 255, 0.98) !important;
}

#manualEventDialog .manual-event-sheet .muted-label {
  color: #7b8798 !important;
  font-size: 11px !important;
}

#manualEventDialog .manual-event-sheet h2 {
  color: #111827 !important;
  font-size: 24px !important;
  line-height: 1.02 !important;
  letter-spacing: 0 !important;
}

#manualEventDialog .manual-event-sheet .upload-helper {
  max-width: 29ch;
  color: #64748b !important;
  font-size: 12px !important;
  line-height: 1.25 !important;
}

#manualEventDialog .manual-event-sheet .field {
  gap: 6px !important;
  color: #5f6f85 !important;
  font-size: 11px !important;
  font-weight: 760 !important;
}

#manualEventDialog .manual-event-sheet input,
#manualEventDialog .manual-event-sheet select,
#manualEventDialog .manual-event-sheet textarea {
  min-height: 40px !important;
  border: 1px solid rgba(60, 60, 67, 0.16) !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  color: #111827 !important;
  font-size: 13px !important;
  box-shadow: none !important;
}

#manualEventDialog .manual-event-sheet textarea {
  min-height: 62px !important;
}

#manualEventDialog .manual-event-sheet input::placeholder,
#manualEventDialog .manual-event-sheet textarea::placeholder {
  color: #94a3b8 !important;
}

#manualEventDialog .manual-event-sheet .manual-time-grid {
  gap: 8px !important;
}

#manualEventDialog .manual-event-sheet .dialog-actions {
  gap: 7px !important;
  margin: 8px 0 0 !important;
}

#manualEventDialog .manual-event-sheet .dialog-actions button {
  min-height: 38px !important;
  padding: 0 9px !important;
  border-radius: 12px !important;
  font-size: 12px !important;
  font-weight: 760 !important;
}

body.theme-night #manualEventDialog .manual-event-sheet {
  color: #f8fafc !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
  background: rgba(15, 23, 42, 0.98) !important;
}

body.theme-night #manualEventDialog .manual-event-sheet h2 {
  color: #f8fafc !important;
}

body.theme-night #manualEventDialog .manual-event-sheet .upload-helper,
body.theme-night #manualEventDialog .manual-event-sheet .field {
  color: #c9d6e8 !important;
}

body.theme-night #manualEventDialog .manual-event-sheet input,
body.theme-night #manualEventDialog .manual-event-sheet select,
body.theme-night #manualEventDialog .manual-event-sheet textarea {
  border-color: rgba(148, 163, 184, 0.24) !important;
  background: rgba(2, 6, 23, 0.62) !important;
  color: #f8fafc !important;
}

#salaryTableCard {
  padding: 18px 16px 16px !important;
}

#salaryTableCard .section-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  margin-bottom: 12px;
}

#salaryTableCard .section-title .muted-label {
  margin-bottom: 4px;
  font-size: 11px !important;
  letter-spacing: 0.12em !important;
}

#salaryTableCard .section-title h2 {
  max-width: 240px;
  color: #12345d !important;
  font-size: 25px !important;
  line-height: 0.98 !important;
  letter-spacing: 0 !important;
}

#salaryTableCard .section-title .badge {
  min-height: 26px;
  padding: 0 10px !important;
  font-size: 11px !important;
  line-height: 26px;
}

#salaryTableCard .salary-table-wrap {
  max-height: 232px;
  overflow: auto;
  border: 1px solid rgba(60, 60, 67, 0.14) !important;
  border-radius: 16px !important;
  background: rgba(255, 255, 255, 0.74);
  -webkit-overflow-scrolling: touch;
}

#salaryTableCard .salary-table {
  min-width: 560px;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

#salaryTableCard .salary-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 9px 10px !important;
  background: rgba(242, 247, 255, 0.96) !important;
  font-size: 10px !important;
}

#salaryTableCard .salary-table td {
  padding: 9px 10px !important;
  font-size: 12px;
}

#salaryTableCard .salary-table th:first-child,
#salaryTableCard .salary-table td:first-child {
  min-width: 176px;
}

#salaryTableCard .salary-table tr.selected td {
  background: rgba(0, 122, 255, 0.1) !important;
}

body.theme-night #salaryTableCard .salary-table-wrap {
  border-color: rgba(60, 60, 67, 0.14) !important;
  background: rgba(255, 255, 255, 0.96) !important;
}

body.theme-night #salaryTableCard .salary-table th {
  background: rgba(242, 247, 255, 0.98) !important;
  color: #415f82 !important;
}

.calendar-export-card {
  padding: 18px 16px 16px !important;
}

.calendar-export-card .section-title {
  margin-bottom: 6px;
}

.calendar-export-card .section-title h2 {
  color: #12345d !important;
  font-size: 26px !important;
  line-height: 1.02 !important;
  letter-spacing: 0 !important;
}

.calendar-export-card .export-copy {
  max-width: 32ch;
  margin: 0;
  color: #5f7796 !important;
  font-size: 12px;
  line-height: 1.28;
}

.calendar-export-card .import-actions {
  gap: 8px;
  margin-top: 12px;
}

.calendar-export-card .import-actions button {
  min-height: 38px !important;
  padding: 0 10px !important;
  border-radius: 13px !important;
  font-size: 13px !important;
  font-weight: 780 !important;
  box-shadow: none !important;
}

.calendar-export-card .import-actions .print-export {
  min-height: 36px !important;
}

#quickUploadDialog .quick-upload-sheet {
  gap: 9px !important;
  padding: 20px 18px 18px !important;
}

#quickUploadDialog .quick-upload-sheet .muted-label {
  margin-bottom: 0;
  font-size: 12px !important;
}

#quickUploadDialog .quick-upload-sheet h2 {
  max-width: none;
  font-size: clamp(24px, 6vw, 28px) !important;
  line-height: 1.08 !important;
  letter-spacing: 0 !important;
  white-space: nowrap;
}

#quickUploadDialog .quick-upload-sheet .upload-helper {
  max-width: 26ch;
  margin: 0 0 4px !important;
  color: #5f7796 !important;
  font-size: 12px !important;
  line-height: 1.25 !important;
}

#quickUploadDialog .choice-list {
  display: block !important;
  overflow: hidden;
  border: 1px solid rgba(60, 60, 67, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88) !important;
}

#quickUploadDialog .choice {
  grid-template-columns: 36px minmax(0, 1fr) 12px !important;
  gap: 10px !important;
  min-height: 58px !important;
  padding: 9px 10px !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(60, 60, 67, 0.12) !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #111827 !important;
}

#quickUploadDialog .choice:last-child {
  border-bottom: 0 !important;
}

#quickUploadDialog .choice::after {
  color: #8aa4c2 !important;
  font-size: 20px;
}

#quickUploadDialog .choice-icon {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  border-radius: 11px !important;
}

#quickUploadDialog .choice-icon svg {
  width: 20px !important;
  height: 20px !important;
}

#quickUploadDialog .choice-copy strong {
  color: #12345d !important;
  font-size: 14px !important;
  line-height: 1.1;
}

#quickUploadDialog .choice-copy small {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: #5f7796 !important;
  font-size: 11px !important;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#quickUploadDialog .quick-upload-cancel {
  min-height: 38px !important;
  margin-top: 2px !important;
  border-radius: 13px !important;
  font-size: 13px !important;
}

body.theme-night #quickUploadDialog .choice-list {
  border-color: rgba(60, 60, 67, 0.14) !important;
  background: rgba(255, 255, 255, 0.9) !important;
}

body.theme-night #quickUploadDialog .choice {
  border-bottom-color: rgba(60, 60, 67, 0.12) !important;
  color: #111827 !important;
}

body.theme-night #quickUploadDialog .choice-copy strong {
  color: #12345d !important;
}

body.theme-night #quickUploadDialog .choice-copy small {
  color: #5f7796 !important;
}

body.theme-night #quickUploadDialog .choice::after {
  color: #8aa4c2 !important;
}

#uploadDialog .sheet {
  padding: 20px 18px 18px !important;
  background: #f8fbff !important;
  color: #0f1b31 !important;
}

#uploadDialog .sheet .muted-label {
  margin-bottom: 0;
  color: #6e7787 !important;
  font-size: 12px !important;
}

#uploadDialog .sheet h2 {
  max-width: 300px;
  margin-bottom: 8px !important;
  color: #0f1b31 !important;
  font-size: clamp(28px, 7.6vw, 34px) !important;
  line-height: 1 !important;
}

#uploadDialog .sheet .upload-helper {
  margin: 0 0 12px !important;
  color: #516173 !important;
  font-size: 13px !important;
  line-height: 1.28 !important;
}

#uploadDialog .upload-box {
  min-height: 88px;
  margin-bottom: 10px;
  padding: 14px 12px;
  gap: 3px;
  border: 1px solid rgba(60, 60, 67, 0.14);
  border-radius: 16px;
  background: #ffffff !important;
  color: #12345d !important;
}

#uploadDialog .upload-box strong {
  color: #12345d !important;
  font-size: 15px;
  line-height: 1.15;
}

#uploadDialog .upload-box small {
  color: #5f6f83 !important;
  font-size: 12px;
  line-height: 1.2;
}

#uploadDialog #closeUploadBtn {
  min-height: 40px;
  border-radius: 13px !important;
  font-size: 14px !important;
}

body.theme-night #uploadDialog .sheet {
  background: #f8fbff !important;
  color: #0f1b31 !important;
}

body.theme-night #uploadDialog .sheet h2,
body.theme-night #uploadDialog .upload-box strong {
  color: #12345d !important;
}

body.theme-night #uploadDialog .sheet .upload-helper,
body.theme-night #uploadDialog .upload-box small {
  color: #5f6f83 !important;
}

@media (max-width: 360px) {
  #calendar .soft-card {
    padding-inline: 9px !important;
  }

  #calendar .weekday-row {
    padding-inline: 0;
  }

  .calendar-week {
    grid-template-rows: 27px repeat(3, 36px) 16px;
  }

  .calendar-event-bar {
    height: 31px;
    padding-inline: 3px;
  }

  .calendar-event-bar strong {
    font-size: 8px;
  }

  .calendar-event-bar.is-single-day strong {
    font-size: 7px;
    letter-spacing: 0;
  }

  .calendar-event-bar small {
    font-size: 6.5px;
  }

  #calendarDayDialog {
    width: calc(100% - 14px);
  }

  .calendar-day-sheet-header {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 7px;
    padding-inline: 10px;
  }

  .calendar-day-sheet-header h2 {
    font-size: 15px;
  }

  .calendar-day-event {
    grid-template-columns: 4px minmax(0, 1fr);
  }

  .calendar-day-event-actions {
    grid-column: 2;
    display: flex;
    justify-content: flex-end;
    padding: 0 8px 6px;
  }

  #documentsList .document-list-row {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 8px;
    padding-inline: 10px !important;
  }

  #documentsList .row-icon {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
  }

  #documentsList .badge {
    max-width: 66px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #documentsList .doc-upload-btn {
    padding-inline: 8px;
  }

  #salaryTableCard {
    padding-inline: 14px !important;
  }

  #salaryTableCard .section-title h2 {
    max-width: 210px;
    font-size: 23px !important;
  }

  #salaryTableCard .salary-table-wrap {
    max-height: 210px;
  }

  #salaryTableCard .salary-table {
    min-width: 520px;
  }

  .calendar-export-card {
    padding-inline: 14px !important;
  }

  .calendar-export-card .section-title h2 {
    font-size: 24px !important;
  }

  .calendar-export-card .import-actions {
    gap: 7px;
  }

  .calendar-export-card .import-actions button {
    min-height: 36px !important;
    font-size: 12px !important;
    padding-inline: 8px !important;
  }

  #quickUploadDialog .quick-upload-sheet {
    padding-inline: 16px !important;
  }

  #quickUploadDialog .quick-upload-sheet h2 {
    max-width: none;
    font-size: 24px !important;
  }

  #quickUploadDialog .choice {
    min-height: 56px !important;
  }
}

/* Compact payroll overview. */
#payroll > .payroll-card {
  padding: 16px !important;
  border-radius: 20px !important;
}

#payroll > .payroll-card .payroll-card-header {
  gap: 8px;
}

#payrollCardEyebrow {
  margin: 0 !important;
  font-size: 11px !important;
  line-height: 1.15 !important;
}

#payrollStatusBadge {
  padding: 5px 8px !important;
  font-size: 9px !important;
  line-height: 1.1 !important;
}

#payrollTotal strong {
  margin-top: 5px !important;
  font-size: clamp(34px, 10vw, 42px) !important;
  line-height: 1 !important;
}

#payrollTotal span {
  display: block;
  max-width: 48ch;
  margin-top: 4px;
  color: #64748b !important;
  font-size: 12px !important;
  line-height: 1.28 !important;
}

#payrollBars {
  gap: 0 !important;
  margin-top: 10px !important;
}

#payrollBars > div {
  padding: 7px 0;
}

#payrollBars > div + div {
  border-top: 1px solid rgba(60, 60, 67, 0.12);
}

#payrollBars .pay-line {
  display: flex !important;
  align-items: baseline !important;
  justify-content: space-between !important;
  min-height: 0 !important;
  gap: 10px !important;
  padding: 0 !important;
  border: 0 !important;
}

#payrollBars .pay-line span {
  min-width: 0;
  color: #64748b !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
}

#payrollBars .pay-line strong {
  flex: 0 0 auto;
  color: #12345d !important;
  font-size: 13px !important;
  line-height: 1.15 !important;
}

#payrollBars .bar {
  height: 3px !important;
  margin-top: 5px;
  border-radius: 999px !important;
  background: #e7edf5 !important;
}

#payrollBars .bar span {
  border-radius: inherit;
}

@media (max-width: 360px) {
  #payroll > .payroll-card {
    padding: 14px !important;
  }

  #payrollTotal strong {
    font-size: 36px !important;
  }

  #payrollTotal span,
  #payrollBars .pay-line span {
    font-size: 11.5px !important;
  }
}

/* Payroll verification table. */
.payroll-verification-card {
  padding: 18px 16px 16px !important;
  background: #ffffff !important;
  color: #12345d !important;
}

.payroll-verification-card .section-title {
  align-items: center;
  margin-bottom: 10px !important;
}

.payroll-verification-card .section-title h2 {
  color: #12345d !important;
  font-size: 25px !important;
  line-height: 1 !important;
}

.payroll-verification-status {
  min-height: 26px;
  padding: 0 9px !important;
  font-size: 10px !important;
  line-height: 26px;
  white-space: nowrap;
}

.payroll-verification-status.is-ok,
#payrollChecks .payroll-check-row.is-ok .payroll-check-marker,
#payrollChecks .payroll-check-row.is-ok .payroll-check-status {
  background: #e8f7ed !important;
  color: #176b37 !important;
}

.payroll-verification-status.is-approx,
#payrollChecks .payroll-check-row.is-approx .payroll-check-marker,
#payrollChecks .payroll-check-row.is-approx .payroll-check-status {
  background: #fff4df !important;
  color: #925200 !important;
}

.payroll-verification-status.is-missing,
#payrollChecks .payroll-check-row.is-missing .payroll-check-marker,
#payrollChecks .payroll-check-row.is-missing .payroll-check-status {
  background: #fff0ef !important;
  color: #b42318 !important;
}

.payroll-checks-table {
  overflow: hidden;
  border: 1px solid rgba(60, 60, 67, 0.14);
  border-radius: 16px;
  background: #ffffff;
}

.payroll-checks-table-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 8px;
  padding: 8px 12px 8px 50px;
  border-bottom: 1px solid rgba(60, 60, 67, 0.12);
  background: #f2f7ff;
  color: #526b89;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.payroll-checks-table-head span:last-child {
  text-align: center;
}

#payrollChecks {
  display: block !important;
  gap: 0 !important;
}

#payrollChecks .payroll-check-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 58px;
  align-items: start;
  gap: 10px;
  min-height: 0;
  padding: 9px 12px;
  background: #ffffff;
}

#payrollChecks .payroll-check-row + .payroll-check-row {
  border-top: 1px solid rgba(60, 60, 67, 0.1);
}

#payrollChecks .payroll-check-marker {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

#payrollChecks .payroll-check-marker svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#payrollChecks .payroll-check-marker .row-icon-text {
  font-size: 9px;
  font-weight: 850;
}

#payrollChecks .payroll-check-copy {
  min-width: 0;
}

#payrollChecks .payroll-check-copy strong,
#payrollChecks .payroll-check-copy span {
  display: block;
}

#payrollChecks .payroll-check-copy strong {
  color: #12345d !important;
  font-size: 13px !important;
  font-weight: 760 !important;
  line-height: 1.18;
}

#payrollChecks .payroll-check-copy span {
  margin-top: 2px;
  color: #607590 !important;
  font-size: 11px !important;
  line-height: 1.28;
}

#payrollChecks .payroll-check-status {
  min-width: 54px;
  padding: 5px 6px;
  border-radius: 999px;
  font-size: 9px !important;
  font-weight: 850;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
}

body.theme-night .payroll-verification-card,
body.theme-night .payroll-checks-table,
body.theme-night #payrollChecks .payroll-check-row {
  background: #ffffff !important;
  color: #12345d !important;
}

body.theme-night .payroll-checks-table-head {
  border-color: rgba(60, 60, 67, 0.12) !important;
  background: #f2f7ff !important;
  color: #526b89 !important;
}

@media (max-width: 360px) {
  .payroll-verification-card {
    padding-inline: 14px !important;
  }

  .payroll-checks-table-head {
    grid-template-columns: minmax(0, 1fr) 52px;
    padding-left: 46px;
  }

  #payrollChecks .payroll-check-row {
    grid-template-columns: 26px minmax(0, 1fr) 52px;
    gap: 8px;
    padding-inline: 10px;
  }

  #payrollChecks .payroll-check-marker {
    width: 26px;
    height: 26px;
  }

  #payrollChecks .payroll-check-status {
    min-width: 50px;
  }
}

/* Compact 7P fiscal module. */
.sevenp-card {
  padding: 16px !important;
  border-radius: 20px !important;
  background: #ffffff !important;
  color: #12345d !important;
}

.sevenp-card .section-title {
  align-items: center;
  margin-bottom: 10px !important;
}

.sevenp-card .section-title .muted-label {
  margin-bottom: 3px;
  color: #607590 !important;
  font-size: 10px !important;
  line-height: 1.1;
}

.sevenp-card .section-title h2 {
  color: #12345d !important;
  font-size: 24px !important;
  line-height: 1 !important;
}

.sevenp-card .badge.warn {
  min-height: 26px;
  padding: 0 9px !important;
  background: #fff4df !important;
  color: #925200 !important;
  font-size: 9px !important;
  line-height: 26px;
}

.sevenp-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 !important;
  overflow: hidden;
  margin-bottom: 10px !important;
  border: 1px solid rgba(60, 60, 67, 0.14);
  border-radius: 14px;
  background: #ffffff;
}

.sevenp-summary article {
  min-height: 58px !important;
  padding: 8px 10px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #ffffff !important;
}

.sevenp-summary article:nth-child(even) {
  border-left: 1px solid rgba(60, 60, 67, 0.1) !important;
}

.sevenp-summary article:nth-child(n + 3) {
  border-top: 1px solid rgba(60, 60, 67, 0.1) !important;
}

.sevenp-summary strong {
  display: block;
  color: #12345d !important;
  font-size: 16px !important;
  line-height: 1.05;
}

.sevenp-summary span {
  display: block;
  margin-top: 3px;
  color: #607590 !important;
  font-size: 10.5px !important;
  font-weight: 720 !important;
  line-height: 1.18;
}

#sevenPChecks {
  display: block !important;
  gap: 0 !important;
  overflow: hidden;
  border: 1px solid rgba(60, 60, 67, 0.14);
  border-radius: 14px;
  background: #ffffff;
}

#sevenPChecks .list-row {
  display: grid !important;
  grid-template-columns: 28px minmax(0, 1fr) !important;
  align-items: start !important;
  gap: 10px !important;
  min-height: 0 !important;
  padding: 9px 10px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #ffffff !important;
  box-shadow: none !important;
}

#sevenPChecks .list-row + .list-row {
  border-top: 1px solid rgba(60, 60, 67, 0.1) !important;
}

#sevenPChecks .row-icon {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: #eef6ff !important;
  color: #1264b0 !important;
  box-shadow: none !important;
}

#sevenPChecks .row-icon::before {
  display: none !important;
}

#sevenPChecks .row-icon.off,
#sevenPChecks .row-icon.ok {
  background: #e8f7ed !important;
  color: #176b37 !important;
}

#sevenPChecks .row-icon.warn,
#sevenPChecks .row-icon.hotel {
  background: #fff4df !important;
  color: #925200 !important;
}

#sevenPChecks .row-icon.sim {
  background: #f0efff !important;
  color: #5145b5 !important;
}

#sevenPChecks .row-icon svg {
  width: 16px !important;
  height: 16px !important;
}

#sevenPChecks .row-icon-text {
  font-size: 9px;
  font-weight: 850;
}

#sevenPChecks .row-main strong {
  color: #12345d !important;
  font-size: 13px !important;
  font-weight: 760 !important;
  line-height: 1.18;
}

#sevenPChecks .row-main span {
  margin-top: 2px;
  color: #607590 !important;
  font-size: 11px !important;
  line-height: 1.28;
}

body.theme-night .sevenp-card,
body.theme-night .sevenp-summary,
body.theme-night .sevenp-summary article,
body.theme-night #sevenPChecks,
body.theme-night #sevenPChecks .list-row {
  background: #ffffff !important;
  color: #12345d !important;
}

@media (max-width: 360px) {
  .sevenp-card {
    padding: 14px !important;
  }

  .sevenp-summary article {
    padding-inline: 8px !important;
  }

  #sevenPChecks .list-row {
    grid-template-columns: 26px minmax(0, 1fr) !important;
    gap: 8px !important;
    padding-inline: 9px !important;
  }

  #sevenPChecks .row-icon {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
  }
}

/* Compact logbook export table. */
#logbookExportDialog {
  width: min(404px, calc(100vw - 28px));
}

#logbookExportDialog .logbook-export-sheet {
  display: grid;
  gap: 8px;
  max-height: min(86vh, 680px);
  overflow: hidden;
  padding: 18px;
  background: #fbfbfa !important;
  color: #12345d !important;
}

#logbookExportDialog .muted-label {
  margin-bottom: 0;
  color: #607590 !important;
  font-size: 11px !important;
}

#logbookExportDialog h2 {
  margin: 0;
  padding-right: 34px;
  color: #12345d !important;
  font-size: 24px !important;
  line-height: 1.08 !important;
  letter-spacing: 0 !important;
}

#logbookExportDialog .upload-helper {
  margin: 0 0 4px !important;
  color: #607590 !important;
  font-size: 11.5px !important;
  line-height: 1.25 !important;
}

#logbookExportDialog .logbook-export-options {
  display: block !important;
  max-height: min(58vh, 430px);
  overflow-y: auto;
  padding: 0 !important;
  border: 1px solid rgba(60, 60, 67, 0.14);
  border-radius: 14px;
  background: #ffffff !important;
}

#logbookExportDialog .logbook-export-options .list-row {
  display: grid !important;
  grid-template-columns: 28px minmax(0, 1fr) auto !important;
  grid-template-areas: "icon text button" !important;
  align-items: center !important;
  gap: 8px !important;
  min-height: 58px !important;
  padding: 8px 9px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #ffffff !important;
  box-shadow: none !important;
}

#logbookExportDialog .logbook-export-options .list-row + .list-row {
  border-top: 1px solid rgba(60, 60, 67, 0.1) !important;
}

#logbookExportDialog .logbook-export-options .row-icon {
  grid-area: icon;
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  border: 0 !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}

#logbookExportDialog .logbook-export-options .row-icon::before {
  display: none !important;
}

#logbookExportDialog .logbook-export-options .row-icon svg {
  width: 15px !important;
  height: 15px !important;
}

#logbookExportDialog .logbook-export-options .row-icon-text {
  font-size: 8px;
  font-weight: 850;
}

#logbookExportDialog .logbook-export-options .row-main {
  grid-area: text;
  min-width: 0;
}

#logbookExportDialog .logbook-export-options .row-main strong {
  color: #12345d !important;
  font-size: 13px !important;
  font-weight: 760 !important;
  line-height: 1.15;
  letter-spacing: 0 !important;
}

#logbookExportDialog .logbook-export-options .row-main span {
  display: block;
  margin-top: 2px;
  color: #607590 !important;
  font-size: 10.5px !important;
  line-height: 1.2;
}

#logbookExportDialog .logbook-export-options .row-action {
  position: static !important;
  grid-area: button;
  width: auto !important;
  min-width: 60px;
  min-height: 30px !important;
  margin: 0 !important;
  padding: 0 8px !important;
  transform: none !important;
  border: 1px solid #bfd8fb !important;
  border-radius: 9px !important;
  background: #eef6ff !important;
  color: #1264b0 !important;
  font-size: 10.5px !important;
  font-weight: 780 !important;
  white-space: nowrap;
  box-shadow: none !important;
}

body.theme-night #logbookExportDialog .logbook-export-sheet,
body.theme-night #logbookExportDialog .logbook-export-options,
body.theme-night #logbookExportDialog .logbook-export-options .list-row {
  background: #ffffff !important;
  color: #12345d !important;
}

@media (max-width: 360px) {
  #logbookExportDialog .logbook-export-sheet {
    padding: 16px;
  }

  #logbookExportDialog h2 {
    font-size: 22px !important;
  }

  #logbookExportDialog .logbook-export-options .list-row {
    grid-template-columns: 26px minmax(0, 1fr) auto !important;
    gap: 7px !important;
    min-height: 56px !important;
    padding-inline: 8px !important;
  }

  #logbookExportDialog .logbook-export-options .row-icon {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
  }

  #logbookExportDialog .logbook-export-options .row-action {
    min-width: 56px;
    padding-inline: 7px !important;
    font-size: 10px !important;
  }
}

/* Final semantic color pass: every light and dark surface uses the same tokens. */
body.theme-night .secondary,
body.theme-night .text-button,
body.theme-night .calendar-export-actions button,
body.theme-night .settings-row button,
body.theme-night .pill-button,
body.theme-night .dialog-actions button:not(.primary) {
  border-color: var(--cc-line) !important;
  background: var(--cc-card) !important;
  color: var(--cc-blue) !important;
}

body.theme-night .month-controls,
body.theme-night .calendar-view-toggle,
body.theme-night .dialog-close,
body.theme-night .pay-line .bar,
body.theme-night .pay-line > div:last-child,
body.theme-night .duty-bar-row .bar,
body.theme-night .year-payroll-bar {
  border-color: var(--cc-line) !important;
  background: var(--cc-fill) !important;
}

body.theme-night .calendar-view-toggle button.active,
body.theme-night .full-calendar,
body.theme-night .mini-calendar,
body.theme-night .calendar-day,
body.theme-night .day-cell,
body.theme-night .mini-day,
body.theme-night .calendar-status-card,
body.theme-night .payroll-card,
body.theme-night .logbook-world-card,
body.theme-night .logbook-table,
body.theme-night .salary-table,
body.theme-night dialog .sheet,
body.theme-night .choice,
body.theme-night .list-row,
body.theme-night .settings-row,
body.theme-night .document-row,
body.theme-night .flight-row,
body.theme-night .calendar-list-item,
body.theme-night .timeline-row,
body.theme-night .year-payroll-row,
body.theme-night .logbook-export-option {
  border-color: var(--cc-line) !important;
  background: var(--cc-card) !important;
  color: var(--cc-ink) !important;
}

body.theme-night .calendar-day.is-selected,
body.theme-night .calendar-day.selected,
body.theme-night .day-cell.active,
body.theme-night .day-cell.selected,
body.theme-night .mini-day.is-selected {
  background: var(--cc-selected) !important;
}

body.theme-night .logbook-world-card .local-world-map,
body.theme-night #logbookGlobe,
body.theme-night .row-icon,
body.theme-night .choice-icon,
body.theme-night .icon-action,
body.theme-night .settings-image-action,
body.theme-night .mcdu-scan-action,
body.theme-night .document-icon {
  border-color: var(--cc-line) !important;
  background: var(--cc-icon-bg) !important;
}

body.theme-night .screen-header h1,
body.theme-night .view:not(.first-run-view) > header h1,
body.theme-night .section-title h2,
body.theme-night .card h2,
body.theme-night dialog .sheet h2,
body.theme-night .list-row strong,
body.theme-night .settings-row strong,
body.theme-night .flight-row strong,
body.theme-night .calendar-list-item strong,
body.theme-night .pay-line strong,
body.theme-night .year-payroll-row strong,
body.theme-night label,
body.theme-night legend {
  color: var(--cc-ink) !important;
}

body.theme-night .muted-label,
body.theme-night .section-title p,
body.theme-night .upload-helper,
body.theme-night .settings-note,
body.theme-night .list-row span,
body.theme-night .list-row small,
body.theme-night .settings-row span,
body.theme-night .flight-row span,
body.theme-night .calendar-list-item span,
body.theme-night .pay-line span,
body.theme-night .year-payroll-row span,
body.theme-night .field > span,
body.theme-night .field small {
  color: var(--cc-muted) !important;
}

body.theme-night .logbook-table th,
body.theme-night .salary-table th {
  background: var(--cc-fill) !important;
  color: var(--cc-muted) !important;
}

body.theme-night .logbook-table td,
body.theme-night .salary-table td {
  border-color: var(--cc-line) !important;
  color: var(--cc-ink) !important;
}

body.theme-night #salaryTableCard .section-title h2,
body.theme-night #payrollBars .pay-line strong,
body.theme-night #payrollTotal strong {
  color: var(--cc-ink) !important;
}

body.theme-night #salaryTableCard .salary-table-wrap {
  border-color: var(--cc-line) !important;
  background: var(--cc-card) !important;
}

body.theme-night #salaryTableCard .salary-table th {
  background: var(--cc-fill) !important;
  color: var(--cc-muted) !important;
}

body.theme-night #salaryTableCard .salary-table tr.selected td {
  background: var(--cc-selected) !important;
}

body.theme-night .calendar-export-card .section-title h2 {
  color: var(--cc-ink) !important;
}

body.theme-night .calendar-export-card .export-copy,
body.theme-night #payrollTotal span,
body.theme-night #payrollBars .pay-line span {
  color: var(--cc-muted) !important;
}

body.theme-night #payrollBars .bar {
  background: var(--cc-fill-strong) !important;
}

body.theme-night #quickUploadDialog .quick-upload-sheet,
body.theme-night #quickUploadDialog .choice-list,
body.theme-night #quickUploadDialog .choice {
  border-color: var(--cc-line) !important;
  background: var(--cc-card) !important;
  color: var(--cc-ink) !important;
}

body.theme-night #quickUploadDialog .choice {
  border-bottom-color: var(--cc-line) !important;
  background: transparent !important;
}

body.theme-night #quickUploadDialog .choice-copy strong {
  color: var(--cc-ink) !important;
}

body.theme-night #quickUploadDialog .choice-copy small,
body.theme-night #quickUploadDialog .quick-upload-sheet .upload-helper {
  color: var(--cc-muted) !important;
}

body.theme-night #quickUploadDialog .choice::after {
  color: var(--cc-subtle) !important;
}

body.theme-night #uploadDialog .sheet,
body.theme-night #uploadDialog .upload-box {
  border-color: var(--cc-line) !important;
  background: var(--cc-card) !important;
  color: var(--cc-ink) !important;
}

body.theme-night #uploadDialog .upload-box {
  background: var(--cc-fill) !important;
}

body.theme-night #uploadDialog .sheet h2,
body.theme-night #uploadDialog .upload-box strong {
  color: var(--cc-ink) !important;
}

body.theme-night #uploadDialog .sheet .upload-helper,
body.theme-night #uploadDialog .upload-box small {
  color: var(--cc-muted) !important;
}

body.theme-night .payroll-verification-card,
body.theme-night .payroll-checks-table,
body.theme-night #payrollChecks .payroll-check-row,
body.theme-night .sevenp-card,
body.theme-night .sevenp-summary,
body.theme-night .sevenp-summary article,
body.theme-night #sevenPChecks,
body.theme-night #sevenPChecks .list-row {
  border-color: var(--cc-line) !important;
  background: var(--cc-card) !important;
  color: var(--cc-ink) !important;
}

body.theme-night .payroll-checks-table-head {
  border-color: var(--cc-line) !important;
  background: var(--cc-fill) !important;
  color: var(--cc-muted) !important;
}

body.theme-night .payroll-verification-card .section-title h2,
body.theme-night #payrollChecks .payroll-check-copy strong,
body.theme-night .sevenp-card .section-title h2,
body.theme-night .sevenp-summary strong,
body.theme-night #sevenPChecks .row-main strong {
  color: var(--cc-ink) !important;
}

body.theme-night #payrollChecks .payroll-check-copy span,
body.theme-night .sevenp-card .section-title .muted-label,
body.theme-night .sevenp-summary span,
body.theme-night #sevenPChecks .row-main span {
  color: var(--cc-muted) !important;
}

body.theme-night .payroll-verification-status.is-ok,
body.theme-night #payrollChecks .payroll-check-row.is-ok .payroll-check-marker,
body.theme-night #payrollChecks .payroll-check-row.is-ok .payroll-check-status,
body.theme-night #sevenPChecks .row-icon.off,
body.theme-night #sevenPChecks .row-icon.ok {
  background: rgba(48, 209, 88, 0.18) !important;
  color: var(--cc-ok-ink) !important;
}

body.theme-night .payroll-verification-status.is-approx,
body.theme-night #payrollChecks .payroll-check-row.is-approx .payroll-check-marker,
body.theme-night #payrollChecks .payroll-check-row.is-approx .payroll-check-status,
body.theme-night .sevenp-card .badge.warn,
body.theme-night #sevenPChecks .row-icon.warn,
body.theme-night #sevenPChecks .row-icon.hotel {
  background: rgba(255, 159, 10, 0.18) !important;
  color: var(--cc-warn-ink) !important;
}

body.theme-night .payroll-verification-status.is-missing,
body.theme-night #payrollChecks .payroll-check-row.is-missing .payroll-check-marker,
body.theme-night #payrollChecks .payroll-check-row.is-missing .payroll-check-status {
  background: rgba(255, 69, 58, 0.18) !important;
  color: var(--cc-error-ink) !important;
}

body.theme-night #logbookExportDialog .logbook-export-sheet,
body.theme-night #logbookExportDialog .logbook-export-options,
body.theme-night #logbookExportDialog .logbook-export-options .list-row {
  border-color: var(--cc-line) !important;
  background: var(--cc-card) !important;
  color: var(--cc-ink) !important;
}

body.theme-night #logbookExportDialog h2,
body.theme-night #logbookExportDialog .logbook-export-options .row-main strong {
  color: var(--cc-ink) !important;
}

body.theme-night #logbookExportDialog .muted-label,
body.theme-night #logbookExportDialog .upload-helper,
body.theme-night #logbookExportDialog .logbook-export-options .row-main span {
  color: var(--cc-muted) !important;
}

body.theme-night #logbookExportDialog .logbook-export-options .row-action {
  border-color: rgba(10, 132, 255, 0.34) !important;
  background: var(--cc-selected) !important;
  color: var(--cc-blue) !important;
}

body.theme-night #documentsList {
  border-color: var(--cc-line) !important;
  background: var(--cc-card) !important;
}

body.theme-night #documentsList .document-list-row {
  border-bottom-color: var(--cc-line) !important;
}

body.theme-night #documentsList .row-main strong {
  color: var(--cc-ink) !important;
}

body.theme-night #documentsList .row-main span {
  color: var(--cc-muted) !important;
}

body.theme-night .badge.ok,
body.theme-night .status-pill.ok,
body.theme-night .document-status.valid,
body.theme-night .document-status.ok,
body.theme-night .payroll-status-badge.real,
body.theme-night .payroll-status-badge.confirmed {
  background: rgba(48, 209, 88, 0.18) !important;
  color: var(--cc-ok-ink) !important;
}

body.theme-night .badge.warn,
body.theme-night .status-pill.warn,
body.theme-night .document-status.warning,
body.theme-night .payroll-status-badge.estimated,
body.theme-night .route-count {
  background: rgba(255, 159, 10, 0.18) !important;
  color: var(--cc-warn-ink) !important;
}

body.theme-night .badge.error,
body.theme-night .status-pill.error,
body.theme-night .document-status.expired {
  background: rgba(255, 69, 58, 0.18) !important;
  color: var(--cc-error-ink) !important;
}

/* Accessible action colors and the remaining custom dialog surfaces. */
.primary,
.start-button,
.button.primary,
.dialog-actions .primary,
.quick-upload-cancel,
.calendar-export-actions button:first-child,
.payroll-action,
.text-button.primary {
  background: var(--cc-primary) !important;
  color: #ffffff !important;
}

.calendar-day-add,
.schedule-review-summary,
.mcdu-result {
  background: var(--cc-selected) !important;
  color: var(--cc-blue-on-fill) !important;
}

.time-calculator-arrow,
#manualEventDialog .manual-event-sheet .muted-label,
#uploadDialog .sheet .muted-label {
  color: var(--cc-muted) !important;
}

#accountTypeDialog .muted-label,
#accountTypeDialog .upload-helper,
#crewRoleDialog .muted-label,
#crewRoleDialog .upload-helper,
#crewSyncDialog .muted-label,
#familyAccessDialog .muted-label,
#familyAccessDialog .upload-helper,
#familyAccessDialog .field {
  color: var(--cc-muted) !important;
}

#crewSyncDialog .sync-action-button--skip {
  border-color: var(--cc-line) !important;
  background: var(--cc-selected) !important;
  color: var(--cc-blue) !important;
  box-shadow: none !important;
}

body.theme-night dialog .dialog-close,
body.theme-night #accountTypeDialog .dialog-close,
body.theme-night #crewRoleDialog .dialog-close,
body.theme-night #crewSyncDialog .dialog-close,
body.theme-night #familyAccessDialog .dialog-close,
body.theme-night #calendarDayDialog .dialog-close {
  border-color: var(--cc-line) !important;
  background: var(--cc-fill) !important;
  color: var(--cc-ink) !important;
  box-shadow: none !important;
}

body.theme-night #accountTypeDialog .sheet,
body.theme-night #crewRoleDialog .sheet,
body.theme-night #crewSyncDialog .sheet,
body.theme-night #familyAccessDialog .sheet {
  border-color: var(--cc-line) !important;
  background: var(--cc-card) !important;
  color: var(--cc-ink) !important;
  box-shadow: var(--cc-shadow) !important;
}

body.theme-night #accountTypeDialog .sheet h2,
body.theme-night #crewRoleDialog .sheet h2,
body.theme-night #crewSyncDialog .sheet h2,
body.theme-night #familyAccessDialog .sheet h2 {
  color: var(--cc-ink) !important;
}

body.theme-night #accountTypeDialog .muted-label,
body.theme-night #accountTypeDialog .upload-helper,
body.theme-night #crewRoleDialog .muted-label,
body.theme-night #crewRoleDialog .upload-helper,
body.theme-night #crewSyncDialog .muted-label,
body.theme-night #familyAccessDialog .muted-label,
body.theme-night #familyAccessDialog .upload-helper,
body.theme-night #familyAccessDialog .field {
  color: var(--cc-muted) !important;
}

body.theme-night #accountTypeDialog .role-choice-card,
body.theme-night #crewRoleDialog .role-profile-button--tcp,
body.theme-night #crewSyncDialog .sync-note {
  border-color: var(--cc-line) !important;
  background: var(--cc-fill) !important;
  color: var(--cc-ink) !important;
  box-shadow: none !important;
}

body.theme-night #accountTypeDialog .role-choice-card .choice-copy strong {
  color: var(--cc-ink) !important;
}

body.theme-night #accountTypeDialog .role-choice-card .choice-copy small {
  color: var(--cc-muted) !important;
}

body.theme-night #accountTypeDialog .role-choice-card::after,
body.theme-night #crewRoleDialog .role-profile-button--tcp::after {
  background: linear-gradient(90deg, rgba(44, 44, 46, 0.98), rgba(44, 44, 46, 0.74), rgba(44, 44, 46, 0.2)) !important;
}

body.theme-night #crewRoleDialog .role-profile-button--tcp {
  color: var(--cc-blue-on-fill) !important;
}

body.theme-night #crewSyncDialog .sync-note strong {
  color: var(--cc-ink) !important;
}

body.theme-night #crewSyncDialog .sync-note p {
  color: var(--cc-muted) !important;
}

body.theme-night #crewSyncDialog .sync-action-button--skip {
  border-color: var(--cc-line) !important;
  background: var(--cc-fill) !important;
  color: var(--cc-blue-on-fill) !important;
  box-shadow: none !important;
}

body.theme-night #familyAccessDialog .field input {
  border-color: var(--cc-line) !important;
  background: var(--cc-fill) !important;
  color: var(--cc-ink) !important;
  box-shadow: none !important;
}

body.theme-night .account-email-panel,
body.theme-night .shared-access-create {
  border-color: var(--cc-line) !important;
  background: var(--cc-fill) !important;
  color: var(--cc-ink) !important;
}

body.theme-night .account-email-panel .field,
body.theme-night .shared-access-create .field {
  color: var(--cc-ink) !important;
}

body.theme-night .account-email-panel input,
body.theme-night .shared-access-create input {
  border-color: var(--cc-line) !important;
  background: var(--cc-card) !important;
  color: var(--cc-ink) !important;
}

body.theme-night .shared-access-create .field > span,
body.theme-night .shared-access-create > small,
body.theme-night .shared-access-heading span {
  color: var(--cc-muted) !important;
}

body.theme-night .shared-access-status {
  border-color: var(--cc-line) !important;
  color: var(--cc-muted) !important;
}

body.theme-night .shared-access-status[data-tone="success"] {
  color: #63d79f !important;
}

body.theme-night .shared-access-status[data-tone="error"] {
  color: #ff8a80 !important;
}

body.theme-night .account-provider,
body.theme-night .google-auth-button,
body.theme-night .apple-auth-button,
body.theme-night .email-auth-button {
  border-color: var(--cc-line) !important;
  background: var(--cc-fill) !important;
  color: var(--cc-ink) !important;
}

body.theme-night #mcduDialog .choice > strong {
  color: var(--cc-ink) !important;
}

body.theme-night #mcduDialog .choice > small {
  color: var(--cc-muted) !important;
}

body.theme-night #mcduDialog .mcdu-result {
  border-color: rgba(10, 132, 255, 0.3) !important;
  background: var(--cc-selected) !important;
  color: var(--cc-blue-on-fill) !important;
}

body.theme-night .schedule-review-meta article,
body.theme-night .schedule-change-card,
body.theme-night .schedule-change-card.is-hidden-update {
  border-color: var(--cc-line) !important;
  background: var(--cc-fill) !important;
  color: var(--cc-ink) !important;
}

body.theme-night .schedule-review-meta small,
body.theme-night .schedule-change-copy span,
body.theme-night .schedule-change-copy small {
  color: var(--cc-muted) !important;
}

body.theme-night .schedule-review-meta strong,
body.theme-night .schedule-change-date strong,
body.theme-night .schedule-change-copy b,
body.theme-night .schedule-change-copy em {
  color: var(--cc-ink) !important;
}

body.theme-night .schedule-review-summary {
  background: var(--cc-selected) !important;
  color: var(--cc-blue-on-fill) !important;
}

body.theme-night .schedule-review-decisions {
  border-color: var(--cc-line) !important;
  background: var(--cc-fill-strong) !important;
}

body.theme-night .schedule-review-decision {
  color: var(--cc-ink) !important;
}

body.theme-night .schedule-review-decision + .schedule-review-decision {
  border-left-color: var(--cc-line) !important;
}

body.theme-night .schedule-review-decision.is-keep.is-selected {
  background: rgba(148, 163, 184, 0.22) !important;
  color: var(--cc-ink) !important;
}

body.theme-night .schedule-review-decision.is-apply.is-selected {
  background: rgba(48, 209, 88, 0.20) !important;
  color: #72e894 !important;
}

/* Remove legacy light glass gradients when iOS is using dark appearance. */
body.theme-night .phone-shell > #calendar.view.active,
body.theme-night .phone-shell > #payroll.view.active,
body.theme-night .phone-shell > #documents.view.active,
body.theme-night .phone-shell > #logbook.view.active,
body.theme-night .phone-shell > #settings.view.active,
body.theme-night .phone-shell > #home.view.active,
body.theme-night .phone-shell > #onboarding.view.active {
  background: var(--cc-bg) !important;
  background-image: none !important;
}

body.theme-night .card,
body.theme-night .soft-card,
body.theme-night .selected-day-card,
body.theme-night .payroll-confidence-card,
body.theme-night .logbook-card,
body.theme-night .logbook-ledger-card,
body.theme-night .documents-hero,
body.theme-night .settings-section,
body.theme-night .calendar-status-card {
  border-color: var(--cc-line) !important;
  background: var(--cc-card) !important;
  background-image: none !important;
  color: var(--cc-ink) !important;
  box-shadow: var(--cc-shadow) !important;
}

body.theme-night .screen-header .icon-action.subtle-action.settings-image-action,
body.theme-night #logbook .mcdu-scan-action {
  border-color: var(--cc-line) !important;
  background: var(--cc-fill) !important;
  background-image: none !important;
  color: var(--cc-ink) !important;
  box-shadow: none !important;
}

body.theme-night .screen-header .settings-image-action .settings-icon-image,
body.theme-night .settings-image-action .settings-icon-image,
body.theme-night #logbook .mcdu-scan-action .mcdu-action-image {
  filter: brightness(0) invert(1) !important;
}

body.theme-night .bottom-nav {
  border-color: var(--cc-glass-border) !important;
  background: var(--cc-glass) !important;
  color: var(--cc-ink) !important;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.34) !important;
}

body.theme-night .bottom-nav a,
body.theme-night .bottom-nav button,
body.theme-night .bottom-nav .nav-upload {
  color: var(--cc-muted) !important;
}

body.theme-night .bottom-nav a.active,
body.theme-night .bottom-nav button.active,
body.theme-night .bottom-nav .nav-upload.active {
  color: var(--cc-blue) !important;
}

body.theme-night .logbook-year-dashboard,
body.theme-night .crewcal-trip-mini,
body.theme-night .logbook-table-wrap,
body.theme-night .duty-bar-row {
  border-color: var(--cc-line) !important;
  background: var(--cc-card) !important;
  color: var(--cc-ink) !important;
  box-shadow: none !important;
}

body.theme-night .logbook-dashboard-head {
  border-color: var(--cc-line) !important;
  background: var(--cc-fill) !important;
  color: var(--cc-muted) !important;
}

body.theme-night .logbook-dashboard-head strong,
body.theme-night .logbook-dashboard-table strong,
body.theme-night .crewcal-trip-mini strong,
body.theme-night .duty-bar-head strong {
  color: var(--cc-ink) !important;
}

body.theme-night .logbook-dashboard-table td,
body.theme-night .logbook-dashboard-table td + td {
  border-color: var(--cc-line) !important;
}

body.theme-night .logbook-dashboard-table span:not(.dashboard-glyph),
body.theme-night .crewcal-trip-mini span,
body.theme-night .duty-bar-head span {
  color: var(--cc-muted) !important;
}

body.theme-night .dashboard-glyph {
  border-color: rgba(10, 132, 255, 0.3) !important;
  background: var(--cc-icon-bg) !important;
  color: var(--cc-blue-on-fill) !important;
}

body.theme-night .crewcal-trip-mini em {
  background: var(--cc-selected) !important;
  color: var(--cc-blue-on-fill) !important;
}

body.theme-night .logbook-table tbody tr:nth-child(even),
body.theme-night .salary-table tbody tr:nth-child(even),
body.theme-night #salaryTableCard .salary-table tbody tr:nth-child(even) {
  background: var(--cc-fill) !important;
}

body.theme-night .logbook-table tfoot td {
  border-color: var(--cc-line) !important;
  background: var(--cc-fill) !important;
  color: var(--cc-ink) !important;
}

body.theme-night .duty-bar,
body.theme-night .duty-bar-row .duty-bar {
  background: var(--cc-fill-strong) !important;
}

body.theme-night .year-payroll-chart .year-empty {
  border-color: var(--cc-line) !important;
  background: var(--cc-fill) !important;
  color: var(--cc-ink) !important;
}

body.theme-night #sevenPChecks .row-icon {
  border-color: var(--cc-line) !important;
  background: var(--cc-icon-bg) !important;
  color: var(--cc-blue-on-fill) !important;
}

body.theme-night #sevenPChecks .row-icon.sim {
  background: rgba(94, 92, 230, 0.2) !important;
  color: #b9b8ff !important;
}

body.theme-night .switch span {
  background: var(--cc-fill-strong) !important;
}

body.theme-night .switch input:checked + span {
  background: var(--cc-primary) !important;
}

body.theme-night .danger-button {
  border-color: rgba(255, 69, 58, 0.28) !important;
  background: rgba(255, 69, 58, 0.16) !important;
  color: var(--cc-error-ink) !important;
}

body.theme-night .calendar-wheel-picker {
  border-color: var(--cc-line) !important;
  background: var(--cc-fill) !important;
}

body.theme-night .calendar-wheel-picker::before {
  background: linear-gradient(to bottom, var(--cc-fill) 8%, rgba(44, 44, 46, 0)) !important;
}

body.theme-night .calendar-wheel-picker::after {
  background: linear-gradient(to top, var(--cc-fill) 8%, rgba(44, 44, 46, 0)) !important;
}

body.theme-night .calendar-wheel-highlight {
  border-color: var(--cc-line) !important;
  background: var(--cc-fill-strong) !important;
  box-shadow: none !important;
}

body.theme-night .calendar-wheel-column > span,
body.theme-night .calendar-wheel-scroll button {
  color: var(--cc-muted) !important;
}

body.theme-night .calendar-wheel-scroll button.active {
  color: var(--cc-ink) !important;
}

body.theme-night .email-provider-card,
body.theme-night .email-import-note,
body.theme-night .email-import-preview span {
  border-color: var(--cc-line) !important;
  background: var(--cc-fill) !important;
  color: var(--cc-ink) !important;
}

body.theme-night .email-provider-card.selected {
  border-color: rgba(10, 132, 255, 0.42) !important;
  background: var(--cc-selected) !important;
}

body.theme-night .email-provider-card strong,
body.theme-night .email-import-note strong {
  color: var(--cc-ink) !important;
}

body.theme-night .email-provider-card small,
body.theme-night .email-import-note p {
  color: var(--cc-muted) !important;
}

body.theme-night .email-provider-mark {
  border-color: var(--cc-line) !important;
  background: var(--cc-card) !important;
}

body.theme-night .email-provider-mark.apple-mark {
  color: var(--cc-ink) !important;
}

body.theme-night .guide-visual,
body.theme-night .guide-visual.is-family,
body.theme-night .feature-tour-visual {
  border-color: var(--cc-line) !important;
  background: var(--cc-fill) !important;
  background-image: none !important;
}

body.theme-night .onboarding-guide-visual strong,
body.theme-night .feature-tour-visual strong {
  color: var(--cc-ink) !important;
}

body.theme-night .guide-visual::before {
  background: rgba(199, 199, 204, 0.22) !important;
  box-shadow: 0 42px 0 rgba(10, 132, 255, 0.22), 0 84px 0 rgba(199, 199, 204, 0.16) !important;
}

/* Persistent language and employment preferences. */
button,
a {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0, 100, 200, 0.12);
}

.language-segmented,
.employment-segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 2px;
  width: 132px;
  padding: 3px;
  border: 1px solid var(--cc-line);
  border-radius: 12px;
  background: var(--cc-fill);
}

.language-segmented button,
.employment-segmented button,
.settings-row .language-segmented button,
.settings-row .employment-segmented button {
  width: auto !important;
  min-width: 0 !important;
  min-height: 32px !important;
  padding: 0 8px !important;
  border: 0 !important;
  border-radius: 9px !important;
  background: transparent !important;
  color: var(--cc-muted) !important;
  font-size: 11px !important;
  font-weight: 780 !important;
  box-shadow: none !important;
}

.language-segmented button.selected,
.language-segmented button[aria-pressed="true"],
.employment-segmented button.selected,
.employment-segmented button[aria-pressed="true"] {
  background: var(--cc-card) !important;
  color: var(--cc-blue) !important;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1) !important;
}

.welcome-language {
  position: absolute !important;
  top: max(14px, env(safe-area-inset-top)) !important;
  right: 16px;
  z-index: 3 !important;
  width: 106px;
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(10, 20, 36, 0.44);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

.welcome-language button {
  color: rgba(255, 255, 255, 0.78) !important;
}

.welcome-language button.selected,
.welcome-language button[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.94) !important;
  color: #124b7f !important;
}

.settings-row:has(.language-segmented),
.settings-row:has(.employment-segmented) {
  grid-template-columns: minmax(0, 1fr) 132px !important;
}

.settings-row > .language-segmented,
.settings-row > .employment-segmented {
  justify-self: end;
}

#pilotEmploymentDialog {
  width: min(390px, calc(100vw - 28px));
}

#pilotEmploymentDialog .preference-sheet {
  display: grid;
  gap: 8px;
  padding: 20px 18px 18px !important;
  color: var(--cc-ink) !important;
  background: var(--cc-card) !important;
}

#pilotEmploymentDialog h2 {
  margin: 0 !important;
  color: var(--cc-ink) !important;
  font-size: 26px !important;
  line-height: 1.08 !important;
  letter-spacing: 0 !important;
}

#pilotEmploymentDialog .muted-label,
#pilotEmploymentDialog .upload-helper {
  color: var(--cc-muted) !important;
  font-size: 12px !important;
}

.preference-choice-list {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  border: 1px solid var(--cc-line);
  border-radius: 14px;
  background: var(--cc-card);
}

.preference-choice {
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 62px;
  padding: 11px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--cc-ink);
  text-align: left;
  box-shadow: none;
}

.preference-choice + .preference-choice {
  border-top: 1px solid var(--cc-line);
}

.preference-choice strong {
  color: var(--cc-ink) !important;
  font-size: 14px;
}

.preference-choice small {
  color: var(--cc-muted) !important;
  font-size: 11px;
  line-height: 1.25;
}

.preference-choice.selected,
.preference-choice[aria-checked="true"] {
  background: var(--cc-selected);
}

/* Compact payroll amount with explicit gross/net semantics. */
.payroll-amount-label,
.payroll-gross-notice {
  display: block;
  color: var(--cc-muted) !important;
  letter-spacing: 0 !important;
}

.payroll-amount-label {
  margin-top: 6px;
  color: var(--cc-blue) !important;
  font-size: 10px !important;
  font-weight: 820;
  text-transform: uppercase;
}

.payroll-gross-notice {
  max-width: 44ch;
  margin-top: 6px;
  font-size: 10.5px !important;
  line-height: 1.3;
}

/* Distinct rest-day tones: same semantic family, no duplicate color. */
.calendar-event-bar.is-off-lib {
  background: #d9f4df;
  color: #176b37;
}

.calendar-event-bar.is-off-lrs {
  background: #d9f3eb;
  color: #116558;
}

.calendar-event-bar.is-off-vac {
  background: repeating-linear-gradient(135deg, #d8f5df 0 6px, #bfe9cb 6px 12px);
  color: #145f2e;
}

.calendar-event-bar.is-off-ddd {
  background: repeating-linear-gradient(135deg, #edf3d2 0 6px, #dce8b5 6px 12px);
  color: #566810;
}

.calendar-day-event.is-off-lib .calendar-day-event-accent { background: #34c759; }
.calendar-day-event.is-off-lrs .calendar-day-event-accent { background: #20a98a; }
.calendar-day-event.is-off-vac .calendar-day-event-accent { background: #68c985; }
.calendar-day-event.is-off-ddd .calendar-day-event-accent { background: #8ca634; }

.row-icon.off-lib { background: #e8f7ed !important; color: #176b37 !important; }
.row-icon.off-lrs { background: #e4f6f1 !important; color: #116558 !important; }
.row-icon.off-vac { background: #e0f5e6 !important; color: #145f2e !important; }
.row-icon.off-ddd { background: #f1f5df !important; color: #566810 !important; }

body.theme-night .calendar-event-bar.is-off-lib {
  background: rgba(48, 209, 88, 0.2);
  color: #8cebab;
}

body.theme-night .calendar-event-bar.is-off-lrs {
  background: rgba(32, 201, 151, 0.2);
  color: #7fe3c6;
}

body.theme-night .calendar-event-bar.is-off-vac {
  background: repeating-linear-gradient(135deg, rgba(48, 209, 88, 0.24) 0 6px, rgba(48, 209, 88, 0.12) 6px 12px);
  color: #a0efb7;
}

body.theme-night .calendar-event-bar.is-off-ddd {
  background: repeating-linear-gradient(135deg, rgba(174, 197, 64, 0.25) 0 6px, rgba(174, 197, 64, 0.12) 6px 12px);
  color: #d7e98b;
}

/* Final navigation material: rounded, translucent, and readable in both appearances. */
.bottom-nav {
  width: min(calc(100% - 24px), 406px) !important;
  padding: 6px 7px !important;
  border: 1px solid rgba(255, 255, 255, 0.72) !important;
  border-radius: 23px !important;
  background: rgba(250, 250, 252, 0.76) !important;
  box-shadow: 0 10px 32px rgba(15, 23, 42, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.74) !important;
  backdrop-filter: blur(24px) saturate(1.3) !important;
  -webkit-backdrop-filter: blur(24px) saturate(1.3) !important;
}

.bottom-nav a,
.bottom-nav button {
  min-height: 54px !important;
  border-radius: 16px !important;
}

.bottom-nav .tab-label,
.bottom-nav small {
  color: inherit !important;
  font-size: 10.5px !important;
  line-height: 1 !important;
}

body:not(.theme-night) .bottom-nav a.active,
body:not(.theme-night) .bottom-nav button.active,
body:not(.theme-night) .bottom-nav .nav-upload.active {
  color: var(--cc-blue) !important;
}

body.theme-night .bottom-nav {
  border-color: rgba(255, 255, 255, 0.13) !important;
  background: rgba(28, 28, 30, 0.76) !important;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

body:not(.theme-night) input,
body:not(.theme-night) select,
body:not(.theme-night) textarea,
body:not(.theme-night) dialog .sheet,
body:not(.theme-night) dialog .sheet label {
  color: var(--cc-ink) !important;
}

body:not(.theme-night) input::placeholder,
body:not(.theme-night) textarea::placeholder {
  color: var(--cc-subtle) !important;
  opacity: 1;
}

body.theme-night #pilotEmploymentDialog .preference-sheet,
body.theme-night .preference-choice-list,
body.theme-night .preference-choice {
  border-color: var(--cc-line) !important;
  background: var(--cc-card) !important;
  color: var(--cc-ink) !important;
}

body.theme-night .preference-choice.selected,
body.theme-night .preference-choice[aria-checked="true"] {
  background: var(--cc-selected) !important;
}

@media (max-width: 360px) {
  .settings-row:has(.language-segmented),
  .settings-row:has(.employment-segmented) {
    grid-template-columns: minmax(0, 1fr) 118px !important;
  }

  .language-segmented,
  .employment-segmented {
    width: 118px;
  }

  .welcome-language {
    width: 98px;
  }
}

body.theme-night #mcduDialog .choice > span:not(.choice-copy),
body.theme-night #mcduDialog .mcdu-choice-icon {
  border-color: var(--cc-line) !important;
  background: var(--cc-icon-bg) !important;
  background-image: none !important;
  color: var(--cc-blue-on-fill) !important;
}

body.theme-night #quickUploadDialog .choice-icon,
body.theme-night #quickUploadDialog .choice[data-quick-upload] .choice-icon {
  border-color: var(--cc-line) !important;
  background: var(--cc-icon-bg) !important;
  color: var(--cc-blue-on-fill) !important;
}

#quickUploadDialog .quick-upload-sheet {
  width: 100% !important;
  max-width: 100% !important;
}

#quickUploadDialog .quick-upload-sheet > *,
#quickUploadDialog .choice-list,
#quickUploadDialog .quick-upload-cancel {
  min-width: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
}

#quickUploadDialog .choice {
  outline: 0 !important;
  box-shadow: none !important;
  background-image: none !important;
}

#quickUploadDialog .choice + .choice {
  border-top: 0 !important;
}

#quickUploadDialog .choice:focus-visible {
  box-shadow: inset 3px 0 0 var(--cc-blue) !important;
}

#quickUploadDialog .choice.is-suggested {
  background: var(--cc-selected) !important;
}

#quickUploadDialog .choice[data-quick-upload="document"] .choice-icon {
  background: rgba(88, 86, 214, 0.1) !important;
  color: #4f46c7 !important;
}

@media (max-width: 360px) {
  #quickUploadDialog .quick-upload-sheet h2 {
    font-size: 18px !important;
    line-height: 1.1 !important;
  }
}

/* Keep logbook export rows in one compact, predictable table. */
#logbookExportDialog {
  width: min(380px, calc(100vw - 28px)) !important;
}

#logbookExportDialog .logbook-export-sheet {
  width: 100% !important;
  gap: 6px !important;
  padding: 16px !important;
}

#logbookExportDialog .logbook-export-sheet h2 {
  margin-bottom: 8px !important;
  font-size: 22px !important;
}

#logbookExportDialog .logbook-export-status {
  margin: 0 0 6px !important;
  padding: 8px 10px !important;
  border: 1px solid var(--cc-line) !important;
  border-radius: 6px !important;
  background: var(--cc-fill) !important;
  color: var(--cc-muted) !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  line-height: 1.35 !important;
}

#logbookExportDialog .logbook-export-status[data-tone="warning"] {
  color: var(--cc-warn-ink) !important;
}

#logbookExportDialog .logbook-export-status[data-tone="error"] {
  color: var(--cc-error-ink) !important;
}

#logbookExportDialog .logbook-export-row {
  display: grid !important;
  grid-template-columns: 30px minmax(0, 1fr) 22px !important;
  grid-template-areas: "icon text action" !important;
  align-items: center !important;
  gap: 9px !important;
  min-height: 54px !important;
  padding: 8px 10px !important;
}

#logbookExportDialog .logbook-export-row .row-icon {
  grid-area: icon !important;
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
}

#logbookExportDialog .logbook-export-row .row-main {
  grid-area: text !important;
  min-width: 0 !important;
}

#logbookExportDialog .logbook-export-row .row-main strong {
  font-size: 13px !important;
}

#logbookExportDialog .logbook-export-row .row-main small {
  font-size: 10.5px !important;
}

#logbookExportDialog .logbook-export-row-action {
  grid-area: action !important;
  justify-self: end !important;
  width: auto !important;
  min-width: 0 !important;
  font-size: 17px !important;
  line-height: 1 !important;
}

#logbookExportDialog .logbook-export-row[data-export-type="mcdu"] {
  grid-template-columns: 30px minmax(0, 1fr) auto !important;
}

#logbookExportDialog .logbook-export-row[data-export-type="mcdu"] .logbook-export-row-action {
  padding: 5px 7px !important;
  border: 1px solid var(--cc-line) !important;
  border-radius: 8px !important;
  background: var(--cc-selected) !important;
  color: var(--cc-blue) !important;
  font-size: 9.5px !important;
}

body.theme-night #logbookExportDialog .row-icon.off .row-icon-text {
  color: #8cebab !important;
}

body.theme-night #logbookExportDialog .row-icon.flight .row-icon-text {
  color: #76bcff !important;
}

body.theme-night #logbookExportDialog .row-icon.hotel .row-icon-text {
  color: #ffd08a !important;
}

body.theme-night #logbookExportDialog .row-icon.sim .row-icon-text {
  color: #c5c4ff !important;
}

body:not(.theme-night) #logbookExportDialog .row-icon.hotel .row-icon-text {
  color: #8a4b00 !important;
}

body:not(.theme-night) .calendar-week-day.is-outside {
  color: #626c7a !important;
}

.calendar-week-day.is-today span {
  background: #c9342b !important;
  color: #ffffff !important;
}

body:not(.theme-night) .calendar-day-empty button,
body:not(.theme-night) .calendar-day-add {
  color: var(--cc-blue) !important;
}

body.theme-night .calendar-week-day.is-outside {
  color: #a5afbd !important;
}

body.theme-night .weekday-row {
  color: #aeb7c5 !important;
}

body.theme-night #logbookExportDialog .logbook-export-row-action,
body.theme-night #logbookExportDialog .logbook-export-row[data-export-type="mcdu"] .logbook-export-row-action {
  color: var(--cc-blue-on-fill) !important;
}

/* Final contrast pass for labels rendered by the calendar, logbook and payroll views. */
body.theme-night .calendar-view-toggle button {
  color: var(--cc-muted) !important;
}

body.theme-night .calendar-view-toggle button.active {
  color: var(--cc-blue) !important;
}

body.theme-night .crewcal-checklist-pills span.ok {
  color: var(--cc-ok-ink) !important;
}

body.theme-night .crewcal-checklist-pills span.pending {
  color: var(--cc-warn-ink) !important;
}

body.theme-night #logbook .time-calculator-action span,
body.theme-night #logbook .logbook-export-summary strong {
  color: var(--cc-ink) !important;
}

body.theme-night #logbookLedgerCount,
body.theme-night #logbook .duty-note,
body.theme-night #logbook .logbook-export-summary span {
  color: var(--cc-muted) !important;
}

body.theme-night #payrollCardEyebrow {
  color: var(--cc-blue) !important;
}

body.theme-night #payrollSourceCopy,
body.theme-night #yearPayrollTotal span,
body.theme-night .year-payroll-chart .year-empty small {
  color: var(--cc-muted) !important;
}

body.theme-night .time-calculator-result {
  border-color: rgba(10, 132, 255, 0.3) !important;
  background: var(--cc-selected) !important;
  background-image: none !important;
}

body.theme-night .time-calculator-result-label {
  color: var(--cc-muted) !important;
}

/* Light appearance also uses semantic ink; legacy glass rules must not leave pale text behind. */
body:not(.theme-night) .screen-header .muted-label,
body:not(.theme-night) .home-header .muted-label,
body:not(.theme-night) .onboarding-hero .muted-label,
body:not(.theme-night) #payrollScreenEyebrow {
  color: var(--cc-muted) !important;
}

body:not(.theme-night) .calendar-view-toggle button,
body:not(.theme-night) .calendar-export-card .export-copy,
body:not(.theme-night) .logbook-dashboard-head span {
  color: var(--cc-muted) !important;
}

body:not(.theme-night) #documentsList .doc-upload-btn,
body:not(.theme-night) #logbookRouteCount {
  border-color: rgba(0, 100, 200, 0.18) !important;
  background: var(--cc-selected) !important;
  color: var(--cc-blue) !important;
}

body:not(.theme-night) #payrollCardEyebrow {
  color: var(--cc-blue) !important;
}

body:not(.theme-night) .payroll-confidence-card {
  border: 1px solid var(--cc-line) !important;
  background: var(--cc-card) !important;
  background-image: none !important;
  color: var(--cc-ink) !important;
  box-shadow: var(--cc-shadow) !important;
}

body:not(.theme-night) .payroll-confidence-card h2,
body:not(.theme-night) .payroll-confidence-card strong {
  color: var(--cc-ink) !important;
}

body:not(.theme-night) .payroll-confidence-card .muted-label,
body:not(.theme-night) .payroll-confidence-card span,
body:not(.theme-night) .payroll-confidence-card small {
  color: var(--cc-muted) !important;
}

body:not(.theme-night) .payroll-confidence-grid span {
  border-color: var(--cc-line) !important;
  background: var(--cc-fill) !important;
}

body.theme-night #onboarding .onboarding-route-card strong {
  color: var(--cc-ink) !important;
}

body.theme-night #onboarding .onboarding-route-card small {
  color: var(--cc-muted) !important;
}

body.theme-night #onboarding .route-pill {
  border: 1px solid var(--cc-line) !important;
  background: var(--cc-fill) !important;
  color: var(--cc-muted) !important;
  box-shadow: none !important;
}

body.theme-night #onboarding .privacy-note {
  border-color: var(--cc-line) !important;
  background: var(--cc-fill-strong) !important;
  background-image: none !important;
  box-shadow: none !important;
}

body.theme-night #onboarding .privacy-note span {
  border: 1px solid var(--cc-line) !important;
  background: var(--cc-card) !important;
  color: var(--cc-ink) !important;
  box-shadow: none !important;
}

body:not(.theme-night) #onboarding .onboarding-hero p:not(.muted-label),
body:not(.theme-night) #onboarding .onboarding-cta p {
  color: var(--cc-muted) !important;
}

#crewSyncDialog #crewSyncLoginBtn {
  background: var(--cc-primary) !important;
  background-image: none !important;
  color: #ffffff !important;
}

/* Pilot/TCP hybrid selector: compact segmented control inside one list surface. */
#crewRoleDialog .role-profile-actions {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 0 !important;
  overflow: hidden;
  margin-top: 10px !important;
  border: 1px solid var(--cc-line) !important;
  border-radius: 16px !important;
  background: var(--cc-card) !important;
  box-shadow: none !important;
}

#crewRoleDialog .role-profile-actions .role-profile-button {
  min-width: 0 !important;
  min-height: 54px !important;
  padding: 0 14px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-image: none !important;
  color: var(--cc-blue) !important;
  box-shadow: none !important;
  font-size: 16px !important;
  font-weight: 750 !important;
  line-height: 1 !important;
}

#crewRoleDialog .role-profile-actions .role-profile-button + .role-profile-button {
  border-left: 1px solid var(--cc-line) !important;
}

#crewRoleDialog .role-profile-actions .role-profile-button::before,
#crewRoleDialog .role-profile-actions .role-profile-button::after {
  content: none !important;
  background: none !important;
  background-image: none !important;
}

#crewRoleDialog .role-profile-actions .role-profile-button:active {
  background: var(--cc-selected) !important;
}

#crewRoleDialog .role-profile-actions .role-profile-button span {
  color: inherit !important;
}

body.theme-night #crewRoleDialog .role-profile-actions {
  border-color: var(--cc-line) !important;
  background: var(--cc-fill) !important;
}

body.theme-night #crewRoleDialog .role-profile-actions .role-profile-button {
  background: transparent !important;
  color: var(--cc-blue-on-fill) !important;
}

/* UTC timing and dialog stability. */
.calendar-day-sheet {
  width: min(calc(100vw - 24px), 560px) !important;
  max-height: min(88dvh, 760px) !important;
  overflow: hidden !important;
}

#calendarDayEventList {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.calendar-day-event-local-note {
  display: block;
  color: var(--cc-muted) !important;
  font-size: 12px;
  line-height: 1.25;
}

dialog input,
dialog select,
dialog textarea {
  font-size: 16px !important;
}

.logbook-completion-sheet {
  width: min(calc(100vw - 24px), 680px) !important;
  max-height: min(90dvh, 780px) !important;
  overflow-y: auto;
}

.logbook-z-time-fieldset {
  min-width: 0;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--cc-line);
  border-radius: 12px;
}

.logbook-z-time-fieldset legend {
  padding: 0 6px;
  color: var(--cc-ink);
  font-size: 13px;
  font-weight: 800;
}

.logbook-z-time-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(76px, 1fr));
  gap: 8px;
}

.logbook-z-time-grid .field {
  min-width: 0;
  font-size: 12px;
}

.logbook-z-time-grid input {
  width: 100%;
  min-width: 0;
}

.field-error {
  margin: 8px 0 0;
  color: var(--cc-danger-ink, #b42318) !important;
  font-size: 13px;
  font-weight: 700;
}

.duty-bar > span.is-ok {
  background: var(--cc-ok, #16a34a) !important;
}

.duty-bar > span.is-warning {
  background: var(--cc-warn, #d97706) !important;
}

.duty-bar > span.is-danger {
  background: var(--cc-danger, #dc2626) !important;
}

.duty-bar > span.is-neutral {
  background: var(--cc-muted) !important;
}

@media (max-width: 720px) {
  .logbook-completion-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .logbook-z-time-grid {
    grid-template-columns: repeat(2, minmax(76px, 1fr));
  }
}

/* Document wallet: one sober surface with line-separated credentials. */
#documentsList {
  border-radius: 8px !important;
  background: var(--cc-card) !important;
}

#documentsList .document-category-row {
  border-bottom: 1px solid var(--cc-line);
  background: transparent;
}

#documentsList .document-category-row:last-child {
  border-bottom: 0;
}

#documentsList .document-category-main {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 62px;
  padding: 9px 10px;
}

#documentsList .document-category-main .row-icon {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  border-radius: 8px !important;
}

#documentsList .document-category-main .row-main {
  min-width: 0;
}

#documentsList .document-category-main .row-main strong,
#documentsList .document-credential-copy strong {
  display: block;
  overflow: hidden;
  color: var(--cc-ink) !important;
  font-size: 13px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#documentsList .document-category-main .row-main span,
#documentsList .document-credential-copy span {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--cc-muted) !important;
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#documentsList .document-category-row.is-not-applicable {
  background: var(--cc-fill);
}

#documentsList .document-category-row.is-not-applicable .row-icon {
  border-color: var(--cc-line) !important;
  background: var(--cc-card) !important;
  color: var(--cc-subtle) !important;
}

#documentsList .document-category-row.is-not-applicable .row-main strong {
  color: var(--cc-muted) !important;
}

body:not(.theme-night) #documentsList .document-category-row.is-not-applicable .row-main span {
  color: #526176 !important;
}

#documentsList .doc-actions,
#documentsList .document-credential-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
}

#documentsList .doc-upload-btn,
#documentsList .document-add-btn,
#documentsList .document-open-btn,
#documentsList .document-edit-btn,
#documentsList .privilege-state-btn {
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, var(--cc-blue) 18%, transparent);
  border-radius: 7px;
  background: var(--cc-selected) !important;
  color: var(--cc-blue) !important;
  font-size: 10px;
  font-weight: 750;
  line-height: 1;
  box-shadow: none !important;
  white-space: nowrap;
}

#documentsList .document-add-btn {
  width: 30px;
  padding: 0;
  font-size: 17px;
}

#documentsList .privilege-state-btn {
  border-color: var(--cc-line);
  background: var(--cc-card) !important;
  color: var(--cc-ink) !important;
}

#documentsList .privilege-state-btn.is-off {
  color: var(--cc-muted) !important;
}

#documentsList .document-open-btn:disabled {
  border-color: var(--cc-line);
  background: transparent !important;
  color: var(--cc-subtle) !important;
  opacity: 1;
}

#documentsList .document-credential-list {
  border-top: 1px solid var(--cc-line);
  background: var(--cc-fill);
}

#documentsList .document-credential-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px 8px 55px;
  border-bottom: 1px solid var(--cc-line);
}

#documentsList .document-credential-row:last-child {
  border-bottom: 0;
}

#documentsList .document-credential-copy {
  min-width: 0;
}

#documentEditorDialog {
  width: min(380px, calc(100vw - 24px));
}

#documentEditorDialog .document-editor-sheet {
  width: 100%;
  gap: 8px;
  padding: 18px 16px 16px;
  background: var(--cc-card) !important;
  color: var(--cc-ink) !important;
}

#documentEditorDialog .document-editor-sheet h2 {
  margin: 0;
  color: var(--cc-ink) !important;
  font-size: 22px !important;
  line-height: 1.1;
}

#documentEditorDialog .document-editor-sheet .upload-helper {
  margin: 0 0 4px;
  color: var(--cc-muted) !important;
  font-size: 12px;
  line-height: 1.35;
}

#documentEditorDialog .document-editor-table {
  overflow: hidden;
  border: 1px solid var(--cc-line);
  border-radius: 8px;
  background: var(--cc-card);
}

#documentEditorDialog .document-editor-row {
  display: grid;
  grid-template-columns: minmax(105px, 0.9fr) minmax(0, 1.25fr);
  align-items: center;
  min-width: 0;
  min-height: 48px;
  padding: 0 10px;
  border-bottom: 1px solid var(--cc-line);
  color: var(--cc-muted) !important;
  font-size: 12px;
  font-weight: 650;
}

#documentEditorDialog .document-editor-row:last-child {
  border-bottom: 0;
}

#documentEditorDialog .document-editor-row[hidden] {
  display: none;
}

#documentEditorDialog .document-editor-row input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 0;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--cc-ink) !important;
  font-size: 16px;
  text-align: right;
  box-shadow: none !important;
}

#documentEditorDialog .document-restore-detected {
  align-self: flex-start;
  min-height: 32px;
  padding: 0;
  color: var(--cc-blue) !important;
  font-size: 11px;
}

@media (max-width: 390px) {
  #documentsList .document-category-main {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  #documentsList .document-category-main .row-icon {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
  }

  #documentsList .document-category-main .doc-actions {
    grid-column: 2;
    justify-content: flex-start;
  }

  #documentsList .document-credential-row {
    grid-template-columns: minmax(0, 1fr);
    padding-left: 51px;
  }

  #documentsList .document-credential-actions {
    justify-content: flex-start;
  }
}

/* Documents: one compact table surface with source-backed preview actions. */
.documents-detail-card {
  padding: 18px 16px 16px !important;
}

.documents-detail-card .section-title {
  margin-bottom: 8px;
}

.documents-detail-card .section-title h2 {
  font-size: 23px !important;
  line-height: 1.12;
}

#documentsList {
  overflow: hidden;
  border: 1px solid var(--cc-line) !important;
  border-radius: 8px !important;
  background: var(--cc-card) !important;
  box-shadow: none !important;
}

#documentsList .document-category-row {
  border-bottom: 1px solid var(--cc-line);
  background: transparent !important;
}

#documentsList .document-category-row:last-child {
  border-bottom: 0;
}

#documentsList .document-category-main {
  display: grid;
  grid-template-columns: 34px minmax(72px, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 56px;
  padding: 8px 9px;
}

#documentsList .document-category-main .row-icon {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  border: 1px solid var(--cc-line) !important;
  border-radius: 7px !important;
  background: var(--cc-icon-bg) !important;
  color: var(--cc-blue) !important;
}

#documentsList .document-category-main .row-main {
  min-width: 0;
}

#documentsList .document-category-main .row-main strong {
  color: var(--cc-ink) !important;
  font-size: 13px;
  font-weight: 780;
  line-height: 1.18;
}

#documentsList .document-category-main .row-main span {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--cc-muted) !important;
  font-size: 10.5px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#documentsList .doc-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
}

#documentsList .doc-actions .badge {
  min-height: 26px;
  padding: 0 7px;
  font-size: 9px;
  line-height: 26px;
  white-space: nowrap;
}

#documentsList .doc-upload-btn,
#documentsList .document-add-btn,
#documentsList .document-preview-btn,
#documentsList .document-edit-btn,
#documentsList .privilege-state-btn {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  min-height: 30px;
  margin: 0;
  padding: 0 7px;
  border: 1px solid var(--cc-line) !important;
  border-radius: 7px !important;
  background: var(--cc-card) !important;
  color: var(--cc-blue) !important;
  font-size: 10px;
  font-weight: 760;
  line-height: 1;
  box-shadow: none !important;
}

#documentsList .doc-upload-btn,
#documentsList .document-add-btn,
#documentsList .document-preview-btn {
  width: 30px;
  padding: 0;
}

#documentsList .doc-upload-btn svg,
#documentsList .document-preview-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

#documentsList .document-add-btn {
  font-size: 18px;
  font-weight: 500;
}

#documentsList .document-preview-btn:disabled {
  color: var(--cc-subtle) !important;
  cursor: default;
  opacity: 0.62;
}

#documentsList .privilege-state-btn.is-off {
  color: var(--cc-muted) !important;
}

#documentsList .document-data-list {
  border-top: 1px solid var(--cc-line);
  background: color-mix(in srgb, var(--cc-fill) 58%, var(--cc-card));
}

#documentsList .document-data-row,
#documentsList .document-source-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 43px;
  margin-left: 51px;
  padding: 6px 9px 6px 0;
  border-bottom: 1px solid var(--cc-line);
}

#documentsList .document-data-list > :last-child {
  border-bottom: 0;
}

#documentsList .document-source-row {
  min-height: 34px;
  color: var(--cc-muted) !important;
  font-size: 10px;
  font-weight: 760;
  text-transform: uppercase;
}

#documentsList .document-source-row .document-preview-btn {
  min-width: 28px;
  min-height: 28px;
  width: 28px;
}

#documentsList .document-data-copy {
  min-width: 0;
}

#documentsList .document-data-copy strong {
  display: block;
  overflow: hidden;
  color: var(--cc-ink) !important;
  font-size: 12px;
  font-weight: 720;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#documentsList .document-data-copy span {
  display: block;
  overflow: hidden;
  margin-top: 1px;
  color: var(--cc-muted) !important;
  font-size: 10px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#documentsList .document-data-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

#documentsList .document-line-expiry {
  color: var(--cc-muted) !important;
  font-size: 10px;
  font-weight: 720;
  white-space: nowrap;
}

#documentsList .document-line-expiry.no-date {
  background: transparent !important;
  color: var(--cc-muted) !important;
}

#documentsList .document-line-expiry.ok {
  color: var(--cc-ok-ink, #147a42) !important;
}

#documentsList .document-line-expiry.warn {
  color: var(--cc-warn-ink, #9a5b00) !important;
}

#documentsList .document-line-expiry.danger {
  color: var(--cc-danger-ink, #b42318) !important;
}

#documentsList .document-category-row.is-not-applicable {
  background: var(--cc-fill) !important;
}

#documentsList .document-category-row.is-not-applicable .row-main strong,
#documentsList .document-category-row.is-not-applicable .row-main span {
  color: var(--cc-muted) !important;
}

#documentAddDialog,
#documentPreviewDialog {
  width: min(420px, calc(100vw - 24px));
}

#documentAddDialog .document-add-sheet,
#documentPreviewDialog .document-preview-sheet {
  width: 100%;
  gap: 8px;
  padding: 18px 16px 16px;
  background: var(--cc-card) !important;
  color: var(--cc-ink) !important;
}

#documentAddDialog h2,
#documentPreviewDialog h2 {
  max-width: calc(100% - 32px);
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--cc-ink) !important;
  font-size: 22px !important;
  line-height: 1.12;
}

#documentAddDialog h2 {
  max-width: calc(100% - 48px);
  padding-right: 0;
  font-size: 20px !important;
  white-space: nowrap;
}

#documentAddDialog .upload-helper,
#documentPreviewDialog .upload-helper {
  margin: 0 0 3px;
  color: var(--cc-muted) !important;
  font-size: 12px;
  line-height: 1.3;
}

#documentAddDialog .document-add-actions {
  overflow: hidden;
  border: 1px solid var(--cc-line);
  border-radius: 8px;
  background: var(--cc-card);
}

#documentAddDialog .document-add-choice {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 58px;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid var(--cc-line);
  border-radius: 0;
  background: transparent !important;
  color: var(--cc-ink) !important;
  text-align: left;
  box-shadow: none !important;
}

#documentAddDialog .document-add-choice:last-child {
  border-bottom: 0;
}

#documentAddDialog .document-add-choice-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--cc-line);
  border-radius: 7px;
  background: var(--cc-icon-bg);
  color: var(--cc-blue);
}

#documentAddDialog .document-add-choice-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

#documentAddDialog .document-add-choice strong,
#documentAddDialog .document-add-choice small {
  display: block;
  color: var(--cc-ink) !important;
}

#documentAddDialog .document-add-choice strong {
  font-size: 13px;
  line-height: 1.2;
}

#documentAddDialog .document-add-choice small {
  margin-top: 2px;
  color: var(--cc-muted) !important;
  font-size: 10.5px;
  line-height: 1.2;
}

#documentAddDialog .document-add-choice-chevron {
  color: var(--cc-subtle) !important;
  font-size: 22px;
  font-weight: 400;
}

#documentAddDialog .document-dialog-cancel {
  min-height: 38px;
}

#documentPreviewDialog .document-preview-sheet {
  width: min(760px, calc(100vw - 24px));
  max-height: min(92dvh, 900px);
}

#documentPreviewDialog {
  width: min(760px, calc(100vw - 24px));
}

#documentPreviewDialog .document-preview-stage {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 250px;
  height: min(68dvh, 720px);
  overflow: hidden;
  border: 1px solid var(--cc-line);
  border-radius: 8px;
  background: var(--cc-fill);
}

#documentPreviewDialog .document-preview-stage img,
#documentPreviewDialog .document-preview-stage iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--cc-card);
}

#documentPreviewDialog .document-preview-stage img {
  object-fit: contain;
}

#documentPreviewDialog .document-preview-stage [hidden] {
  display: none;
}

#documentPreviewDialog .document-preview-stage p {
  max-width: 30ch;
  margin: 0;
  padding: 18px;
  color: var(--cc-muted) !important;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}

body.theme-night #documentsList,
body.theme-night #documentsList .document-category-row,
body.theme-night #documentAddDialog .document-add-actions,
body.theme-night #documentAddDialog .document-add-choice,
body.theme-night #documentPreviewDialog .document-preview-stage {
  border-color: var(--cc-line) !important;
  background: var(--cc-card) !important;
  color: var(--cc-ink) !important;
}

body.theme-night #documentsList .document-line-expiry.ok {
  color: #66d99a !important;
}

body.theme-night #documentsList .document-line-expiry.warn {
  color: #f4b95f !important;
}

body.theme-night #documentsList .document-line-expiry.danger {
  color: #ff8178 !important;
}

/* Local data controls: one compact table with explicit destructive actions. */
.settings-section[data-settings-group="local-data"] {
  padding: 14px 16px !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}

.settings-section[data-settings-group="local-data"] > h2 {
  margin-bottom: 2px !important;
}

.settings-section[data-settings-group="local-data"] .settings-row {
  min-height: 52px !important;
  padding: 9px 0 !important;
  border: 0 !important;
  border-top: 1px solid var(--cc-line) !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.settings-section[data-settings-group="local-data"] .settings-row:first-of-type {
  border-top: 0 !important;
}

.settings-section[data-settings-group="local-data"] .settings-row .row-main {
  min-width: 0;
}

.settings-section[data-settings-group="local-data"] .settings-row strong {
  font-size: 14px !important;
}

.settings-section[data-settings-group="local-data"] .settings-row span {
  font-size: 12px !important;
  line-height: 1.3 !important;
}

.settings-row .settings-data-delete,
body.theme-night .settings-row .settings-data-delete {
  flex: 0 0 auto;
  min-width: 58px !important;
  min-height: 30px !important;
  padding: 0 8px !important;
  border: 1px solid color-mix(in srgb, var(--cc-danger-ink, #b42318) 22%, transparent) !important;
  border-radius: 7px !important;
  background: color-mix(in srgb, var(--cc-danger-ink, #b42318) 7%, var(--cc-card)) !important;
  color: var(--cc-danger-ink, #b42318) !important;
  font-size: 12px !important;
  font-weight: 750 !important;
}

#localDataClearDialog {
  width: min(390px, calc(100vw - 28px));
}

#localDataClearDialog .local-data-clear-sheet {
  display: grid;
  gap: 10px;
  padding: 20px 18px 18px !important;
  border-radius: 8px !important;
}

#localDataClearDialog h2 {
  margin: 0 !important;
  font-size: 25px !important;
  line-height: 1.08 !important;
}

#localDataClearDialog .upload-helper {
  margin: 0 !important;
  color: var(--cc-muted) !important;
  font-size: 14px !important;
  line-height: 1.4 !important;
}

.local-data-clear-note {
  margin: 0;
  padding: 10px 0;
  border-top: 1px solid var(--cc-line);
  border-bottom: 1px solid var(--cc-line);
  color: var(--cc-danger-ink, #b42318);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

#localDataClearDialog .dialog-actions button {
  min-height: 40px !important;
  border-radius: 8px !important;
}

@media (max-width: 390px) {
  .documents-detail-card {
    padding: 15px 12px 13px !important;
  }

  #documentsList .document-category-main {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 7px;
    min-height: 54px;
    padding: 8px;
  }

  #documentsList .document-category-main .row-icon {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
  }

  #documentsList .document-category-main .doc-actions {
    grid-column: 2;
    justify-content: flex-start;
    margin-top: 3px;
  }

  #documentsList .document-data-row,
  #documentsList .document-source-row {
    margin-left: 47px;
    padding-right: 8px;
  }

  #documentsList .document-data-actions {
    gap: 4px;
  }

  #documentsList .document-edit-btn {
    min-width: 28px;
    padding: 0 5px;
  }

  #documentPreviewDialog .document-preview-sheet {
    padding: 16px 12px 12px;
  }

  #documentPreviewDialog .document-preview-stage {
    min-height: 230px;
    height: 64dvh;
  }
}

/* Journeylog editor: compact table sections without stacked field cards. */
#logbookCompletionDialog .logbook-completion-sheet {
  width: min(calc(100vw - 20px), 640px) !important;
  padding: 20px !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain;
}

#logbookCompletionDialog .logbook-completion-sheet:focus,
#logbookCompletionDialog .logbook-completion-sheet:focus-visible {
  outline: 0 !important;
}

#logbookCompletionDialog .logbook-completion-sheet h2 {
  margin-bottom: 2px;
  font-size: 26px;
  line-height: 1.05;
}

#logbookCompletionDialog .upload-helper {
  margin: 4px 0 2px;
}

#logbookCompletionDialog .logbook-form-section,
#logbookCompletionDialog .logbook-z-time-fieldset {
  min-width: 0;
  margin: 12px 0 0;
  padding: 0;
  border: 0;
}

#logbookCompletionDialog .logbook-form-section > h3,
#logbookCompletionDialog .logbook-z-time-fieldset > legend {
  width: 100%;
  margin: 0;
  padding: 0 0 6px;
  color: var(--cc-muted) !important;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

#logbookCompletionDialog .logbook-table-grid,
#logbookCompletionDialog .logbook-completion-grid,
#logbookCompletionDialog .logbook-z-time-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  min-width: 0;
}

#logbookCompletionDialog .logbook-table-grid {
  overflow: hidden;
  border: 1px solid var(--cc-line);
  border-radius: 8px;
  background: var(--cc-card);
}

#logbookCompletionDialog .logbook-table-grid .field {
  display: grid;
  align-content: center;
  gap: 1px;
  min-width: 0;
  min-height: 57px;
  margin: 0;
  padding: 7px 10px;
  border: 0;
  border-bottom: 1px solid var(--cc-line);
  border-radius: 0;
  background: transparent;
  color: var(--cc-muted) !important;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
  box-shadow: none;
}

#logbookCompletionDialog .logbook-table-grid .field:nth-child(odd):not(.full) {
  border-right: 1px solid var(--cc-line);
}

#logbookCompletionDialog .logbook-table-grid .field:nth-last-child(-n + 2):not(.full),
#logbookCompletionDialog .logbook-table-grid .field.full {
  border-bottom: 0;
}

#logbookCompletionDialog .logbook-table-grid .field.full {
  grid-column: 1 / -1;
}

#logbookCompletionDialog .logbook-table-grid input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 29px;
  margin: 0;
  padding: 2px 0;
  overflow: hidden;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--cc-ink) !important;
  font-size: 16px !important;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  box-shadow: none !important;
}

#logbookCompletionDialog .logbook-table-grid input:focus {
  outline: 0;
  box-shadow: inset 0 -2px 0 var(--cc-blue) !important;
}

#logbookCompletionDialog input[type='date']::-webkit-date-and-time-value,
#logbookCompletionDialog input[type='time']::-webkit-date-and-time-value {
  min-width: 0;
  text-align: left;
}

#logbookCompletionDialog .field-error {
  margin: 6px 0 0;
}

#logbookCompletionDialog .dialog-actions {
  margin-top: 14px;
  gap: 8px;
}

#logbookCompletionDialog .dialog-actions button {
  min-height: 40px;
  border-radius: 8px;
}

@media (max-width: 390px) {
  #logbookCompletionDialog .logbook-completion-sheet {
    padding: 18px 14px 14px !important;
  }

  #logbookCompletionDialog .logbook-completion-sheet h2 {
    font-size: 23px;
  }

  #logbookCompletionDialog .logbook-table-grid .field {
    min-height: 54px;
    padding-inline: 8px;
  }

  #logbookCompletionDialog .logbook-table-grid input {
    font-size: 15px !important;
  }
}

/* Compact calendar maintenance and 30-day recovery. */
.calendar-maintenance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--cc-line);
}

.calendar-maintenance-row > div:first-child {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.calendar-maintenance-row strong {
  color: var(--cc-ink) !important;
  font-size: 13px;
}

.calendar-maintenance-row small {
  color: var(--cc-muted) !important;
  font-size: 11px;
}

.calendar-maintenance-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 3px;
}

.calendar-maintenance-actions .text-button {
  min-width: 0;
  min-height: 30px;
  padding: 0 7px;
  border: 1px solid var(--cc-line);
  border-radius: 6px;
  background: transparent !important;
  color: var(--cc-blue) !important;
  font-size: 11px;
  line-height: 1;
}

.calendar-maintenance-actions .text-button:disabled {
  color: var(--cc-muted) !important;
  opacity: 0.55;
}

.calendar-trash-button span {
  color: inherit !important;
  font-variant-numeric: tabular-nums;
}

#calendarClearDialog .calendar-clear-sheet,
#calendarTrashDialog .calendar-trash-sheet {
  width: min(calc(100vw - 24px), 430px) !important;
  max-height: min(82dvh, 620px);
  overflow-y: auto;
}

.calendar-clear-facts,
.calendar-trash-list {
  overflow: hidden;
  border: 1px solid var(--cc-line);
  border-radius: 8px;
  background: var(--cc-card);
}

.calendar-clear-facts {
  display: grid;
  margin-top: 12px;
}

.calendar-clear-facts span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--cc-line);
  color: var(--cc-muted) !important;
  font-size: 12px;
  font-weight: 700;
}

.calendar-clear-facts span:last-child {
  border-bottom: 0;
}

.calendar-clear-facts strong {
  color: var(--cc-ink) !important;
  font-size: 13px;
  text-align: right;
}

.calendar-clear-note {
  margin: 9px 0 0;
  color: var(--cc-muted) !important;
  font-size: 12px;
  line-height: 1.35;
}

#confirmCalendarClearBtn {
  min-height: 40px;
  border: 1px solid color-mix(in srgb, var(--cc-danger-ink, #b42318) 24%, transparent) !important;
  border-radius: 8px;
  background: color-mix(in srgb, var(--cc-danger-ink, #b42318) 10%, var(--cc-card)) !important;
  color: var(--cc-danger-ink, #b42318) !important;
}

body.theme-night #confirmCalendarClearBtn {
  border-color: rgb(255 155 142 / 38%) !important;
  background: #2b1d20 !important;
  color: #ff9b8e !important;
}

.calendar-trash-list {
  margin-top: 12px;
}

.calendar-trash-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 60px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--cc-line);
  background: transparent;
}

.calendar-trash-row:last-child {
  border-bottom: 0;
}

.calendar-trash-row > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.calendar-trash-row strong {
  overflow: hidden;
  color: var(--cc-ink) !important;
  font-size: 13px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-trash-row small,
.calendar-trash-empty {
  margin: 0;
  color: var(--cc-muted) !important;
  font-size: 11px;
  line-height: 1.3;
}

.calendar-trash-row .text-button {
  min-height: 30px;
  padding: 0 6px;
  color: var(--cc-blue) !important;
  font-size: 11px;
}

.calendar-trash-empty {
  padding: 16px 12px;
  text-align: center;
}

@media (max-width: 390px) {
  .calendar-maintenance-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .calendar-maintenance-actions {
    width: 100%;
  }

  .calendar-maintenance-actions .text-button {
    flex: 1;
  }
}

#logbook .logbook-world-card .logbook-map-toolbar {
  justify-content: flex-end;
  margin-bottom: 6px;
}

#logbook .logbook-world-card .logbook-map-toolbar + .logbook-globe {
  margin-top: 0;
}

#logbook .logbook-world-card .logbook-globe {
  width: calc(100% + 44px);
  max-width: none;
  margin-inline: -22px;
}

/* Document review and destructive confirmation. */
#documentReviewDialog .document-review-sheet {
  display: flex;
  width: min(720px, calc(100vw - 24px));
  max-height: min(88dvh, 820px);
  padding: 24px 20px 18px;
  overflow: hidden;
  flex-direction: column;
}

#documentReviewDialog .document-review-sheet > h2,
#documentConfirmDialog .document-confirm-sheet > h2 {
  margin: 2px 0 6px;
  color: var(--cc-ink);
  font-size: 25px;
  line-height: 1.12;
  letter-spacing: 0;
}

.document-review-summary {
  display: flex;
  min-height: 34px;
  margin: 8px 0 0;
  padding: 7px 2px;
  color: var(--cc-muted);
  border-top: 1px solid var(--cc-line);
  border-bottom: 1px solid var(--cc-line);
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.document-review-summary strong {
  min-width: 0;
  overflow: hidden;
  color: var(--cc-ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-review-list {
  min-height: 0;
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.document-review-row {
  position: relative;
  padding: 12px 2px;
  border-bottom: 1px solid var(--cc-line);
}

.document-review-row:last-child {
  border-bottom: 0;
}

.document-review-row.is-expired {
  box-shadow: inset 3px 0 0 var(--cc-red);
}

.document-review-row.is-invalid:not(.is-expired) {
  box-shadow: inset 3px 0 0 var(--cc-orange);
}

.document-review-row-head {
  display: grid;
  min-height: 30px;
  margin-bottom: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.document-review-check {
  display: flex;
  min-width: 0;
  color: var(--cc-ink);
  gap: 9px;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
}

.document-review-check input {
  width: 20px;
  height: 20px;
  margin: 0;
  flex: 0 0 20px;
  accent-color: var(--cc-blue);
}

.document-review-status {
  color: var(--cc-muted);
  font-size: 11px;
  font-weight: 700;
}

.document-review-status.ok { color: var(--cc-ok-ink); }
.document-review-status.warn { color: var(--cc-warn-ink); }
.document-review-status.danger { color: var(--cc-error-ink); }

.document-review-fields {
  display: grid;
  grid-template-columns: minmax(120px, .8fr) minmax(160px, 1.25fr) minmax(140px, .9fr);
  border: 1px solid var(--cc-line);
  background: var(--cc-card);
}

.document-review-field {
  display: grid;
  min-width: 0;
  padding: 7px 9px 8px;
  border-right: 1px solid var(--cc-line);
  gap: 4px;
}

.document-review-field:last-child {
  border-right: 0;
}

.document-review-field > span,
.document-review-conflict > span {
  color: var(--cc-muted);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.document-review-field input,
.document-review-field select,
.document-review-conflict select {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 3px 5px;
  color: var(--cc-ink);
  border: 0;
  border-radius: 4px;
  outline: 0;
  background: var(--cc-fill);
  font-size: 16px;
}

.document-review-conflict {
  display: grid;
  margin-top: 8px;
  grid-template-columns: minmax(0, 1fr) minmax(150px, .7fr);
  gap: 10px;
  align-items: center;
}

.document-review-conflict-copy {
  min-width: 0;
}

.document-review-conflict-copy strong,
.document-review-conflict-copy small {
  display: block;
}

.document-review-conflict-copy strong {
  color: var(--cc-ink);
  font-size: 12px;
}

.document-review-conflict-copy small {
  margin-top: 2px;
  color: var(--cc-muted);
  font-size: 11px;
}

.document-review-add-row {
  width: max-content;
  min-height: 40px;
  margin: 6px 0 2px;
  padding-inline: 2px 12px;
  color: var(--cc-blue) !important;
  font-size: 13px;
}

.document-review-actions {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--cc-line);
  background: var(--cc-card);
}

#documentConfirmDialog .document-confirm-sheet {
  width: min(420px, calc(100vw - 32px));
  padding: 24px 20px 18px;
}

#documentConfirmDialog .document-confirm-sheet .upload-helper {
  margin: 8px 0 16px;
  color: var(--cc-muted);
  line-height: 1.42;
}

body.theme-night .document-review-fields,
body.theme-night .document-review-actions {
  background: var(--cc-card);
}

body.theme-night .document-review-field input,
body.theme-night .document-review-field select,
body.theme-night .document-review-conflict select {
  color: var(--cc-ink);
  background: var(--cc-fill);
}

@media (max-width: 560px) {
  #documentReviewDialog .document-review-sheet {
    width: calc(100vw - 18px);
    max-height: 92dvh;
    padding: 20px 14px 14px;
  }

  .document-review-fields {
    grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  }

  .document-review-field:nth-child(2) {
    border-right: 0;
  }

  .document-review-field:last-child {
    grid-column: 1 / -1;
    border-top: 1px solid var(--cc-line);
  }

  .document-review-conflict {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* Documents final layout: one table surface, compact actions and an expiry rail. */
.documents-detail-card {
  overflow: hidden;
  padding: 16px 16px 12px !important;
}

.documents-detail-card .section-title {
  margin-bottom: 4px;
}

.documents-detail-card .section-title h2 {
  color: var(--cc-ink) !important;
  font-size: 22px !important;
}

#documentTimeline {
  margin: 0 0 8px;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--cc-line);
}

#documentTimeline:empty {
  display: none;
}

.document-expiry-timeline {
  position: relative;
  display: grid;
  padding-left: 2px;
}

.document-expiry-timeline::before {
  position: absolute;
  z-index: 0;
  top: 17px;
  bottom: 17px;
  left: 7px;
  width: 1px;
  background: var(--cc-line);
  content: '';
}

.document-expiry-row {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  margin: 0;
  padding: 6px 0;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--cc-line) 72%, transparent);
  border-radius: 0;
  background: transparent !important;
  color: var(--cc-ink) !important;
  grid-template-columns: 14px 70px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  text-align: left;
  box-shadow: none !important;
}

.document-expiry-row:last-child {
  border-bottom: 0;
}

.document-expiry-marker {
  position: relative;
  z-index: 2;
  width: 9px;
  height: 9px;
  border: 2px solid var(--cc-card);
  border-radius: 50%;
  background: var(--cc-subtle);
  box-shadow: 0 0 0 1px var(--cc-line);
}

.document-expiry-row.is-ok .document-expiry-marker { background: var(--cc-green); }
.document-expiry-row.is-warn .document-expiry-marker { background: var(--cc-orange); }
.document-expiry-row.is-danger .document-expiry-marker { background: var(--cc-red); }

.document-expiry-date,
.document-expiry-status {
  color: var(--cc-muted) !important;
  font-size: 10px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.document-expiry-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.document-expiry-copy strong,
.document-expiry-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-expiry-copy strong {
  color: var(--cc-ink) !important;
  font-size: 12px;
  line-height: 1.2;
}

.document-expiry-copy small {
  color: var(--cc-muted) !important;
  font-size: 10px;
  line-height: 1.2;
}

.document-expiry-row.is-ok .document-expiry-status { color: var(--cc-ok-ink) !important; }
.document-expiry-row.is-warn .document-expiry-status { color: var(--cc-warn-ink) !important; }
.document-expiry-row.is-danger .document-expiry-status { color: var(--cc-error-ink) !important; }

#documentsList,
body.theme-night #documentsList {
  overflow: visible;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#documentsList .document-category-row,
body.theme-night #documentsList .document-category-row {
  border-bottom: 1px solid var(--cc-line) !important;
  background: transparent !important;
}

#documentsList .document-category-row:last-child {
  border-bottom: 0 !important;
}

#documentsList .document-category-main {
  min-height: 54px;
  padding: 7px 0;
}

#documentsList .document-category-main .row-icon {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  border-radius: 7px !important;
}

#documentsList .document-category-main .row-main strong {
  color: var(--cc-ink) !important;
  font-size: 12.5px;
}

#documentsList .document-category-main .row-main span {
  color: var(--cc-muted) !important;
  font-size: 10px;
}

#documentsList .doc-actions {
  gap: 3px;
}

#documentsList .doc-actions .badge,
#documentsList .privilege-state-btn {
  min-height: 27px !important;
  padding: 0 7px !important;
  font-size: 9px !important;
  line-height: 25px !important;
}

#documentsList .document-add-btn,
#documentsList .document-preview-btn,
#documentsList .document-edit-btn,
#documentsList .document-delete-btn {
  display: inline-grid;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  margin: 0;
  padding: 0 !important;
  place-items: center;
  border: 1px solid var(--cc-line) !important;
  border-radius: 6px !important;
  background: transparent !important;
  color: var(--cc-blue) !important;
  box-shadow: none !important;
}

#documentsList .document-add-btn {
  font-size: 18px;
  font-weight: 500;
}

#documentsList .document-add-btn:disabled {
  color: var(--cc-subtle) !important;
  opacity: .58;
}

#documentsList .document-preview-btn svg,
#documentsList .document-edit-btn svg,
#documentsList .document-delete-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

#documentsList .document-delete-btn {
  color: var(--cc-error-ink) !important;
}

#documentsList .document-data-list,
body.theme-night #documentsList .document-data-list {
  border-top: 1px solid var(--cc-line);
  background: transparent !important;
}

#documentsList .document-data-row,
#documentsList .document-source-row {
  min-height: 40px;
  margin-left: 0;
  padding: 5px 0 5px 41px;
}

#documentsList .document-data-copy strong {
  color: var(--cc-ink) !important;
  font-size: 11.5px;
}

#documentsList .document-data-copy span {
  color: var(--cc-muted) !important;
  font-size: 9.5px;
}

#documentsList .document-data-actions {
  display: grid;
  grid-template-columns: auto repeat(3, 28px);
  gap: 3px;
  align-items: center;
}

#documentsList .document-line-expiry {
  max-width: 82px;
  overflow: hidden;
  font-size: 9.5px;
  text-overflow: ellipsis;
}

#documentsList .document-category-row.is-not-applicable,
body.theme-night #documentsList .document-category-row.is-not-applicable {
  background: color-mix(in srgb, var(--cc-fill) 55%, transparent) !important;
}

#documentsList .document-category-row.is-not-applicable .row-main strong,
#documentsList .document-category-row.is-not-applicable .row-main span {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

#documentsList .document-category-row.is-not-applicable .row-icon {
  opacity: .58;
}

#documentsList .document-category-row.is-timeline-focus {
  box-shadow: inset 3px 0 0 var(--cc-blue) !important;
}

#documentReviewDialog .document-review-sheet,
#documentConfirmDialog .document-confirm-sheet,
body.theme-night #documentReviewDialog .document-review-sheet,
body.theme-night #documentConfirmDialog .document-confirm-sheet {
  background: var(--cc-card) !important;
  color: var(--cc-ink) !important;
}

#documentReviewDialog input,
#documentReviewDialog select,
#documentConfirmDialog button {
  -webkit-text-fill-color: currentColor;
}

@media (max-width: 420px) {
  #documentReviewDialog .document-review-sheet {
    padding: 16px 14px 14px;
  }

  #documentReviewDialog .document-review-sheet > h2 {
    font-size: 22px;
  }

  #documentReviewDialog .document-review-sheet > .upload-helper {
    margin-block: 2px 4px;
    font-size: 13px;
    line-height: 1.32;
  }

  .document-review-actions {
    display: grid !important;
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr) !important;
    gap: 6px !important;
  }

  .document-review-actions button {
    min-width: 0;
    min-height: 42px;
    padding-inline: 6px;
    font-size: 12px;
    white-space: nowrap;
  }

  .documents-detail-card {
    padding: 14px 12px 10px !important;
  }

  .document-expiry-row {
    grid-template-columns: 12px 58px minmax(0, 1fr);
    gap: 6px;
  }

  .document-expiry-status {
    grid-column: 3;
    margin-top: -4px;
  }

  #documentsList .document-category-main {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 7px;
    padding: 7px 0;
  }

  #documentsList .document-category-main .doc-actions {
    grid-column: auto;
    justify-content: flex-end;
    margin-top: 0;
  }

  #documentsList .document-data-row,
  #documentsList .document-source-row {
    padding-left: 39px;
    padding-right: 0;
  }

  #documentsList .document-data-actions {
    grid-template-columns: auto repeat(3, 26px);
    gap: 2px;
  }

  #documentsList .document-preview-btn,
  #documentsList .document-edit-btn,
  #documentsList .document-delete-btn {
    width: 26px;
    min-width: 26px;
    height: 26px;
    min-height: 26px;
  }

  #documentsList .document-line-expiry {
    max-width: 67px;
    font-size: 9px;
  }
}

/* Compact Wallet-style schedule history: one row per day, detail on demand. */
.schedule-change-history-list {
  display: grid;
  max-height: min(46vh, 360px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border-top: 1px solid var(--cc-line);
}

.schedule-change-history-day-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto) 18px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--cc-line);
  border-radius: 0;
  background: transparent;
  color: var(--cc-ink);
  text-align: left;
  box-shadow: none;
}

.schedule-change-history-day-row:last-child {
  border-bottom: 0;
}

.schedule-change-history-day-row:active {
  background: var(--cc-selected);
}

.schedule-change-history-day-row-date,
.schedule-change-history-day-row-summary {
  min-width: 0;
}

.schedule-change-history-day-row-date {
  display: grid;
  gap: 2px;
}

.schedule-change-history-day-row-date strong {
  overflow-wrap: anywhere;
  color: var(--cc-ink);
  font-size: 14px;
  font-weight: 780;
  line-height: 1.2;
}

.schedule-change-history-day-row-date small,
.schedule-change-history-day-row-summary {
  overflow-wrap: anywhere;
  color: var(--cc-muted);
  font-size: 11px;
  line-height: 1.25;
}

.schedule-change-history-day-row-summary {
  max-width: 132px;
  text-align: right;
}

.schedule-change-history-day-row-chevron {
  color: var(--cc-muted);
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
  text-align: right;
}

.schedule-change-history-detail {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.schedule-change-history-detail-head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--cc-line);
}

.schedule-change-history-detail-head h3 {
  margin: 2px 0 2px;
  color: var(--cc-ink);
  font-size: 18px;
  line-height: 1.15;
}

.schedule-change-history-detail-head span {
  color: var(--cc-muted);
  font-size: 11px;
  line-height: 1.3;
}

.schedule-change-history-close {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid var(--cc-line);
  border-radius: 10px;
  background: var(--cc-fill);
  color: var(--cc-ink);
  font-size: 23px;
  font-weight: 500;
  line-height: 1;
}

.schedule-change-history-detail-list {
  display: grid;
  min-width: 0;
  max-height: min(42vh, 340px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.schedule-change-history-detail-list .schedule-change-day-group {
  overflow: visible;
  border-color: var(--cc-line);
  border-radius: 10px;
  background: var(--cc-card);
}

.schedule-change-history-detail-list .schedule-change-day-group > h3 {
  padding: 9px 11px;
  color: var(--cc-muted);
  font-size: 11px;
  line-height: 1.25;
}

.schedule-change-history-detail-list .schedule-change-card {
  min-height: 0;
  padding: 11px;
  border-radius: 0;
  overflow: visible;
}

.schedule-change-history-detail-list .schedule-change-copy span,
.schedule-change-history-detail-list .schedule-change-copy small {
  overflow-wrap: anywhere;
}

body.theme-night .schedule-change-history-day-row,
body.theme-night .schedule-change-history-detail-head,
body.theme-night .schedule-change-history-detail-list .schedule-change-day-group {
  border-color: var(--cc-line) !important;
}

body.theme-night .schedule-change-history-day-row:active,
body.theme-night .schedule-change-history-close {
  background: var(--cc-fill) !important;
}

body.theme-night .schedule-change-history-day-row-date strong,
body.theme-night .schedule-change-history-detail-head h3,
body.theme-night .schedule-change-history-close {
  color: var(--cc-ink) !important;
}

body.theme-night .schedule-change-history-day-row-date small,
body.theme-night .schedule-change-history-day-row-summary,
body.theme-night .schedule-change-history-day-row-chevron,
body.theme-night .schedule-change-history-detail-head span {
  color: var(--cc-muted) !important;
}

@media (max-width: 420px) {
  .schedule-change-history-day-row {
    grid-template-columns: minmax(0, 1fr) 18px;
    gap: 8px;
  }

  .schedule-change-history-day-row-summary {
    display: none;
  }
}

/* Payroll salary table library */
.payroll-view-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  min-height: 42px;
  margin: -2px 0 14px;
  padding: 3px;
  border: 1px solid rgba(60, 60, 67, 0.14);
  border-radius: 10px;
  background: rgba(118, 118, 128, 0.12);
}

.payroll-view-tabs button {
  min-width: 0;
  min-height: 34px;
  margin: 0;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #5f6b7a;
  font-size: 13px;
  font-weight: 760;
  letter-spacing: 0;
}

.payroll-view-tabs button.is-selected,
.payroll-view-tabs button[aria-selected="true"] {
  background: #ffffff;
  color: #075fbd;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

.payroll-view-tabs button:focus-visible {
  outline: 3px solid rgba(10, 132, 255, 0.34);
  outline-offset: 1px;
}

.payroll-tab-panel[hidden] {
  display: none !important;
}

#payrollSummaryPanel,
.salary-library-panel {
  min-width: 0;
}

#payrollSummaryPanel > * + *,
.salary-library-panel > * + * {
  margin-top: 14px;
}

.salary-library-panel {
  display: grid;
  gap: 14px;
}

.salary-library-panel > * + * {
  margin-top: 0;
}

.salary-library-active-card,
.salary-library-list-card {
  padding: 16px 14px !important;
  border-radius: 8px !important;
}

.salary-library-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  margin-bottom: 10px !important;
}

.salary-library-heading .muted-label {
  margin-bottom: 3px;
  font-size: 10px !important;
  letter-spacing: 0.1em !important;
}

.salary-library-heading h2 {
  margin: 0;
  color: #15365d !important;
  font-size: 21px !important;
  line-height: 1.08 !important;
  letter-spacing: 0 !important;
}

.salary-library-active-detail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-block: 1px solid rgba(60, 60, 67, 0.12);
}

.salary-library-active-detail span {
  min-width: 0;
  padding: 9px 8px;
  border-left: 1px solid rgba(60, 60, 67, 0.12);
}

.salary-library-active-detail span:first-child {
  border-left: 0;
  padding-left: 0;
}

.salary-library-active-detail small,
.salary-library-active-detail strong {
  display: block;
}

.salary-library-active-detail small {
  margin-bottom: 2px;
  color: #66758b;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.salary-library-active-detail strong {
  overflow: hidden;
  color: #132b49;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.salary-library-transition {
  margin: 10px 0 0;
  padding: 9px 10px;
  border-left: 3px solid #dd8612;
  background: #fff5df;
  color: #7f4a08;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.salary-library-add {
  display: grid;
  place-items: center;
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #087ef5;
  color: #ffffff;
  font-size: 23px;
  font-weight: 500;
  line-height: 1;
}

.salary-library-add:active {
  transform: scale(0.96);
}

.salary-library-table {
  overflow: hidden;
  border-block: 1px solid rgba(60, 60, 67, 0.13);
}

.salary-library-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 56px;
  padding: 9px 0;
  border-top: 1px solid rgba(60, 60, 67, 0.12);
}

.salary-library-row:first-child {
  border-top: 0;
}

.salary-library-row-copy {
  min-width: 0;
}

.salary-library-row-copy strong,
.salary-library-row-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.salary-library-row-copy strong {
  color: #142b49;
  font-size: 13px;
}

.salary-library-row-copy small {
  margin-top: 3px;
  color: #66758b;
  font-size: 10px;
}

.salary-library-row-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.salary-library-row-status {
  color: #167653;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.salary-library-row-status.is-history {
  color: #6b7280;
}

.salary-library-file-button {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border: 1px solid rgba(10, 132, 255, 0.22);
  border-radius: 7px;
  background: #edf6ff;
  color: #086fda;
  font-size: 15px;
  font-weight: 850;
}

.salary-library-empty {
  margin: 0;
  padding: 14px 0;
  color: #66758b;
  font-size: 12px;
  line-height: 1.4;
}

#salaryTableReviewDialog .salary-table-review-sheet {
  width: min(900px, calc(100vw - 24px));
  max-width: 900px;
  max-height: min(92dvh, 820px);
  padding: 18px 18px 16px;
  overflow: auto;
  border-radius: 16px;
  background: #ffffff;
  color: #111827;
}

#salaryTableReviewDialog .salary-table-review-sheet > h2 {
  margin: 2px 42px 2px 0;
  color: #101a2e;
  font-size: 24px;
  line-height: 1.08;
  letter-spacing: 0;
}

#salaryTableReviewDialog .upload-helper {
  margin: 4px 0 12px;
  color: #5e6b7e;
  font-size: 12px;
  line-height: 1.35;
}

.salary-table-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-block: 1px solid #dfe4eb;
}

.salary-table-meta label {
  display: grid;
  min-width: 0;
  padding: 8px 9px;
  border-left: 1px solid #e3e7ed;
  color: #5d6a7d;
  font-size: 10px;
  font-weight: 800;
}

.salary-table-meta label:first-child {
  border-left: 0;
}

.salary-table-meta-wide {
  grid-column: span 2;
}

.salary-table-meta input,
.salary-table-meta select {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  margin-top: 3px;
  padding: 5px 7px;
  border: 1px solid #d7dde6;
  border-radius: 6px;
  background: #f8fafc;
  color: #13233d;
  font-size: 12px;
  font-weight: 700;
}

.salary-table-meta input[readonly] {
  background: #eef2f7;
  color: #536276;
}

.salary-table-review-wrap {
  margin-top: 12px;
  overflow: auto;
  border-block: 1px solid #dfe4eb;
  -webkit-overflow-scrolling: touch;
}

.salary-table-review-grid {
  width: 100%;
  min-width: 1460px;
  border-collapse: collapse;
}

.salary-table-review-grid th,
.salary-table-review-grid td {
  padding: 7px 5px;
  border-left: 1px solid #e3e7ed;
  border-bottom: 1px solid #e3e7ed;
  text-align: left;
}

.salary-table-review-grid th:first-child,
.salary-table-review-grid td:first-child {
  border-left: 0;
}

.salary-table-review-grid tr:last-child td {
  border-bottom: 0;
}

.salary-table-review-grid th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f1f5f9;
  color: #5c6a7e;
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.salary-table-review-grid input {
  width: 96px;
  min-width: 0;
  min-height: 31px;
  padding: 4px 6px;
  border: 1px solid #d6dde6;
  border-radius: 5px;
  background: #ffffff;
  color: #13233d;
  font-size: 11px;
  font-weight: 700;
}

.salary-table-review-grid input[data-salary-profile-field="label"] {
  width: 190px;
}

.salary-table-remove-profile {
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: #fff0ef;
  color: #c92a20;
  font-size: 16px;
}

.salary-table-add-profile {
  min-height: 34px;
  margin-top: 9px;
  padding: 0 9px;
  border: 1px solid rgba(10, 132, 255, 0.24);
  border-radius: 7px;
  background: #edf6ff;
  color: #076ed4;
  font-size: 11px;
  font-weight: 800;
}

#salaryTableReviewDialog .dialog-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  gap: 7px;
  margin-top: 12px;
}

#salaryTableReviewDialog .dialog-actions button {
  min-width: 0;
  min-height: 40px;
  padding-inline: 8px;
  border-radius: 8px;
  font-size: 12px;
}

#salaryTableFileDialog .salary-table-file-sheet {
  width: min(720px, calc(100vw - 24px));
  max-width: 720px;
  padding: 18px;
  background: #ffffff;
  color: #111827;
}

#salaryTableFileDialog h2 {
  margin-right: 38px;
  color: #101a2e;
  font-size: 22px;
  letter-spacing: 0;
}

.salary-table-file-viewer {
  display: grid;
  place-items: center;
  min-height: min(60dvh, 520px);
  margin: 10px 0;
  overflow: hidden;
  border: 1px solid #dbe1e9;
  border-radius: 8px;
  background: #f5f7fa;
}

.salary-table-file-viewer p {
  color: #637188;
  font-size: 12px;
}

.salary-table-file-viewer iframe,
.salary-table-file-viewer img {
  width: 100%;
  height: min(60dvh, 520px);
  border: 0;
  object-fit: contain;
}

body.theme-night .payroll-view-tabs {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.72);
}

body.theme-night .payroll-view-tabs button {
  color: #aebbd0;
}

body.theme-night .payroll-view-tabs button.is-selected,
body.theme-night .payroll-view-tabs button[aria-selected="true"] {
  background: #243247;
  color: #8ec5ff;
}

body.theme-night .salary-library-heading h2,
body.theme-night .salary-library-active-detail strong,
body.theme-night .salary-library-row-copy strong {
  color: #f4f7fb !important;
}

body.theme-night .salary-library-active-detail small,
body.theme-night .salary-library-row-copy small,
body.theme-night .salary-library-empty {
  color: #aab8cc;
}

body.theme-night .salary-library-active-detail,
body.theme-night .salary-library-active-detail span,
body.theme-night .salary-library-table,
body.theme-night .salary-library-row {
  border-color: rgba(148, 163, 184, 0.2);
}

body.theme-night .salary-library-transition {
  background: rgba(217, 119, 6, 0.16);
  color: #f6c777;
}

body.theme-night .salary-library-file-button {
  border-color: rgba(96, 165, 250, 0.3);
  background: rgba(30, 64, 175, 0.28);
  color: #9dccff;
}

body.theme-night #salaryTableReviewDialog .salary-table-review-sheet,
body.theme-night #salaryTableFileDialog .salary-table-file-sheet {
  background: #111b2b;
  color: #f4f7fb;
}

body.theme-night #salaryTableReviewDialog .salary-table-review-sheet > h2,
body.theme-night #salaryTableFileDialog h2 {
  color: #f4f7fb;
}

body.theme-night #salaryTableReviewDialog .upload-helper,
body.theme-night .salary-table-meta label {
  color: #b7c3d5;
}

body.theme-night .salary-table-meta,
body.theme-night .salary-table-meta label,
body.theme-night .salary-table-review-wrap,
body.theme-night .salary-table-review-grid th,
body.theme-night .salary-table-review-grid td,
body.theme-night .salary-table-file-viewer {
  border-color: rgba(148, 163, 184, 0.22);
}

body.theme-night .salary-table-meta input,
body.theme-night .salary-table-meta select,
body.theme-night .salary-table-review-grid input {
  border-color: rgba(148, 163, 184, 0.28);
  background: #172337;
  color: #f4f7fb;
}

body.theme-night .salary-table-meta input[readonly],
body.theme-night .salary-table-review-grid th,
body.theme-night .salary-table-file-viewer {
  background: #202d42;
  color: #c6d2e3;
}

@media (max-width: 600px) {
  .salary-library-active-detail {
    grid-template-columns: 1fr;
  }

  .salary-library-active-detail span,
  .salary-library-active-detail span:first-child {
    padding: 7px 0;
    border-left: 0;
    border-top: 1px solid rgba(60, 60, 67, 0.12);
  }

  .salary-library-active-detail span:first-child {
    border-top: 0;
  }

  .salary-table-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .salary-table-meta label:nth-child(3) {
    border-left: 0;
    border-top: 1px solid #e3e7ed;
  }

  .salary-table-meta label:nth-child(4),
  .salary-table-meta label:nth-child(5) {
    border-top: 1px solid #e3e7ed;
  }
}

@media (max-width: 420px) {
  .payroll-view-tabs {
    margin-bottom: 10px;
  }

  .salary-library-active-card,
  .salary-library-list-card {
    padding: 13px 12px !important;
  }

  .salary-library-heading h2 {
    font-size: 18px !important;
  }

  #salaryTableReviewDialog .salary-table-review-sheet {
    width: calc(100vw - 12px);
    max-height: 96dvh;
    padding: 15px 12px 12px;
    border-radius: 12px;
  }

  #salaryTableReviewDialog .salary-table-review-sheet > h2 {
    font-size: 21px;
  }

  .salary-table-meta {
    grid-template-columns: 1fr;
  }

  .salary-table-meta-wide {
    grid-column: auto;
  }

  .salary-table-meta label,
  .salary-table-meta label:first-child,
  .salary-table-meta label:nth-child(3),
  .salary-table-meta label:nth-child(4),
  .salary-table-meta label:nth-child(5) {
    padding: 7px 0;
    border-left: 0;
    border-top: 1px solid #e3e7ed;
  }

  .salary-table-meta label:first-child {
    border-top: 0;
  }

  #salaryTableReviewDialog .dialog-actions button {
    font-size: 11px;
  }
}
