/*
Theme Name:        Paulites Directory
Theme URI:         https://opanepal.org/
Author:            Old Paulites Association, Nepal
Description:       Custom private alumni directory. Built from scratch.
Version:           3.0.0
Requires at least: 6.0
Requires PHP:      8.0
License:           GPL-2.0-or-later
Text Domain:       paulites-directory
*/

/* =========================================================================
   1. DESIGN TOKENS
   ========================================================================= */
:root {
  --navy:          #1B2A6B;
  --navy-dark:     #131f52;
  --navy-light:    #eef1fa;
  --navy-tint:     #f5f7fc;
  --crimson:       #A6192E;
  --crimson-dark:  #8a1426;
  --crimson-light: #fdf2f4;
  --text:          #0f172a;
  --text-muted:    #64748b;
  --text-subtle:   #94a3b8;
  --bg:            #fafbfd;
  --border:        #e8ebf2;
  --border-strong: #d5dae5;
  --success:       #16a34a;

  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06), 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.08), 0 4px 8px rgba(15, 23, 42, 0.04);

  --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* =========================================================================
   2. RESET / BASE
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--crimson); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--crimson-dark); text-decoration: none; }
h1, h2, h3, h4 { color: var(--navy); letter-spacing: -0.02em; margin: 0; }
h1 { font-size: 2rem; line-height: 1.15; font-weight: 800; }
h2 { font-size: 1.35rem; line-height: 1.25; font-weight: 700; }
h3 { font-size: 1.05rem; line-height: 1.3; font-weight: 600; }
p { margin: 0 0 1em; }

/* =========================================================================
   3. LAYOUT
   ========================================================================= */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.site-main { min-height: 60vh; }
.page-wrap { padding: 40px 0 60px; }
.page-wrap .card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
}

/* =========================================================================
   4. HEADER
   ========================================================================= */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 24px;
}
.site-brand { display: flex; align-items: center; gap: 12px; color: var(--navy); text-decoration: none; }
.site-brand:hover { color: var(--navy); }
.site-brand__mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; letter-spacing: -0.02em;
  flex-shrink: 0;
}
.site-brand__logo {
  max-height: 40px;
  width: auto;
  height: auto;
  display: block;
  flex-shrink: 0;
}
.site-brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.site-brand__name { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.site-brand__sub  { font-weight: 400; font-size: 11px; color: var(--text-muted); }

.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  transition: background .15s ease, color .15s ease;
}
.site-nav a:hover { background: var(--navy-tint); color: var(--navy); }
.site-nav a.is-active { background: var(--navy-tint); color: var(--navy); }
.site-nav a.site-nav__logout { color: var(--crimson); }
.site-nav a.site-nav__logout:hover { background: var(--crimson-light); color: var(--crimson-dark); }

/* =========================================================================
   5. FOOTER
   ========================================================================= */
.site-footer {
  border-top: 1px solid var(--border);
  background: #fff;
  padding: 28px 0;
  margin-top: 80px;
  font-size: 13px;
  color: var(--text-muted);
}
.site-footer .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}

/* =========================================================================
   6. BUTTONS
   ========================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .15s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--crimson); color: #fff; }
.btn-primary:hover { background: var(--crimson-dark); color: #fff; }
.btn-secondary {
  background: #fff;
  color: var(--navy);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--navy-tint); border-color: var(--navy); color: var(--navy); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-dark); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* =========================================================================
   7. HERO (archive / directory header)
   ========================================================================= */
.hero {
  background: linear-gradient(180deg, #f5f7fc 0%, #fafbfd 100%);
  border-bottom: 1px solid var(--border);
  padding: 56px 0 40px;
}
.hero__inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.hero__eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--crimson);
  margin: 0 0 12px;
}
.hero__title {
  font-size: clamp(2.2rem, 5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--navy);
  margin: 0 0 12px;
}
.hero__subtitle {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0;
  line-height: 1.6;
}
.hero__stat {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}
.hero__stat-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--navy-tint);
  color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.hero__stat-label { font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-subtle); margin: 0; }
.hero__stat-value { font-size: 17px; font-weight: 700; color: var(--navy); margin: 0; }

/* =========================================================================
   8. MEMBER CARDS
   ========================================================================= */
.directory { padding: 40px 0 60px; }
.directory__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}
@media (max-width: 820px) {
  .directory__grid { grid-template-columns: 1fr; }
}

.alumni-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all .2s ease;
  overflow: hidden;
  position: relative;
}
.alumni-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.alumni-card__link {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  color: inherit;
  cursor: pointer;
}
.alumni-card__link:hover { color: inherit; text-decoration: none; }

