:root {
  --navy: #1e2a38;
  --ink: #343a3f;
  --bronze: #a97b50;
  --paper: #f4f2ee;
  --white: #fffefa;
  --line: #d9d2c8;
  --mist: #ebe6df;
  --muted: #71777d;
  --success: #627d69;
  --danger: #a05245;
  --shadow: 0 14px 38px rgba(30, 42, 56, 0.09);
  --radius: 8px;
  --body: "Segoe UI", Tahoma, sans-serif;
  --display: "Palatino Linotype", Georgia, serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.48;
  background-color: var(--paper);
  background-image: repeating-linear-gradient(0deg, rgba(30, 42, 56, 0.018) 0, rgba(30, 42, 56, 0.018) 1px, transparent 1px, transparent 5px);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--navy); font-family: var(--display); line-height: 1.04; letter-spacing: 0; }
h1 { font-size: clamp(34px, 5vw, 58px); }
h2 { font-size: clamp(26px, 3.3vw, 38px); }
h3 { font-size: 22px; }

.app-shell, .admin-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 18px 0 54px; }
.topbar { display: flex; min-height: 54px; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.course-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--navy); font-size: 13px; font-weight: 800; letter-spacing: .08em; text-decoration: none; text-transform: uppercase; }
.brand-number { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--bronze); border-radius: 50%; background: var(--navy); color: var(--white); font-size: 13px; letter-spacing: 0; }
.admin-link { color: var(--muted); font-size: 12px; text-decoration: none; }
.admin-link:hover { color: var(--navy); text-decoration: underline; }
.feedback-topbar { display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; padding: 4px 0; cursor: pointer; }
.message-bell { display: inline-flex; align-items: center; justify-content: center; font-size: 13px; line-height: 1; }
.course-kicker { margin-bottom: 9px; color: var(--bronze); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }

.access-screen { min-height: 76vh; display: grid; align-content: space-between; padding: 5px 0 12vh; }
.access-copy { width: min(620px, 100%); }
.access-copy p:last-child { max-width: 470px; color: var(--muted); font-size: 18px; }
.consent-screen { min-height: 76vh; display: grid; place-items: center; padding: 36px 0; }
.consent-card { display: grid; width: min(620px, 100%); gap: 16px; padding: 30px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.consent-card h1, .consent-card p { margin-bottom: 0; }
.consent-card > p:not(.course-kicker):not(.form-status) { color: var(--muted); }
.consent-check { display: flex; align-items: flex-start; gap: 10px; color: var(--navy); font-size: 14px; }
.consent-check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--navy); }
.consent-check a { color: var(--navy); text-decoration-color: var(--bronze); text-underline-offset: 2px; }

