:root {
  color-scheme: dark;
  --ink: #f5f6f7;
  --muted: #99a0aa;
  --muted-2: #6f7680;
  --canvas: #090b0e;
  --sidebar: #0c0e12;
  --panel: #111419;
  --panel-2: #161a20;
  --line: #272c34;
  --line-soft: #1c2128;
  --red: #be1e2d;
  --red-light: #e04452;
  --red-deep: #7f1721;
  --green: #36b37e;
  --amber: #e6a844;
  --blue: #5ea4ef;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--canvas); }

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
a { color: inherit; }
img { max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.08; letter-spacing: -0.03em; }
h1 { font-size: clamp(2.15rem, 4vw, 3.65rem); margin-bottom: .5rem; }
h2 { font-size: clamp(1.35rem, 2vw, 1.85rem); margin-bottom: .45rem; }
h3 { font-size: 1.05rem; }
p { color: #b9bec6; }

:focus-visible { outline: 3px solid rgba(224, 68, 82, .42); outline-offset: 3px; }
.skip-link { position: fixed; top: -80px; left: 18px; z-index: 100; padding: 10px 14px; background: white; color: black; border-radius: 8px; }
.skip-link:focus { top: 18px; }
.muted { color: var(--muted); }
.small-text { font-size: .82rem; }
.wide { width: 100%; }
.compact { padding: .62rem .85rem !important; font-size: .78rem; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 20px 20px; background: var(--sidebar); border-right: 1px solid var(--line-soft); z-index: 30; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; padding: 0 7px; margin-bottom: 44px; }
.brand img { width: 145px; height: auto; }
.brand-product { padding-left: 10px; border-left: 1px solid #40454e; color: #d4d7dc; font-size: 1.02rem; font-weight: 650; letter-spacing: .03em; }
.sidebar-section { flex: 1; }
.eyebrow, .overline { display: block; color: var(--muted); font-size: .68rem; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
.overline { color: var(--red-light); margin-bottom: 10px; }
.nav-list { display: grid; gap: 6px; margin: 12px 0; }
.nav-link { display: flex; gap: 12px; align-items: center; padding: 11px 12px; color: #aab0b8; text-decoration: none; border-radius: 9px; font-weight: 600; }
.nav-link:hover { color: white; background: #15191e; }
.nav-link.active { color: white; background: #1a1e24; box-shadow: inset 3px 0 0 var(--red); }
.nav-icon { color: var(--red-light); width: 18px; font-size: 1.05rem; text-align: center; }
.sidebar-course { padding: 15px; margin-bottom: 20px; border: 1px solid var(--line); background: #12151a; border-radius: 12px; }
.sidebar-course strong, .sidebar-course span { display: block; }
.sidebar-course strong { margin: 7px 0 4px; font-size: .83rem; }
.sidebar-course > span:last-child { color: var(--muted); font-size: .72rem; }
.sidebar-user { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; padding-top: 19px; border-top: 1px solid var(--line-soft); }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid #6c2028; border-radius: 50%; color: white; background: #35151a; font-weight: 800; }
.avatar.small { width: 31px; height: 31px; font-size: .78rem; }
.user-copy { min-width: 0; }
.user-copy strong, .user-copy span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-copy strong { font-size: .82rem; }
.user-copy span { color: var(--muted); font-size: .71rem; }
.icon-button { border: 0; background: transparent; color: var(--muted); width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; cursor: pointer; }
.icon-button:hover { color: white; background: var(--panel-2); }

.app-main { min-width: 0; }
.mobile-header { display: none; }
.content-shell { width: min(1440px, 100%); margin: 0 auto; padding: 48px clamp(26px, 4vw, 64px) 80px; }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 28px; margin-bottom: 34px; }
.page-header p { margin: 0; font-size: 1.04rem; }
.dashboard-header h1 { margin-bottom: 7px; }
.header-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.panel { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); box-shadow: 0 1px 0 rgba(255,255,255,.02); }
.panel-accent { position: relative; overflow: hidden; }
.panel-accent::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--red); }
.button { min-height: 43px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: .73rem 1rem; border: 1px solid transparent; border-radius: 9px; text-decoration: none; font-size: .83rem; font-weight: 750; cursor: pointer; transition: transform .16s ease, background .16s ease, border-color .16s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: white; background: var(--red); border-color: #d72c3c; }
.button.primary:hover { background: #cf2635; }
.button.secondary { color: #eceef1; background: #181c22; border-color: #343a43; }
.button.secondary:hover { border-color: #59606b; background: #20252c; }
.button.ghost { color: #d8dbe0; background: transparent; border-color: #343a43; }
.button.danger { color: #f1a0a7; border-color: #6a2930; }
.text-link { color: #e8e9ec; font-size: .82rem; font-weight: 750; text-decoration: none; }
.text-link:hover { color: var(--red-light); }
.pill, .status-chip, .state-badge, .role-badge { display: inline-flex; align-items: center; width: fit-content; border-radius: 999px; text-transform: uppercase; letter-spacing: .08em; font-size: .61rem; font-weight: 800; }
.pill { padding: 6px 9px; border: 1px solid #6b2730; color: #ff9da7; background: #2f151a; }
.pill.amber { border-color: #725729; background: #292113; color: #f0c16f; }
.status-chip { padding: 5px 8px; color: #9ca4ae; border: 1px solid #343a43; background: #161a20; }
.status-chip.complete, .status-chip.received { color: #81d7ad; border-color: #245d48; background: #11281f; }
.status-chip.submitted, .status-chip.earned, .status-chip.approved, .status-chip.ordered { color: #f0c16f; border-color: #725729; background: #292113; }
.status-chip.revision { color: #ef929c; border-color: #74303a; background: #2f171c; }

.flash-stack { position: fixed; top: 20px; right: 24px; z-index: 80; width: min(420px, calc(100vw - 48px)); display: grid; gap: 9px; }
.flash { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 13px 15px; border: 1px solid #3b414a; border-radius: 10px; color: white; background: #181c22; box-shadow: var(--shadow); font-size: .84rem; }
.flash-success { border-left: 3px solid var(--green); }
.flash-error { border-left: 3px solid var(--red-light); }
.flash-info { border-left: 3px solid var(--blue); }
.flash-close { border: 0; color: #9ca3ad; background: transparent; cursor: pointer; font-size: 1.1rem; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .75fr); gap: 20px; margin-bottom: 46px; }
.current-card { min-height: 380px; padding: 31px; }
.current-card::after { content: "TF"; position: absolute; right: -18px; bottom: -70px; color: #15191e; font-size: 16rem; line-height: 1; font-weight: 900; letter-spacing: -.12em; pointer-events: none; }
.current-card > * { position: relative; z-index: 1; }
.current-card-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 46px; }
.current-card-head > div:first-child { display: grid; gap: 9px; }
.mission-count { color: var(--muted); font-size: .72rem; }
.current-card h2 { max-width: 650px; margin: 5px 0 10px; font-size: clamp(2rem, 4vw, 3.45rem); }
.current-card > p { max-width: 680px; font-size: 1.02rem; }
.mission-meta { display: flex; flex-wrap: wrap; gap: 20px; margin: 28px 0; color: #939aa4; font-size: .75rem; }
.progress-ring { --size: 82px; width: var(--size); height: var(--size); display: grid; place-items: center; border: 7px solid #292e35; border-top-color: var(--red); border-right-color: var(--red); border-radius: 50%; background: var(--panel); position: relative; }
.progress-ring > span { position: relative; z-index: 1; font-size: 1.15rem; font-weight: 850; }
.progress-ring small { font-size: .62rem; color: var(--muted); }
.project-summary { padding: 29px; display: flex; flex-direction: column; }
.project-summary h2 { margin: 35px 0 6px; }
.project-summary > p { flex: 1; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 26px 0; padding: 18px 0; border-block: 1px solid var(--line-soft); }
.mini-stats div + div { border-left: 1px solid var(--line-soft); padding-left: 15px; }
.mini-stats dt { color: var(--muted); font-size: .66rem; }
.mini-stats dd { margin: 4px 0 0; font-weight: 750; font-size: .78rem; }
.section-block { margin-top: 45px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 17px; }
.section-heading h2 { margin: 4px 0 0; }
.section-heading > .muted { font-size: .77rem; }
.level-path { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.level-card { min-height: 245px; padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: #101318; }
.level-card.locked { opacity: .5; }
.level-card.active { border-color: #722832; background: #171215; }
.level-card.complete { border-color: #285844; }
.level-topline { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.level-number { color: #5e6670; font-size: 1.7rem; line-height: 1; font-weight: 900; }
.state-badge { color: var(--muted); }
.level-card.active .state-badge { color: #f098a2; }
.level-card.complete .state-badge { color: #70cca0; }
.level-card h3 { margin: 30px 0 7px; }
.level-card p { min-height: 42px; font-size: .76rem; }
.thin-progress { height: 4px; overflow: hidden; margin: 21px 0 8px; border-radius: 4px; background: #292e35; }
.thin-progress span { height: 100%; display: block; background: var(--red); }
.level-card.complete .thin-progress span { background: var(--green); }
.level-card small { color: var(--muted); font-size: .66rem; }
.reward-line { display: flex; gap: 7px; align-items: center; margin-top: 21px; padding-top: 14px; border-top: 1px solid var(--line-soft); color: #868d96; font-size: .69rem; }
.reward-line span { color: var(--red); }
.reward-cabinet { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.reward-card { display: flex; align-items: center; gap: 12px; min-height: 105px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #101318; }
.reward-card.locked { filter: grayscale(1); opacity: .42; }
.reward-emblem { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid #4a2025; background: #241217; border-radius: 10px; }
.reward-emblem img { width: 25px; height: 25px; }
.reward-card span, .reward-order-copy span { color: var(--muted); font-size: .62rem; text-transform: uppercase; letter-spacing: .08em; }
.reward-card h3 { margin: 3px 0; font-size: .76rem; letter-spacing: 0; }
.reward-card p { margin: 0; color: var(--muted); font-size: .66rem; }
.empty-state, .error-state { min-height: 430px; display: grid; place-items: center; align-content: center; padding: 50px; text-align: center; }
.empty-state img, .error-state img { width: 70px; opacity: .8; }
.empty-state h2, .error-state h1 { margin: 20px 0 8px; }
.error-code { margin-top: 20px; color: var(--red-light); font-size: .78rem; font-weight: 800; letter-spacing: .2em; }

.breadcrumbs { display: flex; gap: 9px; align-items: center; margin-bottom: 25px; color: var(--muted); font-size: .72rem; }
.breadcrumbs a { text-decoration: none; color: #d6d9de; }
.project-header { align-items: center; }
.project-overview { display: grid; grid-template-columns: 160px minmax(280px, 1fr) 160px 160px; gap: 24px; align-items: center; padding: 24px 27px; }
.project-score { display: grid; }
.project-score strong { font-size: 1.7rem; line-height: 1; }
.project-score span { margin-top: 7px; color: var(--muted); font-size: .67rem; }
.overview-label { display: flex; justify-content: space-between; margin-bottom: 9px; color: var(--muted); font-size: .72rem; }
.overview-label strong { color: white; }
.bar { height: 8px; overflow: hidden; border-radius: 10px; background: #292e35; }
.bar span { display: block; height: 100%; background: var(--red); }
.project-levels { display: grid; gap: 14px; }
.project-level { overflow: hidden; }
.project-level.locked { opacity: .68; }
.project-level > header { display: grid; grid-template-columns: 48px 1fr auto; gap: 17px; align-items: center; padding: 20px 22px; border-bottom: 1px solid var(--line-soft); }
.project-level > header h3 { margin: 4px 0 0; font-size: 1.05rem; }
.level-medallion { width: 45px; height: 45px; display: grid; place-items: center; border: 1px solid #3b4149; border-radius: 50%; color: #a4abb5; font-size: .82rem; font-weight: 850; }
.project-level.active .level-medallion { color: #ff9ca5; border-color: #74303a; background: #2b151a; }
.project-level.complete .level-medallion { color: #79d1a7; border-color: #286049; background: #11261e; }
.level-reward { text-align: right; }
.level-reward span, .level-reward strong { display: block; }
.level-reward span { color: var(--muted); font-size: .62rem; text-transform: uppercase; letter-spacing: .1em; }
.level-reward strong { margin-top: 3px; font-size: .76rem; }
.mission-list { display: grid; }
.mission-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 105px 20px; gap: 13px; align-items: center; min-height: 71px; padding: 12px 22px; border-bottom: 1px solid var(--line-soft); text-decoration: none; }
.mission-row:last-child { border-bottom: 0; }
.mission-row:not(.disabled):hover { background: #171b21; }
.mission-row.disabled { cursor: default; opacity: .42; }
.mission-status { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid #3b414a; border-radius: 50%; color: #858c96; font-size: .67rem; font-weight: 850; }
.mission-row.complete .mission-status { border-color: #285d47; color: #75d0a3; background: #11261e; }
.mission-row.submitted .mission-status { border-color: #725729; color: #f0c16f; background: #292113; }
.mission-row.in_progress .mission-status, .mission-row.revision .mission-status { border-color: #74303a; color: #ef929c; background: #2f171c; }
.mission-row div strong, .mission-row div small { display: block; }
.mission-row div strong { font-size: .82rem; letter-spacing: 0; }
.mission-row div small { margin-top: 3px; color: var(--muted); font-size: .69rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-state { color: var(--muted); font-size: .67rem; }

.mission-header { display: flex; justify-content: space-between; gap: 30px; align-items: flex-end; margin-bottom: 26px; }
.mission-heading h1 { margin: 12px 0 6px; font-size: clamp(2.1rem, 4vw, 3.5rem); }
.mission-heading p { margin: 0; }
.mission-header-meta { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: .72rem; white-space: nowrap; }
.mission-workspace { display: grid; grid-template-columns: minmax(210px, .63fr) minmax(430px, 1.5fr) minmax(240px, .74fr); gap: 16px; align-items: start; }
.mission-brief { position: sticky; top: 24px; padding: 22px; }
.mission-brief p { margin: 7px 0 24px; font-size: .81rem; }
.check-list { display: grid; gap: 11px; margin: 11px 0 25px; padding: 0; list-style: none; }
.check-list li { display: grid; grid-template-columns: 19px 1fr; gap: 8px; font-size: .76rem; color: #c1c5cb; }
.check-list li span { color: var(--green); font-weight: 900; }
.reward-preview { padding: 14px; border: 1px solid #4a2025; border-radius: 10px; background: #211216; }
.reward-preview span, .reward-preview strong { display: block; }
.reward-preview span { color: #b87f85; font-size: .62rem; text-transform: uppercase; letter-spacing: .1em; }
.reward-preview strong { margin-top: 5px; font-size: .75rem; }
.mission-editor { padding: 26px; }
.editor-heading { display: flex; justify-content: space-between; gap: 15px; align-items: flex-start; margin-bottom: 20px; }
.editor-heading h2 { margin: 4px 0 0; }
.autosave-note { color: var(--muted-2); font-size: .66rem; }
.mission-task { padding: 16px 17px; margin-bottom: 23px; border-left: 3px solid var(--red); background: #18161a; }
.mission-task strong { color: #f09aa3; font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; }
.mission-task p { margin: 5px 0 0; color: #d5d7dc; font-size: .82rem; }
.form-stack { display: grid; gap: 17px; }
.field { display: grid; gap: 7px; color: #e3e5e8; font-size: .77rem; font-weight: 700; }
.field small { color: var(--muted); font-size: .68rem; font-weight: 400; }
.field input, .field textarea, .field select, .field-field { width: 100%; color: white; background: #0c0f13; border: 1px solid #353b45; border-radius: 9px; padding: 11px 12px; outline: 0; }
.field textarea { resize: vertical; min-height: 92px; line-height: 1.55; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--red-light); box-shadow: 0 0 0 3px rgba(190,30,45,.12); }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 4px; }
.readback { display: grid; gap: 8px; }
.readback p { white-space: pre-wrap; padding: 13px 0 21px; border-bottom: 1px solid var(--line-soft); color: #d2d5da; }
.review-form { display: grid; gap: 15px; padding-top: 21px; border-top: 1px solid var(--line); }
.review-history { display: grid; gap: 10px; margin-top: 27px; padding-top: 22px; border-top: 1px solid var(--line); }
.review-history article { padding: 14px; background: #0d1014; border: 1px solid var(--line-soft); border-radius: 9px; }
.review-history article > div { display: flex; justify-content: space-between; gap: 10px; }
.review-history article p { margin: 9px 0; font-size: .77rem; white-space: pre-wrap; }
.review-history article small { color: var(--muted); font-size: .64rem; }
.mission-support { display: grid; gap: 16px; }
.support-card { padding: 21px; }
.support-card h2 { margin: 7px 0 7px; font-size: 1.15rem; }
.support-card > p { font-size: .75rem; }
.hint { padding: 11px 0; border-top: 1px solid var(--line-soft); }
.hint > span { color: #757d87; font-size: .64rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.hint p { margin: 4px 0 0; color: #6e7580; font-size: .72rem; }
.hint.revealed > span { color: #ec9ca5; }
.hint.revealed p { color: #c7cbd0; }
.upload-form { display: grid; gap: 9px; }
.file-field { position: relative; overflow: hidden; display: grid; place-items: center; min-height: 72px; padding: 12px; border: 1px dashed #454c56; border-radius: 9px; color: #b5bac2; text-align: center; cursor: pointer; font-size: .72rem; }
.file-field:hover { border-color: #7f343c; background: #161216; }
.file-field input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.checkpoint-list { display: grid; gap: 9px; margin-top: 15px; }
.checkpoint-list > div { padding-top: 9px; border-top: 1px solid var(--line-soft); }
.checkpoint-list strong, .checkpoint-list span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.checkpoint-list strong { font-size: .7rem; }
.checkpoint-list span { color: var(--muted); font-size: .62rem; }
.evidence-card { grid-column: 1 / -1; border-color: #54242a; background: #141116; }
.evidence-list { display: grid; gap: 7px; margin-top: 15px; }
.evidence-list a { display: grid; grid-template-columns: 36px minmax(0, 1fr) 18px; gap: 9px; align-items: center; padding: 9px; border: 1px solid #332c32; border-radius: 8px; color: #d9dce1; background: #0e0d10; text-decoration: none; }
.evidence-list a:hover { border-color: #74303a; background: #171216; }
.evidence-list a > span:nth-child(2) { min-width: 0; }
.evidence-list strong, .evidence-list small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evidence-list strong { font-size: .68rem; }
.evidence-list small { color: var(--muted); font-size: .59rem; }
.file-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 7px; color: #f09aa3; background: #2a1519; font-size: .53rem; font-weight: 850; letter-spacing: .05em; }
.evidence-empty { margin-bottom: 6px; }
.upload-limits { margin: 13px 0 0; color: var(--muted-2) !important; font-size: .59rem !important; }

.mentor-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stat-card { padding: 20px; }
.stat-card > span, .stat-card > small { display: block; color: var(--muted); font-size: .68rem; }
.stat-card strong { display: block; margin: 14px 0 5px; font-size: 2.3rem; line-height: 1; }
.submission-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.submission-card { padding: 22px; }
.submission-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 34px; color: var(--muted); font-size: .63rem; }
.submission-card h3 { margin: 7px 0 7px; font-size: 1.35rem; }
.submission-card p { min-height: 48px; font-size: .77rem; }
.quiet-state { display: flex; gap: 15px; align-items: center; padding: 22px; }
.quiet-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: #12261f; color: #6dcca0; }
.quiet-state h3 { margin: 0 0 4px; }
.quiet-state p { margin: 0; font-size: .77rem; }
.table-panel { overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th { padding: 13px 18px; border-bottom: 1px solid var(--line); color: var(--muted); background: #0e1115; font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; }
.data-table td { padding: 16px 18px; border-bottom: 1px solid var(--line-soft); font-size: .75rem; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td strong, .data-table td span { display: block; }
.data-table td > span { color: var(--muted); font-size: .67rem; }
.table-progress { display: flex; align-items: center; gap: 10px; }
.table-progress > span { width: 110px; height: 5px; overflow: hidden; border-radius: 6px; background: #2a3037; }
.table-progress i { display: block; height: 100%; background: var(--red); }
.table-progress small { color: var(--muted); }
.count-badge { width: 27px; height: 27px; display: grid !important; place-items: center; border-radius: 50%; background: #2d1f13; color: #f0c16f !important; font-weight: 800; }
.table-empty { padding: 35px !important; text-align: center; color: var(--muted); }
.reward-queue { display: grid; gap: 10px; }
.reward-order { display: grid; grid-template-columns: 44px 1fr auto auto; gap: 15px; align-items: center; padding: 15px 18px; }
.reward-order-copy h3 { margin: 3px 0; font-size: .84rem; letter-spacing: 0; }
.reward-order-copy p { margin: 0; font-size: .67rem; }

.admin-grid { display: grid; grid-template-columns: minmax(320px, .72fr) minmax(430px, 1.28fr); gap: 18px; align-items: start; }
.admin-form-card, .people-card { padding: 26px; }
.admin-form-card h2 { margin: 7px 0 5px; }
.admin-form-card > p { font-size: .78rem; }
.choice-field { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.choice-field input { margin-top: 4px; accent-color: var(--red); }
.choice-field strong, .choice-field small { display: block; }
.choice-field strong { font-size: .76rem; }
.choice-field small { color: var(--muted); font-size: .66rem; }
.people-list { display: grid; }
.people-list article { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.people-list article:last-child { border-bottom: 0; }
.people-list strong, .people-list span { display: block; }
.people-list strong { font-size: .8rem; }
.people-list article > div:nth-child(2) span { color: var(--muted); font-size: .68rem; }
.role-badge { padding: 5px 8px; color: #bec3ca; border: 1px solid #3b4149; }

.dialog { width: min(530px, calc(100vw - 28px)); padding: 0; border: 0; color: var(--ink); background: transparent; }
.dialog::backdrop { background: rgba(0,0,0,.74); backdrop-filter: blur(5px); }
.dialog-card { padding: 27px; border: 1px solid #343a43; border-radius: 16px; background: var(--panel); box-shadow: var(--shadow); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; }
.dialog-head h2 { margin-top: 5px; }
.dialog-card > p { font-size: .8rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 23px; }

.login-body { min-height: 100vh; overflow-x: hidden; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(390px, .72fr); }
.login-story { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; padding: clamp(34px, 5vw, 72px); background: #0b0d10; border-right: 1px solid var(--line); }
.login-story::after { content: ""; position: absolute; width: 560px; height: 560px; right: -210px; top: 7%; border: 120px solid #12151a; border-radius: 50%; }
.login-story > * { position: relative; z-index: 1; }
.login-brand { display: flex; align-items: center; gap: 17px; }
.login-brand img { width: 190px; }
.login-brand span { padding-left: 16px; border-left: 1px solid #4a5058; font-size: 1.25rem; font-weight: 700; }
.login-story-copy { max-width: 760px; margin: 80px 0 50px; }
.login-story-copy h1 { max-width: 800px; font-size: clamp(3rem, 6vw, 6.7rem); line-height: .98; }
.login-story-copy h1 em { color: var(--red-light); font-style: normal; }
.login-story-copy p { max-width: 650px; font-size: 1.02rem; }
.login-levels { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.login-level { padding: 15px 12px 0 0; }
.login-level + .login-level { padding-left: 15px; border-left: 1px solid var(--line); }
.login-level span, .login-level strong, .login-level small { display: block; }
.login-level span { color: var(--red-light); font-size: .65rem; font-weight: 800; }
.login-level strong { margin: 7px 0 4px; font-size: .7rem; }
.login-level small { color: var(--muted); font-size: .6rem; }
.login-footnote { margin: 24px 0 0; color: #686f79; font-size: .65rem; text-transform: uppercase; letter-spacing: .12em; }
.login-panel { display: grid; place-items: center; min-height: 100vh; padding: 35px; background: #0e1115; }
.login-card { width: min(410px, 100%); }
.login-icon { width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: 25px; border: 1px solid #57252b; border-radius: 13px; background: #251419; }
.login-icon img { width: 39px; }
.login-card h2 { margin: 8px 0; font-size: 2.2rem; }
.login-card > p { margin-bottom: 29px; }
.dev-access { margin-top: 22px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-size: .68rem; }
.dev-access summary { cursor: pointer; color: #b9bec5; font-weight: 700; }
.dev-access p { margin: 8px 0 0; color: var(--muted); word-break: break-word; }

@media (max-width: 1180px) {
  .level-path, .reward-cabinet { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mission-workspace { grid-template-columns: minmax(200px, .55fr) minmax(430px, 1.45fr); }
  .mission-support { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
  .mission-brief { position: static; }
  .project-overview { grid-template-columns: 130px 1fr 130px; }
  .project-overview > :last-child { display: none; }
}

@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; height: 100vh; transform: translateX(-105%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .mobile-header { position: sticky; top: 0; z-index: 20; height: 60px; display: flex; justify-content: space-between; align-items: center; padding: 0 17px; border-bottom: 1px solid var(--line); background: rgba(12,14,18,.95); backdrop-filter: blur(12px); }
  .mobile-title { font-weight: 800; font-size: .84rem; }
  .content-shell { padding: 30px 20px 60px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .current-card { min-height: auto; }
  .level-path, .reward-cabinet { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mission-workspace { grid-template-columns: 1fr; }
  .mission-support { grid-column: auto; grid-template-columns: 1fr 1fr; }
  .mission-brief { position: static; }
  .project-overview { grid-template-columns: 110px 1fr 110px; }
  .submission-grid { grid-template-columns: 1fr 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
  .login-shell { grid-template-columns: 1fr; }
  .login-story { min-height: auto; padding: 35px 30px; }
  .login-story-copy { margin: 65px 0; }
  .login-levels, .login-footnote { display: none; }
  .login-panel { min-height: auto; padding: 70px 30px; }
}

@media (max-width: 640px) {
  h1 { font-size: 2.3rem; }
  .page-header, .mission-header { align-items: flex-start; flex-direction: column; }
  .page-header .button, .header-actions { width: 100%; }
  .header-actions .button { flex: 1; }
  .current-card { padding: 23px; }
  .current-card-head { margin-bottom: 34px; }
  .current-card h2 { font-size: 2.15rem; }
  .progress-ring { --size: 68px; }
  .level-path, .reward-cabinet, .mentor-stats, .submission-grid { grid-template-columns: 1fr; }
  .level-card { min-height: auto; }
  .project-overview { grid-template-columns: 1fr 1fr; }
  .overview-progress { grid-column: 1 / -1; grid-row: 1; }
  .project-level > header { grid-template-columns: 42px 1fr; }
  .level-reward { display: none; }
  .mission-row { grid-template-columns: 32px minmax(0, 1fr) 18px; padding-inline: 14px; }
  .row-state { display: none; }
  .mission-support { grid-template-columns: 1fr; }
  .mission-header-meta { white-space: normal; }
  .mission-editor { padding: 20px; }
  .form-actions { align-items: stretch; flex-direction: column-reverse; }
  .data-table th:nth-child(3), .data-table td:nth-child(3), .data-table th:nth-child(4), .data-table td:nth-child(4) { display: none; }
  .data-table th, .data-table td { padding: 13px 12px; }
  .reward-order { grid-template-columns: 42px 1fr auto; }
  .reward-order form { grid-column: 1 / -1; }
  .reward-order .button { width: 100%; }
  .login-story-copy h1 { font-size: 3rem; }
  .login-story::after { display: none; }
  .flash-stack { top: 12px; right: 12px; width: calc(100vw - 24px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
