:root {
  --navy: #073763;
  --navy-dark: #061f3a;
  --teal: #0f9a9a;
  --teal-dark: #0f766e;
  --ink: #172033;
  --slate: #506070;
  --muted: #6b7a90;
  --line: #dbe4ef;
  --bg: #f6f9fc;
  --card: #ffffff;
  --blue-soft: #edf6ff;
  --teal-soft: #e6fffb;
  --shadow: 0 18px 45px rgba(7, 55, 99, 0.09);
  --radius: 24px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
}

a { color: inherit; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: white;
  padding: 12px 16px;
  border: 1px solid var(--line);
  z-index: 100;
}

.skip-link:focus { left: 16px; top: 16px; }

.site-header {
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
}

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 28px 22px;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--navy);
  color: var(--navy);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 900;
  font-size: 20px;
  letter-spacing: -0.12em;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px rgba(7, 55, 99, 0.13);
  position: relative;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border-right: 3px solid var(--teal);
  border-bottom: 3px solid var(--teal);
}

.brand-text strong {
  display: block;
  color: var(--navy-dark);
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.brand-text span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.nav-links {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--slate);
  font-size: 15px;
}

.nav-links a {
  text-decoration: none;
  padding: 8px 0;
}

.nav-links a:hover { color: var(--teal-dark); }

.nav-cta {
  padding: 10px 15px !important;
  background: linear-gradient(135deg, var(--navy), var(--teal-dark));
  color: white !important;
  border-radius: 999px;
  font-weight: 800;
}

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 8%, rgba(15,154,154,0.18), transparent 30%),
    radial-gradient(circle at 88% 14%, rgba(7,55,99,0.14), transparent 30%),
    linear-gradient(135deg, #ffffff 0%, #f4fbff 46%, #eafffb 100%);
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  padding-top: 76px;
  padding-bottom: 76px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  background: var(--teal-soft);
  color: var(--teal-dark);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 18px;
  border: 1px solid rgba(15,154,154,0.18);
}

.hero h1 {
  color: var(--navy-dark);
  font-size: clamp(42px, 7vw, 68px);
  line-height: 0.98;
  letter-spacing: -0.055em;
  margin: 0 0 24px;
}

.hero p {
  color: var(--slate);
  font-size: 21px;
  max-width: 720px;
  margin: 0 0 34px;
}

.button-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 22px;
  border-radius: 14px;
  font-weight: 850;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}

.button-primary {
  background: linear-gradient(135deg, var(--navy), var(--teal-dark));
  color: white;
  box-shadow: 0 16px 28px rgba(7, 55, 99, 0.22);
}

.button-secondary {
  background: white;
  color: var(--navy-dark);
  border-color: var(--line);
}

.hero-panel {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(219, 228, 239, 0.95);
  border-radius: 30px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.hero-panel h2 {
  margin-top: 0;
  font-size: 22px;
}

.hero-panel .mini-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  margin-top: 14px;
}

.hero-panel .mini-card strong {
  color: var(--navy-dark);
  display: block;
  margin-bottom: 4px;
}

.hero-panel .mini-card p {
  font-size: 15px;
  margin: 0;
  color: var(--slate);
}

.hero-panel .mini-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.hero-panel .mini-card-link:hover {
  transform: translateY(-2px);
  border-color: rgba(15,154,154,0.35);
  box-shadow: 0 14px 28px rgba(7, 55, 99, 0.08);
}

.hero-panel .mini-card-link span {
  display: inline-block;
  margin-top: 10px;
  color: var(--teal-dark);
  font-weight: 900;
  font-size: 14px;
}

.section { margin-top: 76px; }

.section-heading {
  max-width: 800px;
  margin-bottom: 28px;
}

.kicker {
  color: var(--teal-dark);
  font-size: 14px;
  text-transform: uppercase;
  font-weight: 950;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}

h1, h2, h3 { color: var(--navy-dark); }

h2 {
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.035em;
  margin: 0 0 14px;
}

h3 {
  font-size: 21px;
  margin: 0 0 10px;
}

.section-heading p,
.lead {
  color: var(--slate);
  font-size: 18px;
  margin: 0;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

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

.card,
.education-card,
.content-card,
.tool-box,
.assessment-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: 0 10px 30px rgba(7, 55, 99, 0.05);
}

