/* Fva Connect visual system. Dark shell, emerald actions, gold After Hours.
   Loaded after the page so these tokens win over earlier one-off rules. */

:root {
  --fva-bg: #040d0c;
  --fva-bg-elev: #0b201d;
  --fva-card: #102824;
  --fva-card-2: #14312c;
  --fva-border: rgba(167, 243, 208, 0.16);
  --fva-text: #f4f7f6;
  --fva-text-soft: #d5e0db;
  --fva-text-muted: #c5d4ce;
  --fva-accent: #10b981;
  --fva-accent-strong: #047857;
  --fva-accent-text: #6ee7b7;
  --fva-amber: #f59e0b;
  --fva-gold: #c9a06b;
  --fva-deep: #003a34;
  --fva-danger: #fca5a5;
  --fva-radius: 16px;
  --fva-radius-sm: 10px;
  --fva-radius-pill: 999px;
  --fva-space: 16px;
  --fva-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  --fva-font: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --fva-text-xs: 0.8125rem;
  --fva-text-sm: 0.9375rem;
  --fva-text-md: 1.0625rem;
  --fva-text-lg: 1.375rem;
  --fva-text-xl: 1.75rem;
  --fva-nav-h: 64px;
}

html { font-size: 16px; }
body {
  font-family: var(--fva-font);
  line-height: 1.5;
  color: var(--fva-text);
  background: var(--fva-bg);
}

/* Type scale inside the signed-in shell. Captions stay above AA on the near-black ground. */
#appView { font-size: var(--fva-text-sm); color: var(--fva-text); }
#appView h2 { font-size: var(--fva-text-lg); line-height: 1.25; font-weight: 700; color: var(--fva-text); }
#appView h3, #appView h4 { color: var(--fva-text); font-weight: 700; }
html[data-theme="dark"] #appView .text-gray-300,
html.dark #appView .text-gray-300 { color: var(--fva-text-soft) !important; }
html[data-theme="dark"] #appView .text-gray-400,
html[data-theme="dark"] #appView .text-gray-500,
html[data-theme="dark"] #appView .text-gray-600,
html.dark #appView .text-gray-400,
html.dark #appView .text-gray-500,
html.dark #appView .text-gray-600 { color: var(--fva-text-muted) !important; }
html[data-theme="dark"] #keptTabs h2,
html[data-theme="dark"] #keptTabs h3,
html[data-theme="dark"] #keptTabs h4,
html[data-theme="dark"] [style*="003A34"],
html.dark #keptTabs h2,
html.dark [style*="003A34"] { color: var(--fva-text) !important; }

/* Header: deep green bar, gold rule. Exact token strings also live in index.html. */
.app-header {
  background: #003A34;
  border-bottom: 4px solid #C9A06B;
}
.app-brand { font-size: 1.05rem !important; letter-spacing: -0.02em; }
.app-logo { display: block; }
.app-menu-brand { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; }
.app-menu-mark { width: 40px; height: 40px; flex: 0 0 auto; display: block; }
.app-menu-word { color: #F7F3EA; font-weight: 700; letter-spacing: 0.28em; font-size: 13px; }

/* Cards that were painted white to fight the dark shell. Match the shell instead. */
html[data-theme="dark"] #fv-box,
html.dark #fv-box {
  background: var(--fva-card) !important;
  color: var(--fva-text) !important;
  border: 1px solid var(--fva-gold) !important;
}
html[data-theme="dark"] #fv-box .fv-text,
html[data-theme="dark"] #fv-status,
html[data-theme="dark"] #fv-box .fv-brand,
html.dark #fv-box .fv-text,
html.dark #fv-status,
html.dark #fv-box .fv-brand { color: var(--fva-text) !important; }
html[data-theme="dark"] #fv-box .fv-check,
html.dark #fv-box .fv-check {
  background: var(--fva-bg) !important;
  border-color: var(--fva-gold) !important;
  color: var(--fva-gold) !important;
}

