:root {
  --legacy-plum: #1d0c2b;
  --legacy-purple: #7b56c6;
  --legacy-pink: #e21e7a;
  --legacy-pink-dark: #bd145f;
  --legacy-teal: #008f9b;
  --legacy-gold: #ffc93c;
  --legacy-ivory: #fff9f2;
  --legacy-lilac: #f5eafb;
  --legacy-muted: #65566c;
  --legacy-border: #eadfec;
}

.legacy-portal,
.legacy-portal * { box-sizing: border-box; }

.legacy-portal {
  width: min(1320px, calc(100% - 32px));
  margin: 24px auto 70px;
  color: var(--legacy-plum);
  font-family: "Avenir Next", Avenir, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.legacy-portal a { color: inherit; text-decoration: none; }
.legacy-portal button { font: inherit; }

.legacy-portal-topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 22px;
  background: rgba(255,255,255,.96);
  border: 1px solid var(--legacy-border);
  border-radius: 18px;
  box-shadow: 0 12px 34px rgba(46,23,69,.07);
}

.legacy-portal-brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.legacy-portal-brand > span { width: 44px; height: 44px; display: grid; place-items: center; color: var(--legacy-gold); background: var(--legacy-plum); border: 4px solid #ffb3c6; border-radius: 50%; }
.legacy-portal-brand div { display: flex; flex-direction: column; line-height: 1.1; }
.legacy-portal-brand strong { font-size: 17px; }
.legacy-portal-brand small { margin-top: 4px; color: var(--legacy-pink); font-family: Georgia, serif; font-style: italic; }
.legacy-view-label { padding: 8px 12px; color: var(--legacy-purple); background: #f2eaf8; border-radius: 999px; font-size: 11px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.legacy-account { display: flex; align-items: center; gap: 15px; color: var(--legacy-muted); font-size: 12px; }
.legacy-account a { color: var(--legacy-pink); font-weight: 800; }

.legacy-welcome {
  min-height: 260px;
  margin-top: 22px;
  padding: 52px clamp(28px,5vw,72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  color: white;
  background: radial-gradient(circle at 85% 20%,rgba(255,201,60,.22),transparent 25%),linear-gradient(135deg,var(--legacy-plum),#4a1a56);
  border-radius: 28px;
  overflow: hidden;
}

.legacy-eyebrow { margin: 0; color: #ffb3c6; font-size: 11px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.legacy-welcome h1 { max-width: 760px; margin: 12px 0 0; color: white; font-family: Georgia, serif; font-size: clamp(39px,5vw,67px); font-weight: 500; line-height: 1.03; letter-spacing: -.035em; }
.legacy-welcome p:last-child { max-width: 680px; margin: 16px 0 0; color: rgba(255,255,255,.72); font-size: 16px; }
.legacy-parent-welcome { min-height: 220px; background: radial-gradient(circle at 90% 18%,rgba(255,201,60,.28),transparent 24%),linear-gradient(135deg,#6c429f,var(--legacy-purple)); }
.legacy-admin-welcome { background: radial-gradient(circle at 85% 15%,rgba(255,201,60,.25),transparent 22%),linear-gradient(135deg,#004f57,var(--legacy-teal)); }

.legacy-progress-ring {
  --progress: 0%;
  width: 142px;
  height: 142px;
  flex: 0 0 142px;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--legacy-gold) var(--progress), rgba(255,255,255,.16) 0);
  border-radius: 50%;
  position: relative;
}
.legacy-progress-ring::after { content: ""; position: absolute; inset: 12px; background: var(--legacy-plum); border-radius: 50%; }
.legacy-admin-welcome .legacy-progress-ring::after { background: #006b74; }
.legacy-progress-ring > span { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; }
.legacy-progress-ring strong { font-family: Georgia,serif; font-size: 30px; font-weight: 500; }
.legacy-progress-ring small { color: rgba(255,255,255,.66); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }

.legacy-week-nav { display: grid; grid-template-columns: repeat(5,1fr); gap: 10px; margin: 22px 0; }
.legacy-week-nav a { min-height: 92px; padding: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: white; border: 1px solid var(--legacy-border); border-radius: 16px; transition: .16s ease-out; }
.legacy-week-nav a:hover { border-color: var(--legacy-purple); transform: translateY(-2px); }
.legacy-week-nav a.is-selected { color: white; background: var(--legacy-pink); border-color: var(--legacy-pink); box-shadow: 0 10px 25px rgba(226,30,122,.18); }
.legacy-week-nav small { font-size: 10px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.legacy-week-nav strong { font-family: Georgia,serif; font-size: 27px; font-weight: 500; line-height: 1.1; }
.legacy-week-nav span { min-height: 15px; margin-top: 3px; font-size: 9px; }

.legacy-progress-track { height: 8px; overflow: hidden; background: #ebe4ed; border-radius: 99px; }
.legacy-progress-track > span { display: block; width: 0; height: 100%; background: linear-gradient(90deg,var(--legacy-teal),var(--legacy-pink)); border-radius: inherit; transition: width .25s ease-out; }

.legacy-task-section, .legacy-roster { margin-top: 38px; }
.legacy-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding-bottom: 13px; border-bottom: 1px solid var(--legacy-border); }
.legacy-section-heading p { margin: 0; color: var(--legacy-pink); font-size: 12px; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.legacy-section-heading span { color: var(--legacy-muted); font-size: 11px; }
.legacy-task-list { display: grid; gap: 14px; margin-top: 17px; }

.legacy-task-card {
  min-height: 128px;
  display: grid;
  grid-template-columns: 46px 54px minmax(0,1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--legacy-border);
  border-radius: 18px;
  box-shadow: 0 8px 25px rgba(46,23,69,.045);
  transition: .18s ease-out;
}
.legacy-task-card:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(46,23,69,.08); }
.legacy-task-card.is-saving { opacity: .68; }
.legacy-task-card.is-complete { background: #f5fcfa; border-color: rgba(0,143,155,.3); }
.legacy-task-card.is-complete h3 { color: var(--legacy-muted); text-decoration: line-through; }
.legacy-check { width: 42px; height: 42px; display: grid; place-items: center; color: transparent; background: white; border: 2px solid #cfc3d3; border-radius: 50%; cursor: pointer; transition: .16s ease-out; }
.legacy-check:hover { border-color: var(--legacy-teal); transform: scale(1.05); }
.legacy-check span { font-size: 18px; font-weight: 900; }
.is-complete .legacy-check { color: white; background: var(--legacy-teal); border-color: var(--legacy-teal); }
.legacy-task-icon { width: 52px; height: 52px; display: grid; place-items: center; color: var(--legacy-purple); background: #f2eaf8; border-radius: 14px; font-size: 24px; }
.legacy-task-meta { display: flex; flex-wrap: wrap; gap: 7px; }
.legacy-task-meta span { padding: 4px 8px; color: var(--legacy-purple); background: #f2eaf8; border-radius: 999px; font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.legacy-task-meta span:nth-child(2) { color: #8a6200; background: #fff3c6; }
.legacy-task-meta span:nth-child(3) { color: #a10d50; background: #ffe4ef; }
.legacy-task-content h3 { margin: 9px 0 0; font-family: Georgia,serif; font-size: 24px; font-weight: 500; line-height: 1.2; }
.legacy-task-directions { margin-top: 8px; color: var(--legacy-muted); font-size: 13px; line-height: 1.55; }
.legacy-task-directions p { margin: 0; }
.legacy-open-resource { min-height: 44px; display: inline-flex; align-items: center; gap: 10px; padding: 0 16px; color: var(--legacy-purple) !important; background: white; border: 2px solid var(--legacy-purple); border-radius: 10px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.legacy-open-resource:hover { color: white !important; background: var(--legacy-purple); }

.legacy-empty, .legacy-login-card { max-width: 720px; margin: 44px auto; padding: 58px; text-align: center; background: white; border: 1px solid var(--legacy-border); border-radius: 24px; box-shadow: 0 14px 42px rgba(46,23,69,.07); }
.legacy-empty > span, .legacy-login-card > span { width: 64px; height: 64px; margin: 0 auto 20px; display: grid; place-items: center; color: var(--legacy-gold); background: var(--legacy-plum); border-radius: 50%; font-size: 28px; }
.legacy-empty h2, .legacy-login-card h1 { margin: 12px 0 0; font-family: Georgia,serif; font-size: clamp(31px,4vw,46px); font-weight: 500; }
.legacy-empty p, .legacy-login-card > p:last-of-type { color: var(--legacy-muted); }
.legacy-primary-button { min-height: 54px; margin-top: 18px; padding: 0 24px; display: inline-flex; align-items: center; justify-content: center; color: white !important; background: var(--legacy-pink); border-radius: 10px; font-weight: 800; }

.legacy-family-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; margin-top: 28px; }
.legacy-family-card { padding: 28px; background: white; border: 1px solid var(--legacy-border); border-radius: 22px; box-shadow: 0 10px 30px rgba(46,23,69,.05); }
.legacy-family-card-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.legacy-family-card-head span { color: var(--legacy-pink); font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.legacy-family-card-head h2 { margin: 6px 0 0; font-family: Georgia,serif; font-size: 29px; font-weight: 500; }
.legacy-family-card-head > strong { font-family: Georgia,serif; font-size: 34px; font-weight: 500; }
.legacy-family-card .legacy-progress-track { margin-top: 17px; }
.legacy-family-summary { color: var(--legacy-muted); font-size: 11px; }
.legacy-parent-task-list { margin-top: 20px; display: grid; gap: 8px; }
.legacy-parent-task { display: flex; gap: 12px; align-items: center; padding: 12px; background: #faf6fb; border-radius: 10px; }
.legacy-parent-task > span { width: 26px; height: 26px; display: grid; place-items: center; color: var(--legacy-muted); background: white; border: 1px solid #d9cede; border-radius: 50%; }
.legacy-parent-task.is-complete > span { color: white; background: var(--legacy-teal); border-color: var(--legacy-teal); }
.legacy-parent-task div { display: flex; flex-direction: column; }
.legacy-parent-task strong { font-size: 13px; }
.legacy-parent-task small, .legacy-muted { color: var(--legacy-muted); font-size: 10px; }

.legacy-admin-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 25px 0; }
.legacy-admin-actions a { min-height: 46px; display: inline-flex; align-items: center; padding: 0 17px; color: var(--legacy-purple); background: white; border: 2px solid var(--legacy-purple); border-radius: 10px; font-size: 12px; font-weight: 800; }
.legacy-admin-actions a:first-child { color: white; background: var(--legacy-pink); border-color: var(--legacy-pink); }
.legacy-table-wrap { overflow-x: auto; margin-top: 16px; background: white; border: 1px solid var(--legacy-border); border-radius: 18px; }
.legacy-roster table { width: 100%; border-collapse: collapse; }
.legacy-roster th, .legacy-roster td { padding: 17px; text-align: left; border-bottom: 1px solid var(--legacy-border); font-size: 13px; }
.legacy-roster th { color: var(--legacy-muted); background: #faf6fb; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.legacy-roster tbody tr:last-child td { border-bottom: 0; }
.legacy-mini-progress { width: 140px; height: 7px; overflow: hidden; background: #ebe4ed; border-radius: 99px; }
.legacy-mini-progress span { display: block; height: 100%; background: var(--legacy-teal); }
.legacy-status { display: inline-flex; padding: 5px 9px; border-radius: 99px; font-size: 9px; font-weight: 850; text-transform: uppercase; }
.legacy-status-done { color: #00666f; background: #d9f6f3; }
.legacy-status-working { color: #794c00; background: #fff1bf; }
.legacy-status-waiting { color: var(--legacy-muted); background: #eee9ef; }

@media (max-width: 820px) {
  .legacy-view-label { display: none; }
  .legacy-welcome { align-items: flex-start; }
  .legacy-progress-ring { width: 112px; height: 112px; flex-basis: 112px; }
  .legacy-progress-ring strong { font-size: 24px; }
  .legacy-task-card { grid-template-columns: 42px 46px minmax(0,1fr); }
  .legacy-open-resource { grid-column: 2/-1; justify-self: start; }
  .legacy-family-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .legacy-portal { width: calc(100% - 20px); margin-top: 10px; }
  .legacy-portal-topbar { padding: 12px 14px; }
  .legacy-portal-brand > span { width: 38px; height: 38px; }
  .legacy-portal-brand strong { font-size: 14px; }
  .legacy-account > span { display: none; }
  .legacy-welcome { min-height: auto; padding: 34px 24px; flex-direction: column; }
  .legacy-welcome h1 { font-size: 39px; }
  .legacy-progress-ring { width: 100px; height: 100px; flex-basis: 100px; }
  .legacy-week-nav { gap: 5px; }
  .legacy-week-nav a { min-height: 75px; padding: 7px 3px; border-radius: 11px; }
  .legacy-week-nav strong { font-size: 22px; }
  .legacy-task-card { grid-template-columns: 40px minmax(0,1fr); gap: 12px; padding: 18px; }
  .legacy-task-icon { display: none; }
  .legacy-open-resource { grid-column: 2; width: 100%; justify-content: center; }
  .legacy-task-content h3 { font-size: 21px; }
  .legacy-section-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .legacy-empty, .legacy-login-card { padding: 38px 22px; }
  .legacy-family-card { padding: 22px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .legacy-portal * { transition: none !important; }
}
