/* ==========================================================================
   Money Management COE — Team Pulse
   Palette: deep emerald ground, ivory type, brass for the executive accents.
   Emerald carries anything the team owns; brass marks the headline number;
   amber is reserved for the gap question so "we're short here" reads
   instantly without turning it into an alarm.
   ========================================================================== */

:root {
  --forest:     #04241A;
  --forest-2:   #083527;
  --forest-3:   #0E4A34;
  --forest-4:   #14603F;

  --emerald:    #00A758;
  --mint:       #7FE3AE;

  --ivory:      #F7F3E9;
  --white:      #FFFFFF;
  --ivory-dim:  #9BB8A8;

  --brass:      #D9A93C;
  --amber:      #E8963C;

  /* Straight from the jacket artwork: blue / green / orange */
  --p-connect:  #4FA3DC;
  --p-deliver:  #6FBE44;
  --p-grow:     #E8853C;

  --line:       rgba(247, 243, 233, 0.15);
  --line-soft:  rgba(247, 243, 233, 0.07);

  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --body:    "Inter Tight", system-ui, -apple-system, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, "SF Mono", monospace;

  --pad: clamp(1.25rem, 3.5vw, 3.25rem);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(120% 90% at 50% 0%, #0A3A28 0%, var(--forest) 62%);
  background-attachment: fixed;
  color: var(--ivory);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100dvh; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  font-variation-settings: "SOFT" 16, "WONK" 0;
  line-height: 1.06;
  letter-spacing: -0.018em;
  margin: 0;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mint);
  margin: 0;
}

.eyebrow.brass { color: var(--brass); }

.muted { color: var(--ivory-dim); }

a { color: var(--ivory); }

button, input, textarea { font-family: inherit; font-size: 1rem; color: inherit; }

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
  border-radius: 4px;
}

/* The team phrase, used on the cover, the join slide and the closing card. */
.phrase {
  font-family: var(--display);
  font-weight: 600;
  display: flex;
  gap: 0.55em;
  flex-wrap: wrap;
  letter-spacing: -0.01em;
}

.phrase span:nth-child(1) { color: var(--p-connect); }
.phrase span:nth-child(2) { color: var(--p-deliver); }
.phrase span:nth-child(3) { color: var(--p-grow); }

.wordmark {
  font-family: var(--body);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--ivory);
}

/* ------------------------------------------------------------- join screen */

.join-wrap { min-height: 100dvh; display: grid; place-items: center; padding: var(--pad); }

.join-card { width: min(30rem, 100%); text-align: center; }

.join-card h1 { font-size: clamp(2.2rem, 7vw, 3.2rem); margin: 1.6rem 0 2rem; }

.join-card p.lede { color: var(--ivory-dim); line-height: 1.6; margin: 0 0 2.2rem; }

.join-card .phrase { justify-content: center; font-size: clamp(1.05rem, 4vw, 1.3rem); margin-top: 0.7rem; }

.code-input {
  width: 100%;
  background: rgba(8, 53, 39, 0.85);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.15rem 1rem;
  font-family: var(--mono);
  font-size: 1.85rem;
  letter-spacing: 0.4em;
  text-align: center;
  text-transform: uppercase;
  color: var(--white);
}

.code-input::placeholder { color: rgba(155, 184, 168, 0.35); }

.btn {
  display: block;
  width: 100%;
  margin-top: 1rem;
  padding: 1.05rem 1rem;
  background: var(--emerald);
  color: #03251A;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1.02rem;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }

.btn-quiet { background: transparent; color: var(--ivory); border: 1px solid var(--line); }

.notice {
  margin-top: 1.2rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: rgba(232, 150, 60, 0.12);
  border: 1px solid rgba(232, 150, 60, 0.32);
  font-size: 0.9rem;
  line-height: 1.5;
}

.privacy-note {
  margin-top: 2.5rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line-soft);
  font-size: 0.78rem;
  line-height: 1.65;
  color: var(--ivory-dim);
}

/* ------------------------------------------------------------ voter screen */

.voter {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: var(--pad);
  max-width: 34rem;
  margin: 0 auto;
  width: 100%;
}

.voter-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 1.5rem;
}

.voter-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }

.q-title { font-size: clamp(1.45rem, 5vw, 1.95rem); margin-bottom: 0.75rem; }

