/* ==========================================================================
   IndiaMBA — landing page
   Design language: the CAT admission ticket / OMR answer sheet.
   Paper base, ink text, drop-out-blue structural rules, one invigilator-red
   accent spent deliberately. Space Grotesk for headlines and all numerals;
   IBM Plex Sans for body copy.
   ========================================================================== */

:root {
  --paper: #f3f2ea;
  --paper-deep: #ebe9df;
  --card: #fbfaf5;
  --ink: #171e1b;
  --ink-soft: #454f49;
  --muted: #6b756e;
  --line: #d7d5c8;
  --guide: #7c93a6;
  --guide-soft: #e4eaee;
  --exam-blue: #2c4257;
  --exam-blue-raised: #35506a;
  --mark: #b23a2e;
  --mark-soft: #f3ded9;
  --white: #ffffff;

  --font-display: "Space Grotesk", "Segoe UI", Helvetica, Arial, sans-serif;
  --font-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --radius: 3px;
  --shadow-card: 0 1px 0 var(--line), 0 10px 24px -18px rgba(23, 30, 27, .4);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  background: var(--paper);
}

/* scroll-padding-top above isn't reliably honored on every mobile browser
   (seen clipping the heading under the sticky header on Brave/Android).
   scroll-margin-top on the actual jump targets is the more robustly
   supported mechanism for anchor navigation, so set it explicitly on
   every section a nav link or hash can land on: #archive, #leaderboard,
   #stories, #discussion. 96px clears .site-header at every breakpoint. */
#archive, #leaderboard, #stories, #discussion {
  scroll-margin-top: 96px;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::selection { color: var(--paper); background: var(--exam-blue); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.12;
}

p { margin: 0; color: var(--ink-soft); }

a { color: inherit; text-decoration: none; }

strong, b { font-weight: 600; }

img, svg { display: block; max-width: 100%; }

button { font: inherit; color: inherit; cursor: pointer; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--exam-blue);
  color: var(--paper);
  padding: 12px 18px;
  z-index: 200;
}
.skip-link:focus { left: 12px; top: 12px; }

:focus-visible {
  outline: 2px solid var(--exam-blue);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

.page-shell { min-height: 100vh; }

/* ---------------------------------- setup notice ---------------------------------- */

.setup-notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 20px;
  background: var(--exam-blue);
  color: var(--paper);
  font-size: 13px;
}
.setup-notice .setup-icon {
  flex: 0 0 20px;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border: 1px solid rgba(243,242,234,.5);
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 12px;
}
.setup-notice strong { display: block; }
.setup-notice p { margin: 2px 0 0; color: rgba(243,242,234,.82); font-size: 12.5px; }

/* ---------------------------------- header ---------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(243, 242, 234, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.header-inner {
  width: min(calc(100% - 40px), 1240px);
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 0 auto;
}

.brand { display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand-mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: var(--exam-blue);
  color: var(--paper);
  border-radius: 2px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .02em;
}
.brand-name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -.02em;
}
.brand-name span { color: var(--mark); }

.origin-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 6px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: 13px;
  color: var(--ink-soft);
  background: var(--card);
  flex: 0 0 auto;
}
.origin-badge .reddit-glyph {
  display: grid; place-items: center;
  width: 20px; height: 20px;
  background: var(--exam-blue-raised);
  color: var(--paper);
  border-radius: 50%;
  font-size: 11px;
  font-family: var(--font-display);
}

.desktop-nav { display: flex; gap: 26px; margin-left: 8px; }
.desktop-nav a { font-size: 14.5px; color: var(--ink-soft); }
.desktop-nav a:hover { color: var(--ink); }

.header-account { margin-left: auto; display: flex; align-items: center; }

.account-summary { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  background: var(--exam-blue);
  color: var(--paper);
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 600;
}
.user-avatar-small { width: 30px; height: 30px; font-size: 12px; }
.user-copy { display: flex; flex-direction: column; line-height: 1.25; }
.user-copy small { font-size: 11px; color: var(--muted); }
.user-copy strong { font-size: 14px; }
.header-portal-link {
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 12px;
  border: 1px solid var(--ink);
  border-radius: 2px;
}
.logout-button {
  background: none; border: none;
  font-size: 13px; color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------------------------------- buttons ---------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -.005em;
  border: 1px solid transparent;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.button:active { transform: translateY(1px); }

.button-primary { background: var(--mark); color: var(--paper); }
.button-primary:hover { background: #9c3125; }

.button-ink { background: var(--ink); color: var(--paper); }
.button-ink:hover { background: #2a332e; }

.button-ghost { background: transparent; border-color: var(--ink); color: var(--ink); }
.button-ghost:hover { background: var(--ink); color: var(--paper); }

.button-outline { background: transparent; border-color: var(--line); color: var(--ink); }
.button-outline:hover { border-color: var(--ink); }

.button-small { padding: 9px 14px; font-size: 13px; }
.button-full { width: 100%; }

.plain-button {
  background: none; border: none;
  font-size: 13.5px; color: var(--muted);
  text-decoration: underline; text-underline-offset: 3px;
  padding: 4px 0;
}

.text-link {
  display: inline-block;
  font-weight: 600;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
}

/* ---------------------------------- layout helpers ---------------------------------- */