.alumni-card__avatar {
  order: -1;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  font-size: 18px;
  border-radius: var(--radius);
  background: var(--navy-light);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-weight: 700;
}
.alumni-card__avatar img { width: 100%; height: 100%; object-fit: cover; }

.alumni-card__body { flex: 1; min-width: 0; }

.alumni-card__name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  line-height: 1.3;
  word-break: break-word;
}
.alumni-card__verified {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  flex-shrink: 0;
}
.alumni-card__verified svg { width: 10px; height: 10px; }

.alumni-card__meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
}
.alumni-card__meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  min-width: 0;
}
.alumni-card__meta-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.alumni-card__meta-item svg { color: var(--text-subtle); flex-shrink: 0; }

.alumni-card__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}
.alumni-card__meta-link {
  position: relative;
  z-index: 2;
  color: var(--text-muted);
  transition: color .15s ease;
}
.alumni-card__meta-link:hover { color: var(--crimson); }

.alumni-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  gap: 8px;
}
.badge-batch {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--navy-tint);
  color: var(--navy);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: var(--radius-pill);
}
.alumni-card__view {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-subtle);
  display: flex;
  align-items: center;
  gap: 4px;
}
.alumni-card:hover .alumni-card__view { color: var(--crimson); }

/* House crests on cards */
.alumni-card__houses {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  padding-top: 2px;
}
.house-crest-mini {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: contain;
  transition: transform .15s ease;
}
.house-crest-mini:hover { transform: scale(1.15); }

@media (max-width: 480px) {
  .alumni-card__link { gap: 12px; }
  .alumni-card__avatar { width: 48px; height: 48px; font-size: 16px; }
  .alumni-card__name { font-size: 15px; }
  .house-crest-mini { width: 16px; height: 16px; }
}

/* =========================================================================
   9. NOTICES / EMPTY STATES
   ========================================================================= */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
  font-size: 14px;
}
.notice {
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 14px;
  border: 1px solid;
}
.notice-error   { background: var(--crimson-light); border-color: #f5c2c7; color: #7f1d1d; }
.notice-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.notice-info    { background: var(--navy-tint); border-color: #c7d2fe; color: var(--navy); }

/* =========================================================================
   10. AUTH PAGES (login / register / forgot / pending)
   ========================================================================= */
.auth-wrap {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
}
.auth-card--wide { max-width: 560px; }
.auth-card__head { text-align: center; margin-bottom: 28px; }
.auth-card__mark {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--navy); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px;
  margin-bottom: 18px;
}
.auth-card__logo {
  max-height: 180px;
  width: auto;
  height: auto;
  margin: 0 auto 18px;
  display: block;
}
.auth-card__title { font-size: 1.6rem; font-weight: 800; color: var(--navy); margin: 0 0 6px; letter-spacing: -0.025em; }
.auth-card__sub { font-size: 14px; color: var(--text-muted); margin: 0; }
.auth-card__alt {
  text-align: center;
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 22px 0 0;
}
.auth-card__alt a { font-weight: 600; color: var(--crimson); }
.auth-card .btn-block { width: 100%; }

@media (max-width: 480px) {
  .auth-card { padding: 28px 22px; }
  .auth-card__logo { max-height: 140px; }
}

/* Pending approval page — inline status blocks */
.pending-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #fef3c7;
  color: #b45309;
  margin-bottom: 18px;
}
.pending-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  color: #92400e;
  font-size: 13.5px;
  margin-bottom: 24px;
}
.pending-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d97706;
  box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.15);
  animation: pendingPulse 2s ease-in-out infinite;
}
@keyframes pendingPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.pending-section { margin-bottom: 24px; }
.pending-section--compact { margin-bottom: 20px; }
.pending-section__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin: 0 0 14px;
}
.pending-steps { list-style: none; padding: 0; margin: 0; }
.pending-steps li {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.pending-steps li:last-child { border-bottom: 0; padding-bottom: 0; }
.pending-steps li:first-child { padding-top: 0; }
.pending-steps__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--navy-tint);
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}
.pending-steps strong {
  display: block;
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 2px;
}
.pending-steps p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}
.pending-steps em { font-style: normal; color: var(--navy); font-weight: 500; }
.pending-details { list-style: none; padding: 0; margin: 0; }
.pending-details li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.pending-details li:last-child { border-bottom: 0; }
.pending-details span { color: var(--text-muted); }
.pending-details strong { color: var(--text); font-weight: 600; }
.pending-actions { margin-top: 28px; }
.pending-help {
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
  margin: 16px 0 0;
  line-height: 1.6;
}
.pending-help a { color: var(--crimson); font-weight: 500; }

