:root {
  --navy: #082a60;
  --navy-2: #0d3a78;
  --ink: #15233d;
  --muted: #667085;
  --line: #dce3ef;
  --paper: #f6f8fc;
  --white: #fff;
  --gold: #d5a633;
  --gold-soft: #fff5d6;
  --blue-soft: #edf4ff;
  --green: #217a55;
  --amber: #a86612;
  --red: #b4233a;
  --shadow: 0 18px 46px rgba(8, 42, 96, .09);
  --soft-shadow: 0 10px 24px rgba(8, 42, 96, .06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255,255,255,.97), rgba(246,248,252,.98)),
    url("./assets/highmark-journey-hero.png") top right / 880px auto no-repeat fixed;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 14px 32px;
  border-bottom: 1px solid rgba(220, 227, 239, .9);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.brand img {
  width: 188px;
  height: auto;
  flex: 0 0 auto;
}

.brand span,
.section-head span,
.parent-summary span,
.progress-card span,
.data-card span,
.share-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.brand h1 {
  margin: 4px 0 0;
  color: var(--navy);
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.15;
  letter-spacing: 0;
}

.mode-tabs {
  display: inline-flex;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
  background: #fff;
}

.tab {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 7px 13px;
  color: var(--navy);
  background: transparent;
  font-weight: 900;
}

.tab.active {
  color: #17223a;
  background: var(--gold);
}

main {
  width: min(1440px, calc(100vw - 40px));
  margin: 18px auto 42px;
}

.hidden { display: none !important; }

.family-view,
.coach-view,
.data-view {
  display: grid;
  gap: 18px;
}

.family-hero,
.journey-card,
.white-panel,
.parent-summary,
.coach-editor,
.student-rail,
.upload-board,
.data-card,
.progress-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.95);
  box-shadow: var(--shadow);
}

.family-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 278px;
  gap: 28px;
  min-height: 390px;
  padding: 40px;
  overflow: hidden;
  position: relative;
}

.family-hero::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -70px;
  width: 580px;
  height: 280px;
  border-top: 2px solid var(--gold);
  transform: rotate(-7deg);
  opacity: .48;
}

.hero-copy,
.progress-card {
  position: relative;
  z-index: 1;
}

.service-label {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 4px 11px;
  color: var(--navy);
  background: var(--blue-soft);
  font-size: 12px;
  font-weight: 900;
}

.family-hero h2 {
  margin: 18px 0 0;
  max-width: 860px;
  color: var(--navy);
  font-size: clamp(46px, 6vw, 82px);
  line-height: 1.02;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.family-hero p {
  max-width: 740px;
  margin: 18px 0 0;
  color: #4d596d;
  font-size: 18px;
  line-height: 1.75;
  overflow-wrap: break-word;
}

.journey-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.journey-meta span {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  border: 1px solid #dbe5f2;
  border-radius: 999px;
  padding: 5px 11px;
  color: #30405f;
  background: rgba(255,255,255,.82);
  font-size: 13px;
  font-weight: 800;
}

.hero-actions,
.ops-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 26px;
}

.select,
.input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 12px;
  color: var(--ink);
  background: #fff;
}

.primary-button,
.secondary-button {
  min-height: 42px;
  border: 1px solid var(--gold);
  border-radius: 6px;
  padding: 9px 14px;
  color: #17223a;
  background: var(--gold);
  font-weight: 900;
}

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

.progress-card {
  align-self: stretch;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
}

.progress-card small {
  display: block;
  max-width: 190px;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.5;
}

.big-ring {
  --pct: 0%;
  display: grid;
  place-items: center;
  width: 176px;
  height: 176px;
  margin: 16px 0;
  border-radius: 50%;
  background: conic-gradient(var(--gold) var(--pct), #e7edf6 0);
}

.big-ring strong {
  display: grid;
  place-items: center;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  color: var(--navy);
  background: #fff;
  font-size: 34px;
}

.progress-card p {
  margin: 0;
  color: var(--navy);
  font-weight: 900;
}

.snapshot-grid,
.metrics-row,
.data-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.snapshot,
.metric,
.data-card {
  min-height: 108px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255,255,255,.96);
  box-shadow: var(--soft-shadow);
}

