/* Shared pages: homepage, check-ins, coordinator, admin, errors.
   Sits on the portal shell. Selectors stay under .shell so the portal and intake are unchanged. */

.shell main .wrap.narrow { width: min(720px, calc(100% - 40px)); }
.shell main .wrap.home { width: min(880px, calc(100% - 40px)); }
.quiet-note { margin: 0 0 18px; color: var(--muted); font-size: 14.5px; }
.home-mark { display: block; width: 76px; height: auto; margin: 0 0 14px; }
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.home-grid .card { display: flex; flex-direction: column; }
.home-grid .card > p:last-child { margin-top: auto; padding-top: 14px; }
.home-grid .card .btn { margin-top: 0; }
.home-action h2 { font-size: 1.55rem; }
.home-note { background: var(--tint); }
.home-admin { margin: 8px 0 0; font-size: 14.5px; }
.home-admin a { font-weight: 650; color: var(--muted); }
.nav a.nav-signin {
  font-size: 13px;
  font-weight: 700;
  padding: 5px 10px;
}
.about-steps { margin: 8px 0 18px; padding-left: 1.2rem; }
.about-steps li { margin: 8px 0; }
.about-promise { margin: 8px 0 0; }
.class-code-box {
  margin-top: 8px;
  background: var(--white);
  border-top: 4px solid var(--teal);
}
.class-code-box h2 { font-size: 1.05rem; margin: 0 0 6px; }
.class-code-box p { margin: 0 0 8px; color: var(--muted); font-size: 14.5px; }
.class-code-box button { min-height: 40px; padding: 8px 16px; font-size: 15px; }
.home-help { margin: 4px 0 0; font-weight: 750; }
.shell pre.welcome-letter {
  white-space: pre-wrap;
  margin: 8px 0 0;
  padding: 14px;
  border-radius: 14px;
  background: var(--paper);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  line-height: 1.45;
}
.shell input.code-entry {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 14px;
  padding: 16px 16px;
  font: inherit;
  font-size: 1.25rem;
  font-weight: 750;
  letter-spacing: .06em;
  color: inherit;
}
.shell .share-card {
  border-top: 4px solid var(--teal);
  background: linear-gradient(180deg, var(--tint) 0%, var(--white) 42%);
}
.shell .share-instruction {
  margin: 8px 0 14px;
  color: var(--primary);
  font-weight: 750;
  font-size: 1.08rem;
}
.shell .card { margin: 0 0 14px; overflow-x: auto; }
.shell .card .card { box-shadow: none; }
.shell h3 { margin: 1.15rem 0 .45rem; font-size: 1.05rem; }
.shell .lede { margin-bottom: 22px; }

.shell label { margin: 14px 0 6px; }
.shell label:first-child { margin-top: 0; }
.shell input[type="email"],
.shell input[type="password"],
.shell input[type="number"],
.shell input[type="date"],
.shell textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 14px;
  padding: 13px 14px;
  font: inherit;
  color: inherit;
}
.shell textarea { min-height: 6.5rem; resize: vertical; line-height: 1.45; }
.shell textarea.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  min-height: 24rem;
  line-height: 1.45;
}
.shell .row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.shell .row button, .shell .row .btn { margin-top: 0; }
.shell .row input[type="text"],
.shell .row input[type="number"],
.shell .row select { width: auto; max-width: 100%; }

.shell .nav { flex-wrap: wrap; }
.shell .nav-label {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 8px 4px 8px 12px;
}
.shell textarea.copy-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.95rem;
  min-height: 18rem;
  background: var(--tint);
}