.participant-header { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 54px 0 28px; }
.participant-header h1 { margin-bottom: 10px; }
.participant-meta { margin-bottom: 0; color: var(--muted); }
.day-counter { display: flex; align-items: baseline; min-width: 104px; justify-content: center; padding: 17px 12px; border: 1px solid rgba(169,123,80,.7); border-radius: 50%; aspect-ratio: 1; background: var(--navy); box-shadow: 0 0 25px rgba(169,123,80,.32); color: var(--white); }
.day-counter span { font-family: var(--display); font-size: 42px; line-height: 1; }
.day-counter small { color: #dcd5ca; font-size: 15px; }

.course-status { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.course-status p { margin: 0; padding: 17px 0; color: var(--navy); font-family: var(--display); font-size: 22px; }

.mountain-section { padding: 43px 0 20px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin-bottom: 22px; }
.section-heading h2 { margin-bottom: 0; }
.section-heading > p { max-width: 310px; margin-bottom: 3px; color: var(--muted); font-size: 13px; text-align: right; }
.mountain-scene { width: 100%; }
.route-track { width: 100%; aspect-ratio: 1600 / 900; position: relative; isolation: isolate; overflow: hidden; border: 1px solid rgba(217,210,200,.8); border-radius: 18px; background: url("assets/progress/mountain-background.png") center / cover no-repeat; }
.route-chart { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; }
.route-baseline { stroke: var(--navy); stroke-width: 3; opacity: .72; }.route-day-guide { pointer-events: none; stroke: var(--bronze); stroke-dasharray: 4 7; stroke-width: 2; opacity: 0; transition: opacity 140ms ease; }.route-day-guide.is-linked { opacity: .92; }.route-base-dot { fill: var(--navy); }.route-day-label { fill: var(--navy); font-family: var(--body); font-size: 22px; font-weight: 800; }.route-day-label.is-linked { fill: var(--bronze); font-size: 24px; }
.route-line { fill: none; stroke: var(--bronze); stroke-linecap: round; stroke-linejoin: round; stroke-width: 10; }.route-dot { stroke-width: 4; }.route-dot--completed { fill: var(--bronze); stroke: #fffaf2; }.route-dot--missed { fill: #c9c8c4; stroke: #f5f1ea; }.route-dot--available { fill: #fff8e8; stroke: var(--navy); }
.route-node { position: absolute; z-index: 2; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; padding: 0; transform: translate(-50%, -50%); }.route-node:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; }
.progress-climber { position: absolute; z-index: 3; width: clamp(120px, 12%, 192px); height: auto; pointer-events: none; transform: translate(-50%, -70.1%); }
.progress-polaris { position: absolute; z-index: 4; width: clamp(118px, 14%, 190px); height: auto; pointer-events: none; transform: translate(-50%, -95%); }
.route-day-picker { display: none; }
.route-picker-day { min-width: 0; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 5px; background: var(--white); color: var(--navy); font-size: 12px; font-weight: 800; }.route-picker-day.is-completed { border-color: var(--bronze); color: var(--bronze); }.route-picker-day.is-missed { background: #f0eeea; color: #706f6b; }.route-picker-day.is-available { border-color: var(--navy); background: #fff8e8; }.route-picker-day.is-future { color: var(--muted); opacity: .58; }
.route-picker-day:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
.route-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.route-legend span { width: 10px; height: 10px; border-radius: 50%; }
.legend-done { background: var(--bronze); }.legend-missed { margin-left: 8px; background: #dfdbd5; }
.saved-workout-count { margin: 10px 0 0; color: var(--muted); font-size: 13px; }

.dashboard-actions { display: grid; grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(0, .72fr)); gap: 11px; padding-top: 24px; }
.primary-action, .secondary-action, .quiet-button, .danger-button, .small-button { min-height: 48px; border: 1px solid transparent; border-radius: var(--radius); padding: 10px 16px; font-weight: 800; letter-spacing: 0; }
.primary-action { background: var(--navy); color: var(--white); }.primary-action:hover { background: #101b27; }
.secondary-action, .quiet-button, .small-button { border-color: var(--line); background: rgba(255,255,255,.5); color: var(--navy); }.secondary-action:hover, .quiet-button:hover, .small-button:hover { border-color: var(--bronze); color: var(--bronze); }
.danger-button { border-color: rgba(160,82,69,.4); background: #fff8f6; color: var(--danger); }

.app-dialog { width: min(680px, calc(100% - 26px)); max-height: min(80vh, 800px); border: 1px solid var(--line); border-radius: var(--radius); padding: 0; background: var(--white); box-shadow: 0 24px 60px rgba(30,42,56,.28); color: var(--ink); }.app-dialog::backdrop { background: rgba(30,42,56,.45); }.wide-dialog { width: min(940px, calc(100% - 26px)); }.dialog-content { padding: 28px; }.dialog-top { display: flex; align-items: start; justify-content: space-between; gap: 18px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }.dialog-top h2 { margin-bottom: 0; }.dialog-actions { display: flex; align-items: center; gap: 8px; }.icon-close { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--navy); font-size: 20px; }.history-list { margin: 20px 0 0; padding-left: 21px; }.history-list li + li { margin-top: 8px; }.history-meta { margin: 14px 0 0; color: var(--muted); font-size: 14px; }.empty-state { margin: 22px 0 0; color: var(--muted); }

.chat-messages { display: grid; gap: 10px; max-height: 390px; overflow-y: auto; padding: 20px 0; }.chat-message { width: min(84%, 470px); padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; background: #f7f4ef; }.chat-message.is-admin { justify-self: end; border-color: rgba(169,123,80,.55); background: #fbf7f0; }.chat-meta { display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; }.chat-message p { margin: 0; white-space: pre-wrap; }.chat-form { display: grid; gap: 10px; padding-top: 15px; border-top: 1px solid var(--line); }.chat-form textarea { min-height: 82px; resize: vertical; }

.technique-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; padding-top: 21px; }.technique-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); }.technique-image { display: grid; min-height: 150px; place-items: center; background: var(--mist); color: var(--muted); font-size: 13px; }.technique-image img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #fffefa; }.technique-copy { padding: 17px; }.technique-copy h3 { margin-bottom: 10px; }.technique-copy p { margin-bottom: 11px; font-size: 14px; }.technique-copy strong { color: var(--navy); }.technique-attribution { margin: 16px 0 0; color: var(--muted); font-size: 11px; }

.login-card { width: min(480px, 100%); margin: 12vh auto; padding: 30px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }.login-card p { color: var(--muted); }.form-stack { display: grid; gap: 13px; }.form-stack label, .field-grid label { display: grid; gap: 6px; color: var(--navy); font-size: 13px; font-weight: 800; }.form-stack input, .field-grid input, .field-grid select, .chat-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 5px; background: #fffefa; padding: 10px 11px; color: var(--ink); }.form-status { min-height: 20px; margin-bottom: 0; color: var(--danger); font-size: 13px; }
.admin-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding: 44px 0 20px; }.admin-heading h1 { margin-bottom: 0; }.admin-nav { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); }.admin-tab { border: 0; border-bottom: 3px solid transparent; background: transparent; padding: 12px 14px 10px; color: var(--muted); font-weight: 800; }.admin-tab.is-active { border-bottom-color: var(--bronze); color: var(--navy); }.admin-unread-badge { margin-left: 4px; color: var(--bronze); font-size: 12px; font-weight: 800; }.admin-unread-badge::before { content: "🔔"; margin-right: 2px; font-size: 12px; }.admin-panel { padding-top: 25px; }.admin-grid { display: grid; grid-template-columns: minmax(280px, .7fr) minmax(0, 1.3fr); gap: 26px; }.form-box, .data-box { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }.form-box h2, .data-box h2 { margin-bottom: 18px; }.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }.field-grid .full-field { grid-column: 1 / -1; }.table-wrap { overflow-x: auto; }.data-table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 13px; }.data-table th { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .05em; text-align: left; text-transform: uppercase; }.data-table th, .data-table td { border-bottom: 1px solid var(--line); padding: 11px 8px; vertical-align: top; }.inline-actions { display: flex; flex-wrap: wrap; gap: 6px; }.tiny-button { min-height: 30px; border: 1px solid var(--line); border-radius: 5px; background: transparent; padding: 4px 7px; color: var(--navy); font-size: 12px; font-weight: 800; }.tiny-button:hover, .tiny-button.is-active { border-color: var(--bronze); color: var(--bronze); }.tiny-button.is-danger { color: var(--danger); }.status-pill { display: inline-flex; border-radius: 999px; padding: 3px 8px; font-size: 11px; font-weight: 800; }.status-active { background: #e5eee7; color: #3f6248; }.status-disabled { background: #ece8e1; color: var(--muted); }.status-archived { background: #ece8e1; color: #6e6258; }.link-output { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }.participant-filters { margin: -4px 0 16px; }.participant-filters .tiny-button { min-height: 32px; }.admin-panel#participantsPanel > .form-box { margin-bottom: 22px; }.admin-panel#participantsPanel .table-wrap { overflow-x: visible; }.admin-panel#participantsPanel .data-table { min-width: 0; table-layout: fixed; }.admin-panel#participantsPanel .data-table th:nth-child(1) { width: 21%; }.admin-panel#participantsPanel .data-table th:nth-child(2) { width: 17%; }.admin-panel#participantsPanel .data-table th:nth-child(3) { width: 11%; }.admin-panel#participantsPanel .data-table th:nth-child(4) { width: 26%; }.admin-panel#participantsPanel .data-table th:nth-child(5) { width: 25%; }.admin-panel#participantsPanel .link-output { display: block; max-width: none; }.admin-chat { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: 470px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); overflow: hidden; }.conversation-list { border-right: 1px solid var(--line); }.conversation-item { display: grid; width: 100%; gap: 3px; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 13px; color: var(--ink); text-align: left; }.conversation-item.is-active { background: #f3eee7; }.conversation-item strong { color: var(--navy); }.conversation-item span { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }.unread-count { color: var(--bronze) !important; font-weight: 800; }.admin-chat-main { padding: 20px; }.archive-group + .archive-group { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }.archive-group .dialog-top { align-items: center; }.archive-group .dialog-top p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }.archive-participants { display: grid; gap: 9px; padding-top: 15px; }.archive-participants ul { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }.archive-participants li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }.archive-chat { margin-top: 22px; min-height: 360px; }.test-box { width: min(610px, 100%); }.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; }.switch-row input { width: 20px; height: 20px; }

.admin-heading-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dialog-actions .secondary-action, .dialog-actions .primary-action { min-height: 40px; }

.admin-panel#participantsPanel .table-wrap { overflow-x: auto; }.admin-panel#participantsPanel .participants-table { min-width: 980px; table-layout: fixed; }.admin-panel#participantsPanel .participants-table th:nth-child(1) { width: 18%; }.admin-panel#participantsPanel .participants-table th:nth-child(2) { width: 15%; }.admin-panel#participantsPanel .participants-table th:nth-child(3) { width: 11%; }.admin-panel#participantsPanel .participants-table th:nth-child(4) { width: 19%; }.admin-panel#participantsPanel .participants-table th:nth-child(5) { width: 17%; }.admin-panel#participantsPanel .participants-table th:nth-child(6) { width: 20%; }.participants-table .inline-actions { min-width: 160px; align-items: flex-start; }.participants-table form.inline-actions { display: grid; }.participants-table form.inline-actions label { display: grid; gap: 6px; color: var(--navy); font-size: 12px; font-weight: 800; }.participants-table select { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 5px; background: #fffefa; padding: 7px; color: var(--ink); }

@media (max-width: 720px) { .app-shell, .admin-shell { width: min(100% - 22px, 1180px); }.participant-header { align-items: start; padding-top: 35px; }.day-counter { min-width: 80px; padding: 11px; }.day-counter span { font-size: 33px; }.course-status p { font-size: 19px; }.section-heading { align-items: start; flex-direction: column; }.section-heading > p { text-align: left; }.route-day-label:not([data-major="true"]) { display: none; }.progress-polaris { width: 64px; transform: translate(-110%, -80%); }.route-day-picker { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 5px; margin-top: 10px; }.dashboard-actions { grid-template-columns: 1fr; }.technique-grid, .admin-grid { grid-template-columns: 1fr; }.field-grid { grid-template-columns: 1fr; }.admin-chat { grid-template-columns: 1fr; }.conversation-list { max-height: 180px; overflow-y: auto; border-right: 0; border-bottom: 1px solid var(--line); }.admin-panel#participantsPanel .table-wrap { overflow-x: auto; }.admin-panel#participantsPanel .data-table:not(.participants-table) { min-width: 620px; table-layout: auto; }.admin-panel#participantsPanel .participants-table { min-width: 980px; table-layout: fixed; }.archive-participants li { align-items: start; flex-direction: column; }.login-card { margin-top: 8vh; padding: 22px; }.admin-heading { padding-top: 28px; }.course-brand { font-size: 10px; } }
