:root {
  --courtyard-black: #050606;
  --courtyard-panel: rgba(11, 12, 13, 0.95);
  --courtyard-panel-soft: rgba(16, 17, 18, 0.9);
  --courtyard-border: rgba(255, 255, 255, 0.12);
  --courtyard-green: #66ff35;
  --courtyard-purple: #bb65ff;
  --courtyard-white: #f4f4f4;
  --courtyard-muted: #aaa6ad;
  --courtyard-danger: #ff5151;
  --courtyard-warning: #ffd45a;
}

* {
  box-sizing: border-box;
}

body.courtyard-page {
  margin: 0;
  min-height: 100vh;
  color: var(--courtyard-white);
  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(83, 16, 111, 0.22),
      transparent 35rem
    ),
    linear-gradient(180deg, #070809 0%, #030404 100%);
}

.hidden {
  display: none !important;
}

.courtyard-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;

  gap: 12px;

  color: var(--courtyard-green);
  background: #030404;

  text-align: center;
  letter-spacing: 0.08em;
}

.courtyard-gate-mark {
  font-size: 3rem;
}

.courtyard-gate p {
  margin: 0;
}

.courtyard-app {
  min-height: 100vh;
}

.courtyard-top-header {
  position: relative;
  z-index: 40;
}

.courtyard-zb-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 5px 12px;
  border: 1px solid var(--courtyard-border);
  border-radius: 999px;
  color: var(--courtyard-white);
  background: #090a0a;
  text-decoration: none;
}

.courtyard-zb-pill > span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #ffe082;
  background: #34290d;
  font-size: 0.68rem;
  font-weight: 800;
}

.courtyard-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: calc(100vh - 90px);
}

.courtyard-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: calc(100vh - 90px);
  padding: 18px 14px 30px;
  border-right: 1px solid rgba(102, 255, 53, 0.28);
  background: rgba(4, 5, 5, 0.96);
}

.sidebar-brand {
  display: block;
  max-width: 160px;
  margin: 0 auto 18px;
}

.sidebar-brand img {
  display: block;
  width: 100%;
  height: auto;
}

.courtyard-side-nav {
  display: grid;
  gap: 4px;
}

.courtyard-side-nav a {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #ddd;
  text-decoration: none;
  font-size: 0.86rem;
}

.courtyard-side-nav a:hover,
.courtyard-side-nav a:focus-visible,
.courtyard-side-nav a.active {
  color: var(--courtyard-green);
  border-color: rgba(102, 255, 53, 0.54);
  background: rgba(102, 255, 53, 0.08);
}

.side-badge {
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  color: white;
  background: #7822aa;
  text-align: center;
  font-size: 0.72rem;
}

.founder-plaque {
  margin-top: 26px;
  padding: 16px 12px;
  border: 1px solid var(--courtyard-border);
  border-radius: 8px;
  background:
    linear-gradient(
      180deg,
      rgba(102, 255, 53, 0.05),
      rgba(0, 0, 0, 0.25)
    );
  text-align: center;
}

.founder-plaque p,
.founder-plaque small {
  margin: 0;
}

.founder-plaque strong {
  display: block;
  margin: 6px 0;
  color: var(--courtyard-green);
}

.founder-plaque small {
  color: var(--courtyard-muted);
}

.courtyard-main {
  width: min(100%, 1480px);
  margin: 0 auto;
  padding: 20px;
}

.courtyard-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 15px 18px;
  border: 1px solid;
  border-radius: 8px;
}

.courtyard-notice strong {
  display: block;
  margin-bottom: 4px;
}

.courtyard-notice p {
  margin: 0;
  color: #ddd;
}

.notice-incomplete {
  border-color: rgba(255, 212, 90, 0.65);
  background: rgba(120, 89, 5, 0.22);
}

.notice-membership {
  border-color: rgba(187, 101, 255, 0.58);
  background: rgba(75, 20, 105, 0.22);
}

.courtyard-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid rgba(102, 255, 53, 0.62);
  border-radius: 6px;
  color: #041500;
  background: var(--courtyard-green);
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}

.courtyard-button.secondary {
  border-color: rgba(187, 101, 255, 0.65);
  color: white;
  background: rgba(99, 26, 142, 0.9);
}

.courtyard-hero {
  position: relative;
  isolation: isolate;
  min-height: 235px;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 38px 42px;
  border: 1px solid var(--courtyard-border);
  border-radius: 9px;
  background:
  linear-gradient(
    90deg,
    rgba(2, 3, 3, 0.95) 0%,
    rgba(2, 3, 3, 0.72) 35%,
    rgba(2, 3, 3, 0.18) 68%,
    rgba(2, 3, 3, 0.08) 100%
  ),
  url("../assets/images/residents-courtyard-banner.png")
  center center / cover no-repeat;
  background-position: center 40%;
}

.courtyard-hero-copy {
  max-width: 520px;
}

.courtyard-hero-copy p {
  margin: 0 0 6px;
  color: #ddd;
}

.courtyard-hero-copy h1 {
  margin: 0 0 8px;
  color: var(--courtyard-green);
  font-size: clamp(2.2rem, 5vw, 4.1rem);
  line-height: 0.96;
}

.courtyard-hero-line {
  color: #cfc8d3 !important;
}

.activity-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.activity-card {
  appearance: none;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 132px;
  padding: 17px;
  border: 1px solid var(--courtyard-border);
  border-radius: 8px;
  color: white;
  background: var(--courtyard-panel);
  text-decoration: none;
  text-align: left;
  cursor: pointer;
}

.activity-card:hover,
.activity-card:focus-visible {
  border-color: rgba(187, 101, 255, 0.72);
}

.activity-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: var(--courtyard-purple);
  background: rgba(129, 38, 174, 0.16);
  font-size: 2rem;
}

.activity-card.matches .activity-icon,
.activity-card.notifications .activity-icon {
  color: var(--courtyard-green);
  background: rgba(102, 255, 53, 0.1);
}

.activity-card strong {
  display: block;
  font-size: 1.85rem;
  line-height: 1;
}

.activity-card small {
  display: block;
  margin-top: 5px;
  color: var(--courtyard-green);
  text-transform: uppercase;
}

.activity-card em {
  grid-column: 1 / -1;
  color: var(--courtyard-muted);
  font-size: 0.78rem;
  font-style: normal;
}

.courtyard-content-grid {
  display: grid;
  grid-template-columns: 1.05fr 1.45fr 0.8fr;
  gap: 12px;
}

.courtyard-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--courtyard-border);
  border-radius: 8px;
  background: var(--courtyard-panel);
}

.courtyard-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--courtyard-border);
}

.courtyard-panel h2 {
  margin: 0;
  color: var(--courtyard-purple);
  font-size: 0.92rem;
  text-transform: uppercase;
}

.courtyard-panel header a {
  color: var(--courtyard-purple);
  font-size: 0.78rem;
  text-decoration: none;
}

.panel-placeholder {
  min-height: 188px;
  display: grid;
  place-items: center;
  padding: 22px;
  color: var(--courtyard-muted);
  text-align: center;
}

.companion-panel,
.balance-panel,
.wheel-panel {
  padding-bottom: 16px;
  text-align: center;
}

.companion-placeholder {
  padding: 22px 15px 8px;
  font-size: 5.5rem;
  filter: grayscale(0.2);
}

.companion-panel h3 {
  margin: 0 14px 6px;
  color: var(--courtyard-green);
  font-size: 1.1rem;
}

.companion-panel p,
.wheel-panel p {
  margin: 0 auto 13px;
  padding: 0 15px;
  color: var(--courtyard-muted);
  font-size: 0.85rem;
}

.wheel-placeholder {
  width: 130px;
  aspect-ratio: 1;
  margin: 18px auto 10px;
  display: grid;
  place-items: center;
  border: 7px double #81715c;
  border-radius: 50%;
  color: var(--courtyard-green);
  background:
    conic-gradient(
      #141414 0 12.5%,
      #252525 0 25%,
      #141414 0 37.5%,
      #252525 0 50%,
      #141414 0 62.5%,
      #252525 0 75%,
      #141414 0 87.5%,
      #252525 0 100%
    );
  font-size: 0.7rem;
  font-weight: 900;
}

.laboratory-panel {
  grid-column: span 2;
}

.laboratory-art-placeholder {
  min-height: 175px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 22px;
  background:
    linear-gradient(
      90deg,
      rgba(11, 12, 13, 0.94),
      rgba(25, 8, 43, 0.44)
    ),
    radial-gradient(
      circle at 72% 44%,
      rgba(97, 75, 180, 0.55),
      transparent 10rem
    ),
    linear-gradient(135deg, #0b0c0e, #161026);
}

.laboratory-art-placeholder span {
  color: white;
  font-size: 1.55rem;
}

.laboratory-art-placeholder small {
  color: var(--courtyard-purple);
  text-transform: uppercase;
}

.laboratory-panel > .courtyard-button {
  margin: 12px 16px 16px;
}

.balance-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.balance-label {
  margin: 22px 0 4px;
  color: var(--courtyard-muted);
  text-transform: uppercase;
}

.balance-panel > strong {
  margin-bottom: 20px;
  color: var(--courtyard-green);
  font-size: 2.3rem;
}

.balance-panel > strong small {
  font-size: 1rem;
}

.quick-actions-panel {
  margin-top: 12px;
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

.quick-actions-grid a {
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 6px;
  border-right: 1px solid var(--courtyard-border);
  color: #ddd;
  text-decoration: none;
  text-align: center;
  font-size: 0.72rem;
}

.quick-actions-grid a:last-child {
  border-right: 0;
}

.quick-actions-grid a:hover,
.quick-actions-grid a:focus-visible {
  color: var(--courtyard-green);
  background: rgba(102, 255, 53, 0.06);
}

.quick-actions-grid span {
  font-size: 1.35rem;
}

.courtyard-footer {
  padding: 28px 18px 94px;
  color: var(--courtyard-muted);
  text-align: center;
}

.courtyard-footer p {
  margin: 0 0 5px;
  color: var(--courtyard-green);
  letter-spacing: 0.12em;
}

.courtyard-mobile-nav,
.mobile-menu-drawer,
.mobile-menu-backdrop {
  display: none;
}

.account-status-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
}

.account-status-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
}

.account-status-card {
  position: relative;
  width: min(100%, 590px);
  padding: 28px;
  border: 1px solid rgba(255, 81, 81, 0.62);
  border-radius: 10px;
  background: #0b0c0d;
  text-align: center;
}

.account-status-symbol {
  color: var(--courtyard-danger);
  font-size: 2.5rem;
}

.account-status-card h2 {
  color: var(--courtyard-danger);
}

.account-status-reason {
  padding: 12px;
  border: 1px solid var(--courtyard-border);
  background: #111;
}

.account-status-warning {
  color: var(--courtyard-muted);
  font-size: 0.9rem;
}

.account-status-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

