:root {
  color-scheme: light;
  --ink: #172f36;
  --muted: #72838a;
  --line: #e4ebed;
  --paper: #fff;
  --canvas: #f2f6f7;
  --teal: #167968;
  --deep-teal: #103b46;
  --mint: #e4f4ef;
  --green: #23845c;
  --yellow: #b98514;
  --orange: #c66b24;
  --red: #c34747;
  --shadow: 0 8px 26px rgba(28, 62, 70, .055);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 15px; }
button, input, select { font: inherit; }
a { color: inherit; }
.topbar { height: 68px; padding: 0 max(24px, calc((100% - 1180px) / 2)); background: var(--deep-teal); display: flex; align-items: center; justify-content: space-between; color: white; }
.brand { display: inline-flex; gap: 10px; align-items: center; text-decoration: none; font: 800 18px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: -.5px; }
.brand img { width: 31px; height: 31px; }
.brand-light { color: #a7d8cd; }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.topbar-right form { margin: 0; }
.page { max-width: 1180px; min-height: calc(100vh - 116px); margin: 0 auto; padding: 35px 24px 58px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 24px; }
h1, h2, p { margin-top: 0; }
h1, h2 { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: -.6px; }
h1 { margin-bottom: 7px; font-size: clamp(26px, 4vw, 34px); }
h2 { margin-bottom: 0; font-size: 20px; }
.muted { color: var(--muted); line-height: 1.55; }
.page-heading .muted { margin: 0; }
.eyebrow { margin-bottom: 8px; color: var(--teal); font-size: 10px; font-weight: 700; letter-spacing: 1.4px; }
.mission-chip { display: flex; gap: 9px; align-items: center; border: 1px solid var(--line); background: white; border-radius: 999px; padding: 10px 14px; color: #50636a; font-size: 12px; font-weight: 600; white-space: nowrap; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 15px; margin-bottom: 15px; }
.card { border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: var(--shadow); }
.metric-grid .card { min-height: 160px; padding: 21px 23px; }
.card-label { color: #64777d; font-size: 12px; font-weight: 600; }
.fine-print { margin: 9px 0 0; color: #91a0a4; font-size: 11px; line-height: 1.45; }
.unavailable { font-size: 22px; letter-spacing: -.4px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-heading .eyebrow { margin-bottom: 4px; }
#trend-chart { width: 100%; height: 100%; overflow: visible; }
.checkin-actions { display: flex; gap: 13px; align-items: center; margin-top: 20px; }
.form-status { color: var(--teal); font-size: 12px; }
.form-status.error { color: var(--red); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 39px; padding: 9px 15px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 700; text-decoration: none; transition: .15s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--deep-teal); color: white; }
.button-primary:hover { background: #1a5661; }
.button-secondary { border-color: #c6dbd6; background: #f5faf8; color: var(--teal); }
.button-quiet { min-height: 34px; padding: 7px 10px; background: transparent; color: inherit; }
.button-wide { width: 100%; }
.empty-state { padding: clamp(24px, 6vw, 58px); text-align: center; }
.empty-state > p { max-width: 510px; margin: 9px auto 24px; }
.empty-state h2 { font-size: 23px; }
.login-wrap { display: grid; min-height: 68vh; place-items: center; }
.login-card { width: min(420px, 100%); padding: 32px; border: 1px solid var(--line); border-radius: 15px; background: white; box-shadow: var(--shadow); }
.login-card h1 { font-size: 25px; }
.stack-form { display: grid; gap: 10px; margin-top: 25px; }
.stack-form label { color: #50636a; font-size: 12px; font-weight: 600; }
.stack-form input { width: 100%; min-height: 42px; margin-bottom: 7px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.footer { padding: 16px 24px 22px; color: #94a1a5; text-align: center; font-size: 10px; }
.messages { margin-bottom: 16px; }
.message { margin-bottom: 7px; padding: 11px 14px; border-radius: 8px; font-size: 12px; }
.message-error { background: #fff0ef; color: #a6413c; }
.fine-print code { border-radius: 4px; background: #f1f5f5; padding: 2px 4px; }
.offline-page { max-width: 550px; margin: 35px auto; text-align: center; }
.offline-page h1 { margin-bottom: 10px; }
.offline-page > .muted { max-width: 460px; margin: 0 auto 24px; }
.back-link { display: inline-block; margin-top: 19px; color: var(--teal); font-size: 12px; font-weight: 600; text-decoration: none; }

@media (max-width: 850px) {
  .metric-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .topbar { height: 58px; padding: 0 16px; }
  .page { padding: 25px 14px 42px; }
  .page-heading { display: block; }
  .mission-chip { width: fit-content; margin-top: 15px; }
  .metric-grid { gap: 9px; }
  .metric-grid .card { min-height: 145px; padding: 16px; }
  .section-heading { align-items: flex-start; }
  .login-card { padding: 24px; }
}

/* Local mission artwork frames the interface while panels keep data legible. */
.topbar { background: rgba(7, 28, 39, .94); border-bottom: 1px solid #35515b; }
.page-heading { color: #f1f8f8; }
.page-heading .muted { color: #bed0d6; }
.page-heading .eyebrow { color: #7fe0c6; }
.footer { color: #c0d2d8; }
.main-nav { display: flex; gap: 16px; }
.main-nav a { color: #d6e9ec; text-decoration: none; font-weight: 600; font-size: 13px; }
.main-nav a:hover { color: #7fe0c6; }
.mission-banner { padding: 36px; margin-bottom: 24px; border: 1px solid #42616b; border-radius: 18px; background: linear-gradient(100deg, rgba(8, 37, 48, .9), rgba(8, 37, 48, .35)), url("../backgrounds/Waves.ab95e89191b1.png") center / cover; color: #f3f9fa; }
.mission-banner .eyebrow { color: #8fe0c8; }
.mission-banner p:last-child { margin-bottom: 0; color: #d4e4e8; line-height: 1.5; }
.mission-banner .button-primary { background: #a2edd5; color: #123d3c; flex-shrink: 0; }
.crew-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.crew-grid > .empty-state { grid-column: 1 / -1; }
.crew-card { overflow: hidden; text-decoration: none; transition: transform .15s; }
.crew-card:hover { transform: translateY(-3px); }
.crew-card-cover { height: 115px; padding: 16px; background: #12333c url("../backgrounds/Rosette.576cb86106b8.png") center / cover; text-align: right; }
.crew-badge { display: inline-block; background: #dff4ec; color: #195c48; border-radius: 999px; padding: 6px 10px; font-size: 11px; font-weight: 700; }
.crew-portrait { display: block; width: 112px; height: 112px; object-fit: cover; border-radius: 24px; border: 5px solid white; background: #dcefe9; flex-shrink: 0; }
.crew-card > .crew-portrait { position: relative; margin: -48px 0 0 22px; }
.portrait-initials { display: grid; place-items: center; color: #195c48; font-size: 30px; font-weight: 800; }
.crew-card-body { padding: 18px 23px 24px; }
.crew-card-body h2 { font-size: 23px; }
.crew-card-body .muted { font-size: 13px; margin-top: 8px; }
.crew-mission { border-top: 1px solid var(--line); padding-top: 14px; color: #49646d; font-size: 13px; }
.profile-form, .profile-detail { padding: 30px; }
.profile-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.profile-field label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.profile-field input:not([type="checkbox"]), .profile-field select, .profile-field textarea { width: 100%; padding: 11px; border: 1px solid #b9cdd2; border-radius: 8px; background: #f6faf9; color: var(--ink); font: inherit; }
.profile-field input[type="checkbox"] { margin: 12px 6px; }
.field-wide { grid-column: 1 / -1; }
.profile-banner { margin-top: 18px; margin-bottom: 0; border-radius: 18px 18px 0 0; }
.profile-banner .crew-badge { margin-bottom: 20px; }
.profile-detail { border-radius: 0 0 18px 18px; }
.profile-identity { display: flex; gap: 22px; align-items: center; }
.profile-identity .muted { margin: 8px 0 0; }
.profile-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 25px; margin: 30px 0; padding: 25px 0; border-block: 1px solid var(--line); }
.profile-facts dt { color: #64777d; font-size: 12px; margin-bottom: 8px; }
.profile-facts dd { margin: 0; overflow-wrap: anywhere; }
.profile-bio { margin-top: 15px; overflow-wrap: anywhere; }
.offline-page > h1, .offline-page > .muted { color: #e2eff2; }
@media (max-width: 850px) { .crew-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .topbar-right { gap: 8px; }
  .main-nav { gap: 10px; }
  .crew-grid, .profile-fields, .profile-facts { grid-template-columns: 1fr; }
  .mission-banner, .profile-form, .profile-detail { padding: 22px; }
  .mission-banner .section-heading, .profile-detail .section-heading { align-items: flex-start; flex-direction: column; }
  .profile-identity { gap: 12px; }
  .profile-identity .crew-portrait { width: 80px; height: 80px; border-radius: 18px; }
  .profile-identity h2 { font-size: 19px; }
}

[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #31bb9a; outline-offset: 4px; }
button:disabled { opacity: .65; cursor: wait; transform: none; }
.main-nav a[aria-current], .site-footer a[aria-current] { color: #94efd1; text-decoration: underline; text-underline-offset: 6px; }
.site-footer { background: rgba(7, 28, 39, .95); border-top: 1px solid #35515b; padding: 30px max(24px, calc((100% - 1132px) / 2)); text-align: left; font-size: 12px; }
.footer-content { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 30px; }
.footer-content strong { font-size: 18px; color: #f1f8f8; }
.footer-content p { margin-top: 10px; line-height: 1.5; }
.footer-content nav { display: grid; gap: 12px; align-content: start; }
.footer-content a { text-decoration: none; }
.footer-content a:hover { color: #94efd1; }
.appearance-controls { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; }
.appearance-controls select { min-width: 0; padding: 7px; color: #e0efef; background: #193d48; border: 1px solid #456570; border-radius: 6px; }
.footer-bottom { display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; border-top: 1px solid #35515b; margin-top: 24px; padding-top: 20px; font-size: 11px; line-height: 1.6; }
#connection-status { color: #a2edd5; }
#connection-status[data-online="false"] { color: #f5ce87; }
.crew-toolbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; color: #e3eff1; }
.crew-toolbar input { flex: 1; min-width: 200px; padding: 12px; border: 1px solid #63858c; border-radius: 9px; background: #f5faf9; color: #172f36; }
.crew-toolbar span { font-size: 12px; }
.developer-links { display: flex; gap: 14px; flex-wrap: wrap; margin: 16px 0; font-size: 13px; color: var(--teal); }
.message { position: relative; padding-right: 40px; }
.dismiss-message { position: absolute; right: 8px; top: 4px; border: 0; color: inherit; background: none; font-size: 24px; cursor: pointer; }
.photo-preview { margin-top: 14px; }
.character-count { display: block; text-align: right; }
html[data-theme="dark"] { color-scheme: dark; --paper: #152e38; --ink: #e2eef1; --muted: #adc2ca; --line: #35525e; --deep-teal: #b4efdc; --teal: #8de2c5; --mint: #234b43; --green: #75d3a7; --yellow: #efca77; --orange: #ffb078; --red: #ff9c9c; }
html[data-theme="dark"] .login-card, html[data-theme="dark"] .mission-chip { background: var(--paper); color: var(--ink); }
html[data-theme="dark"] .profile-field input:not([type="checkbox"]), html[data-theme="dark"] .profile-field select, html[data-theme="dark"] .profile-field textarea, html[data-theme="dark"] .stack-form input { background: #102730; color: var(--ink); border-color: var(--line); }
html[data-theme="dark"] .button-primary { background: #a2edd5; color: #123d3c; }
html[data-theme="dark"] .button-secondary { background: #234b43; color: #b4efdc; border-color: #4d796d; }
html[data-theme="dark"] :is(.card-label, .domain-name, .fine-print, .alert-item p, .alert-item li, .alert-domain, .profile-field label, .profile-facts dt, .crew-mission, .stack-form label, .checkin-fields > label, .symptom-picker legend, .symptom-option span, .offline-checkin label) { color: #b7cbd1; }
html[data-theme="dark"] .crew-portrait { border-color: var(--paper); }
@media (prefers-reduced-motion: no-preference) { .card { animation: panel-arrive .3s ease-out both; } @keyframes panel-arrive { from { opacity: .5; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } } }
@media (max-width: 650px) { .footer-content { grid-template-columns: 1fr; gap: 22px; } .appearance-controls { max-width: 350px; } }

.account-avatar { display: grid; place-items: center; flex-shrink: 0; width: 40px; height: 40px; border: 2px solid #a2edd5; border-radius: 50%; background: #28574f; color: #e9fff7; text-decoration: none; font-size: 14px; font-weight: 800; overflow: hidden; }
.account-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.account-avatar:hover { box-shadow: 0 0 0 4px rgba(162, 237, 213, .2); }
.camera-controls { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.camera-controls p { margin: 0; max-width: 420px; line-height: 1.6; }
.camera-dialog { width: min(520px, calc(100% - 28px)); max-height: 90vh; overflow: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); color: var(--ink); padding: 24px; }
.camera-dialog::backdrop { background: rgba(0, 12, 20, .8); }
.camera-dialog video { display: block; width: 100%; max-height: 50vh; min-height: 160px; object-fit: contain; background: #071c27; border-radius: 10px; transform: scaleX(-1); }
.camera-dialog p { margin-top: 12px; color: var(--muted); }
@media (max-width: 380px) { .topbar { padding-inline: 10px; } .brand { gap: 5px; font-size: 15px; } .brand img { width: 24px; height: 24px; } .main-nav { gap: 8px; } .topbar-right { gap: 5px; } }

@media (max-width: 560px) { .training-launcher { align-items: flex-start; flex-direction: column; } .training-dialog { padding: 20px; } .training-summary { gap: 8px; } }

@media (max-width: 600px) { .mission-checkin { grid-template-columns: 1fr; } .brand-light { display: none; } .mission-nav { gap: 8px; } .finding-reading { padding: 18px; } }
