:root {
  /* Calendar Manifestation */
  --cal-bg: #ffffff;
  --cal-muted: #f9fafb;
  --cal-border: var(--border, #d7dbe3);
  --cal-weekday: var(--surface-2, #edf0f5);
  color-scheme: light;
  --alliance-blue: #171f3a;
  --alliance-blue-light: #2f3f6f;
  --alliance-accent: #d4af37;
  --alliance-text: #17212a;
  --alliance-text-muted: #586775;
  --alliance-bg-panel: rgba(255, 255, 255, 0.85);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--alliance-text);
  background: #f0f3f7;
}

/* Calendar Manifestation */
.calendar-month {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  width: 100%;
  box-sizing: border-box;
  gap: 1px;
  background: var(--cal-border);
  border: 1px solid var(--cal-border);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 16px;
}

.calendar-weekday {
  background: var(--cal-weekday);
  padding: 10px 4px;
  text-align: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.8rem;
  color: var(--alliance-blue);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.calendar-day {
  background: var(--cal-bg);
  min-height: 80px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background 0.2s ease;
  min-width: 0; /* Prevent grid blowout */
}

.calendar-day-muted {
  background: var(--cal-muted);
  color: var(--alliance-text-muted);
}

.calendar-day strong {
  font-size: 0.9rem;
  font-weight: 800;
  margin-bottom: 2px;
}

.calendar-event {
  background: var(--alliance-blue);
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 3px 5px;
  font-size: 0.7rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  transition: transform 0.1s ease;
}

.calendar-event:hover {
  transform: scale(1.02);
  filter: brightness(1.1);
}

/* Mobile Rhythmic Optimization */
@media (max-width: 640px) {
  .calendar-month {
    border-radius: 8px;
    margin-top: 8px;
  }
  
  .calendar-weekday {
    padding: 6px 1px;
    font-size: 0.6rem;
  }
  
  .calendar-day {
    min-height: 50px;
    padding: 3px 1px;
  }
  
  .calendar-day strong {
    font-size: 0.7rem;
    text-align: center;
    display: block;
    margin-bottom: 1px;
  }
  
  .calendar-event {
    padding: 1px 2px;
    font-size: 0.55rem;
    border-radius: 2px;
  }
}

* {
  box-sizing: border-box;
}

img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}

[hidden] {
  display: none !important;
}

body.page-loading {
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, #f0f3f7 0%, #e1e5eb 100%);
  background-attachment: fixed;
  padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
}

body.install-banner-visible {
  padding-bottom: calc(186px + env(safe-area-inset-bottom, 0px));
}

body.chat-page {
  overflow: hidden;
  overflow-x: clip;
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: calc(62px + env(safe-area-inset-bottom, 0px));
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(23, 31, 58, 0.12);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 -10px 30px rgba(23, 40, 58, 0.08);
  z-index: 1200;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  align-items: end;
  overflow: visible;
}

.install-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  z-index: 1230;
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid rgba(23, 31, 58, 0.14);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 44px rgba(23, 40, 58, 0.16);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.install-banner[hidden] {
  display: none;
}

.install-banner-copy h2 {
  margin: 0 0 6px;
  color: var(--alliance-blue);
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.15;
}

.install-banner-copy p {
  margin: 0;
  color: #556273;
  line-height: 1.45;
}

.install-banner-ios-hint {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(23, 31, 58, 0.12);
  border-radius: 14px;
  background: rgba(23, 31, 58, 0.04);
  color: var(--alliance-blue);
  font-weight: 700;
}

.install-banner-ios-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  background: rgba(23, 31, 58, 0.08);
  color: var(--alliance-blue);
}

.install-banner-ios-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.install-banner-ios-hint-text {
  line-height: 1.35;
}

.install-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.install-banner-actions button {
  min-height: 40px;
}

.install-banner-actions .button-link {
  margin-top: 0;
}

.home-alt-action {
  margin: 12px 0 0;
  display: flex;
  justify-content: flex-start;
}

.login-code-group {
  display: grid;
  gap: 8px;
}

.login-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.login-actions .button-link {
  margin-top: 0;
}

.bottom-nav-item {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 7px 4px 8px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--alliance-blue);
  text-decoration: none;
  font-family: 'Outfit', sans-serif;
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  min-width: 0;
}

.bottom-nav-item:hover,
.bottom-nav-item:focus-visible {
  border-color: rgba(23, 31, 58, 0.14);
  background: rgba(23, 31, 58, 0.05);
  outline: none;
}

.bottom-nav-item[aria-current="page"] {
  color: #06b6d4;
  background: rgba(6, 182, 212, 0.12);
  border-color: rgba(6, 182, 212, 0.18);
}

.bottom-nav-item[aria-expanded="true"] {
  color: #06b6d4;
  background: rgba(6, 182, 212, 0.12);
  border-color: rgba(6, 182, 212, 0.18);
}

.bottom-nav-item--logged-out {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.18);
}

.bottom-nav-item--logged-out:hover,
.bottom-nav-item--logged-out:focus-visible {
  border-color: rgba(220, 38, 38, 0.28);
  background: rgba(220, 38, 38, 0.12);
}

.bottom-nav-item--logged-out[aria-current="page"],
.bottom-nav-item--logged-out[aria-expanded="true"] {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.14);
  border-color: rgba(220, 38, 38, 0.24);
}

.profile-link--logged-out {
  color: #dc2626 !important;
  font-weight: 900;
}

.profile-link--signed-in {
  color: var(--alliance-blue) !important;
}

.bottom-nav-item--signed-in .bottom-nav-icon {
  border-radius: 999px;
  overflow: hidden;
  background: rgba(23, 31, 58, 0.04);
  border: 1px solid rgba(23, 31, 58, 0.12);
}

.bottom-nav-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
}

.bottom-nav-profile-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 999px;
}