@media (max-width: 1180px) {
  .courtyard-layout {
    grid-template-columns: 200px minmax(0, 1fr);
  }

  .activity-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .courtyard-content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .companion-panel {
    grid-column: auto;
  }

  .laboratory-panel {
    grid-column: span 1;
  }

  .quick-actions-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .quick-actions-grid a {
    border-bottom: 1px solid var(--courtyard-border);
  }
}

@media (max-width: 900px) {
  .courtyard-top-header .main-nav {
    display: none;
  }

  .courtyard-layout {
    display: block;
  }

  .courtyard-sidebar {
    display: none;
  }

  .courtyard-main {
    padding: 14px 14px 92px;
  }

  .courtyard-content-grid {
    grid-template-columns: 1fr 1fr;
  }

  .courtyard-mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    min-height: 68px;
    padding-bottom: env(safe-area-inset-bottom, 0);
    border-top: 1px solid rgba(102, 255, 53, 0.33);
    background: rgba(3, 4, 4, 0.97);
  }

  .courtyard-mobile-nav a,
  .courtyard-mobile-nav button {
    appearance: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 0;
    color: #d3d3d3;
    background: transparent;
    text-decoration: none;
    font-size: 0.65rem;
  }

  .courtyard-mobile-nav span {
    font-size: 1.25rem;
  }

  .courtyard-mobile-nav .active {
    color: var(--courtyard-green);
  }

  .mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 110;
    display: block;
    background: rgba(0, 0, 0, 0.78);
  }

  .mobile-menu-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 120;
    display: block;
    width: min(88vw, 360px);
    overflow-y: auto;
    padding-bottom: 30px;
    border-left: 1px solid rgba(102, 255, 53, 0.35);
    background: #080909;
    transform: translateX(105%);
    transition: transform 0.22s ease;
  }

  .mobile-menu-drawer.open {
    transform: translateX(0);
  }

  .mobile-menu-profile {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 18px;
    border-bottom: 1px solid var(--courtyard-border);
  }

  .mobile-menu-profile img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
  }

  .mobile-menu-profile strong {
    display: block;
  }

  .mobile-menu-profile a {
    color: var(--courtyard-purple);
    font-size: 0.8rem;
  }

  .mobile-menu-profile button {
    align-self: start;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    color: white;
    background: #551979;
  }

  .mobile-menu-drawer nav {
    display: grid;
    padding: 12px;
  }

  .mobile-menu-drawer nav a {
    padding: 13px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    color: #e0e0e0;
    text-decoration: none;
  }

  .mobile-menu-drawer nav a.active {
    color: var(--courtyard-green);
    background: rgba(102, 255, 53, 0.07);
  }
}

@media (max-width: 650px) {
  .courtyard-top-header .courtyard-zb-pill {
    display: none;
  }

  .courtyard-main {
    padding: 10px 10px 86px;
  }

  .courtyard-notice {
    align-items: stretch;
    flex-direction: column;
  }

  .courtyard-hero {
    min-height: 265px;
    align-items: flex-end;
    padding: 24px 20px;
    background:
      linear-gradient(
        180deg,
        rgba(3, 4, 4, 0.28),
        rgba(3, 4, 4, 0.97)
      ),
      radial-gradient(
        circle at 60% 18%,
        rgba(218, 224, 218, 0.65) 0 37px,
        transparent 39px
      ),
      linear-gradient(180deg, #10191a 0 50%, #0b130d 51%);
  }

  .courtyard-hero-copy h1 {
    font-size: 2.5rem;
  }

  .courtyard-raven-placeholder {
    top: 20px;
    right: 12%;
    font-size: 3.8rem;
  }

  .activity-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .activity-card {
    min-height: 112px;
    grid-template-columns: 40px minmax(0, 1fr);
    padding: 12px 10px;
  }

  .activity-icon {
    width: 38px;
    height: 38px;
    font-size: 1.5rem;
  }

  .activity-card strong {
    font-size: 1.55rem;
  }

  .activity-card small {
    font-size: 0.65rem;
  }

  .activity-card em {
    display: none;
  }

  .courtyard-content-grid {
    grid-template-columns: 1fr;
  }

  .daily-panel {
    order: 1;
  }

  .companion-panel {
    order: 2;
  }

  .forum-panel {
    order: 3;
  }

  .wheel-panel {
    order: 4;
  }

  .laboratory-panel {
    order: 5;
  }

  .balance-panel {
    order: 6;
  }

  .quick-actions-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .quick-actions-grid a {
    min-height: 84px;
  }
}

@media (max-width: 360px) {
  .activity-card {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .activity-card span:nth-child(2) {
    text-align: center;
  }

  .quick-actions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* =========================================================
   CRITICAL COURTYARD OVERRIDES
   These prevent the site's older global CSS from breaking
   the Residents' Courtyard layout.
========================================================= */

/* The HTML hidden attribute must always actually hide things. */
[hidden] {
  display: none !important;
}

/* Ensure the loading gate disappears after authentication. */
.courtyard-gate.hidden,
.courtyard-gate[hidden] {
  display: none !important;
}

/* Existing site CSS applies grid rules to main.
   The Courtyard main area must control its own internal layout. */
body.courtyard-page main.courtyard-main {
  display: block !important;
  grid-template-columns: none !important;
  grid-template-rows: none !important;
  grid-auto-flow: initial !important;
  align-items: initial !important;
  justify-items: initial !important;
}

/* Prevent inherited width rules from squeezing the dashboard. */
body.courtyard-page .courtyard-main {
  min-width: 0 !important;
  max-width: 1480px !important;
  width: 100% !important;
}

/* Keep every major dashboard section on its own normal row. */
body.courtyard-page .courtyard-hero,
body.courtyard-page .activity-grid,
body.courtyard-page .courtyard-content-grid,
body.courtyard-page .quick-actions-panel {
  width: 100% !important;
  min-width: 0 !important;
}

/* Stop global article/card styles from changing our grid placement. */
body.courtyard-page .activity-card,
body.courtyard-page .courtyard-panel {
  position: relative !important;
  min-width: 0 !important;
  max-width: none !important;
  width: auto !important;
}

/* Restore the intended four-card desktop row. */
@media (min-width: 1181px) {
  body.courtyard-page .activity-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  body.courtyard-page .courtyard-content-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.45fr) minmax(260px, 0.8fr) !important;
  }

  body.courtyard-page .quick-actions-grid {
    display: grid !important;
    grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
  }
}

/* Tablet protection. */
@media (min-width: 651px) and (max-width: 1180px) {
  body.courtyard-page .activity-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.courtyard-page .courtyard-content-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Mobile protection. */
@media (max-width: 650px) {
  body.courtyard-page .activity-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.courtyard-page .courtyard-content-grid {
    display: flex !important;
    flex-direction: column !important;
  }

  body.courtyard-page .quick-actions-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* =========================================================
   DESKTOP COURTYARD HEADER CLEANUP
========================================================= */

@media (min-width: 901px) {

  /*
    Hide the duplicated top logo and navigation.
    Desktop uses the left dashboard sidebar instead.
  */
  body.courtyard-page .courtyard-top-header .logo-link,
  body.courtyard-page .courtyard-top-header .main-nav {
    display: none !important;
  }

  /*
    Keep only ZombieBucks, notifications, and the avatar
    at the upper-right.
  */
  body.courtyard-page .courtyard-top-header {
    position: absolute !important;
    top: 14px !important;
    right: 22px !important;
    left: auto !important;

    width: auto !important;
    min-height: auto !important;

    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;

    z-index: 70 !important;
  }

  body.courtyard-page .courtyard-top-header .header-right {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
  }
}

/* =========================================================
   COURTYARD HERO / WELCOME HEADER
========================================================= */

body.courtyard-page .courtyard-layout {
  align-items: stretch !important;
}

body.courtyard-page .courtyard-main {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;

  margin: 0 !important;
  padding: 0 22px 40px !important;
}

body.courtyard-page .courtyard-hero {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 270px !important;

  margin: 0 !important;
  padding: 42px 38px !important;

  display: flex !important;
  align-items: flex-start !important;

  border-top: 0 !important;
  border-radius: 0 0 10px 10px !important;

  overflow: hidden !important;
}

body.courtyard-page .courtyard-hero-copy {
  position: relative !important;
  z-index: 5 !important;

  width: min(100%, 500px) !important;
  max-width: 500px !important;

  padding-top: 10px !important;
}

body.courtyard-page .courtyard-hero-copy > p:first-child {
  margin-bottom: 8px !important;

  color: #eeeeee !important;

  font-size: 0.95rem !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
}

body.courtyard-page .courtyard-hero-copy h1 {
  width: auto !important;

  margin: 0 0 12px !important;

  color: #f5f5f5 !important;

  font-size: clamp(2.6rem, 5vw, 4.4rem) !important;
  line-height: 1 !important;

  white-space: normal !important;
  overflow: visible !important;
}

body.courtyard-page .courtyard-hero-line {
  width: min(100%, 430px) !important;

  color: #d5c6dc !important;

  font-size: 1rem !important;
  line-height: 1.6 !important;
}

/* =========================================================
   ACTIVITY CARDS
========================================================= */

body.courtyard-page .activity-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;

  width: 100% !important;
  min-width: 0 !important;

  gap: 12px !important;

  margin: 14px 0 !important;
}

body.courtyard-page .activity-card {
  display: grid !important;
  grid-template-columns: 58px minmax(0, 1fr) !important;

  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;

  min-height: 125px !important;

  padding: 17px !important;

  overflow: hidden !important;
}

body.courtyard-page .activity-card strong {
  display: block !important;

  color: #ffffff !important;

  font-size: 2rem !important;
  line-height: 1 !important;
}

body.courtyard-page .activity-card small {
  display: block !important;

  margin-top: 5px !important;

  font-size: 0.72rem !important;
  white-space: normal !important;
}

body.courtyard-page .activity-card em {
  display: block !important;
  grid-column: 1 / -1 !important;

  width: 100% !important;

  overflow: hidden !important;

  color: #aaa6ad !important;

  font-size: 0.77rem !important;
  line-height: 1.4 !important;
}

@media (max-width: 1180px) {
  body.courtyard-page .activity-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 650px) {
  body.courtyard-page .activity-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* =========================================================
   MAIN DASHBOARD PANEL LAYOUT
========================================================= */

body.courtyard-page .courtyard-content-grid {
  display: grid !important;

  grid-template-columns:
    minmax(260px, 1fr)
    minmax(360px, 1.4fr)
    minmax(250px, 0.8fr) !important;

  width: 100% !important;
  min-width: 0 !important;

  gap: 12px !important;
}

body.courtyard-page .courtyard-panel {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
}

body.courtyard-page .daily-panel {
  grid-column: 1 !important;
}

body.courtyard-page .forum-panel {
  grid-column: 2 !important;
}

body.courtyard-page .companion-panel {
  grid-column: 3 !important;
}

body.courtyard-page .wheel-panel {
  grid-column: 1 !important;
}

body.courtyard-page .laboratory-panel {
  grid-column: 2 !important;
}

body.courtyard-page .balance-panel {
  grid-column: 3 !important;
}

body.courtyard-page .quick-actions-panel {
  width: 100% !important;
  min-width: 0 !important;

  margin-top: 12px !important;
}

body.courtyard-page .quick-actions-grid {
  display: grid !important;
  grid-template-columns: repeat(8, minmax(0, 1fr)) !important;

  width: 100% !important;
}

@media (max-width: 1180px) {
  body.courtyard-page .courtyard-content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.courtyard-page .daily-panel,
  body.courtyard-page .forum-panel,
  body.courtyard-page .companion-panel,
  body.courtyard-page .wheel-panel,
  body.courtyard-page .laboratory-panel,
  body.courtyard-page .balance-panel {
    grid-column: auto !important;
  }

  body.courtyard-page .quick-actions-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 650px) {
  body.courtyard-page .courtyard-content-grid {
    display: flex !important;
    flex-direction: column !important;
  }

  body.courtyard-page .quick-actions-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

body.courtyard-page .courtyard-hero::after {
  display: none !important;
}

body.courtyard-page .courtyard-hero-overlay,
body.courtyard-page .courtyard-raven-placeholder {
  display: none !important;
}

body.courtyard-page .courtyard-hero-copy {
  position: relative;
  z-index: 5;

  max-width: 540px;
  padding: 18px 22px;

  border-radius: 8px;

  background:
    linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.78),
      rgba(0, 0, 0, 0.42),
      transparent
    );
}

@media (max-width: 650px) {
  body.courtyard-page .courtyard-hero {
    min-height: 330px;

    padding: 20px;

    background:
      linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.12),
        rgba(0, 0, 0, 0.82)
      ),
      url("../assets/images/residents-courtyard-banner.png")
      58% center / cover no-repeat;
  }

  body.courtyard-page .courtyard-hero-copy {
    align-self: flex-end;
    max-width: 100%;
    padding: 14px 16px;
  }
}

