:root {
  --bg-1: #f6ead4;
  --bg-2: #d6e9e5;
  --panel: rgba(255, 252, 246, 0.88);
  --panel-strong: #fffdfa;
  --ink: #1f2430;
  --muted: #5d6470;
  --line: rgba(31, 36, 48, 0.12);
  --accent: #c6502f;
  --accent-deep: #7d2b1b;
  --teal: #1d7d72;
  --teal-soft: rgba(29, 125, 114, 0.12);
  --blue-soft: rgba(39, 93, 165, 0.12);
  --gold: #e3ba63;
  --shadow: 0 22px 50px rgba(37, 49, 63, 0.12);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.8), transparent 28%),
    radial-gradient(circle at bottom right, rgba(29, 125, 114, 0.12), transparent 24%),
    linear-gradient(145deg, var(--bg-1), var(--bg-2));
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(14px);
}

body::before {
  width: 20rem;
  height: 20rem;
  top: -6rem;
  right: -4rem;
  background: rgba(198, 80, 47, 0.14);
}

body::after {
  width: 22rem;
  height: 22rem;
  bottom: -8rem;
  left: -7rem;
  background: rgba(227, 186, 99, 0.22);
}

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

.page-shell {
  position: relative;
  width: min(1280px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 6.5rem;
}

.hero,
.panel,
.progress-panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.hero {
  border-radius: 36px;
  padding: 1.5rem;
}

.eyebrow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  color: var(--accent-deep);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.eyebrow span {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(198, 80, 47, 0.09);
}

.hero-grid,
.main-layout,
.activity-grid,
.drop-columns {
  display: grid;
  gap: 1rem;
}

.hero-grid {
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  margin-top: 1.35rem;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 4.7rem);
  line-height: 0.95;
  margin-bottom: 0.8rem;
}

.intro,
.activity-copy,
.progress-note,
.zone-copy,
th,
td {
  line-height: 1.55;
}

.intro,
.activity-copy,
.progress-note,
.zone-copy {
  color: var(--muted);
}

.hero-actions,
.feedback-bar,
.drop-zone-head,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.hero-actions {
  margin-top: 1.25rem;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.button {
  border: 0;
  border-radius: 999px;
  padding: 0.9rem 1.2rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.button:hover,
.chip-button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--accent);
  color: white;
}

.button-secondary {
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  border: 1px solid var(--line);
}