@media (max-width: 480px) {
  .pending-mark { width: 56px; height: 56px; }
  .pending-status { font-size: 13px; padding: 12px 14px; }
}

/* =========================================================================
   11. FORMS
   ========================================================================= */
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.field input[type=text],
.field input[type=email],
.field input[type=tel],
.field input[type=url],
.field input[type=password],
.field input[type=number],
.field select,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: #fff;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 4px rgba(27, 42, 107, 0.08);
}
.field textarea { min-height: 100px; resize: vertical; }
.field .hint { display: block; font-size: 12px; color: var(--text-muted); margin-top: 5px; }

.field select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%2364748b%22%20stroke-width%3D%222.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }

.field-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--navy-tint);
  border: 1px solid transparent;
  transition: all .15s ease;
}
.field-checkbox:hover { border-color: var(--border-strong); }
.field-checkbox input { margin: 2px 0 0; flex-shrink: 0; accent-color: var(--navy); }

/* Profile form — grouped sections */
.profile-form { max-width: 880px; margin: 0 auto; }
.form-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  overflow: hidden;
}
.form-section__head {
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fafbfd 0%, #fff 100%);
}
.form-section__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 2px;
  letter-spacing: -0.01em;
}
.form-section__sub {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}
.form-section__body { padding: 24px 28px 28px; }
.form-section__body .field:last-child { margin-bottom: 0; }
.form-section__body .field-row:last-child .field { margin-bottom: 0; }

.visibility-group {
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.visibility-group__title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin: 0 0 12px;
}
.visibility-group .field-checkbox + .field-checkbox { margin-top: 8px; }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 8px 0 24px;
  flex-wrap: wrap;
}

.password-section {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.password-section .form-section__title { color: var(--crimson); }

@media (max-width: 640px) {
  .form-section__head,
  .form-section__body { padding-left: 20px; padding-right: 20px; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; }
}

/* Photo upload */
.photo-upload {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.photo-upload__preview {
  width: 96px;
  height: 96px;
  border-radius: var(--radius);
  background: var(--navy-light);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.photo-upload__preview img,
.photo-upload__img { width: 100%; height: 100%; object-fit: cover; }
.photo-upload__initials {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.photo-upload__controls {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.photo-upload__remove {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}
.photo-upload__remove input { accent-color: var(--crimson); }
.photo-upload__hint {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 0;
}
label[for="profile_photo"] { cursor: pointer; }

/* Repeater fields */
.repeater {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.repeater__items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.repeater__row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.repeater__row input,
.repeater__row select,
.repeater__row textarea {
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: #fff;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.repeater__row input:focus,
.repeater__row select:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 4px rgba(27, 42, 107, 0.08);
}
.repeater__remove {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text-muted);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  line-height: 1;
  transition: all .12s ease;
}
.repeater__remove:hover {
  border-color: var(--crimson);
  color: var(--crimson);
  background: var(--crimson-light);
}
.repeater__add {
  align-self: flex-start;
  background: none;
  border: 1px dashed var(--border-strong);
  color: var(--navy);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .12s ease;
}
.repeater__add:hover {
  border-color: var(--navy);
  border-style: solid;
  background: var(--navy-tint);
}
.repeater__row--paired {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: center;
}
@media (max-width: 640px) {
  .repeater__row--paired { grid-template-columns: 1fr auto; }
  .repeater__row--paired > .autocomplete { grid-column: 1 / -1; }
  .repeater__row--paired > input[type="text"] { grid-column: 1; }
  .repeater__row--paired > .repeater__remove { grid-column: 2; grid-row: 2 / 3; }
}
@media (max-width: 480px) {
  .repeater__row input,
  .repeater__row select { font-size: 14px; padding: 10px 12px; }
}

/* Autocomplete */
.autocomplete {
  position: relative;
  flex: 1;
  min-width: 0;
}
.autocomplete__input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: #fff;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.autocomplete__input:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 4px rgba(27, 42, 107, 0.08);
}
.autocomplete.is-open .autocomplete__input {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-color: var(--border);
}
.autocomplete__panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 60;
  background: #fff;
  border: 1px solid var(--navy);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 260px;
  overflow-y: auto;
  padding: 4px;
}
.autocomplete__panel[hidden] { display: none; }
.autocomplete__option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  border-radius: var(--radius-sm);
  cursor: pointer;
  line-height: 1.35;
}
.autocomplete__option:hover,
.autocomplete__option.is-highlighted {
  background: var(--navy-tint);
  color: var(--navy);
}
.autocomplete__option strong {
  color: var(--crimson);
  font-weight: 700;
}
.autocomplete__empty {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* =========================================================================
   12. PROFILE PAGE
   ========================================================================= */
.profile-hero {
  background: linear-gradient(180deg, #f5f7fc 0%, #fafbfd 100%);
  border-bottom: 1px solid var(--border);
  padding: 48px 0 0;
}
.profile-hero__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.profile-hero__back:hover { color: var(--navy); }
.profile-hero__inner {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}
.profile-hero__avatar {
  width: 112px; height: 112px;
  border-radius: var(--radius-lg);
  background: var(--navy);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; font-weight: 700;
  letter-spacing: -0.02em;
  overflow: hidden;
  flex-shrink: 0;
  border: 4px solid #fff;
  box-shadow: var(--shadow-md);
}
.profile-hero__avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-hero__body { flex: 1; min-width: 0; padding-bottom: 20px; }
.profile-hero__name {
  display: flex; align-items: center; gap: 10px;
  font-size: 2rem; font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--navy);
  margin: 0 0 8px;
  flex-wrap: wrap;
}
.profile-hero__meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13.5px; color: var(--text-muted);
}

.profile-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-top: 8px;
}
.profile-tabs span {
  display: inline-block;
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  border-bottom: 2px solid var(--crimson);
  margin-bottom: -1px;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  padding: 32px 0 60px;
}
@media (max-width: 860px) { .profile-grid { grid-template-columns: 1fr; } }

.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.panel__title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin: 0 0 16px;
}
.panel + .panel { margin-top: 16px; }