/* =========================================================
   STAFF-ONLY ADMINISTRATION WING ENTRANCES
========================================================= */

.staff-only-link[hidden],
.staff-only-link.hidden {
  display: none !important;
}

/* Desktop sidebar entrance */

body.courtyard-page .courtyard-side-nav .courtyard-staff-link {
  position: relative;

  margin-top: 10px;

  color: #cfffbe;

  border-color: rgba(102, 255, 53, 0.42);

  background:
    linear-gradient(
      90deg,
      rgba(102, 255, 53, 0.14),
      rgba(102, 255, 53, 0.035)
    );

  box-shadow:
    inset 0 0 18px rgba(102, 255, 53, 0.035),
    0 0 12px rgba(102, 255, 53, 0.035);
}

body.courtyard-page
.courtyard-side-nav
.courtyard-staff-link:hover,
body.courtyard-page
.courtyard-side-nav
.courtyard-staff-link:focus-visible {
  color: #ffffff;

  border-color: rgba(102, 255, 53, 0.82);

  background:
    linear-gradient(
      90deg,
      rgba(102, 255, 53, 0.22),
      rgba(102, 255, 53, 0.07)
    );

  box-shadow:
    inset 0 0 22px rgba(102, 255, 53, 0.06),
    0 0 18px rgba(102, 255, 53, 0.08);
}

.staff-access-badge {
  padding: 2px 6px;

  color: #061000;
  background: var(--courtyard-green);

  border-radius: 999px;

  font-size: 0.52rem;
  font-weight: 900;
  letter-spacing: 0.05em;
}

/* Quick Action */

body.courtyard-page
.quick-actions-grid
.staff-quick-action {
  color: var(--courtyard-green);

  background:
    radial-gradient(
      circle at 50% 30%,
      rgba(102, 255, 53, 0.13),
      transparent 58%
    ),
    rgba(102, 255, 53, 0.025);

  box-shadow:
    inset 0 0 0 1px rgba(102, 255, 53, 0.18);
}

body.courtyard-page
.quick-actions-grid
.staff-quick-action:hover {
  color: #ffffff;

  background:
    radial-gradient(
      circle at 50% 30%,
      rgba(102, 255, 53, 0.2),
      transparent 62%
    ),
    rgba(102, 255, 53, 0.06);
}

/* Mobile drawer entrance */

body.courtyard-page
.mobile-menu-drawer
.mobile-staff-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;

  margin: 10px 0;

  color: var(--courtyard-green);

  border: 1px solid rgba(102, 255, 53, 0.34);
  border-radius: 7px;

  background:
    linear-gradient(
      90deg,
      rgba(102, 255, 53, 0.13),
      rgba(102, 255, 53, 0.025)
    );
}

body.courtyard-page
.mobile-menu-drawer
.mobile-staff-link small {
  color: #91b48a;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/*
 * Nine Quick Actions for staff on wide screens.
 */
@media (min-width: 1181px) {
  body.courtyard-page.staff-access-active
  .quick-actions-grid {
    grid-template-columns:
      repeat(9, minmax(0, 1fr)) !important;
  }
}

/* =========================================================
   RESIDENT PROFILE ENVIRONMENT CARD
   2026-07-30
========================================================= */

body.courtyard-page .environment-panel {
  grid-column: 3 !important;
  padding-bottom: 0;
  text-align: left;
}

.environment-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 24px;
  padding: 3px 9px;

  border: 1px solid rgba(102, 255, 53, 0.3);
  border-radius: 999px;

  color: var(--courtyard-green);
  background: rgba(102, 255, 53, 0.08);

  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.environment-preview {
  position: relative;
  isolation: isolate;

  min-height: 190px;
  overflow: hidden;

  display: flex;
  align-items: flex-end;

  background:
    radial-gradient(
      circle at 50% 25%,
      rgba(111, 40, 151, 0.35),
      transparent 13rem
    ),
    linear-gradient(
      145deg,
      #17101f,
      #08090a 65%
    );

  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

.environment-preview-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;

  background:
    linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.05) 15%,
      rgba(0, 0, 0, 0.88) 100%
    );
}

.environment-preview-content {
  position: relative;
  z-index: 2;

  width: 100%;

  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: center;
  gap: 12px;

  padding: 18px;
}

.environment-avatar {
  display: block;

  width: 68px;
  height: 68px;

  border: 2px solid rgba(102, 255, 53, 0.72);
  border-radius: 50%;

  background: #050505;
  object-fit: cover;

  box-shadow:
    0 0 0 4px rgba(0, 0, 0, 0.56),
    0 0 22px rgba(102, 255, 53, 0.2);
}

.environment-preview-copy {
  min-width: 0;
}

