/* ActivityX UI system: consistent surfaces, spacing and alignment across app screens. */
:root {
  --gutter: 18px;
  --radius: 18px;
  --background: #F5F7FA;
  --foreground: #172033;
  --ink: #172033;
  --card: #FFFFFF;
  --card-foreground: #172033;
  --surface: #FFFFFF;
  --surface-elevated: #FFFFFF;
  --secondary: #EEF2F7;
  --secondary-foreground: #334155;
  --muted: #F1F4F8;
  --muted-foreground: #66758A;
  --accent: #EAF2FF;
  --accent-foreground: #1557AE;
  --border: #E2E8F0;
  --input: #FFFFFF;
  --ring: #1877F2;
  --primary: #1877F2;
  --primary-foreground: #FFFFFF;
  --bg-canvas: var(--background);
  --bg-surface: var(--card);
  --bg-elevated: var(--surface-elevated);
  --text-primary: var(--foreground);
  --text-secondary: var(--muted-foreground);
  --action-primary: var(--primary);
  --focus-ring: var(--ring);
  --card-outline: #E5EAF1;
  --card-tint: #FFFFFF;
  --glass-surface: color-mix(in srgb, var(--surface-elevated) 86%, transparent);
  --glass-border: color-mix(in srgb, var(--border) 90%, transparent);
  --shadow-card: 0 4px 16px -12px rgba(20, 37, 62, .28);
  --shadow-soft: 0 6px 18px -12px rgba(24, 119, 242, .36);
  --shadow-elevated: 0 14px 32px -20px rgba(20, 37, 62, .38);
}

.dark {
  --background: #0B1017;
  --foreground: #F4F7FB;
  --ink: #F4F7FB;
  --card: #141C27;
  --card-foreground: #F4F7FB;
  --surface: #141C27;
  --surface-elevated: #192331;
  --secondary: #1D2938;
  --secondary-foreground: #E4EBF4;
  --muted: #1A2431;
  --muted-foreground: #A5B1C0;
  --accent: #172B45;
  --accent-foreground: #BBD8FF;
  --border: #293748;
  --input: #141C27;
  --ring: #6AA9FF;
  --primary: #287FF0;
  --primary-foreground: #FFFFFF;
  --card-outline: #293849;
  --card-tint: #141C27;
  --glass-surface: color-mix(in srgb, #141C27 88%, transparent);
  --glass-border: #2A394B;
  --shadow-card: 0 7px 22px -15px rgba(0, 0, 0, .74);
  --shadow-soft: 0 7px 20px -13px rgba(40, 127, 240, .45);
  --shadow-elevated: 0 16px 40px -22px rgba(0, 0, 0, .8);
}

html, body, #axh-root, .axh-frame { background: var(--background); color: var(--foreground); }
html, body { font-family: var(--font-sans); font-size: 14px; line-height: 1.45; }
body { letter-spacing: -.01em; }
.axi { stroke-linecap: round; stroke-linejoin: round; }
button, input, textarea, select { font: inherit; }
button:focus-visible, a:focus-visible, select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 42%, transparent);
  outline-offset: 2px;
}
input:focus-visible, textarea:focus-visible { outline: 0; }
.axh-frame { max-width: 480px; }
.ax-col, .ax-scroll, .axh-frame, .axh-screen { min-width: 0; }
.ax-scroll { overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; }
.ax-stack { gap: 22px; }
.ax-end { height: calc(104px + env(safe-area-inset-bottom)); }
.ax-avatar-fallback { display: inline-grid; place-items: center; flex-shrink: 0; overflow: hidden; background: var(--muted); color: var(--foreground); font-weight: 800; text-transform: uppercase; }