.detail-list { list-style: none; padding: 0; margin: 0; }
.detail-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14.5px;
}
.detail-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.detail-list li:first-child { padding-top: 0; }
.detail-list__icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--navy-tint);
  color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.detail-list__body { min-width: 0; flex: 1; }
.detail-list__label { font-size: 11.5px; font-weight: 600; color: var(--text-subtle); text-transform: uppercase; letter-spacing: 0.05em; }
.detail-list__value { font-size: 14.5px; color: var(--text); font-weight: 500; word-break: break-word; }
.detail-list__sub {
  display: block;
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}

/* Grouped work entries */
.work-entries {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 2px;
}
.work-entry { padding: 0; }
.work-entry__profession {
  font-size: 14.5px;
  color: var(--text);
  font-weight: 500;
  line-height: 1.35;
}
.work-entry__companies {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.4;
}
.work-entry + .work-entry {
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

/* House crest badges on profile */
.house-crest {
  display: inline-block;
  vertical-align: middle;
  border-radius: 50%;
  object-fit: contain;
}
.house-crest-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}
.house-crest-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  background: var(--navy-tint);
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1;
}
.house-crest-badge__name { padding-right: 4px; }

@media (max-width: 640px) {
  .profile-hero { padding: 32px 0 0; }
  .profile-hero__avatar { width: 80px; height: 80px; font-size: 28px; }
  .profile-hero__body { padding-bottom: 14px; }
  .profile-hero__name { font-size: 1.5rem; gap: 8px; }
  .profile-hero__meta { font-size: 13px; gap: 6px; }
  .profile-grid { padding: 24px 0 40px; gap: 16px; }
  .panel { padding: 20px; }
  .detail-list li { gap: 12px; padding: 12px 0; }
  .detail-list__icon { width: 32px; height: 32px; }
  .detail-list__value { font-size: 14px; }
}
@media (max-width: 480px) {
  .work-entry__profession { font-size: 14px; }
  .work-entry__companies { font-size: 12px; }
  .work-entries { gap: 10px; }
  .house-crest-badge { font-size: 12.5px; padding: 4px 10px 4px 4px; }
}

/* =========================================================================
   13. PAGINATION
   ========================================================================= */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 40px; flex-wrap: wrap; }
.pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 12px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px; font-weight: 500;
}
.pagination .page-numbers:hover { border-color: var(--navy); color: var(--navy); }
.pagination .current { background: var(--navy); color: #fff; border-color: var(--navy); }

/* =========================================================================
   14. DIRECTORY LAYOUT (sidebar + main)
   ========================================================================= */
.directory-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 80px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  align-items: start;
}