.environment-preview-copy small {
  display: block;
  margin-bottom: 3px;

  color: rgba(255, 255, 255, 0.68);

  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.environment-preview-copy h3 {
  margin: 0 0 6px;

  overflow: hidden;

  color: #ffffff;

  font-size: 1.25rem;
  line-height: 1.15;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.environment-preview-copy span {
  display: inline-flex;

  max-width: 100%;
  padding: 3px 8px;

  overflow: hidden;

  border: 1px solid rgba(187, 101, 255, 0.42);
  border-radius: 999px;

  color: #d8a6ff;
  background: rgba(80, 22, 112, 0.48);

  font-size: 0.67rem;
  font-weight: 700;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.environment-panel-details {
  padding: 14px;
}

.environment-panel-details > p {
  min-height: 38px;
  margin: 0 0 13px;

  color: var(--courtyard-muted);

  font-size: 0.8rem;
  line-height: 1.45;
}

.environment-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.environment-actions .courtyard-button {
  min-width: 0;
  min-height: 38px;

  padding: 8px 10px;

  text-align: center;
  font-size: 0.72rem;
}

@media (max-width: 1180px) {
  body.courtyard-page .environment-panel {
    grid-column: auto !important;
  }
}

@media (max-width: 650px) {
  .environment-preview {
    min-height: 220px;
  }

  .environment-preview-content {
    grid-template-columns: 62px minmax(0, 1fr);
    padding: 16px;
  }

  .environment-avatar {
    width: 62px;
    height: 62px;
  }

  .environment-preview-copy h3 {
    font-size: 1.15rem;
  }

  .environment-actions {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   RESIDENT RECORD WORKSPACE
   2026-08-19
========================================================= */

body.courtyard-page
.courtyard-management-workspace {
  margin-top: 12px;

  border-color:
    rgba(102, 255, 53, 0.22);

  background:
    linear-gradient(
      180deg,
      rgba(12, 14, 13, 0.98),
      rgba(6, 7, 7, 0.98)
    );

  box-shadow:
    inset 0 0 30px
      rgba(102, 255, 53, 0.018);
}


/* ---------- Workspace header ---------- */

body.courtyard-page
.courtyard-management-workspace
> header {
  align-items: flex-start;

  min-height: 0;

  padding: 20px 22px;

  background:
    linear-gradient(
      90deg,
      rgba(102, 255, 53, 0.055),
      rgba(187, 101, 255, 0.025),
      transparent
    );
}


body.courtyard-page
.courtyard-management-workspace
> header
> div {
  min-width: 0;
}


body.courtyard-page
.courtyard-kicker {
  margin:
    0
    0
    5px;

  color:
    var(--courtyard-green);

  font-size: 0.68rem;
  font-weight: 900;

  letter-spacing: 0.12em;
  text-transform: uppercase;
}


body.courtyard-page
.courtyard-management-workspace
> header
h2 {
  margin:
    0
    0
    6px;

  color:
    #ffffff;

  font-size: 1.45rem;

  line-height: 1.1;

  text-transform: none;
}


body.courtyard-page
.courtyard-management-workspace
> header
p:last-child {
  margin: 0;

  color:
    var(--courtyard-muted);

  font-size: 0.86rem;
  line-height: 1.45;
}


/* ---------- Workspace content ---------- */

body.courtyard-page
#residentRecordWorkspaceContent {
  padding: 20px;
}


/* ---------- Basic Information card ---------- */

body.courtyard-page
.resident-record-section {
  overflow: hidden;

  border:
    1px solid
    rgba(255, 255, 255, 0.09);

  border-radius: 9px;

  background:
    rgba(7, 9, 8, 0.88);
}


body.courtyard-page
.resident-record-section
> header {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 24px;

  padding:
    15px
    20px;

  border-bottom:
    1px solid
    rgba(255, 255, 255, 0.08);

  background:
    linear-gradient(
      90deg,
      rgba(187, 101, 255, 0.055),
      transparent
    );
}


body.courtyard-page
.resident-record-section
> header
h3 {
  flex:
    0
    0
    auto;

  margin: 0;

  color:
    var(--courtyard-purple);

  font-size: 0.92rem;
  font-weight: 900;

  letter-spacing: 0.04em;
  text-transform: uppercase;
}


body.courtyard-page
.resident-record-section
> header
p {
  max-width: 620px;

  margin: 0;

  color:
    var(--courtyard-muted);

  font-size: 0.78rem;
  line-height: 1.45;

  text-align: right;
}


/* ---------- Form grid ---------- */

body.courtyard-page
.resident-record-grid {
  display: grid;

  grid-template-columns:
    repeat(
      2,
      minmax(0, 1fr)
    );

  gap:
    17px
    20px;

  width: 100%;

  padding:
    20px;
}


body.courtyard-page
.resident-record-field {
  display: flex;

  flex-direction: column;

  gap: 7px;

  min-width: 0;

  color:
    #e9e9e9;

  font-size: 0.78rem;
  font-weight: 800;

  line-height: 1.3;
}


body.courtyard-page
.resident-record-field-full {
  grid-column:
    1 / -1;
}


/* ---------- Inputs ---------- */

body.courtyard-page
.resident-record-field
input,

body.courtyard-page
.resident-record-field
select,

body.courtyard-page
.resident-record-field
textarea {
  width: 100%;

  min-width: 0;
  max-width: 100%;

  margin: 0;

  padding:
    10px
    12px;

  box-sizing:
    border-box;

  border:
    1px solid
    rgba(255, 255, 255, 0.15);

  border-radius: 6px;

  outline: none;

  color:
    #f5f5f5;

  background:
    #080a09;

  font: inherit;
  font-weight: 500;

  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}


body.courtyard-page
.resident-record-field
input,

body.courtyard-page
.resident-record-field
select {
  min-height: 44px;
}


body.courtyard-page
.resident-record-field
textarea {
  min-height: 118px;

  line-height: 1.5;

  resize: vertical;
}


body.courtyard-page
.resident-record-field
input:focus,

body.courtyard-page
.resident-record-field
select:focus,

body.courtyard-page
.resident-record-field
textarea:focus {
  border-color:
    rgba(102, 255, 53, 0.72);

  background:
    #0a0d0b;

  box-shadow:
    0 0 0 3px
      rgba(102, 255, 53, 0.07);
}


body.courtyard-page
.resident-record-field
input[type="date"] {
  color-scheme: dark;
}


/* ---------- Save area ---------- */

body.courtyard-page
.resident-record-actions {
  display: flex;

  justify-content: flex-end;

  padding:
    4px
    20px
    10px;
}


body.courtyard-page
#residentRecordSaveButton {
  min-width: 210px;

  min-height: 44px;
}


body.courtyard-page
#residentRecordSaveButton:disabled {
  opacity: 0.55;

  cursor: wait;
}


body.courtyard-page
#residentRecordLoadStatus {
  min-height: 20px;

  margin:
    0
    20px
    18px;

  color:
    var(--courtyard-muted);

  font-size: 0.76rem;
  line-height: 1.4;
}

/* =========================================================
   RESIDENT RECORD WORKSPACE — MOBILE
   2026-08-19
========================================================= */

@media (max-width: 650px) {

  body.courtyard-page
  .courtyard-management-workspace {
    margin-top: 10px;
    border-radius: 8px;
  }

  body.courtyard-page {
  background:
    linear-gradient(
      180deg,
      #070809 0%,
      #030404 100%
    ) !important;
}

body.courtyard-page
.courtyard-app,

body.courtyard-page
.courtyard-layout,

body.courtyard-page
.courtyard-main {
  background:
    transparent !important;
}


  /* ---------- Workspace heading ---------- */

  body.courtyard-page
  .courtyard-management-workspace
  > header {
    flex-direction: column;
    align-items: stretch;

    gap: 14px;

    padding: 17px 15px;
  }

  body.courtyard-page
.courtyard-management-workspace {
  background:
    linear-gradient(
      180deg,
      rgba(12, 14, 13, 0.99),
      rgba(4, 5, 5, 0.99)
    ) !important;
}

  body.courtyard-page
  .courtyard-management-workspace
  > header
  h2 {
    font-size: 1.3rem;
  }


  body.courtyard-page
  .courtyard-management-workspace
  > header
  p:last-child {
    font-size: 0.82rem;
  }


  body.courtyard-page
#residentRecordBackButton {
  width: auto !important;
  max-width: 100% !important;

  align-self: flex-start;

  min-height: 42px;

  padding:
    9px
    18px;

  margin: 0 !important;
}


  /* ---------- Workspace body ---------- */

  body.courtyard-page
  #residentRecordWorkspaceContent {
    padding: 12px;
  }


  /* ---------- Section heading ---------- */

  body.courtyard-page
  .resident-record-section
  > header {
    flex-direction: column;
    align-items: flex-start;

    gap: 6px;

    padding: 14px;
  }


  body.courtyard-page
  .resident-record-section
  > header
  p {
    max-width: none;

    font-size: 0.74rem;
    line-height: 1.45;

    text-align: left;
  }


  /* ---------- Form ---------- */

  body.courtyard-page
  .resident-record-grid {
    grid-template-columns: 1fr;

    gap: 14px;

    padding: 15px 14px;
  }


  body.courtyard-page
  .resident-record-field,
  body.courtyard-page
  .resident-record-field-full {
    grid-column: auto;

    width: 100%;
    min-width: 0;
  }


  body.courtyard-page
  .resident-record-field {
    gap: 6px;

    font-size: 0.78rem;
  }


  body.courtyard-page
  .resident-record-field
  input,

  body.courtyard-page
  .resident-record-field
  select,

  body.courtyard-page
  .resident-record-field
  textarea {
    width: 100% !important;
    max-width: 100% !important;

    font-size: 16px !important;
  }


  body.courtyard-page
  .resident-record-field
  input,

  body.courtyard-page
  .resident-record-field
  select {
    min-height: 48px;
  }


  body.courtyard-page
  .resident-record-field
  textarea {
    min-height: 140px;
  }


  /* ---------- Save ---------- */

  body.courtyard-page
  .resident-record-actions {
    padding:
      5px
      14px
      10px;
  }


  body.courtyard-page
  #residentRecordSaveButton {
    width: 100%;
    min-width: 0;

    min-height: 48px;
  }


  body.courtyard-page
  #residentRecordLoadStatus {
    margin:
      0
      14px
      16px;

    font-size: 0.74rem;
  }
}

/* =========================================================
   COURTYARD MOBILE NAVIGATION SHELL
   2026-08-24
   Matches the Investigator Dashboard hamburger/drawer model
========================================================= */

.courtyard-mobile-menu-button {
  display: none;
}

@media (max-width: 900px) {

  /* =====================================================
     STOP GLOBAL mobile.css FROM BUILDING THE LARGE
     STACKED SITE HEADER ON THE COURTYARD
  ===================================================== */

  body.courtyard-page
  .courtyard-top-header {
    position: relative !important;

    display: grid !important;
    grid-template-columns:
      48px
      minmax(0, 1fr)
      auto !important;

    align-items: center !important;

    width: 100% !important;
    min-height: 72px !important;

    margin: 0 !important;
    padding:
      10px
      14px !important;

    gap: 10px !important;

    background:
      rgba(3, 4, 4, 0.98) !important;

    border-bottom:
      1px solid
      rgba(102, 255, 53, 0.26) !important;

    overflow: visible !important;

    box-sizing: border-box !important;

    z-index: 80 !important;
  }


  /* Hide the desktop navigation completely. */

  body.courtyard-page
  .courtyard-top-header
  .main-nav {
    display: none !important;
  }


  /* =====================================================
     HAMBURGER
  ===================================================== */

  body.courtyard-page
  .courtyard-mobile-menu-button {
    display: grid !important;

    width: 46px !important;
    height: 46px !important;

    min-width: 46px !important;
    min-height: 46px !important;

    margin: 0 !important;
    padding: 0 !important;

    place-items: center;

    color:
      var(--courtyard-green) !important;

    background:
      #0c0d0d !important;

    border:
      1px solid
      rgba(255, 255, 255, 0.16) !important;

    border-radius:
      7px !important;

    box-shadow:
      none !important;

    font-size:
      1.65rem !important;

    line-height:
      1 !important;

    cursor:
      pointer;
  }


  /* =====================================================
     LOGO
  ===================================================== */

  body.courtyard-page
  .courtyard-top-header
  .logo-link {
    position: static !important;

    display: flex !important;

    width: 100% !important;
    min-width: 0 !important;

    margin: 0 !important;
    padding: 0 !important;

    justify-content: center !important;
  }

  body.courtyard-page
  .courtyard-top-header
  .site-logo {
    display: block !important;

    width:
      min(155px, 42vw) !important;

    max-width:
      155px !important;

    height:
      auto !important;

    max-height:
      58px !important;

    margin:
      0 auto !important;
  }


  /* =====================================================
     RIGHT-SIDE CONTROLS
  ===================================================== */

  body.courtyard-page
  .courtyard-top-header
  .header-right {
    position: relative !important;

    display: flex !important;

    width: auto !important;

    min-width: 0 !important;

    margin: 0 !important;
    padding: 0 !important;

    align-items: center !important;
    justify-content: flex-end !important;

    gap: 8px !important;
  }

  body.courtyard-page
  .courtyard-top-header
  .courtyard-zb-pill {
    display: none !important;
  }

  body.courtyard-page
  .courtyard-top-header
  .notif-btn,

  body.courtyard-page
  .courtyard-top-header
  .avatar-btn {
    width: 42px !important;
    height: 42px !important;

    min-width: 42px !important;
    min-height: 42px !important;

    margin: 0 !important;
  }

  body.courtyard-page
  .courtyard-top-header
  #userAvatar {
    width: 38px !important;
    height: 38px !important;
  }


  /* =====================================================
     REMOVE OLD BOTTOM MOBILE NAV
  ===================================================== */

  body.courtyard-page
  .courtyard-mobile-nav {
    display: none !important;
  }


  /* =====================================================
     LEFT-SIDE DRAWER
  ===================================================== */

  body.courtyard-page
  .mobile-menu-drawer {
    position: fixed !important;

    top: 0 !important;
    bottom: 0 !important;

    left: 0 !important;
    right: auto !important;

    width:
      min(88vw, 360px) !important;

    height:
      100dvh !important;

    overflow-x:
      hidden !important;

    overflow-y:
      auto !important;

    padding-bottom:
      max(
        30px,
        env(safe-area-inset-bottom)
      ) !important;

    border-left:
      0 !important;

    border-right:
      1px solid
      rgba(102, 255, 53, 0.35) !important;

    background:
      #080909 !important;

    transform:
      translateX(-105%) !important;

    transition:
      transform
      0.22s
      ease !important;

    z-index:
      120 !important;
  }

  body.courtyard-page
  .mobile-menu-drawer.open {
    transform:
      translateX(0) !important;
  }


  /* =====================================================
     BACKDROP
  ===================================================== */

  body.courtyard-page
  .mobile-menu-backdrop {
    position:
      fixed !important;

    inset:
      0 !important;

    z-index:
      110 !important;

    background:
      rgba(0, 0, 0, 0.78) !important;
  }


  /* =====================================================
     DRAWER CLOSE BUTTON
  ===================================================== */

  body.courtyard-page
  #mobileMenuClose {
    display: grid !important;

    width: 38px !important;
    height: 38px !important;

    min-width: 38px !important;
    min-height: 38px !important;

    margin: 0 !important;
    padding: 0 !important;

    place-items: center;

    color:
      var(--courtyard-green) !important;

    background:
      #101111 !important;

    border:
      1px solid
      rgba(102, 255, 53, 0.32) !important;

    border-radius:
      50% !important;

    font-size:
      1.5rem !important;

    line-height:
      1 !important;
  }


  /* Bottom bar no longer exists, so page content
     does not need the old 86–92px reserved space. */

  body.courtyard-page
  .courtyard-main {
    padding-bottom:
      36px !important;
  }

}

