:root {
  --nh-gold: #f5c84b;
  --nh-bg: #050505;
  --nh-card: rgba(255,255,255,.05);
  --nh-border: rgba(255,255,255,.10);
  --nh-text: rgba(255,255,255,.88);
  --nh-muted: rgba(255,255,255,.60);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #000;
  color: white;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(circle at top, rgba(245,200,75,.08), transparent 30%),
    #000;
}

.bg-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .04;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 4px 4px;
  z-index: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(18px);
  background: rgba(0,0,0,.78);
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.nav-wrap {
  width: min(1400px, calc(100% - 40px));
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
}

.nh-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: white;
}

.nh-brand img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,.12);
}

.nh-brand strong {
  display: block;
  font-size: .95rem;
  letter-spacing: .24em;
  line-height: 1;
}

.nh-brand span {
  display: block;
  color: var(--nh-muted);
  font-size: .82rem;
  margin-top: 4px;
}

.top-nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.top-nav a {
  text-decoration: none;
  color: white;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  transition: .2s ease;
  font-weight: 800;
  font-size: .92rem;
}

.top-nav a:hover {
  background: rgba(245,200,75,.15);
  border-color: rgba(245,200,75,.35);
  transform: translateY(-2px);
}

.engineer-shell {
  position: relative;
  z-index: 1;
  width: min(1550px, calc(100% - 40px));
  margin: 40px auto 80px;
}

.engineer-main-card {
  max-width: 1220px;
  margin: 0 auto;
  border-radius: 34px;
  border: 1px solid var(--nh-border);
  background:
    radial-gradient(circle at top left, rgba(245,200,75,.12), transparent 35%),
    linear-gradient(to bottom right, rgba(255,255,255,.05), rgba(255,255,255,.02));
  backdrop-filter: blur(20px);
  padding: 34px;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0,0,0,.45);
}

.loading-card,
.error-card {
  min-height: 280px;
  display: grid;
  place-items: center;
  text-align: center;
}

.loading-card h1,
.error-card h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 5vw, 4rem);
}

.loading-card p,
.error-card p {
  color: var(--nh-muted);
  margin: 0;
}

.engineer-hero {
  display: grid;
  grid-template-columns: 180px minmax(0,1fr);
  gap: 34px;
  align-items: center;
}

.engineer-avatar {
  width: 180px;
  height: 180px;
  border-radius: 36px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
  flex-shrink: 0;
}

.engineer-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.eyebrow,
.panel-label {
  color: var(--nh-gold);
  text-transform: uppercase;
  letter-spacing: .2em;
  font-size: .76rem;
  font-weight: 900;
}

.eyebrow {
  margin-bottom: 10px;
}

.panel-label {
  margin-bottom: 10px;
}

.engineer-name {
  font-size: clamp(3rem, 7vw, 6rem);
  line-height: .92;
  margin: 0;
  letter-spacing: -.04em;
  word-break: break-word;
}

.engineer-tagline {
  margin-top: 16px;
  color: var(--nh-muted);
  font-size: 1.05rem;
  max-width: 760px;
  line-height: 1.7;
}

.engineer-pills,
.engineer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.engineer-pills {
  margin-top: 24px;
}

.engineer-actions {
  margin-top: 28px;
}

.pill {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  font-size: .92rem;
  font-weight: 800;
  color: rgba(255,255,255,.85);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary,
.btn-secondary {
  padding: 14px 22px;
  border-radius: 16px;
  text-decoration: none;
  font-weight: 900;
  transition: .2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  font-size: .95rem;
}

.btn-primary {
  background: var(--nh-gold);
  color: black;
  box-shadow: 0 18px 40px rgba(245,200,75,.25);
}

.btn-secondary {
  color: white;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
}

.btn-primary:hover,
.btn-secondary:hover {
  transform: translateY(-2px);
}

.profile-top-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  margin-top: 36px;
  align-items: start;
}

.calendar-location-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 24px;
  align-items: stretch;
}

.profile-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  margin-top: 24px;
  align-items: stretch;
}

.panel {
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  padding: 28px;
  margin-bottom: 24px;
  overflow: hidden;
}

.calendar-location-grid .panel,
.profile-bottom-grid .panel {
  margin-bottom: 0;
  min-height: 0;
}

.panel h2 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
}

.panel h3 {
  margin: 0 0 10px;
  font-size: 1.25rem;
}

.panel p {
  color: var(--nh-muted);
  line-height: 1.8;
  margin: 0;
}

.service-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 22px;
  border-radius: 22px;
  background: rgba(0,0,0,.24);
  border: 1px solid rgba(255,255,255,.08);
  margin-top: 18px;
  flex-wrap: wrap;
}

.service-card h3 {
  margin: 0 0 8px;
  font-size: 1.3rem;
}

.service-card strong {
  display: block;
  font-size: 1.4rem;
  margin-bottom: 10px;
  text-align: right;
}

.service-card .pill {
  font-size: .8rem;
  padding: 8px 12px;
  margin-top: 12px;
}

.service-card > div:last-child {
  min-width: 160px;
}

.sidebar {
  position: sticky;
  top: 110px;
  display: grid;
  gap: 24px;
}

.sidebar .panel {
  margin-bottom: 0;
}

.booking-steps {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.booking-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  color: rgba(255,255,255,.75);
  line-height: 1.7;
}

.booking-step span {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--nh-gold);
  color: black;
  font-weight: 900;
  font-size: .85rem;
}

iframe {
  width: 100%;
  height: 340px;
  border: 0;
  border-radius: 24px;
  margin-top: 20px;
  display: block;
}

.calendar-location-grid iframe {
  height: 390px;
  max-height: 390px;
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  margin-bottom: 16px;
}