.filter-sidebar {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 4px 0;
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.filter-sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.filter-sidebar__header h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}
.filter-sidebar__close {
  display: none;
  background: none;
  border: 0;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}
.filter-sidebar__close:hover { background: var(--navy-tint); color: var(--navy); }

.filter-group { border-bottom: 1px solid var(--border); }
.filter-group:last-child { border-bottom: 0; }
.filter-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background .12s ease;
}
.filter-group > summary::-webkit-details-marker { display: none; }
.filter-group > summary:hover { background: var(--navy-tint); }
.filter-group > summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-subtle);
  border-bottom: 2px solid var(--text-subtle);
  transform: rotate(-45deg);
  transition: transform .15s ease;
  margin-left: 8px;
  flex-shrink: 0;
}
.filter-group[open] > summary::after { transform: rotate(45deg); }
.filter-group__count {
  margin-left: auto;
  margin-right: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-subtle);
  background: var(--navy-tint);
  padding: 2px 8px;
  border-radius: 999px;
}
.filter-group__body { padding: 4px 12px 14px; }
.filter-group__empty {
  font-size: 12.5px;
  color: var(--text-muted);
  padding: 8px 12px;
  margin: 0;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  font-size: 13.5px;
  color: var(--text);
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  transition: background .1s ease;
}
.filter-option:hover { background: var(--navy-tint); }
.filter-option input {
  width: 15px;
  height: 15px;
  accent-color: var(--navy);
  flex-shrink: 0;
  margin: 0;
}
.filter-option > span:first-of-type {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filter-option__count {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-subtle);
  flex-shrink: 0;
}

.directory-main { min-width: 0; }
.directory-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.directory-toolbar__search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--navy-tint);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 0 16px;
  height: 44px;
  flex: 1 1 260px;
  transition: border-color .15s ease, background .15s ease;
}
.directory-toolbar__search:focus-within {
  background: #fff;
  border-color: var(--navy);
}
.directory-toolbar__search svg { color: var(--text-subtle); flex-shrink: 0; }
.directory-toolbar__search input {
  border: 0;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  width: 100%;
  height: 100%;
}
.directory-toolbar__filter-toggle {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  height: 44px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
}
.filter-toggle-count {
  background: var(--crimson);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  margin-left: 2px;
}
.directory-toolbar__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--text-muted);
  margin-left: auto;
}
.directory-toolbar__meta strong { color: var(--navy); font-weight: 700; }

.filterbar__reset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--crimson);
  cursor: pointer;
  background: none;
  border: 0;
  font-family: inherit;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}
.filterbar__reset:hover { background: var(--crimson-light); }

.filter-sidebar__backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.filter-sidebar__backdrop.is-open { opacity: 1; pointer-events: auto; }

@media (max-width: 900px) {
  .directory-layout {
    grid-template-columns: 1fr;
    padding: 20px 16px 60px;
  }
  .filter-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    max-height: 100vh;
    width: 320px;
    max-width: 88vw;
    z-index: 250;
    border-radius: 0;
    border: 0;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.1);
  }
  .filter-sidebar.is-open { transform: translateX(0); }
  .filter-sidebar__close { display: inline-block; }
  .filter-sidebar__backdrop { display: block; }
  .directory-toolbar__filter-toggle { display: inline-flex; }
  .directory-toolbar__meta { width: 100%; justify-content: space-between; margin-left: 0; }
  .directory-toolbar__search { flex: 1 1 100%; }
  body.no-scroll { overflow: hidden; }
}

/* =========================================================================
   15. HOMEPAGE DASHBOARD
   ========================================================================= */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}
.chart-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.chart-card__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 20px;
  letter-spacing: -0.01em;
}
.chart-card__hint {
  font-size: 12px;
  color: var(--text-subtle);
  margin: 0 0 16px;
  line-height: 1.4;
}
.chart-card__chart {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}
.chart-card__chart svg {
  max-width: 200px;
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}
.chart-legend {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
}
.chart-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
}
.chart-legend li strong {
  margin-left: auto;
  color: var(--navy);
  font-weight: 700;
}
.chart-legend__dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.chart-legend__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chart-legend--links li a,
.chart-legend--links li .chart-legend__static {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: background .12s ease, color .12s ease;
  text-decoration: none;
}
.chart-legend--links li a:hover {
  background: var(--navy-tint);
  color: var(--navy);
  text-decoration: none;
}
.chart-legend--links li a:hover .chart-legend__name { color: var(--navy); }
.chart-legend--links li a:focus {
  outline: 2px solid var(--navy);
  outline-offset: 1px;
}
.chart-legend--links li strong {
  margin-left: auto;
  color: var(--navy);
  font-weight: 700;
}
.chart-legend__static { cursor: default; }
.chart-legend__static strong {
  margin-left: auto;
  color: var(--navy);
  font-weight: 700;
}

