* {
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.language-switcher {
  position: fixed;
  top: 60px;
  right: 20px;
  z-index: 10;
}

/* The full-width teal .logo-banner was an early header placeholder and has been
   retired. Its wordmark and marketing-home link moved to the sidebar lockup,
   and its locale switcher into the App Shell v3 top bar (TopBar.tsx). The
   remaining rules below exist only for sign-in.html, which reuses the class on a
   display:contents element for its own static brand panel. */

/* Mount point for the React top bar. Sized here so the reserved space is
   correct before React hydrates and the content doesn't jump. */
.lf-topbar {
  display: block;
  height: var(--top-bar-height);
}

/* Public, unauthenticated pages (celebration report, provider nominee) get a
   plain navy brand bar instead: the logged-in bar's greeting, notifications
   and Send a Celebration CTA all assume a signed-in user. */
.lf-brandbar {
  position: fixed;
  top: var(--lf-banner-h, 0px);
  left: 0;
  right: 0;
  height: var(--top-bar-height);
  background: var(--nav-navy, #0D1B2A);
  display: flex;
  align-items: center;
  padding: 0 32px;
  z-index: 90;
}

.lf-brandbar img {
  display: block;
  height: 34px;
  width: auto;
}

#header-locale-switcher {
  margin-left: auto;
  flex-shrink: 0;
}

#header-locale-select {
  appearance: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  padding: 4px 24px 4px 10px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, #fff 50%),
    linear-gradient(135deg, #fff 50%, transparent 50%);
  background-position: calc(100% - 9px) calc(50% - 1px), calc(100% - 5px) calc(50% - 1px);
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}

#header-locale-select:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

#header-locale-select option {
  background: #0b4f6c;
  color: #fff;
}

body[class^="page-"],
body[class*=" page-"] {
  --footer-height: 72px;
  padding-bottom: calc(var(--footer-height) + 24px);
}

/* Full-height list/detail pages (Messages, Notifications, the dashboards, My
   Deliveries): their panes scroll on their own, so the page itself must not.
   The body is a viewport-high flex column with no margin or footer padding:
   the in-flow .lf-topbar mount reserves the fixed top bar's height, the
   .app-container's margin-top the construction banner's (js/header.js), and
   .app-container takes exactly what's left, banner or no banner. */
body.lf-fill-viewport {
  margin: 0;
  padding-bottom: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.lf-fill-viewport .lf-topbar {
  flex: none;
}

body.lf-fill-viewport .app-container {
  flex: 1 1 auto;
  min-height: 0;
}

body.lf-fill-viewport .main-content {
  padding: 0;
  overflow: hidden;
  align-items: stretch;
  min-height: 0;
}

/* flex as well as height: on a phone .main-content is a flex column whose
   height doesn't resolve a percentage. */
body.lf-fill-viewport #spa-root {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  min-height: var(--footer-height);
  padding: 16px 20px;
  background: rgba(15, 20, 27, 0.92);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.9rem;
  text-align: center;
  box-shadow: 0 -8px 24px rgba(15, 20, 27, 0.2);
  z-index: 999;
}

.site-footer a {
  color: #ffffff;
  font-weight: 600;
}

.site-footer a:hover {
  color: #ffd7c8;
}

.redirect-card {
  max-width: 680px;
  margin: 120px auto 0;
  padding: 0 20px;
  text-align: center;
}

.home-legal-callout {
  margin: 1.25rem auto 1.5rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(11, 79, 108, 0.18);
  border-radius: 14px;
  background: rgba(11, 79, 108, 0.08);
  color: #0f141b;
}

.home-legal-callout strong {
  font-weight: 700;
}

.home-legal-callout a {
  color: #0b4f6c;
  font-weight: 700;
}

.home-legal-callout a:hover {
  color: #08384d;
}

body.page-privacy,
body.page-tos {
  color-scheme: light;
  --ink: #0f141b;
  --muted: #4c5563;
  --accent: #0b4f6c;
  --card: #f8f4f0;
  --shadow: 0 22px 60px rgba(15, 20, 27, 0.18);
  --radius: 24px;
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 15% 20%, #fef1e6 0%, #fde9d6 35%, #f3efe9 65%, #e9f1f4 100%);
  padding: 96px 16px calc(var(--footer-height) + 32px);
}

