:root {
  --bg: #f4f1e8;
  --surface: #ffffff;
  --surface-soft: #f9f8f5;
  --text: #10253f;
  --muted: #405a75;
  --line: #d6dbe2;
  --primary: #123a5f;
  --primary-strong: #0a2c49;
  --accent: #d89f57;
  --danger: #c45555;
  --success: #23836d;
  --radius-xl: 24px;
  --radius-md: 14px;
  --shadow: 0 14px 32px rgba(16, 37, 63, 0.1);
  --font-serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, serif;
  --font-sans: "Segoe UI", "Inter", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
}

.bg-grid {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(16, 37, 63, 0.03) 1px, transparent 1px) 0 0 / 80px 80px,
    radial-gradient(circle at 18% 16%, rgba(216, 159, 87, 0.2), transparent 36%),
    radial-gradient(circle at 85% 42%, rgba(16, 37, 63, 0.1), transparent 44%);
  pointer-events: none;
  z-index: 0;
}

.layout {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 20px;
  margin-bottom: 18px;
}

.hero-left,
.hero-right,
.panel,
.auth-panel,
.topbar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.hero-left,
.hero-right,
.panel,
.auth-panel {
  padding: 24px;
}

.brand {
  margin: 0 0 8px;
  font-size: 46px;
  letter-spacing: 0.08em;
  font-family: var(--font-serif);
}

.kicker {
  margin: 0 0 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

h1,
h2,
h3 {
  margin: 0 0 12px;
  font-family: var(--font-serif);
}

h1 {
  font-size: clamp(2.2rem, 4vw, 4rem);
  line-height: 1.02;
}

.subtitle,
.muted {
  color: var(--muted);
  margin: 0;
}

.sponsor-card {
  min-height: 240px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #edf1f5, #d9dee5);
  padding: 0;
  display: grid;
  overflow: hidden;
  position: relative;
}

.sponsor-empty {
  place-items: center;
  padding: 18px;
}

.sponsor-empty span,
.sponsor-badge {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--primary-strong);
  font-weight: 800;
  padding: 10px 16px;
}

.sponsor-link {
  color: inherit;
  display: block;
  min-height: inherit;
  position: relative;
  text-decoration: none;
}

.sponsor-media,
.sponsor-media img,
.sponsor-media video {
  height: 100%;
  min-height: 240px;
  width: 100%;
}

.sponsor-media img,
.sponsor-media video {
  display: block;
  object-fit: cover;
}

.sponsor-badge {
  bottom: 16px;
  box-shadow: 0 10px 24px rgba(16, 37, 63, 0.12);
  left: 16px;
  position: absolute;
}

.admin-sponsor-media {
  border: 1px solid var(--line);
  border-radius: 14px;
  height: 96px;
  object-fit: cover;
  width: 144px;
}

.sponsor-row {
  align-items: center;
  display: grid;
  gap: 14px;
  grid-template-columns: 144px minmax(0, 1fr);
}

.sponsor-row h4 {
  margin: 0 0 4px;
}

.sponsor-row p + p {
  margin-top: 4px;
}

/* Legacy label kept harmless if older markup is cached. */
.sponsor-label {
  margin: 0 0 8px;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/*
  Older markup used flex-centering; the media version above now owns the
  sponsor layout.
*/
.sponsor-card.legacy {
  display: flex;
  justify-content: center;
}

.auth-panel {
  margin-bottom: 18px;
}

.auth-tabs,
.view-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tab {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
  cursor: pointer;
}

.tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

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

label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #c7d0dc;
  background: #f7f9fc;
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 1rem;
}

textarea {
  resize: vertical;
}

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

.fieldset {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin: 0;
}

.fieldset legend {
  padding: 0 8px;
  font-weight: 700;
}

.btn {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(120deg, var(--primary), #204f79);
  color: #fff;
}

.btn-secondary {
  background: #eaf0f8;
  color: var(--primary-strong);
  border-color: #d1deec;
}

.btn-ghost {
  background: #fff;
  color: var(--primary-strong);
  border-color: var(--line);
}

.btn-pass {
  background: #f4f1f1;
  color: #344d66;
  border-color: #d4dce6;
}

.btn-like {
  background: linear-gradient(120deg, #db4f7d, #f17e46);
  color: #fff;
}

.message {
  min-height: 22px;
  margin: 8px 0 0;
  color: var(--muted);
  white-space: pre-line;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  margin-bottom: 14px;
}

.top-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.notice {
  border: 1px solid #f2c68b;
  background: #fff4e8;
  color: #7f4a0d;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}

.notice.compact {
  margin: 0;
  padding: 10px 12px;
}

.notice.success {
  border-color: rgba(35, 131, 109, 0.28);
  background: rgba(35, 131, 109, 0.08);
  color: #176b59;
}

.notice.rejected {
  border-color: rgba(164, 64, 64, 0.3);
  background: rgba(252, 235, 231, 0.88);
  color: #742f2f;
}

#profile-review-banner {
  display: flex;
  gap: 0.55rem;
  align-items: baseline;
  margin-bottom: 1rem;
}

#profile-review-banner span {
  color: inherit;
}

.deck-card {
  min-height: 320px;
  border-radius: 20px;
  border: 1px solid #40658b;
  padding: 28px;
  color: #f4f7ff;
  background:
    radial-gradient(circle at 80% 28%, rgba(168, 133, 111, 0.25), transparent 40%),
    radial-gradient(circle at 6% 4%, rgba(159, 196, 236, 0.2), transparent 35%),
    linear-gradient(120deg, #0b2d4a, #123f64 52%, #1c2f58);
}

.deck-card h3 {
  color: #fff9ef;
  font-size: clamp(1.8rem, 3vw, 3rem);
  margin: 0;
}

.deck-card p {
  margin: 0;
}

.deck-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 24px;
  align-items: start;
}

.deck-copy {
  min-width: 0;
}

.deck-photo {
  margin: 0;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
  aspect-ratio: 1 / 1;
}

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

.deck-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 22px;
}