/* Manhattan bar charts */
.manhattan-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 4px 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.manhattan-scroll svg {
  max-width: none;
  width: auto;
  height: auto;
}
.manhattan {
  display: block;
  min-width: 100%;
}
.manhattan__link { text-decoration: none; }
.manhattan__link:hover { text-decoration: none; }
.manhattan__bar {
  transition: opacity .15s ease, filter .15s ease;
  cursor: pointer;
}
.manhattan__bar:hover {
  opacity: 0.85;
  filter: brightness(1.15);
}
.manhattan__bar--img {
  transition: filter .15s ease;
}
.manhattan__link:hover .manhattan__bar--img {
  filter: brightness(1.1);
}
.manhattan__bar-bg {
  transition: opacity .15s ease;
}
.manhattan__link:hover .manhattan__bar-bg {
  opacity: 0.25;
}
.manhattan__value {
  font-family: var(--font);
  font-size: 10px;
  font-weight: 700;
  fill: var(--navy);
  pointer-events: none;
}
.manhattan__label {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  fill: var(--navy);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  text-transform: uppercase;
}

/* Houses chart card — half width, centered, fit-to-width */
.houses-wrap {
  display: flex;
  justify-content: center;
}
.houses-wrap > .chart-card {
  width: 100%;
  max-width: 620px;
}
.houses-wrap .manhattan-scroll { overflow-x: hidden; }
.houses-wrap .manhattan-scroll svg {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  height: auto;
}

@media (max-width: 700px) {
  .houses-wrap > .chart-card { max-width: 100%; }
}
@media (max-width: 640px) {
  .chart-card { padding: 18px 16px; }
  .chart-card__title { font-size: 14px; margin-bottom: 12px; }
  .chart-card__hint { font-size: 11.5px; margin: 0 0 12px; }
  .chart-card__chart { margin-bottom: 16px; }
  .chart-legend { font-size: 13px; gap: 6px; }
  .chart-legend li a,
  .chart-legend li .chart-legend__static { padding: 8px 10px; }
  .manhattan__label { font-size: 11px; }
}

/* =========================================================================
   16. CROP MODAL
   ========================================================================= */
.crop-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.crop-modal[hidden] { display: none; }
.crop-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  cursor: pointer;
}
.crop-modal__inner {
  position: relative;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 40px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.crop-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.crop-modal__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.crop-modal__sub {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}
.crop-modal__close {
  background: none;
  border: 0;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  line-height: 1;
  flex-shrink: 0;
}
.crop-modal__close:hover { background: var(--navy-tint); color: var(--navy); }
.crop-modal__canvas {
  padding: 20px 24px;
  background: #f5f7fc;
  overflow: hidden;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.crop-modal__canvas img {
  max-width: 100%;
  max-height: 60vh;
  display: block;
}
.crop-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border);
  background: #fff;
}