.calendar-head h3 {
  margin: 0;
  font-size: 1.35rem;
}

.calendar-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: white;
  font-size: 1.6rem;
  font-weight: 900;
  cursor: pointer;
  transition: .2s ease;
}

.calendar-btn:hover {
  background: rgba(245,200,75,.15);
  border-color: rgba(245,200,75,.35);
}

.calendar-weekdays,
.booking-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

.calendar-weekdays span {
  color: var(--nh-muted);
  font-size: .82rem;
  font-weight: 900;
  text-align: center;
  padding: 8px 0;
}

.calendar-day {
  min-height: 82px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  color: white;
  cursor: pointer;
  padding: 12px;
  text-align: left;
  font-weight: 900;
  position: relative;
  transition: .2s ease;
}

.calendar-day:hover {
  border-color: rgba(245,200,75,.45);
  background: rgba(245,200,75,.10);
  transform: translateY(-1px);
}

.calendar-day.is-muted {
  opacity: .25;
  pointer-events: none;
}

.calendar-day.is-today {
  border-color: rgba(245,200,75,.55);
}

.calendar-day.is-selected {
  background: var(--nh-gold);
  color: black;
}

.calendar-day.is-available::after {
  content: "Available";
  position: absolute;
  left: 12px;
  bottom: 10px;
  font-size: .68rem;
  color: var(--nh-gold);
}

.calendar-day.is-selected::after {
  color: black;
}

.selected-date-box {
  margin-top: 18px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(245,200,75,.10);
  border: 1px solid rgba(245,200,75,.25);
  color: white;
  font-weight: 800;
  line-height: 1.6;
}

.selected-date-box .btn-primary {
  margin-top: 8px;
}

@media (max-width: 1200px) {
  .calendar-location-grid,
  .profile-bottom-grid {
    grid-template-columns: 1fr;
  }

  .calendar-location-grid iframe {
    height: 360px;
    max-height: 360px;
  }
}

@media (max-width: 1100px) {
  .profile-top-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    top: auto;
  }
}

@media (max-width: 760px) {
  .nav-wrap {
    width: min(100% - 24px, 1400px);
    flex-direction: column;
    gap: 18px;
    align-items: flex-start;
  }

  .top-nav {
    width: 100%;
  }

  .top-nav a {
    font-size: .85rem;
    padding: 9px 12px;
  }

  .engineer-shell {
    width: min(100% - 24px, 1450px);
    margin-top: 24px;
  }

  .engineer-main-card {
    padding: 22px;
    border-radius: 24px;
  }

  .engineer-hero {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .engineer-avatar {
    width: 130px;
    height: 130px;
    border-radius: 26px;
  }

  .engineer-name {
    font-size: clamp(2.6rem, 13vw, 4rem);
  }

  .panel {
    padding: 20px;
    border-radius: 22px;
  }

  .service-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .service-card strong {
    text-align: left;
  }

  .calendar-weekdays,
  .booking-calendar {
    gap: 6px;
  }

  .calendar-day {
    min-height: 58px;
    border-radius: 12px;
    padding: 8px;
    font-size: .85rem;
  }

  .calendar-day.is-available::after {
    display: none;
  }
}

/* ===== FINAL LAYOUT TUNING ===== */

.engineer-main-card {
  max-width: 1420px;
}

.profile-top-layout {
  grid-template-columns:
    minmax(0, 1fr)
    300px;
}

.calendar-location-grid {
  grid-template-columns:
    minmax(0, 1.25fr)
    minmax(340px, .75fr);
}

.profile-bottom-grid {
  grid-template-columns:
    minmax(0, 1fr)
    minmax(0, 1fr);
}

.calendar-location-grid .panel,
.profile-bottom-grid .panel {
  height: 100%;
}

.calendar-location-grid iframe {
  height: 320px;
  min-height: 320px;
}

.booking-calendar-panel {
  min-width: 0;
}

.service-card {
  min-height: 220px;
}

.sidebar {
  width: 100%;
}

.sidebar .panel:first-child {
  min-height: 360px;
}

.sidebar .panel:last-child {
  position: sticky;
  top: 500px;
}

@media (max-width: 1350px) {
  .profile-top-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    grid-template-columns: 1fr 1fr;
    display: grid;
  }
}

@media (max-width: 900px) {
  .calendar-location-grid,
  .profile-bottom-grid,
  .sidebar {
    grid-template-columns: 1fr;
  }

  .calendar-location-grid iframe {
    height: 360px;
  }

  .sidebar .panel:last-child {
    position: relative;
    top: auto;
  }
}

/* Make the page wider and stop columns from squeezing */
.engineer-main-card {
  max-width: 1500px;
}

.profile-top-layout {
  grid-template-columns: minmax(0, 1fr) 280px;
}

.calendar-location-grid {
  grid-template-columns: minmax(560px, 1.35fr) minmax(360px, .85fr);
}

/* Make map fill its card better */
.calendar-location-grid iframe {
  width: 100%;
  height: 430px;
  max-height: none;
}

/* Fix bottom cards */
.profile-bottom-grid {
  grid-template-columns: 1fr 1fr;
}

.profile-bottom-grid .panel {
  min-height: 260px;
}

/* Make service card look cleaner */
.service-card {
  align-items: flex-start;
}

.service-card > div:last-child {
  display: grid;
  justify-items: start;
  gap: 12px;
}

/* Responsive fallback */
@media (max-width: 1350px) {
  .profile-top-layout,
  .calendar-location-grid,
  .profile-bottom-grid {
    grid-template-columns: 1fr;
  }

  .calendar-location-grid iframe {
    height: 380px;
  }
}