body.page-privacy .card,
body.page-tos .card {
  width: min(820px, 100%);
  margin: 0 auto;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  line-height: 1.65;
}

body.page-privacy h1,
body.page-privacy h2,
body.page-tos h1,
body.page-tos h2 {
  color: var(--ink);
}

body.page-privacy p,
body.page-privacy li,
body.page-tos p,
body.page-tos li {
  color: var(--muted);
}

body.page-privacy a,
body.page-tos a {
  color: var(--accent);
}

/* Language switcher — no flag icons. Flags map to countries, not languages,
   and are misleading for multi-country languages (Español, Français, Kiswahili).
   Plain language names in their own script are unambiguous and correct. */
.language-switcher select,
.language-dropdown-look {
  appearance: none;
  border: 1px solid rgba(15, 20, 27, 0.2);
  border-radius: 8px;
  padding: 5px 26px 5px 10px;
  font-size: 13px;
  font-weight: 500;
  background: #fff;
  color: #0f141b;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, #0f141b 50%),
    linear-gradient(135deg, #0f141b 50%, transparent 50%);
  background-position: calc(100% - 10px) calc(50% - 2px), calc(100% - 6px) calc(50% - 2px);
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}

.language-switcher select:focus,
.language-dropdown-look:focus {
  outline: none;
  border-color: rgba(11, 79, 108, 0.6);
  box-shadow: 0 0 0 3px rgba(11, 79, 108, 0.15);
}

body.page-signup {
  color-scheme: light;
  --ink: #0f141b;
  --muted: #4c5563;
  --accent: #0b4f6c;
  --accent-2: #ff6b35;
  --card: #f8f4f0;
  --shadow: 0 22px 60px rgba(15, 20, 27, 0.18);
  --radius: 24px;
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 15% 20%, #fef1e6 0%, #fde9d6 35%, #f3efe9 65%, #e9f1f4 100%);
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.social-login {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 8px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  transition: transform 0.1s, box-shadow 0.1s;
  border: 1px solid rgba(0,0,0,0.1);
}

.btn-social:active {
  transform: scale(0.98);
}

.btn-social img {
  width: 18px;
  height: 18px;
}

.btn-google {
  background: white;
  color: #3c4043;
}

.btn-facebook {
  background: #1877f2;
  color: white;
}

.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
  color: #666;
  font-size: 0.9rem;
}

.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(0,0,0,0.1);
}

body.page-sign-in .card {
  width: min(420px, 100%);
  background: var(--card, #fff);
  padding: 40px;
  border-radius: 24px;
  box-shadow: 0 22px 60px rgba(15, 20, 27, 0.1);
}

body.page-sign-in {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 15% 20%, #fef1e6 0%, #fde9d6 35%, #f3efe9 65%, #e9f1f4 100%);
  font-family: "Space Grotesk", sans-serif;
}

body.page-signup .page {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 28px;
  align-items: stretch;
}

body.page-signup .hero {
  padding: 40px;
  border-radius: var(--radius);
  background: linear-gradient(140deg, #0b4f6c 0%, #124559 45%, #1b2a41 100%);
  color: #f5f7fb;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

body.page-signup .hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(255, 107, 53, 0.35), transparent 55%);
}

body.page-signup .hero h1 {
  position: relative;
  margin: 0 0 12px;
  font-size: clamp(2rem, 3vw, 3rem);
  letter-spacing: -0.02em;
}

body.page-signup .hero p {
  position: relative;
  margin: 0;
  color: rgba(245, 247, 251, 0.85);
  line-height: 1.5;
}

body.page-signup .card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 20px;
  animation: rise 0.6s ease-out both;
}

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

body.page-signup .fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

body.page-signup .field {
  display: grid;
  gap: 6px;
}

body.page-signup label {
  font-size: 0.9rem;
  font-weight: 600;
}