html[data-theme="dark"] .bg-white,
html[data-theme="dark"] #profileModal > div,
html[data-theme="dark"] #wizardModal > div,
html[data-theme="dark"] #otherProfileModal > div,
html[data-theme="dark"] #trialPopupModal > div,
html[data-theme="dark"] #tab-profile .fva-card,
html[data-theme="dark"] #tab-pulse .fva-card,
html[data-theme="dark"] #tab-squads .fva-card,
html[data-theme="dark"] #tab-groups .fva-card,
html[data-theme="dark"] #tab-organisations .fva-card,
html[data-theme="dark"] #tab-admin .bg-white,
html.dark .bg-white,
html.dark #profileModal > div,
html.dark #wizardModal > div,
html.dark #otherProfileModal > div,
html.dark #trialPopupModal > div {
  background: var(--fva-card) !important;
  color: var(--fva-text) !important;
  border-color: var(--fva-border) !important;
}
html[data-theme="dark"] #profileModal,
html[data-theme="dark"] #wizardModal,
html[data-theme="dark"] #otherProfileModal,
html[data-theme="dark"] #trialPopupModal,
html[data-theme="dark"] #tab-profile .fva-card,
html[data-theme="dark"] #tab-pulse .fva-card,
html[data-theme="dark"] #tab-squads .fva-card,
html[data-theme="dark"] #tab-organisations .fva-card,
html[data-theme="dark"] #tab-groups .fva-card,
html[data-theme="dark"] #squadList .bg-white,
html[data-theme="dark"] #homeSquads .bg-white,
html[data-theme="dark"] #orgList .bg-white,
html[data-theme="dark"] #orgView .bg-white,
html[data-theme="dark"] #eventList .bg-white,
html[data-theme="dark"] #groupList .bg-white,
html.dark #profileModal,
html.dark #wizardModal,
html.dark #otherProfileModal,
html.dark #tab-profile .fva-card,
html.dark #squadList .bg-white,
html.dark #orgList .bg-white,
html.dark #orgView .bg-white,
html.dark #eventList .bg-white,
html.dark #groupList .bg-white,
html.dark #homeSquads .bg-white {
  color: var(--fva-text) !important;
}
html[data-theme="dark"] #profileModal p,
html[data-theme="dark"] #profileModal label,
html[data-theme="dark"] #profileModal h3,
html[data-theme="dark"] #profileModal h4,
html[data-theme="dark"] #wizardModal p,
html[data-theme="dark"] #wizardModal label,
html[data-theme="dark"] #wizardModal h3,
html[data-theme="dark"] #wizardModal h4,
html[data-theme="dark"] #otherProfileModal p,
html[data-theme="dark"] #otherProfileModal h3,
html[data-theme="dark"] #tab-profile .fva-card p,
html[data-theme="dark"] #tab-profile .fva-card label,
html[data-theme="dark"] #tab-profile .fva-card h3,
html[data-theme="dark"] #tab-squads .fva-card p,
html[data-theme="dark"] #tab-squads .fva-card h3,
html[data-theme="dark"] #tab-organisations .fva-card p,
html[data-theme="dark"] #tab-organisations .fva-card h3,
html[data-theme="dark"] #tab-groups .fva-card p,
html[data-theme="dark"] #tab-groups .fva-card h3,
html[data-theme="dark"] #tab-pulse .fva-card p,
html[data-theme="dark"] #tab-pulse .fva-card h3,
html.dark #profileModal p,
html.dark #profileModal label,
html.dark #profileModal h3,
html.dark #profileModal h4,
html.dark #wizardModal p,
html.dark #wizardModal label,
html.dark #wizardModal h3,
html.dark #wizardModal h4 {
  color: var(--fva-text) !important;
}
html[data-theme="dark"] #profileModal input,
html[data-theme="dark"] #profileModal select,
html[data-theme="dark"] #profileModal textarea,
html[data-theme="dark"] #wizardModal input,
html[data-theme="dark"] #wizardModal select,
html[data-theme="dark"] #wizardModal textarea,
html[data-theme="dark"] #tab-profile .fva-card input,
html[data-theme="dark"] #tab-profile .fva-card textarea,
html[data-theme="dark"] #tab-squads .fva-card input,
html[data-theme="dark"] #tab-organisations .fva-card input,
html[data-theme="dark"] #tab-groups .fva-card input,
html[data-theme="dark"] #tab-pulse .fva-card input,
html[data-theme="dark"] #orgView input,
html[data-theme="dark"] #orgView select,
html[data-theme="dark"] #orgView textarea,
html.dark #profileModal input,
html.dark #profileModal select,
html.dark #profileModal textarea,
html.dark #wizardModal input,
html.dark #wizardModal select,
html.dark #wizardModal textarea {
  color: var(--fva-text) !important;
  background: var(--fva-bg) !important;
  border-color: var(--fva-border) !important;
}
html[data-theme="dark"] .fva-outline,
html.dark .fva-outline {
  color: var(--fva-text) !important;
  border-color: var(--fva-border) !important;
  background: transparent !important;
}
html[data-theme="dark"] #profileModal > div,
html[data-theme="dark"] #wizardModal > div,
html[data-theme="dark"] #otherProfileModal > div,
html[data-theme="dark"] #trialPopupModal > div {
  max-height: min(88dvh, 820px);
  overflow: auto;
}