.q-helper { color: var(--ivory-dim); font-size: 0.88rem; line-height: 1.55; margin: 0 0 1.6rem; }

.options { display: grid; gap: 0.65rem; }

.option {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  width: 100%;
  text-align: left;
  padding: 1rem 1.1rem;
  background: rgba(8, 53, 39, 0.75);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.option:hover { border-color: rgba(247, 243, 233, 0.34); }
.option:active { transform: scale(0.995); }

.option[aria-pressed="true"] {
  border-color: var(--emerald);
  background: rgba(0, 167, 88, 0.16);
}

.option-label { font-weight: 600; display: block; line-height: 1.3; }
.option-sub { font-size: 0.8rem; color: var(--ivory-dim); }

/* Charter picker — the number matches the poster, so people recognise it. */

.option.compact { padding: 0.75rem 0.9rem; gap: 0.8rem; }

.option.rankable .badge { font-weight: 600; }
.option.rankable[aria-pressed="false"] .badge { color: var(--ivory-dim); }
.option.maxed { opacity: 0.45; }

.pick-counter {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--mint);
  margin: 0 0 1rem;
}

.badge {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 0.75rem;
  background: var(--forest-3);
  border: 1px solid var(--line);
  color: var(--mint);
}

.option[aria-pressed="true"] .badge {
  background: var(--emerald);
  border-color: var(--emerald);
  color: #03251A;
  font-weight: 600;
}

/* Battery glyph — the energy question's own vernacular */

.battery {
  flex: 0 0 auto;
  width: 44px;
  height: 23px;
  border: 2px solid var(--ivory-dim);
  border-radius: 5px;
  position: relative;
  display: flex;
  align-items: center;
  padding: 2px;
}

.battery::after {
  content: "";
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 9px;
  background: var(--ivory-dim);
  border-radius: 0 2px 2px 0;
}

.battery i { display: block; height: 100%; border-radius: 2px; }
.battery.empty   i { width: 16%; background: var(--amber); }
.battery.steady  i { width: 55%; background: var(--mint); }
.battery.charged i { width: 100%; background: var(--emerald); }

/* Scale buttons */

.scale-values { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.5rem; }

.scale-btn {
  aspect-ratio: 1;
  background: rgba(8, 53, 39, 0.75);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-family: var(--mono);
  font-size: 1.05rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.scale-btn:hover { border-color: rgba(247, 243, 233, 0.34); }
.scale-btn:active { transform: scale(0.95); }

.scale-btn[aria-pressed="true"] {
  border-color: var(--emerald);
  background: var(--emerald);
  color: #03251A;
  font-weight: 700;
}

.scale-ends {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.85rem;
  font-size: 0.78rem;
  color: var(--ivory-dim);
}

.stage .scale-ends { font-size: clamp(0.9rem, 1.4vw, 1.1rem); margin-top: 0.8rem; }

.scale-ends span:last-child { text-align: right; }

/* Open text */

.open-input {
  width: 100%;
  min-height: 7.5rem;
  background: rgba(8, 53, 39, 0.75);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  line-height: 1.55;
  resize: vertical;
  color: var(--ivory);
}

.open-input.small { min-height: 4.5rem; margin-top: 0.9rem; }

.char-count {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ivory-dim);
  text-align: right;
  margin-top: 0.4rem;
}

.comment-label { font-size: 0.82rem; color: var(--ivory-dim); margin: 1.2rem 0 0; }

.standby, .thanks { text-align: center; padding: 2.5rem 0; }

.standby h2, .thanks h2 { font-size: 1.6rem; margin-bottom: 0.6rem; }
.standby p, .thanks p { color: var(--ivory-dim); line-height: 1.6; margin: 0; }

.tick {
  width: 56px;
  height: 56px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: rgba(0, 167, 88, 0.16);
  border: 1px solid rgba(0, 167, 88, 0.5);
  display: grid;
  place-items: center;
  color: var(--mint);
  font-size: 1.5rem;
}

/* --------------------------------------------------------- presenter stage */

.stage { min-height: 100dvh; display: flex; flex-direction: column; padding: var(--pad); }

.stage-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  padding-bottom: 0.9rem;
}

.brandbar { display: flex; align-items: center; gap: 0.9rem; }

.brandbar .rule { width: 34px; height: 2px; background: var(--brass); border-radius: 2px; }