/* Shared screen headers and controls */
.ax-topbar, .ax-crh2, .ax-aih {
  color: var(--foreground);
  border-color: var(--border);
  background: color-mix(in srgb, var(--background) 88%, transparent);
  backdrop-filter: blur(22px) saturate(155%);
  -webkit-backdrop-filter: blur(22px) saturate(155%);
}
.ax-topbar { min-height: 54px; padding-inline: var(--gutter); }
.ax-topbar h1 { font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: -.025em; }
.ax-back, .ax-rbtn, .ax-iconbtn, .ax-ib, .ax-fb {
  color: var(--foreground);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: none;
}
.ax-rbtn { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 14px; }
.ax-homebar { gap: 12px; padding-inline: var(--gutter); }
.ax-homebar .n { font-size: 19px; line-height: 25px; letter-spacing: -.03em; }
.ax-homebar .g { font-size: 12px; }
.ax-iconbtn { width: 42px; height: 42px; border-radius: 15px; }
.ax-clh, .ax-cth { padding-inline: var(--gutter); }
.ax-clh h1, .ax-cth h1, .ax-nthead h1 { font-family: var(--font-display); letter-spacing: -.035em; }
.ax-sh { padding-inline: var(--gutter); }
.ax-sh h1 { font-size: clamp(25px, 7vw, 30px); letter-spacing: -.04em; }

