/* ==========================================================================
   BlissLand Agroland — public site
   ========================================================================== */

:root {
  --forest-900: #12261b;
  --forest: #1d3a2a;
  --forest-700: #275038;
  --leaf: #4f7f40;
  --leaf-soft: #e3ecd9;
  --sand: #f7f2e8;
  --sand-2: #efe6d5;
  --gold: #d29b3a;
  --gold-300: #e9c983;
  --ink: #18211b;
  --muted: #5b675e;
  --line: #e2d9c6;
  --white: #fff;

  --available: #4f9a52;
  --booked: #e2a336;
  --sold: #c4bca9;

  --radius: 18px;
  --shadow: 0 24px 60px -24px rgba(18, 38, 27, .35);
  --shadow-sm: 0 8px 24px -12px rgba(18, 38, 27, .3);

  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --header-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
  /* No square blue flash over buttons and links on tap; they have their own pressed and focus styles. */
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--sand);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
[hidden] { display: none !important; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-variant-numeric: lining-nums;
  line-height: 1.1;
  letter-spacing: -.01em;
  color: var(--forest-900);
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.7rem, 6.2vw, 4.8rem); }
h2 { font-size: clamp(2rem, 4.2vw, 3.1rem); }
h3 { font-size: 1.55rem; }
p  { margin: 0 0 1em; }

/* Playfair defaults to old-style figures; keep numbers on the baseline. */
.about-note strong, .step::before, .stat-value, .id-card-id { font-variant-numeric: lining-nums; }

.container { width: min(1200px, 100% - 40px); margin-inline: auto; }
.section { padding: clamp(72px, 10vw, 128px) 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .7em;
  margin: 0 0 1rem;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--leaf);
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: currentColor; }
.eyebrow--light { color: var(--gold-300); }

.section-head { max-width: 680px; margin-bottom: 52px; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .eyebrow { justify-content: center; }
.section-head .lead { margin-bottom: 0; }
.lead { font-size: 1.12rem; color: var(--muted); }

.icon { width: 1.2em; height: 1.2em; flex: none; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--forest);
  color: #fff;
  font-weight: 700;
}
.skip-link:focus { top: 12px; }

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

:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55em;
  padding: .85em 1.45em;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(.97); }
.btn .icon { width: 1.1em; height: 1.1em; }