.section { padding: 88px 0; }
.section > * { width: min(calc(100% - 40px), 1240px); margin: 0 auto; }
.section-dark { background: var(--exam-blue); color: var(--paper); }

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  margin-bottom: 44px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.section-heading-wide { align-items: flex-start; }
.section-heading h2 { font-size: clamp(26px, 3vw, 34px); max-width: 16ch; }
.section-heading p { max-width: 34ch; font-size: 15px; }
.section-heading-light { border-top-color: rgba(243,242,234,.2); }
.section-heading-light h2 { color: var(--paper); }
.section-heading-light p { color: rgba(243,242,234,.72); }

.data-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
  letter-spacing: .02em;
}

/* ---------------------------------- hero ---------------------------------- */

.hero {
  width: min(calc(100% - 40px), 1240px);
  margin: 0 auto;
  padding: 56px 0 80px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 360px);
  gap: 56px;
  align-items: start;
}

.community-origin {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 22px;
}
.origin-dot {
  display: grid; place-items: center;
  width: 20px; height: 20px;
  background: var(--exam-blue-raised);
  color: var(--paper);
  border-radius: 50%;
  font-size: 10.5px;
  font-family: var(--font-display);
}

.hero-copy h1 {
  font-size: clamp(36px, 5vw, 58px);
  margin-bottom: 22px;
}

.hero-lede {
  font-size: 17px;
  max-width: 46ch;
  margin-bottom: 32px;
}

.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 36px; }
.hero-welcome { font-size: 14px; color: var(--muted); }

.hero-principles {
  list-style: none;
  margin: 0; padding: 20px 0 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
}
.hero-principles li {
  position: relative;
  padding-left: 16px;
  font-size: 14px;
  color: var(--ink-soft);
}
.hero-principles li::before {
  content: "";
  position: absolute;
  left: 0; top: 7px;
  width: 7px; height: 7px;
  background: var(--mark);
  border-radius: 50%;
}

/* hall ticket */

.hall-ticket {
  background: var(--card);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.hall-ticket-main { padding: 26px 26px 22px; }
.hall-ticket-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.hall-ticket-label {
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--muted);
}
.hall-ticket-code {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  padding: 5px 10px;
  border: 1px solid var(--ink);
  border-radius: 2px;
}
.hall-ticket h2 {
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  font-family: var(--font-body);
  margin-bottom: 10px;
}
.exam-date {
  display: block;
  margin-bottom: 22px;
  font-family: var(--font-display);
}
.exam-date span { display: block; font-size: 14px; color: var(--muted); font-family: var(--font-body); }
.exam-date strong { display: block; font-size: 28px; font-weight: 600; line-height: 1.15; }
.exam-date b { display: block; font-size: 15px; color: var(--muted); font-weight: 500; }

.slot-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}
.slot-heading strong { color: var(--ink); font-family: var(--font-display); }

.slot-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0; padding: 0;
}
.slot-list li {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 10px 6px;
  text-align: center;
}
.slot-list strong {
  display: block;
  font-family: var(--font-display);
  font-size: 17px;
}
.slot-list span { font-size: 10.5px; color: var(--muted); }