/* =========================================================
   COURTYARD MOBILE TEXT / PANEL CONTAINMENT
   2026-08-24
========================================================= */

@media (max-width: 650px) {

  /* =====================================================
     GENERAL PANEL HEADERS
     Let titles/status/actions wrap instead of clipping.
  ===================================================== */

  body.courtyard-page
  .courtyard-panel > header {
    flex-wrap: wrap !important;

    align-items: flex-start !important;

    min-width: 0 !important;
  }

  body.courtyard-page
  .courtyard-panel > header h2,

  body.courtyard-page
  .courtyard-panel > header h3,

  body.courtyard-page
  .courtyard-panel > header a {
    min-width: 0 !important;
    max-width: 100% !important;

    white-space: normal !important;

    overflow: visible !important;

    text-overflow: clip !important;

    overflow-wrap: anywhere !important;
  }


  /* =====================================================
     PROFILE ENVIRONMENT
     Do not force "Legacy Look" beside the long title.
  ===================================================== */

  body.courtyard-page
  .environment-panel > header {
    flex-direction: column !important;

    align-items: flex-start !important;

    gap: 8px !important;
  }

  body.courtyard-page
  .environment-status {
    align-self: flex-start !important;

    width: auto !important;
    max-width: 100% !important;

    white-space: normal !important;

    overflow: visible !important;

    text-overflow: clip !important;

    overflow-wrap: anywhere !important;
  }

  body.courtyard-page
  .environment-preview-copy h3,

  body.courtyard-page
  .environment-preview-copy span {
    max-width: 100% !important;

    white-space: normal !important;

    overflow: visible !important;

    text-overflow: clip !important;

    overflow-wrap: anywhere !important;
  }


  /* =====================================================
     ACTIVITY CARDS
     Keep labels such as NOTIFICATIONS inside the card.
  ===================================================== */

  body.courtyard-page
  .activity-card
  > span:not(.activity-icon) {
    width: 100% !important;

    min-width: 0 !important;
  }

  body.courtyard-page
  .activity-card small {
    width: 100% !important;

    min-width: 0 !important;
    max-width: 100% !important;

    white-space: normal !important;

    overflow: visible !important;

    text-overflow: clip !important;

    overflow-wrap: anywhere !important;

    line-height: 1.25 !important;

    font-size: 0.62rem !important;
  }

  body.courtyard-page
  .activity-card.notifications small {
    font-size: 0.58rem !important;
  }


  /* =====================================================
     RESIDENT RECORD WORKSPACE HEADER
  ===================================================== */

  body.courtyard-page
  .courtyard-management-workspace
  > header {
    display: flex !important;

    flex-direction: column !important;

    align-items: stretch !important;

    gap: 14px !important;
  }

  body.courtyard-page
  .courtyard-management-workspace
  > header
  > div {
    width: 100% !important;

    min-width: 0 !important;
    max-width: 100% !important;
  }

  body.courtyard-page
  .courtyard-management-workspace
  > header
  p:last-child {
    width: 100% !important;

    min-width: 0 !important;
    max-width: 100% !important;

    white-space: normal !important;

    overflow: visible !important;

    text-overflow: clip !important;

    overflow-wrap: anywhere !important;
  }

  body.courtyard-page
  #residentRecordBackButton {
    align-self: flex-start !important;

    width: auto !important;

    max-width: 100% !important;
  }


  /* =====================================================
     BASIC INFORMATION HEADER
  ===================================================== */

  body.courtyard-page
  .resident-record-section
  > header {
    flex-direction: column !important;

    align-items: flex-start !important;

    gap: 8px !important;
  }

  body.courtyard-page
  .resident-record-section
  > header
  h3,

  body.courtyard-page
  .resident-record-section
  > header
  p {
    width: 100% !important;

    min-width: 0 !important;
    max-width: 100% !important;

    margin-left: 0 !important;
    margin-right: 0 !important;

    text-align: left !important;

    white-space: normal !important;

    overflow: visible !important;

    text-overflow: clip !important;

    overflow-wrap: anywhere !important;
  }

}

/* =========================================================
   COURTYARD MOBILE — REMOVE REDUNDANT AVATAR MENU
   Mobile navigation now lives in the hamburger drawer.
========================================================= */

@media (max-width: 900px) {

  body.courtyard-page
  .courtyard-top-header
  .user-menu {
    display: none !important;
  }

}

/* =========================================================
   COURTYARD MOBILE — READABLE ACTIVITY CARDS
   Keep the 2-card row, but give card contents full width.
========================================================= */

@media (max-width: 650px) {

  body.courtyard-page
  .activity-card {
    grid-template-columns: 1fr !important;

    justify-items: center !important;
    align-content: start !important;

    gap: 8px !important;

    min-height: 205px !important;

    padding:
      16px
      12px !important;

    text-align: center !important;
  }

  body.courtyard-page
  .activity-card
  .activity-icon {
    width: 50px !important;
    height: 50px !important;

    margin: 0 auto !important;

    font-size: 1.7rem !important;
  }

  body.courtyard-page
  .activity-card
  > span:not(.activity-icon) {
    display: block !important;

    width: 100% !important;

    min-width: 0 !important;
    max-width: 100% !important;

    text-align: center !important;
  }

  body.courtyard-page
  .activity-card strong {
    display: block !important;

    width: 100% !important;

    margin: 0 0 7px !important;

    font-size: 2rem !important;
    line-height: 1 !important;

    text-align: center !important;
  }

  body.courtyard-page
  .activity-card small,

  body.courtyard-page
  .activity-card.notifications small {
    display: block !important;

    width: 100% !important;
    max-width: 100% !important;

    margin: 0 !important;

    font-size: 0.78rem !important;
    line-height: 1.25 !important;

    text-align: center !important;

    white-space: normal !important;

    overflow: visible !important;
    text-overflow: clip !important;

    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: none !important;
  }

  body.courtyard-page
  .activity-card em {
    display: block !important;

    grid-column: 1 !important;

    width: 100% !important;

    margin-top: 5px !important;

    color: var(--courtyard-muted) !important;

    font-size: 0.74rem !important;
    line-height: 1.4 !important;

    text-align: center !important;

    white-space: normal !important;

    overflow: visible !important;

    overflow-wrap: normal !important;
    word-break: normal !important;
  }

}

/* =========================================================
   COURTYARD MOBILE — RESIDENT RECORD HEADER CONTAINMENT
   Prevent padded headers from extending past their panels.
========================================================= */

@media (max-width: 650px) {

  /* Outer Resident Record header */
  body.courtyard-page
  .courtyard-management-workspace
  > header,

  /* Basic Information header */
  body.courtyard-page
  .resident-record-section
  > header {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;

    box-sizing: border-box !important;

    overflow: visible !important;
  }


  /* Text container inside Resident Record header */
  body.courtyard-page
  .courtyard-management-workspace
  > header
  > div {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;

    box-sizing: border-box !important;
  }


  /* Resident Record subtitle */
  body.courtyard-page
  .courtyard-management-workspace
  > header
  > div
  > p:last-child {
    display: block !important;

    width: auto !important;
    max-width: 100% !important;
    min-width: 0 !important;

    white-space: normal !important;

    overflow: visible !important;
    text-overflow: clip !important;

    overflow-wrap: break-word !important;
    word-break: normal !important;
  }


  /* Basic Information description */
  body.courtyard-page
  .resident-record-section
  > header
  > p {
    display: block !important;

    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;

    box-sizing: border-box !important;

    white-space: normal !important;

    overflow: visible !important;
    text-overflow: clip !important;

    overflow-wrap: break-word !important;
    word-break: normal !important;

    text-align: left !important;
  }

}

/* =========================================================
   COURTYARD MOBILE — FINAL PANEL HEADER FIXES
   Balance + Open Forum
========================================================= */

@media (max-width: 650px) {

  /* =====================================================
     YOUR BALANCE
     Balance panel centers its children, so force its
     header to stretch across the entire card.
  ===================================================== */

  body.courtyard-page
  .balance-panel
  > header {
    align-self: stretch !important;

    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;

    box-sizing: border-box !important;

    padding:
      10px
      14px !important;

    text-align: left !important;
  }

  body.courtyard-page
  .balance-panel
  > header
  h2 {
    display: block !important;

    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;

    margin: 0 !important;

    text-align: left !important;

    white-space: normal !important;

    overflow: visible !important;
    text-overflow: clip !important;
  }


  /* =====================================================
     LATEST FROM THE OPEN FORUM
     Give the long title and View Forum their own lines.
  ===================================================== */

  body.courtyard-page
  .forum-panel
  > header {
    display: flex !important;

    flex-direction: column !important;

    align-items: flex-start !important;
    justify-content: flex-start !important;

    gap: 7px !important;

    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;

    box-sizing: border-box !important;
  }

  body.courtyard-page
  .forum-panel
  > header
  h2 {
    display: block !important;

    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;

    white-space: normal !important;

    overflow: visible !important;
    text-overflow: clip !important;

    overflow-wrap: normal !important;
    word-break: normal !important;
  }

  body.courtyard-page
  .forum-panel
  > header
  a {
    display: inline-block !important;

    width: auto !important;
    max-width: 100% !important;

    margin: 0 !important;

    align-self: flex-start !important;

    white-space: nowrap !important;

    overflow: visible !important;
    text-overflow: clip !important;

    font-size: 0.82rem !important;
  }

}

/* =========================================================
   COURTYARD — MANAGE PHOTOS WORKSPACE
   2026-08-26
========================================================= */

body.courtyard-page
.manage-photos-workspace-content {
  padding: 20px;
}


body.courtyard-page
.courtyard-photo-manager-body {
  display: grid;

  gap: 18px;

  padding: 20px;
}


/* =========================================================
   HELP / REVIEW NOTICE
========================================================= */

body.courtyard-page
.courtyard-photo-help {
  padding: 16px 18px;

  border:
    1px solid
    rgba(102, 255, 53, 0.18);

  border-radius: 8px;

  background:
    linear-gradient(
      135deg,
      rgba(102, 255, 53, 0.055),
      rgba(187, 101, 255, 0.035)
    );
}