/* Press, hover, focus. Motion only when the person has not asked for less. */
button, a, .fva-pill, .glass-card, .feed-tab, .job-filter {
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 120ms ease, opacity 160ms ease;
}
button:hover, .fva-pill:hover, a:hover { filter: brightness(1.06); }
button:active, .fva-pill:active { transform: translateY(1px); }
body :focus-visible { outline: 3px solid var(--fva-gold); outline-offset: 2px; }

.fva-skel { display: grid; gap: 8px; padding: 4px 0; }
.fva-skel span {
  display: block;
  height: 12px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.08), rgba(16, 185, 129, 0.22), rgba(16, 185, 129, 0.08));
  background-size: 200% 100%;
  animation: fva-shimmer 1.2s ease-in-out infinite;
}
.fva-skel span:nth-child(2) { width: 92%; }
.fva-skel span:nth-child(3) { width: 66%; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@keyframes fva-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Cookie choice: a short bar above the phone nav, never a full-width wall. */
#cookieConsentBanner.fva-cookie {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--fva-nav-h) + 10px);
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
  padding: 10px 12px;
  border-radius: var(--fva-radius);
  background: var(--fva-card);
  color: var(--fva-text);
  border: 1px solid var(--fva-border);
  box-shadow: var(--fva-shadow);
}
#cookieConsentBanner.fva-cookie .fva-cookie-copy {
  flex: 1 1 auto;
  margin: 0;
  font-size: var(--fva-text-xs);
  line-height: 1.4;
  color: var(--fva-text-soft);
}
#cookieConsentBanner.fva-cookie .fva-cookie-actions { display: flex; gap: 8px; flex: 0 0 auto; }
#cookieConsentBanner.fva-cookie button { min-height: 44px; padding: 8px 14px; border-radius: var(--fva-radius-pill); font-weight: 700; font-size: var(--fva-text-xs); }
#cookieConsentBanner.fva-cookie .fva-cookie-accept { background: var(--fva-accent-strong); color: #fff; border: 0; }
#cookieConsentBanner.fva-cookie .fva-cookie-decline { background: transparent; color: var(--fva-text); border: 1px solid var(--fva-border); }

/* Desktop: wider column and a top nav in place of the fixed bottom bar. */
@media (min-width: 1024px) {
  #appView .app-column { max-width: 1120px !important; padding-bottom: 32px !important; }
  #appView > nav.app-nav,
  nav.app-nav {
    position: sticky;
    top: 76px;
    bottom: auto;
    left: auto;
    right: auto;
    z-index: 35;
    border-top: 0;
    border-bottom: 1px solid var(--fva-border);
    background: rgba(0, 58, 52, 0.96);
    padding: 8px 16px !important;
  }
  nav.app-nav .nav-row {
    max-width: 1120px;
    justify-content: flex-start;
    gap: 6px;
  }
  nav.app-nav .nav-row > button {
    flex-direction: row;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--fva-radius-pill);
    font-size: 0.95rem;
    min-height: 44px;
  }
  #cookieConsentBanner.fva-cookie { bottom: 16px; }
  #sectionFeed, #sectionProfile { display: block; }
  .page-with-rail:not(.hidden) { display: grid !important; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
  .page-with-rail > .page-rail { grid-column: 2; grid-row: 1 / span 24; position: sticky; top: 148px; }
  .page-with-rail > :not(.page-rail) { grid-column: 1; }
}