.snapshot strong,
.metric strong,
.data-card strong {
  display: block;
  margin-top: 8px;
  color: var(--navy);
  font-size: 24px;
  line-height: 1.25;
  overflow-wrap: break-word;
}

.snapshot span,
.metric span {
  color: var(--muted);
  font-size: 12px;
}

.journey-card,
.white-panel,
.parent-summary {
  padding: 22px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 16px;
}

.section-head strong {
  color: var(--navy);
  font-size: 20px;
}

.stage-narrative {
  max-width: 900px;
  margin: -2px 0 18px;
  color: #3d4b65;
  font-size: 17px;
  line-height: 1.75;
}

.journey-road {
  display: grid;
  grid-template-columns: repeat(8, minmax(118px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.milestone {
  position: relative;
  min-height: 168px;
  border: 1px solid #e2e8f2;
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.milestone::before {
  content: "";
  position: absolute;
  left: 42px;
  right: -20px;
  top: 29px;
  height: 2px;
  background: #dbe3ef;
}

.milestone:last-child::before { display: none; }

.milestone.done { background: #f8fbff; }
.milestone.current {
  border-color: var(--gold);
  background: #fffaf0;
  box-shadow: inset 0 0 0 1px rgba(213,166,51,.2);
}

.node {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  background: var(--navy);
  font-size: 12px;
  font-weight: 900;
}

.milestone.current .node {
  color: #17223a;
  background: var(--gold);
}

.milestone strong {
  display: block;
  margin-top: 14px;
  color: var(--navy);
  font-size: 17px;
}

.milestone p,
.timeline-item p,
.task-item p,
.parent-summary p,
.upload-board p,
.student-meta,
.health-list p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.milestone em {
  display: inline-block;
  margin-top: 10px;
  color: var(--navy);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.family-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr) minmax(280px, .72fr);
  gap: 18px;
}

.timeline-list,
.task-list,
.health-list,
.student-list {
  display: grid;
  gap: 10px;
}

.timeline-item,
.task-item,
.student-card,
.health-item,
.assurance-item {
  border: 1px solid #e3e9f3;
  border-left: 4px solid var(--navy);
  border-radius: 6px;
  padding: 13px;
  background: rgba(255,255,255,.72);
}

.timeline-item strong,
.task-item strong,
.student-card strong,
.health-item strong,
.assurance-item strong {
  display: block;
  color: var(--navy);
}

.timeline-item span,
.task-item span,
.assurance-item span {
  color: var(--muted);
  font-size: 12px;
}

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

.assurance-item.gold { border-left-color: var(--gold); }
.assurance-item.green { border-left-color: var(--green); }
.assurance-item.amber { border-left-color: var(--amber); }
.assurance-item.red { border-left-color: var(--red); }

.assurance-item p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.parent-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 20px;
  align-items: center;
  background:
    linear-gradient(90deg, rgba(255,255,255,.96), rgba(255,250,240,.94)),
    url("./assets/highmark-journey-hero.png") right center / 420px auto no-repeat;
}

.priority-summary {
  border-color: rgba(213,166,51,.45);
}

.parent-summary p {
  color: var(--ink);
  font-size: 18px;
}

.coach-signature {
  border-left: 1px solid var(--line);
  padding-left: 20px;
}

.coach-signature strong {
  display: block;
  margin-top: 8px;
  color: var(--navy);
  font-size: 28px;
}

.coach-view {
  grid-template-columns: 340px minmax(0, 1fr);
  align-items: start;
}

.student-rail,
.coach-editor {
  padding: 16px;
}

.rail-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}

.rail-head strong {
  color: var(--navy);
  font-size: 20px;
}

.rail-head span {
  color: var(--gold);
  font-size: 24px;
  font-weight: 900;
}

.student-list {
  max-height: 680px;
  overflow: auto;
}

.student-card {
  cursor: pointer;
}

.student-card.active,
.student-card:hover {
  border-color: var(--navy);
  box-shadow: 0 12px 26px rgba(8,42,96,.08);
}

.mini-progress {
  height: 6px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f6;
}

.mini-progress div {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--navy), var(--gold));
}