.score-pill {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 20px;
}

.insight-grid div {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  padding: 14px;
  min-height: 84px;
}

.insight-grid span {
  display: block;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.insight-grid strong {
  display: block;
  color: #fff;
  font-size: 1rem;
  line-height: 1.25;
}

.deck-summary {
  color: rgba(255, 255, 255, 0.92);
  font-size: 1.08rem;
  line-height: 1.55;
  max-width: 980px;
  margin-bottom: 18px !important;
}

.decision-note {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-left: 4px solid rgba(216, 159, 87, 0.95);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
}

.decision-note span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.decision-note strong {
  color: #fff9ef;
  font-size: 1.03rem;
  line-height: 1.5;
}

.deck-small {
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.96rem;
}

.analysis-box {
  margin-top: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.analysis-box summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 800;
  color: #fff9ef;
}

.analysis-box ul {
  margin: 0;
  padding: 0 18px 16px 34px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
}

.deck-card .chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.chip {
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.86rem;
}

.deck-actions {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.list {
  display: grid;
  gap: 10px;
}

.list-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 12px;
}

.section-intro {
  margin: -4px 0 16px;
}

.subsection-title {
  margin-top: 24px;
}

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

.plan-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #fff, #faf8f3);
  padding: 18px;
  display: grid;
  gap: 14px;
  min-height: 100%;
}

.plan-card.active {
  border-color: rgba(35, 131, 109, 0.45);
  box-shadow: 0 0 0 4px rgba(35, 131, 109, 0.08);
}

.plan-card h4,
.match-card h4 {
  margin: 0 0 6px;
  font-size: 1.25rem;
}

.plan-card ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.plan-price {
  font-size: 1.35rem;
  color: var(--primary-strong);
}

.activation-request {
  border: 1px solid rgba(18, 58, 95, 0.18);
  border-radius: 18px;
  background: linear-gradient(135deg, #fff, #f8f4ec);
  margin-top: 16px;
  padding: 18px;
  display: grid;
  gap: 14px;
}

.activation-request h4 {
  margin: 0 0 6px;
  font-size: 1.25rem;
}

.match-card,
.compact-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.status-pill,
.chip-light {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--primary-strong);
  padding: 8px 12px;
  font-weight: 800;
  white-space: nowrap;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

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

.stat-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 14px;
}

.stat-card p {
  margin: 0;
  color: var(--muted);
}

.stat-card strong {
  font-size: 1.8rem;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  margin-bottom: 12px;
}

.user-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.user-row-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.admin-user-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.admin-avatar,
.photo-preview img {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--surface);
}

.photo-preview {
  min-height: 92px;
  border: 1px dashed #b8c4d2;
  border-radius: 16px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 700;
}

.admin-details {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.admin-details summary {
  cursor: pointer;
  font-weight: 800;
  margin-bottom: 10px;
}

.admin-decision {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.admin-decision textarea {
  min-height: 5.5rem;
  resize: vertical;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.admin-grid p {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
}

.admin-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.admin-grid strong {
  display: block;
  overflow-wrap: anywhere;
}

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

.list-plain {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.site-footer {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto 24px;
  padding: 22px 24px 16px;
  color: #eef4f8;
  background: var(--primary-strong);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.1fr 1.5fr 1fr;
  gap: 24px;
  align-items: start;
}

.footer-brand,
.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-brand strong {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  letter-spacing: 0.08em;
}

.footer-brand span,
.footer-copyright {
  color: rgba(238, 244, 248, 0.72);
  font-size: 0.88rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.site-footer a {
  color: #fff;
  text-decoration: none;
  font-size: 0.92rem;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: #f0c88f;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.footer-copyright {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.legal-layout {
  max-width: 1060px;
}

.legal-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding: 28px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.legal-hero .brand {
  font-size: 2rem;
}

.legal-nav {
  position: sticky;
  top: 12px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 20px rgba(16, 37, 63, 0.08);
  backdrop-filter: blur(12px);
}

.legal-nav a {
  padding: 9px 12px;
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 10px;
}

.legal-nav a:hover,
.legal-nav a:focus-visible {
  background: #edf2f6;
}

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

.legal-section {
  scroll-margin-top: 92px;
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.legal-section p {
  max-width: 82ch;
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.65;
}

.legal-section p:last-child {
  margin-bottom: 0;
}

.legal-section a {
  color: var(--primary);
  font-weight: 700;
}

.legal-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.legal-details div {
  padding: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.legal-details dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.legal-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.legal-updated {
  margin: 2px 4px 22px;
  color: var(--muted);
  font-size: 0.88rem;
}

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

  .grid-2,
  .stats-grid,
  .plan-grid {
    grid-template-columns: 1fr;
  }

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

  .deck-head {
    flex-direction: column;
  }

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

  .deck-photo {
    max-width: 220px;
  }

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

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

  .user-row-head {
    flex-direction: column;
  }

  .match-card,
  .compact-row {
    align-items: stretch;
    flex-direction: column;
  }

  .inline-actions {
    justify-content: stretch;
  }

  .footer-inner,
  .legal-details {
    grid-template-columns: 1fr;
  }

  .legal-hero {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .site-footer {
    margin: 0 12px 12px;
    padding: 20px;
    border-radius: 18px;
  }

  .footer-links {
    flex-direction: column;
  }

  .legal-hero,
  .legal-section {
    padding: 20px;
  }

  .legal-nav {
    position: static;
  }
}