/* Profile, wide cover, overlapping portrait, section cards. */
.profile-layout { display: grid; gap: 16px; }
@media (min-width: 1024px) {
  .profile-layout { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
  .profile-rail { position: sticky; top: 148px; }
}
.profile-hero { padding: 0 !important; overflow: hidden; border-radius: var(--fva-radius); }
.profile-hero-body { padding: 0 16px 16px; }
.profile-id-row { display: flex; gap: 14px; align-items: flex-end; margin-top: -48px; }
.profile-avatar-wrap { position: relative; flex: 0 0 auto; }
.profile-avatar {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  border: 4px solid var(--fva-bg);
  background: var(--fva-bg-elev);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-weight: 800;
  font-size: 1.75rem;
  color: var(--fva-accent-text);
  box-shadow: var(--fva-shadow);
}
.profile-avatar-cam {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--fva-accent-strong);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.profile-name { margin: 8px 0 0; font-size: var(--fva-text-xl); line-height: 1.15; font-weight: 800; }
.profile-headline { margin: 4px 0 0; font-size: var(--fva-text-md); color: var(--fva-text-soft); }
.profile-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 6px 0 0; color: var(--fva-text-muted); font-size: var(--fva-text-sm); }
.profile-conn {
  background: none;
  border: 0;
  padding: 0;
  min-height: 44px;
  color: var(--fva-accent-text);
  font-weight: 700;
  cursor: pointer;
}
.profile-conn:hover { text-decoration: underline; }
.profile-actions, .profile-photo-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.fva-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: var(--fva-radius-pill);
  border: 1px solid var(--fva-border);
  background: transparent;
  color: var(--fva-text);
  font-weight: 700;
  font-size: var(--fva-text-sm);
}
.fva-pill-solid { background: var(--fva-accent-strong); border-color: var(--fva-accent-strong); color: #fff; }
.fva-menu { position: relative; }
.fva-menu-pop {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  min-width: 200px;
  padding: 6px;
  border-radius: var(--fva-radius-sm);
  background: var(--fva-card-2);
  border: 1px solid var(--fva-border);
  box-shadow: var(--fva-shadow);
  display: grid;
}
.fva-menu-pop button {
  text-align: left;
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: var(--fva-text);
  border-radius: 8px;
  font-weight: 600;
}
.fva-menu-pop button:hover { background: rgba(16, 185, 129, 0.15); }
.li-section {
  padding: 16px !important;
  border-radius: var(--fva-radius);
  display: grid;
  gap: 10px;
}
.li-section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.li-section-head h3 { margin: 0; font-size: 1.05rem; }
.fva-pencil {
  width: 44px;
  height: 44px;
  min-height: 44px;
  border-radius: 50%;
  border: 1px solid var(--fva-border);
  background: transparent;
  color: var(--fva-text-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.fva-pencil:hover { color: #fff; background: rgba(16, 185, 129, 0.2); }
.fva-empty {
  background: none;
  border: 0;
  padding: 0;
  min-height: 44px;
  color: var(--fva-accent-text);
  font-weight: 700;
  text-align: left;
}
.profile-note { color: var(--fva-text-muted); font-size: var(--fva-text-xs); }
.profile-note summary { min-height: 44px; display: inline-flex; align-items: center; cursor: pointer; color: var(--fva-text-soft); }
.profile-skills { display: flex; flex-wrap: wrap; gap: 8px; }
.page-rail .glass-card, .profile-rail .glass-card { padding: 16px; }
.session-list { display: grid; gap: 8px; }
.session-row { padding: 10px 12px; border: 1px solid var(--fva-border); border-radius: var(--fva-radius-sm); }
.session-more { min-height: 44px; }

.open-badge { position:absolute; left:50%; bottom:-6px; transform:translateX(-50%); background:#047857; color:#fff; font-size:10px; font-weight:800; letter-spacing:.04em; padding:2px 8px; border-radius:999px; border:2px solid var(--fva-bg); white-space:nowrap; }
.verify-pill { margin-top:8px; min-height:36px; padding:6px 12px; border-radius:999px; border:1px solid var(--fva-border); background:transparent; color:var(--fva-accent-text); font-weight:700; font-size:var(--fva-text-xs); }
.profile-org { margin:6px 0 0; color:var(--fva-text-soft); font-size:var(--fva-text-sm); }
.fva-more { width:44px; padding:0; border-radius:50%; font-size:1.25rem; line-height:1; }
.week-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.week-tile { border:1px solid var(--fva-border); border-radius:12px; padding:12px; display:grid; gap:4px; }
.week-tile strong { font-size:1.5rem; line-height:1; }
.week-tile span, .week-tile em { font-style:normal; color:var(--fva-text-muted); font-size:var(--fva-text-xs); }
.net-switch { display:flex; gap:8px; }
.net-switch button { flex:1; min-height:44px; border-radius:999px; border:1px solid var(--fva-border); background:transparent; color:var(--fva-text-soft); font-weight:700; }
.net-switch button.is-on { background:#047857; color:#fff; border-color:#047857; }
.verify-banner { width:100%; text-align:left; min-height:44px; padding:12px; border-radius:12px; border:1px solid var(--fva-border); background:rgba(16,185,129,.12); color:var(--fva-text); font-weight:700; }
#profileDrawer #navMessages.app-menu-item, #profileDrawer #navProfile.app-menu-item { flex-direction: column !important; width: auto; }
#globalSearch, #jobSearch, #userSearch { border-radius:999px; }
@media (max-width: 480px) {
  button[aria-label="Settings"] { display: none; }
}

/* Phone: nothing sits under the fixed nav, off the right edge, or outside a modal. */
html {
  overflow-x: hidden;
  max-width: 100%;
}
body {
  overflow-x: hidden;
  max-width: 100%;
  padding-top: env(safe-area-inset-top, 0px);
}
@media (max-width: 1023px) {
  :root { --fva-nav-h: calc(88px + env(safe-area-inset-bottom, 0px)); }
  body,
  #appView .app-column {
    padding-bottom: calc(108px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .app-header {
    padding-top: calc(8px + env(safe-area-inset-top, 0px)) !important;
    padding-left: max(8px, env(safe-area-inset-left, 0px));
    padding-right: max(8px, env(safe-area-inset-right, 0px));
  }
  nav.app-nav {
    padding: 6px max(6px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px)) !important;
  }
  nav.app-nav .nav-row { max-width: 100%; gap: 2px; }
  nav.app-nav .nav-row > button {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    padding: 4px 2px;
    font-size: 10px;
    line-height: 1.15;
  }
  nav.app-nav .nav-row > button span {
    max-width: 100%;
    text-align: center;
    overflow-wrap: anywhere;
  }
  .composer-actions,
  .feed-tabs,
  .job-filters,
  .profile-actions,
  .profile-photo-row,
  #sectionJobs .flex.gap-2,
  #cookieConsentBanner .fva-cookie-actions {
    display: flex;
    flex-wrap: wrap;
    max-width: 100%;
  }
  .composer-actions > * { min-width: 0; }
  .composer-actions select { max-width: calc(50% - 8px); }
  #publishBtn { margin-left: auto; }
  .feed-tab, .job-filter { flex: 1 1 auto; flex-shrink: 1 !important; }
  #storiesBar { max-width: 100%; }
  #toast, #chatNotifPopup, #refreshNotice {
    left: 12px !important;
    right: 12px !important;
    max-width: calc(100vw - 24px);
    box-sizing: border-box;
  }
  #toast, #chatNotifPopup {
    bottom: calc(112px + env(safe-area-inset-bottom, 0px)) !important;
  }
  #cookieConsentBanner.fva-cookie {
    flex-wrap: wrap;
    left: max(8px, env(safe-area-inset-left, 0px));
    right: max(8px, env(safe-area-inset-right, 0px));
    width: auto;
    max-width: none;
    bottom: calc(112px + env(safe-area-inset-bottom, 0px));
  }
  body[data-shell="auth"] #cookieConsentBanner.fva-cookie {
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
  body[data-shell="auth"] #authView {
    padding-bottom: calc(128px + env(safe-area-inset-bottom, 0px));
  }
  #profileModal,
  #wizardModal,
  #otherProfileModal,
  #trialPopupModal {
    align-items: flex-start;
    overflow-y: auto;
    overscroll-behavior: contain;
    height: 100dvh;
    max-height: 100dvh;
    box-sizing: border-box;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 12px calc(16px + env(safe-area-inset-bottom, 0px));
  }
  #profileModal > div,
  #wizardModal > div,
  #otherProfileModal > div,
  #trialPopupModal > div,
  #wizardModal > div.wizard-scroll-panel {
    width: min(100%, 32rem);
    max-height: none !important;
    overflow: visible !important;
    margin: 0 auto 12px;
  }
  #profileDrawer > div {
    height: 100dvh;
    max-height: 100dvh;
    box-sizing: border-box;
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
}
@media (max-width: 1023px) and (max-height: 500px) {
  nav.app-nav .nav-row > button { min-height: 44px; padding-top: 2px; padding-bottom: 2px; }
  body, #appView .app-column {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
  }
}
#jobList, .job-filter { scroll-margin-top:8px; }
.flex.items-center.gap-2.overflow-x-auto, #sectionJobs .overflow-x-auto { display:flex; gap:8px; overflow-x:auto; }