.btn-primary { background: var(--forest); color: #fff; }
.btn-primary:hover { background: var(--forest-700); box-shadow: var(--shadow-sm); }
.btn-gold { background: var(--gold); color: var(--forest-900); }
.btn-gold:hover { background: #ddaa4d; box-shadow: 0 10px 28px -12px rgba(210, 155, 58, .8); }
.btn-ghost-light { border-color: rgba(255, 255, 255, .5); color: #fff; }
.btn-ghost-light:hover { background: rgba(255, 255, 255, .12); border-color: #fff; }
.btn-outline { border-color: var(--forest); color: var(--forest); }
.btn-outline:hover { background: var(--forest); color: #fff; }

.btn-sm { padding: .62em 1.15em; font-size: .87rem; }
.btn-lg { padding: 1.02em 1.75em; font-size: 1rem; }
.btn-block { width: 100%; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  background: var(--leaf-soft);
  color: var(--forest);
}
.badge--live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3fa34d;
  box-shadow: 0 0 0 0 rgba(63, 163, 77, .6);
  animation: pulse 2s infinite;
}
.badge--few  { background: #fde8dc; color: #9a3d12; }
.badge--soon { background: #fff1d6; color: #7d5410; }

@keyframes pulse {
  70%  { box-shadow: 0 0 0 7px rgba(63, 163, 77, 0); }
  100% { box-shadow: 0 0 0 0 rgba(63, 163, 77, 0); }
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(247, 242, 232, .95);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--ink);
  transition: box-shadow .3s ease;
}
.site-header.is-solid { box-shadow: 0 1px 0 var(--line), 0 10px 30px -18px rgba(10, 22, 15, .35); }

.header-inner { display: flex; align-items: center; gap: 32px; }

.brand { display: flex; align-items: center; text-decoration: none; flex: none; }
.brand-logo { display: block; width: auto; height: 50px; }
@media (max-width: 520px) { .brand-logo { height: 42px; } }

.main-nav { display: flex; align-items: center; gap: 30px; margin-left: auto; }
.main-nav > a:not(.btn) {
  position: relative;
  padding: 6px 0;
  font-size: .93rem;
  font-weight: 600;
  text-decoration: none;
  opacity: .88;
}
.main-nav > a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.main-nav > a:not(.btn):hover { opacity: 1; }
.main-nav > a:not(.btn):hover::after { transform: scaleX(1); }
.nav-cta-mobile { display: none; }

.header-actions { display: flex; align-items: center; gap: 20px; }
.header-phone { display: flex; align-items: center; gap: 8px; font-size: .92rem; font-weight: 700; text-decoration: none; white-space: nowrap; }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1.5px solid currentColor;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.nav-toggle .icon { width: 22px; height: 22px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 1140px) {
  .header-phone span { display: none; }
  .main-nav { gap: 22px; }
}

@media (max-width: 940px) {
  .nav-toggle { display: grid; }
  .header-actions .btn { display: none; }
  .header-actions { margin-left: auto; gap: 12px; }
  .header-phone { width: 44px; height: 44px; justify-content: center; border-radius: 12px; border: 1.5px solid currentColor; }

  .main-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 8px 20px 24px;
    background: var(--sand);
    color: var(--ink);
    box-shadow: 0 24px 40px -20px rgba(0, 0, 0, .3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .25s ease, transform .25s ease, visibility .25s;
  }
  .main-nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .main-nav > a:not(.btn) { padding: 15px 2px; border-bottom: 1px solid var(--line); font-size: 1.05rem; opacity: 1; }
  .main-nav > a:not(.btn)::after { display: none; }
  .nav-cta-mobile { display: flex; margin-top: 18px; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: calc(var(--header-h) + clamp(36px, 6vw, 76px)) 0 clamp(64px, 8vw, 104px);
  background: linear-gradient(180deg, var(--sand) 0%, var(--sand-2) 100%);
}
/* Faint survey-map contour rings behind the photo */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: repeating-radial-gradient(circle at 76% 46%, transparent 0 44px, rgba(79, 127, 64, .13) 44px 45.5px);
  -webkit-mask-image: radial-gradient(circle at 76% 46%, #000 0, transparent 62%);
  mask-image: radial-gradient(circle at 76% 46%, #000 0, transparent 62%);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: clamp(40px, 6vw, 88px);
  align-items: center;
}

.hero h1 { margin-bottom: .32em; font-size: clamp(2.7rem, 5.6vw, 4.6rem); }
.hero h1 em, .auth-card h1 em { position: relative; z-index: 0; font-style: italic; color: var(--leaf); white-space: nowrap; }
.hero h1 em::after, .auth-card h1 em::after {
  content: "";
  position: absolute;
  left: -2%;
  right: -4%;
  bottom: -.06em;
  z-index: -1;
  height: .3em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20' preserveAspectRatio='none'%3E%3Cpath d='M3 15C55 5 125 3 197 9' fill='none' stroke='%23d29b3a' stroke-width='6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
}
.hero-lead { max-width: 520px; margin-bottom: 30px; font-size: 1.15rem; color: var(--muted); }

.hero-form {
  display: flex;
  gap: 8px;
  max-width: 600px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}
.hero-form input:not([type="hidden"]) {
  flex: 1 1 0;
  min-width: 0;
  padding: 14px 16px;
  border: 1.5px solid transparent;
  border-radius: 12px;
  background: #faf7f0;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  transition: border-color .2s ease, background-color .2s ease;
}
.hero-form input:focus { border-color: var(--leaf); background: #fff; outline: none; }
.hero-form .btn { flex: none; border-radius: 12px; }
.hero-done { max-width: 600px; margin: 0; }

.hero-alt { display: flex; flex-wrap: wrap; gap: 10px 26px; margin: 18px 0 0; font-size: .92rem; font-weight: 700; }
.hero-alt a { display: inline-flex; align-items: center; gap: 8px; color: var(--forest); text-decoration: none; }
.hero-alt a:hover { color: var(--leaf); }
.hero-alt .icon { color: var(--leaf); }

/* ---------- Photo + floating cards ---------- */
.hero-visual { position: relative; width: 100%; max-width: 480px; justify-self: end; }
.hero-photo { position: relative; }
.hero-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border: 1.5px solid var(--gold);
  border-radius: 50% 50% 6% 6% / 42% 42% 5% 5%;
  transform: translate(18px, 18px);
}
.hero-photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 6;
  object-fit: cover;
  object-position: 62% center;
  border-radius: 50% 50% 6% 6% / 42% 42% 5% 5%;
  box-shadow: var(--shadow);
  filter: saturate(.82);
}

.hero-float {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 18px;
  border: 1px solid rgba(226, 217, 198, .8);
  border-radius: 18px;
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
}
.hero-float-label { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.hero-float-value { font-family: var(--font-display); font-size: 1.9rem; font-weight: 600; line-height: 1.15; color: var(--forest-900); font-variant-numeric: lining-nums; }
.hero-float-value small { font-family: var(--font-body); font-size: .9rem; font-weight: 600; color: var(--muted); }
.hero-float-sub { font-size: .85rem; color: var(--muted); }

.hero-float--price { top: 16%; right: -28px; }

/* ---------- Entrance ---------- */
@keyframes hero-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.hero-copy > *, .hero-photo, .hero-float { animation: hero-rise .8s cubic-bezier(.2, .7, .2, 1) both; }
.hero-copy > :nth-child(2) { animation-delay: .06s; }
.hero-copy > :nth-child(3) { animation-delay: .12s; }
.hero-copy > :nth-child(4) { animation-delay: .18s; }
.hero-copy > :nth-child(n + 5) { animation-delay: .24s; }
.hero-photo { animation-delay: .1s; }
.hero-float--price { animation-delay: .45s; }

@media (max-width: 1100px) { .hero-float--price { right: -12px; } }
@media (max-width: 940px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 56px; }
  .hero-visual { justify-self: center; max-width: 420px; }
  .hero::before { background-position: center; -webkit-mask-image: radial-gradient(circle at 50% 72%, #000 0, transparent 60%); mask-image: radial-gradient(circle at 50% 72%, #000 0, transparent 60%); }
}
@media (max-width: 560px) {
  .hero-form { flex-direction: column; }
  .hero-form .btn { padding-block: 1em; }
  .hero-photo::before { transform: translate(10px, 10px); }
  .hero-float { padding: 12px 14px; }
  .hero-float-value { font-size: 1.5rem; }
  .hero-float--price { top: 10%; right: -8px; }
}

/* ==========================================================================
   About
   ========================================================================== */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; }
.about-media { position: relative; }
.about-media img { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--radius); }
.about-note {
  position: absolute;
  right: -28px;
  bottom: 40px;
  max-width: 260px;
  padding: 22px 24px;
  border-radius: 16px;
  background: var(--forest);
  color: rgba(255, 255, 255, .8);
  font-size: .9rem;
  box-shadow: var(--shadow);
}
.about-note strong { display: block; margin-bottom: 4px; font-family: var(--font-display); font-size: 1.45rem; font-weight: 600; line-height: 1.15; color: #fff; }

.checklist { display: grid; gap: 14px; margin: 28px 0 36px; padding: 0; list-style: none; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; font-weight: 500; }
.checklist .icon { margin-top: 2px; padding: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--leaf-soft); color: var(--leaf); stroke-width: 2.6; }

@media (max-width: 940px) {
  .about-grid { grid-template-columns: 1fr; gap: 48px; }
  .about-media img { aspect-ratio: 16 / 11; }
  .about-note { right: 16px; bottom: 16px; }
}

/* ==========================================================================
   Amenities
   ========================================================================== */
.amenity-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.amenity {
  padding: 28px 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.amenity:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); border-color: transparent; }
.amenity-icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 18px; border-radius: 14px; background: var(--forest); color: var(--gold-300); }
.amenity-icon .icon { width: 24px; height: 24px; }
.amenity h3 { margin-bottom: 6px; font-family: var(--font-body); font-size: 1.05rem; font-weight: 800; letter-spacing: 0; }
.amenity p { margin: 0; font-size: .9rem; line-height: 1.55; color: var(--muted); }

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

/* ==========================================================================
   Process
   ========================================================================== */
.process { background: #fff; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.step { position: relative; padding-top: 70px; }
.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute;
  top: 0;
  left: 0;
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 600;
  line-height: 1;
  color: var(--gold);
}
.step::after { content: ""; position: absolute; top: 24px; left: 76px; right: -16px; height: 1px; background: var(--line); }
.step:last-child::after { display: none; }
.step h3 { margin-bottom: 8px; font-family: var(--font-body); font-size: 1.12rem; font-weight: 800; letter-spacing: 0; }
.step p { margin: 0; font-size: .95rem; color: var(--muted); }

@media (max-width: 940px) {
  .steps { grid-template-columns: repeat(2, 1fr); gap: 40px 32px; }
  .step::after { display: none; }
}
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

/* ==========================================================================
   CTA band
   ========================================================================== */
.cta-band { position: relative; isolation: isolate; overflow: hidden; padding: clamp(84px, 12vw, 150px) 0; text-align: center; color: #fff; }
.cta-band img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.cta-band::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(18, 38, 27, .78), rgba(18, 38, 27, .66)); }
.cta-band h2 { max-width: 760px; margin-inline: auto; color: #fff; }
.cta-band p { max-width: 560px; margin: 0 auto 34px; font-size: 1.12rem; color: rgba(255, 255, 255, .85); }
.cta-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }

/* ==========================================================================
   FAQ
   ========================================================================== */
.faq-list { display: grid; gap: 12px; max-width: 860px; margin-inline: auto; }
.faq-item { border: 1px solid var(--line); border-radius: 14px; background: #fff; transition: box-shadow .25s ease; }
.faq-item[open] { box-shadow: var(--shadow-sm); }
.faq-item summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 20px 24px;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--forest-900);
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .icon { color: var(--leaf); transition: transform .25s ease; }
.faq-item[open] summary .icon { transform: rotate(45deg); }
.faq-item p { margin: 0; padding: 0 24px 22px; color: var(--muted); }

/* ==========================================================================
   Enquiry
   ========================================================================== */
.enquire { background: var(--sand-2); }
.enquire-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 72px; align-items: start; }

.contact-list { display: grid; gap: 20px; margin: 36px 0 0; padding: 0; list-style: none; }
.contact-list li { display: flex; gap: 16px; align-items: center; }
.contact-icon { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 14px; background: #fff; color: var(--forest); box-shadow: var(--shadow-sm); }
.contact-list small { display: block; font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.contact-list a, .contact-list span:not(.contact-icon) { font-weight: 700; color: var(--forest-900); text-decoration: none; overflow-wrap: anywhere; }
.contact-list a:hover { color: var(--leaf); }

.form-card { padding: clamp(24px, 4vw, 42px); border-radius: 22px; background: #fff; box-shadow: var(--shadow); }
.form-card h3 { margin-bottom: 4px; font-size: 1.9rem; }
.form-card > p { margin: 0; color: var(--muted); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 26px 0 24px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: .85rem; font-weight: 700; }
.field .opt { font-weight: 500; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fcfaf5;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.field select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b675e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
}
.field textarea { min-height: 104px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--leaf);
  background-color: #fff;
  box-shadow: 0 0 0 4px rgba(79, 127, 64, .15);
  outline: none;
}
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: #c2410c; }
.field-error { font-size: .82rem; font-weight: 600; color: #b42318; }

.alert { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; padding: 14px 16px; border-radius: 12px; font-weight: 600; }
.alert .icon { margin-top: 2px; }
.alert--success { background: #e5f2e1; color: #1f5a2a; }
.alert--error { background: #fdecea; color: #a1271b; }

.form-consent { margin: 14px 0 0; font-size: .8rem; text-align: center; color: var(--muted); }

.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 940px) { .enquire-grid { grid-template-columns: 1fr; gap: 48px; } }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { padding: 76px 0 0; background: var(--forest-900); color: rgba(230, 239, 226, .72); font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1.3fr; gap: 44px; }
.site-footer .brand { display: inline-flex; margin-bottom: 22px; padding: 12px 18px; border-radius: 14px; background: var(--sand); }
.site-footer .brand-logo { height: 46px; }
.footer-about p { max-width: 340px; }
.site-footer h4 { margin: 6px 0 18px; font-size: .76rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: #fff; }
.footer-links { display: grid; gap: 11px; margin: 0; padding: 0; list-style: none; }
.footer-links a { text-decoration: none; transition: color .2s ease; }
.footer-links a:hover { color: #fff; }
.footer-contact li { display: flex; gap: 10px; align-items: flex-start; overflow-wrap: anywhere; }
.footer-contact .icon { margin-top: 4px; color: var(--gold-300); }

.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 32px; margin-top: 60px; padding: 24px 0 30px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .82rem; }
.footer-bottom p { margin: 0; }
.disclaimer { max-width: 640px; color: rgba(230, 239, 226, .5); }

@media (max-width: 940px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; gap: 32px; } }

/* ==========================================================================
   Floating contact
   ========================================================================== */
.wa-float {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  box-shadow: 0 12px 30px -8px rgba(37, 211, 102, .6);
  transition: transform .2s ease;
}
.wa-float:hover { transform: scale(1.06); }
.wa-float .icon { width: 28px; height: 28px; }

@media (max-width: 720px) {
  .wa-float { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); width: 52px; height: 52px; }
  .wa-float .icon { width: 25px; height: 25px; }
}

/* ==========================================================================
   Member pages (login, register, panel)
   ========================================================================== */
/* One sans-serif across the member pages; the public site keeps Playfair + Inter. */
.auth-page,
.panel-page {
  --font-display: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: var(--font-display);
}
.auth-page h1, .auth-page h2, .auth-page h3,
.panel-page h1, .panel-page h2, .panel-page h3 { font-weight: 700; letter-spacing: -.02em; }

.account-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--forest);
  font: inherit;
  font-size: .88rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .2s ease;
}
.account-link:hover { border-color: var(--forest); }

/* ---------- Login / register ---------- */
.auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .92fr);
  min-height: 100vh;
  min-height: 100svh;
}

.auth-main {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0 clamp(20px, 4vw, 56px);
}
/* Faint contour rings in the corner, echoing the home page hero */
.auth-main::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: repeating-radial-gradient(circle at 0% 100%, transparent 0 44px, rgba(79, 127, 64, .11) 44px 45.5px);
  -webkit-mask-image: radial-gradient(circle at 0% 100%, #000 0, transparent 58%);
  mask-image: radial-gradient(circle at 0% 100%, #000 0, transparent 58%);
}

.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: var(--header-h); padding-top: 14px; }
.auth-body { flex: 1; display: flex; align-items: center; justify-content: center; padding: clamp(32px, 6vh, 64px) 0; }
.auth-foot { padding-bottom: 26px; font-size: .82rem; color: var(--muted); }
.auth-foot p { margin: 0; }
.auth-foot a { color: var(--forest); font-weight: 700; text-decoration: none; }

.auth-card { width: 100%; max-width: 430px; }
.auth-card--wide { max-width: 520px; }
.auth-card .hero-pill { margin-bottom: 22px; box-shadow: none; }
.auth-card h1 { margin-bottom: .28em; font-size: clamp(2.3rem, 3.8vw, 2.9rem); font-weight: 800; line-height: 1.08; letter-spacing: -.035em; }
.auth-card h1 em { font-style: normal; }
.auth-lead { margin: 0; font-size: 1.05rem; color: var(--muted); }
.auth-card .alert { margin-top: 24px; }

.auth-form { display: grid; gap: 18px; margin-top: 30px; }
.auth-form .btn-block { margin-top: 4px; }
.auth-form .field input { padding-block: 14px; background-color: #fff; }
.form-grid--tight { margin: 0; }

/* Icon (or +91 prefix) inside the input */
.input-wrap { position: relative; }
.input-wrap > .icon,
.input-prefix {
  position: absolute;
  top: 50%;
  left: 15px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  transition: color .2s ease;
}
.input-wrap > .icon { width: 20px; height: 20px; }
.field .input-wrap input { padding-left: 46px; }
.input-wrap:focus-within > .icon { color: var(--leaf); }
.input-prefix { padding-right: 11px; border-right: 1px solid var(--line); font-weight: 700; line-height: 1.3; color: var(--forest-900); }
.field .input-wrap--prefix input { padding-left: 64px; }

.input-id { font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.input-id::placeholder { font-weight: 400; letter-spacing: 0; text-transform: none; }

.password-wrap input { padding-right: 52px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.password-toggle:hover { color: var(--forest); background: var(--leaf-soft); }
.password-toggle .icon-hide { display: none; }
.password-toggle[aria-pressed="true"] .icon-show { display: none; }
.password-toggle[aria-pressed="true"] .icon-hide { display: block; }

/* Numbered groups on the register form */
.auth-form:has(.auth-step) { gap: 26px; }
.auth-step { display: grid; gap: 16px; min-width: 0; margin: 0; padding: 0; border: 0; }
.auth-step legend {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 0;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--forest);
}
.auth-step-num { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--forest); color: #fff; font-size: .74rem; letter-spacing: 0; }
.auth-note { margin: 0; font-size: .85rem; color: var(--muted); }

.sponsor-status { display: inline-flex; align-items: center; gap: 7px; align-self: flex-start; font-size: .85rem; font-weight: 700; }
.sponsor-status:empty { display: none; }
.sponsor-status[data-state="ok"] { padding: 5px 13px 5px 6px; border-radius: 999px; background: var(--leaf-soft); color: var(--forest); }
.sponsor-status[data-state="ok"]::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--available) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 11px no-repeat;
}
.sponsor-status[data-state="error"] { color: #b42318; }
.field:has(.sponsor-status[data-state="ok"]) input { border-color: var(--available); }

.alert--registered .copy-btn { margin-top: 10px; background: #fff; }

.auth-help { margin: 2px 0 0; font-size: .85rem; text-align: center; color: var(--muted); }
.auth-switch { margin: 24px 0 0; font-weight: 600; text-align: center; color: var(--muted); }
.auth-switch a, .auth-help a { font-weight: 700; color: var(--leaf); }
.auth-help a { white-space: nowrap; }

.auth-divider { display: flex; align-items: center; gap: 14px; margin: 30px 0 16px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Farmland panel ---------- */
.auth-visual {
  position: sticky;
  top: 14px;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 3.5vh, 32px);
  align-self: start;
  height: calc(100vh - 28px);
  height: calc(100svh - 28px);
  margin: 14px 14px 14px 0;
  padding: clamp(30px, 4vw, 52px);
  overflow: hidden;
  border-radius: 28px;
  background: radial-gradient(120% 80% at 90% 0%, var(--forest-700) 0, var(--forest-900) 62%);
  color: #fff;
}
.auth-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: repeating-radial-gradient(circle at 50% 62%, transparent 0 46px, rgba(233, 201, 131, .1) 46px 47.5px);
  -webkit-mask-image: radial-gradient(circle at 50% 62%, #000 0, transparent 66%);
  mask-image: radial-gradient(circle at 50% 62%, #000 0, transparent 66%);
}

.auth-visual .eyebrow { margin-bottom: .8rem; }
.auth-visual h2 { margin-bottom: .3em; font-size: clamp(1.9rem, 2.8vw, 2.5rem); font-weight: 800; line-height: 1.1; letter-spacing: -.03em; color: #fff; }
.auth-visual h2 em { font-style: normal; color: var(--gold-300); }
.auth-visual-copy > p:last-child { max-width: 430px; margin: 0; color: rgba(255, 255, 255, .78); }

.auth-art { display: flex; flex: 1; align-items: center; justify-content: center; min-height: 0; }
.auth-arch { position: relative; height: 100%; max-height: 440px; max-width: 100%; aspect-ratio: 4 / 5; }
.auth-arch::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1.5px solid rgba(233, 201, 131, .7);
  border-radius: 50% 50% 6% 6% / 40% 40% 5% 5%;
  transform: translate(16px, 16px);
}
.auth-arch > img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50% 50% 6% 6% / 40% 40% 5% 5%;
  filter: saturate(.85);
}

.member-card {
  position: absolute;
  bottom: 9%;
  left: -26%;
  display: flex;
  flex-direction: column;
  width: 236px;
  padding: 16px 18px;
  border: 1px solid rgba(233, 201, 131, .7);
  border-radius: 18px;
  background: linear-gradient(150deg, #fff 0%, var(--sand) 100%);
  box-shadow: 0 30px 60px -22px rgba(0, 0, 0, .6);
  color: var(--ink);
}
.member-card-logo { width: auto; height: 28px; margin-bottom: 14px; align-self: flex-start; }
.member-card-label { font-size: .68rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.member-card-id { font-size: 1.6rem; font-weight: 800; line-height: 1.2; letter-spacing: .04em; font-variant-numeric: tabular-nums; color: var(--forest-900); }
.member-card-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: .78rem; font-weight: 600; color: var(--muted); }

.auth-chip {
  position: absolute;
  top: 16%;
  right: -16%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px 8px 8px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 20px 40px -16px rgba(0, 0, 0, .55);
  color: var(--forest-900);
  font-size: .85rem;
  font-weight: 700;
  white-space: nowrap;
}
.auth-chip .icon { width: 22px; height: 22px; padding: 4px; border-radius: 50%; background: var(--available); color: #fff; stroke-width: 3; }

.auth-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
  padding: 22px 0 0;
  border-top: 1px solid rgba(255, 255, 255, .12);
  list-style: none;
  font-size: .85rem;
  font-weight: 600;
  line-height: 1.4;
  color: rgba(255, 255, 255, .82);
}
.auth-points li { display: flex; flex-direction: column; gap: 10px; }
.auth-points .icon { width: 36px; height: 36px; padding: 8px; border-radius: 11px; background: rgba(255, 255, 255, .08); color: var(--gold-300); }

/* Entrance */
.auth-card > *, .auth-arch, .member-card, .auth-chip { animation: hero-rise .8s cubic-bezier(.2, .7, .2, 1) both; }
.auth-card > :nth-child(2) { animation-delay: .05s; }
.auth-card > :nth-child(3) { animation-delay: .1s; }
.auth-card > :nth-child(n + 4) { animation-delay: .15s; }
.member-card { animation-delay: .4s; }
.auth-chip { animation-delay: .55s; }

@media (max-height: 760px) {
  .auth-points { display: none; }
}
@media (max-width: 1180px) {
  .auth { grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); }
  .member-card { left: -18%; width: 214px; padding: 14px 16px; }
  .member-card-id { font-size: 1.4rem; }
  .auth-chip { right: -10%; }
  .auth-points { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .auth-points li { flex-direction: row; align-items: center; }
  .auth-points .icon { width: 30px; height: 30px; padding: 6px; }
}
@media (max-width: 1100px) {
  .member-card { left: -8%; }
  .auth-chip { right: -6%; }
}
@media (max-width: 940px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-visual { display: none; }
  .auth-body { align-items: flex-start; padding-top: clamp(24px, 6vw, 48px); }
  .auth-main::before { background-image: repeating-radial-gradient(circle at 100% 0%, transparent 0 44px, rgba(79, 127, 64, .11) 44px 45.5px); -webkit-mask-image: radial-gradient(circle at 100% 0%, #000 0, transparent 60%); mask-image: radial-gradient(circle at 100% 0%, #000 0, transparent 60%); }
}
@media (max-width: 520px) {
  .auth-top .account-link { padding: 8px 13px; font-size: .82rem; }
  .auth-card h1 { font-size: 2.1rem; }
  .auth-foot { text-align: center; }
}

/* ---------- Member panel ---------- */
.panel-page {
  --panel-bg: #f5f2ea;
  --card-shadow: 0 1px 2px rgba(18, 38, 27, .04), 0 6px 18px -14px rgba(18, 38, 27, .25);
  font-size: 15px;
  line-height: 1.55;
  background: var(--panel-bg);
}
/* Background: warm gold and leaf glows, with survey contour rings spreading from two corners.
   Fixed layers rather than background-attachment, which phones ignore. Each corner's rings
   have their own layer and fade out before reaching the other's, so the lines never cross. */
.panel::before,
.panel-page::before,
.panel-page::after { content: ""; position: fixed; inset: 0; pointer-events: none; }
.panel::before {
  z-index: -2;
  background:
    radial-gradient(70vmax 48vmax at 100% -6%, rgba(210, 155, 58, .24), transparent 68%),
    radial-gradient(64vmax 52vmax at -4% 104%, rgba(79, 127, 64, .26), transparent 70%),
    radial-gradient(40vmax 30vmax at 58% 52%, rgba(255, 255, 255, .55), transparent 72%),
    linear-gradient(165deg, #f8f3e7 0%, #f3efe2 48%, #ebeedd 100%);
}
.panel-page::before {
  z-index: -1;
  background: repeating-radial-gradient(circle at 100% 0, rgba(133, 87, 15, .22) 0 1px, transparent 1px 44px);
  -webkit-mask-image: radial-gradient(circle 75vmin at 100% 0, #000 25%, transparent 100%);
  mask-image: radial-gradient(circle 75vmin at 100% 0, #000 25%, transparent 100%);
}
.panel-page::after {
  z-index: -1;
  background: repeating-radial-gradient(circle at 0 100%, rgba(29, 58, 42, .2) 0 1px, transparent 1px 44px);
  -webkit-mask-image: radial-gradient(circle 75vmin at 0 100%, #000 25%, transparent 100%);
  mask-image: radial-gradient(circle 75vmin at 0 100%, #000 25%, transparent 100%);
}

.panel { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; min-height: 100svh; }

/* Sidebar */
.panel-side {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100vh;
  height: 100svh;
  padding: 22px 16px 18px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}
.panel-side-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 6px; }
.panel-brand { display: inline-flex; border-radius: 10px; }
.panel-brand .brand-logo { width: auto; height: 46px; }
.panel-close { display: none; }

.panel-nav { display: grid; gap: 3px; }
.panel-nav-label { margin: 0 0 8px; padding: 0 12px; font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.panel-nav a,
.panel-group > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: #3a463e;
  font-size: .94rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .2s ease, color .3s ease;
}
.panel-nav .icon { width: 19px; height: 19px; color: var(--muted); transition: color .3s ease, transform .2s ease; }
.panel-nav a:hover,
.panel-group > summary:hover { background: var(--sand); color: var(--forest-900); }
.panel-nav a:hover .icon,
.panel-group > summary:hover .icon { color: var(--forest); }
.panel-nav a.is-active { background: var(--forest); color: #fff; box-shadow: 0 8px 18px -10px rgba(18, 38, 27, .7); }
.panel-nav a.is-active .icon { color: var(--gold-300); }

/* Menu group (My Genealogy): opens to show its pages, and starts open on one of them */
.panel-group > summary { list-style: none; cursor: pointer; }
.panel-group > summary::-webkit-details-marker { display: none; }
.panel-group > summary.is-current { color: var(--forest-900); }
.panel-group > summary.is-current .icon { color: var(--forest); }
.panel-nav .panel-group-chevron { width: 16px; height: 16px; margin-left: auto; }
.panel-group[open] > summary .panel-group-chevron { transform: rotate(90deg); }
/* Sub-pages line up with the group's label; the guide line runs under its icon. */
.panel-subnav { position: relative; display: grid; gap: 2px; padding: 6px 0 8px 31px; }
.panel-subnav::before { content: ""; position: absolute; top: 10px; bottom: 12px; left: 21px; width: 1.5px; border-radius: 1px; background: var(--line); }
.panel-subnav a { padding: 8px 12px; font-size: .9rem; }
.panel-subnav a.is-active { box-shadow: 0 4px 10px -6px rgba(18, 38, 27, .6); }

/* Sliding highlight: account.js adds one pill behind the menu and moves it between items.
   Without the script, .is-active above keeps its own background. */
.panel-nav { position: relative; }
.panel-nav a, .panel-group > summary { position: relative; z-index: 1; }
.panel-nav-pill {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 12px;
  background: var(--forest);
  box-shadow: 0 8px 18px -10px rgba(18, 38, 27, .7);
  pointer-events: none;
  transition: transform .35s cubic-bezier(.22, .8, .24, 1), width .35s cubic-bezier(.22, .8, .24, 1), height .35s cubic-bezier(.22, .8, .24, 1);
}
.panel-nav.has-pill a.is-active { background: none; box-shadow: none; color: #3a463e; }
.panel-nav.has-pill a.is-active .icon { color: var(--muted); }
.panel-nav.has-pill a.pill-on,
.panel-nav.has-pill summary.pill-on,
.panel-nav.has-pill a.pill-on:hover,
.panel-nav.has-pill summary.pill-on:hover { background: none; color: #fff; }
.panel-nav.has-pill a.pill-on .icon,
.panel-nav.has-pill summary.pill-on .icon { color: var(--gold-300); }
.panel-nav.has-pill summary.pill-on .panel-group-chevron { color: rgba(255, 255, 255, .75); }

.panel-side-foot { display: grid; gap: 2px; margin-top: auto; }
.panel-side-foot form { margin: 0; }
.panel-me {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--sand);
  color: inherit;
  text-decoration: none;
  transition: border-color .2s ease;
}
.panel-me:hover { border-color: var(--leaf); }
.panel-me .avatar { width: 38px; height: 38px; }
.panel-me-text { display: grid; min-width: 0; line-height: 1.3; }
.panel-me-text strong { overflow: hidden; font-size: .9rem; color: var(--forest-900); text-overflow: ellipsis; white-space: nowrap; }
.panel-me-text small { font-size: .76rem; font-weight: 600; letter-spacing: .04em; color: var(--muted); }
.panel-side-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: .88rem;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
.panel-side-link:hover { background: var(--sand); color: var(--forest-900); }
.panel-side-link .icon { width: 18px; height: 18px; }

.panel-scrim { display: none; }

/* Top bar */
.panel-main { display: flex; flex-direction: column; min-width: 0; }
.panel-top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 12px clamp(20px, 3.2vw, 40px);
  border-bottom: 1px solid var(--line);
  background: rgba(245, 242, 234, .88);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.panel-menu { display: none; }
.panel-heading { flex: 1; min-width: 0; }
.panel-crumb { margin: 0; font-size: .74rem; font-weight: 600; line-height: 1.4; color: var(--muted); }
.panel-title { overflow: hidden; margin: 0; font-size: 1.3rem; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.panel-actions { display: flex; gap: 10px; }

.panel-content { flex: 1; display: grid; align-content: start; gap: 20px; padding: clamp(20px, 3vw, 32px) clamp(20px, 3.2vw, 40px) 44px; }
.panel-alert { margin: 0; }
.panel-foot { padding: 0 clamp(20px, 3.2vw, 40px) 24px; font-size: .8rem; color: var(--muted); }
.panel-foot p { margin: 0; }
.panel-foot a { color: var(--forest); font-weight: 700; text-decoration: none; white-space: nowrap; }

/* Bottom bar on phones (shown under 760px): the menu's items with the sidebar's green highlight.
   My Genealogy opens its pages in a small card above the bar. */
.panel-tabs { display: none; }
.panel-tabs > a,
.panel-tabs summary {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 7px 2px 6px;
  border-radius: 12px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
  list-style: none;
  cursor: pointer;
  transition: color .3s ease;
}
.panel-tabs summary::-webkit-details-marker { display: none; }
.panel-tabs .icon { width: 21px; height: 21px; transition: color .3s ease, transform .2s ease; }
.panel-tabs > a:active .icon,
.panel-tabs summary:active .icon { transform: scale(.88); }
.panel-tabs-group[open] > summary { color: var(--forest-900); }
/* Without the script the active item keeps its own background, as in the sidebar. */
.panel-tabs > a.is-active,
.panel-tabs summary.is-current { background: var(--forest); color: #fff; box-shadow: 0 8px 18px -10px rgba(18, 38, 27, .7); }
.panel-tabs > a.is-active .icon,
.panel-tabs summary.is-current .icon { color: var(--gold-300); }
.panel-tabs.has-pill > a.is-active,
.panel-tabs.has-pill summary.is-current { background: none; box-shadow: none; color: var(--muted); }
.panel-tabs.has-pill > a.is-active .icon,
.panel-tabs.has-pill summary.is-current .icon { color: inherit; }
.panel-tabs.has-pill > a.pill-on,
.panel-tabs.has-pill summary.pill-on { color: #fff; }
.panel-tabs.has-pill > a.pill-on .icon,
.panel-tabs.has-pill summary.pill-on .icon { color: var(--gold-300); }

@keyframes tabs-sheet-in { from { opacity: 0; transform: translateY(8px) scale(.97); } }
.panel-tabs-sheet {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 8px;
  z-index: 2;
  display: grid;
  gap: 2px;
  width: min(240px, calc(100% - 16px));
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 40px -16px rgba(18, 38, 27, .45);
  transform-origin: 30% 100%;
}
.panel-tabs-group[open] > .panel-tabs-sheet { animation: tabs-sheet-in .24s cubic-bezier(.22, .8, .24, 1); }
.panel-tabs-sheet a { padding: 11px 12px; border-radius: 10px; color: #3a463e; font-size: .92rem; font-weight: 600; text-decoration: none; }
.panel-tabs-sheet a.is-active { background: var(--leaf-soft); color: var(--forest-900); font-weight: 700; }

.panel-columns { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.panel-columns--form { grid-template-columns: minmax(0, 1.45fr) minmax(0, .9fr); }
.panel-columns--even { align-items: stretch; }
.panel-stack { display: grid; gap: 20px; min-width: 0; }

/* Cards */
.card { min-width: 0; padding: clamp(20px, 2.4vw, 26px); border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--card-shadow); }
.card--flush { overflow: hidden; padding: 0; }
.card--tint { border-color: transparent; background: var(--leaf-soft); box-shadow: none; }
.card h2 { margin-bottom: .4em; font-size: 1.08rem; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.card-sub { margin: 3px 0 0; font-size: .85rem; color: var(--muted); }
.card-link { display: inline-flex; align-items: center; gap: 2px; padding: 3px 0; font-size: .85rem; font-weight: 700; color: var(--leaf); text-decoration: none; white-space: nowrap; }
.card-link:hover { color: var(--forest); }
.card-link .icon { width: 16px; height: 16px; }
.card-text { margin: 0 0 18px; color: var(--muted); }
.card-note { margin: 18px 0 0; font-size: .86rem; color: var(--muted); }
.card-note a { font-weight: 700; color: var(--leaf); white-space: nowrap; }
.card--form .auth-form { margin-top: 22px; }
.card .alert { margin-top: 0; margin-bottom: 4px; }
.muted { color: var(--muted); }
small.muted { font-size: .8rem; }

.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--gold-300);
  color: var(--forest-900);
  font-size: .86rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.avatar--sm { width: 36px; height: 36px; background: var(--leaf-soft); color: var(--forest); font-size: .75rem; }
.avatar--lg { width: 64px; height: 64px; font-size: 1.25rem; }

.welcome-card { padding: clamp(20px, 3vw, 28px); border: 1px solid rgba(210, 155, 58, .5); border-radius: 18px; background: #fdf6e7; }
.welcome-card .eyebrow { margin-bottom: .6rem; font-size: .7rem; }
.welcome-card h2 { margin-bottom: .35em; font-size: clamp(1.3rem, 2.4vw, 1.6rem); }
.welcome-card p:last-child { margin: 0; color: var(--muted); }

/* Land measure strip on the dashboard: ten small plots make one unit */
.unit-note { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border: 1px dashed rgba(210, 155, 58, .6); border-radius: 16px; background: #fdf6e7; }
.unit-note-icon { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 13px; background: linear-gradient(145deg, #e3b45c, var(--gold)); color: var(--forest-900); box-shadow: 0 8px 16px -10px rgba(133, 87, 15, .7); }
.unit-note-text { display: grid; margin: 0; line-height: 1.3; }
.unit-note-text span { font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #85570f; }
.unit-note-text strong { font-size: 1.2rem; font-weight: 800; color: var(--forest-900); }
.unit-note-sum { display: flex; align-items: center; gap: 12px; margin-left: auto; font-size: 1.1rem; font-weight: 800; color: #85570f; }
.unit-note-plots { display: grid; grid-template-columns: repeat(5, 16px); gap: 3px; }
.unit-note-plots i { height: 16px; border-radius: 4px; background: var(--gold-300); }
.unit-note-whole { display: grid; place-items: center; width: 92px; height: 35px; border-radius: 8px; background: linear-gradient(145deg, var(--forest-700), var(--forest-900)); color: var(--gold-300); font-size: .74rem; letter-spacing: .08em; }
.welcome-id { color: var(--leaf); white-space: nowrap; }

/* Overview banner: greeting, referral link and the membership card */
.dash-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: clamp(20px, 3vw, 44px);
  align-items: center;
  padding: clamp(22px, 3.2vw, 34px);
  border-radius: 22px;
  background: linear-gradient(135deg, var(--forest-700) 0%, var(--forest) 45%, var(--forest-900) 100%);
  color: rgba(255, 255, 255, .8);
  box-shadow: var(--shadow-sm);
}
/* Faint survey-map contour rings, as on the home page */
.dash-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: repeating-radial-gradient(circle at 96% 120%, transparent 0 26px, rgba(233, 201, 131, .13) 26px 27px);
  -webkit-mask-image: radial-gradient(circle at 96% 120%, #000 0, transparent 72%);
  mask-image: radial-gradient(circle at 96% 120%, #000 0, transparent 72%);
}
.dash-hero-date { margin: 0 0 6px; font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-300); }
.dash-hero h2 { margin: 0 0 8px; font-size: clamp(1.55rem, 2.8vw, 2.1rem); line-height: 1.2; color: #fff; }
.dash-hero-text { max-width: 520px; margin: 0 0 20px; font-size: .95rem; }
.dash-hero .referral-box { max-width: 640px; }
.dash-hero .referral-box input { border-color: rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .08); color: #fff; }
.dash-hero .referral-box input:focus { border-color: var(--gold-300); outline: none; }
.dash-hero .referral-actions { margin-top: 12px; }

.referral-box { display: flex; gap: 10px; }
.referral-box input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fcfaf5;
  color: var(--ink);
  font: inherit;
  font-size: .9rem;
  text-overflow: ellipsis;
}
.referral-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--forest);
  font: inherit;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease;
}
.copy-btn:hover { border-color: var(--forest); background: #fff; }
.copy-btn .icon { width: 1em; height: 1em; }

/* Membership card */
.id-card {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 20px 22px;
  border: 1px solid rgba(233, 201, 131, .8);
  border-radius: 18px;
  background: linear-gradient(150deg, #fffdf8 0%, var(--sand) 100%);
  color: var(--ink);
  box-shadow: 0 22px 44px -20px rgba(0, 0, 0, .6);
}
.id-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: repeating-radial-gradient(circle at 100% 0%, transparent 0 22px, rgba(210, 155, 58, .16) 22px 23px);
  -webkit-mask-image: radial-gradient(circle at 100% 0%, #000 0, transparent 60%);
  mask-image: radial-gradient(circle at 100% 0%, #000 0, transparent 60%);
}
.id-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.id-card-logo { width: auto; height: 32px; }
.id-card-status { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; background: #e5f2e1; color: #1f5a2a; font-size: .74rem; font-weight: 700; }
.id-card-status--off { background: #f8ebcd; color: #85570f; }
.id-card-status--off .status-dot { background: var(--gold); }
.id-card-label { font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.id-card-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.id-card-id { font-size: 1.85rem; font-weight: 800; line-height: 1.25; letter-spacing: .04em; font-variant-numeric: tabular-nums; color: var(--forest-900); }
.id-card-name { font-weight: 600; }
.id-card-foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; margin: 14px 0 0; padding-top: 12px; border-top: 1px dashed var(--line); font-size: .86rem; }
.id-card-foot dd { margin: 0; font-weight: 600; color: var(--forest-900); }
.id-card-designation { grid-column: 1 / -1; }
.id-card-foot .id-card-designation dd { margin-top: 3px; }
.designation-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 9px; border-radius: 999px; background: linear-gradient(145deg, var(--gold-300), var(--gold)); color: var(--forest-900); font-size: .84rem; font-weight: 800; }
.designation-chip .icon { width: 15px; height: 15px; }
.id-card-foot dd.designation-none, .profile-list dd.designation-none { color: var(--muted); font-weight: 500; }
.id-card-foot dd.id-card-progress { display: grid; gap: 5px; margin-top: 8px; color: var(--muted); font-size: .78rem; font-weight: 600; }
.id-card-track { height: 6px; overflow: hidden; border-radius: 999px; background: var(--sand-2); }
.id-card-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold-300), var(--gold)); }

/* Stats: each card has its own earthy accent (--accent), an icon tile with survey-map
   contour rings spreading behind it, and an accent line along the bottom edge. */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-card {
  --accent: var(--leaf);
  --accent-ink: #2f5a24;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 20px 22px 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(165deg, #fff 40%, color-mix(in srgb, var(--accent) 7%, #fff) 100%);
  box-shadow: var(--card-shadow);
}
.stat-card--forest { --accent: var(--forest); --accent-ink: var(--forest); }
.stat-card--gold { --accent: var(--gold); --accent-ink: #85570f; }
.stat-card--soil { --accent: #a0663a; --accent-ink: #7a4521; }
.stat-card::before {
  content: "";
  position: absolute;
  top: -52px;
  right: -50px;
  z-index: -1;
  width: 190px;
  height: 190px;
  background: repeating-radial-gradient(circle, transparent 0 13px, color-mix(in srgb, var(--accent) 24%, transparent) 13px 14px);
  -webkit-mask-image: radial-gradient(circle, #000 0, transparent 68%);
  mask-image: radial-gradient(circle, #000 0, transparent 68%);
  opacity: .75;
}
.stat-card::after { content: ""; position: absolute; left: 22px; bottom: 0; width: 34px; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); }
.stat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.stat-label { padding-top: 5px; font-size: .7rem; font-weight: 700; line-height: 1.4; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.stat-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 80%, #fff), var(--accent));
  color: #fff;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 12%, transparent), 0 10px 18px -10px var(--accent);
}
.stat-card--forest .stat-icon { color: var(--gold-300); }
.stat-card--gold .stat-icon { color: var(--forest-900); }
.stat-icon .icon { width: 21px; height: 21px; }
/* account.js shrinks a value that doesn't fit on one line, such as ₹1,43,00,000. */
.stat-value { font-size: 2.35rem; font-weight: 800; line-height: 1.05; letter-spacing: -.03em; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--forest-900); }
.stat-sub { align-self: flex-start; margin-top: 10px; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 11%, #fff); color: var(--accent-ink); font-size: .76rem; font-weight: 600; }

/* Dashboard cards: icon tile beside the title, dashed rule under the header */
.dash-card { display: flex; flex-direction: column; }
.dash-card .card-head { align-items: center; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px dashed var(--line); }
.card-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--leaf-soft); color: var(--forest); }
.card-icon .icon { width: 20px; height: 20px; }
.card-head-text { flex: 1; min-width: 0; }

/* Team by level: numbered badge, name, bar and count per level; gold for the member's directs */
.level-bars { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.level-row {
  display: grid;
  grid-template-columns: 30px 70px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 12px;
  margin: 0 -10px;
  padding: 8px 10px;
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
}
a.level-row:hover { background: var(--sand); }
.level-badge { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--forest); color: var(--gold-300); font-size: .8rem; font-weight: 800; }
.is-direct .level-badge { background: var(--gold); color: var(--forest-900); }
.level-name { font-size: .88rem; font-weight: 600; white-space: nowrap; }
.level-track { overflow: hidden; height: 10px; border-radius: 99px; background: var(--sand-2); }
.level-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--forest-700), var(--leaf)); }
.is-direct .level-track span { background: linear-gradient(90deg, #c08a2c, var(--gold-300)); }
.level-count { font-size: 1rem; font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; color: var(--forest-900); }

/* Before anyone joins: the first three levels drawn as dotted plot lines */
.level-bars--ghost { margin-bottom: 18px; }
.level-bars--ghost .level-row { opacity: .6; }
.level-bars--ghost .level-badge { background: var(--sand-2); color: var(--muted); }
.level-bars--ghost .is-direct .level-badge { background: #f6e7c5; color: #85570f; }
.level-bars--ghost .level-track { height: 4px; background: repeating-linear-gradient(90deg, #d8ccb3 0 8px, transparent 8px 14px); }
.level-bars--ghost .level-count { color: var(--muted); }
.level-empty { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-top: auto; padding: 14px 16px; border-radius: 14px; background: var(--sand); font-size: .88rem; color: var(--muted); }
.level-empty p { flex: 1 1 220px; margin: 0; }
.level-empty strong { color: var(--forest-900); }

/* Newest in your team, before anyone joins: member dots orbit the team on dashed contour rings */
.dash-empty { display: grid; justify-items: center; gap: 12px; margin: auto 0; padding: 4px 12px; font-size: .9rem; text-align: center; color: var(--muted); }
.dash-empty p { max-width: 320px; margin: 0; }
.team-radar { position: relative; display: grid; place-items: center; width: 132px; height: 132px; }
.team-radar::before,
.team-radar::after { content: ""; position: absolute; border: 1.5px dashed rgba(210, 155, 58, .55); border-radius: 50%; }
.team-radar::before { inset: 0; }
.team-radar::after { inset: 24px; border-color: rgba(79, 127, 64, .35); }
.team-radar-core { position: relative; z-index: 1; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: linear-gradient(145deg, var(--forest-700), var(--forest-900)); color: var(--gold-300); box-shadow: 0 0 0 6px var(--leaf-soft), 0 12px 24px -12px rgba(18, 38, 27, .7); }
.team-radar-core .icon { width: 24px; height: 24px; }
.team-radar-orbit { position: absolute; inset: 0; animation: radar-spin 26s linear infinite; }
.team-radar-orbit span { position: absolute; top: 50%; left: 50%; width: 16px; height: 16px; margin: -8px; border: 2px solid #fff; border-radius: 50%; background: var(--gold-300); box-shadow: 0 2px 6px rgba(18, 38, 27, .25); transform: rotate(var(--a)) translateX(66px); }
.team-radar-orbit span:nth-child(1) { --a: -50deg; }
.team-radar-orbit span:nth-child(2) { --a: 70deg; width: 12px; height: 12px; margin: -6px; background: var(--leaf); }
.team-radar-orbit span:nth-child(3) { --a: 190deg; width: 13px; height: 13px; margin: -6.5px; background: #b5d0a6; transform: rotate(var(--a)) translateX(42px); }
@keyframes radar-spin { to { transform: rotate(360deg); } }

/* People */
.person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person-text { display: grid; min-width: 0; line-height: 1.35; }
.person-text strong { overflow: hidden; font-weight: 700; color: var(--forest-900); text-overflow: ellipsis; white-space: nowrap; }
.person-text small { font-size: .8rem; color: var(--muted); }
.person-list { display: grid; margin: 0; padding: 0; list-style: none; }
.person-list .person { padding: 12px 0; border-bottom: 1px solid var(--line); }
.person-list .person:first-child { padding-top: 0; }
.person-list .person:last-child { padding-bottom: 0; border-bottom: 0; }
.person-list .person-text { flex: 1; }
.level-pill { display: inline-flex; padding: 3px 10px; border-radius: 999px; background: var(--sand-2); color: var(--forest); font-size: .74rem; font-weight: 700; white-space: nowrap; }
.level-pill--direct { background: #f8ebcd; color: #85570f; }
.level-pill--on { background: #e5f2e1; color: #1f5a2a; }
.avatar--gold { background: var(--gold-300); color: var(--forest-900); }

/* Empty states */
.empty { display: grid; justify-items: center; gap: 10px; padding: 18px 16px 6px; font-size: .92rem; text-align: center; color: var(--muted); }
.empty p { max-width: 400px; margin: 0; }
.empty strong { color: var(--forest-900); }
.empty a:not(.btn) { font-weight: 700; color: var(--leaf); }
.empty .btn { margin-top: 4px; }
.empty-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--leaf-soft); color: var(--forest); }
.empty-icon .icon { width: 22px; height: 22px; }
.empty--large { padding: clamp(40px, 6vw, 72px) 24px; }
.empty--large h2 { margin: 4px 0 0; font-size: 1.35rem; }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 6px; }

/* Team list */
.team-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.team-filters { display: flex; flex: 1 1 auto; flex-wrap: wrap; align-items: center; gap: 10px; }
.team-search { flex: 0 1 auto; width: 300px; min-width: 0; }
.team-filters input,
.team-filters select {
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background-color: #fcfaf5;
  color: var(--ink);
  font: inherit;
  font-size: .9rem;
}
.team-search input { width: 100%; padding-left: 44px; }
.team-filters select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b675e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}
.team-filters input:focus,
.team-filters select:focus { border-color: var(--leaf); background-color: #fff; box-shadow: 0 0 0 4px rgba(79, 127, 64, .15); outline: none; }
.team-clear { font-size: .88rem; font-weight: 700; color: var(--leaf); }
.team-count { margin: 0; font-size: .88rem; color: var(--muted); }
.team-count strong { color: var(--forest-900); }

/* Member dashboard: one card per purchase, with what is paid and the next EMI */
.purchases { display: grid; gap: 14px; min-width: 0; }
.purchases-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; padding: 0 4px; }
.purchases-head h2 { margin: 0; font-size: 1.08rem; }
.purchase-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.purchase-card { display: flex; flex-direction: column; gap: 18px; min-width: 0; padding: 20px 22px 22px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--card-shadow); }
.purchase-top { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px dashed var(--line); }
.purchase-title { flex: 1; min-width: 0; }
.purchase-title h3 { margin: 0; font-size: 1.05rem; font-weight: 800; line-height: 1.3; color: var(--forest-900); }
.purchase-title p { margin: 2px 0 0; font-size: .84rem; color: var(--muted); }
.purchase-label,
.purchase-figures dt { display: block; font-size: .7rem; font-weight: 700; line-height: 1.4; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.purchase-figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin: 0; }
.purchase-figures dd { margin: 4px 0 0; font-size: 1rem; font-weight: 600; line-height: 1.25; font-variant-numeric: tabular-nums; color: var(--forest-900); overflow-wrap: anywhere; }
.purchase-amount dd { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; }
.purchase-progress { display: grid; gap: 8px; }
.purchase-progress-text { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; font-size: .88rem; color: var(--muted); }
.purchase-progress-text strong { font-variant-numeric: tabular-nums; color: var(--forest-900); }
.purchase-progress small { font-size: .8rem; color: var(--muted); }
.purchase-track { height: 8px; }
.purchase-plan p { margin: 4px 0 0; font-size: .9rem; color: var(--ink); }
.purchase-next { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; margin-top: auto; padding: 14px 16px; border-radius: 14px; background: var(--sand); }
.purchase-next strong { display: block; margin-top: 2px; font-size: 1.12rem; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; color: var(--forest-900); }
.purchase-due { text-align: right; }
.purchase-due strong { font-size: .95rem; font-weight: 700; }
.purchase-next.is-overdue { background: #fdecea; }
.purchase-next.is-overdue .purchase-due strong,
.purchase-next.is-overdue .purchase-due .purchase-label { color: #a1271b; }

/* Admin: record a sale */
.sale-alert { margin: 0 0 18px; }
.card--narrow { width: 100%; max-width: 560px; }
.sale-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.sale-form .field--wide { grid-column: 1 / -1; }
.sale-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; grid-column: 1 / -1; }
.sale-summary { margin: 0; font-size: .92rem; font-weight: 700; color: var(--forest); }
.field-hint { font-size: .78rem; color: var(--muted); }
.team-table td[data-label="Joined"] { white-space: nowrap; }
.table-scroll { overflow-x: auto; }
.table-actions .btn { white-space: nowrap; }
.secret-value { white-space: nowrap; }
@media (min-width: 761px) {
  .team-table--dense th, .team-table--dense td { padding-right: 10px; padding-left: 10px; }
  .team-table--dense th:first-child, .team-table--dense td:first-child { padding-left: 22px; }
  .team-table--dense th:last-child, .team-table--dense td:last-child { padding-right: 22px; }
}
@media (min-width: 1241px) {
  .team-table--dense .person-text small { white-space: nowrap; }
}
}
.team-table .person-text strong { white-space: normal; }
.table-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.table-actions form { margin: 0; }
.table-actions .btn-sm { padding: .5em .95em; font-size: .8rem; }
.table-name { color: inherit; text-decoration: none; }
.table-name:hover { color: var(--leaf); text-decoration: underline; }
.level-pill--blocked { background: #fdecea; color: #a1271b; }
.level-pill--leader { background: var(--forest); color: var(--gold-300); }
.person-text .level-pill--leader { justify-self: start; margin-top: 4px; }
.member-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
.member-actions form { margin: 0; }

/* Record a sale: fields beside a live summary */
.sale-entry { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: 24px; align-items: start; }
.sale-fields { display: grid; gap: 20px; min-width: 0; }
.sale-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.sale-group legend { margin-bottom: 12px; padding: 0; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sale-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.sale-grid--one { grid-template-columns: minmax(0, 1fr); }
.sale-summary-card { position: sticky; top: 20px; display: grid; gap: 16px; padding: 22px; border-radius: 16px; background: var(--forest); color: #fff; box-shadow: var(--shadow-sm); }
.sale-summary-card h3 { margin: 0; font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-300); }
.sale-summary-body { display: grid; gap: 12px; }
.sale-summary-empty { margin: 0; font-size: .92rem; color: rgba(255, 255, 255, .72); }
.sale-summary-list { display: grid; margin: 0; }
.sale-summary-list > div { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 2px 12px; padding: 11px 0; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.sale-summary-list > div:first-child { padding-top: 0; }
.sale-summary-list > div:last-of-type { border-bottom: 0; }
.sale-summary-list dt { font-size: .86rem; color: rgba(255, 255, 255, .72); }
.sale-summary-list dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sale-summary-list small { grid-column: 1 / -1; font-size: .78rem; text-align: right; color: rgba(255, 255, 255, .6); }
.sale-summary-total dd { font-size: 1.6rem; line-height: 1.15; color: #fff; }
.sale-summary-emi dd { font-size: 1.3rem; line-height: 1.2; color: var(--gold-300); }
.sale-summary-warning { margin: 0; padding: 10px 12px; border-radius: 10px; background: #fdecea; font-size: .86rem; font-weight: 600; color: #a1271b; }
@media (max-width: 1240px) {
  .sale-entry { grid-template-columns: minmax(0, 1fr); }
  .sale-summary-card { position: static; }
}
@media (max-width: 760px) { .sale-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .sale-grid { grid-template-columns: minmax(0, 1fr); } }

/* Company bank details */
.bank-list dd { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.bank-value { overflow-wrap: anywhere; }
.bank-qr { display: grid; justify-items: center; text-align: center; }
.bank-qr .card-text { margin-bottom: 0; }
.bank-qr-image { display: block; width: min(100%, 260px); height: auto; margin: 16px 0 10px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.bank-qr-id { margin: 0 0 14px; font-weight: 700; color: var(--forest-900); overflow-wrap: anywhere; }
.bank-qr-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
/* A upi:// link only does something on a phone. */
@media (hover: hover) and (pointer: fine) { .bank-upi-link { display: none; } }

/* Withdraw */
.withdraw-open { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 14px 16px; border: 1px dashed var(--gold-300); border-radius: 14px; background: #fffaf0; }
.withdraw-open p { margin: 0; }
.withdraw-open form { margin: 0; }
.withdraw-form .withdraw-to { grid-column: span 2; gap: 4px; }
.field-label { font-size: .88rem; font-weight: 600; color: var(--forest-900); }
.bank-form { margin-top: 0; }

/* Withdrawal requests on the Payments page */
.payout-list { display: grid; gap: 14px; }
.payout { display: grid; gap: 14px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: #fffdf8; }
.payout-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.payout-amount { display: grid; justify-items: end; line-height: 1.3; }
.payout-amount strong { font-size: 1.3rem; color: var(--forest-900); }
.payout-amount small { font-size: .8rem; color: var(--muted); }
.payout-warning { display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 12px; border-radius: 10px; background: #fdecea; color: #a1271b; font-size: .88rem; font-weight: 600; }
.payout-warning .icon { flex: none; width: 1em; height: 1em; }
.payout-bank { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 18px; margin: 0; }
.payout-bank dt { font-size: .76rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.payout-bank dd { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 2px 0 0; font-weight: 700; color: var(--forest-900); overflow-wrap: anywhere; }
.payout-bank code { font-family: inherit; font-size: .95rem; letter-spacing: .02em; }
.payout-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.payout-pay, .payout-reject form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.payout-actions input { padding: .5em .7em; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font: inherit; font-size: .86rem; }
.payout-actions input[type="text"] { width: 220px; max-width: 100%; }
.payout-actions input:focus { border-color: var(--leaf); box-shadow: 0 0 0 4px rgba(79, 127, 64, .15); outline: none; }
.payout-reject { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.payout-reject summary { list-style: none; cursor: pointer; }
.payout-reject summary::-webkit-details-marker { display: none; }
.payout-reject[open] summary { display: none; }
@media (max-width: 760px) {
  .payout-amount { justify-items: start; }
  .withdraw-form .withdraw-to { grid-column: 1 / -1; }
  .payout-actions input[type="text"] { width: 100%; }
}

/* Income ledger */
.ledger-credit strong { color: #1f5a2a; }
.ledger-opening td { background: var(--sand); }
.ledger-debit strong { color: #a1271b; }
.ledger-payment td { background: #fdfbf7; }
.payment-form { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-card--link { color: inherit; text-decoration: none; }

/* Password on the admin members list, hidden until its eye is clicked */
.secret { display: inline-flex; align-items: center; gap: 6px; }
.secret-value { font-family: inherit; font-size: .86rem; font-weight: 600; overflow-wrap: anywhere; }
.secret-toggle { display: grid; place-items: center; flex: none; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.secret-toggle:hover { background: var(--sand); color: var(--forest); }
.secret-toggle .icon { width: 16px; height: 16px; }
.secret-toggle .icon-hide, .secret-toggle[aria-pressed="true"] .icon-show { display: none; }
.secret-toggle[aria-pressed="true"] .icon-hide { display: block; }

/* Support */
.nav-badge { display: grid; place-items: center; min-width: 20px; height: 20px; margin-left: auto; padding: 0 6px; border-radius: 999px; background: var(--gold); color: var(--forest-900); font-size: .72rem; font-weight: 800; line-height: 1; }
.ticket-list { display: grid; margin: 0; padding: 0; list-style: none; }
.ticket-list li + li { border-top: 1px solid var(--line); }
.ticket-row { display: flex; align-items: center; gap: 12px; padding: 14px 22px; color: inherit; text-decoration: none; transition: background-color .2s ease; }
.ticket-row:hover { background: #fdfbf7; }
.ticket-row .person-text { flex: 1; min-width: 0; }
.ticket-row .person-text strong { white-space: normal; }
.ticket-thread { display: grid; gap: 12px; margin: 14px 0 0; padding: 0; list-style: none; }
.ticket-message { justify-self: start; width: min(100%, 620px); padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--sand); }
.ticket-message--mine { justify-self: end; border-color: rgba(79, 127, 64, .35); background: var(--leaf-soft); }
.ticket-meta { display: block; margin-bottom: 4px; font-size: .78rem; color: var(--muted); }
.ticket-meta strong { color: var(--forest-900); }
.ticket-body { font-size: .93rem; line-height: 1.55; overflow-wrap: anywhere; }
.ticket-reply { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.card--narrow-wide { width: 100%; max-width: 820px; }

/* Sub-admin access */
.access-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.access-quick .btn-sm { padding: .5em .95em; font-size: .8rem; }
.access-group { display: grid; gap: 4px; margin: 0 0 14px; padding: 0 0 14px; border: 0; border-bottom: 1px solid var(--line); }
.access-group legend { padding: 0; margin-bottom: 8px; font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.access-item { display: flex; align-items: flex-start; gap: 10px; padding: 7px 8px; border-radius: 10px; font-size: .92rem; font-weight: 600; color: var(--forest-900); cursor: pointer; }
.access-item:hover { background: var(--sand); }
.access-item input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--forest); }
.access-pills { display: flex; flex-wrap: wrap; gap: 4px; max-width: 420px; }
.access-pills .level-pill { white-space: normal; }
.sub-fields { margin-top: 0; }

/* Monthly EMI */
.emi-alert { margin: 16px 22px 0; }
.emi-paid { display: grid; gap: 5px; min-width: 80px; font-weight: 700; color: var(--forest-900); }
.emi-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.emi-actions form { margin: 0; }
.emi-form { display: flex; align-items: center; gap: 6px; }
.emi-form input[type="date"] { width: 138px; padding: .42em .55em; border: 1px solid var(--line); border-radius: 10px; background: #fffdf8; color: var(--ink); font: inherit; font-size: .82rem; }
.emi-actions .btn-sm { padding: .5em .95em; font-size: .8rem; }
.team-table td[data-label="Next EMI"] .level-pill { margin-top: 4px; }

/* Shown while an admin is viewing a member's panel */
.view-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px clamp(16px, 3.2vw, 40px); background: #f8ebcd; color: #5f3f0b; font-size: .9rem; }
.view-banner > span { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.view-banner .icon { width: 18px; height: 18px; }
.view-banner form { margin: 0; }

/* Plan ladder on the member dashboard */
.plan-ladder { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.plan-step { display: grid; grid-template-columns: 34px minmax(0, 1.3fr) minmax(0, .8fr) minmax(0, 1.2fr); align-items: center; gap: 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.plan-num { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--sand-2); color: var(--forest); font-size: .86rem; font-weight: 800; }
.plan-num .icon { width: 17px; height: 17px; }
.plan-name { display: grid; min-width: 0; line-height: 1.35; }
.plan-name strong { font-size: .94rem; color: var(--forest-900); }
.plan-name small { font-size: .8rem; color: var(--muted); }
.plan-earns { font-size: .88rem; font-weight: 700; color: var(--forest); }
.plan-status { justify-self: end; width: 100%; text-align: right; }
.plan-progress { display: grid; gap: 5px; text-align: left; }
.plan-progress small { font-size: .78rem; font-weight: 600; color: var(--muted); }
.plan-step--done { background: #f6faf3; }
.plan-step--done .plan-num { background: var(--leaf-soft); color: #1f5a2a; }
.plan-step--current { border-color: var(--gold); background: #fdf6e7; }
.plan-step--current .plan-num { background: linear-gradient(145deg, var(--gold-300), var(--gold)); color: var(--forest-900); }
.plan-step--next { border-style: dashed; border-color: var(--gold); }
.plan-step--later { opacity: .72; }

/* Designations on the admin dashboard */
.admin-levels { display: grid; margin: 0; padding: 0; list-style: none; }
.admin-levels li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.admin-levels li:first-child { padding-top: 0; }
.admin-levels li:last-child { padding-bottom: 0; border-bottom: 0; }
.admin-levels .person-text { flex: 1; }
.admin-level-count { font-size: 1.05rem; font-weight: 800; color: var(--forest-900); }
.admin-levels-rest strong { font-size: .9rem; font-weight: 600; color: var(--muted); }
.admin-levels-rest .admin-level-count { font-size: 1.05rem; font-weight: 800; color: var(--forest-900); }

/* A designation under a name on the tree */
.tree-node .person-text .level-pill, .tree-root .person-text .level-pill { justify-self: start; margin-top: 4px; }

.team-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.team-table th {
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  background: #fcfaf5;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-align: left;
  text-transform: uppercase;
  color: var(--muted);
}
.team-table td { padding: 14px 22px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.team-table tbody tr:last-child td { border-bottom: 0; }
.team-table tbody tr:hover { background: #fdfbf7; }
.table-link { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; color: var(--leaf); text-decoration: none; white-space: nowrap; }
.table-link .icon { width: 16px; height: 16px; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-top: 1px solid var(--line); }
.pager-info { font-size: .86rem; color: var(--muted); }

/* Team tree */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .88rem; color: var(--muted); }
.crumbs a { font-weight: 700; color: var(--leaf); text-decoration: none; }
.crumbs [aria-current] { font-weight: 700; color: var(--forest-900); }
.crumbs .icon { width: 14px; height: 14px; }

.tree-root { display: flex; align-items: center; gap: 14px; padding-bottom: 18px; border-bottom: 1px dashed var(--line); }
.tree-root .person-text { flex: 1; }
.tree-root .person-text strong { font-size: 1.05rem; }
.tree-root-stat { font-size: .86rem; text-align: right; color: var(--muted); }
.tree-root-stat strong { color: var(--forest-900); }

/* Elbow connectors: each item draws the line into its own card and on to the next sibling. */
.tree, .tree-children { --indent: 24px; margin: 0 0 0 20px; padding: 0 0 0 var(--indent); list-style: none; }
.tree { margin-top: 8px; }
.tree li { position: relative; }
.tree li::before,
.tree li::after { content: ""; position: absolute; left: calc(-1 * var(--indent)); border-color: var(--line); border-style: solid; border-width: 0; }
.tree li::before { top: 0; width: calc(var(--indent) - 6px); height: 35px; border-bottom-width: 1.5px; border-left-width: 1.5px; border-bottom-left-radius: 10px; }
.tree li::after { top: 35px; bottom: 0; border-left-width: 1.5px; }
.tree li:last-child::after { display: none; }

.tree-node {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 600px;
  margin: 8px 0;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  list-style: none;
  transition: border-color .2s ease;
}
.tree-node .person-text { flex: 1; }
summary.tree-node { cursor: pointer; }
summary.tree-node::-webkit-details-marker { display: none; }
summary.tree-node:hover, a.tree-node:hover { border-color: var(--leaf); }
.tree-count { padding: 3px 10px; border-radius: 999px; background: var(--leaf-soft); color: var(--forest); font-size: .74rem; font-weight: 700; white-space: nowrap; }
.tree-toggle { width: 18px; height: 18px; color: var(--muted); transition: transform .2s ease; }
details[open] > summary .tree-toggle { transform: rotate(90deg); }
.tree-node--more .tree-toggle { color: var(--leaf); }
.tree-note { margin: 16px 0 0; font-size: .84rem; color: var(--muted); }

/* Profile */
.profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 6px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.profile-head strong { font-size: 1.3rem; font-weight: 700; letter-spacing: -.01em; white-space: normal; }
.status-dot { display: inline-block; width: 8px; height: 8px; margin: 0 6px 1px 0; border-radius: 50%; background: var(--available); }
.status-dot--off { background: var(--gold); }
.profile-list { display: grid; margin: 0; }
.profile-list div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.profile-list dt { color: var(--muted); }
.profile-list dd { margin: 0; font-weight: 700; text-align: right; overflow-wrap: anywhere; }

/* Add member */
.steps-list { display: grid; gap: 10px; margin: 0; padding-left: 20px; color: var(--muted); }
.steps-list strong { color: var(--forest-900); }
.steps-list a { font-weight: 700; color: var(--leaf); overflow-wrap: anywhere; }

/* ---------- Panel motion ---------- */
/* Lets height animate to and from "auto" (menu group and tree branches below). */
.panel-page { interpolate-size: allow-keywords; }

/* Page changes cross-fade (opted in by layouts/panel.php); the sidebar and the top and bottom bars hold still. */
.panel-top { view-transition-name: panel-top; }
.panel-tabs { view-transition-name: panel-tabs; }
@media (min-width: 1025px) { .panel-side { view-transition-name: panel-side; } }

/* Entrance: blocks rise in one after another; stat cards and column cards stagger inside their row. */
@keyframes panel-rise { from { opacity: 0; transform: translateY(14px); } }
.panel-content > * { --rise-delay: 0s; }
.panel-content > :nth-child(2) { --rise-delay: .07s; }
.panel-content > :nth-child(3) { --rise-delay: .14s; }
.panel-content > :nth-child(n + 4) { --rise-delay: .21s; }
.panel-content > :not(.stat-grid, .panel-columns),
.stat-grid > *,
.panel-columns > * {
  /* "backwards" so the finished animation never overrides hover transforms */
  animation: panel-rise .6s cubic-bezier(.22, .8, .24, 1) backwards;
  animation-delay: calc(var(--rise-delay, 0s) + var(--rise-step, 0) * 60ms);
}
.stat-grid > :nth-child(2), .panel-columns > :nth-child(2) { --rise-step: 1; }
.stat-grid > :nth-child(3) { --rise-step: 2; }
.stat-grid > :nth-child(4) { --rise-step: 3; }

@keyframes bar-grow { from { width: 0; } }
.level-track span, .id-card-track span { animation: bar-grow 1s cubic-bezier(.22, .8, .24, 1) .35s backwards; }

/* Hover */
.stat-card { transition: transform .3s cubic-bezier(.22, .8, .24, 1), box-shadow .3s ease, border-color .3s ease; }
.stat-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); box-shadow: 0 18px 34px -20px color-mix(in srgb, var(--accent) 60%, transparent); }
.stat-card::before { transition: transform .7s cubic-bezier(.22, .8, .24, 1), opacity .4s ease; }
.stat-card:hover::before { transform: scale(1.15); opacity: 1; }
.stat-card::after { transition: width .5s cubic-bezier(.22, .8, .24, 1); }
.stat-card:hover::after { width: calc(100% - 44px); }
.stat-icon { transition: transform .4s cubic-bezier(.22, .8, .24, 1); }
.stat-card:hover .stat-icon { transform: translateY(-2px) rotate(-6deg); }
.id-card { transition: transform .4s cubic-bezier(.22, .8, .24, 1), box-shadow .4s ease; }
.id-card:hover { transform: translateY(-3px); box-shadow: 0 28px 50px -20px rgba(0, 0, 0, .65); }
.card-link .icon, .table-link .icon { transition: transform .2s ease; }
.card-link:hover .icon, .table-link:hover .icon { transform: translateX(3px); }
.team-table tbody tr, .level-row { transition: background-color .2s ease; }

/* Menu group and tree branches slide open and shut (where ::details-content is supported). */
.panel-group::details-content,
.tree details::details-content {
  height: 0;
  overflow-x: visible;
  overflow-y: clip;
  transition: height .32s cubic-bezier(.22, .8, .24, 1), content-visibility .32s allow-discrete;
}
.panel-group[open]::details-content,
.tree details[open]::details-content { height: auto; }

@media (max-width: 1240px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-hero { grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); }
}
@media (max-width: 1100px) {
  .sale-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-columns, .panel-columns--form { grid-template-columns: minmax(0, 1fr); }
  .dash-hero { grid-template-columns: minmax(0, 1fr); }
  .dash-hero .id-card { max-width: 460px; }
}
@media (max-width: 1024px) {
  .panel { grid-template-columns: minmax(0, 1fr); }
  .panel-side {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(290px, 86vw);
    border-right: 0;
    visibility: hidden;
    transform: translateX(-100%);
    transition: transform .3s ease, visibility 0s linear .3s;
  }
  .panel-open .panel-side { visibility: visible; transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .25); transition: transform .3s ease; }
  .panel-scrim { position: fixed; inset: 0; z-index: 35; display: block; background: rgba(10, 22, 15, .45); opacity: 0; pointer-events: none; transition: opacity .3s ease; }
  .panel-open .panel-scrim { opacity: 1; pointer-events: auto; }
  .panel-open { overflow: hidden; }
  .panel-menu,
  .panel-close { display: grid; place-items: center; flex: none; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--forest); cursor: pointer; }
  .panel-menu { width: 42px; height: 42px; }
  .panel-close { width: 38px; height: 38px; }
}
@media (max-width: 760px) {
  .panel-main { padding-bottom: 66px; } /* room for the bottom bar */
  .panel-tabs {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 4px;
    padding: 6px 8px;
    background: #fff;
    box-shadow: 0 -1px 0 var(--line), 0 -12px 28px -20px rgba(18, 38, 27, .45);
  }
  .team-filters { width: 100%; }
  .team-search { flex: 1 1 100%; width: auto; }
  .team-filters select { flex: 1; }
  .team-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .team-table, .team-table tbody, .team-table tr, .team-table td { display: block; }
  .team-table tr { padding: 16px 18px; border-bottom: 1px solid var(--line); }
  .team-table tbody tr:last-child { border-bottom: 0; }
  .team-table td { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 0; border: 0; text-align: right; }
  .team-table td:first-child { padding-bottom: 10px; text-align: left; }
  .team-table td.ledger-text { text-align: left; }
  .team-table td:empty { display: none; }
  .table-actions { justify-content: flex-start; width: 100%; padding-top: 6px; }
  .emi-actions { justify-content: flex-start; width: 100%; padding-top: 6px; }
  .emi-form { flex: 1 1 100%; }
  .emi-form input[type="date"] { flex: 1; width: auto; }
  .team-table td .emi-paid { width: 120px; text-align: right; }
  .team-table td[data-label]::before { content: attr(data-label); font-size: .8rem; font-weight: 700; text-align: left; color: var(--muted); }
}
@media (max-width: 560px) {
  .panel-top { gap: 12px; min-height: 64px; padding: 10px 16px; }
  .panel-title { font-size: 1.15rem; }
  .panel-actions .btn { padding: .7em; }
  .panel-actions .btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .panel-content { gap: 16px; padding: 16px 16px 36px; }
  .panel-columns, .panel-stack { gap: 16px; }
  .panel-foot { padding: 0 16px 22px; }
  .dash-hero { padding: 20px; border-radius: 18px; }
  .dash-hero-text { margin-bottom: 16px; }
  .referral-box { flex-direction: column; }
  .referral-actions .btn { flex: 1 1 auto; }
  .sale-form { grid-template-columns: minmax(0, 1fr); }
  .plan-step { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 8px 12px; padding: 10px 12px; }
  .plan-earns { grid-column: 2; grid-row: 2; font-size: .82rem; }
  .plan-status { grid-column: 3; grid-row: 1 / span 2; width: auto; }
  .plan-step--next .plan-status { grid-column: 2 / -1; grid-row: 3; width: 100%; }
  .unit-note { padding: 12px 16px; }
  .unit-note-sum { display: none; }
  .stat-grid { gap: 12px; }
  .stat-card { padding: 16px 16px 18px; }
  .stat-card::before { top: -58px; right: -58px; width: 160px; height: 160px; }
  .stat-card::after { left: 16px; }
  .stat-top { margin-bottom: 10px; }
  .stat-icon { width: 38px; height: 38px; border-radius: 12px; }
  .stat-icon .icon { width: 18px; height: 18px; }
  .stat-label { padding-top: 2px; font-size: .62rem; letter-spacing: .1em; }
  .stat-value { font-size: 1.75rem; }
  .stat-sub { padding: 2px 8px; font-size: .72rem; }
  .level-row { grid-template-columns: 28px 60px minmax(0, 1fr) 32px; gap: 10px; }
  .id-card { padding: 18px; }
  .id-card-id { font-size: 1.6rem; }
  .tree, .tree-children { --indent: 16px; margin-left: 10px; }
  .tree-node { gap: 10px; padding: 8px 10px; }
  .tree-node .avatar { display: none; }
  .tree li::before { height: 28px; }
  .tree li::after { top: 28px; }
  .tree-root { flex-wrap: wrap; }
  .tree-root-stat { flex-basis: 100%; text-align: left; }
}
@media (max-width: 360px) {
  .panel-tabs { gap: 2px; padding: 6px 4px; }
  .panel-tabs > a, .panel-tabs summary { padding-right: 0; padding-left: 0; font-size: .63rem; }
}

/* ==========================================================================
   Coming soon (home page while Config\Site::$comingSoon is on)
   ========================================================================== */
.soon-page {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  padding: 0 max(16px, 4vw);
  background: var(--forest-900);
  color: #fff;
}
.soon-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.soon-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(18, 38, 27, .55), rgba(18, 38, 27, .88) 70%),
    linear-gradient(180deg, rgba(18, 38, 27, .55), rgba(18, 38, 27, .2) 40%, rgba(18, 38, 27, .85));
}

.soon-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0;
}
.soon-top .btn { white-space: nowrap; }
/* The logo's green tagline needs a light backdrop. */
.soon-brand { display: inline-flex; padding: 10px 16px; border-radius: 14px; background: var(--sand); box-shadow: var(--shadow-sm); }
.soon-brand .brand-logo { height: 44px; }

.soon-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(760px, 100%);
  margin-inline: auto;
  padding: 48px 0 64px;
  text-align: center;
}
.soon-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 28px;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  backdrop-filter: blur(6px);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold-300);
}
.soon-main h1 { margin-bottom: .4em; font-size: clamp(2.5rem, 7vw, 4.8rem); color: #fff; }
.soon-main h1 em { font-style: italic; color: var(--gold-300); }
.soon-lead { max-width: 560px; margin: 0 0 36px; font-size: clamp(1.02rem, 2.2vw, 1.15rem); color: rgba(255, 255, 255, .85); }

.soon-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.soon-mail { display: inline-flex; align-items: center; gap: 8px; margin: 26px 0 0; color: rgba(255, 255, 255, .8); }
.soon-mail a { text-decoration-color: rgba(255, 255, 255, .4); text-underline-offset: 3px; }
.soon-mail a:hover { color: #fff; text-decoration-color: currentColor; }

.soon-foot { padding: 20px 0 24px; font-size: .85rem; text-align: center; color: rgba(255, 255, 255, .6); }
.soon-foot p { margin: 0; }

@media (max-width: 520px) {
  .soon-top { padding: 16px 0; }
  .soon-brand { padding: 8px 12px; }
  .soon-brand .brand-logo { height: 34px; }
  .soon-actions { flex-direction: column; width: 100%; }
  .soon-actions .btn { width: 100%; }
}

/* ==========================================================================
   Reveal on scroll
   ========================================================================== */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
/* Separate rule: browsers that don't know ::details-content would drop the whole list above. */
@media (prefers-reduced-motion: reduce) {
  ::details-content { transition: none !important; }
}
