:root {
  color-scheme: light;
  --ink: #17212b;
  --muted: #667381;
  --line: #d9e1e7;
  --paper: #ffffff;
  --wash: #f4f7f6;
  --green: #2f8f83;
  --green-dark: #1d655d;
  --gold: #e39b34;
  --blue: #243b53;
  --red: #b94a48;
  --shadow: 0 18px 50px rgba(23, 33, 43, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--wash);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto auto;
  gap: 18px;
  align-items: center;
  padding: 14px clamp(16px, 4vw, 44px);
  border-bottom: 1px solid rgba(217, 225, 231, 0.9);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

body:not(.is-signed-in) .app-only {
  display: none !important;
}

body:not(.is-signed-in) .topnav a:not([href="#account"]) {
  display: none;
}

body:not(.is-signed-in) #postTaskTop {
  display: none;
}

body.is-signed-in .signed-out-intro {
  display: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  background: #fff;
}

.topnav a {
  min-width: 70px;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.topnav a:hover {
  background: var(--wash);
  color: var(--ink);
}

.primary-action,
.ghost-action,
.tab,
.task-action {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

.primary-action {
  background: var(--green);
  color: #fff;
  padding: 10px 16px;
}

.primary-action:hover {
  background: var(--green-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px clamp(16px, 4vw, 44px) 56px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.overview-panel,
.task-board,
.form-section,
.admin-section,
.rules-section {
  width: 100%;
  min-width: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(23, 33, 43, 0.06);
}

.overview-panel {
  position: sticky;
  top: 88px;
  overflow: hidden;
}

.campus-visual {
  aspect-ratio: 3 / 2;
  background: #dce9e5;
}

.campus-visual svg {
  display: block;
  width: 100%;
  height: 100%;
}

.overview-copy,
.task-board,
.form-section,
.admin-section,
.rules-section {
  padding: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.15;
}

h3 {
  margin-bottom: 8px;
  font-size: 18px;
}

.overview-copy p:last-child {
  color: var(--muted);
  line-height: 1.55;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}

.stats-grid div {
  padding: 16px 14px;
  border-right: 1px solid var(--line);
}

.stats-grid div:last-child {
  border-right: 0;
}

.stats-grid strong,
.stats-grid span {
  display: block;
}

.stats-grid strong {
  font-size: 28px;
}

.stats-grid span {
  color: var(--muted);
  font-size: 12px;
}

.board-header {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(280px, 540px);
  gap: 18px;
  align-items: end;
  margin-bottom: 16px;
}

.board-tools {
  display: grid;
  grid-template-columns: 1fr 170px;
  gap: 10px;
}

label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 143, 131, 0.14);
}

.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.tab {
  flex: 0 0 auto;
  min-width: 86px;
  padding: 8px 12px;
  background: #edf2f4;
  color: var(--muted);
}

.tab.active {
  background: var(--blue);
  color: #fff;
}

.task-list {
  display: grid;
  gap: 12px;
  padding-top: 16px;
}

.task-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.task-card.boosted {
  border-color: rgba(227, 155, 52, 0.72);
  box-shadow: inset 4px 0 0 var(--gold);
}

.task-title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.task-title-row h3 {
  margin: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  background: #edf2f4;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.badge.open {
  background: rgba(47, 143, 131, 0.12);
  color: var(--green-dark);
}

.badge.accepted {
  background: rgba(36, 59, 83, 0.12);
  color: var(--blue);
}

.badge.completed {
  background: rgba(102, 115, 129, 0.14);
  color: var(--muted);
}

.badge.boost {
  background: rgba(227, 155, 52, 0.18);
  color: #8f590e;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 14px;
}

.task-card p {
  margin: 10px 0;
  color: #3b4651;
  line-height: 1.45;
}

.fee-line {
  margin-top: 8px;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.deadline-line {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.contact-line {
  color: var(--muted);
  font-size: 13px;
}

.privacy-note {
  margin: 0;
  border-left: 3px solid var(--green);
  background: rgba(47, 143, 131, 0.08);
  color: var(--green-dark);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.4;
}

.task-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-content: start;
  min-width: 128px;
}

.task-action {
  padding: 9px 11px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.task-action.accept {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.task-action.danger {
  color: var(--red);
}

.empty-state {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.form-section,
.admin-section,
.account-section,
.rules-section {
  margin-top: 22px;
}

.account-section {
  width: 100%;
  min-width: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(23, 33, 43, 0.06);
  padding: 22px;
}

.section-intro {
  max-width: 820px;
  margin: -8px 0 16px;
  color: var(--muted);
  line-height: 1.5;
}

.signed-out-intro {
  max-width: 760px;
  margin-bottom: 18px;
}

.signed-out-intro h1 {
  margin-bottom: 10px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.12;
  max-width: 820px;
}

.signed-out-intro p {
  color: var(--muted);
  line-height: 1.55;
}

.auth-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto auto auto;
  gap: 12px;
  align-items: end;
}

.my-tasks-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.personal-list {
  min-height: 110px;
  text-align: left;
}

.personal-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.personal-card + .personal-card {
  margin-top: 10px;
}

.personal-card p {
  margin-bottom: 6px;
  color: var(--muted);
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.rules-grid article {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.rules-grid p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.payment-plan {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.85fr);
  gap: 18px;
  align-items: start;
  margin-top: 16px;
  border: 1px solid rgba(47, 143, 131, 0.24);
  border-radius: 8px;
  background: #f7fbfa;
  padding: 18px;
}

.payment-plan h3 {
  margin-bottom: 8px;
}

.payment-plan p {
  color: var(--muted);
  line-height: 1.55;
}

.payment-plan ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
  color: var(--ink);
}

.payment-plan li {
  line-height: 1.45;
}

.policy-panel {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}

.section-heading.compact {
  margin-bottom: 14px;
}

.policy-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.policy-steps article {
  border-left: 3px solid var(--green);
  background: #f8faf9;
  border-radius: 6px;
  padding: 12px 12px 12px 14px;
}

.policy-steps strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
}

.policy-steps p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.section-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: end;
  margin-bottom: 18px;
}

.section-heading .eyebrow,
.section-heading h2 {
  width: 100%;
}

.mode-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(47, 143, 131, 0.22);
  border-radius: 999px;
  background: rgba(47, 143, 131, 0.1);
  color: var(--green-dark);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
}

.task-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.wide {
  grid-column: 1 / -1;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-row input {
  width: 18px;
  min-height: 18px;
}

.check-row span {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}

.payment-preview {
  align-self: end;
  min-height: 46px;
  border: 1px solid rgba(47, 143, 131, 0.2);
  border-radius: 8px;
  background: #f7fbfa;
  color: var(--muted);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.35;
}

.payment-preview strong {
  color: var(--ink);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.admin-tools {
  display: none;
}

.lookup-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.lookup-result {
  margin-top: 12px;
}

.lookup-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.lookup-card + .lookup-card {
  margin-top: 8px;
}

.reports-panel {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.reports-list {
  display: grid;
  gap: 10px;
}

.report-card {
  border-left: 3px solid #c75050;
  border-radius: 6px;
  background: #fff8f8;
  padding: 12px;
}

.report-card h3 {
  margin-bottom: 6px;
  font-size: 16px;
}

.report-card p {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.task-action.report {
  border-color: rgba(199, 80, 80, 0.28);
  color: #a23f3f;
}

.code-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
  color: var(--ink);
  padding: 14px;
  font-size: 18px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.ghost-action {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 10px 14px;
}

.icon-action {
  width: 42px;
  min-width: 42px;
  padding-inline: 0;
}

.ghost-action:hover,
.task-action:hover {
  border-color: var(--blue);
}

.task-dialog {
  width: min(440px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.task-dialog::backdrop {
  background: rgba(23, 33, 43, 0.34);
}

.task-dialog form {
  display: grid;
  gap: 12px;
}

.task-dialog menu {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  max-width: min(360px, calc(100vw - 36px));
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .topnav {
    display: none;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .overview-panel {
    position: static;
  }

  .board-header {
    grid-template-columns: 1fr;
  }

  .task-form,
  .auth-form,
  .rules-grid,
  .payment-plan,
  .policy-steps,
  .my-tasks-grid,
  .lookup-form,
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body {
    min-width: 0;
  }

  main {
    width: 100%;
    padding: 14px 10px 44px;
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
  }

  .brand {
    width: 100%;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand strong {
    font-size: 16px;
    line-height: 1.1;
  }

  .top-actions {
    display: grid;
    width: 100%;
    grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1.25fr);
    gap: 8px;
  }

  .top-actions .ghost-action,
  .top-actions .primary-action {
    width: 100%;
    min-width: 0;
    padding-inline: 8px;
    font-size: 14px;
    white-space: nowrap;
  }

  .brand small {
    display: none;
  }

  .overview-copy,
  .task-board,
  .form-section,
  .admin-section,
  .account-section,
  .rules-section {
    padding: 16px;
  }

  .overview-panel,
  .task-board,
  .form-section,
  .admin-section,
  .account-section,
  .rules-section {
    overflow: hidden;
  }

  .overview-copy h1,
  .signed-out-intro h1 {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .stats-grid div {
    padding: 14px 12px;
  }

  .stats-grid strong {
    font-size: 24px;
  }

  .category-tabs {
    margin-inline: -2px;
    padding-inline: 2px;
  }

  .tab {
    min-width: 0;
    padding-inline: 12px;
  }

  .board-tools {
    grid-template-columns: 1fr;
  }

  .task-form > *,
  .auth-form > *,
  .lookup-form > * {
    min-width: 0;
  }

  .task-card {
    grid-template-columns: 1fr;
  }

  .task-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 0;
  }

  .task-action {
    min-width: 0;
    padding-inline: 8px;
    font-size: 13px;
  }

  h1 {
    font-size: 34px;
    line-height: 1.06;
  }
}