.bottom-nav-profile-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--alliance-blue);
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.bottom-nav-icon svg {
  width: 27px;
  height: 27px;
  stroke: currentColor;
  stroke-width: 1.9;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom-nav-menu {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(100% + 12px);
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(23, 31, 58, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 40px rgba(23, 40, 58, 0.14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 1;
}

.bottom-nav-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(23, 31, 58, 0.05);
  color: var(--alliance-blue);
  text-decoration: none;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
}

.bottom-nav-menu-item:hover,
.bottom-nav-menu-item:focus-visible {
  background: rgba(23, 31, 58, 0.1);
  outline: none;
}

.bottom-nav-menu-item[aria-current="page"] {
  color: #06b6d4;
  background: rgba(6, 182, 212, 0.12);
}

.bottom-nav-menu-icon {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.bottom-nav-menu-icon svg {
  width: 27px;
  height: 27px;
  stroke: currentColor;
  stroke-width: 1.9;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom-nav-menu-label {
  min-width: 0;
}

body.chat-page .shell {
  padding: 0;
  place-items: stretch;
  width: 100vw;
  min-height: 100dvh;
}

.panel {
  width: min(100%, 680px);
  background: var(--alliance-bg-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(23, 40, 58, 0.08), 0 8px 24px rgba(23, 40, 58, 0.04);
  overflow: hidden;
}

.panel,
.panel * {
  min-width: 0;
}

.panel h1,
.panel h2,
.panel h3,
.panel h4,
.panel h5,
.panel h6,
.panel p,
.panel span,
.panel strong,
.panel button,
.panel a,
.panel label,
.panel summary,
.panel li,
.panel input,
.panel textarea,
.panel select {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.panel.page-loading > * {
  opacity: 0;
  transform: translateY(14px);
  filter: blur(3px);
  transition-property: opacity, transform, filter;
  transition-duration: 0.45s;
  transition-timing-function: ease;
  transition-delay: var(--page-reveal-delay, 0ms);
}

.panel.page-loaded > * {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.page-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(240, 243, 247, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 1;
  transition: opacity 0.24s ease;
}

.page-loading-overlay-hidden {
  opacity: 0;
}

.page-loading-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  min-width: min(100%, 260px);
  border: 1px solid rgba(184, 195, 204, 0.55);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 44px rgba(23, 40, 58, 0.1);
  padding: 22px 28px;
  color: var(--alliance-blue);
  text-align: center;
}

.page-loading-card p {
  margin: 0;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 800;
}

.page-loading-spinner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid rgba(23, 31, 58, 0.14);
  border-top-color: var(--alliance-blue);
  animation: pageSpin 0.8s linear infinite;
}

@keyframes pageSpin {
  to {
    transform: rotate(360deg);
  }
}

.home-panel {
  width: min(100%, 960px);
}

.panel > *:not(.header-image) {
  margin-left: clamp(24px, 4vw, 40px);
  margin-right: clamp(24px, 4vw, 40px);
}

.panel > *:last-child {
  margin-bottom: clamp(24px, 4vw, 40px);
}

.header-image {
  display: block;
  width: 100%;
  margin-bottom: 20px;
  aspect-ratio: 16 / 6;
  object-fit: cover;
  object-position: center 42%;
}

.branch-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  min-width: 0;
}

.branch-nav a,
.branch-nav button,
.button-link {
  display: inline-grid;
  min-width: 0;
  min-height: 40px;
  align-items: center;
  border-radius: 8px;
  padding: 0 16px;
  border: 1px solid rgba(184, 195, 204, 0.6);
  color: var(--alliance-blue);
  background: rgba(255, 255, 255, 0.8);
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.branch-nav a:hover,
.branch-nav button:hover,
.button-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(47, 85, 111, 0.12);
  border-color: var(--alliance-blue-light);
  background: #ffffff;
}

.branch-nav a[aria-current="page"],
.button-link {
  border-color: var(--alliance-blue-light);
  background: linear-gradient(to bottom, #edf0f5, #e1e5eb);
}

.mast {
  margin-top: clamp(24px, 4vw, 38px);
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--alliance-blue-light);
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: 'Outfit', sans-serif;
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--alliance-blue);
}

.copy {
  width: 100%;
  max-width: 54ch;
  margin: 14px 0 0;
  color: #586775;
  font-size: 1rem;
  line-height: 1.55;
}

.about-list {
  display: grid;
  gap: 16px;
  margin-bottom: 22px;
}

.about-list article {
  border-top: 1px solid #dce3e8;
  padding-top: 16px;
}

.about-list h2 {
  margin: 0 0 8px;
  font-size: 1.12rem;
}

.about-list p {
  margin: 0;
  color: #586775;
  line-height: 1.55;
}

.story-context {
  border: 1px solid #d7dbe3;
  border-radius: 8px;
  background: #f6f8fa;
  padding: 15px;
}

.story-context h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.story-context p {
  margin: 8px 0 0;
  color: #586775;
  line-height: 1.5;
}

.story-flow {
  display: flex;
  flex-direction: column;
  gap: 80px;
  width: auto;
  margin-top: 60px;
  margin-bottom: 60px;
}

.story-section {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 40px;
  width: 100%;
  max-width: 100%;
}

.story-section:nth-child(even) {
  flex-direction: row-reverse;
}

.story-image {
  flex: 1;
  min-width: 280px;
  max-width: 100%;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(23, 31, 58, 0.15);
  aspect-ratio: 4 / 3;
}

.story-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.story-content {
  flex: 1;
  min-width: 280px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.story-content h3 {
  margin: 0;
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--alliance-blue);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.story-content p {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.6;
  color: #4a5568;
}

@media (max-width: 900px) {
  .story-flow {
    gap: 60px;
  }
  
  .story-section, 
  .story-section:nth-child(even) {
    flex-direction: column;
    gap: 24px;
    text-align: center;
  }
  
  .story-image {
    width: 100%;
    aspect-ratio: 16 / 9;
  }
}

.about-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.bento-card {
  border: 1px solid rgba(47, 85, 111, 0.15);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.bento-card[open] {
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(23, 40, 58, 0.08);
  border-color: var(--alliance-blue-light);
}

.bento-card summary {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background 0.2s ease;
}

.bento-card summary:hover {
  background: rgba(255, 255, 255, 0.8);
}

.bento-card summary::-webkit-details-marker {
  display: none;
}

.bento-icon {
  font-size: 1.6rem;
  line-height: 1;
  background: linear-gradient(135deg, #2f3f6f 0%, #171f3a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.bento-card summary h3 {
  margin: 0;
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--alliance-blue);
}

.expand-icon {
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--alliance-blue-light);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.bento-card[open] .expand-icon {
  transform: rotate(45deg);
}

.bento-content {
  padding: 0 20px 20px;
  color: #586775;
  line-height: 1.6;
  font-size: 0.95rem;
  animation: slideDown 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.bento-content p {
  margin: 0;
}

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

.section-kicker {
  margin: 0 0 6px;
  color: #424e6b;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.phone-start {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
  padding: 22px;
  border: 1px solid rgba(55, 163, 97, 0.28);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(240, 255, 246, 0.96) 0%, rgba(223, 248, 229, 0.9) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 12px 32px rgba(23, 40, 58, 0.06);
}

.phone-start[hidden] {
  display: none;
}

.phone-start h2 {
  margin: 0 0 6px;
  font-family: 'Outfit', sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
  color: #17663b;
}

.phone-start p {
  margin: 0;
  color: #2f6b47;
  line-height: 1.5;
}

.floating-alert {
  margin-bottom: 18px;
}

.home-signup-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  border-color: rgba(55, 163, 97, 0.28);
  background: linear-gradient(180deg, rgba(240, 255, 246, 0.98) 0%, rgba(223, 248, 229, 0.92) 100%);
  color: #17663b;
  box-shadow: 0 10px 24px rgba(23, 102, 59, 0.12);
}

.home-signup-hands {
  font-size: 1.2rem;
  line-height: 1;
}

.home-signup-alert.home-signup-alert,
.home-signup-alert a,
.home-signup-alert button {
  color: #17663b;
}

#home-view #phone-start-form #start_submit {
  background: linear-gradient(180deg, #2aa45d 0%, #1f8a4c 100%);
  border-color: #1f8a4c;
  color: #ffffff;
  box-shadow: 0 10px 18px rgba(31, 138, 76, 0.2);
}

#home-view #phone-start-form #start_submit:hover {
  background: linear-gradient(180deg, #31b264 0%, #238f51 100%);
  border-color: #238f51;
}

#home-view #phone-start-form label span {
  color: #17663b;
}

#home-view #phone-start-form input {
  border-color: rgba(55, 163, 97, 0.34);
  background: rgba(255, 255, 255, 0.9);
}

.invite-card {
  display: grid;
  gap: 10px;
}

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

.invited-by {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  align-items: center;
  border: 1px solid #c8ced8;
  border-radius: 8px;
  background: #edf0f5;
  padding: 12px;
}

.invited-by-avatar {
  position: relative;
  width: 54px;
  height: 54px;
}

.invited-by img {
  display: block;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  object-fit: cover;
  background: #ffffff;
}

.invited-by-avatar-fallback {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: #ffffff;
  color: #171f3a;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.invited-by-avatar img[hidden] {
  display: none;
}

.invited-by p,
.invited-by span {
  display: block;
  margin: 0;
  color: #586775;
  font-weight: 700;
}

.invited-by strong {
  display: block;
  color: #171f3a;
  font-size: 1.04rem;
}

.form {
  display: grid;
  gap: 18px;
}

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

label {
  display: grid;
  gap: 7px;
  color: #2c3843;
  font-size: 0.92rem;
  font-weight: 700;
}

label em {
  color: #77848f;
  font-style: normal;
  font-weight: 600;
}

input,
select {
  min-height: 50px;
  width: 100%;
  border: 1px solid rgba(184, 195, 204, 0.8);
  border-radius: 8px;
  background: #ffffff;
  color: var(--alliance-text);
  font: inherit;
  font-weight: 500;
  padding: 12px 16px;
  transition: all 0.2s ease;
}

input.missing-required,
select.missing-required {
  border-color: #c7342f;
  box-shadow: 0 0 0 3px rgba(199, 52, 47, 0.12);
}

.required-missing {
  color: #9f2924;
}

.required-missing input,
.required-missing select {
  border-color: #c7342f;
  box-shadow: 0 0 0 3px rgba(199, 52, 47, 0.12);
}

.field-label {
  display: block;
  margin-bottom: 7px;
  color: #2c3843;
  font-size: 0.92rem;
  font-weight: 700;
}

.field-label em {
  color: #77848f;
  font-style: normal;
  font-weight: 600;
}

.image-picker {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 14px;
  align-items: center;
  border: 1px solid #cbd4dc;
  border-radius: 8px;
  background: #f8fafb;
  padding: 14px;
}

.image-preview {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  overflow: hidden;
  border-radius: 8px;
  background: #1e2334;
  color: #ffffff;
  font-size: 1.8rem;
  font-weight: 900;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-controls {
  display: grid;
  gap: 10px;
}

.organization-step {
  display: grid;
  gap: 12px;
  margin-top: 8px;
  border-top: 1px solid #dce3e8;
  padding-top: 18px;
}

.church-search-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 10px;
  align-items: center;
}

.church-search-icon {
  display: grid;
  min-height: 48px;
  place-items: center;
  border: 1px solid #b8c3cc;
  border-radius: 8px;
  background: #f6f8fa;
  font-size: 1.45rem;
}

.search-field {
  position: relative;
  display: block;
}

.search-field input {
  padding-left: 42px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  color: #77848f;
  font-size: 1.15rem;
  font-weight: 900;
  transform: translateY(-50%);
  pointer-events: none;
}

.organization-results {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.organization-choice {
  flex: 0 0 auto;
  min-height: 42px;
  border: 1px solid #b8c3cc;
  background: #ffffff;
  color: #222d4d;
  padding: 0 13px;
  white-space: nowrap;
}

.organization-card,
.organization-profile-card {
  position: relative;
  display: grid;
  gap: 10px;
  border: 1px solid #d7dbe3;
  border-radius: 8px;
  background: #f6f8fa;
  padding: 14px;
}

.organization-card {
  grid-template-columns: 72px 1fr;
  align-items: center;
}

.organization-card img,
.organization-profile-card img {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
}

.organization-card h2,
.profile-organization h3 {
  margin: 0;
  font-size: 1.05rem;
}

.organization-card p,
.organization-profile-card p {
  margin: 0;
  color: #586775;
  font-weight: 700;
  line-height: 1.45;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.profile-links a {
  display: inline-grid;
  min-height: 36px;
  align-items: center;
  border: 1px solid #b8c3cc;
  border-radius: 6px;
  padding: 0 11px;
  color: #222d4d;
  background: #ffffff;
  font-weight: 800;
  text-decoration: none;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 10px;
  padding-top: 4px;
  min-width: 0;
}

.organization-actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.settings-menu {
  position: relative;
  width: min(100%, 260px);
  min-width: 0;
}

.organization-card-settings {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: auto;
}

.settings-menu summary {
  display: grid;
  min-height: 46px;
  align-items: center;
  border: 1px solid #2f3f6f;
  border-radius: 6px;
  background: #2f3f6f;
  color: #ffffff;
  padding: 0 38px 0 14px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.organization-card-settings summary {
  width: 40px;
  min-height: 40px;
  justify-items: center;
  border-color: #d7dde3;
  background: #ffffff;
  color: #222d4d;
  padding: 0;
  font-size: 1.1rem;
}

.settings-menu summary::-webkit-details-marker {
  display: none;
}

.settings-menu summary::after {
  content: "";
  position: absolute;
  top: 18px;
  right: 15px;
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.settings-menu[open] summary::after {
  top: 21px;
  transform: rotate(225deg);
}

.organization-card-settings summary::after,
.organization-card-settings[open] summary::after {
  content: none;
}

.settings-actions {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid #d7dde3;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(32, 45, 56, 0.12);
}

.organization-card-settings .settings-actions {
  position: absolute;
  top: 42px;
  right: 0;
  width: min(230px, calc(100vw - 64px));
}

.settings-action {
  min-height: 40px;
  border: 1px solid #d7dde3;
  background: #f6f8fa;
  color: #222d4d;
  padding: 0 12px;
  text-align: left;
}

.settings-action:disabled {
  cursor: default;
  opacity: 1;
}

.status-line {
  color: #8a5b11;
}

.compact-form {
  margin-bottom: 20px;
}

.review-list {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.admin-list-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.admin-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #586775;
  min-width: 0;
}

.admin-breadcrumbs button {
  background: transparent;
  border: none;
  padding: 0;
  color: #586775;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease;
}

.admin-breadcrumbs button:hover {
  color: var(--alliance-blue-light);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.admin-breadcrumbs button:disabled {
  color: var(--alliance-blue);
  font-weight: 700;
  cursor: default;
  text-decoration: none;
}

.admin-breadcrumb-divider {
  color: #8a96a1;
  font-size: 0.9rem;
  user-select: none;
}

.admin-small-action {
  min-height: 34px;
  border-radius: 6px;
  padding: 0 10px;
  font-size: 0.86rem;
}

.link-button {
  display: inline-grid;
  min-height: 36px;
  align-items: center;
  border: 1px solid #b8c3cc;
  border-radius: 6px;
  padding: 0 11px;
  background: #ffffff;
  color: #222d4d;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
}

.admin-entity-form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #dce3e8;
}

#admin-entity-panel {
  padding-bottom: 50px;
}

.admin-entity-card {
  grid-template-columns: 58px 1fr;
  align-items: center;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.admin-entity-card:hover,
.admin-entity-card:focus {
  border-color: #2f3f6f;
  box-shadow: 0 10px 24px rgba(32, 45, 56, 0.12);
  outline: none;
  transform: translateY(-1px);
}

.admin-entity-card img {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
}

.organization-members {
  margin-top: 18px;
}

.organization-members .review-list {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: stretch;
}

.organization-member-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  width: min(100%, 168px);
  aspect-ratio: 1 / 1;
  padding: 10px 10px 12px;
  border: 1px solid #dce3e8;
  border-radius: 12px;
  background: #ffffff;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(17, 26, 41, 0.02);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.organization-member-card:hover,
.organization-member-card:focus-visible {
  border-color: #b7c4d6;
  box-shadow: 0 8px 20px rgba(32, 45, 56, 0.08);
  transform: translateY(-1px);
}

.organization-member-card h3,
.organization-member-card p {
  margin: 0;
}

.organization-member-card h3 {
  color: #17212a;
  font-size: 1rem;
  font-weight: 800;
  text-align: center;
}

.organization-member-card .member-last-name {
  margin: 0;
  color: #5d6b78;
  font-size: 0.96rem;
  font-weight: 800;
  text-align: center;
  line-height: 1.2;
}

.organization-member-card .member-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(18, 32, 48, 0.12);
  background: #f7fafc;
}

.network-panel {
  width: min(100%, 1120px);
  overflow: visible;
}

.network-map {
  margin-top: 18px;
  max-height: none;
  overflow: visible;
  padding-bottom: 10px;
}

.network-tree {
  position: relative;
  display: grid;
  gap: 14px;
  min-width: 0;
  width: 100%;
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.network-tree .network-tree {
  margin-top: 14px;
  margin-left: 14px;
  padding-left: 22px;
  border-left: 2px solid #b8c3cc;
}

.network-node {
  position: relative;
  margin: 0;
}

.network-node-church {
  display: block;
}

.network-node-church .network-node-card {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #d7dbe3;
  border-radius: 12px;
  background: #ffffff;
  color: #17212a;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(23, 40, 58, 0.03);
}

.network-node-church .network-node-card:hover,
.network-node-church .network-node-card:focus-visible {
  border-color: #98a7c7;
  box-shadow: 0 4px 14px rgba(23, 40, 58, 0.08);
  outline: none;
}

.network-node-orphan {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px;
}

.network-node-orphan .network-node-toggle {
  flex: 1 1 320px;
}

.network-node-orphan .network-node-visit {
  margin-left: 38px;
}

.network-node-church.network-node-orphan .network-node-card {
  flex: 1 1 320px;
}

.network-node-church.network-node-orphan .network-node-card + .network-orphan-controls {
  margin-left: 38px;
}

.network-orphan-controls {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-left: 38px;
}

.network-orphan-select {
  min-width: 220px;
  max-width: 320px;
  border: 1px solid #b8c3cc;
  border-radius: 6px;
  padding: 6px 10px;
  background: #ffffff;
  color: #17212a;
  font: inherit;
}

.network-orphan-button {
  min-height: 30px;
  border: 1px solid #b8c3cc;
  border-radius: 6px;
  padding: 0 10px;
  background: #fff5f5;
  color: #8a1f11;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.network-orphan-button:disabled,
.network-orphan-select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.network-node-orphan .network-node-text strong,
.network-node-orphan .network-node-text span,
.network-node-orphan .network-node-text .network-node-category {
  color: #8a1f11;
}

.network-tree .network-tree > .network-node::before {
  content: "";
  position: absolute;
  top: 21px;
  left: -32px;
  width: 24px;
  border-top: 2px solid #b8c3cc;
}

.network-node {
  display: block;
}

.network-node-toggle {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  width: 100%;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: #17212a;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  margin-bottom: 8px;
}

.network-node-toggle:hover,
.network-node-toggle:focus {
  color: var(--alliance-blue-light);
  outline: none;
  transform: none;
  box-shadow: none;
  filter: none;
}

.network-node-toggle:disabled {
  cursor: default;
  opacity: 1;
}

.network-node-visit {
  display: inline-grid;
  width: max-content;
  justify-self: start;
  min-height: 30px;
  align-items: center;
  border: 1px solid #b8c3cc;
  border-radius: 6px;
  padding: 0 10px;
  background: #ffffff;
  color: #222d4d;
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.network-node-visit:hover,
.network-node-visit:focus {
  border-color: var(--alliance-blue-light);
  outline: none;
}

.network-node-marker {
  width: 22px;
  margin-top: 1px;
  font-size: 1.18rem;
  line-height: 1;
  text-align: center;
}

.network-node-card {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  width: 100%;
  min-width: 0;
  margin-bottom: 8px;
}

@media (min-width: 861px) {
  .network-tree > .network-node {
    padding-left: 0;
  }

  .network-node-toggle {
    align-items: start;
  }

  .network-node-text {
    max-width: 100%;
  }
}

.network-node-text {
  display: grid;
  gap: 2px;
  min-width: 0;
  line-height: 1.25;
}

.network-node-text strong {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  color: currentColor;
}

.network-node-text span {
  color: #586775;
  font-size: 0.9rem;
  font-weight: 700;
}

@media (max-width: 700px) {
  .network-map {
    max-height: none;
    overflow: visible;
  }

  .network-tree .network-tree {
    margin-left: 4px;
    padding-left: 14px;
  }

  .network-tree .network-tree > .network-node::before {
    left: -14px;
    width: 10px;
  }

  .network-node {
    grid-template-columns: 1fr;
  }

  .network-node-visit {
    width: fit-content;
    margin-left: 32px;
  }
}

.network-node-text .network-node-category {
  color: #222d4d;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.calendar-content {
  display: grid;
  gap: 16px;
  padding-bottom: 8px;
}

.calendar-panel {
  display: flex;
  flex-direction: column;
}

.calendar-toolbar {
  flex: 0 0 auto;
}

.calendar-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.event-panel {
  display: flex;
  flex-direction: column;
}

.event-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 16px;
}

.event-hero {
  display: grid;
  gap: 10px;
  padding: 0 40px 40px;
}

.event-hero-banner {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  border-radius: 18px;
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.16);
}

.event-hero-image-banner {
  background: #0b1020;
  border: 1px solid rgba(15, 23, 42, 0.14);
  display: grid;
  place-items: center;
}

.event-hero-fallback-banner {
  border: 1px solid rgba(109, 40, 217, 0.22);
  background:
    radial-gradient(circle at top left, rgba(168, 85, 247, 0.85), transparent 42%),
    radial-gradient(circle at 85% 18%, rgba(34, 211, 238, 0.7), transparent 36%),
    linear-gradient(135deg, #2f1065 0%, #0f172a 55%, #0f766e 100%);
}

.event-hero-fallback-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 15, 31, 0.16) 0%, rgba(8, 15, 31, 0.52) 100%),
    linear-gradient(90deg, rgba(168, 85, 247, 0.16) 0%, rgba(34, 211, 238, 0.12) 100%);
  pointer-events: none;
}

.event-hero-image {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  opacity: 0.92;
  mix-blend-mode: normal;
  border-radius: 18px;
}

.event-hero-overlay {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: end;
  gap: 8px;
  min-height: 260px;
  padding: 26px;
  color: #ffffff;
}

.event-hero-overlay .eyebrow {
  color: rgba(232, 245, 255, 0.84);
}

.event-hero-title {
  margin: 0;
  max-width: 12ch;
  font-family: 'Outfit', sans-serif;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: transparent;
  background: linear-gradient(90deg, #f5f3ff 0%, #c4b5fd 35%, #22d3ee 100%);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: 0 10px 30px rgba(7, 10, 23, 0.45);
}

.event-hero-meta {
  margin: 0;
  max-width: 34ch;
  color: rgba(239, 246, 255, 0.88);
  font-size: 1rem;
  font-weight: 700;
}

.event-hero-image-banner[hidden],
.event-hero-fallback-banner[hidden] {
  display: none !important;
}

.event-summary-card {
  display: grid;
  gap: 12px;
  padding: 18px 20px;
  border: 1px solid #d7dbe3;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 24px rgba(23, 40, 58, 0.05);
}

@media (max-width: 640px) {
  .event-panel > *:not(.header-image) {
    margin-left: 12px;
    margin-right: 12px;
  }

  .event-panel > *:last-child {
    margin-bottom: 16px;
  }

  .event-panel .mast {
    margin-top: 12px;
    margin-bottom: 16px;
  }

  .event-content {
    gap: 12px;
  }

  .event-hero {
    padding: 0 12px 12px;
    gap: 8px;
  }

  .event-hero-banner {
    min-height: 220px;
    border-radius: 16px;
  }

  .event-hero-overlay {
    min-height: 220px;
    padding: 18px;
  }

  .event-hero-title {
    max-width: none;
    font-size: clamp(1.85rem, 8vw, 2.8rem);
  }

  .event-hero-meta {
    max-width: 28ch;
    font-size: 0.93rem;
  }

  .event-summary-card {
    gap: 10px;
    padding: 14px 14px 16px;
    border-radius: 12px;
  }

  .event-summary-card h2 {
    font-size: clamp(1.6rem, 6vw, 2.1rem);
  }

  .event-summary-image {
    max-height: 250px;
    border-radius: 12px;
  }

  .profile-header-actions {
    gap: 8px;
  }
}

.event-summary-meta {
  display: grid;
  gap: 6px;
  color: #586775;
}

.event-summary-meta div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
}

.event-summary-meta div span {
  color: #586775;
  font-weight: 700;
}

.event-summary-meta strong {
  color: #17212a;
}

.event-summary-image {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid #d7dbe3;
}

.calendar-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 8px 0 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.9) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.calendar-summary {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  gap: 12px;
  border-bottom: 1px solid #dce3e8;
  background: rgba(255, 255, 255, 0.96);
  padding: 12px 0 14px;
}

.calendar-summary h2,
.calendar-summary p {
  margin: 0;
}

.calendar-summary h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  color: var(--alliance-blue);
}

.calendar-micro {
  margin-top: 2px;
  color: #586775;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.calendar-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.calendar-filter {
  min-height: 30px;
  border: 1px solid #b8c3cc;
  border-radius: 999px;
  padding: 0 10px;
  background: #ffffff;
  color: #222d4d;
  font-size: 0.82rem;
  font-weight: 800;
}

.calendar-filter[aria-pressed="true"] {
  border-color: #2f3f6f;
  background: #2f3f6f;
  color: #ffffff;
}

.calendar-saturation {
  display: grid;
  gap: 2px;
}

.calendar-saturation svg {
  display: block;
  width: 100%;
  height: 44px;
  border: 1px solid #d7dbe3;
  border-radius: 8px;
  background: #f6f8fa;
}

.calendar-month-labels {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  color: #586775;
  font-size: 0.72rem;
  font-weight: 900;
  text-align: center;
}

.calendar-month {
  display: grid;
  grid-template-columns: repeat(7, minmax(72px, 1fr));
  grid-template-rows: auto repeat(5, minmax(92px, 1fr));
  gap: 1px;
  overflow-x: auto;
  border: 1px solid #d7dbe3;
  border-radius: 8px;
  background: #d7dbe3;
}

.calendar-weekday,
.calendar-day {
  min-width: 72px;
  background: #ffffff;
}

.calendar-weekday {
  padding: 8px 6px;
  color: #586775;
  font-size: 0.72rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.calendar-day {
  display: grid;
  align-content: start;
  gap: 5px;
  min-height: 92px;
  padding: 8px;
}

.calendar-day > strong {
  color: #17212a;
  font-size: 0.85rem;
}

.calendar-day-muted {
  background: #f4f6f8;
}

.calendar-day-muted > strong {
  color: #9aa5af;
}

.calendar-day-today {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.58);
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.1);
}

.calendar-day-today > strong {
  color: #15803d;
}

.calendar-event {
  min-height: 0;
  border: 0;
  border-left: 3px solid #d4af37;
  border-radius: 4px;
  padding: 4px 5px;
  background: #f8f1d9;
  color: #17212a;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: left;
}

.calendar-list {
  display: grid;
  gap: 12px;
  padding: 4px 0 8px;
}

.calendar-list .bento-card,
.calendar-list-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid #d7dbe3;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(23, 40, 58, 0.03);
}

.calendar-list .bento-card:hover,
.calendar-list .bento-card:focus-visible,
.calendar-list-item:hover,
.calendar-list-item:focus-visible {
  border-color: #98a7c7;
  box-shadow: 0 4px 14px rgba(23, 40, 58, 0.08);
  outline: none;
}

.calendar-list-heading {
  display: grid;
  gap: 4px;
  padding: 8px 0 4px;
}

.calendar-list-heading h2 {
  margin: 0;
  color: var(--alliance-blue);
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
}

.calendar-list-empty {
  margin: 0;
  padding: 14px 16px;
  border: 1px dashed #c6d0d8;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
}

.calendar-list-date {
  display: grid;
  place-items: center;
  min-width: 68px;
  min-height: 68px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #171f3a;
  color: #ffffff;
  text-align: center;
}

.calendar-list-month {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.calendar-list-day {
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
}

.calendar-list-info {
  display: grid;
  gap: 4px;
}

.calendar-list-info h3 {
  margin: 0;
  color: #17212a;
  font-size: 1.08rem;
}

.calendar-list-info p {
  margin: 0;
  color: #586775;
  font-size: 0.92rem;
  line-height: 1.45;
}

@media (max-width: 620px) {
  .calendar-month {
    grid-template-columns: repeat(7, minmax(64px, 1fr));
  }

  .calendar-weekday,
  .calendar-day {
    min-width: 64px;
  }

  .calendar-day {
    min-height: 86px;
    padding: 6px;
  }

  .calendar-list-item {
    grid-template-columns: 1fr;
  }

  .calendar-list-date {
    min-width: 0;
    min-height: 0;
    justify-items: center;
  }
}

.member-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(18, 32, 48, 0.12);
  background: #f7fafc;
  flex: 0 0 auto;
}

.member-claim-panel {
  display: grid;
  gap: 14px;
  border-top: 1px solid #dce3e8;
  padding-top: 18px;
}

.member-claim-panel h2,
.member-claim-panel p {
  margin: 0;
}

.member-claim-panel p {
  color: #586775;
  font-weight: 700;
  line-height: 1.45;
}

.member-claim-form {
  display: grid;
  gap: 12px;
}

.review-section {
  display: grid;
  gap: 10px;
  border-top: 1px solid #dce3e8;
  padding-top: 14px;
}

.review-section h2,
.review-section h3,
.review-section p {
  margin: 0;
}

.review-section h2 {
  font-size: 1.1rem;
}

.review-section article {
  display: grid;
  gap: 5px;
  border: 1px solid #d7dbe3;
  border-radius: 8px;
  background: #f6f8fa;
  padding: 12px;
}

.review-section p {
  color: #586775;
  font-weight: 700;
}

.help-layout {
  display: grid;
  grid-template-columns: minmax(150px, 0.38fr) 1fr;
  gap: 18px;
  align-items: start;
}

.help-topics {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 14px;
  border: 1px solid #d7dbe3;
  border-radius: 8px;
  background: #f6f8fa;
  padding: 14px;
}

.help-topics h2 {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

.help-topics a {
  display: block;
  margin: 6px 0;
  color: #222d4d;
  font-weight: 800;
  text-decoration: none;
}

.help-content {
  display: grid;
  gap: 14px;
}

.help-content article {
  scroll-margin-top: 20px;
  border-top: 1px solid #dce3e8;
  padding-top: 14px;
}

.help-content h2,
.help-content p {
  margin: 0 0 8px;
}

.help-content a {
  color: #222d4d;
  font-weight: 800;
}

.tips-tools {
  display: grid;
  gap: 14px;
  margin: 24px 0;
}

.tips-search {
  max-width: 760px;
}

.tips-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tips-categories button {
  border: 1px solid #d7dbe3;
  background: #fff;
  color: #222d4d;
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.tips-categories button[aria-pressed="true"] {
  background: #222d4d;
  color: #fff;
  border-color: #222d4d;
}

.tips-list {
  display: grid;
  gap: 12px;
}

.tips-list.compact {
  gap: 10px;
}

.tip-card {
  border: 1px solid #d7dbe3;
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  display: grid;
  gap: 8px;
}

.tip-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.tip-command {
  font-weight: 900;
  color: #222d4d;
}

.tip-card p {
  margin: 0;
}

.tip-meta {
  color: #586775;
  font-size: 0.92rem;
}

.tips-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  margin-top: 32px;
  align-items: start;
}

.tip-suggestion-form {
  display: grid;
  gap: 12px;
}

.tip-suggestion-form textarea {
  resize: vertical;
  min-height: 110px;
}

input[type="file"] {
  padding: 10px;
  background: #ffffff;
}

input[readonly] {
  background: #eef2f4;
  color: #586775;
}

input::placeholder {
  color: #9aa6af;
}

input:focus,
select:focus,
button:focus {
  outline: 3px solid rgba(47, 85, 111, 0.24);
  outline-offset: 2px;
  border-color: #2f3f6f;
}

.check {
  grid-template-columns: 22px 1fr;
  align-items: start;
  gap: 10px;
  font-weight: 600;
  line-height: 1.4;
}

.check input {
  width: 20px;
  min-height: 20px;
  margin: 2px 0 0;
}

.check.required-missing {
  border: 1px solid #c7342f;
  border-radius: 8px;
  padding: 10px;
  background: #fff7f6;
}

button {
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--alliance-blue-light) 0%, var(--alliance-blue) 100%);
  color: #ffffff;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(23, 40, 58, 0.2);
  filter: brightness(1.1);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.alert {
  border-radius: 6px;
  padding: 12px 14px;
  background: #edf0f5;
  border: 1px solid #b9c3d7;
  color: #222d4d;
  font-weight: 700;
}

.alert.error {
  background: #fff0ef;
  border-color: #e6b9b3;
  color: #8c2e24;
}

.alert a,
.alert button {
  display: inline-grid;
  min-height: 38px;
  align-items: center;
  margin-top: 10px;
  margin-right: 8px;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 0.92rem;
  text-decoration: none;
}

.alert a {
  background: #ffffff;
  border: 1px solid #95a0b9;
  color: #222d4d;
}

.profile-card {
  display: grid;
  gap: 18px;
  margin-bottom: 20px;
}

.profile-hero {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid #d7dbe3;
  border-radius: 8px;
  background: #f7f9fb;
}

.profile-avatar {
  display: grid;
  width: 132px;
  height: 132px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #d7dbe3;
  border-radius: 8px;
  background: #17212a;
  color: #ffffff;
  font-size: 2.35rem;
  font-weight: 900;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-identity {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.profile-status,
.profile-section-label {
  margin: 0;
  color: #424e6b;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.profile-identity h2 {
  margin: 0;
  color: #17212a;
  font-size: clamp(1.8rem, 4vw, 2.45rem);
  line-height: 1.05;
}

.profile-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.profile-admin-cta {
  border-color: #17212a;
  background: #17212a;
  color: #ffffff;
}

.profile-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  color: #17212a;
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.profile-edit-btn:hover {
  background: #f0f3f7;
  border-color: #171f3a;
  transform: translateY(-1px);
}

.profile-edit-btn:active {
  transform: translateY(0);
}

.profile-edit-btn svg {
  flex-shrink: 0;
}

.dev-role-picker {
  width: min(100%, 260px);
  margin-top: 4px;
}

.dev-role-picker span {
  color: #8a5b11;
}

.dev-role-picker select {
  min-height: 42px;
  border-color: #dfc06a;
  background: #fff9e8;
}

.profile-badge {
  display: inline-grid;
  min-height: 34px;
  align-items: center;
  border: 1px solid #2f3f6f;
  border-radius: 999px;
  padding: 0 12px;
  background: #2f3f6f;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 900;
}

.profile-badge-muted {
  border-color: #c8ced8;
  background: #ffffff;
  color: #222d4d;
}

.profile-organization,
.profile-invite-section {
  display: grid;
  gap: 10px;
  border: 1px solid #d7dde3;
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
}

.profile-organization h3 {
  margin: 0;
  color: #17212a;
  font-size: 1.2rem;
}

.profile-organization p {
  margin: 0;
  color: #586775;
  font-weight: 700;
  line-height: 1.45;
}

.profile-organization-empty {
  border-style: dashed;
  background: #fbfcfd;
}

.profile-detail-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.profile-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
}

.profile-detail span {
  color: #586775;
  font-size: 0.95rem;
  font-weight: 500;
}

.profile-detail span::after {
  content: ":";
}

.profile-detail strong {
  color: #17212a;
  font-size: 1rem;
  font-weight: 600;
  overflow-wrap: break-word;
}

.reset-instruction {
  display: grid;
  gap: 12px;
  margin-top: 4px;
  padding: 16px;
  border: 1px solid #b9c3d7;
  border-radius: 8px;
  background: #edf0f5;
  color: #222d4d;
  font-weight: 700;
  line-height: 1.45;
}

.reset-instruction strong {
  display: inline-grid;
  width: fit-content;
  min-height: 42px;
  align-items: center;
  padding: 0 16px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #95a0b9;
  color: #171f3a;
  font-size: 1.15rem;
}

@media (max-width: 640px) {
  .shell {
    padding: 14px;
    place-items: start center;
  }

  .panel {
    width: 100%;
  }

  .panel > *:not(.header-image) {
    margin-left: 22px;
    margin-right: 22px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .home-signal {
    grid-template-columns: 1fr;
  }

  .profile-hero {
    grid-template-columns: 1fr;
  }

  .profile-avatar {
    width: 104px;
    height: 104px;
    font-size: 1.9rem;
  }

  .image-picker {
    grid-template-columns: 1fr;
  }

  .help-layout {
    grid-template-columns: 1fr;
  }

  .help-topics {
    position: static;
  }
}

/* GroupChat popup surface */
body.chat-page .chat-panel {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  min-height: 100dvh;
  padding: 12px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

body.chat-page .chat-panel > *:not(.header-image) {
  margin-left: 0;
  margin-right: 0;
}

.chat-stage-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}

body.chat-page .chat-stage-body {
  width: 100%;
  min-height: 0;
  overflow: hidden;
}

.chat-context-panel {
  display: grid;
  gap: 12px;
  align-content: start;
  width: min(100%, 1120px);
  height: 100%;
  margin: 0 auto;
  overflow: auto;
}

.chat-context-header {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid rgba(184, 195, 204, 0.55);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
}

.chat-context-header h2 {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
}

.chat-scope-rail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  width: 100%;
}

.chat-scope-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  width: 100%;
}

.chat-scope-item {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(184, 195, 204, 0.7);
  border-radius: 16px;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.chat-scope-item:hover,
.chat-scope-item:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(47, 63, 111, 0.4);
  box-shadow: 0 10px 24px rgba(23, 40, 58, 0.08);
}

.chat-scope-item strong {
  font-size: 1rem;
}

.chat-scope-item span {
  display: block;
  min-width: 0;
}

.chat-scope-meta {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--alliance-text-muted);
}