.floating-pdf-button {
  position: absolute;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  z-index: 30;
  border: 0;
  border-radius: 999px;
  padding: 1rem 1.6rem;
  min-width: min(20rem, calc(100% - 2rem));
  background: linear-gradient(135deg, var(--accent), #ea7b43);
  color: white;
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  box-shadow:
    0 18px 34px rgba(198, 80, 47, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    filter 180ms ease;
}

.floating-pdf-button:hover {
  transform: translateX(-50%) translateY(-2px);
  box-shadow:
    0 22px 40px rgba(198, 80, 47, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  filter: saturate(1.05);
}

.floating-pdf-button:focus {
  outline: 3px solid rgba(39, 93, 165, 0.18);
  outline-offset: 3px;
}

.hero-figure {
  margin: 0;
  padding: 1rem;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(243, 248, 248, 0.92));
  border: 1px solid var(--line);
}

.hero-figure img {
  display: block;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.hero-figure figcaption {
  margin-top: 0.8rem;
  color: var(--muted);
  text-align: center;
}

.main-layout {
  grid-template-columns: 300px minmax(0, 1fr);
  margin-top: 1rem;
  align-items: start;
}

.progress-panel {
  position: sticky;
  top: 1rem;
  border-radius: var(--radius-xl);
  padding: 1.25rem;
}

.panel-kicker {
  margin-bottom: 0.35rem;
  color: var(--accent-deep);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.progress-ring {
  width: 8.5rem;
  height: 8.5rem;
  margin: 1rem auto 1.25rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, var(--panel-strong) 0 56%, transparent 57%),
    conic-gradient(var(--accent) 0deg, rgba(198, 80, 47, 0.12) 0deg);
  font-size: 1.3rem;
  font-weight: 800;
}

.progress-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: grid;
  gap: 0.7rem;
}

.progress-list li {
  display: grid;
  gap: 0.4rem;
}

.status-pill,
.challenge-tag,
.zone-counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
}

.status-pill,
.zone-counter {
  width: fit-content;
  padding: 0.35rem 0.7rem;
  background: rgba(31, 36, 48, 0.07);
  color: var(--muted);
}

.status-pill.complete {
  background: rgba(29, 125, 114, 0.12);
  color: var(--teal);
}

.status-pill.partial {
  background: rgba(227, 186, 99, 0.2);
  color: #8b6312;
}

.challenge-tag {
  padding: 0.5rem 0.8rem;
  background: var(--blue-soft);
  color: #24508b;
}

.content-stack {
  display: grid;
  gap: 1rem;
}

.panel {
  border-radius: var(--radius-xl);
  padding: 1.25rem;
}

.card {
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.bank-grid,
.chip-zone {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.choice-chip {
  position: relative;
  padding: 0.95rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(244, 247, 247, 0.92));
}

.chip-remove-button {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 1.9rem;
  height: 1.9rem;
  display: none;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: #c6502f;
  color: white;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(198, 80, 47, 0.2);
}

.chip-text {
  margin-bottom: 0.8rem;
  font-weight: 600;
}

.chip-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.chip-button {
  border: 1px solid var(--line);
  background: white;
  border-radius: 999px;
  padding: 0.5rem 0.8rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.choice-chip[data-state="input"] {
  border-color: rgba(29, 125, 114, 0.25);
  background: linear-gradient(135deg, rgba(29, 125, 114, 0.11), rgba(255, 255, 255, 0.94));
}

.choice-chip[data-state="output"] {
  border-color: rgba(198, 80, 47, 0.25);
  background: linear-gradient(135deg, rgba(198, 80, 47, 0.12), rgba(255, 255, 255, 0.94));
}

.choice-chip.sorted-chip {
  padding-top: 2.55rem;
}

.choice-chip.sorted-chip .chip-actions {
  display: none;
}

.choice-chip.sorted-chip .chip-remove-button {
  display: inline-flex;
}

.drop-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.drop-zone {
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: var(--panel-strong);
  border: 1px dashed rgba(31, 36, 48, 0.16);
  min-height: 12rem;
}

.chip-zone {
  margin-top: 0.8rem;
}

.feedback-bar {
  margin-top: 1rem;
  flex-wrap: wrap;
}

.feedback-text {
  margin: 0;
  font-weight: 700;
  color: var(--accent-deep);
}

.feedback-text.success {
  color: var(--teal);
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
  background: rgba(255, 255, 255, 0.82);
}

th,
td {
  padding: 0.85rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  text-align: left;
  background: rgba(31, 36, 48, 0.04);
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 3.6rem;
  padding: 0.75rem 0.85rem;
  border-radius: 16px;
  border: 1px solid rgba(31, 36, 48, 0.14);
  background: rgba(255, 255, 255, 0.96);
  font: inherit;
  color: var(--ink);
}

textarea:focus,
.button:focus,
.chip-button:focus {
  outline: 3px solid rgba(39, 93, 165, 0.18);
  outline-offset: 2px;
}

.payroll-shell {
  display: grid;
  gap: 1rem;
}

@media (max-width: 980px) {
  .hero-grid,
  .main-layout,
  .activity-grid,
  .drop-columns {
    grid-template-columns: 1fr;
  }

  .bank-grid,
  .chip-zone {
    grid-template-columns: 1fr;
  }

  .progress-panel {
    position: static;
  }
}

@media (max-width: 680px) {
  .page-shell {
    width: min(100%, calc(100% - 1rem));
    padding-top: 0.5rem;
    padding-bottom: 6rem;
  }

  .hero,
  .panel,
  .progress-panel {
    border-radius: 24px;
    padding: 1rem;
  }

  h1 {
    line-height: 1;
  }

  .hero-actions,
  .section-heading,
  .feedback-bar,
  .drop-zone-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media print {
  .floating-pdf-button {
    display: none;
  }
}