.hall-ticket-stub {
  border-top: 1px dashed var(--guide);
  padding: 16px 26px 20px;
  background: var(--guide-soft);
}
.slot-note { font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; }

/* ---------------------------------- archive / scoresheet ---------------------------------- */

.archive-board {
  display: grid;
  grid-template-columns: minmax(260px, 380px) 1fr;
  gap: 32px;
  margin-bottom: 56px;
}

.scoresheet {
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--card);
  padding: 4px;
}
.scoresheet-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 22px 20px;
  border-bottom: 1px solid var(--line);
}
.scoresheet-row:nth-child(2) { border-bottom: none; }
.scoresheet-row span { font-size: 13.5px; color: var(--ink-soft); max-width: 16ch; }
.scoresheet-row strong { font-family: var(--font-display); font-size: 30px; }
.scoresheet-row small { font-size: 11.5px; color: var(--muted); }
.scoresheet-row-marked strong { color: var(--mark); }
.archive-disclosure {
  font-size: 11.5px;
  color: var(--muted);
  padding: 10px 20px 14px;
}

.archive-explainer {
  border-left: 2px solid var(--guide);
  padding-left: 28px;
}
.archive-explainer-label { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.archive-explainer h3 { font-size: 21px; margin-bottom: 14px; max-width: 24ch; }
.archive-explainer p { font-size: 14.5px; margin-bottom: 12px; }
.archive-explainer p strong { color: var(--ink); }
.archive-explainer .text-link { margin-top: 6px; }

.archive-rules {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.archive-rules article { background: var(--paper); padding: 26px; }
.archive-rules h3 { font-size: 16px; margin-bottom: 10px; }
.archive-rules p { font-size: 13.5px; }

/* ---------------------------------- practice loop ---------------------------------- */

.practice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.practice-card { background: var(--card); padding: 30px 26px; }
.practice-card-marked { background: var(--guide-soft); }
.practice-index {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
  font-family: var(--font-display);
}
.practice-index b { font-size: 20px; color: var(--ink); }
.practice-card h3 { font-size: 18px; margin-bottom: 10px; }
.practice-card p { font-size: 14px; }

/* ---------------------------------- pricing ---------------------------------- */

.pricing-section { padding-top: 0; }
.pricing-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  padding: 40px 44px;
}
.pricing-copy { max-width: 46ch; }
.pricing-kicker { display: block; font-size: 12.5px; color: rgba(243,242,234,.6); margin-bottom: 10px; }
.pricing-copy h2 { color: var(--paper); font-size: 26px; margin-bottom: 12px; }
.pricing-copy p { color: rgba(243,242,234,.72); font-size: 14.5px; }
.pricing-figure { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.pricing-figure span { font-size: 11.5px; color: rgba(243,242,234,.55); letter-spacing: .03em; }
.pricing-figure strong { font-family: var(--font-display); font-size: 34px; }

/* ---------------------------------- leaderboard ---------------------------------- */

.leaderboard-panel {
  background: rgba(243,242,234,.06);
  border: 1px solid rgba(243,242,234,.16);
  border-radius: var(--radius);
  padding: 4px;
}
.data-panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 20px 22px 16px;
}
.data-panel-heading h3 { font-size: 18px; color: inherit; }
.section-dark .data-label { color: rgba(243,242,234,.68); }

.data-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  flex: 0 0 auto;
}
.section-dark .data-status { color: rgba(243,242,234,.65); }
.data-status i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.data-status[data-state="live"] i { background: #4e9e6f; }
.data-status[data-state="error"] i { background: var(--mark); }
.data-status[data-state="empty"] i { background: var(--guide); }

.state-icon {
  display: grid; place-items: center;
  width: 30px; height: 30px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 13px;
}
.data-state strong { font-family: var(--font-display); font-size: 15px; color: inherit; }
/* The global `p { color: var(--ink-soft) }` gave these paragraphs a dark color
   of their own, so they never inherited the light color set on .data-state
   (dark gray on navy, ~1.7:1). Force inheritance. */
.data-state p { color: inherit; }
.testimonials-column .state-icon,
.discussion-preview .state-icon { color: var(--muted); }
.testimonials-column .data-state strong { color: var(--ink); }

.data-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 20px;
  text-align: center;
  color: rgba(243,242,234,.88);
  font-size: 14px;
}
.loading-ring {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(243,242,234,.25);
  border-top-color: var(--paper);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.leaderboard-list {
  list-style: none;
  margin: 0; padding: 0 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 4px;
  border-bottom: 1px solid rgba(243,242,234,.1);
}
.leaderboard-row:last-child { border-bottom: none; }
.leaderboard-rank {
  font-family: var(--font-display);
  font-size: 13px;
  color: rgba(243,242,234,.68);
  width: 22px;
  flex: 0 0 auto;
}
.leaderboard-person { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.leaderboard-person .user-avatar { background: rgba(243,242,234,.12); color: var(--paper); width: 34px; height: 34px; font-size: 12px; }
.leaderboard-name { display: flex; flex-direction: column; min-width: 0; }
.leaderboard-name strong { font-family: var(--font-display); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-name small { font-size: 11px; color: rgba(243,242,234,.68); }
.leaderboard-score { text-align: right; flex: 0 0 auto; }
.leaderboard-score strong { display: block; font-family: var(--font-display); font-size: 17px; }
.leaderboard-score small { font-size: 11px; color: rgba(243,242,234,.68); }
.data-updated { padding: 0 22px 20px; font-size: 12px; color: rgba(243,242,234,.68); }

.button-soft {
  background: rgba(243,242,234,.1);
  color: var(--paper);
  border: 1px solid rgba(243,242,234,.25);
  margin: 0 22px 22px;
}
.button-soft:hover { background: rgba(243,242,234,.18); }

/* ---------------------------------- testimonials ---------------------------------- */

.testimonial-area {
  display: grid;
  grid-template-columns: minmax(0,1.2fr) minmax(300px, 420px);
  gap: 40px;
}
.testimonials-column .data-panel-heading { padding-left: 0; padding-right: 0; }
.testimonials-column .data-state { color: var(--muted); }
.testimonials-column .loading-ring { border-color: var(--line); border-top-color: var(--exam-blue); }
.testimonials-column .button-soft {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--ink);
  margin-left: 0; margin-right: 0;
}
.testimonials-column .button-soft:hover { background: var(--paper-deep); }

.testimonial-grid { display: grid; gap: 16px; }
.testimonial-card {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.testimonial-rating {
  color: var(--mark);
  font-size: 14px;
  letter-spacing: 2px;
  margin-bottom: 12px;
}
.testimonial-card blockquote { margin: 0 0 16px; }
.testimonial-card blockquote p { font-size: 14.5px; color: var(--ink); line-height: 1.6; }
.testimonial-card figcaption { display: flex; flex-direction: column; gap: 2px; }
.testimonial-card figcaption strong { font-family: var(--font-display); font-size: 14px; }
.testimonial-card figcaption small { font-size: 12px; color: var(--muted); }
.testimonial-form-card {
  background: var(--card);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  padding: 28px;
}
.form-card-topline { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.pending-chip {
  font-size: 11px;
  padding: 4px 9px;
  border: 1px solid var(--guide);
  border-radius: 2px;
  color: var(--exam-blue);
}
.testimonial-form-card h3 { font-size: 19px; margin-bottom: 8px; }
.testimonial-form-card > p { font-size: 13.5px; margin-bottom: 18px; }

.auth-callout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 2px;
  margin-bottom: 18px;
  font-size: 13px;
}
.auth-callout p { font-size: 13px; flex: 1; }
.auth-callout button {
  background: none; border: 1px solid var(--ink);
  border-radius: 2px; padding: 6px 10px;
  font-size: 12.5px; font-weight: 600;
}
.auth-callout-success { background: var(--guide-soft); border-color: var(--guide); }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.field span small { color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 11px 12px;
  font: inherit;
  font-size: 14px;
  background: var(--paper);
  color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--exam-blue);
  outline: none;
}
.field-hint { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }

.approval-note {
  display: flex; gap: 8px; align-items: flex-start;
  font-size: 12px; color: var(--muted);
  margin: 4px 0 16px;
}
.approval-note span {
  flex: 0 0 16px; width: 16px; height: 16px;
  display: grid; place-items: center;
  border: 1px solid var(--muted); border-radius: 50%;
  font-size: 10px;
}
.form-status { font-size: 13px; margin-bottom: 12px; }

/* ---------------------------------- discussion ---------------------------------- */

.discussion-section {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(300px, 420px);
  gap: 48px;
}
.discussion-copy h2 { font-size: clamp(26px, 3vw, 34px); margin-bottom: 16px; }
.discussion-copy > p { font-size: 15px; max-width: 42ch; margin-bottom: 22px; }
.discussion-rules {
  list-style: none;
  margin: 0 0 26px; padding: 18px 0 0;
  border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 8px;
}
.discussion-rules li { font-size: 13.5px; color: var(--ink-soft); padding-left: 14px; position: relative; }
.discussion-rules li::before {
  content: ""; position: absolute; left: 0; top: 7px;
  width: 6px; height: 6px; background: var(--exam-blue); border-radius: 50%;
}

.discussion-preview {
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--card);
  padding: 4px;
  align-self: start;
}
.discussion-preview-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 20px 20px 14px; gap: 16px; }
.discussion-preview-head h3 { font-size: 16px; }
.discussion-list { padding: 0 20px 12px; display: flex; flex-direction: column; gap: 1px; background: var(--line); }
.discussion-preview-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--card);
  padding: 14px 4px;
}
.discussion-preview-meta { font-size: 11.5px; color: var(--muted); }
.discussion-preview-item strong { font-size: 14px; font-family: var(--font-display); }
.discussion-preview-item small { font-size: 12px; color: var(--muted); }
.discussion-empty { font-size: 13.5px; color: var(--muted); padding: 20px 4px; text-align: center; background: var(--card); }
.discussion-all {
  display: block;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  font-size: 13px; font-weight: 600;
}