.chat-popup {
  display: grid;
  align-items: stretch;
  justify-items: stretch;
  width: min(100%, 1120px);
  height: 100%;
  margin: 0 auto;
}

.chat-popup[hidden],
.chat-context-panel[hidden] {
  display: none !important;
}

.chat-popup-card.chat-thread-panel {
  width: 100%;
  height: 100%;
  min-height: 0;
  gap: 12px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(184, 195, 204, 0.55);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 64px rgba(23, 40, 58, 0.12), 0 8px 24px rgba(23, 40, 58, 0.04);
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
}

.chat-popup-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  min-width: 0;
}

.chat-popup-heading {
  min-width: 0;
  display: grid;
  gap: 0;
}

.chat-popup-header h1 {
  margin: 0;
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
}

.chat-popup-header .copy {
  margin: 4px 0 0;
}

.chat-popup-header .button-link {
  align-self: flex-start;
  white-space: nowrap;
}

.chat-message {
  width: 100%;
  max-width: 100%;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid rgba(184, 195, 204, 0.55);
  background: #ffffff;
  display: grid;
  gap: 8px;
}

.chat-message.outgoing {
  justify-self: end;
  background: #edf0f5;
  border-color: rgba(47, 63, 111, 0.25);
}

.chat-message.incoming {
  justify-self: start;
}

