:root {
  color-scheme: light;
  font-family: "Aptos", "Segoe UI", system-ui, sans-serif;
  color: #182e2e;
  background: #f6f7f1;
  --ink: #182e2e;
  --muted: #4d625f;
  --teal: #194c47;
  --dark: #142e2c;
  --border: #dce3d9;
  --light: #fffdf7;
  --yellow: #ecf278;
  --radius: 1.1rem;
  line-height: 1.5;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.1; }
h1 { font-size: clamp(2.25rem, 6vw, 4.15rem); letter-spacing: -.066em; font-weight: 750; }
h2 { font-size: 1.55rem; letter-spacing: -.035em; }
h3 { font-size: 1.14rem; letter-spacing: -.02em; }
p + p { margin-top: .75rem; }
a { color: var(--teal); text-underline-offset: .23em; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #346bda; outline-offset: 3px; }
.wrap, .top { max-width: 74rem; padding-inline: clamp(1rem, 4vw, 3rem); margin-inline: auto; }
.skip { position: absolute; left: 1rem; top: .7rem; padding: .5rem 1rem; background: white; z-index: 10; transform: translateY(-180%); }
.skip:focus { transform: none; }
.site-header { background: #fffdf9; border-bottom: 1px solid var(--border); }
.top { display: flex; align-items: center; min-height: 4.65rem; gap: 1.8rem; }
.brand { color: var(--ink); text-decoration: none; display: inline-flex; gap: .65rem; align-items: center; white-space: nowrap; font-size: 1.17rem; font-weight: 760; letter-spacing: -.055em; }
.brand-icon { display: inline-flex; align-items: flex-end; justify-content: center; gap: 3px; width: 2rem; height: 2rem; padding: .48rem .35rem; border-radius: .52rem; background: var(--dark); }
.brand-icon i { width: .19rem; border-radius: 2px; background: var(--yellow); height: 42%; }
.brand-icon i:nth-child(2) { height: 67%; }
.brand-icon i:nth-child(3) { height: 100%; }
.top nav { display: flex; align-items: center; gap: .23rem; flex-wrap: wrap; }
.top nav a { color: var(--muted); font-size: .92rem; text-decoration: none; font-weight: 650; padding: .52rem .72rem; border-radius: .52rem; }
.top nav a:hover, .top nav a[aria-current="page"] { background: #eaf0e5; color: var(--dark); }
.sign-out { margin-left: auto; }
main.wrap { padding-top: clamp(2rem, 5vw, 4rem); min-height: 68vh; }
.footer { padding-block: 2rem 1.8rem; color: var(--muted); display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; font-size: .86rem; }
.footer span:first-child { font-weight: 700; }
.eyebrow { text-transform: uppercase; font-size: .82rem; font-weight: 760; letter-spacing: .12em; }
.page-heading { margin: .3rem 0 1.65rem; }
.page-heading p { margin-top: .55rem; color: var(--muted); }
.student-title { margin: 0 0 1.55rem; }
.student-title .eyebrow { color: #4b665c; margin-bottom: .42rem; }
.home-grid, .topic-grid, .admin-grid { display: grid; gap: 1rem; margin-bottom: 1rem; align-items: start; }
.home-grid { grid-template-columns: 1.95fr 1fr; align-items: stretch; }
.topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-grid { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.hero { min-height: 19rem; border-radius: var(--radius); background: var(--dark); color: #fffdf5; position: relative; overflow: hidden; display: flex; align-items: center; }
.hero-body { position: relative; padding: clamp(1.5rem, 5vw, 3.35rem); max-width: 37rem; }
.hero .eyebrow { color: var(--yellow); margin-bottom: .95rem; }
.hero h2 { font-size: clamp(2.15rem, 4.5vw, 3.9rem); letter-spacing: -.06em; text-wrap: balance; }
.hero p:not(.eyebrow), .hero-meta { margin-top: .7rem; color: #e0e9dd; }
.hero .button.primary { background: var(--yellow); border-color: var(--yellow); color: #263b22; margin-top: .3rem; }
.hero .button:hover { background: #f7fbae; }
.hero .actions { align-items: center; margin-top: 1.25rem; }
.hero-lines { position: absolute; inset: -22% -30% -34% 40%; opacity: .37; background: repeating-radial-gradient(ellipse at 80% 16%, transparent 0 18px, #7f9e73 19px 20px, transparent 21px 35px); transform: rotate(-28deg); mask-image: linear-gradient(90deg, transparent, #000 45%); pointer-events: none; }
.panel { background: #fffdf9; border: 1px solid var(--border); min-width: 0; padding: clamp(1.15rem, 3vw, 1.8rem); border-radius: var(--radius); }
.panel > h2 { margin-bottom: .95rem; }
.panel p + .actions, .panel p + form, .panel .table-scroll + form, .panel p + .button { margin-top: 1rem; }
.panel p { color: var(--muted); }
main > .panel + .panel, .account-list > .panel + .panel { margin-top: 1rem; }
.quick { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; min-height: 100%; }
.quick p { margin-bottom: .3rem; }
.quick-icon { height: 2.6rem; width: 2.6rem; border-radius: .65rem; display: grid; place-items: center; background: #ecf0df; color: #305644; margin-bottom: 1rem; font-weight: 700; font-size: 1.6rem; line-height: 1; }
.below { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; padding: 1.35rem 1.5rem; border-block: 1px solid var(--border); }
.below p { margin-top: .4rem; color: var(--muted); }
.subject { min-height: 100%; }
.resource-link { margin-top: 1.15rem; }
.topic-link { display: block; padding: .62rem .82rem; border-radius: .5rem; background: #f1f4ec; font-weight: 700; text-decoration: none; }
.topic-link + .topic-link { margin-top: .3rem; }
.topic-link:hover { background: #e4eddf; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.65rem; padding: .52rem .88rem; border-radius: .55rem; border: 1px solid transparent; font-weight: 690; font-size: .93rem; text-decoration: none; line-height: 1.25; width: fit-content; max-width: 100%; white-space: normal; text-align: center; }
.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.primary:hover { background: #26655b; }
.secondary { color: var(--teal); background: #f0f4e9; border-color: #dce7d8; }
.secondary:hover { background: #e3eddf; }
.plain { color: var(--teal); background: transparent; }
.plain:hover { background: #edf2e7; }
.danger { color: #8e2924; background: #fdf0ec; border-color: #efc9bf; }
.danger:hover { background: #fce1d8; }
.text-link { font-weight: 670; }
.text-link + .page-heading { margin-top: .75rem; }
.actions { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; }
.stack { display: grid; gap: 1rem; align-items: start; }
.stack > .actions { margin-top: 0; }
.welcome { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1.65fr) minmax(17rem, 1fr); }
.welcome-copy { border-radius: var(--radius); background: var(--dark); color: var(--light); min-height: 19rem; padding: clamp(1.6rem, 5vw, 3rem); display: flex; flex-direction: column; justify-content: center; }
.welcome-copy h1 { max-width: 12ch; color: #f5f8d8; }
.welcome-copy p { max-width: 33ch; margin-top: .95rem; color: #e0e9dd; font-size: 1.05rem; }
.login { align-content: center; }
.login .primary { width: 100%; }
.notice, .error { border-radius: .58rem; border: 1px solid #bdd5bc; padding: .75rem .9rem; background: #e8f3e5; color: #24472e; margin-bottom: 1rem; }
.error { border-color: #e9bda9; background: #fcf0e8; color: #793524; }
.notice p, .error p { color: inherit; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.tag { display: inline-flex; align-items: center; padding: .23rem .55rem; border-radius: 2rem; background: #e9efe8; color: #304d40; font-size: .84rem; line-height: 1.2; font-weight: 660; white-space: nowrap; }
.tag.green { background: #def0d9; color: #24502f; }
.tag.amber { background: #f6eac6; color: #654610; }
.field { display: grid; gap: .32rem; min-width: 0; align-content: start; }
.field > span, legend { font-size: .92rem; color: var(--ink); font-weight: 700; }
input:not([type="radio"]):not([type="checkbox"]), select, textarea { width: 100%; min-width: 0; border-radius: .5rem; min-height: 2.65rem; background: #fff; color: var(--ink); padding: .52rem .65rem; border: 1px solid #bccac1; }
select { appearance: none; padding-right: 1.7rem; background: linear-gradient(45deg, transparent 50%, #4a645d 50%) calc(100% - 15px) 52% / 4px 4px no-repeat, linear-gradient(135deg, #4a645d 50%, transparent 50%) calc(100% - 11px) 52% / 4px 4px no-repeat, #fff; }
textarea { resize: vertical; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--teal); width: 1.05rem; height: 1.05rem; }
.inline-form { display: flex; align-items: flex-end; gap: .65rem; flex-wrap: wrap; }
.filters { margin-bottom: 1rem; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.compact { margin: 0; border: 1px solid var(--border); border-radius: .55rem; padding: .48rem .65rem .65rem; min-width: 0; }
.days, .checkline { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; }
.days label, .order-row label { display: flex; align-items: center; gap: .25rem; font-size: .91rem; }
.order-row { display: flex; justify-content: space-between; align-items: center; gap: .35rem; border-bottom: 1px solid var(--border); padding-block: .15rem; }
.order-row:last-child { border-bottom: 0; }
.order-buttons { display: flex; flex-shrink: 0; gap: .1rem; }
.order-buttons button { padding: .15rem .42rem; min-height: 2.1rem; }
.week, .review-top, .quiz-intro { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .9rem; }
.week > span { font-weight: 690; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; }
th, td { padding: .7rem .65rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .87rem; color: var(--muted); background: #f5f7f0; white-space: nowrap; }
td { min-width: 4rem; }
tr:last-child td { border-bottom: 0; }
.account-list { margin-top: 1rem; }
.account-actions { margin: .8rem 0; }
.availability { margin-top: .8rem; }
.invite-code { flex: 0 1 25rem; font-family: monospace; }
.callout { border-color: #adc9aa; }
.quiz, .review-list { display: grid; gap: .95rem; max-width: 54rem; }
.quiz-intro { max-width: 54rem; margin-bottom: 1.4rem; }
.question { margin: 0; }
.question legend { padding: .15rem .55rem; background: #e6eee2; border-radius: .35rem; }
.prompt { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 1.08rem; color: var(--ink) !important; margin-bottom: .8rem; }
.choices { display: grid; gap: .45rem; }
.choice { display: flex; align-items: center; gap: .66rem; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: .55rem; cursor: pointer; overflow-wrap: anywhere; }
.choice:hover, .choice:has(input:checked) { background: #edf3e7; border-color: #93b098; }
.choice input { flex: none; margin: 0; }
.choice-letter { padding: .12rem .44rem; border-radius: .35rem; color: #45624f; font-weight: 700; background: #e8eee3; }
.submit-bar { display: flex; justify-content: flex-end; }
.score { display: flex; gap: 1.1rem; align-items: center; padding: .9rem 1.35rem; background: var(--dark); color: #fff; border-radius: var(--radius); margin-bottom: 1rem; max-width: 54rem; }
.score strong { color: var(--yellow); font-size: 2.5rem; letter-spacing: -.04em; }
.score div { display: grid; justify-items: start; gap: .3rem; }
.review-choices { padding-left: 1.4rem; }
.review-choices li { padding-left: .22rem; margin-block: .3rem; overflow-wrap: anywhere; }
.explanation { border-left: .22rem solid #a3c19d; padding: .48rem .85rem; background: #f0f4ea; margin-bottom: .7rem; }
.explanation h3 { margin-bottom: .36rem; }

@media (max-width: 760px) {
  .top { gap: .2rem .65rem; flex-wrap: wrap; padding-block: .6rem; }
  .top nav { order: 2; width: 100%; }
  .top nav a { padding: .4rem .5rem; }
  .home-grid, .admin-grid, .welcome { grid-template-columns: minmax(0, 1fr); }
  .hero, .welcome-copy { min-height: 14rem; }
  .login { min-height: 13rem; }
}

@media (max-width: 490px) {
  .topic-grid, .field-grid { grid-template-columns: minmax(0, 1fr); }
  .below { align-items: flex-start; flex-direction: column; padding-inline: .55rem; }
  .inline-form .field { flex: 1 1 8.5rem; }
}