.cropper-view-box,
.cropper-face { border-radius: 4px; }
.cropper-view-box { outline: 2px solid #A6192E; outline-color: #A6192E; }
.cropper-line { background-color: #A6192E; }
.cropper-point { background-color: #A6192E; }
.cropper-bg { background-image: none; background-color: #0f172a; }

@media (max-width: 520px) {
  .crop-modal { padding: 0; }
  .crop-modal__inner {
    max-width: 100%;
    border-radius: 0;
    height: 100vh;
    max-height: 100vh;
  }
  .crop-modal__actions .btn { flex: 1; }
}

/* =========================================================================
   17. UTILITIES
   ========================================================================= */
.muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* =========================================================================
   18. RESPONSIVE — HEADER + DASHBOARD
   ========================================================================= */
@media (max-width: 780px) {
  .site-header .container {
    height: auto;
    min-height: 60px;
    padding: 12px 16px;
    gap: 12px;
    flex-wrap: wrap;
  }
  .site-brand { flex: 1 1 auto; min-width: 0; }
  .site-brand__name {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .site-brand__sub { display: none; }
  .site-brand__logo { max-height: 32px; }

  .site-nav {
    flex: 1 1 100%;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
    gap: 2px;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a {
    padding: 8px 12px;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
  }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .hero { padding: 28px 0 24px; }
  .hero__eyebrow { font-size: 10px; margin-bottom: 8px; }
  .hero__title { font-size: 1.7rem; line-height: 1.15; }
  .hero__subtitle { font-size: 14px; margin-bottom: 12px; }
  .hero__inner { gap: 20px; }
  .hero__stat { padding: 10px 16px; gap: 10px; }
  .hero__stat-icon { width: 32px; height: 32px; }
  .hero__stat-value { font-size: 15px; }
  .page-wrap { padding: 20px 0 40px; }
}

@media (max-width: 480px) {
  .site-brand__name { font-size: 13px; }
  .site-nav a { padding: 7px 11px; font-size: 12.5px; }
  .hero__title { font-size: 1.5rem; }
  .hero__subtitle { font-size: 13.5px; }
}


/* =========================================================================
   LEGEND — 4-COLUMN GRID (city/profession lists)
   Renders as: [City] [Count] [City] [Count]
   ========================================================================= */
.chart-legend--grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 20px;
}

/* Neutralize the parent flex column layout when grid is used */
.chart-legend--grid {
    flex-direction: unset;
}

.chart-legend--grid li {
    display: block;
}

.chart-legend--grid li a,
.chart-legend--grid li .chart-legend__static {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    color: var(--text);
    text-decoration: none;
    transition: background .12s ease, color .12s ease;
}

.chart-legend--grid li a:hover {
    background: var(--navy-tint);
    color: var(--navy);
    text-decoration: none;
}

.chart-legend--grid li strong {
    margin-left: auto;
    color: var(--navy);
    font-weight: 700;
}

@media (max-width: 780px) {
    .chart-legend--grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================================
   HOUSES CHART — allow horizontal scroll instead of squishing
   ========================================================================= */
.houses-wrap .manhattan-scroll {
    overflow-x: auto !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.houses-wrap .manhattan-scroll svg {
    min-width: auto !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    display: block;
}

/* =========================================================================
   HOUSES + QUAD — two-column side-by-side layout
   ========================================================================= */
.houses-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: stretch;
}

/* Remove the old single-column centering */
.houses-wrap > .chart-card {
    width: 100%;
    max-width: none;
    margin: 0;
}

/* Quad image card */
.quad-card {
    display: flex;
    flex-direction: column;
}
.quad-card__image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
}
.quad-card__image img {
    width: 100%;
    height: auto;
    max-height: 380px;
    object-fit: contain;
    display: block;
    border-radius: var(--radius);
}

/* Responsive: stack on tablets/mobile */
@media (max-width: 900px) {
    .houses-wrap {
        grid-template-columns: 1fr;
    }
}

/* =========================================================================
   HEADER — bigger logo + site title
   ========================================================================= */
.site-header .container {
    height: 84px;
    gap: 28px;
}

.site-brand {
    gap: 16px;
}

.site-brand__logo {
    max-height: 60px;
    width: auto;
}

.site-brand__mark {
    width: 48px;
    height: 48px;
    font-size: 16px;
    border-radius: 12px;
}

.site-brand__name {
    font-size: 19px;
    letter-spacing: -0.015em;
}

.site-brand__sub {
    font-size: 13px;
    margin-top: 2px;
}

.site-nav a {
    padding: 9px 16px;
    font-size: 15px;
}

@media (max-width: 780px) {
    .site-header .container {
        height: auto;
        min-height: 68px;
        padding: 12px 16px;
    }
    .site-brand__logo { max-height: 44px; }
    .site-brand__mark { width: 40px; height: 40px; font-size: 13px; border-radius: 10px; }
    .site-brand__name { font-size: 16px; }
    .site-brand__sub  { font-size: 11.5px; }
    .site-nav a { padding: 8px 13px; font-size: 14px; }
}

/* =========================================================================
   STORE — Product grid
   ========================================================================= */
.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}
.store-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.store-card__image {
    aspect-ratio: 4 / 3;
    background: var(--navy-tint);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.store-card__image img { width: 100%; height: 100%; object-fit: cover; }
.store-card__placeholder {
    color: var(--text-subtle);
    font-size: 13px;
    font-weight: 500;
}
.store-card__body {
    padding: 20px 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}
.store-card__name {
    font-size: 17px;
    font-weight: 700;
    color: var(--navy);
    margin: 0;
    letter-spacing: -0.015em;
}
.store-card__price {
    font-size: 15px;
    font-weight: 700;
    color: var(--crimson);
    margin: 0;
}
.store-card__desc {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.55;
    margin: 4px 0 8px;
}
.store-card__unavailable {
    font-size: 13px;
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin: 4px 0 0;
}
.store-card__form {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 8px;
}
.store-card__row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.store-card__row label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
    width: 70px;
    flex-shrink: 0;
}
.store-card__row select,
.store-card__row input[type="number"] {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: #fff;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
}
.store-card__row select:focus,
.store-card__row input:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(27, 42, 107, 0.08);
}

.store-cart-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 14px 20px;
    background: var(--navy-tint);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    font-size: 14px;
    color: var(--text);
}

.nav-cart-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 6px;
    background: var(--crimson);
    color: #fff;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1;
}

/* =========================================================================
   CART PAGE
   ========================================================================= */
.cart-table {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 20px;
}
.cart-table__head,
.cart-row {
    display: grid;
    grid-template-columns: 56px 1fr 90px 110px 120px 40px;
    gap: 16px;
    align-items: center;
    padding: 14px 20px;
}
.cart-table__head {
    background: #fafbfd;
    border-bottom: 1px solid var(--border);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-subtle);
}
.cart-row { border-bottom: 1px solid var(--border); }
.cart-row:last-child { border-bottom: 0; }

