:root {
  --bg: #f4f3ef;
  --panel: #ffffff;
  --text: #1f2622;
  --muted: #68726c;
  --line: #dedfd9;
  --accent: #2f5d50;
  --accent-dark: #21443a;
  --accent-soft: #e5eeea;
  --warning: #8a5b20;
  --warning-soft: #fff1dc;
  --danger: #8b3b3b;
  --success: #2e6447;
  --success-soft: #e2f0e8;
  --shadow: 0 12px 32px rgba(31, 38, 34, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at top right, rgba(47,93,80,.08), transparent 36rem), var(--bg); }
button, input, textarea, select { font: inherit; }
.page-shell { width: min(1120px, calc(100% - 28px)); margin: 0 auto; padding: 28px 0 56px; }
.portal-shell { max-width: 1040px; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: clamp(2.2rem, 6vw, 4rem); line-height: 1; letter-spacing: -.045em; }
h2 { margin-bottom: 8px; font-size: clamp(1.55rem, 4vw, 2.2rem); letter-spacing: -.025em; }
h3 { margin-bottom: 0; font-size: 1.25rem; line-height: 1.25; }
.subtitle { color: var(--muted); max-width: 760px; margin-bottom: 0; line-height: 1.55; }
.muted { color: var(--muted); }
.eyebrow { margin-bottom: 8px; color: var(--accent); font-size: .74rem; font-weight: 800; letter-spacing: .16em; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 22px; box-shadow: var(--shadow); margin-bottom: 22px; }
.panel-heading { margin-bottom: 20px; }
.stack { display: grid; gap: 16px; }
label { display: grid; gap: 7px; font-weight: 700; font-size: .94rem; }
input, textarea, select { width: 100%; border: 1px solid #cfd3ce; border-radius: 12px; background: #fff; color: var(--text); padding: 12px 13px; outline: none; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; min-height: 150px; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47,93,80,.12); }
.button { border: 0; border-radius: 12px; padding: 11px 16px; font-weight: 800; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.button:disabled { opacity: .55; cursor: wait; }
.button.primary { background: var(--accent); color: white; }
.button.primary:hover { background: var(--accent-dark); }
.button.secondary { background: var(--accent-soft); color: var(--accent-dark); }
.inline-button { width: fit-content; }
.form-message { margin: 0; min-height: 1.25rem; color: var(--danger); font-weight: 700; font-size: .9rem; }
.text-link { color: var(--accent-dark); font-weight: 800; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.hidden { display: none !important; }

.intro-panel { padding: 26px; }
.steps-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 18px; }
.steps-grid > div { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: #fafbf9; display: grid; gap: 8px; }
.steps-grid strong { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: white; }
.steps-grid span { color: #445047; line-height: 1.4; font-size: .92rem; }
.catalog-toolbar { padding: 16px 20px; }
.search-box { max-width: 520px; }
.catalog-section { margin: 34px 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.count-pill { display: inline-flex; padding: 6px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); font-weight: 800; font-size: .78rem; }
.catalog-list { display: grid; gap: 12px; }
.assignment-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: 0 8px 24px rgba(31,38,34,.05); }
.assignment-card-top { display: flex; justify-content: space-between; gap: 18px; }
.assignment-meta { margin-bottom: 6px; color: var(--muted); font-size: .82rem; font-weight: 750; }
.assignment-prompt { margin: 14px 0; white-space: pre-wrap; line-height: 1.55; color: #3f4943; }
.assignment-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.extra-section .assignment-card { border-left: 5px solid var(--accent); }
.empty-card { box-shadow: none; color: var(--muted); text-align: center; }

.assignment-panel { max-width: 760px; margin-left: auto; margin-right: auto; }
.back-link { display: inline-block; margin-bottom: 18px; color: var(--accent-dark); font-weight: 800; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.prompt-box { background: #f7f7f4; border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 18px 0; }
.prompt-box p { white-space: pre-wrap; line-height: 1.55; }
.divider { height: 1px; background: var(--line); margin: 20px 0; }
.choice-divider { display: flex; align-items: center; gap: 12px; color: #667085; font-size: 12px; font-weight: 700; letter-spacing: .08em; margin: 2px 0; }
.choice-divider::before, .choice-divider::after { content: ""; height: 1px; background: #d9dee7; flex: 1; }
.file-list { display: grid; gap: 6px; }
.file-list > div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 8px 10px; border-radius: 8px; background: #f6f8fb; }
.file-list span { color: #667085; white-space: nowrap; }
.big-submit { width: 100%; min-height: 52px; font-size: 16px; }
.success-panel { max-width: 760px; margin: 0 auto; text-align: center; padding: 48px 24px; }
.success-mark { width: 60px; height: 60px; border-radius: 50%; background: #e7f6ec; display: grid; place-items: center; margin: 0 auto 14px; font-size: 34px; font-weight: 800; }
small.muted { display: block; margin-top: 6px; }

@media (max-width: 760px) {
  .site-header, .section-heading { align-items: flex-start; flex-direction: column; }
  .steps-grid { grid-template-columns: repeat(2, 1fr); }
  .assignment-actions { align-items: stretch; flex-direction: column; }
  .assignment-actions .button { width: 100%; }
}

@media (max-width: 460px) {
  .page-shell { width: min(100% - 18px, 1120px); padding-top: 18px; }
  .panel { padding: 18px; border-radius: 16px; }
  .steps-grid { grid-template-columns: 1fr; }
  h1 { font-size: 2.45rem; }
}