/* Surface language and card rhythm shared by feed, activities, clubs, chat and settings. */
.ax-card2, .ax-acard, .ax-club, .ax-person, .ax-up, .ax-feed li, .ax-pc,
.ax-nclub, .ax-biz, .ax-prson, .ax-sgc, .ax-lcard, .ax-cli, .ax-ni, .ax-pact,
.ax-vfeed-card, .ax-full-post, .ax-social-post, .ax-post-create-panel {
  border-color: var(--card-outline);
  background-color: var(--card);
  box-shadow: var(--shadow-card);
}
.ax-card2, .ax-vfeed-card, .ax-full-post, .ax-social-post, .ax-post-create-panel { border-radius: 20px; }
.ax-card2 { padding: 16px; }
.ax-stack > section { min-width: 0; }
.ax-sech { margin-bottom: 12px; }
.ax-sech h2 { font-size: 17px; line-height: 23px; letter-spacing: -.025em; }
.ax-sech p { font-size: 12px; line-height: 17px; }
.ax-sbar, .ax-usb form, .ax-search { border-color: var(--border); background: var(--card); box-shadow: none; }
.ax-input, .ax-search, .ax-textarea, .ax-fi, .ax-ta, .ax-otp input {
  border-color: var(--border);
  background-color: var(--card);
  color: var(--foreground);
}
.ax-input:focus-within, .ax-search:focus-within, .ax-fi:focus, .ax-ta:focus,
.ax-usb form:focus-within, .ax-acomp form:focus-within, .ax-inp:focus, input:focus-visible, textarea:focus-visible { outline: none; border-color: var(--border); box-shadow: none; }
.ax-avatar-fallback { display: grid !important; place-items: center !important; overflow: hidden; border-radius: 50%; background: var(--muted); color: var(--muted-foreground); font-weight: 700; }
.ax-btn { min-height: 46px; height: 46px; border-radius: 15px; font-weight: 700; }
.ax-btn-primary { border: 0; background: var(--primary); box-shadow: 0 5px 15px -9px color-mix(in srgb, var(--primary) 80%, transparent); }
.ax-btn-glass, .ax-sbtn.outline, .ax-sm.outline { border: 1px solid var(--border); background: var(--card); color: var(--foreground); }
.ax-pill { border-color: var(--border); background: var(--card); color: var(--foreground); }
.ax-pill.on { border-color: var(--primary); background: var(--primary); color: #fff; }
.ax-tabs { gap: 8px; }
.ax-tabs .ax-pill { min-height: 36px; padding-inline: 13px; }

/* Main feed and activity cards */
.ax-home > .ax-stack, .ax-home #dyn.ax-stack { gap: 24px; }
.ax-acard { flex-basis: min(78vw, 340px); border-radius: 19px; }
.ax-acard .im { height: 194px; }
.ax-acard .bd { gap: 11px; padding: 14px; }
.ax-acard h3 { min-height: 0; font-size: 15px; line-height: 21px; }
.ax-list, .ax-vfeed, .ax-social-list, .ax-clgrid { gap: 12px; }
.ax-vfeed-card, .ax-full-post, .ax-social-post { overflow: hidden; }
.ax-feed, .ax-list { padding-inline: var(--gutter); }

/* Profile hero and edit sheet: keep the avatar/actions inside safe areas. */
.ax-pbn { height: 216px; }
.ax-pbn.ax-pbn-safe { height: 246px; padding-top: env(safe-area-inset-top); }
.ax-pbn.ax-pbn-safe .ac { top: env(safe-area-inset-top); }
.ax-pbn-safe + .ax-ph { margin-top: 0; padding: 44px var(--gutter) 0; }
.ax-pbn-safe + .ax-ph .av { width: 96px; height: 96px; flex-basis: 96px; margin-top: 0; }
.ax-pbn-safe + .ax-ph .av img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.ax-ph { gap: 7px; }
.ax-ph h1 { overflow-wrap: anywhere; }
.ax-ph .row { gap: 9px; }
.ax-ph .row .ax-btn, .ax-ph .row .sq { min-height: 44px; height: 44px; border-radius: 14px; }
.ax-bs.ax-profile-edit-panel { padding-top: max(env(safe-area-inset-top), 12px); }
.ax-bs.ax-profile-edit-panel .panel { max-height: calc(var(--axh-viewport-height, 100dvh) - max(env(safe-area-inset-top), 12px) - 8px); }
.ax-profile-edit-panel .ax-edf { scroll-padding-block: 18px 160px; }

/* Notifications: one vertical scroller, wrapped filters and unclipped cards. */
#nsp { min-height: 0; min-width: 0; overflow-x: hidden; overflow-y: auto; touch-action: pan-y; }
#nsp > .ax-nthead { position: sticky; top: 0; z-index: 25; padding-inline: var(--gutter); background: color-mix(in srgb, var(--background) 90%, transparent); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); }
#nsp #ntb { min-width: 0; }
#nsp .ax-tabs.n { display: flex; flex-wrap: wrap; overflow: visible; padding-inline: var(--gutter); }
#nsp #nb2 { display: flex; flex: 0 0 auto; flex-direction: column; gap: 22px; min-height: max-content; overflow: visible; padding-bottom: calc(104px + env(safe-area-inset-bottom)) !important; }
#nsp #nb2 > section { min-width: 0; max-width: 100%; }
#nsp .ax-rem-list { gap: 10px; padding-inline: var(--gutter); }
#nsp .ax-rem-list .ax-rem { width: 100%; min-width: 0; min-height: 132px; height: auto; flex: none; border-radius: 18px; }
#nsp .ax-ni { min-width: 0; max-width: calc(100% - var(--gutter) * 2); margin-inline: var(--gutter); border: 1px solid var(--card-outline); border-radius: 16px; background: var(--card); }

/* Home recent activity: compact, connected timeline rows that follow either theme. */
.ax-home .ax-feed {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 var(--gutter);
  padding: 0;
  list-style: none;
}
.ax-home .ax-feed::before {
  position: absolute;
  z-index: 0;
  top: 36px;
  bottom: 36px;
  left: 35px;
  width: 1px;
  background: color-mix(in srgb, var(--border) 78%, var(--primary) 22%);
  content: "";
}
.ax-home .ax-feed > li {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--card-outline);
  border-radius: 22px;
  background: var(--card-tint);
  box-shadow: var(--shadow-card);
}
.ax-home .ax-feed > li > img,
.ax-home .ax-feed > li > .ph,
.ax-home .ax-feed > li > .ax-avatar-fallback {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 2px solid var(--card-tint);
  border-radius: 50%;
  background: var(--muted);
  color: var(--muted-foreground);
  object-fit: cover;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--border) 70%, transparent);
}
.ax-home .ax-feed .tx { min-width: 0; flex: 1; }
.ax-home .ax-feed .tx p { margin: 0; }
.ax-home .ax-feed .l {
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 19px;
  color: var(--foreground);
}
.ax-home .ax-feed .l b { font-weight: 700; }
.ax-home .ax-feed .l span { color: var(--muted-foreground); }
.ax-home .ax-feed .l u { color: var(--primary); font-weight: 650; text-decoration: none; }
.ax-home .ax-feed .tm { margin-top: 2px; font-size: 11.5px; line-height: 16px; color: var(--muted-foreground); }
@media (max-width: 360px) {
  .ax-home .ax-feed > li { gap: 10px; padding: 10px; border-radius: 19px; }
  .ax-home .ax-feed::before { left: 32px; }
}