body.courtyard-page
.courtyard-photo-help strong {
  display: block;

  margin-bottom: 7px;

  color:
    var(--courtyard-green);

  font-size: 0.9rem;
}


body.courtyard-page
.courtyard-photo-help p {
  max-width: 850px;

  margin:
    0
    0
    8px;

  color:
    var(--courtyard-muted);

  font-size: 0.8rem;
  line-height: 1.5;
}


body.courtyard-page
.courtyard-photo-help
.courtyard-button {
  margin-top: 5px;

  font-size: 0.72rem;
}


/* =========================================================
   NORMAL / HORROR SECTIONS
========================================================= */

body.courtyard-page
.courtyard-photo-side {
  padding: 18px;

  border:
    1px solid
    rgba(255, 255, 255, 0.09);

  border-radius: 9px;

  background:
    rgba(4, 6, 5, 0.75);
}


body.courtyard-page
.courtyard-photo-side-horror {
  border-color:
    rgba(187, 101, 255, 0.22);

  background:
    linear-gradient(
      145deg,
      rgba(33, 12, 43, 0.42),
      rgba(4, 6, 5, 0.82)
    );
}


body.courtyard-page
.courtyard-photo-side-heading {
  display: flex;

  align-items: flex-start;
  justify-content: space-between;

  gap: 16px;

  margin-bottom: 14px;
}


body.courtyard-page
.courtyard-photo-side-heading
> div {
  min-width: 0;
}


body.courtyard-page
.courtyard-photo-side-kicker {
  margin:
    0
    0
    4px;

  color:
    var(--courtyard-green);

  font-size: 0.64rem;
  font-weight: 900;

  letter-spacing: 0.11em;

  text-transform: uppercase;
}


body.courtyard-page
.courtyard-photo-side-horror
.courtyard-photo-side-kicker {
  color:
    var(--courtyard-purple);
}


body.courtyard-page
.courtyard-photo-side-heading h4 {
  margin:
    0
    0
    5px;

  color: #ffffff;

  font-size: 1rem;
}


body.courtyard-page
.courtyard-photo-side-heading p {
  margin: 0;

  color:
    var(--courtyard-muted);

  font-size: 0.76rem;
  line-height: 1.45;
}


body.courtyard-page
.courtyard-photo-count {
  flex:
    0
    0
    auto;

  min-width: 54px;

  padding:
    5px
    9px;

  border:
    1px solid
    rgba(102, 255, 53, 0.28);

  border-radius: 999px;

  color:
    var(--courtyard-green);

  background:
    rgba(102, 255, 53, 0.07);

  text-align: center;

  font-size: 0.68rem;
  font-weight: 900;
}


/* =========================================================
   5 PHOTO SLOTS
========================================================= */

body.courtyard-page
.courtyard-photo-slots {
  display: grid;

  grid-template-columns:
    repeat(
      5,
      minmax(0, 1fr)
    );

  gap: 12px;

  width: 100%;
}


body.courtyard-page
.courtyard-photo-slot {
  appearance: none;

  position: relative;

  width: 100%;

  aspect-ratio: 1 / 1;

  min-width: 0;

  overflow: hidden;

  padding: 0;

  border:
    1px solid
    rgba(255, 255, 255, 0.16);

  border-radius: 10px;

  color:
    var(--courtyard-green);

  background:
    radial-gradient(
      circle at 50% 40%,
      rgba(102, 255, 53, 0.07),
      transparent 60%
    ),
    #050706;

  cursor: pointer;

  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    transform 0.16s ease;
}


body.courtyard-page
.courtyard-photo-side-horror
.courtyard-photo-slot {
  background:
    radial-gradient(
      circle at 50% 40%,
      rgba(187, 101, 255, 0.1),
      transparent 60%
    ),
    #070508;
}


body.courtyard-page
.courtyard-photo-slot:hover,

body.courtyard-page
.courtyard-photo-slot:focus-visible {
  border-color:
    rgba(102, 255, 53, 0.7);

  background:
    rgba(102, 255, 53, 0.08);

  transform:
    translateY(-2px);
}


body.courtyard-page
.courtyard-photo-slot.empty::before {
  content: "+";

  display: grid;

  place-items: center;

  position: absolute;

  inset: 0;

  color:
    var(--courtyard-green);

  font-size: 2.25rem;
  font-weight: 300;

  opacity: 0.7;
}


body.courtyard-page
.courtyard-photo-side-horror
.courtyard-photo-slot.empty::before {
  color:
    var(--courtyard-purple);
}


body.courtyard-page
.courtyard-photo-status {
  min-height: 20px;

  margin: 0;

  color:
    var(--courtyard-muted);

  font-size: 0.76rem;
}


/* =========================================================
   MANAGE PHOTOS — TABLET
========================================================= */

@media (max-width: 900px) {

  body.courtyard-page
  .courtyard-photo-slots {
    grid-template-columns:
      repeat(
        3,
        minmax(0, 1fr)
      );
  }

}


/* =========================================================
   MANAGE PHOTOS — MOBILE
========================================================= */

@media (max-width: 650px) {

  body.courtyard-page
  .manage-photos-workspace-content {
    padding: 12px;
  }


  body.courtyard-page
  .courtyard-photo-manager-body {
    gap: 14px;

    padding: 14px;
  }


  body.courtyard-page
  .courtyard-photo-help,

  body.courtyard-page
  .courtyard-photo-side {
    padding: 14px;
  }


  body.courtyard-page
  .courtyard-photo-side-heading {
    flex-direction: column;

    gap: 8px;
  }


  body.courtyard-page
  .courtyard-photo-count {
    align-self: flex-start;
  }


  body.courtyard-page
  .courtyard-photo-slots {
    grid-template-columns:
      repeat(
        2,
        minmax(0, 1fr)
      );

    gap: 10px;
  }


  body.courtyard-page
  .courtyard-photo-slot {
    border-radius: 8px;
  }

}

/* =========================================================
   MANAGE PHOTOS — READ-ONLY PHOTO STATE
   2026-08-26
========================================================= */

body.courtyard-page
.courtyard-photo-slot
img {
  position: absolute;

  inset: 0;

  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;
  object-position: center;

  background: #000;
}


body.courtyard-page
.courtyard-photo-slot.filled::before {
  display: none !important;
}


body.courtyard-page
.courtyard-photo-slot.pending {
  border-color:
    rgba(255, 212, 90, 0.72);

  box-shadow:
    inset 0 0 0 1px
    rgba(255, 212, 90, 0.12);
}


body.courtyard-page
.courtyard-photo-state-badge {
  position: absolute;

  left: 7px;
  right: 7px;
  bottom: 7px;

  z-index: 3;

  padding:
    5px
    7px;

  border:
    1px solid
    rgba(255, 212, 90, 0.48);

  border-radius: 999px;

  color:
    #ffe894;

  background:
    rgba(8, 8, 6, 0.88);

  font-size: 0.58rem;
  font-weight: 900;

  line-height: 1.15;

  text-align: center;

  text-transform: uppercase;

  letter-spacing: 0.05em;
}

/* =========================================================
   COURTYARD — PHOTO CROPPER
   2026-08-26
========================================================= */

body.courtyard-page
.courtyard-photo-crop-modal {
  position: fixed;
  inset: 0;

  z-index: 10050;

  display: grid;
  place-items: center;

  padding: 20px;

  box-sizing: border-box;
}


body.courtyard-page
.courtyard-photo-crop-modal.hidden {
  display: none !important;
}


body.courtyard-page
.courtyard-photo-crop-backdrop {
  position: absolute;
  inset: 0;

  background:
    rgba(0, 0, 0, 0.84);

  backdrop-filter:
    blur(3px);
}


body.courtyard-page
.courtyard-photo-crop-card {
  position: relative;
  z-index: 2;

  width:
    min(100%, 520px);

  max-height:
    calc(100dvh - 40px);

  overflow-y: auto;

  padding: 22px;

  box-sizing: border-box;

  border:
    1px solid
    rgba(102, 255, 53, 0.32);

  border-radius: 12px;

  color:
    var(--courtyard-white);

  background:
    #070909;

  box-shadow:
    0 20px 60px
    rgba(0, 0, 0, 0.65);
}


body.courtyard-page
.courtyard-photo-crop-card h2 {
  margin:
    0
    0
    7px;

  color: #ffffff;

  font-size: 1.45rem;
}


body.courtyard-page
.courtyard-photo-crop-help {
  margin:
    0
    0
    15px;

  color:
    var(--courtyard-muted);

  font-size: 0.82rem;
  line-height: 1.45;
}


body.courtyard-page
.courtyard-photo-crop-close {
  position: absolute;

  top: 12px;
  right: 12px;

  display: grid;
  place-items: center;

  width: 38px;
  height: 38px;

  padding: 0;

  border:
    1px solid
    rgba(102, 255, 53, 0.32);

  border-radius: 50%;

  color:
    var(--courtyard-green);

  background:
    #101111;

  font-size: 1.35rem;

  cursor: pointer;
}


body.courtyard-page
.courtyard-photo-crop-stage {
  position: relative;

  width:
    min(72vw, 320px);

  height:
    min(72vw, 320px);

  margin:
    0
    auto
    16px;

  overflow: hidden;

  border:
    1px solid
    rgba(255, 255, 255, 0.14);

  border-radius: 12px;

  background: #000;

  touch-action: none;

  cursor: grab;
}


body.courtyard-page
.courtyard-photo-crop-stage.dragging {
  cursor: grabbing;
}


body.courtyard-page
.courtyard-photo-crop-stage img {
  position: absolute;

  top: 50%;
  left: 50%;

  width: 100%;
  height: 100%;

  object-fit: cover;

  transform:
    translate(-50%, -50%)
    scale(1);

  transform-origin:
    center center;

  user-select: none;

  -webkit-user-drag: none;

  touch-action: none;
}


body.courtyard-page
.courtyard-photo-crop-zoom {
  display: grid;

  gap: 7px;

  color: #e7e7e7;

  font-size: 0.78rem;
  font-weight: 800;
}


body.courtyard-page
.courtyard-photo-crop-zoom
input {
  width: 100%;
}


body.courtyard-page
.courtyard-photo-crop-actions {
  display: flex;

  justify-content: flex-end;

  gap: 10px;

  margin-top: 18px;
}


@media (max-width: 650px) {

  body.courtyard-page
  .courtyard-photo-crop-modal {
    padding:
      max(12px, env(safe-area-inset-top))
      12px
      max(12px, env(safe-area-inset-bottom));
  }


  body.courtyard-page
  .courtyard-photo-crop-card {
    width: 100%;

    padding: 18px 15px;
  }


  body.courtyard-page
  .courtyard-photo-crop-stage {
    width:
      min(76vw, 300px);

    height:
      min(76vw, 300px);
  }


  body.courtyard-page
  .courtyard-photo-crop-actions {
    display: grid;

    grid-template-columns:
      1fr
      1fr;
  }

}