.feed-tab[data-active="true"] {
  background: var(--fva-accent-strong) !important;
  color: #fff !important;
  font-weight: 700;
}
.job-description { padding-top: 8px; border-top: 1px solid var(--fva-border); }
#jobDetailBox.is-open { scroll-margin-top: 88px; }

.token-swatch { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--fva-border); font-size: var(--fva-text-xs); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  button:active, .fva-pill:active { transform: none !important; }
}

/* App launcher: every real page, grouped. Phone sheet covers the nav. Desktop is a panel. */
@media (max-width: 399px) {
  .app-brand { display: none; }
}
.app-menu { display: grid; gap: 4px; }
.app-menu-group h3 {
  margin: 12px 0 8px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fva-text-muted);
}
.app-menu-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.app-menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 76px;
  padding: 8px 4px;
  border-radius: 14px;
  border: 1px solid var(--fva-border);
  background: transparent;
  color: var(--fva-text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}
.app-menu-item svg, .app-menu-item i { width: 22px; height: 22px; }
.app-menu-count {
  min-width: 1.25rem;
  min-height: 1.25rem;
  padding: 0 4px;
  border-radius: 999px;
  background: #047857;
  color: #fff;
  font-size: 11px;
}
.app-menu-count:empty { display: none; }
#appMenuAdmin:has(#drawerAdminRow.hidden) { display: none; }
#verifyBanner.app-menu-item { width: auto; text-align: center; background: transparent; }