.chat-message-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--alliance-text-muted);
  min-width: 0;
}

.chat-message p {
  margin: 0;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-compose-label {
  display: grid;
  gap: 8px;
}

.chat-compose-label span {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--alliance-blue);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chat-compose-label textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  border-radius: 8px;
  border: 1px solid rgba(184, 195, 204, 0.7);
  padding: 12px 14px;
  font: inherit;
  background: #ffffff;
}

.chat-form-actions {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

.chat-form-actions button {
  min-width: 160px;
  max-width: 100%;
}

body.chat-page .chat-thread-meta,
body.chat-page .chat-messages,
body.chat-page .chat-form {
  border-radius: 14px;
}

body.chat-page .chat-thread-meta {
  padding: 14px 16px;
  background: rgba(248, 250, 252, 0.95);
}

body.chat-page .chat-messages {
  padding: 16px;
  overflow: auto;
}

body.chat-page .chat-form {
  padding: 14px 16px 16px;
}

body.chat-page .chat-form-actions {
  justify-content: flex-end;
}

@media (max-width: 860px) {
  body.chat-page .chat-panel {
    padding: 10px;
    gap: 10px;
  }

  .chat-scope-list,
  .chat-scope-rail {
    grid-template-columns: 1fr;
  }

  .chat-popup-card.chat-thread-panel {
    padding: 14px;
    border-radius: 16px;
  }
}

@media (max-width: 620px) {
  .chat-popup-header {
    flex-direction: column;
  }

  .chat-popup-header .button-link {
    width: 100%;
  }

  body.chat-page .chat-form-actions {
    justify-content: stretch;
  }

  body.chat-page .chat-form-actions button {
    width: 100%;
    min-width: 0;
  }
}

.admin-mast {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

/* Chat popup final overrides */
body.chat-page .shell {
  padding: 0;
  place-items: stretch;
  width: 100vw;
  min-height: 100dvh;
}

body.chat-page .chat-panel {
  width: 100vw;
  max-width: 100vw;
  min-height: 100dvh;
  height: 100dvh;
  padding: 12px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

body.chat-page .chat-stage-body {
  width: 100%;
  min-height: 0;
  overflow: hidden;
}

body.chat-page .chat-context-panel,
body.chat-page .chat-popup {
  width: min(100%, 1120px);
  margin: 0 auto;
}

body.chat-page .chat-popup {
  height: 100%;
}

body.chat-page .chat-popup-card.chat-thread-panel {
  width: 100%;
  height: 100%;
  min-height: 0;
  gap: 12px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(184, 195, 204, 0.55);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 64px rgba(23, 40, 58, 0.12), 0 8px 24px rgba(23, 40, 58, 0.04);
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
}

body.chat-page .chat-popup-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  min-width: 0;
}

body.chat-page .chat-thread-meta,
body.chat-page .chat-messages,
body.chat-page .chat-form {
  border-radius: 14px;
}

body.chat-page .chat-thread-meta {
  padding: 14px 16px;
  background: rgba(248, 250, 252, 0.95);
}

body.chat-page .chat-messages {
  padding: 16px;
  overflow: auto;
}

body.chat-page .chat-form {
  padding: 14px 16px 16px;
}

body.chat-page .chat-form-actions {
  justify-content: flex-end;
}

@media (max-width: 860px) {
  body.chat-page .chat-panel {
    padding: 10px;
  }

  body.chat-page .chat-popup-card.chat-thread-panel {
    padding: 14px;
    border-radius: 16px;
  }
}

@media (max-width: 620px) {
  body.chat-page .chat-popup-header {
    flex-direction: column;
  }

  body.chat-page .chat-popup-header .button-link {
    width: 100%;
  }

  body.chat-page .chat-form-actions {
    justify-content: stretch;
  }

  body.chat-page .chat-form-actions button {
    width: 100%;
    min-width: 0;
  }
}

.admin-settings-container {
  position: relative;
}

.settings-btn {
  background: transparent;
  border: 1px solid rgba(184, 195, 204, 0.4);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--alliance-blue);
  transition: all 0.2s ease;
}

.settings-btn:hover {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(184, 195, 204, 0.8);
  transform: translateY(-1px);
}

.settings-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: #ffffff;
  border: 1px solid rgba(184, 195, 204, 0.6);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(23, 40, 58, 0.15);
  min-width: 200px;
  z-index: 100;
  padding: 8px 0;
  animation: fadeUp 0.2s ease forwards;
}