/* =========================================================
   MANAGE PHOTOS — ACTIVE UPLOAD FEEDBACK
   2026-08-26
========================================================= */

body.courtyard-page
.courtyard-photo-slot.uploading {
  border-color:
    rgba(102, 255, 53, 0.78);

  box-shadow:
    0 0 0 1px
    rgba(102, 255, 53, 0.16),
    0 0 20px
    rgba(102, 255, 53, 0.10);
}


body.courtyard-page
.courtyard-photo-uploading-badge {
  display: flex;

  align-items: center;
  justify-content: center;

  gap: 6px;

  color:
    var(--courtyard-green);

  border-color:
    rgba(102, 255, 53, 0.48);

  animation:
    courtyardPhotoUploadPulse
    1.1s
    ease-in-out
    infinite;
}


body.courtyard-page
.courtyard-photo-uploading-badge::before {
  content: "";

  width: 9px;
  height: 9px;

  flex: 0 0 auto;

  border:
    2px solid
    rgba(102, 255, 53, 0.28);

  border-top-color:
    var(--courtyard-green);

  border-radius: 50%;

  animation:
    courtyardPhotoUploadSpin
    0.7s
    linear
    infinite;
}


body.courtyard-page
.courtyard-photo-slot.temporarily-disabled {
  cursor: wait;
}


body.courtyard-page
.courtyard-photo-slot.temporarily-disabled:not(.uploading) {
  opacity: 0.62;
}


@keyframes courtyardPhotoUploadSpin {
  to {
    transform:
      rotate(360deg);
  }
}


@keyframes courtyardPhotoUploadPulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.72;
  }
}

/* =========================================================
   MANAGE PHOTOS — SLOT EDIT / DELETE CONTROLS
   2026-08-26
========================================================= */

body.courtyard-page
.courtyard-photo-slot-actions {
  position: absolute;

  top: 7px;
  right: 7px;

  z-index: 5;

  display: flex;

  gap: 6px;

  pointer-events: auto;
}


body.courtyard-page
.courtyard-photo-slot-actions
button {
  appearance: none;

  display: grid;

  place-items: center;

  width: 34px;
  height: 34px;

  min-width: 34px;
  min-height: 34px;

  padding: 0;

  border:
    1px solid
    rgba(255, 255, 255, 0.22);

  border-radius: 50%;

  color: #ffffff;

  background:
    rgba(4, 5, 5, 0.91);

  box-shadow:
    0 3px 12px
    rgba(0, 0, 0, 0.45);

  font-size: 1rem;
  font-weight: 900;

  line-height: 1;

  cursor: pointer;

  transition:
    border-color 0.16s ease,
    color 0.16s ease,
    background 0.16s ease,
    transform 0.16s ease;
}


body.courtyard-page
.courtyard-photo-edit-button {
  color:
    var(--courtyard-green) !important;
}


body.courtyard-page
.courtyard-photo-delete-button {
  color:
    #ffffff !important;

  border-color:
    rgba(187, 101, 255, 0.48) !important;
}


body.courtyard-page
.courtyard-photo-slot-actions
button:hover,

body.courtyard-page
.courtyard-photo-slot-actions
button:focus-visible {
  border-color:
    rgba(102, 255, 53, 0.78);

  color:
    var(--courtyard-green);

  background:
    rgba(10, 15, 10, 0.97);

  transform:
    scale(1.06);

  outline: none;
}


body.courtyard-page
.courtyard-photo-delete-button:hover,

body.courtyard-page
.courtyard-photo-delete-button:focus-visible {
  border-color:
    rgba(187, 101, 255, 0.82) !important;

  color:
    var(--courtyard-purple) !important;
}


body.courtyard-page
.courtyard-photo-slot.temporarily-disabled
.courtyard-photo-slot-actions {
  pointer-events: none;
}


@media (max-width: 650px) {

  body.courtyard-page
  .courtyard-photo-slot-actions {
    top: 6px;
    right: 6px;

    gap: 5px;
  }


  body.courtyard-page
  .courtyard-photo-slot-actions
  button {
    width: 38px;
    height: 38px;

    min-width: 38px;
    min-height: 38px;
  }

}

/* =========================================================
   BLOCK LIST
   2026-08-27
========================================================= */

.block-list-residents {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.blocked-resident-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;

  padding: 16px;

  border: 1px solid rgba(21, 251, 0, 0.22);
  border-radius: 14px;

  background:
    rgba(0, 0, 0, 0.34);
}

.blocked-resident-avatar {
  width: 64px;
  height: 64px;
  overflow: hidden;

  border: 1px solid rgba(21, 251, 0, 0.35);
  border-radius: 50%;

  background: #050505;
}

.blocked-resident-avatar img {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;
}

.blocked-resident-copy {
  min-width: 0;

  display: flex;
  flex-direction: column;
  gap: 4px;
}

.blocked-resident-copy strong {
  overflow: hidden;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.blocked-resident-copy small {
  opacity: 0.7;
}

.blocked-resident-state {
  width: fit-content;

  font-size: 0.75rem;
  font-weight: 700;

  letter-spacing: 0.08em;
  text-transform: uppercase;

  opacity: 0.75;
}

.blocked-resident-actions {
  display: flex;
  align-items: center;
}

.block-list-empty {
  padding: 24px;

  text-align: center;

  border: 1px dashed rgba(21, 251, 0, 0.25);
  border-radius: 14px;

  background:
    rgba(0, 0, 0, 0.2);
}

.block-list-empty p {
  margin-bottom: 0;
}


/* Mobile */
@media (max-width: 640px) {

  .blocked-resident-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .blocked-resident-actions {
    grid-column: 1 / -1;
  }

  .blocked-resident-actions .courtyard-button {
    width: 100%;
  }

}

/* =========================================================
   COURTYARD SETTINGS
   PHASE 3A — 2026-08-27
========================================================= */

.courtyard-settings-content {
  display: grid;
  gap: 18px;
}

.courtyard-settings-section {
  margin-top: 0;
}

.settings-field-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.courtyard-settings-age-row {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.courtyard-settings-age-row label {
  display: grid;
  gap: 6px;
}

.courtyard-settings-distance-row {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.courtyard-settings-distance-row input {
  width: 100%;
}

.courtyard-settings-distance-row strong {
  white-space: nowrap;
}

.courtyard-settings-toggle {
  display: grid;
  grid-template-columns:
    auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;

  padding: 16px;

  border:
    1px solid
    rgba(21, 251, 0, 0.22);

  border-radius: 14px;

  background:
    rgba(0, 0, 0, 0.25);
}

.courtyard-settings-toggle input {
  margin-top: 4px;
}

.courtyard-settings-toggle span {
  display: grid;
  gap: 4px;
}

.courtyard-settings-toggle small {
  opacity: 0.72;
  line-height: 1.45;
}


@media (max-width: 640px) {

  .courtyard-settings-age-row {
    grid-template-columns: 1fr;
  }

  .courtyard-settings-distance-row {
    grid-template-columns: 1fr;
  }

}

/* =========================================================
   COURTYARD MOBILE SHELL STABILIZATION
   2026-08-27
========================================================= */

@media (max-width: 900px) {

  /* ---------- Hamburger hit target ---------- */

  body.courtyard-page
  #mobileMenuButton {
    position: relative !important;

    z-index: 5 !important;

    pointer-events: auto !important;

    touch-action: manipulation;
  }


  /* ---------- Drawer ---------- */

  body.courtyard-page
  #mobileMenuDrawer {
    display: block !important;

    visibility: visible !important;

    left: 0 !important;
    right: auto !important;

    transform:
      translateX(-105%) !important;

    pointer-events: none !important;
  }


  body.courtyard-page
  #mobileMenuDrawer.open {
    transform:
      translateX(0) !important;

    pointer-events: auto !important;
  }


  /* ---------- Backdrop ---------- */

  body.courtyard-page
  #mobileMenuBackdrop.hidden {
    display: none !important;
  }


  body.courtyard-page
  #mobileMenuBackdrop:not(.hidden) {
    display: block !important;
  }

}

/* =========================================================
   COURTYARD MOBILE NOTIFICATIONS
   2026-08-27
========================================================= */

@media (max-width: 900px) {

  body.courtyard-page
  .courtyard-top-header
  #notifDropdown {
    position: fixed !important;

    top:
      calc(
        72px +
        env(
          safe-area-inset-top,
          0px
        )
      ) !important;

    right: 12px !important;
    left: auto !important;

    width:
      min(
        380px,
        calc(100vw - 24px)
      ) !important;

    min-width: 0 !important;

    max-width:
      calc(100vw - 24px) !important;

    max-height:
      calc(
        100dvh -
        92px
      ) !important;

    margin: 0 !important;

    overflow-x: hidden !important;
    overflow-y: auto !important;

    box-sizing:
      border-box !important;

    z-index: 1000 !important;
  }


  body.courtyard-page
  #notifDropdown h4 {
    width: 100%;

    margin:
      0
      0
      10px;
  }


  body.courtyard-page
  #notifList {
    width: 100%;
    min-width: 0;

    max-height:
      min(
        60dvh,
        430px
      ) !important;

    overflow-x: hidden;
    overflow-y: auto;
  }


  body.courtyard-page
  #notifDropdown
  .notif-item {
    width: 100%;
    min-width: 0;
  }


  body.courtyard-page
  #notifDropdown
  .notif-head {
    display: grid !important;

    grid-template-columns:
      minmax(0, 1fr)
      auto;

    gap: 8px;

    align-items: start;
  }


  body.courtyard-page
  #notifDropdown
  .notif-item strong,

  body.courtyard-page
  #notifDropdown
  .notif-item span,

  body.courtyard-page
  #notifDropdown
  .notif-body {
    min-width: 0;

    white-space: normal;

    overflow-wrap: anywhere;
  }


  body.courtyard-page
  #notifDropdown
  .notif-when {
    white-space: nowrap;
  }

}

/* =========================================================
   COURTYARD SETTINGS — PROFILE & PUBLIC PREVIEW
   PHASE 3B — 2026-08-27
========================================================= */

.courtyard-profile-side-setting,
.courtyard-public-preview-body {
  padding: 20px;
}


.courtyard-settings-question {
  margin:
    0
    0
    14px;

  color: #eeeeee;

  font-size: 0.86rem;
  font-weight: 800;
}


.courtyard-side-first-grid {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 14px;
}


.courtyard-side-first-card {
  appearance: none;

  display: grid;

  grid-template-columns:
    auto minmax(0, 1fr);

  gap:
    5px
    12px;

  align-items: center;

  min-width: 0;

  padding: 18px;

  border:
    1px solid
    rgba(255, 255, 255, 0.12);

  border-radius: 10px;

  color:
    var(--courtyard-white);

  background:
    rgba(0, 0, 0, 0.28);

  text-align: left;

  cursor: pointer;

  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}