.coach-main {
  display: grid;
  gap: 14px;
}

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

.editor-grid label {
  display: grid;
  gap: 6px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 900;
}

.editor-grid label.wide { grid-column: 1 / -1; }

.editor-grid input,
.editor-grid select,
.editor-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  color: var(--ink);
  background: #fff;
}

.editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.upload-board {
  position: relative;
  min-height: 260px;
  padding: 34px;
  overflow: hidden;
}

.upload-board input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-board.dragging {
  border-color: var(--gold);
  background: #fffaf0;
}

.upload-badge {
  display: inline-grid;
  place-items: center;
  width: 62px;
  height: 34px;
  border-radius: 6px;
  color: var(--navy);
  background: var(--blue-soft);
  font-size: 12px;
  font-weight: 900;
}

.upload-board h2 {
  margin: 18px 0 0;
  color: var(--navy);
  font-size: clamp(32px, 5vw, 56px);
}

.upload-board p {
  max-width: 820px;
  font-size: 17px;
}

.share-sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 42, 96, .28);
}

.share-card {
  position: relative;
  width: min(560px, 100%);
  border-radius: 8px;
  padding: 24px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(8, 42, 96, .24);
}

.share-card strong {
  display: block;
  margin-top: 8px;
  color: var(--navy);
  font-size: 22px;
}

.share-card textarea {
  width: 100%;
  min-height: 116px;
  margin: 16px 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  color: var(--ink);
  resize: vertical;
}

.close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--navy);
  font-size: 22px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 50;
  transform: translateX(-50%) translateY(18px);
  opacity: 0;
  border-radius: 999px;
  padding: 10px 16px;
  color: #fff;
  background: var(--navy);
  box-shadow: var(--shadow);
  pointer-events: none;
  transition: .2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.green { color: var(--green); }
.amber { color: var(--amber); }
.red { color: var(--red); }

@media (max-width: 1120px) {
  .site-header,
  .family-hero,
  .parent-summary {
    grid-template-columns: 1fr;
  }

  .site-header {
    position: static;
    align-items: flex-start;
  }

  .coach-view,
  .family-grid {
    grid-template-columns: 1fr;
  }

  .snapshot-grid,
  .metrics-row,
  .data-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .coach-signature {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 18px 0 0;
  }
}

@media (max-width: 720px) {
  main {
    width: min(100% - 24px, 1440px);
    margin-top: 12px;
  }

  .site-header,
  .family-hero,
  .journey-card,
  .white-panel,
  .parent-summary,
  .upload-board {
    padding: 16px;
  }

  .site-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .brand {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .brand img { width: min(210px, 100%); }
  .mode-tabs { width: 100%; }
  .tab {
    flex: 1;
    padding-inline: 6px;
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
  }
  .family-hero {
    min-height: 0;
  }

  .family-hero h2 {
    font-size: 38px;
    line-height: 1.08;
  }

  .family-hero p {
    font-size: 15px;
  }

  .journey-meta span {
    width: 100%;
    justify-content: center;
    border-radius: 6px;
  }

  .progress-card {
    min-height: 244px;
  }

  .big-ring {
    width: 148px;
    height: 148px;
  }

  .big-ring strong {
    width: 108px;
    height: 108px;
    font-size: 30px;
  }

  .journey-road {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .milestone {
    min-height: 0;
  }

  .milestone::before {
    left: 29px;
    right: auto;
    top: 42px;
    bottom: -20px;
    width: 2px;
    height: auto;
  }

  .snapshot-grid,
  .metrics-row,
  .data-grid,
  .editor-grid {
    grid-template-columns: 1fr;
  }
}