.settings-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--alliance-text);
  cursor: pointer;
  transition: background 0.2s ease;
}

.settings-item:hover {
  background: #f0f3f7;
  color: var(--alliance-blue);
}

.org-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.breadcrumb-link {
  color: #2f3f6f;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.95rem;
}

.breadcrumb-link:hover {
  text-decoration: underline;
}

.breadcrumb-slash {
  color: var(--alliance-text-muted);
  font-weight: 400;
}

/* Rhythmic Intake Manifestation */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(23, 31, 58, 0.4);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 2000;
  padding: 20px;
}

.modal-content {
  background: #ffffff;
  width: min(100%, 480px);
  border-radius: 16px;
  box-shadow: 0 32px 128px rgba(23, 40, 58, 0.2);
  padding: 32px;
  animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-content h2 {
  margin-top: 0;
  margin-bottom: 24px;
}

.modal-form {
  display: grid;
  gap: 16px;
}

.modal-form label span {
  display: block;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--alliance-blue);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.modal-form input, 
.modal-form textarea {
  background: var(--surface-2, #edf0f5);
  border: 1px solid rgba(184, 195, 204, 0.4);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.95rem;
  width: 100%;
  font-family: inherit;
}

.modal-form .posted-by {
  font-size: 0.85rem;
  color: var(--alliance-text-muted);
  background: #f8fafc;
  padding: 10px;
  border-radius: 8px;
  border-left: 3px solid var(--alliance-blue);
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.modal-actions button {
  flex: 1;
} 

@media (max-width: 760px) {
  .tips-band {
    grid-template-columns: 1fr;
  }
}

/* Alliance Chat */
.chat-panel {
  width: min(100%, 1440px);
  height: calc(100dvh - 48px);
  min-height: calc(100dvh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  align-self: stretch;
  justify-self: stretch;
}

body.chat-page .chat-panel {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  min-height: 100dvh;
  border-radius: 0;
  box-shadow: none;
  padding: 12px 12px 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

body.chat-page .chat-panel > *:not(.header-image) {
  margin-left: 0;
  margin-right: 0;
}

body.chat-page .chat-panel > *:last-child {
  margin-bottom: 0;
}

.chat-breadcrumb-row {
  margin: 0 0 12px;
}

.chat-breadcrumb-row a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--alliance-blue);
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  text-decoration: none;
}

.chat-breadcrumb-row a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.chat-shell {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
  width: 100%;
  align-content: stretch;
}

body.chat-page .chat-shell {
  width: 100%;
  margin: 0;
  min-height: 0;
  overflow: hidden;
}

.chat-thread-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
}

body.chat-page .chat-thread-panel {
  gap: 12px;
  min-height: 0;
  overflow: hidden;
}

.chat-thread-panel > * {
  min-width: 0;
}

.chat-thread-meta {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid rgba(184, 195, 204, 0.55);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  width: 100%;
}

body.chat-page .chat-thread-meta,
body.chat-page .chat-messages,
body.chat-page .chat-form {
  border-radius: 12px;
}

.chat-thread-meta h2 {
  margin: 0;
  font-size: 1.25rem;
}

.chat-thread-meta p {
  margin: 0;
}

.chat-jump-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.chat-jump-row a {
  display: inline-grid;
  min-height: 34px;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(184, 195, 204, 0.7);
  background: #ffffff;
  color: var(--alliance-blue);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
}

.chat-jump-row a[aria-current="page"] {
  background: var(--alliance-blue);
  color: #ffffff;
  border-color: var(--alliance-blue);
}

.chat-messages {
  min-height: 0;
  display: grid;
  gap: 12px;
  padding: 18px;
  max-height: none;
  overflow: auto;
  border: 1px solid rgba(184, 195, 204, 0.55);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.95);
  width: 100%;
  align-content: start;
}

body.chat-page .chat-messages {
  padding: 16px;
  overflow-x: hidden;
}

.chat-message {
  width: 100%;
  max-width: 100%;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid rgba(184, 195, 204, 0.55);
  background: #ffffff;
  display: grid;
  gap: 8px;
}

.chat-message.outgoing {
  justify-self: end;
  background: #edf0f5;
  border-color: rgba(47, 63, 111, 0.25);
}

.chat-message.incoming {
  justify-self: start;
}

.chat-message-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--alliance-text-muted);
  min-width: 0;
}