/* Welcome brand placement and category discovery polish. */
.ax-welcome-brand {
  position: absolute;
  z-index: 10;
  top: max(48px, calc(env(safe-area-inset-top) + 16px));
  left: var(--gutter);
  display: grid;
  place-items: center;
  width: 104px;
  height: 74px;
  padding: 7px 9px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 19px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 12px 32px -16px rgba(0,0,0,.52), inset 0 1px 0 rgba(255,255,255,.9);
  animation-delay: .06s;
}
.ax-welcome-brand img { width: 100%; height: 100%; object-fit: contain; }
.ax-hs {
  gap: 10px;
  padding-right: var(--gutter);
  scroll-padding-inline: var(--gutter);
  touch-action: pan-x;
}
.ax-cat {
  flex: 0 0 auto;
  flex-direction: row;
  min-height: 46px;
  gap: 8px;
  padding: 0 14px;
  border-color: var(--card-outline);
  border-radius: 999px;
  box-shadow: var(--shadow-card);
  transition: background-color .22s ease, color .22s ease, border-color .22s ease, box-shadow .22s ease, transform .22s cubic-bezier(.2,.8,.2,1);
  animation: ax-slide-up .42s cubic-bezier(.2,.8,.2,1) both;
}
.ax-cat:nth-child(2) { animation-delay: .04s; }
.ax-cat:nth-child(3) { animation-delay: .08s; }
.ax-cat:nth-child(4) { animation-delay: .12s; }
.ax-cat:nth-child(5) { animation-delay: .16s; }
.ax-cat:nth-child(n+6) { animation-delay: .2s; }
.ax-cat .ic {
  width: 18px;
  height: 18px;
  border-radius: 0;
  color: var(--primary);
  transition: background-color .22s ease, color .22s ease, transform .22s cubic-bezier(.2,.8,.2,1);
}
.ax-cat .ic .axi { width: 20px; height: 20px; }
.ax-cat .l { font-size: 12.5px; line-height: 17px; letter-spacing: -.01em; white-space: nowrap; }
.ax-cat.on {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--card-outline));
  background: var(--accent);
  color: var(--accent-foreground);
  box-shadow: 0 8px 22px -15px color-mix(in srgb, var(--primary) 70%, transparent);
}
.ax-cat.on .ic { background: transparent; color: var(--primary); }
.ax-cat:active { transform: translateY(1px) scale(.97); }
.ax-cat:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }
.ax-btn, .ax-pill, .ax-iconbtn, .ax-nav-i, .ax-sm, .ax-rbtn, .ax-back {
  transition: transform .18s cubic-bezier(.2,.8,.2,1), background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.ax-btn:active, .ax-pill:active, .ax-iconbtn:active, .ax-nav-i:active, .ax-rbtn:active, .ax-back:active { transform: scale(.97); }
@media (hover: hover) {
  .ax-cat:hover { border-color: color-mix(in srgb, var(--primary) 35%, var(--card-outline)); transform: translateY(-2px); }
  .ax-btn:hover, .ax-pill:hover, .ax-iconbtn:hover { filter: brightness(1.035); }
}

/* Map activity labels show the category and the person hosting each event. */
.ax-social-pin.activity { max-width: 236px; min-height: 52px; border-radius: 17px; }
.ax-social-pin .label.activity { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; gap: 1px; overflow: hidden; white-space: normal; }
.ax-social-pin .label.activity b { display: block; max-width: 174px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; line-height: 14px; }
.ax-social-pin .label.activity small { display: block; max-width: 174px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #647084; font-size: 9.5px; line-height: 13px; font-weight: 600; }
.dark .ax-social-pin .label.activity small { color: #A5B1C0; }

/* Google Identity Services keeps its official branded button inside the app surface. */
.ax-google-auth { padding: 0 20px 14px; animation: ax-slide-up .32s cubic-bezier(.2,.8,.2,1) both; }
.ax-google-auth .ax-or { margin: 0 0 12px; }
.ax-google-button { display: flex; min-height: 44px; align-items: center; justify-content: center; overflow: hidden; }
.ax-google-button iframe { max-width: 100%; }
.ax-google-auth[aria-busy="true"] { opacity: .68; pointer-events: none; }
.ax-google-error { margin: 0; color: var(--muted-foreground); font-size: 12px; line-height: 17px; text-align: center; }

/* iOS Safari: use a stable viewport fallback, safe-area padding and native momentum scrolling. */
#axh-root, .axh-frame { height: var(--axh-viewport-height, 100vh); }
.ax-scroll { -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; }
@supports (height: 100dvh) {
  #axh-root, .axh-frame { height: var(--axh-viewport-height, 100dvh); }
}
#nsp .ax-ni + .ax-ni { margin-top: 8px; }
#nsp .ax-ni .row { min-width: 0; width: 100%; }
#nsp .ax-ni .main { min-width: 0; width: 0; flex: 1; }
#nsp .ax-ni .ac { max-width: 100%; padding-bottom: 12px; }
#nsp .ax-inbox-h { padding-inline: var(--gutter); }

/* Chat list/conversation: align message composer with the live keyboard viewport. */
.ax-cli { border-radius: 16px; }
.ax-cli + .ax-cli { border-top: 0; }
#cr { display: flex; flex-direction: column; min-height: 0; }
#cr #hd, #cr #pb, #cr #cp { flex: 0 0 auto; }
#cr #ms { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 14px; }
.ax-comp { flex: 0 0 auto; padding: 8px 12px max(9px, env(safe-area-inset-bottom)); border-top-color: var(--border); background: color-mix(in srgb, var(--background) 92%, transparent); }
.ax-comp .row { align-items: flex-end; gap: 8px; }
.ax-comp .box { min-height: 44px; border-radius: 22px; border-color: var(--border); background: var(--card); }
.ax-comp textarea { max-height: 112px; min-height: 32px; padding-block: 7px; }
#axh-root.axh-keyboard-open .ax-comp { padding-bottom: 10px; }
.ax-meta2 .ax-receipt.read .axi { color: #55A2FF; }

/* Floating glass navigation stays inset from the device edges. */
.ax-nav {
  left: var(--gutter); right: var(--gutter); bottom: calc(12px + env(safe-area-inset-bottom));
  height: 72px; padding: 6px 9px; border: 1px solid var(--glass-border); border-radius: 24px;
  background: color-mix(in srgb, var(--surface-elevated) 82%, transparent);
  box-shadow: 0 10px 30px -20px rgba(10, 25, 48, .45), inset 0 1px 0 color-mix(in srgb, #fff 45%, transparent);
  backdrop-filter: blur(26px) saturate(165%); -webkit-backdrop-filter: blur(26px) saturate(165%);
}
.dark .ax-nav { box-shadow: 0 12px 32px -20px rgba(0, 0, 0, .82), inset 0 1px 0 rgba(255, 255, 255, .07); }
.ax-nav-i, .ax-nav-create { border-radius: 15px; }
.ax-nav-i.on { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.ax-nav-create-icon { width: 34px; height: 32px; border-radius: 12px; }

/* Compact phones and reduced motion */
@media (min-width: 520px) {
  #axh-root { background: color-mix(in srgb, var(--background) 72%, #DDE6F2); }
  .dark #axh-root { background: #070B11; }
  .axh-frame { box-shadow: 0 22px 64px -34px rgba(10, 25, 48, .45); }
}
@media (max-width: 380px) {
  :root { --gutter: 14px; }
  .ax-stack { gap: 18px; }
  .ax-nav { left: 10px; right: 10px; }
  .ax-pbn.ax-pbn-safe { height: 226px; }
  .ax-pbn-safe + .ax-ph { padding-top: 38px; }
  #nsp > .ax-nthead { gap: 3px; }
  #nsp .ax-nthead h1 { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