.cart-row__image {
    width: 56px; height: 56px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--navy-tint);
}
.cart-row__image img { width: 100%; height: 100%; object-fit: cover; }
.cart-row__placeholder { width: 100%; height: 100%; background: var(--navy-light); }

.cart-row__name {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--navy);
}
.cart-row__size {
    font-size: 13.5px;
    color: var(--text-muted);
}
.cart-row__qty input {
    width: 80px;
    padding: 6px 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
}
.cart-row__qty input:focus { outline: none; border-color: var(--navy); }
.cart-row__subtotal {
    font-size: 14px;
    font-weight: 600;
    color: var(--navy);
    text-align: right;
}
.cart-row__remove { display: flex; justify-content: flex-end; }
.cart-row__remove-btn {
    background: none;
    border: 0;
    font-size: 16px;
    color: var(--text-subtle);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    line-height: 1;
    font-family: inherit;
}
.cart-row__remove-btn:hover {
    background: var(--crimson-light);
    color: var(--crimson);
}

.cart-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}
.cart-actions__continue {
    font-size: 13.5px;
    color: var(--text-muted);
    text-decoration: underline;
}

.cart-checkout {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 32px 32px;
}
.cart-checkout__title {
    margin: 0 0 22px;
    font-size: 17px;
    font-weight: 700;
    color: var(--navy);
}
.cart-checkout__footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}
.cart-checkout__total { display: flex; flex-direction: column; gap: 2px; }
.cart-checkout__total span {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-subtle);
}
.cart-checkout__total strong {
    font-size: 26px;
    font-weight: 800;
    color: var(--crimson);
    letter-spacing: -0.02em;
}
.cart-checkout__total small {
    font-size: 12.5px;
    color: var(--text-muted);
}

@media (max-width: 780px) {
    .cart-table__head { display: none; }
    .cart-row {
        grid-template-columns: 56px 1fr 40px;
        grid-template-areas:
            "image name    remove"
            "image details remove";
        gap: 8px 14px;
        padding: 16px 18px;
    }
    .cart-row__image    { grid-area: image; }
    .cart-row__name     { grid-area: name; }
    .cart-row__size     { display: none; }
    .cart-row__qty      { grid-column: 2 / 3; }
    .cart-row__subtotal { grid-column: 2 / 3; text-align: left; font-size: 13.5px; }
    .cart-row__remove   { grid-area: remove; align-items: flex-start; }
    .cart-checkout      { padding: 22px 20px 26px; }
    .cart-checkout__total strong { font-size: 22px; }
}

/* =========================================================================
   STORE — product image gallery
   ========================================================================= */
.store-card__gallery {
    display: flex;
    flex-direction: column;
    background: #fff;
}
.store-card__main-image {
    aspect-ratio: 4 / 3;
    background: var(--navy-tint);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.store-card__main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.store-card__thumbs {
    display: flex;
    gap: 6px;
    padding: 10px 12px 0;
    flex-wrap: wrap;
}
.store-card__thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    padding: 0;
    border: 2px solid transparent;
    background: none;
    cursor: pointer;
    transition: border-color .15s ease;
    flex-shrink: 0;
}
.store-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.store-card__thumb.is-active { border-color: var(--navy); }
.store-card__thumb:hover { border-color: var(--border-strong); }


/* Out-of-stock states in store */
.store-card select option:disabled {
    color: #94a3b8;
}
.store-card__unavailable {
    margin-bottom: 8px;
}