.phrase-bar {
  padding-bottom: 0.9rem;
  margin-bottom: 1.6rem;
  border-bottom: 1px solid var(--line-soft);
}

.phrase-bar .phrase {
  font-size: clamp(1rem, 1.7vw, 1.35rem);
  letter-spacing: 0.01em;
}

.stage-body { flex: 1; display: flex; flex-direction: column; justify-content: center; min-height: 0; }

.stage-title { font-size: clamp(1.9rem, 3.9vw, 3.2rem); max-width: 26ch; margin-bottom: 2rem; }

.stage-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line-soft);
  flex-wrap: wrap;
}

.joinbox { display: flex; align-items: baseline; gap: 0.85rem; }

.joinbox .code {
  font-family: var(--mono);
  font-size: 1.5rem;
  letter-spacing: 0.18em;
  color: var(--white);
}

.headcount { display: flex; align-items: center; gap: 0.55rem; font-family: var(--mono); font-size: 0.95rem; }

/* Offline is stated, not implied: a stopped pulse and a broken connection
   look identical otherwise. */
.dot.offline {
  background: var(--amber);
  animation: none;
  box-shadow: none;
}

#head-label { transition: color 0.2s ease; }

.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 0 rgba(0, 167, 88, 0.5);
  animation: ping 2.4s ease-out infinite;
}

@keyframes ping {
  0%   { box-shadow: 0 0 0 0 rgba(0, 167, 88, 0.5); }
  70%  { box-shadow: 0 0 0 9px rgba(0, 167, 88, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 167, 88, 0); }
}