.shell .nav button, .shell .nav-form button {
  margin: 0;
  min-height: 0;
  padding: 8px 14px;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 650;
  font-size: 15px;
  box-shadow: none;
}
.shell .nav button:hover, .shell .nav-form button:hover,
.shell .nav button:active, .shell .nav-form button:active {
  background: var(--tint);
  color: var(--primary);
  transform: none;
  box-shadow: none;
}
.shell button, .shell .btn {
  display: inline-block;
  margin-top: 12px;
  background: var(--accent);
  color: white;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  min-height: 48px;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--press);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.shell:not(.staff) button:not(.small), .shell:not(.staff) .btn:not(.small) {
  padding: 16px 26px;
  font-size: 1.06rem;
  min-height: 54px;
}
.shell button:hover, .shell .btn:hover { background: #0C6E6C; color: white; transform: translateY(-1px); }
.shell button:active, .shell .btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--press); }
.shell button.secondary, .shell .btn.secondary {
  background: white;
  color: var(--primary);
  box-shadow: inset 0 0 0 2px var(--line), 0 4px 0 var(--line);
}
.shell button.secondary:hover, .shell .btn.secondary:hover { background: var(--tint); color: var(--primary); }
.shell button.secondary:active, .shell .btn.secondary:active { box-shadow: inset 0 0 0 2px var(--line), 0 1px 0 var(--line); }
.shell button.danger { background: #8C3A32; color: white; box-shadow: 0 4px 0 #5E2823; }
.shell button.danger:hover { color: white; background: #8C3A32; }
.shell button.danger:active { box-shadow: 0 1px 0 #5E2823; }
.shell button.small, .shell .btn.small { padding: 8px 14px; min-height: 40px; font-size: 14px; }
.shell button:disabled { opacity: .45; cursor: not-allowed; filter: none; transform: none; }
.shell button.toast-x,
.shell:not(.staff) button.toast-x {
  min-height: 32px;
  width: 32px;
  padding: 0;
  margin: 0;
  background: transparent;
  color: #fff;
  box-shadow: none;
  font-size: 1.2rem;
}
.shell button.toast-x:hover, .shell button.toast-x:active,
.shell:not(.staff) button.toast-x:hover, .shell:not(.staff) button.toast-x:active {
  transform: none;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  box-shadow: none;
}

.shell .check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 550;
  margin: 10px 0;
}
.shell .check input { width: auto; margin-top: 4px; flex: none; }
.shell fieldset { border: 0; padding: 0; margin: 0; }
.shell legend { font-family: var(--serif); font-weight: 600; font-size: 1.2rem; color: var(--primary); padding: 0; }

.shell .scale { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 8px; }
.shell .scale label { position: relative; display: inline-flex; margin: 0; font-weight: 750; }
.shell .scale input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}
.shell .scale.nums span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3rem;
  height: 3.1rem;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: white;
  cursor: pointer;
}
.shell .scale.nums input:checked + span { background: var(--primary); color: white; border-color: var(--primary); }
.shell .scale input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 3px; }
.shell .scale.faces {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
  gap: 8px;
}
.shell .scale.faces .face-choice { display: block; }
.shell .scale.faces .face {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 88px;
  padding: 8px 4px;
  border: 2px solid var(--line);
  border-radius: 20px;
  background: white;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 4px 0 var(--line);
}
.shell .scale.faces .emoji { font-size: 1.85rem; line-height: 1; }
.shell .scale.faces .face-label { font-size: 12.5px; line-height: 1.2; color: var(--ink-soft); font-weight: 750; }
.shell .scale.faces input:checked + .face {
  background: var(--tint);
  border-color: var(--accent);
  box-shadow: 0 4px 0 var(--accent);
}
.shell .scale.faces input:checked + .face .face-label { color: var(--primary); }
.shell .scale.faces label:hover .face { background: var(--tint); }
.shell .scale.faces label:active .face { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.shell .scale.faces input:checked + .face:active,
.shell .scale.faces label:active input:checked + .face { box-shadow: 0 1px 0 var(--accent); }
.shell .anchors { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; }
.shell .choices { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 4px; }
.shell .choices .chip { position: relative; margin: 0; font-weight: 750; }
.shell .choices input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.shell .choices .chip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: white;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--line);
}
.shell .choices label:hover span { background: var(--tint); }
.shell .choices input:checked + span {
  background: var(--tint);
  color: var(--primary);
  border-color: var(--accent);
  box-shadow: 0 4px 0 var(--accent);
}
.shell .choices input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 3px; }
.shell .choices label:active span { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.shell .choices input:checked + span:active,
.shell .choices label:active input:checked + span { box-shadow: 0 1px 0 var(--accent); }

.shell .flash.warn { background: var(--tint); color: var(--primary); }
.shell .pill { display: inline-block; background: color-mix(in srgb, var(--accent) 12%, white); color: var(--primary); vertical-align: middle; }
.shell .pill.pending { background: var(--wait-bg); color: var(--wait); }
.shell .pill.approved, .shell .pill.submitted, .shell .pill.open { background: var(--ok-bg); color: var(--ok); }
.shell .pill.rejected, .shell .pill.closed { background: var(--line); color: var(--primary); }
.shell .pill.blocked, .shell .pill.test { background: var(--change-bg); color: #8C3A32; }
.shell .pill.test { letter-spacing: .04em; }
.shell a.btn.danger { background: #8C3A32; color: white; box-shadow: 0 4px 0 #5E2823; }
.shell a.btn.danger:hover { color: white; background: #8C3A32; }
.shell .flag {
  display: inline-block;
  background: var(--change-bg);
  color: #8C3A32;
  border-radius: 6px;
  padding: 0 6px;
  font-size: 13px;
  font-weight: 750;
  margin: 2px 4px 0 0;
}

.shell table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.shell th, .shell td { border-bottom: 1px solid var(--line); padding: 10px 8px; text-align: left; vertical-align: top; }
.shell th { font-size: 13px; color: var(--muted); font-weight: 750; }
.shell .bars td { border: 0; padding: 3px 6px; }
.shell .bar { height: 8px; background: var(--accent); border-radius: 99px; min-width: 2px; }
.shell .stat {
  background: none;
  border: 0;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 2.2rem;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--primary);
}
.shell .stat-l { color: var(--muted); font-size: 13.5px; font-weight: 650; }
.shell .grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.shell code, .shell .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .86em;
  background: var(--tint);
  padding: 1px 5px;
  border-radius: 6px;
  word-break: break-all;
}
.shell pre { white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; }
.shell summary { cursor: pointer; font-weight: 750; }
.shell .qa { padding-left: 1.15rem; }
.shell .qa li { margin: 6px 0; }
.shell .qa .blocker { color: #8C3A32; }
.shell .qa .warning { color: var(--wait); }
.shell ul, .shell ol { margin: 8px 0 0; padding-left: 1.2rem; }
.shell li + li { margin-top: 4px; }

.shell .section-nav {
  position: sticky;
  top: var(--head, 76px);
  z-index: 4;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 4px 0 16px;
  padding: 8px 0;
  background: var(--paper);
  border-bottom: 1px solid rgba(27, 42, 74, .08);
}
.shell .action-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  margin: 14px 0;
}
.shell .action-stack form { margin: 0; }
.shell .action-stack button,
.shell .action-stack .btn,
.shell .action-stack a.btn {
  margin-top: 0;
  min-height: 44px;
  font-size: 16px;
  padding: 12px 18px;
}
.shell td.person-actions { min-width: 15rem; }
.shell td.person-actions .action-stack { margin: 0; }
.shell .link-block { margin: 8px 0 18px; }
.shell .link-block + .link-block {
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.shell .preview-banner {
  background: var(--tint);
  color: var(--primary);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 650;
}

.shell .section-nav a {
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 750;
  color: var(--ink-soft);
  background: white;
  border-radius: 999px;
  padding: 4px 10px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.shell section[id] { scroll-margin-top: calc(var(--head, 76px) + 3.2rem); }

.shell .notice p { margin: 0; }
.shell .qr-panel { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.shell .qr-panel img { width: 168px; height: 168px; background: #fff; border-radius: 12px; }
.shell .link-line { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.shell .link-line .mono { word-break: break-all; }

.shell .welcome {
  background: var(--white);
  border-top: 4px solid var(--teal);
  padding: 22px 22px 18px;
}
.shell .welcome .eyebrow { margin-bottom: 4px; }
.shell .welcome h2 { font-size: 1.7rem; margin-bottom: 8px; }
.shell .welcome p:last-child { margin: 8px 0 0; }
.shell .thanks {
  text-align: center;
  padding: 32px 20px 26px;
  background: var(--white);
  border-top: 4px solid var(--teal);
  position: relative;
  overflow: hidden;
}
.shell .thanks h2 { font-size: clamp(2rem, 6vw, 2.6rem); margin: 4px 0 8px; }
.shell .thanks .spark { margin: 0 auto 8px; }
.shell .thanks .confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.shell .thanks .confetti i {
  position: absolute;
  top: -12px;
  width: 8px;
  height: 12px;
  border-radius: 2px;
  animation: confetti-fall 2.4s ease-out forwards;
}
.shell .survey-progress { margin: 4px 0 16px; }
.shell .survey-progress-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 750;
  font-size: 14px;
  color: var(--ink-soft);
}
.shell .survey-progress .meter { max-width: none; height: 12px; margin-top: 8px; background: var(--tint); }
.shell .survey-progress .meter span { background: var(--accent); }
.shell .empty-state { text-align: center; padding: 28px 18px; }
.shell .empty-state .spark { margin: 0 auto 8px; }
.shell .empty-state p { margin: 8px auto 0; max-width: 36rem; }
.shell .q-prompt { font-size: 1.2rem; margin: 0 0 10px; }
.shell.staff h1 { font-size: clamp(1.8rem, 3vw, 2.35rem); }
.shell.staff .card { border-radius: 18px; }
@keyframes confetti-fall {
  to { transform: translateY(220px) rotate(160deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .shell button, .shell .btn, .shell .scale.faces .face, .shell .choices .chip span { transition: none; }
  .shell button:hover, .shell .btn:hover, .shell button:active, .shell .btn:active,
  .shell .scale.faces label:active .face, .shell .choices label:active span { transform: none; }
  .shell .thanks .confetti { display: none; }
}

@media (max-width: 800px) {
  .shell table.people thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .shell table.people,
  .shell table.people tbody,
  .shell table.people tr,
  .shell table.people td { display: block; width: 100%; }
  .shell table.people tr { padding: 8px 0 16px; }
  .shell table.people td { border: 0; padding: 2px 0; }
  .shell td.person-actions { min-width: 0; }
  .shell .action-stack { flex-direction: column; align-items: stretch; }
  .shell .action-stack button,
  .shell .action-stack .btn,
  .shell .action-stack a.btn { width: 100%; text-align: center; }
  .shell main .wrap.home, .shell main .wrap.narrow { width: min(880px, calc(100% - 28px)); }
  .home-grid { grid-template-columns: 1fr; }
  .shell .scale.nums span { min-width: 2.6rem; height: 2.8rem; }
  .shell h1 { font-size: 1.9rem; }
  .shell:not(.staff) main { padding-top: 22px; }
  .shell:not(.staff) .card { border-radius: 22px; }
}