body.page-signup input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(15, 20, 27, 0.15);
  font-size: 0.95rem;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body.page-signup input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 79, 108, 0.2);
}

body.page-signup .full {
  grid-column: 1 / -1;
}

body.page-signup button {
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  font-size: 1rem;
  font-weight: 700;
  background: linear-gradient(120deg, var(--accent) 0%, #106581 55%, var(--accent-2) 100%);
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body.page-signup button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(11, 79, 108, 0.3);
}

body.page-signup button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

body.page-signup .note {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}

body.page-signup .field-hint {
  margin: 6px 0 0;
  padding-left: 18px;
  color: rgba(76, 85, 99, 0.65);
  font-size: 0.8rem;
  font-style: italic;
}

body.page-signup .field-hint li {
  margin: 2px 0;
}

body.page-signup .field-error {
  min-height: 1rem;
  font-size: 0.8rem;
  color: #b42318;
}

body.page-signup .helper {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

body.page-signup .helper a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

body.page-signup .helper a:hover {
  text-decoration: underline;
}

@media (max-width: 840px) {
  body.page-signup .page {
    grid-template-columns: 1fr;
  }
  body.page-signup .fields {
    grid-template-columns: 1fr;
  }
}

body.page-index {
  color-scheme: light;
  --ink: #0f141b;
  --muted: #4c5563;
  --accent: #0b4f6c;
  --accent-2: #ff6b35;
  --card: #f8f4f0;
  --shadow: 0 22px 60px rgba(15, 20, 27, 0.18);
  --radius: 22px;
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 12% 20%, #f7f0e6 0%, #f3efe9 45%, #e7eef2 100%);
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

body.page-index .card {
  width: min(720px, 100%);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 32px;
  display: grid;
  gap: 18px;
  text-align: center;
  animation: rise 0.55s ease-out both;
}

body.page-index h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.6rem);
  letter-spacing: -0.02em;
}

body.page-index p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

body.page-index .actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

body.page-index .actions a {
  text-decoration: none;
  color: #fff;
  background: linear-gradient(120deg, var(--accent) 0%, #106581 55%, var(--accent-2) 100%);
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body.page-index .actions a:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(11, 79, 108, 0.3);
}

body.page-index .card a:not(.actions a) {
  color: var(--accent);
  text-decoration: underline;
  background: none;
  padding: 0;
  border-radius: 0;
  font-weight: normal;
  transition: color 0.2s ease;
}

body.page-index .card a:not(.actions a):hover {
  color: var(--accent-2);
  transform: none;
  box-shadow: none;
}

body.page-index ul {
  text-align: left;
  margin: 10px 0;
  padding-left: 20px;
}

body.page-index li {
  margin-bottom: 8px;
  color: var(--muted);
}

body.page-sign-in {
  color-scheme: light;
  --ink: #0f141b;
  --muted: #4c5563;
  --accent: #0b4f6c;
  --accent-2: #ff6b35;
  --card: #f8f4f0;
  --shadow: 0 22px 60px rgba(15, 20, 27, 0.18);
  --radius: 22px;
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 78% 12%, #fef1e6 0%, #f3efe9 50%, #e7eef2 100%);
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

body.page-sign-in .card {
  width: min(640px, 100%);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 32px;
  display: grid;
  gap: 18px;
  text-align: center;
  animation: rise 0.55s ease-out both;
}

.profile-info {
  width: min(500px, 100%);
  margin: 20px auto;
  border-top: 1px solid rgba(0,0,0,0.1);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.avatar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.avatar-placeholder {
  background-color: #e0e0e0;
}

.refresh-button {
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.refresh-button:hover {
  background: var(--accent);
  color: white;
}

.profile-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.profile-row.full-width {
  grid-template-columns: 1fr;
}

.profile-info .info-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.profile-info label {
  color: var(--muted);
  margin-bottom: 2px;
}

.profile-info span {
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  font-size: 1rem;
}

@media (max-width: 480px) {
  .profile-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

body.page-sign-in h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.4rem);
  letter-spacing: -0.02em;
}

body.page-sign-in p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

body.page-sign-in form {
  display: grid;
  gap: 14px;
  text-align: left;
}

body.page-sign-in .login-inline-form {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

body.page-sign-in .login-inline-form .field {
  flex: 1;
}

body.page-sign-in .login-inline-form button {
  white-space: nowrap;
}

@media (max-width: 600px) {
  body.page-sign-in .login-inline-form {
    flex-direction: column;
    align-items: stretch;
  }
}

body.page-sign-in .field {
  display: grid;
  gap: 6px;
}

body.page-sign-in label {
  font-size: 0.9rem;
  font-weight: 600;
}

body.page-sign-in input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(15, 20, 27, 0.15);
  font-size: 0.95rem;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body.page-sign-in input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 79, 108, 0.2);
}

body.page-sign-in button {
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  font-size: 1rem;
  font-weight: 700;
  background: linear-gradient(120deg, var(--accent) 0%, #106581 55%, var(--accent-2) 100%);
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body.page-sign-in button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(11, 79, 108, 0.3);
}

body.page-sign-in .helper a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

body.page-sign-in .helper a:hover {
  text-decoration: underline;
}

:root {
  --side-nav-width: 240px;
  --side-nav-collapsed-width: 64px;
  --top-bar-height: 71px;
  --nav-navy: #0D1B2A;
  --nav-gold: #C9A84C;
  --nav-white: #FDFAF4;
}

/* Sidebar Navigation Layout */
.app-container {
  display: flex;
  /* The retired .logo-banner used to push this down by 50px. The sidebar now
     runs to the top of the viewport, and the only remaining offset is the
     construction banner, whose height js/header.js publishes. */
  margin-top: var(--lf-banner-h, 0px);
  min-height: calc(100vh - var(--lf-banner-h, 0px));
}

.side-nav {
  width: var(--side-nav-width);
  background: var(--nav-navy);
  border-right: none;
  padding: 0;
  flex-shrink: 0;
  position: fixed;
  top: var(--lf-banner-h, 0px);
  left: 0;
  bottom: 0;
  overflow: hidden;
  transition: width 0.2s ease;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.side-nav.collapsed {
  width: var(--side-nav-collapsed-width);
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  /* Tighter on the right than the left so a count badge has room (App Shell v3). */
  padding: 11px 18px 11px 24px;
  text-decoration: none;
  color: rgba(253, 250, 244, 0.6);
  font-weight: 500;
  font-family: 'Plus Jakarta Sans', 'Space Grotesk', sans-serif;
  font-size: 14px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  border-left: 3px solid transparent;
  position: relative;
  white-space: nowrap;
}

/* Long labels truncate rather than pushing the badge out of the sidebar. */
.side-nav a .nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1 1 auto;
}

/* Queue count on the admin nav items, and their sum on a closed section's header.
   Fixed geometry + tabular figures so the pill doesn't change width between 1- and
   2-digit counts. */
.side-nav a .nav-count-badge,
.side-nav [data-nav-section] .nav-count-badge {
  margin-left: auto;
  flex-shrink: 0;
  background: #DC2626;
  color: #fff;
  border-radius: 20px;
  min-width: 22px;
  height: 18px;
  padding: 0 6px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Plus Jakarta Sans', 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.side-nav.collapsed a {
  padding: 12px 0;
  justify-content: center;
  gap: 0;
}

.side-nav.collapsed a span:not(.nav-icon) {
  display: none;
}

.nav-icon {
  display: flex;
  flex-shrink: 0;
  min-width: 20px;
}

.side-nav a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(253, 250, 244, 0.85);
}

.side-nav a.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--nav-white);
  border-left-color: var(--nav-gold);
  pointer-events: none;
  cursor: default;
}

.side-nav a.nav-disabled {
  color: rgba(253, 250, 244, 0.25);
  pointer-events: none;
  cursor: default;
}

.nav-sign-out {
  font-family: 'Plus Jakarta Sans', 'Space Grotesk', sans-serif;
  font-size: 12px;
  color: rgba(253, 250, 244, 0.35);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.15s ease;
}

.nav-sign-out:hover {
  color: rgba(253, 250, 244, 0.6);
}

.nav-toggle-btn {
  position: fixed;
  bottom: 20px;
  left: calc(var(--side-nav-width) - 12px);
  width: 24px;
  height: 24px;
  background: var(--nav-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid var(--nav-navy);
  z-index: 110;
  transition: background 0.15s ease, left 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.side-nav.collapsed .nav-toggle-btn {
  left: calc(var(--side-nav-collapsed-width) - 12px);
}

.nav-toggle-btn:hover {
  background: #E8C97A;
}

.main-content {
  flex: 1;
  padding: 32px;
  padding-top: calc(32px + var(--top-bar-height));
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-left: var(--side-nav-width);
  transition: margin-left 0.2s ease;
}

.side-nav.collapsed + .main-content {
  margin-left: var(--side-nav-collapsed-width);
}

/* Hidden except inside the mobile drawer below — a fixed-position overlay that
   dims the page and closes the drawer on tap-outside. Portalled to <body> by
   NavPanel since it isn't a descendant of .side-nav. */
.side-nav-backdrop {
  display: none;
}

@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }
  /* Off-canvas drawer rather than the old horizontal scroll strip: the base
     .side-nav rule already gives it position:fixed, a column layout and its
     desktop width, so mobile only needs to slide it out of view and bring it
     back on toggle. */
  .side-nav {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
  }
  .side-nav.mobile-open {
    transform: translateX(0);
  }
  /* The desktop rail-collapse chevron doesn't make sense once the rail is a
     full-height drawer toggled by the top bar's hamburger button. */
  .side-nav .nav-toggle-btn {
    display: none;
  }
  .side-nav-backdrop.visible {
    display: block;
    position: fixed;
    inset: var(--lf-banner-h, 0px) 0 0 0;
    background: rgba(13, 27, 42, 0.5);
    z-index: 99;
  }
  .main-content {
    padding: 16px;
    margin-left: 0 !important;
  }
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ccc;
  border-top: none;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  max-height: 250px;
  overflow-y: auto;
  z-index: 1000;
}

.autocomplete-prediction {
  padding: 12px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
  transition: background-color 0.2s;
}

.autocomplete-prediction:last-child {
  border-bottom: none;
}

.autocomplete-prediction:hover {
  background-color: #f0f0f0;
}

/* Field Status Labels */
.label-enabled {
  font-size: 0.9rem;
  color: inherit;
  font-weight: normal;
}

.label-invalid {
  font-size: 0.9rem;
  color: #c62828;
  font-weight: 600;
}

.profile-info label.label-enabled {
  color: inherit;
  font-weight: normal;
}

.profile-info label.label-invalid {
  color: #c62828;
  font-weight: 600;
}

.form-row-top {
  display: flex;
  align-items: flex-start;
}

/* ─── Provider Portal: Touch targets ──────────────────────────────────── */
.btn-primary,
.btn-secondary,
.btn-save,
.btn-cancel,
.btn-accept,
.btn-decline {
  min-height: 44px;
  min-width: 44px;
}

/* ─── Contract cards ───────────────────────────────────────────────────── */
.contract-card {
  background: var(--card, #f8f4f0);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(15, 20, 27, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-left: 4px solid var(--accent, #0b4f6c);
  transition: box-shadow 0.2s;
}
.contract-card:active {
  box-shadow: 0 1px 4px rgba(15, 20, 27, 0.12);
}
.contract-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}
.contract-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink, #0f141b);
}
.contract-card-meta {
  font-size: 0.85rem;
  color: var(--muted, #4c5563);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.contract-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* ─── Status pills ─────────────────────────────────────────────────────── */
.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.status-pill.status-pending_provider_agreement { background: #fff3cd; color: #7d5a00; }
.status-pill.status-pending_recipient_acceptance { background: #d1ecf1; color: #0c5460; }
.status-pill.status-activating_contract { background: #e2d9f3; color: #4a235a; }
.status-pill.status-in_fulfillment { background: #cce5ff; color: #004085; }
.status-pill.status-ready_for_delivery { background: #d4edda; color: #155724; }
.status-pill.status-completed { background: #d4edda; color: #155724; }
.status-pill.status-disputed { background: #f8d7da; color: #721c24; }
.status-pill.status-insufficient_funds { background: #fff3cd; color: #7d5a00; }
.status-pill.status-needs_provider { background: #fff3cd; color: #7d5a00; }
.status-pill.status-canceled_by_provider,
.status-pill.status-canceled_by_customer,
.status-pill.status-canceled_by_recipient { background: #f8d7da; color: #721c24; }

/* ─── Earnings summary card ────────────────────────────────────────────── */
.earnings-card {
  background: linear-gradient(120deg, var(--accent, #0b4f6c) 0%, #106581 100%);
  color: #fff;
  border-radius: 16px;
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.earnings-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}
.earnings-stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
}
.earnings-stat-label {
  font-size: 0.72rem;
  opacity: 0.85;
}

/* ─── Wallet section ───────────────────────────────────────────────────── */
.profile-wallet-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.wallet-display-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.btn-copy {
  background: none;
  border: 1px solid rgba(15, 20, 27, 0.2);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--accent, #0b4f6c);
  transition: background 0.15s;
  min-height: 32px;
}
.btn-copy:hover {
  background: rgba(11, 79, 108, 0.08);
}

/* ─── Communications / messages layout ────────────────────────────────── */
.comms-layout {
  display: flex;
  height: calc(100vh - 200px);
  min-height: 400px;
  gap: 0;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  margin-top: 16px;
}
.comms-contract-list {
  width: 260px;
  flex-shrink: 0;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: #fafafa;
}
.comms-contract-item {
  padding: 14px 16px;
  cursor: pointer;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: background 0.15s;
  min-height: 44px;
}
.comms-contract-item.active { background: rgba(11, 79, 108, 0.1); }
.comms-contract-item:hover  { background: rgba(11, 79, 108, 0.06); }
.comms-thread-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
}
.comms-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.message-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.4;
  word-break: break-word;
}
.message-bubble.sent {
  align-self: flex-end;
  background: var(--accent, #0b4f6c);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.message-bubble.received {
  align-self: flex-start;
  background: #e9ecef;
  color: var(--ink, #0f141b);
  border-bottom-left-radius: 4px;
}
.message-timestamp {
  font-size: 0.7rem;
  opacity: 0.65;
  margin-top: 3px;
  display: block;
}
.comms-input-bar {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  align-items: flex-end;
}
.comms-input-bar textarea,
.message-input {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  resize: none;
  border: 1px solid rgba(15, 20, 27, 0.15);
  border-radius: 12px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
}
.comms-input-bar textarea:focus,
.message-input:focus {
  border-color: var(--accent, #0b4f6c);
  box-shadow: 0 0 0 3px rgba(11, 79, 108, 0.15);
}
.comms-send-btn {
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--accent, #0b4f6c);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.comms-send-btn:hover {
  background: #0d6288;
}
.comms-back-btn {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border: none;
  background: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent, #0b4f6c);
  cursor: pointer;
  min-height: 44px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  width: 100%;
  text-align: left;
}

/* ─── Mobile overrides ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .earnings-card {
    padding: 14px 10px;
    gap: 8px;
  }
  .earnings-stat-value { font-size: 1.2rem; }

  .comms-layout {
    flex-direction: column;
    height: auto;
    min-height: unset;
  }
  .comms-contract-list {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    max-height: 220px;
  }
  .comms-thread-panel {
    display: none;
  }
  .comms-thread-panel.full-screen {
    display: flex;
    position: fixed;
    inset: 50px 0 0 0;
    background: #fff;
    z-index: 200;
    flex-direction: column;
  }
  .comms-back-btn {
    display: flex;
  }
  .message-bubble {
    max-width: 85%;
  }
}

@media (max-width: 480px) {
  .contract-card { padding: 12px; }
  .contract-card-title { font-size: 0.95rem; }
  .earnings-card { padding: 10px 6px; gap: 6px; }
  .earnings-stat-value { font-size: 1rem; }
}