.card-link {
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card-link:hover {
  transform: translateY(-3px);
  border-color: rgba(15,154,154,0.35);
  box-shadow: var(--shadow);
}

.icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: linear-gradient(135deg, #eef7ff, #e6fffb);
  display: grid;
  place-items: center;
  font-size: 22px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
}

.card p,
.content-card p,
.education-card p,
.card li {
  color: var(--slate);
}

.card p { margin: 0; }

.feature {
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  color: white;
  border-radius: 30px;
  padding: 38px;
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 30px;
  align-items: center;
  box-shadow: var(--shadow);
}

.feature h2 { color: white; }
.feature p { color: #d7e3f0; }

.feature-list {
  display: grid;
  gap: 12px;
}

.feature-item {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 16px;
  border-radius: 18px;
  color: #edf6ff;
}

.content-card ul,
.education-card ul {
  margin: 0 0 16px;
  padding-left: 22px;
  color: var(--slate);
}

.content-card li,
.education-card li { margin-bottom: 9px; }

.source-link {
  display: inline-flex;
  margin-top: 14px;
  color: var(--teal-dark);
  font-weight: 900;
  text-decoration: none;
}

.source-link:hover { text-decoration: underline; }

.page-title {
  background:
    radial-gradient(circle at 12% 8%, rgba(15,154,154,0.16), transparent 30%),
    linear-gradient(135deg, #ffffff, #f0f8ff);
  border-bottom: 1px solid var(--line);
}

.page-title .container {
  padding-top: 58px;
  padding-bottom: 58px;
}

.breadcrumb {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 18px;
}

.breadcrumb a {
  color: var(--teal-dark);
  text-decoration: none;
  font-weight: 800;
}

.page-title h1 {
  font-size: clamp(38px, 6vw, 58px);
  line-height: 1.03;
  letter-spacing: -0.05em;
  margin: 0 0 16px;
}

.page-title p {
  color: var(--slate);
  font-size: 19px;
  max-width: 820px;
  margin: 0;
}

.notice {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  border-radius: 18px;
  padding: 18px;
  margin-top: 24px;
}

.contact-box {
  background: linear-gradient(135deg, var(--navy), var(--teal-dark));
  color: white;
  border-radius: 30px;
  padding: 38px;
  text-align: center;
  box-shadow: var(--shadow);
}

.contact-box h2 { color: white; }
.contact-box p { color: #dbeafe; font-size: 18px; }

.disclaimer {
  font-size: 14px;
  color: var(--muted);
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
}

/* Tools */
.tool-grid,
.assessment-grid {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.tool-question,
.assessment-question {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fafc;
}

.tool-question p,
.assessment-question p {
  margin: 0;
  color: var(--slate);
}

.answer-options {
  display: flex;
  gap: 8px;
  white-space: nowrap;
}

.answer-options label {
  cursor: pointer;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 999px;
  font-weight: 800;
  color: var(--slate);
}

.answer-options input { margin-right: 5px; }

.result-box {
  margin-top: 22px;
  padding: 20px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #eff6ff;
}

.result-low { background: #ecfdf5; border-color: #a7f3d0; }
.result-intermediate { background: #fffbeb; border-color: #fde68a; }
.result-high { background: #fef2f2; border-color: #fecaca; }

.sleep-diary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.sleep-diary-field label {
  display: block;
  color: var(--navy-dark);
  font-weight: 900;
  margin-bottom: 6px;
}

.sleep-diary-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  font-size: 16px;
}

.step-list {
  counter-reset: steps;
  display: grid;
  gap: 14px;
}

.step-card { position: relative; padding-left: 68px; }

.step-card::before {
  counter-increment: steps;
  content: counter(steps);
  position: absolute;
  left: 22px;
  top: 24px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--navy), var(--teal));
  color: white;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.printable-diary {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  overflow-x: auto;
}

.diary-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 14px;
}

.diary-table th,
.diary-table td {
  border: 1px solid #cbd5e1;
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.diary-table th {
  background: #f1f5f9;
  color: var(--navy-dark);
}

.print-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

/* Insomnia page declutter */
.compact-section {
  margin-top: 42px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 18px;
  align-items: start;
}

.summary-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.summary-pill {
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 13px;
  color: var(--slate);
  font-weight: 800;
  font-size: 14px;
}

details.content-card summary {
  cursor: pointer;
  color: var(--navy-dark);
  font-weight: 900;
  font-size: 19px;
  list-style: none;
}

details.content-card summary::-webkit-details-marker { display: none; }

details.content-card summary::after {
  content: "+";
  float: right;
  color: var(--teal-dark);
  font-size: 24px;
  line-height: 1;
}

details.content-card[open] summary::after {
  content: "–";
}

details.content-card > div {
  margin-top: 16px;
}

.site-footer {
  margin-top: 76px;
  padding: 38px 22px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  border-top: 1px solid var(--line);
  background: white;
}

.footer-links { margin-top: 10px; }

.footer-links a {
  color: var(--teal-dark);
  text-decoration: none;
  margin: 0 8px;
  font-weight: 800;
}

@media (max-width: 900px) {
  .hero-grid,
  .feature,
  .grid-3,
  .grid-2,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    padding-top: 54px;
    padding-bottom: 54px;
  }

  .nav-links { width: 100%; }

  .sleep-diary-grid { grid-template-columns: 1fr; }

  .tool-question,
  .assessment-question {
    grid-template-columns: 1fr;
  }

  .answer-options { flex-wrap: wrap; }
}

@media (max-width: 560px) {
  .container { padding-left: 18px; padding-right: 18px; }
  .hero p { font-size: 18px; }
  .button { width: 100%; }
  .feature, .contact-box { padding: 26px; }
  .step-card { padding-left: 24px; padding-top: 62px; }
  .step-card::before { left: 24px; top: 22px; }
}

@media print {
  header, footer, .site-header, .site-footer, .nav-links, .button-row, .print-hide {
    display: none !important;
  }

  body { background: white; }
  .container { max-width: none; padding: 0; }
  .printable-diary { border: none; box-shadow: none; padding: 0; }
  .diary-table th, .diary-table td { padding: 8px; }
}


/* Improved accordion cards */
.accordion-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  box-shadow: 0 10px 30px rgba(7, 55, 99, 0.05);
  overflow: hidden;
}

.accordion-button {
  width: 100%;
  text-align: left;
  background: white;
  border: none;
  padding: 24px 26px;
  font-size: 19px;
  font-weight: 900;
  color: var(--navy-dark);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.accordion-button span {
  color: var(--teal-dark);
  font-size: 24px;
  line-height: 1;
}

.accordion-content {
  display: none;
  padding: 0 26px 24px;
  color: var(--slate);
}

.accordion-card.open .accordion-content {
  display: block;
}

.accordion-content ul {
  margin: 0;
  padding-left: 22px;
}

.accordion-content li {
  margin-bottom: 9px;
}

/* Improved on-page sleep diary preview */
.diary-preview-card {
  background: linear-gradient(135deg, #ffffff, #f7fcff);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: 0 10px 30px rgba(7, 55, 99, 0.05);
}

.diary-mini-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.diary-mini-day {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 8px;
  text-align: center;
  color: var(--slate);
  font-weight: 800;
  font-size: 13px;
}

.diary-mini-day strong {
  display: block;
  color: var(--navy-dark);
  margin-bottom: 6px;
}

/* Full printable diary page */
.print-page {
  background: white;
  color: #172033;
}

.print-page .print-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px;
}

.print-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  border-bottom: 4px solid var(--navy);
  padding-bottom: 18px;
  margin-bottom: 22px;
}

.print-brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.print-brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid var(--navy);
  color: var(--navy);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -0.12em;
  display: grid;
  place-items: center;
}

.print-header h1 {
  margin: 0;
  font-size: 28px;
  color: var(--navy-dark);
}

.print-header p {
  margin: 4px 0 0;
  color: var(--slate);
  font-size: 14px;
}

.print-instructions {
  background: #f4fbff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--teal);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 18px;
  color: var(--slate);
}

.print-info-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.7fr 0.7fr;
  gap: 12px;
  margin-bottom: 18px;
}

.print-field {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px;
  min-height: 42px;
}

.print-field strong {
  display: block;
  font-size: 12px;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.print-diary-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  overflow: hidden;
  border: 1px solid #9fb3c8;
  border-radius: 14px;
}

.print-diary-table th {
  background: var(--navy);
  color: white;
  padding: 9px 7px;
  text-align: left;
  border-right: 1px solid rgba(255,255,255,0.25);
  vertical-align: bottom;
}

.print-diary-table th:last-child {
  border-right: none;
}

.print-diary-table td {
  border-top: 1px solid #cbd5e1;
  border-right: 1px solid #cbd5e1;
  padding: 10px 7px;
  height: 46px;
  vertical-align: top;
  background: white;
}

.print-diary-table tr:nth-child(even) td {
  background: #f8fafc;
}

.print-diary-table td:last-child {
  border-right: none;
}

.print-footer-note {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.print-note-box {
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  min-height: 72px;
  padding: 10px;
}

.print-note-box strong {
  color: var(--navy);
  font-size: 13px;
}

.print-actions-top {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-bottom: 18px;
}

@media print {
  @page {
    size: landscape;
    margin: 0.35in;
  }

  .print-actions-top {
    display: none !important;
  }

  .print-page .print-container {
    max-width: none;
    padding: 0;
  }

  .print-header {
    margin-bottom: 12px;
    padding-bottom: 12px;
  }

  .print-instructions {
    margin-bottom: 12px;
    padding: 10px 12px;
  }

  .print-diary-table th {
    padding: 7px 5px;
  }

  .print-diary-table td {
    height: 39px;
    padding: 7px 5px;
  }
}

@media (max-width: 800px) {
  .diary-mini-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .print-info-grid,
  .print-footer-note {
    grid-template-columns: 1fr;
  }
}



/* Final SB monogram match */
.brand-mark {
  width: 48px !important;
  height: 48px !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  border: 1px solid #dbe4ef !important;
  box-shadow: 0 10px 24px rgba(7, 55, 99, 0.10) !important;
  display: grid !important;
  place-items: center !important;
  overflow: hidden !important;
  color: transparent !important;
}

.brand-mark::before {
  content: "";
  width: 38px;
  height: 38px;
  display: block;
  background-image: url("favicon.svg");
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

.brand-mark::after {
  display: none !important;
}

/* Reliable native accordion replacement */
.clean-accordion {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(7, 55, 99, 0.05);
  overflow: hidden;
  padding: 0;
}

.clean-accordion summary {
  cursor: pointer;
  list-style: none;
  padding: 24px 26px;
  font-size: 19px;
  font-weight: 900;
  color: var(--navy-dark);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.clean-accordion summary::-webkit-details-marker {
  display: none;
}

.clean-accordion summary::after {
  content: "+";
  color: var(--teal-dark);
  font-size: 26px;
  line-height: 1;
  font-weight: 900;
}

.clean-accordion[open] summary::after {
  content: "–";
}

.clean-accordion .accordion-inner {
  padding: 0 26px 24px;
  color: var(--slate);
}

.clean-accordion .accordion-inner ul {
  margin: 0;
  padding-left: 22px;
}

.clean-accordion .accordion-inner li {
  margin-bottom: 9px;
}

/* Hide old broken accordion if any survives */
.accordion-card {
  display: none !important;
}

/* Fillable print diary styling */
.fillable-line,
.fillable-cell,
.fillable-note {
  display: block;
  width: 100%;
  min-height: 24px;
  outline: none;
  border-radius: 6px;
  padding: 3px 4px;
}

.fillable-line {
  min-height: 26px;
  border-bottom: 1px solid #94a3b8;
}

.fillable-cell {
  min-height: 34px;
}

.fillable-note {
  min-height: 78px;
}

.fillable-line:focus,
.fillable-cell:focus,
.fillable-note:focus {
  background: #eff6ff;
  box-shadow: inset 0 0 0 1px #0f9a9a;
}

@media print {
  .fillable-line:focus,
  .fillable-cell:focus,
  .fillable-note:focus {
    background: transparent;
    box-shadow: none;
  }
}


/* Favicon/logo reset to original SB monogram style */
.brand-mark {
  width: 48px !important;
  height: 48px !important;
  border: none !important;
  border-radius: 50% !important;
  background: url("favicon.png") center / contain no-repeat !important;
  box-shadow: 0 10px 24px rgba(7, 55, 99, 0.10) !important;
  color: transparent !important;
  overflow: hidden !important;
}

.brand-mark::before,
.brand-mark::after {
  display: none !important;
  content: none !important;
}
