:root {
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #171820;
  background: #f7f8fc;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --blue: #3949f5;
  --muted: #858ba0;
}

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: #f7f8fc; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

.app-shell { width: min(100%, 520px); min-height: 100vh; margin: 0 auto; padding: max(28px, env(safe-area-inset-top)) 24px calc(104px + env(safe-area-inset-bottom)); }
.topbar { display: flex; min-height: 48px; align-items: center; justify-content: space-between; }
.back-link { display: inline-flex; min-height: 42px; align-items: center; gap: 5px; color: #626a81; font-size: 14px; font-weight: 600; }
.back-link > span:first-child { color: #272a36; font-size: 31px; font-weight: 400; line-height: 1; }
.brand { font-size: 18px; font-weight: 850; letter-spacing: -.65px; }
.brand span { color: var(--blue); }

.chapter-heading { margin-top: 27px; }
.chapter-label { margin: 0 0 8px; color: var(--blue); font-size: 12px; font-weight: 750; letter-spacing: .75px; }
.chapter-heading h1 { max-width: 360px; margin: 0; font-size: 32px; line-height: 1.12; letter-spacing: -1.15px; }
.chapter-description { max-width: 350px; margin: 9px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }

.module-card { display: flex; min-height: 76px; align-items: center; justify-content: space-between; gap: 12px; margin-top: 23px; padding: 12px 14px; border: 1px solid #eff0f5; border-radius: 18px; background: #fff; }
.module-details { display: flex; min-width: 0; align-items: center; gap: 12px; }
.module-icon { display: grid; flex: 0 0 44px; width: 44px; height: 44px; place-items: center; border-radius: 13px; color: var(--blue); background: #eff0ff; }
.module-icon svg { width: 22px; fill: currentColor; }
.module-copy { display: grid; min-width: 0; gap: 3px; }
.module-copy strong { font-size: 14px; }
.module-copy span { color: var(--muted); font-size: 12px; }
.module-button { min-height: 38px; padding: 0 13px; border: 0; border-radius: 10px; color: #fff; background: linear-gradient(100deg, #3154f5, #4a39e8); font-size: 12px; font-weight: 650; white-space: nowrap; cursor: pointer; }
.page-feedback { margin: 9px 3px 0; color: #636a80; font-size: 13px; line-height: 1.4; }
.page-feedback[hidden] { display: none; }

.quest-list { display: grid; gap: 15px; margin-top: 22px; }
.quest-card { padding: 18px; border: 1px solid #eff0f5; border-radius: 18px; background: #fff; }
.quest-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.quest-label { color: var(--blue); font-size: 11px; font-weight: 750; letter-spacing: .55px; }
.quest-reward { color: #5a45d8; font-size: 13px; font-weight: 700; text-align: right; }
.quest-card h2 { margin: 10px 0 0; font-size: 20px; letter-spacing: -.45px; }
.quest-instruction { margin: 6px 0 14px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.file-picker { display: flex; min-height: 42px; align-items: center; justify-content: center; border: 1px dashed #c8cbe0; border-radius: 11px; color: #5d6380; background: #fafaff; font-size: 13px; font-weight: 600; cursor: pointer; }
.file-picker input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
.file-picker:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.file-name { overflow: hidden; margin: 7px 1px 0; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.quest-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 13px; }
.submission-status { color: #73788d; font-size: 12px; }
.submit-button { min-height: 36px; padding: 0 13px; border: 0; border-radius: 10px; color: #fff; background: linear-gradient(100deg, #3154f5, #4a39e8); font-size: 12px; font-weight: 650; }
.submit-button:disabled { color: #898ea1; background: #eceef4; }

.bottom-nav { position: fixed; z-index: 5; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(4, 1fr); width: min(100%, 520px); min-height: calc(82px + env(safe-area-inset-bottom)); margin: 0 auto; padding: 10px 8px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid #f0f1f6; background: rgb(255 255 255 / 96%); backdrop-filter: blur(12px); }
.nav-item { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 5px; color: #a2a5b8; font-size: 12px; font-weight: 500; }
.nav-item svg { width: 24px; height: 24px; fill: currentColor; }
.nav-item.is-active { color: var(--blue); }

@media (max-width: 370px) {
  .app-shell { padding-right: 18px; padding-left: 18px; }
  .chapter-heading h1 { font-size: 29px; }
  .module-card { gap: 8px; padding-right: 10px; padding-left: 10px; }
  .module-details { gap: 8px; }
  .module-button { padding: 0 10px; font-size: 11px; }
  .quest-card { padding: 15px; }
  .quest-reward { font-size: 12px; }
}

@media (min-width: 520px) {
  .app-shell { min-height: calc(100vh - 18px); margin-top: 9px; border-radius: 28px; background: #fafbfe; }
  .bottom-nav { border-right: 1px solid #f0f1f6; border-left: 1px solid #f0f1f6; border-radius: 18px 18px 0 0; }
}
