:root {
  --orange: #FF6F00;
  --orange-dark: #D95E00;
  --orange-tint: #FFF1E6;
  --black: #000000;
  --white: #FFFFFF;
  --charcoal: #333333;
  --gray: #F7F7F7;
  --line: #E2E2E2;
  --muted: #6B6B6B;
  --green: #1F8A4C;
  --red: #C62828;
  --head: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --body: "Open Sans", "Helvetica Neue", Arial, sans-serif;
  --rail: 248px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--charcoal);
  background: var(--gray);
}

h1, h2, h3 { font-family: var(--head); color: var(--black); line-height: 1.2; margin: 0; }
h1 { font-size: clamp(1.75rem, 3vw, 2.25rem); font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: 1.375rem; font-weight: 800; }
h3 { font-size: 1.0625rem; font-weight: 700; }
p { margin: 0 0 0.75em; }
a { color: var(--orange-dark); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--head); font-weight: 700; font-size: 0.9375rem;
  padding: 12px 20px; border-radius: 6px; border: 2px solid var(--black);
  background: var(--black); color: var(--white); text-decoration: none; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--charcoal); border-color: var(--charcoal); }
.btn.primary { background: var(--orange); border-color: var(--orange); color: var(--black); }
.btn.primary:hover { background: var(--orange-dark); border-color: var(--orange-dark); }
.btn.ghost { background: transparent; color: var(--black); }
.btn.ghost:hover { background: var(--white); }
.btn.small { padding: 8px 14px; font-size: 0.8125rem; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn.done { background: var(--white); color: var(--green); border-color: var(--green); }

/* ---------- auth pages ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-brand {
  background: var(--black); color: var(--white); padding: 48px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.wordmark { font-family: var(--head); font-weight: 800; font-size: 1.125rem; color: var(--white); text-decoration: none; }
.wordmark span { color: var(--orange); }
.auth-brand h1 { color: var(--white); font-size: clamp(2rem, 4vw, 3rem); max-width: 12ch; }
.auth-brand .rule { width: 64px; height: 6px; background: var(--orange); margin-top: 24px; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 48px 24px; background: var(--white); }
.auth-form form { width: 100%; max-width: 380px; }
.auth-form h2 { margin-bottom: 8px; }
.auth-form .lead { color: var(--muted); margin-bottom: 28px; }
label { display: block; font-family: var(--head); font-weight: 700; font-size: 0.875rem; color: var(--black); margin-bottom: 6px; }
input[type=email], input[type=password] {
  width: 100%; font: inherit; padding: 12px 14px; border: 2px solid var(--line); border-radius: 6px;
  margin-bottom: 18px; background: var(--white);
}
input:focus { border-color: var(--orange); outline: none; }
.auth-form .btn { width: 100%; margin-top: 4px; }
.form-links { margin-top: 18px; font-size: 0.9rem; }
.msg { border-radius: 6px; padding: 12px 14px; margin-bottom: 18px; font-size: 0.9375rem; display: none; }
.msg.show { display: block; }
.msg.error { background: #FDECEC; color: var(--red); }
.msg.ok { background: #E8F5EE; color: var(--green); }

@media (max-width: 820px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: 28px 24px; gap: 28px; }
  .auth-brand h1 { font-size: 1.75rem; max-width: none; }
}

/* ---------- dashboard shell ---------- */
.shell { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; }
.rail {
  background: var(--black); color: var(--white); padding: 28px 20px;
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 32px;
}
.rail nav { display: flex; flex-direction: column; gap: 2px; }
.rail nav a {
  color: #CFCFCF; text-decoration: none; font-family: var(--head); font-weight: 600; font-size: 0.9rem;
  padding: 9px 12px; border-radius: 6px; border-left: 3px solid transparent;
}
.rail nav a:hover { color: var(--white); background: #1A1A1A; }
.rail nav a.active { color: var(--white); border-left-color: var(--orange); background: #1A1A1A; }
.rail .logout { margin-top: auto; background: none; border: 0; color: #9A9A9A; font: inherit; cursor: pointer; text-align: left; padding: 9px 12px; }
.rail .logout:hover { color: var(--white); }

.logout-m { display: none; background: none; border: 0; color: #9A9A9A; font: inherit; font-size: 0.875rem; cursor: pointer; }
.shell > * { min-width: 0; }
main { padding: 40px clamp(20px, 4vw, 56px) 80px; max-width: 980px; width: 100%; }

.hello { margin-bottom: 28px; }
.hello p { color: var(--muted); margin-top: 6px; }

/* the path: the one bold element on the page */
.path { background: var(--black); color: var(--white); border-radius: 10px; padding: 28px 28px 24px; margin-bottom: 20px; }
.path-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.path-top h2 { color: var(--white); font-size: 1rem; font-weight: 700; }
.path-top .now { font-family: var(--head); font-weight: 800; color: var(--orange); font-size: 1.25rem; }
.track-wrap { position: relative; }
.track-wrap::before { content: ""; position: absolute; top: 11px; left: var(--inset, 8.33%); right: var(--inset, 8.33%); height: 3px; background: #3A3A3A; }
.track-wrap .fill { position: absolute; top: 11px; left: var(--inset, 8.33%); height: 3px; background: var(--orange); }
.track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); position: relative; }
.track li { position: relative; text-align: center; font-size: 0.75rem; color: #9A9A9A; padding: 0 4px; }
.track .dot {
  width: 25px; height: 25px; border-radius: 50%; margin: 0 auto 10px; position: relative; z-index: 1;
  background: var(--black); border: 3px solid #3A3A3A;
}
.track li.done { color: #D6D6D6; }
.track li.done .dot { background: var(--orange); border-color: var(--orange); }
.track li.current { color: var(--white); font-weight: 700; }
.track li.current .dot { background: var(--white); border: 6px solid var(--orange); }

.next {
  background: var(--white); border-left: 6px solid var(--orange); border-radius: 0 8px 8px 0;
  padding: 18px 22px; margin-bottom: 40px;
}
.next h3 { margin-bottom: 4px; }
.next p { margin: 0; }
.paused-note { background: var(--orange-tint); }

/* sections */
section.block { margin-bottom: 48px; }
.block-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.block-head p { margin: 4px 0 0; color: var(--muted); font-size: 0.9375rem; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 22px; }

.locked {
  display: flex; gap: 14px; align-items: center; background: var(--white); border: 2px dashed var(--line);
  border-radius: 8px; padding: 20px 22px; color: var(--muted);
}
.locked .lock { font-size: 1.25rem; }

/* blueprint */
.bp-frame { width: 100%; height: 72vh; min-height: 480px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); }
.bp-actions { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }

/* videos */
.tabs { display: inline-flex; background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 4px; margin-bottom: 18px; }
.tabs button {
  font-family: var(--head); font-weight: 700; font-size: 0.875rem; border: 0; background: none; padding: 9px 16px; border-radius: 6px; cursor: pointer; color: var(--charcoal);
}
.tabs button[aria-selected=true] { background: var(--black); color: var(--white); }
.tabs .count { color: var(--orange); margin-left: 6px; }
.video-list { display: flex; flex-direction: column; gap: 18px; max-width: 760px; }
.video { background: var(--white); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.video.is-done { border-color: #BFE3CD; }
.video-embed { aspect-ratio: 16 / 9; background: #111; display: flex; align-items: center; justify-content: center; color: #9A9A9A; font-size: 0.9rem; }
.video-embed iframe { width: 100%; height: 100%; border: 0; }
.video-body { padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.video-body p { margin: 4px 0 0; color: var(--muted); font-size: 0.9rem; }
.video-num { font-family: var(--head); font-weight: 800; color: var(--orange); margin-right: 6px; }

/* two-column rows (forms, uploads, resources) */
.rows { background: var(--white); border: 1px solid var(--line); border-radius: 8px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 22px; flex-wrap: wrap; }
.row + .row { border-top: 1px solid var(--line); }
.row p { margin: 2px 0 0; color: var(--muted); font-size: 0.9rem; }
.row .meta { font-size: 0.8125rem; color: var(--muted); }
.row.is-locked { color: var(--muted); }
.row.is-locked h3 { color: var(--muted); }
.upload-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.upload-controls input[type=file] { font-size: 0.8125rem; max-width: 220px; }
.upload-status { font-size: 0.8125rem; width: 100%; text-align: right; min-height: 1.2em; }
.upload-status.error { color: var(--red); }
.upload-status.ok { color: var(--green); }

/* meeting */
.meeting { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; }
.meeting ul { padding-left: 20px; margin: 8px 0 16px; }
.meeting li { margin-bottom: 4px; }
.meeting .side { background: var(--black); color: var(--white); border-radius: 8px; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.meeting .side h3 { color: var(--white); }
.meeting .when { font-family: var(--head); font-weight: 800; font-size: 1.25rem; color: var(--orange); }
.meeting .side ul { color: #D6D6D6; font-size: 0.9rem; }
.meeting .closing { font-weight: 700; color: var(--black); margin: 0; }

/* community + tools */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.duo .panel { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.duo .panel p { color: var(--muted); margin: 0 0 6px; }

.loading { padding: 80px 0; text-align: center; color: var(--muted); }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--black); color: var(--white);
  padding: 12px 18px; border-radius: 6px; font-size: 0.9rem; opacity: 0; transition: opacity 0.2s; pointer-events: none; z-index: 10;
}
.toast.show { opacity: 1; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: sticky; height: auto; padding: 14px 16px; gap: 10px; flex-direction: column; z-index: 5; }
  .rail nav { flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  .rail nav a { white-space: nowrap; border-left: 0; border-bottom: 3px solid transparent; border-radius: 4px; padding: 7px 10px; }
  .rail nav a.active { border-bottom-color: var(--orange); }
  .rail .logout { display: none; }
  .rail-top { display: flex; justify-content: space-between; align-items: center; }
  .rail-top .logout-m { display: inline-block; }
  main { padding-top: 28px; }
  .meeting, .duo { grid-template-columns: 1fr; }
  .path { padding: 22px 16px 18px; }
  .track li { font-size: 0.625rem; }
  .track .dot { width: 20px; height: 20px; }
  .track-wrap::before, .track-wrap .fill { top: 9px; }
  .bp-frame { height: 60vh; min-height: 380px; }
}

/* Added features */
.goal { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 18px 22px; margin-bottom: 20px; }
.goal h3 { margin-bottom: 4px; }
.goal p { margin: 0; white-space: pre-line; }
.confirm-form { flex-direction: column; align-items: flex-start; }
.confirm-form .full { width: 100%; }
.confirm-form textarea { width: 100%; font: inherit; padding: 12px 14px; border: 2px solid var(--line); border-radius: 6px; resize: vertical; }
.confirm-form textarea:focus { border-color: var(--orange); outline: none; }
.confirm-form fieldset { border: 0; padding: 0; margin: 0; }
.confirm-form legend { font-family: var(--head); font-weight: 700; font-size: 0.875rem; color: var(--black); margin-bottom: 6px; padding: 0; }
.check { display: flex; align-items: center; gap: 8px; font-family: var(--body); font-weight: 400; font-size: 0.9375rem; color: var(--charcoal); margin: 0 0 6px; }
.confirm-actions { display: flex; align-items: center; gap: 14px; width: 100%; }
.confirm-actions .upload-status { width: auto; text-align: left; }
.goal .goal-help { margin-bottom: 10px; }
.tracker { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 18px 22px; margin-bottom: 16px; }
.tracker h3 { margin-bottom: 10px; }
.tracker ul { list-style: none; margin: 0; padding: 0; }
.tracker li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.tracker li:first-child { border-top: 0; }
.pill { font-family: var(--head); font-weight: 700; font-size: 0.75rem; padding: 4px 10px; border-radius: 999px; background: var(--gray); color: var(--charcoal); white-space: nowrap; }
.pill.done { background: #E8F5EE; color: var(--green); }
.pill.late { background: var(--orange-tint); color: var(--orange-dark); }
.banner { display: block; background: var(--orange-tint); border: 2px solid var(--orange); color: var(--black); border-radius: 8px; padding: 14px 18px; margin-bottom: 20px; text-decoration: none; }
.banner:hover { background: #FFE4CC; }
.ext-options { display: flex; gap: 12px; flex-wrap: wrap; }
.grad-form { display: flex; flex-direction: column; align-items: stretch; }
.grad-form input[type=text], .grad-form input[type=date], .grad-form textarea { width: 100%; font: inherit; padding: 12px 14px; border: 2px solid var(--line); border-radius: 6px; margin-bottom: 16px; background: var(--white); }
.grad-form input:focus, .grad-form textarea:focus { border-color: var(--orange); outline: none; }
.grad-form input[type=file] { margin-bottom: 16px; }
.grad-form .check { margin-bottom: 16px; }
#q-form fieldset { border: 0; padding: 0; margin: 0 0 10px; }
#q-form legend { font-family: var(--head); font-weight: 700; font-size: 0.875rem; color: var(--black); margin-bottom: 8px; padding: 0; }
#q-form .check { margin-bottom: 8px; }
#q-check-msg { margin: 0 0 14px; }

/* review stars: radios in reverse order so hover/checked fills every star to the left */
.stars-field { border: 0; padding: 0; margin: 0 0 14px; }
.stars-field legend { font-family: var(--head); font-weight: 700; font-size: 0.875rem; color: var(--black); margin-bottom: 6px; padding: 0; }
.stars { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars label { font-size: 2.25rem; line-height: 1; color: #D6D6D6; cursor: pointer; margin: 0; }
.stars label:hover, .stars label:hover ~ label, .stars input:checked ~ label { color: var(--orange); }
.stars input:focus-visible + label { outline: 2px solid var(--orange); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.video.is-locked-video { opacity: 0.7; }
.locked-embed { display: flex; align-items: center; justify-content: center; text-align: center; padding: 20px; color: #9A9A9A; font-size: 0.9rem; }
.panel.locked-panel { color: var(--muted); border-style: dashed; }
.panel.locked-panel h3 { color: var(--muted); }
.rail nav a[hidden] { display: none; }

/* affiliate section */
.ref-right{display:flex;flex-direction:column;align-items:flex-end;gap:4px}
.rail nav a[hidden]{display:none}
.meeting .meet-list { list-style: none; padding-left: 0; margin: 8px 0 0; }
.meeting .meet-list li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid #333; padding: 6px 0; }
.meeting .meet-list em { font-style: normal; color: var(--orange); white-space: nowrap; }
.code-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border: 2px dashed var(--line); border-radius: 8px; padding: 10px 14px; margin: 4px 0 12px; }
.code-value { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.3rem; font-weight: 700; letter-spacing: .04em; user-select: all; word-break: break-all; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.media-card { background: var(--white); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; }
.media-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; background: var(--line); }
.media-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.media-body h3 { margin: 0; }
.media-caption { margin: 0; white-space: pre-wrap; }
.media-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }

/* ---------- announcements ---------- */
.ann-banner { display: flex; align-items: center; gap: 14px; background: var(--orange-tint); border: 1px solid var(--orange); border-radius: 8px; padding: 12px 14px; margin-bottom: 20px; }
.ann-banner img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; flex: none; }
.ann-text { flex: 1; font-size: 0.9375rem; }
.ann-link { color: var(--orange-dark); font-weight: 700; white-space: nowrap; }
.ann-x { background: none; border: 0; font-size: 1.5rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 2px 8px; }
.ann-x:hover { color: var(--black); }
.promo { padding: 40px 20px 40px 0; grid-column: 2; }
.promo[hidden] { display: none; }
.promo-head { font-family: var(--head); font-weight: 700; font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.promo-card { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin-bottom: 14px; }
.promo-card img { width: 100%; max-height: 180px; object-fit: cover; border-radius: 6px; margin-bottom: 10px; display: block; }
.promo-card h3 { font-size: 0.95rem; margin: 0 0 6px; }
.promo-card p { font-size: 0.875rem; color: var(--charcoal); margin: 0 0 8px; }
.promo-tag { display: inline-block; font-size: 0.6875rem; font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; margin-bottom: 8px; }
.promo-link { font-size: 0.875rem; font-weight: 700; color: var(--orange-dark); }
@media (min-width: 1360px) {
  .shell:has(.promo:not([hidden])) { grid-template-columns: var(--rail) minmax(0, 1fr) 280px; }
  .promo { grid-column: 3; grid-row: 1; position: sticky; top: 0; align-self: start; }
}
@media (max-width: 900px) {
  .promo { grid-column: 1; padding: 0 20px 40px; }
}