/* Sign-in gate: cream form, deep green brand panel, gold ring. */
body[data-shell="auth"] {
  min-height: 100vh;
  min-height: 100dvh;
  background: #071512;
}
#authView.auth-shell {
  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 32rem;
  margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px));
}
.auth-brand-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.auth-mark {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  display: block;
  border: 0;
  background: transparent;
  border-radius: 16px;
}
#authView h1 {
  margin: 0;
  color: #F7F3EA;
  font-size: 1.75rem;
  line-height: 1.2;
  font-weight: 800;
}
#authView .login-gate-tagline { color: #E7D7B8; margin: 4px 0 0; font-size: 0.95rem; }
#authView .auth-card {
  background: #F7F3EA !important;
  color: #14221F !important;
  border: 1px solid #E4D3B0 !important;
  border-radius: 20px !important;
  box-shadow: none !important;
}
#authView .auth-card-title { margin: 0; font-size: 1.25rem; font-weight: 800; color: #14221F; }
#authView .login-gate-label,
#authView .auth-consent { color: #14221F; }
#authView .auth-input {
  background: #fff;
  color: #14221F;
  border: 1px solid #C4B498;
}
#authView .auth-input::placeholder { color: #4B5563; opacity: 1; }
#authView .login-gate-showhide {
  color: #14221F;
  border-color: #14221F;
  background: transparent;
}
#authView .auth-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  font-size: 0.95rem;
}
#authView .auth-consent input { width: 24px; height: 24px; margin-top: 2px; flex: 0 0 auto; }
#authView .auth-consent a { color: #065F46; font-weight: 700; }
.auth-actions { display: grid; }
.auth-submit {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  background: #047857;
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
}
.auth-submit:disabled { opacity: 0.7; cursor: progress; }
#authView .auth-provider {
  background: transparent !important;
  color: #14221F !important;
  border: 1px solid #14221F !important;
}
#authView #authModeSwitchBtn { color: #065F46 !important; }
#authView #authMsg { color: #7F1D1D; }
#authView .login-pro-help { border-top-color: #E4D3B0; }
#authView .login-pro-help summary,
#authView .login-pro-help p { color: #14221F; }
#authView #authStatus { color: #E7D7B8; min-height: 0; margin: 0 0 8px; }
#authView #fvaverifyState { color: #3F4A45 !important; }
#fv-box { margin-top: 8px !important; }
body[data-shell="auth"] #authView.auth-shell {
  padding-bottom: calc(128px + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 960px) {
  #authView.auth-shell {
    max-width: none;
    width: 100%;
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(340px, 480px);
    padding: 0;
    margin: 0;
  }
  .auth-brand-panel {
    min-height: 100dvh;
    margin: 0;
    padding: calc(48px + env(safe-area-inset-top, 0px)) 48px 48px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    background:
      linear-gradient(165deg, rgba(201, 160, 107, 0.18), transparent 42%),
      #003A34;
  }
  .auth-mark { width: 84px; height: 84px; }
  #authView h1 { font-size: 2.5rem; }
  .auth-form-wrap {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100dvh;
    padding: 32px 32px 120px;
    background: #F3EFE4;
    box-sizing: border-box;
  }
  #authView .auth-form-wrap #authStatus { color: #3F4A45; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-brand-panel { background: #003A34; }
}
.logo-preview-stage {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  padding: 16px;
  border-radius: 16px;
  background: #003A34;
}
.logo-preview-full { width: 96px; height: 96px; display: block; }
.logo-preview-small { width: 32px; height: 32px; display: block; }
.logo-preview-mono { width: 48px; height: 48px; display: block; color: #F7F3EA; background: #F7F3EA; border-radius: 12px; }
.logo-preview-lockup { display: flex; align-items: center; gap: 12px; }
.logo-preview-lockup svg { width: 48px; height: 48px; display: block; }
.logo-preview-lockup span {
  color: #F7F3EA;
  font-weight: 700;
  letter-spacing: 0.28em;
  font-size: 18px;
}
/* Signed-out cookie sits in the page flow so it does not cover Sign in or Create account. */
@media (max-width: 959px) {
  body[data-shell="auth"] {
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
  }
  body[data-shell="auth"] #authView.auth-shell {
    min-height: 0;
    padding-bottom: 8px !important;
  }
  body[data-shell="auth"] #cookieConsentBanner.fva-cookie {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    width: auto !important;
    max-width: 32rem;
    margin: 12px auto calc(12px + env(safe-area-inset-bottom, 0px));
  }
}
@media (min-width: 960px) {
  body[data-shell="auth"] #cookieConsentBanner.fva-cookie {
    left: 32px;
    right: auto;
    bottom: 32px;
    width: min(420px, calc(50vw - 80px));
    margin: 0;
  }
}
#profileDrawer > div { overflow-y: auto; }
@media (max-width: 1023px) {
  body[data-shell="app"],
  body[data-shell="app"] #appView .app-column {
    padding-bottom: calc(200px + env(safe-area-inset-bottom, 0px)) !important;
  }
}
button, a, label, input, select, textarea { touch-action: manipulation; }
input, select, textarea { font-size: 16px !important; }
@media (min-width: 1024px) {
  #profileDrawer { align-items: flex-start; justify-content: flex-end; padding: 76px 16px 16px; }
  #profileDrawer > div {
    width: min(440px, calc(100vw - 32px));
    height: auto;
    max-height: min(78dvh, 760px);
    border-radius: 16px;
    border: 1px solid var(--fva-border);
  }
}