.controls { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

.ctrl {
  padding: 0.58rem 0.9rem;
  background: rgba(8, 53, 39, 0.8);
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  font-size: 0.84rem;
  color: var(--ivory);
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.ctrl:hover { border-color: rgba(247, 243, 233, 0.38); }
.ctrl.on { background: var(--emerald); color: #03251A; border-color: var(--emerald); font-weight: 600; }
.ctrl.brass { background: var(--brass); color: #2A1E04; border-color: var(--brass); font-weight: 600; }
.ctrl[disabled] { opacity: 0.32; cursor: not-allowed; }

.pos { font-family: var(--mono); font-size: 0.84rem; color: var(--ivory-dim); }

/* ---------------------------------------------------------- static slides */

.cover { display: flex; flex-direction: column; justify-content: center; gap: 1.5rem; height: 100%; }

.cover .kicker { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--brass); }

.cover h1 { font-size: clamp(2.4rem, 6.5vw, 5rem); max-width: 16ch; }

.cover .phrase { font-size: clamp(1.4rem, 3.2vw, 2.2rem); margin-top: 0.5rem; }

.cover .period { font-family: var(--mono); color: var(--ivory-dim); font-size: 0.95rem; }

.joinslide { display: grid; grid-template-columns: 1fr auto 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }

/* Code-only variant: one instruction, one address, one very large code. */
.joinslide.solo { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 0; }
.joinslide.solo .join-lede { font-size: clamp(1.05rem, 2vw, 1.5rem); color: var(--ivory-dim); margin: 0 0 1.6rem; }
.joinslide.solo .bigurl { font-size: clamp(1.3rem, 3vw, 2.4rem); color: var(--mint); margin: 0 0 1.4rem; }
.joinslide.solo .bigcode {
  font-size: clamp(3.5rem, 13vw, 9rem);
  letter-spacing: 0.16em;
  padding: 0.35em 0.3em 0.35em 0.46em;
  width: min(100%, 20ch);
}

.joinslide .divider { width: 1px; align-self: stretch; background: var(--line-soft); position: relative; }

.joinslide .divider span {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: var(--forest); padding: 0.5rem 0;
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.14em;
  color: var(--ivory-dim); text-transform: uppercase;
}

.joinway h3 { font-size: clamp(1.1rem, 2vw, 1.5rem); margin-bottom: 0.7rem; }
.joinway p { color: var(--ivory-dim); line-height: 1.55; margin: 0 0 1.2rem; font-size: 0.92rem; }

.bigcode {
  font-family: var(--mono);
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--white);
  background: rgba(8, 53, 39, 0.7);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.7em 0.4em;
  text-align: center;
  line-height: 1;
}

.bigurl { font-family: var(--mono); font-size: clamp(0.9rem, 1.6vw, 1.15rem); color: var(--mint); margin-top: 0.9rem; text-align: center; word-break: break-all; }

.closing { display: flex; flex-direction: column; justify-content: center; gap: 1.4rem; height: 100%; }
.closing h1 { font-size: clamp(2.2rem, 5.5vw, 4rem); }
.closing .phrase { font-size: clamp(1.3rem, 3vw, 2rem); }
.closing p { color: var(--ivory-dim); font-size: 1.05rem; line-height: 1.6; max-width: 46ch; margin: 0; }

/* ------------------------------------------------------- result renderings */

.reveal-shell { position: relative; }

.awaiting { display: flex; align-items: center; gap: clamp(1.5rem, 4vw, 3rem); padding: 1rem 0; }

.ring { flex: 0 0 auto; text-align: center; }
.ring svg { display: block; width: clamp(11rem, 19vw, 16rem); height: auto; }
.ring .track-c { fill: none; stroke: var(--forest-3); stroke-width: 7; }
.ring .prog-c {
  fill: none; stroke: var(--emerald); stroke-width: 7; stroke-linecap: round;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ring .ring-n { font-family: var(--display); font-size: 46px; fill: var(--white); text-anchor: middle; }

/* Label sits under the ring, not squeezed inside it. */
.ring-caption {
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ivory-dim);
  margin-top: 0.8rem;
}

.awaiting-copy h3 { font-size: clamp(1.2rem, 2.4vw, 1.8rem); margin-bottom: 0.5rem; }
.awaiting-copy p { color: var(--ivory-dim); margin: 0; line-height: 1.6; }

/* Battery bank — energy */

.bank { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1rem, 2.5vw, 2rem); }

.cell { text-align: center; }

.cell .glyph {
  position: relative;
  height: clamp(8rem, 22vh, 15rem);
  border: 3px solid var(--ivory-dim);
  border-radius: 10px;
  padding: 5px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.cell .glyph::after {
  content: "";
  position: absolute;
  top: -11px; left: 50%; transform: translateX(-50%);
  width: 38px; height: 9px;
  background: var(--ivory-dim);
  border-radius: 3px 3px 0 0;
}

.cell .juice {
  width: 100%; height: 0; border-radius: 6px;
  transition: height 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cell.empty   .juice { background: linear-gradient(180deg, var(--amber), #C4762A); }
.cell.steady  .juice { background: linear-gradient(180deg, var(--mint), #4FB784); }
.cell.charged .juice { background: linear-gradient(180deg, var(--emerald), #007A3F); }

.cell .cell-pct { font-family: var(--display); font-size: clamp(2.2rem, 4.6vw, 3.6rem); margin-top: 0.9rem; line-height: 1; }
.cell .cell-lbl { font-size: clamp(1rem, 1.7vw, 1.35rem); font-weight: 600; margin-top: 0.35rem; }
.cell .cell-n { font-family: var(--mono); font-size: 0.92rem; color: var(--ivory-dim); margin-top: 0.35rem; }

/* Arc gauge — 1-10 scales */

.gauge-wrap { display: flex; align-items: center; gap: clamp(1.5rem, 4vw, 3.5rem); flex-wrap: wrap; }
.gauge { flex: 0 0 auto; }
.gauge svg { display: block; width: clamp(18rem, 36vw, 30rem); height: auto; }
.gauge .g-track { fill: none; stroke: var(--forest-3); stroke-width: 19; stroke-linecap: round; }
.gauge .g-fill {
  fill: none; stroke: var(--emerald); stroke-width: 19; stroke-linecap: round;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.gauge .g-val { font-family: var(--display); font-size: 56px; fill: var(--white); text-anchor: middle; }
.gauge .g-of { font-family: var(--mono); font-size: 13px; fill: var(--ivory-dim); text-anchor: middle; letter-spacing: .08em; }
.gauge .g-end { font-family: var(--mono); font-size: 13px; fill: var(--ivory-dim); }

.histo-side { flex: 1; min-width: 16rem; display: flex; flex-direction: column; }

.histo { width: 100%; display: flex; align-items: flex-end; gap: 0.45rem; height: clamp(10rem, 26vh, 16rem); }

.hcol { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; gap: 0.35rem; }

.hbar {
  background: var(--forest-4);
  border-radius: 5px 5px 0 0;
  min-height: 3px;
  transition: height 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hbar.hot { background: var(--brass); }

.hn { font-family: var(--mono); font-size: 0.95rem; color: var(--ivory); text-align: center; min-height: 1em; }
.hl { font-family: var(--mono); font-size: 0.95rem; color: var(--ivory-dim); text-align: center; }

/* Balance beam — solve vs escalate */

.beam-wrap { display: grid; gap: 1.2rem; }
.beam { width: 100%; height: clamp(12rem, 30vh, 20rem); }
.beam .fulcrum { fill: var(--forest-4); }

/* The whole assembly rotates as one, so the tilt animates smoothly when
   a vote shifts the balance. Pan numbers counter-rotate to stay upright. */
.beam .rig, .beam .pan-text {
  transform-box: view-box;
  transition: transform 0.9s cubic-bezier(0.34, 1.15, 0.4, 1);
}

.beam .rig { transform-origin: 400px 120px; }
.beam .plank { stroke: var(--ivory); stroke-width: 7; stroke-linecap: round; }
.beam .pan circle { transition: r 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.beam .pan-l circle { fill: var(--amber); }
.beam .pan-r circle { fill: var(--emerald); }
.beam .pan text { font-family: var(--mono); font-size: 22px; fill: #03251A; text-anchor: middle; font-weight: 700; }
.beam .beam-lbl { font-family: var(--body); font-size: 20px; fill: var(--ivory-dim); }

.verdict { display: flex; align-items: baseline; gap: 0.9rem; flex-wrap: wrap; }
.verdict .big { font-family: var(--display); font-size: clamp(2rem, 4.2vw, 3.2rem); }
.verdict .big.lean-solve { color: var(--mint); }
.verdict .big.lean-escalate { color: var(--amber); }

/* Friction track — collaboration */

.friction { display: grid; gap: 1rem; }

.f-track {
  position: relative;
  height: 32px;
  border-radius: 16px;
  background: linear-gradient(90deg, #B5542A 0%, var(--brass) 50%, var(--emerald) 100%);
  opacity: 0.85;
}

.f-marker {
  position: absolute;
  top: 50%;
  width: 5px;
  height: 64px;
  background: var(--white);
  border-radius: 2px;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 4px rgba(4, 36, 26, 0.55);
  transition: left 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.f-flag {
  position: absolute;
  top: -3.9rem;
  transform: translateX(-50%);
  font-family: var(--display);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  transition: left 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
  white-space: nowrap;
}

.f-ends { display: flex; justify-content: space-between; font-size: clamp(0.9rem, 1.5vw, 1.15rem); color: var(--ivory-dim); }

/* Ranked bars — Charter slides */

.ranked { display: grid; gap: 0.4rem; }

.rank-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.9rem;
  align-items: center;
  will-change: transform;
}

.rank-row.settling { transition: transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1); }

.rank-row .badge { width: 30px; height: 30px; font-size: 0.85rem; }

.rank-bar-wrap {
  position: relative;
  height: clamp(30px, 4.4vh, 44px);
  background: rgba(8, 53, 39, 0.6);
  border-radius: 7px;
  overflow: hidden;
}

.rank-bar {
  height: 100%;
  width: 0;
  border-radius: 6px;
  background: var(--forest-4);
  transition: width 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.rank-row.top .rank-bar { background: var(--emerald); }
.rank-row.top.warn .rank-bar { background: var(--amber); }

.rank-label {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: clamp(0.95rem, 1.6vw, 1.25rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 1.4rem);
}

.rank-row.top .rank-label { font-weight: 600; }

.rank-n { font-family: var(--mono); font-size: clamp(0.9rem, 1.4vw, 1.1rem); color: var(--ivory); min-width: 4.6rem; text-align: right; }

.rank-note {
  margin: 1rem 0 0;
  font-size: 0.85rem;
  color: var(--ivory-dim);
}

/* Unplaced rows keep an empty badge rather than a stale number. */
.rank-row.zero .badge { color: var(--ivory-dim); background: transparent; }

.rank-row.zero { opacity: 0.38; }
.rank-row.zero .rank-n { color: var(--ivory-dim); }

/* Quote cards — open text and Charter comments */

.wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
  gap: 0.9rem;
  max-height: 52vh;
  overflow-y: auto;
  padding-right: 0.4rem;
}

.wall.inline { max-height: 18vh; margin-top: 1.2rem; }

/* A 15-person team should fit on screen without scrolling. */
.wall.dense { grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.7rem; }
.wall.dense .quote { padding: 0.8rem 0.9rem; font-size: clamp(0.85rem, 1.1vw, 1rem); }
.wall.denser { grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); gap: 0.55rem; max-height: 58vh; }
.wall.denser .quote { padding: 0.65rem 0.8rem; font-size: clamp(0.78rem, 0.95vw, 0.92rem); line-height: 1.42; }

.quote {
  background: rgba(8, 53, 39, 0.8);
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--brass);
  border-radius: 4px 12px 12px 4px;
  padding: 1.05rem 1.2rem;
  line-height: 1.5;
  font-size: clamp(0.95rem, 1.35vw, 1.15rem);
  animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}

.quote .attrib { display: block; margin-top: 0.5rem; font-family: var(--mono); font-size: 0.68rem; color: var(--mint); letter-spacing: 0.06em; }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.summary-line { display: flex; align-items: baseline; gap: 0.85rem; margin-top: 1.5rem; flex-wrap: wrap; }
.summary-line .n { font-family: var(--display); font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1; color: var(--brass); }
.summary-line .of { color: var(--ivory-dim); font-size: 0.92rem; }

.empty-state { color: var(--ivory-dim); font-size: 0.95rem; padding: 1.5rem 0; line-height: 1.6; }

/* ------------------------------------------------------------ admin / trend */

.page { max-width: 68rem; margin: 0 auto; padding: var(--pad); }
.page h1 { font-size: clamp(2rem, 5vw, 2.8rem); margin-bottom: 0.4rem; }
.page-lede { color: var(--ivory-dim); line-height: 1.6; margin: 0 0 2.4rem; }

.card {
  background: rgba(8, 53, 39, 0.72);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 1.4rem 1.5rem;
  margin-bottom: 1rem;
}

.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }

.pill {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.28rem 0.62rem;
  border-radius: 99px;
  border: 1px solid var(--line);
  color: var(--ivory-dim);
  text-decoration: none;
}

.pill.live { color: var(--mint); border-color: rgba(0, 167, 88, 0.45); }
.pill.draft { color: var(--brass); border-color: rgba(217, 169, 60, 0.45); }

.row-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }

.row-actions a, .row-actions button {
  padding: 0.55rem 0.9rem;
  font-size: 0.85rem;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ivory);
  text-decoration: none;
  cursor: pointer;
}

.row-actions a:hover, .row-actions button:hover { border-color: rgba(247, 243, 233, 0.38); }

.inline-form { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }

.inline-form input {
  background: rgba(8, 53, 39, 0.8);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0.7rem 0.85rem;
  font-family: var(--mono);
  color: var(--ivory);
}

.inline-form .btn { width: auto; margin-top: 0; padding: 0.72rem 1.2rem; }

.trend-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: 1rem; }

.spark { width: 100%; height: 90px; margin: 1rem 0 0.5rem; }
.spark polyline { fill: none; stroke: var(--emerald); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark circle { fill: var(--brass); }
.spark .grid-line { stroke: var(--line-soft); stroke-width: 1; }

.trend-value { font-family: var(--display); font-size: 2.2rem; }

.periods { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 0.68rem; color: var(--ivory-dim); }

.textwall { display: grid; gap: 0.6rem; margin-top: 1rem; }
.textwall .quote { animation: none; font-size: 0.88rem; }

/* -------------------------------------------------------------- responsive */

@media (max-width: 860px) {
  .joinslide { grid-template-columns: 1fr; }
  .joinslide .divider { width: 100%; height: 1px; }
  .joinslide .divider span { background: var(--forest); padding: 0 0.8rem; }
  .gauge-wrap { flex-direction: column; align-items: stretch; }
  .bank { grid-template-columns: 1fr; gap: 0.7rem; }
  .cell .glyph { height: 3.5rem; }
  .awaiting { flex-direction: column; text-align: center; }
}

@media (max-width: 720px) {
  .stage-head { flex-direction: column; align-items: flex-start; gap: 0.7rem; }
  .stage-foot { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