.chat-message p {
  margin: 0;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-form {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid rgba(184, 195, 204, 0.55);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  width: 100%;
}

body.chat-page .chat-form {
  padding: 14px 16px 16px;
}

.chat-compose-label {
  display: grid;
  gap: 8px;
}

.chat-compose-label span {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--alliance-blue);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chat-compose-label textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  border-radius: 8px;
  border: 1px solid rgba(184, 195, 204, 0.7);
  padding: 12px 14px;
  font: inherit;
  background: #ffffff;
}

.chat-form-actions {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

.chat-form-actions button {
  min-width: 160px;
  max-width: 100%;
}

@media (max-width: 860px) {
  body.chat-page .chat-panel {
    height: 100dvh;
    min-height: 100dvh;
  }

  .chat-messages {
    max-height: none;
  }
}

@media (max-width: 620px) {
  .chat-breadcrumb-row {
    margin: 0 0 10px;
  }

  .chat-thread-panel,
  .chat-thread-meta,
  .chat-messages,
  .chat-form {
    width: 100%;
  }

  .chat-message {
    width: 100%;
  }

  .chat-form-actions {
    justify-content: stretch;
  }

  .chat-form-actions button {
    width: 100%;
  }

  body.chat-page .chat-panel {
    padding: 10px 10px 0;
  }
}
