/* Phone design first. The (min-width: 720px) block at the end turns it into the desktop design. */
.app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: #FFFFFF; transition: background .3s; }
.app[data-view="welcome"] { background: var(--red); }
.app[data-view="thanks"] { background: var(--ink); color: #FFFFFF; }

.wide-only { display: none; }
.kbd { display: none; }

/* Header */
.top { position: sticky; top: 0; z-index: 2; background: #FFFFFF; border-bottom: 1px solid var(--line-soft); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; min-height: 56px; }
.logo { display: block; width: auto; height: 38px; }
[data-view="welcome"] .logo { height: 52px; }
.tag { display: none; font-family: var(--slab); font-size: 15px; font-weight: 700; letter-spacing: 0.12em; line-height: 1.1; text-align: right; text-transform: uppercase; }
[data-view="welcome"] .tag { display: block; }
.progress-text { font-family: var(--slab); font-size: 17px; font-weight: 700; }
.bar { height: 4px; background: #F0F0EE; }
.bar-fill { height: 4px; width: 0; background: var(--red); transition: width .3s; }

/* Welcome */
.welcome { flex: 1; position: relative; overflow: hidden; display: flex; flex-direction: column; }
.welcome::before {
  content: ''; position: absolute; inset: -24px; background: url('/assets/campus.jpg') center 30% / cover;
  filter: blur(3px) saturate(1.1); transform: scale(1.08);
}
.welcome::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(215,25,32,.45) 0%, rgba(215,25,32,.62) 55%, rgba(170,16,22,.85) 100%);
}
.welcome-in { flex: 1; position: relative; z-index: 1; display: flex; flex-direction: column; gap: 24px; padding: 32px 24px 24px; }
.welcome :focus-visible { outline-color: #FFFFFF; }
.eyebrow {
  align-self: flex-start; padding: 6px 10px; border-radius: 4px; background: #FFFFFF; color: var(--red);
  font-size: 12px; font-weight: 800; letter-spacing: 0.16em; line-height: 1.3; text-transform: uppercase;
}
.hero, .lede, .start-note { color: #FFFFFF; text-shadow: 0 2px 14px rgba(90,0,6,.55), 0 1px 2px rgba(0,0,0,.35); }
.hero { margin: 0; font-family: var(--slab); font-size: 64px; font-weight: 700; letter-spacing: 0.01em; line-height: 0.88; text-transform: uppercase; }
.hero > span { display: block; }
.hero-yours { position: relative; width: fit-content; margin-top: 6px; padding: 4px 12px 2px; }
.wipe { position: absolute; inset: 0; background: var(--ink); }
.yours { position: relative; display: block; }
.lede { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.5; text-wrap: pretty; }
.start { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding-bottom: env(safe-area-inset-bottom); }
.go {
  width: 100%; height: 60px; border: none; border-radius: 8px; background: var(--ink); color: #FFFFFF; cursor: pointer;
  font-family: var(--slab); font-size: 20px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
}
.go:active { transform: scale(.97); }
.start-note { text-align: center; font-size: 14px; font-weight: 800; }
.keycap { border: 1.5px solid #FFFFFF; border-radius: 4px; padding: 1px 7px; }

/* Question */
.question { flex: 1; display: flex; flex-direction: column; }
.q-wrap { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 28px 20px 0; }
.q-num { font-family: var(--slab); font-size: 18px; font-weight: 700; color: var(--red); white-space: nowrap; }
.q-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.q-head { display: flex; flex-direction: column; gap: 8px; }
.q-head h2 { margin: 0; font-family: var(--slab); font-size: 30px; font-weight: 700; line-height: 1.08; text-wrap: balance; }
.q-head h2:focus { outline: none; }
.q-head p { margin: 0; font-size: 16px; line-height: 1.45; color: var(--muted); text-wrap: pretty; }
.answers { flex: 1; display: flex; flex-direction: column; gap: 24px; padding-bottom: 24px; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.sub-q { padding: 0; margin-bottom: 10px; font-family: var(--slab); font-size: 22px; font-weight: 700; line-height: 1.1; }
.sub-help { margin: -4px 0 12px; font-size: 15px; color: var(--muted); }

/* Icons: a Phosphor SVG used as a mask, painted in the text colour. form.js sets --icon. */
.ph {
  display: inline-block; flex: none; width: 1em; height: 1em; background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat;
}

/* The wheel for "What are you bringing us?" on phone widths */
.wheel-wrap { margin: -8px -20px 0; }
.wheel {
  position: relative; height: 350px; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
}
.wheel.dragging { cursor: grabbing; }
.k-idea, [data-kind="idea"] { --c: #E39B00; --rgb: 227, 155, 0; --tint: #FDF3DC; }
.k-problem, [data-kind="problem"] { --c: #D71920; --rgb: 215, 25, 32; --tint: #FBEAEA; }
.k-both, [data-kind="both"] { --c: #14876A; --rgb: 20, 135, 106; --tint: #E2F3EE; }
.arc { position: absolute; top: calc(50% - 380px); right: -700px; width: 760px; height: 760px; border: 1.5px solid #DCDCD8; border-radius: 50%; pointer-events: none; }
.ghost {
  position: absolute; left: -36px; top: 50%; transform: translateY(-50%) rotate(-12deg);
  font-size: 230px; color: var(--tint); transition: color .3s; pointer-events: none;
}
.handle {
  position: absolute; top: calc(50% - 7px); right: 44px; width: 32px; height: 14px; border-radius: 7px; background: #B5B5B2;
  transition: background .35s, box-shadow .35s;
}
[data-kind] .handle { background: var(--c); box-shadow: 0 4px 12px -2px rgba(var(--rgb), .5); }
.item {
  position: absolute; top: 50%; right: 98px; display: flex; align-items: center; gap: 12px; transform-origin: right center;
  transition: transform .55s cubic-bezier(.22, 1.2, .36, 1), opacity .4s ease;
}
.wheel.dragging .item { transition: none; }
.item:focus { outline: none; }
.item:focus-visible .pill { outline: 3px solid var(--ink); outline-offset: 2px; }
.pill { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; padding: 8px 14px; border: 1.5px solid transparent; border-radius: 14px; text-align: right; }
.pill-label { color: #8A8A8A; font-size: 18px; font-weight: 800; white-space: nowrap; }
.pill-desc { max-width: 160px; color: #A8A8A8; font-size: 13px; font-weight: 600; line-height: 1.3; }
.round-tile { display: flex; align-items: center; justify-content: center; width: 60px; height: 60px; border-radius: 50%; background: var(--tint); color: var(--c); font-size: 29px; }
.item.on .pill { border-color: var(--c); background: #FFFFFF; }
.item.on .pill-label { color: var(--ink); }
.item.on .pill-desc { color: var(--muted); }
.item.on .round-tile { background: var(--c); color: #FFFFFF; box-shadow: 0 10px 22px -10px rgba(var(--rgb), .7); }

/* Single-choice cards */
.cards { display: flex; flex-direction: column; gap: 10px; }
.card { position: relative; display: block; cursor: pointer; }
.face {
  display: flex; align-items: center; gap: 14px; min-height: 68px; padding: 12px 16px; border: 2px solid var(--line);
  border-radius: 10px; background: #FFFFFF; color: var(--ink); transition: all .12s;
}
.key {
  display: none; flex-shrink: 0; width: 26px; height: 26px; align-items: center; justify-content: center;
  border: 2px solid #CFCFCC; border-radius: 6px; color: var(--muted); font-size: 13px; font-weight: 800;
}
.tile {
  flex-shrink: 0; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border: 2px solid #CFCFCC; border-radius: 12px; background: #FFFFFF; color: var(--muted); font-size: 24px;
}
.card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.card-label { font-size: 17px; font-weight: 800; }
.card-desc { font-size: 14px; color: var(--muted); }
.tick { font-size: 18px; font-weight: 800; color: #FF3B3B; }
input:checked + .face { border-color: var(--ink); background: var(--ink); color: #FFFFFF; }
input:checked + .face .key { border-color: #FFFFFF; color: #FFFFFF; }
input:checked + .face .tile { border-color: var(--red); background: var(--red); color: #FFFFFF; }
input:checked + .face .card-desc { color: #CFCFCF; }
input:checked + .face .tick::after { content: '✓'; }
/* The first question on wide screens wears the wheel's colours. Phones get the wheel itself. */
.kind-card .tile { border: none; border-radius: 50%; background: var(--tint); color: var(--c); }
.kind-card input:checked + .face { border-color: var(--c); background: #FFFFFF; color: var(--ink); }
.kind-card input:checked + .face .key { border-color: var(--c); color: var(--ink); }
.kind-card input:checked + .face .card-desc { color: var(--muted); }
.kind-card input:checked + .face .tile { background: var(--c); color: #FFFFFF; box-shadow: 0 10px 22px -10px rgba(var(--rgb), .7); }
.kind-card input:checked + .face .tick { color: var(--c); }
input:focus-visible + .face, input:focus-visible + .chip-face, input:focus-visible + .scale-face { outline: 3px solid var(--red); outline-offset: 2px; }

/* Multi-select chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: flex; min-height: 44px; cursor: pointer; }
.chip-face {
  flex: 1;
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 16px; border: 2px solid var(--line); border-radius: 999px;
  background: #FFFFFF; color: var(--ink); font-size: 15px; font-weight: 800; transition: background .15s, color .15s, border-color .15s;
}
.chip-face .ph { color: var(--red); font-size: 19px; }
input:checked + .chip-face { border-color: var(--red); background: var(--red); color: #FFFFFF; }
input:checked + .chip-face .ph { color: #FFFFFF; }
.answers.bad .chip-face { border-color: var(--red); }

/* 1 to 5 scale */
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.scale-item { position: relative; cursor: pointer; }
.scale-face {
  display: flex; align-items: center; justify-content: center; height: 56px; border: 2px solid var(--line); border-radius: 10px;
  background: #FFFFFF; font-family: var(--slab); font-size: 22px; font-weight: 700; transition: all .12s;
}
input:checked + .scale-face { border-color: var(--red); background: var(--red); color: #FFFFFF; }
.answers.bad .scale-face { border-color: var(--red); }
.scale-ends { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: 14px; font-weight: 700; color: var(--muted); }

/* Text fields */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.field label small { font-size: inherit; font-weight: 700; color: var(--faint); }
.fields { display: flex; flex-direction: column; gap: 20px; }
.box {
  width: 100%; height: 52px; padding: 0 14px; border: 2px solid var(--line); border-radius: 10px; outline: none;
  background: #FFFFFF; color: var(--ink); font-size: 17px; font-weight: 700;
}
.box:focus { border-color: var(--ink); }
.box[aria-invalid="true"] { border-color: var(--red); }
.line-input {
  width: 100%; padding: 12px 0; border: none; border-bottom: 3px solid var(--line); border-radius: 0; outline: none;
  background: transparent; color: var(--ink); font-family: var(--slab); font-size: 24px; font-weight: 600;
}
.line-input:focus { border-bottom-color: var(--red); }
.line-input[aria-invalid="true"] { border-bottom-color: var(--red); }
.long {
  width: 100%; padding: 14px 16px; border: 2px solid var(--line); border-radius: 10px; outline: none; resize: none;
  background: #FAFAF8; color: var(--ink); font-size: 17px; line-height: 1.5;
}
.long:focus { border-color: var(--ink); }
.long[aria-invalid="true"] { border-color: var(--red); }
.count { font-size: 13px; font-weight: 700; color: var(--faint); text-align: right; }

/* Review */
.review { display: flex; flex-direction: column; border-top: 3px solid var(--ink); }
.row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.row-key { font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.row-val { grid-column: 1 / -1; grid-row: 2; font-size: 16px; font-weight: 700; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.edit { padding: 0; border: none; background: none; color: var(--red); cursor: pointer; font-size: 13px; font-weight: 800; }
.edit::after { content: ''; position: absolute; inset: 0; } /* The whole row is the tap target on a phone. */

.review-note { margin: 12px 0 0; font-size: 14px; font-weight: 600; color: var(--muted); }

/* Actions: a sticky bar on a phone */
.actions {
  position: sticky; bottom: 0; z-index: 1; display: flex; flex-direction: column; gap: 8px; margin: 0 -20px;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-soft); background: #FFFFFF;
}
.msg { margin: 0; font-size: 14px; font-weight: 800; color: var(--red); }
.msg:empty { display: none; }
.btns { display: flex; gap: 10px; }
.back {
  flex-shrink: 0; width: 56px; height: 56px; border: 2px solid var(--ink); border-radius: 8px; background: #FFFFFF; color: var(--ink);
  cursor: pointer; font-size: 20px; font-weight: 800; transition: transform .1s;
}
.back:active { transform: scale(.94); }
.next {
  flex: 1; height: 56px; border: none; border-radius: 8px; background: var(--red); color: #FFFFFF; cursor: pointer;
  font-family: var(--slab); font-size: 18px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; transition: transform .1s;
}
.next:active { transform: scale(.97); }
.next:disabled { opacity: .6; cursor: progress; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Thank you */
.thanks { flex: 1; display: flex; flex-direction: column; gap: 22px; padding: 36px 24px 24px; }
.thanks :focus-visible { outline-color: #FFFFFF; }
.received { font-size: 13px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: #FF3B3B; }
.thanks-title { margin: 0; color: #FFFFFF; font-family: var(--slab); font-size: 56px; font-weight: 700; line-height: 0.9; text-transform: uppercase; }
.thanks-title:focus { outline: none; }
.thanks-title span { display: block; }
.thanks-copy { margin: 0; color: #D9D9D9; font-size: 17px; font-weight: 600; line-height: 1.55; text-wrap: pretty; }
.thanks-foot { flex: 1; display: flex; flex-direction: column; gap: 22px; }
.ref { display: flex; width: fit-content; border: 2px solid #FFFFFF; border-radius: 8px; }
.ref-tag { display: flex; align-items: center; padding: 12px 14px; background: #FFFFFF; color: var(--ink); font-size: 12px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.ref-code { padding: 12px 16px; color: #FFFFFF; font-family: var(--slab); font-size: 22px; font-weight: 700; letter-spacing: 0.08em; }
.again { margin-top: auto; width: 100%; height: 56px; border: none; border-radius: 8px; background: var(--red); color: #FFFFFF; cursor: pointer; font-size: 16px; font-weight: 800; }
.noscript { padding: 20px; background: #FFFFFF; color: var(--ink); font-weight: 700; }

/* Keyboard hints only on a wide screen with a real pointer. */
@media (min-width: 720px) and (hover: hover) {
  .kbd { display: inline; }
  .touch { display: none; }
  .key { display: flex; }
}

@media (min-width: 720px) {
  .wide-only { display: revert; }
  .segs.wide-only { display: flex; }
  .narrow-only { display: none; }

  .top { position: static; }
  .top-row { flex-wrap: wrap; gap: 16px; padding: 14px clamp(20px, 4vw, 48px); }
  .logo { height: 48px; }
  [data-view="welcome"] .logo { height: 72px; }
  [data-view="welcome"] .tag { display: none; }
  .progress { display: flex; align-items: center; gap: 14px; }
  .progress-text { font-family: inherit; font-size: 13px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
  .segs { gap: 4px; }
  .segs span { width: 22px; height: 6px; border-radius: 3px; background: var(--line-soft); }
  .segs .done { background: var(--ink); }
  .segs .now { background: var(--red); }

  .welcome::before { filter: blur(4px) saturate(1.1); }
  .welcome { justify-content: center; }
  .welcome-in { flex: none; width: 100%; max-width: calc(1040px + 2 * clamp(20px, 6vw, 96px)); margin: 0 auto; gap: 32px; padding: 24px clamp(20px, 6vw, 96px) 48px; }
  .eyebrow { padding: 7px 12px; font-size: 14px; letter-spacing: 0.18em; }
  .hero { font-size: clamp(52px, 10vw, 132px); letter-spacing: 0.02em; }
  .hero-yours { display: inline-block; margin-top: 8px; padding: 6px 18px 2px; }
  .yours { display: inline-block; }
  .lede { max-width: 520px; font-size: clamp(17px, 2vw, 20px); }
  .start { margin-top: 0; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 18px; padding-bottom: 0; }
  .go { width: auto; height: auto; padding: 20px 36px; border-radius: 6px; font-size: 21px; }
  .go:hover { background: #FFFFFF; color: var(--ink); }
  .start-note { text-align: left; }

  .question { justify-content: center; }
  .q-wrap { flex: none; flex-direction: row; gap: clamp(12px, 3vw, 28px); width: 100%; max-width: calc(760px + 2 * clamp(20px, 6vw, 96px)); margin: 0 auto; padding: 24px clamp(20px, 6vw, 96px) 48px; }
  .q-num { font-size: clamp(22px, 3vw, 30px); padding-top: 6px; }
  .q-body { gap: 28px; }
  .q-head { gap: 10px; }
  .q-head h2 { font-size: clamp(28px, 4.5vw, 46px); line-height: 1.05; }
  .q-head p { font-size: 17px; line-height: 1.5; }
  .answers { flex: none; padding-bottom: 0; }

  .cards { max-width: 520px; }
  .face { gap: 16px; min-height: 0; padding: 14px 18px; border-radius: 8px; }
  .key { border-radius: 5px; }
  .card-label { font-size: 18px; }
  .chips { gap: 10px; }
  .chip-face { padding: 12px 18px; }
  .scale { max-width: 520px; }
  .scale-ends { max-width: 520px; }

  .fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px; }
  .field label { font-size: 13px; }
  .box { height: auto; padding: 12px 0; border: none; border-bottom: 3px solid var(--line); border-radius: 0; background: transparent; font-size: 20px; }
  .box:focus { border-bottom-color: var(--red); }
  .box[aria-invalid="true"] { border-color: var(--red); }
  .line-input { font-size: clamp(24px, 3.5vw, 34px); }
  .long { padding: 12px 0; border: none; border-bottom: 3px solid var(--line); border-radius: 0; background: transparent; font-size: 20px; line-height: 1.55; resize: vertical; }
  .long:focus { border-bottom-color: var(--red); }
  .long[aria-invalid="true"] { border-bottom-color: var(--red); }
  .count { text-align: left; }

  .row { grid-template-columns: minmax(100px, 150px) minmax(0, 1fr) auto; gap: 16px; align-items: start; }
  .row-key { padding-top: 3px; }
  .row-val { grid-column: 2; grid-row: 1; font-size: 17px; }
  .edit { min-height: 44px; min-width: 44px; margin: -12px 0; font-size: 14px; }
  .edit::after { content: none; }

  .actions { position: static; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 16px; margin: 0; padding: 0; border: none; background: none; min-height: 24px; }
  .msg { order: 2; }
  .btns { align-items: center; gap: 16px; }
  .next { flex: none; height: auto; padding: 15px 28px; border-radius: 6px; }
  .next:hover { background: var(--ink); }
  .hint { font-size: 14px; font-weight: 700; color: var(--faint); }

  .nav { display: flex; justify-content: flex-end; gap: 6px; padding: 0 clamp(20px, 4vw, 48px) 24px; }
  .nav button { width: 44px; height: 44px; border: none; border-radius: 6px; background: var(--ink); color: #FFFFFF; cursor: pointer; font-size: 18px; font-weight: 800; }
  .nav button:hover { background: var(--red); }
  .nav button:focus-visible { outline-color: var(--red); }

  .thanks { justify-content: center; width: 100%; max-width: calc(1040px + 2 * clamp(20px, 6vw, 96px)); margin: 0 auto; gap: 28px; padding: 24px clamp(20px, 6vw, 96px) 48px; }
  .received { font-size: 14px; letter-spacing: 0.18em; }
  .thanks-title { font-size: clamp(52px, 10vw, 120px); letter-spacing: 0.02em; }
  .thanks-copy { max-width: 520px; font-size: 18px; }
  .thanks-foot { flex: none; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 20px; }
  .ref { border-radius: 6px; }
  .ref-tag { padding: 12px 16px; }
  .ref-code { padding: 12px 18px; }
  .again { width: auto; height: auto; margin-top: 0; padding: 14px 22px; border-radius: 6px; font-size: 15px; }
  .again:hover { background: #FFFFFF; color: var(--ink); }
}