/* ---------------------------------- closing ---------------------------------- */

.closing-section > * { max-width: 1240px; }
.closing-card {
  background: var(--exam-blue);
  color: var(--paper);
  border-radius: var(--radius);
  padding: 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}
.closing-card .community-origin-dark { color: rgba(243,242,234,.7); }
.closing-card h2 { color: var(--paper); font-size: clamp(26px, 3.4vw, 38px); }
.closing-action { max-width: 360px; }
.closing-action p { color: rgba(243,242,234,.75); font-size: 14.5px; margin-bottom: 18px; }

/* ---------------------------------- footer ---------------------------------- */

.site-footer { border-top: 1px solid var(--line); padding: 56px 0 0; }
.footer-inner {
  width: min(calc(100% - 40px), 1240px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
}
.footer-brand p { font-size: 13.5px; margin-top: 12px; max-width: 32ch; }
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a { font-size: 13.5px; color: var(--ink-soft); }
.footer-origin { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.origin-badge-footer { }
.footer-origin p { font-size: 12.5px; color: var(--muted); }

.footer-bottom {
  border-top: 1px solid var(--line);
  padding: 18px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: 12px;
  color: var(--muted);
  width: min(calc(100% - 40px), 1240px);
  margin: 0 auto;
}

/* ---------------------------------- mobile dock ---------------------------------- */

.mobile-dock {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 90;
  background: var(--card);
  border-top: 1px solid var(--ink);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  gap: 10px;
}
.mobile-dock a, .mobile-dock button {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 12px; border-radius: 2px;
  font-size: 13px; font-weight: 600;
  background: var(--ink); color: var(--paper);
}
.mobile-dock .signed-out-only { background: var(--mark); }
.mobile-dock .dock-logout { background: transparent; border: 1px solid var(--ink); color: var(--ink); }

/* ---------------------------------- auth dialog / toast ---------------------------------- */

.auth-dialog {
  border: none;
  border-radius: var(--radius);
  padding: 0;
  width: min(92vw, 440px);
  box-shadow: 0 30px 70px -20px rgba(23,30,27,.4);
}
.auth-dialog::backdrop { background: rgba(23,30,27,.55); }
.auth-dialog-inner { padding: 30px; }
.auth-dialog-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.auth-dialog-header h2 { font-size: 21px; margin-bottom: 6px; }
.auth-dialog-header p { font-size: 13.5px; }
.dialog-close {
  background: none; border: 1px solid var(--line); border-radius: 50%;
  width: 30px; height: 30px; font-size: 16px; color: var(--muted);
  flex: 0 0 auto;
}

.google-button {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px; border: 1px solid var(--line); border-radius: 2px;
  background: var(--white); font-size: 14px; font-weight: 600;
  margin-bottom: 18px;
}
.google-button svg { width: 18px; height: 18px; }
.google-blue { fill: #4285F4; }
.google-green { fill: #34A853; }
.google-yellow { fill: #FBBC05; }
.google-red { fill: #EA4335; }

.auth-setup-note {
  background: var(--mark-soft);
  border: 1px solid var(--mark);
  border-radius: 2px;
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 13px;
}
.auth-setup-note strong { display: block; margin-bottom: 3px; }
.auth-setup-note p { font-size: 12.5px; color: var(--ink-soft); }

.brand-footer { margin-bottom: 14px; }

.auth-divider { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-divider span { font-size: 12px; color: var(--muted); }

.otp-sent-note {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px; background: var(--guide-soft); border-radius: 2px;
  font-size: 13px; margin-bottom: 16px;
}
.otp-sent-note span { color: var(--exam-blue); font-weight: 700; }

.signed-in-card { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.signed-in-card small { display: block; font-size: 11px; color: var(--muted); }
.signed-in-card strong { font-size: 15px; }
.auth-method > p { font-size: 13px; margin-bottom: 16px; }
.auth-method .button { margin-bottom: 10px; }
.auth-status { font-size: 13px; margin-top: 14px; }

.toast {
  position: fixed;
  left: 50%; bottom: 28px;
  transform: translateX(-50%);
  z-index: 300;
  display: flex; align-items: center; gap: 10px;
  background: var(--ink); color: var(--paper);
  padding: 13px 18px; border-radius: 2px;
  font-size: 13.5px;
  box-shadow: 0 20px 40px -14px rgba(23,30,27,.5);
}
.toast-icon { color: #4e9e6f; font-weight: 700; }

/* ---------------------------------- responsive ---------------------------------- */

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .archive-board { grid-template-columns: 1fr; }
  .archive-explainer { border-left: none; border-top: 2px solid var(--guide); padding-left: 0; padding-top: 24px; }
  .archive-rules { grid-template-columns: 1fr; }
  .practice-grid { grid-template-columns: 1fr; }
  .testimonial-area { grid-template-columns: 1fr; }
  .discussion-section { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .desktop-nav { display: none; }
  .section { padding: 56px 0; }
  .section-heading { flex-direction: column; align-items: flex-start; gap: 12px; }
  .field-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .pricing-card { padding: 30px 24px; }
  .closing-card { padding: 36px 26px; }
  /* The bottom dock used to duplicate the header's "Open my portal" /
     "Log out" actions with identical labels. Since .site-header is
     position: sticky (always on screen, never scrolls away), the dock
     added no reachability benefit at all — just permanent redundant
     chrome eating ~90px of a small phone screen. Removed. */
  .mobile-dock { display: none; }

  /* Header: the logo, "r/ IndiaMBA" badge, signed-in name, and portal button
     used to all fight for one unwrapped row on a phone (no width limits,
     no flex-wrap), which forced "Open portal" to wrap letter-by-letter.
     Drop the decorative Reddit badge, collapse the signed-in text to just
     the avatar, and keep the remaining controls from wrapping mid-word. */
  .header-inner { min-height: 60px; gap: 10px; flex-wrap: wrap; row-gap: 8px; }
  .origin-badge { display: none; }
  .brand-name { font-size: 16px; }
  .header-account { gap: 8px; }
  .account-summary { gap: 6px; flex-wrap: wrap; }
  .user-copy { display: none; }
  .header-portal-link,
  .logout-button,
  .button-small { white-space: nowrap; }
  .header-portal-link { padding: 7px 10px; font-size: 12.5px; }
  .logout-button { font-size: 11.5px; }
}