.courtyard-side-first-card:hover,
.courtyard-side-first-card:focus-visible {
  border-color:
    rgba(102, 255, 53, 0.52);

  background:
    rgba(102, 255, 53, 0.06);

  outline: none;
}


.courtyard-side-first-card.active {
  border-color:
    rgba(102, 255, 53, 0.72);

  background:
    linear-gradient(
      135deg,
      rgba(102, 255, 53, 0.12),
      rgba(187, 101, 255, 0.06)
    );

  box-shadow:
    0 0 0 2px
      rgba(102, 255, 53, 0.06);
}


.courtyard-side-first-card[data-side="horror"].active {
  border-color:
    rgba(187, 101, 255, 0.76);

  background:
    linear-gradient(
      135deg,
      rgba(187, 101, 255, 0.14),
      rgba(102, 255, 53, 0.04)
    );

  box-shadow:
    0 0 0 2px
      rgba(187, 101, 255, 0.06);
}


.courtyard-side-first-icon {
  grid-row:
    1 / span 2;

  display: grid;

  place-items: center;

  width: 44px;
  height: 44px;

  border-radius: 50%;

  color:
    var(--courtyard-green);

  background:
    rgba(102, 255, 53, 0.08);

  font-size: 1.35rem;
}


.courtyard-side-first-card[data-side="horror"]
.courtyard-side-first-icon {
  color:
    var(--courtyard-purple);

  background:
    rgba(187, 101, 255, 0.1);
}


.courtyard-side-first-card strong {
  min-width: 0;

  font-size: 0.9rem;
}


.courtyard-side-first-card small {
  min-width: 0;

  color:
    var(--courtyard-muted);

  font-size: 0.74rem;
  line-height: 1.4;
}


.courtyard-settings-status {
  min-height: 20px;

  margin:
    0
    20px
    18px;
}


/* ---------- Public Preview ---------- */

.courtyard-preview-state {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 12px;

  margin-top: 14px;

  padding: 13px 15px;

  border:
    1px solid
    rgba(255, 255, 255, 0.1);

  border-radius: 8px;

  background:
    rgba(0, 0, 0, 0.22);
}


.courtyard-preview-state strong {
  color:
    var(--courtyard-purple);

  font-size: 0.76rem;

  text-transform: uppercase;
  letter-spacing: 0.06em;
}


.courtyard-preview-state span {
  color:
    var(--courtyard-green);

  font-size: 0.82rem;
  font-weight: 800;

  text-align: right;
}


.courtyard-preview-eligibility {
  margin-top: 12px;

  padding: 14px 16px;

  border:
    1px solid
    rgba(102, 255, 53, 0.15);

  border-radius: 8px;

  color:
    var(--courtyard-muted);

  background:
    rgba(102, 255, 53, 0.025);

  font-size: 0.78rem;
  line-height: 1.5;
}


.courtyard-preview-eligibility strong {
  color:
    var(--courtyard-white);
}


.courtyard-preview-eligibility ul {
  margin:
    8px
    0
    0;

  padding-left: 20px;
}


@media (max-width: 640px) {

  .courtyard-profile-side-setting,
  .courtyard-public-preview-body {
    padding: 14px;
  }


  .courtyard-side-first-grid {
    grid-template-columns: 1fr;
  }


  .courtyard-preview-state {
    align-items: flex-start;
    flex-direction: column;
  }


  .courtyard-preview-state span {
    text-align: left;
  }

}

/* =========================================================
   COURTYARD SETTINGS — RESIDENT PRIVACY
   PHASE 3B-2A — 2026-08-28
========================================================= */

.courtyard-privacy-body {
  display: grid;

  gap: 16px;

  padding: 20px;
}


.courtyard-privacy-item {
  overflow: hidden;

  border:
    1px solid
    rgba(255, 255, 255, 0.09);

  border-radius: 10px;

  background:
    rgba(0, 0, 0, 0.2);
}


.courtyard-privacy-item
.courtyard-settings-toggle {
  border: 0;

  border-radius: 0;

  background:
    transparent;
}


.courtyard-privacy-save-row {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 14px;

  padding:
    0
    16px
    16px;
}


.courtyard-privacy-save-row p {
  margin: 0;

  min-width: 0;

  font-size: 0.76rem;

  text-align: right;
}


.courtyard-privacy-coming-next {
  padding: 15px 16px;

  border:
    1px dashed
    rgba(187, 101, 255, 0.28);

  border-radius: 9px;

  background:
    rgba(187, 101, 255, 0.035);
}


.courtyard-privacy-coming-next strong {
  color:
    var(--courtyard-purple);

  font-size: 0.82rem;
}


.courtyard-privacy-coming-next p {
  margin:
    5px
    0
    0;

  color:
    var(--courtyard-muted);

  font-size: 0.76rem;
  line-height: 1.45;
}


@media (max-width: 640px) {

  .courtyard-privacy-body {
    padding: 14px;
  }


  .courtyard-privacy-save-row {
    align-items: stretch;

    flex-direction: column;
  }


  .courtyard-privacy-save-row
  .courtyard-button {
    width: 100%;
  }


  .courtyard-privacy-save-row p {
    text-align: left;
  }

}

/* =========================================================
   COURTYARD SETTINGS — ACCOUNT & SECURITY
   PHASE 3C-1 — 2026-08-28
========================================================= */

.courtyard-account-security-body {
  display: grid;

  gap: 16px;

  padding: 20px;
}


.courtyard-security-item {
  padding: 18px;

  border:
    1px solid
    rgba(255, 255, 255, 0.09);

  border-radius: 10px;

  background:
    rgba(0, 0, 0, 0.2);
}


.courtyard-security-copy strong {
  display: block;

  color:
    var(--courtyard-green);

  font-size: 0.9rem;
}


.courtyard-security-copy p {
  max-width: 760px;

  margin:
    6px
    0
    0;

  color:
    var(--courtyard-muted);

  font-size: 0.78rem;
  line-height: 1.5;
}


.courtyard-security-status {
  min-height: 22px;

  margin:
    16px
    0
    12px;

  font-size: 0.8rem;
  font-weight: 800;
}


.courtyard-security-actions {
  display: flex;

  align-items: center;

  gap: 10px;

  flex-wrap: wrap;
}


.courtyard-security-help {
  display: block;

  margin-top: 12px;

  color:
    var(--courtyard-muted);

  font-size: 0.72rem;
  line-height: 1.45;
}


.courtyard-security-coming-next {
  padding: 15px 16px;

  border:
    1px dashed
    rgba(187, 101, 255, 0.28);

  border-radius: 9px;

  background:
    rgba(187, 101, 255, 0.035);
}


.courtyard-security-coming-next strong {
  color:
    var(--courtyard-purple);

  font-size: 0.82rem;
}


.courtyard-security-coming-next p {
  margin:
    5px
    0
    0;

  color:
    var(--courtyard-muted);

  font-size: 0.76rem;
  line-height: 1.45;
}


@media (max-width: 640px) {

  .courtyard-account-security-body {
    padding: 14px;
  }


  .courtyard-security-item {
    padding: 14px;
  }


  .courtyard-security-actions {
    align-items: stretch;

    flex-direction: column;
  }


  .courtyard-security-actions
  .courtyard-button {
    width: 100%;
  }

}

/* =========================================================
   COURTYARD SETTINGS — LOGIN & PASSWORD
   PHASE 3C-2 — 2026-08-28
========================================================= */

.courtyard-security-grid {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 16px;

  margin-top: 18px;
}


.courtyard-security-field {
  display: grid;

  gap: 7px;

  min-width: 0;

  color:
    #eeeeee;

  font-size: 0.78rem;
  font-weight: 800;
}


.courtyard-security-field.full {
  grid-column:
    1 / -1;
}


.courtyard-security-field input {
  width: 100%;
  min-width: 0;

  min-height: 44px;

  padding:
    10px
    12px;

  border:
    1px solid
    rgba(255, 255, 255, 0.15);

  border-radius: 6px;

  outline: none;

  color:
    #f5f5f5;

  background:
    #080a09;

  font: inherit;
  font-weight: 500;
}


.courtyard-security-field input:focus {
  border-color:
    rgba(102, 255, 53, 0.72);

  box-shadow:
    0 0 0 3px
    rgba(102, 255, 53, 0.07);
}


.courtyard-security-field
input[readonly] {
  color:
    var(--courtyard-muted);

  cursor:
    default;
}


.courtyard-password-toggle {
  justify-self: start;

  margin-top: 2px;

  padding:
    7px
    11px;

  border:
    1px solid
    rgba(255, 255, 255, 0.16);

  border-radius:
    999px;

  color:
    #eeeeee;

  background:
    #111313;

  font-size:
    0.7rem;
  font-weight:
    800;

  cursor:
    pointer;
}


.courtyard-password-toggle:hover,
.courtyard-password-toggle:focus-visible {
  color:
    var(--courtyard-green);

  border-color:
    rgba(102, 255, 53, 0.48);

  outline:
    none;
}


.courtyard-password-toggle:disabled {
  opacity:
    0.5;

  cursor:
    not-allowed;
}


@media (max-width: 640px) {

  .courtyard-security-grid {
    grid-template-columns:
      1fr;
  }


  .courtyard-security-field.full {
    grid-column:
      auto;
  }


  .courtyard-security-field input {
    font-size:
      16px;
  }

}

/* =========================================================
   COURTYARD SETTINGS — CRYPT PASS / MEMBERSHIP
   PHASE 3C-3 — 2026-08-28
========================================================= */

.courtyard-membership-summary {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 18px;

  margin-top: 18px;

  padding: 16px;

  border:
    1px solid
    rgba(102, 255, 53, 0.16);

  border-radius: 9px;

  background:
    rgba(102, 255, 53, 0.025);
}


.courtyard-membership-summary-copy {
  min-width: 0;
}


.courtyard-membership-label {
  display: block;

  margin-bottom: 5px;

  color:
    var(--courtyard-muted);

  font-size: 0.68rem;
  font-weight: 800;

  letter-spacing: 0.07em;
  text-transform: uppercase;
}


.courtyard-membership-status {
  display: block;

  color:
    var(--courtyard-white);

  font-size: 1rem;
  line-height: 1.25;
}


.courtyard-membership-status.good {
  color:
    var(--courtyard-green);
}


.courtyard-membership-status.warning {
  color:
    var(--courtyard-warning);
}


.courtyard-membership-status.danger {
  color:
    #ff9b9b;
}


.courtyard-membership-detail {
  max-width: 760px;

  margin:
    7px
    0
    0;

  color:
    var(--courtyard-muted);

  font-size: 0.76rem;
  line-height: 1.45;
}


.courtyard-membership-summary
.courtyard-button {
  flex:
    0
    0
    auto;
}


@media (max-width: 640px) {

  .courtyard-membership-summary {
    align-items: stretch;

    flex-direction: column;

    padding: 14px;
  }


  .courtyard-membership-summary
  .courtyard-button {
    width: 100%;
  }

}