:root {
  color-scheme: light;
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: #121c33;
  background: #f5f8ff;
  font-size: 16px;
  line-height: 1.5;
  --ink: #121c33;
  --muted: #4a5670;
  --line: #d5dceb;
  --accent: #33405c;
  --dark: #121c33;
  --sunrise: #ffb511;
  --sky: #8bd9fb;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .6; }
a { color: var(--accent); text-underline-offset: .2em; }
:focus-visible { outline: 3px solid #4a5670; outline-offset: 4px; }
h1, h2, p { margin-top: 0; }
h1, h2 { line-height: 1.12; letter-spacing: -.035em; overflow-wrap: anywhere; }
h1 { font-size: clamp(2rem, 7vw, 3.3rem); margin-bottom: 1rem; }
h2 { font-size: 1.35rem; margin-bottom: .8rem; }
img { display: block; max-width: 100%; }
.loading { padding: 2rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.brand-bar { background: var(--dark); color: #f5f8ff; }
.brand-inner { width: min(100%, 1150px); margin: auto; padding: .8rem clamp(1.25rem, 4vw, 3rem);
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 62px; }
.camino-logo { width: clamp(100px, 12vw, 132px); height: auto; }
.admin-nav { display: flex; align-items: center; gap: 1.25rem; }
.admin-nav a { color: inherit; }
.brand-bar :focus-visible { outline-color: var(--sunrise); }

.phone-wrap { width: min(100%, 560px); margin: 0 auto; padding: clamp(1.6rem, 7vh, 4rem) 1.25rem 2rem; }
body:has(.ballot) { overflow-x: clip; }
.panel { border: 1px solid var(--line); background: #fff; border-radius: 20px; }
.intro { padding: clamp(1.4rem, 5vw, 2.6rem); }
.intro p { color: var(--muted); font-size: 1.09rem; }
.intro .feedback { font-size: .95rem; }

.button, .choice {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: .65rem 1rem;
  font-weight: 720; line-height: 1.25; border: 1px solid transparent; border-radius: 10px; text-align: center;
  text-decoration: none; color: var(--ink); background: #fff;
}
.primary { background: var(--sunrise); color: var(--ink); }
.primary:hover:not(:disabled) { background: #ffc132; }
.secondary { border-color: var(--line); }
.secondary:hover:not(:disabled) { background: #f5f8ff; }
.text-btn { color: inherit; border: 0; background: none; padding: 0; text-decoration: underline; text-underline-offset: .2em; }
.feedback { color: #8a3524; min-height: 1.4em; margin: .75rem 0 0; font-size: .95rem; }
.feedback:empty { display: none; }

.card-progress { text-align: center; margin: .7rem 0 0; font-size: .92rem; color: var(--muted); }
.vote-card {
  touch-action: pan-y; user-select: none; display: flex; align-items: center; min-height: clamp(14rem, 35vh, 24rem);
  background: #fff; border: 1px solid var(--line); border-top: 5px solid var(--sunrise);
  border-radius: 20px; padding: clamp(1.45rem, 5vw, 2.65rem); box-shadow: 0 10px 30px #121c330d; transition: transform .18s ease-out;
}
.vote-card.dragging { transition: none; }
.vote-card h1 { font-weight: 650; font-size: clamp(1.45rem, 4.8vw, 2.2rem); line-height: 1.32; margin: 0; }
.vote-card:focus { outline: none; }
.choices { margin-top: 1.15rem; display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.choice { min-height: 56px; font-size: 1.08rem; }
.positive { background: var(--sunrise); color: var(--ink); }
.negative { background: #fff; color: var(--ink); border-color: #a6b1c9; }
.positive:hover:not(:disabled) { background: #ffc132; }
.negative:hover:not(:disabled) { background: #e7edf9; }
.gesture-hint { text-align: center; color: var(--muted); font-size: .92rem; margin: .85rem 0 0; }

label { display: block; font-weight: 700; margin-block: .8rem .3rem; }
input, textarea, select {
  color: var(--ink); background: #fff; border: 1px solid #a6b1c9;
  border-radius: 8px; min-height: 44px; padding: .6rem .75rem; width: 100%;
}
textarea { resize: vertical; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 2rem; }
form .button { margin-top: 1rem; }

.admin-wrap { width: min(100%, 1150px); margin: auto; padding: 1.5rem clamp(1rem, 4vw, 3rem) 4rem; }
.admin-title { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.admin-title h1 { font-size: clamp(2rem, 4vw, 3.25rem); margin: 0; }
.admin-section { padding: clamp(1.2rem, 3vw, 2rem); }
.admin-section > p { color: var(--muted); }
.admin-section > .feedback { color: #8a3524; }
.dashboard-grid { display: grid; grid-template-columns: 1.4fr 1fr; align-items: start; gap: 1rem; }
.stage-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .2rem; color: var(--muted); }
.stage-list li { padding: .32rem .75rem; border-left: 3px solid var(--line); }
.stage-list .current { border-color: var(--sunrise); color: var(--ink); font-weight: 740; background: #fff4d4; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: 1.4rem 0; }
.metrics div { background: #f5f8ff; padding: .6rem .85rem; border-radius: 9px; }
.metrics strong { display: block; font-size: 1.65rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.metrics span { font-size: .9rem; color: var(--muted); }
.join-panel { display: flex; flex-direction: column; align-items: center; text-align: center; }
.join-panel img { width: 200px; height: 200px; }
.join-panel > a { overflow-wrap: anywhere; }
.navigate { display: flex; gap: .6rem; flex-wrap: wrap; }
.join-panel .navigate { margin-top: 1rem; justify-content: center; }
.edit-panel { margin-top: 1rem; }
details { padding: .8rem .9rem; border: 1px solid var(--line); border-radius: 8px; margin-top: .55rem; }
summary { cursor: pointer; font-weight: 700; }
.recent { margin: 0; padding-left: 1.2rem; }
.admin-section > .primary + h2 { margin-top: 2rem; }
.recent span { color: var(--muted); font-size: .88rem; margin-left: .5rem; }

.projector { min-height: 100vh; color: #f5f8ff; background: var(--dark); }
.projector a { color: var(--sunrise); }
.projector :focus-visible { outline-color: var(--sunrise); }
.screen-wrap { width: min(100%, 1800px); margin: 0 auto; padding: clamp(1rem, 3vh, 2.5rem) clamp(1.1rem, 4vw, 4rem) 2rem; }
.screen-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: clamp(1rem, 3vh, 2.4rem); }
.screen-bar .text-btn { color: #d5dceb; font-size: .9rem; }
.screen-error { color: var(--sunrise); margin: 1rem 0 0; }
.screen-error:empty { display: none; }
.screen-heading { margin-bottom: clamp(.8rem, 2vh, 1.65rem); }
.screen-heading h1 { font-size: clamp(1.9rem, 4.5vw, 4.4rem); margin: 0 0 .45rem; }
.screen-heading p { font-size: clamp(1rem, 1.65vw, 1.55rem); color: #d5dceb; margin: 0; }
.waiting-screen {
  display: grid; grid-template-columns: 1.25fr max-content; align-items: center;
  gap: clamp(1.5rem, 5vw, 5rem); min-height: min(76vh, 800px);
}
.waiting-screen h1 { font-size: clamp(2.6rem, 7vw, 7rem); line-height: 1.02; margin-bottom: 1.3rem; }
.waiting-screen p { font-size: clamp(1.15rem, 2vw, 2rem); margin-bottom: .55rem; color: #d5dceb; }
.waiting-screen a { font-size: clamp(.95rem, 1.5vw, 1.5rem); overflow-wrap: anywhere; }
.room-progress { margin-top: 1.9rem; font-size: clamp(1rem, 1.7vw, 1.5rem); font-variant-numeric: tabular-nums; color: #d5dceb; }
.room-progress span { margin-inline: .4rem; }
.qr-card { padding: .6rem; background: #fff; border-radius: 20px; }
.qr-card img { width: min(34vw, 440px); height: auto; }

.axis { display: flex; justify-content: space-between; gap: .5rem; font-size: clamp(.8rem, 1.3vw, 1.1rem); color: #d5dceb; }
.track { position: relative; height: 2px; background: #747f99; margin-inline: .35rem; }
.track::after {
  content: ''; position: absolute; top: -.23rem; height: .58rem; width: 1px; background: #97a3bd; left: 50%;
}
.dot {
  position: absolute; z-index: 1; top: 50%; transform: translate(-50%, -50%); width: clamp(.8rem, 1.4vw, 1.33rem);
  aspect-ratio: 1; border-radius: 50%; background: var(--sunrise); box-shadow: 0 0 0 2px var(--dark);
}
.dot.receiving { border-radius: 3px; background: var(--sky); }
.legend { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem 1.25rem; margin-top: .55rem;
  font-weight: 700; font-size: clamp(.9rem, 1.28vw, 1.2rem); }
.legend span:not(.shift-key)::before { content: ''; display: inline-block; width: .65em; height: .65em; background: currentColor; margin-right: .45em; }
.legend .doing-text::before { border-radius: 50%; }
.legend .receiving-text::before { border-radius: 2px; }
.legend .shift-key { color: #d5dceb; font-weight: 500; }
.doing-text { color: var(--sunrise); }
.receiving-text { color: var(--sky); }
.shift { background: #394660; border-radius: 6px; color: #fff; font-weight: 750; font-variant-numeric: tabular-nums;
  padding: .11rem .38rem; white-space: nowrap; }

.timeline-scroll { overflow-x: auto; }
.timeline { isolation: isolate; position: relative; min-width: 720px; display: grid;
  grid-template-rows: 1fr clamp(7rem, 29vh, 15rem) 1fr; padding: 0 .4rem; }
.timeline-ink { position: absolute; z-index: 1; inset: 0; display: block; width: 100%; height: 100%; pointer-events: none; }
.timeline-cards { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: clamp(.55rem, 1.35vw, 1.4rem); }
.above { align-items: end; }
.below { align-items: start; width: 82%; margin-inline: auto; }
.topic-card { position: relative; z-index: 2; display: flex; flex-direction: column; justify-content: space-between;
  min-height: clamp(5.6rem, 13vh, 8rem); padding: clamp(.65rem, 1vw, 1.05rem);
  background: #212c47; border: 1px solid #4a5670; border-radius: 12px; }
.topic-card h2 { font-size: clamp(.94rem, 1.44vw, 1.55rem); letter-spacing: -.025em; margin-bottom: .45rem; }
.topic-card p { color: var(--sunrise); margin: 0; font-weight: 650; }
.topic-results { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .52rem;
  font-size: clamp(.77rem, 1.08vw, 1.05rem); font-weight: 680; white-space: nowrap; }
.topic-results .shift { margin-left: auto; }
.timeline-scale { position: relative; margin-inline: 2.2%; align-self: center; }
.timeline-line { height: 2px; background: #97a3bd; }
.timeline-scale .axis { position: absolute; z-index: 2; top: .7rem; width: 100%; font-weight: 650; pointer-events: none;
  text-shadow: 0 0 4px var(--dark), 0 0 6px var(--dark); }
.discussion-heading { display: flex; align-items: baseline; gap: .65rem 1rem; flex-wrap: wrap; }
.discussion-heading .shift { font-size: clamp(1rem, 1.8vw, 1.5rem); }

.perspectives { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(.8rem, 2vw, 1.7rem); }
.perspective { display: flex; flex-direction: column; border: 1px solid #4a5670; border-radius: 15px; padding: clamp(1rem, 2vw, 2rem); background: #212c47; }
.perspective h2 { font-size: clamp(1.15rem, 2.15vw, 2rem); margin-bottom: .65rem; }
.perspective p { font-size: clamp(1rem, 1.65vw, 1.6rem); line-height: 1.43; margin-bottom: 1rem; }
.detail-track { margin-top: auto; }
.detail-track .track { margin-block: .75rem; }
.detail-track strong { font-size: clamp(.93rem, 1.45vw, 1.3rem); }
.room-prompt { margin-top: clamp(1rem, 2.5vh, 2rem); }
.room-prompt p { font-size: clamp(1rem, 1.6vw, 1.5rem); color: #f5f8ff; margin-bottom: .5rem; }
.room-prompt h2 { font-size: clamp(1.35rem, 2.6vw, 2.65rem); line-height: 1.2; color: var(--sunrise); margin: 0; }

@media (max-width: 740px) {
  .dashboard-grid, .perspectives { grid-template-columns: 1fr; }
  .admin-title { flex-wrap: wrap; }
  .waiting-screen { min-height: auto; grid-template-columns: 1fr; }
  .qr-card { width: fit-content; }
  .qr-card img { width: min(60vw, 360px); }
}
@media (max-height: 780px) and (min-width: 800px) {
  .screen-heading h1 { font-size: min(4vw, 6vh); }
  .screen-heading p, .room-prompt p, .perspective p { font-size: clamp(1rem, 2.3vh, 1.4rem); }
}

@media (prefers-reduced-motion: reduce) {
  .vote-card { transition: none; }
}
