/* Coastal stationery. Warm paper, lagoon ink, a little late-sun sand.
   Fonts are self-hosted so the demo works with no network. */

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/fraunces-400.woff2") format("woff2");
}

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/fraunces-600.woff2") format("woff2");
}

@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/outfit-400.woff2") format("woff2");
}

@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/outfit-500.woff2") format("woff2");
}

@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/outfit-600.woff2") format("woff2");
}

:root {
  --paper: #f4efe6;
  --card: #fffbf6;
  --ink: #143238;
  --muted: #3c5459;
  --hint: #3e555a;
  --line: #e4d9c8;
  --line-strong: #d3c4ae;
  --lagoon: #135e66;
  --lagoon-deep: #0e4a51;
  --foam: #e5f3f1;
  --sand: #f6ecdf;
  --gold: #8c6232;
  --ok: #0e5c3a;
  --ok-bg: #e3f3ea;
  --ok-line: #b7dcc8;
  --review: #7a4e0d;
  --review-bg: #fbf0dc;
  --review-line: #e4c48a;
  --reject: #7c2e2e;
  --reject-bg: #f8e7e4;
  --reject-line: #e3bdb8;
  --proof: #0e4a51;
  --proof-bg: #e5f3f1;
  --shadow: 0 1px 0 rgba(20, 50, 56, 0.04), 0 16px 36px rgba(20, 50, 56, 0.06);
  --sans: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
  --serif: "Fraunces", "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  --mast: 118px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse 90% 42% at 0% -8%, rgba(19, 94, 102, 0.08), transparent 52%),
    radial-gradient(ellipse 70% 36% at 100% 0%, rgba(201, 133, 74, 0.1), transparent 48%);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

main {
  flex: 1;
}

h1, h2, h3, p, ul, ol, figure {
  margin-top: 0;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-wrap: balance;
}

h1 {
  font-size: clamp(1.85rem, 7vw, 2.35rem);
  margin-bottom: 10px;
  scroll-margin-top: 150px;
}

h2 {
  font-size: 1.35rem;
  margin-bottom: 8px;
}

h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

p {
  text-wrap: pretty;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 3px solid var(--lagoon);
  outline-offset: 2px;
}

::selection {
  background: #d5ebe8;
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 40;
  background: var(--card);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 10px;
}

.skip:focus {
  top: calc(12px + env(safe-area-inset-top));
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mast {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: env(safe-area-inset-top);
  background: #f4efe6;
  border-bottom: 1px solid var(--line);
}

.mast-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  width: min(800px, 100%);
  margin: 0 auto;
  padding: 12px 20px 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mark {
  width: 40px;
  height: 40px;
  flex: none;
}

.brand-kicker,
.brand-name {
  margin: 0;
}

.brand-kicker {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lagoon-deep);
}

.brand-name {
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.demo-badge {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  color: var(--lagoon-deep);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
}

.demo-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c9854a;
  flex: none;
}

.tabs {
  background: #f4efe6;
  display: flex;
  gap: 2px;
  width: min(800px, 100%);
  margin: 0 auto;
  padding: 0 12px 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tabs button {
  position: relative;
  flex: 1 0 auto;
  min-height: 44px;
  padding: 10px 8px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
}

.tabs button[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--lagoon-deep);
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--gold);
  vertical-align: middle;
}

.wrap {
  width: min(640px, 100%);
  margin: 0 auto;
  padding: 22px 20px 28px;
}

.wrap.wide {
  width: min(800px, 100%);
}

.lede {
  margin-bottom: 14px;
  color: var(--ink);
  font-size: 1.02rem;
}

.points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.points li {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 251, 246, 0.8);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
}

.quick-fills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 18px;
}

.text-btn {
  min-height: 44px;
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--lagoon-deep);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-btn:hover {
  color: var(--ink);
}

.group {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.group > legend,
.step-label {
  margin-bottom: 10px;
  color: var(--gold);
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.field {
  margin-bottom: 14px;
}

.field > label,
.radios > legend {
  display: block;
  margin-bottom: 6px;
  font-size: 0.95rem;
  font-weight: 600;
}

.radios {
  margin: 0;
  padding: 0;
  border: 0;
}

.hint {
  margin: 6px 0 0;
  color: var(--hint);
  font-size: 0.88rem;
}

input[type="text"],
input[type="tel"],
input[type="month"],
select,
textarea {
  width: 100%;
  max-width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  font-size: 16px;
  line-height: 1.35;
}

textarea {
  min-height: 128px;
  resize: vertical;
}

select {
  appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 6l4.5 4.5L12.5 6' fill='none' stroke='%230E4A51' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

input::placeholder,
textarea::placeholder {
  color: #4e6266;
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--reject);
  background: #fff8f6;
}

.field-error,
.form-error {
  margin: 6px 0 0;
  color: var(--reject);
  font-size: 0.9rem;
  font-weight: 600;
}

.form-error {
  margin-bottom: 10px;
}

.radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.radio-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  font-weight: 500;
}

.radio-pill:has(input:checked) {
  border-color: var(--lagoon-deep);
  background: var(--foam);
}

.radio-pill input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--lagoon-deep);
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  font-weight: 600;
}

.check input {
  width: 1.2rem;
  height: 1.2rem;
  margin-top: 3px;
  accent-color: var(--lagoon-deep);
  flex: none;
}

.rules {
  margin: 4px 0 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}

.rules summary {
  min-height: 48px;
  padding: 12px 16px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.rules summary::-webkit-details-marker {
  display: none;
}

.rules summary::after {
  content: "Show";
  float: right;
  color: var(--lagoon-deep);
  font-size: 0.88rem;
  font-weight: 600;
}

.rules[open] summary::after {
  content: "Hide";
}

.rules ol {
  margin: 0;
  padding: 0 16px 14px 36px;
}

.rules li {
  margin-bottom: 10px;
}

.rules li strong {
  display: block;
  font-weight: 600;
}

.rules li span {
  color: var(--muted);
  font-size: 0.95rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1.5px solid transparent;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  touch-action: manipulation;
}

.btn-primary {
  background: var(--lagoon-deep);
  border-color: var(--lagoon-deep);
  color: #fff;
}

.btn-secondary {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--lagoon-deep);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.btn-primary:hover {
  background: #0c3e44;
}

.btn[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.step-title {
  margin-bottom: 8px;
}

.who {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--sand);
  font-size: 0.95rem;
}

.proof-box {
  margin: 12px 0;
  padding: 16px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 16px;
  background: rgba(255, 251, 246, 0.7);
}

.proof-box.is-checked {
  border-style: solid;
  border-color: var(--lagoon);
  background: var(--foam);
}

.proof-box p {
  margin: 0 0 8px;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.letter,
.card,
.info-card,
.option,
.note-card,
.verdict {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

#step-result,
.letter,
#message-result {
  scroll-margin-top: 150px;
}

#panel-queue .wrap {
  padding-top: 14px;
}

#panel-queue .lede {
  margin-bottom: 8px;
}

#panel-queue .stats {
  gap: 8px;
  margin-bottom: 10px;
}

#panel-queue .sample-note {
  margin: 0 0 8px;
}

#panel-queue .card {
  padding: 14px 14px 12px;
}

#panel-queue .tags {
  margin: 4px 0 6px;
}

#panel-queue .meta {
  margin-bottom: 2px;
}

#panel-queue .score-line {
  margin-top: 8px;
}

.letter {
  padding: 18px 18px 16px;
}

.checking-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.checking-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
}

.spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  border-top-color: var(--lagoon-deep);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.check-steps {
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-steps li {
  position: relative;
  padding: 8px 0 8px 28px;
  color: var(--muted);
}

.check-steps li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  background: #fff;
}

.check-steps li.is-active {
  color: var(--ink);
  font-weight: 600;
}

.check-steps li.is-active::before {
  border-color: var(--lagoon-deep);
  background: var(--foam);
}

.check-steps li.is-done {
  color: var(--ok);
}

.check-steps li.is-done::before {
  border-color: var(--ok);
  background: var(--ok);
  box-shadow: inset 0 0 0 2px var(--ok-bg);
}

.kicker {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.decision-word {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: clamp(2rem, 8vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.decision-word.is-approve { color: var(--ok); }
.decision-word.is-review { color: var(--review); }
.decision-word.is-reject { color: var(--reject); }

.score-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 6px;
  font-size: 0.92rem;
  font-weight: 600;
}

.bar {
  height: 8px;
  border-radius: 999px;
  background: #efe6d9;
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--lagoon);
}

.bar.is-approve > span { background: var(--ok); }
.bar.is-review > span { background: #b67a24; }
.bar.is-reject > span { background: var(--reject); }

.reason-list {
  margin: 12px 0;
  padding: 0;
  list-style: none;
}

.reason-list li {
  position: relative;
  margin-bottom: 8px;
  padding-left: 16px;
}

.reason-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lagoon);
}

.person-line {
  margin: 8px 0 4px;
  color: var(--muted);
  font-size: 0.95rem;
}

.fine {
  margin: 10px 0 0;
  color: var(--hint);
  font-size: 0.86rem;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.stat {
  padding: 10px 12px 8px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
}

.stat b {
  display: block;
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.stat span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.chip {
  flex: none;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 600;
  width: auto;
  margin: 0;
}

.chip[aria-pressed="true"] {
  background: var(--lagoon-deep);
  border-color: var(--lagoon-deep);
  color: #fff;
}

.sample-note,
.empty {
  color: var(--muted);
  font-size: 0.92rem;
}

.queue {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  padding: 16px;
  scroll-margin-top: 140px;
  border-left: 4px solid var(--line-strong);
}

.card.is-approve { border-left-color: var(--ok); }
.card.is-review { border-left-color: #b67a24; }
.card.is-reject { border-left-color: var(--reject); }
.card.is-proof { border-left-color: var(--lagoon); }

.card.is-fresh {
  animation: wash 2.6s ease;
}

@keyframes wash {
  from { background: #e5f3f1; }
  to { background: var(--card); }
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.card h2 {
  margin: 0;
  font-size: 1.28rem;
}

.badge {
  flex: none;
  padding: 4px 8px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.badge.is-approve { background: var(--ok-bg); color: var(--ok); }
.badge.is-review { background: var(--review-bg); color: var(--review); }
.badge.is-reject { background: var(--reject-bg); color: var(--reject); }
.badge.is-proof { background: var(--proof-bg); color: var(--proof); }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.tag {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--sand);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.meta, .check-said {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.92rem;
  overflow-wrap: break-word;
}

.note {
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--paper);
  font-size: 0.92rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.actions .btn {
  width: auto;
  flex: 1 1 42%;
  margin-top: 0;
  min-height: 44px;
  padding: 10px 12px;
  font-size: 0.95rem;
}

.actions .btn.full {
  flex-basis: 100%;
}

.invite {
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  background: var(--foam);
  border: 1px solid #cfe3e0;
}

.invite p {
  margin: 0 0 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--lagoon-deep);
}

.invite pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--sans);
  font-size: 0.92rem;
  line-height: 1.45;
}

.reset-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  margin-top: 8px;
}

.samples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.samples .chip {
  white-space: normal;
  text-align: left;
  line-height: 1.3;
}

.verdict {
  padding: 16px;
  margin-top: 6px;
  scroll-margin-top: 160px;
}

.verdict.is-ok {
  background: var(--ok-bg);
  border-color: var(--ok-line);
}

.verdict.is-flag {
  background: var(--review-bg);
  border-color: var(--review-line);
}

.reply-box {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
}

.reply-box p {
  margin: 0;
}

.info-card, .option, .note-card {
  margin-top: 14px;
  padding: 16px 16px 14px;
}

.info-card p:last-child,
.option p:last-child,
.note-card p:last-child {
  margin-bottom: 0;
}

.path {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.path li {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 0.88rem;
  font-weight: 600;
}

.path li:not(:last-child)::after {
  content: ">";
  margin-left: 8px;
  color: var(--gold);
  font-weight: 500;
}

.steps {
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}

.steps li {
  position: relative;
  padding: 0 0 18px 48px;
}

.steps li:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 36px;
  bottom: 0;
  width: 1px;
  background: var(--line-strong);
}

.num {
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--lagoon-deep);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
}

.section-title {
  margin: 18px 0 10px;
}

.options {
  display: grid;
  gap: 12px;
}

.note-card {
  background: var(--sand);
  border-color: #ead9c2;
  box-shadow: none;
}

.site-footer {
  width: min(800px, 100%);
  margin: 0 auto;
  padding: 8px 20px calc(22px + env(safe-area-inset-bottom));
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

.footer-note {
  margin-top: 4px !important;
  font-size: 0.86rem;
}

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 30;
  max-width: min(420px, calc(100% - 32px));
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  transform: translateX(-50%) translateY(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#toast.is-on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.noscript {
  width: min(640px, calc(100% - 32px));
  margin: 12px auto;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--review-bg);
}

.hint-inline {
  color: var(--hint);
  font-weight: 500;
}

.sign-form,
#sign-thanks,
#petition-output {
  margin-top: 16px;
  scroll-margin-top: 160px;
}

.sign-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.sign-choices .check {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.petition-card h2 {
  font-size: 1.28rem;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0;
}

.admin-row {
  padding: 12px;
  border-radius: 14px;
  background: var(--paper);
}

.admin-row h3 {
  margin-bottom: 4px;
  font-size: 1.02rem;
}

.admin-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 0;
}

.tower-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 4px 0 12px;
}

.tower-row {
  display: grid;
  grid-template-columns: minmax(108px, 1.1fr) minmax(0, 2fr) auto;
  gap: 8px;
  align-items: center;
  font-size: 0.82rem;
}

.tower-name {
  overflow-wrap: break-word;
}

.tower-track {
  height: 8px;
  border-radius: 999px;
  background: #efe6d9;
  overflow: hidden;
}

.tower-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--lagoon-deep);
}

.tower-count {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

#petition-output pre {
  margin: 8px 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--sans);
  font-size: 0.92rem;
  line-height: 1.45;
}

.thanks-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.thanks-list li {
  margin-bottom: 10px;
}

.live-wrap {
  width: min(960px, 100%);
}

.live-controls {
  position: sticky;
  top: 188px;
  z-index: 5;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f4efe6;
}

.live-controls::before {
  content: "";
  position: absolute;
  left: -16px;
  right: -16px;
  bottom: 100%;
  height: 18px;
  background: #f4efe6;
}

.live-transport {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.live-transport .btn {
  margin-top: 0;
}

.live-progress {
  margin: 8px 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.segmented button {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 600;
}

.segmented button[aria-pressed="true"] {
  background: var(--lagoon-deep);
  border-color: var(--lagoon-deep);
  color: #fff;
}

.feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.live-msg,
.live-dm,
.live-event {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}

.live-msg {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  padding: 12px;
}

.live-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--sand);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 600;
}

.live-avatar.is-assistant {
  background: var(--lagoon-deep);
  color: #fff;
}

.live-who {
  margin: 0;
  font-weight: 600;
}

.live-meta {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.live-body {
  margin: 0;
  overflow-wrap: break-word;
}

.live-msg.is-flagged {
  background: var(--review-bg);
  border-color: var(--review-line);
}

.live-msg.is-assistant {
  background: var(--foam);
  border-color: #cfe3e0;
}

.live-msg.is-removed {
  background: var(--paper);
}

.live-chip {
  display: inline-block;
  margin-bottom: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff;
  color: var(--review);
  font-size: 0.75rem;
  font-weight: 600;
}

.live-original {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  font-size: 0.9rem;
}

.live-dm,
.live-event {
  padding: 12px;
}

.live-event {
  text-align: center;
  background: var(--sand);
  border-style: dashed;
}

.live-compose {
  margin-top: 12px;
}

.live-log-panel {
  margin-top: 16px;
}

.live-log {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.log-item p {
  margin: 0 0 6px;
}

.log-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.log-actions .btn {
  width: auto;
  flex: 1 1 40%;
  margin-top: 0;
}

@media (min-width: 560px) {
  .live-controls {
    top: 124px;
  }
}

@media (min-width: 860px) {
  .live-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.8fr);
    gap: 18px;
    align-items: start;
  }

  .live-log-panel {
    position: sticky;
    top: 210px;
    margin-top: 0;
  }
}

@media (max-width: 520px) {
  .tabs {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .tabs button {
    flex: 1 1 30%;
    padding: 8px 4px 10px;
    font-size: 0.78rem;
    white-space: normal;
  }
}

@media (min-width: 720px) {
  .wrap {
    padding-top: 32px;
  }

  .stats {
    grid-template-columns: repeat(4, 1fr);
  }

  .options {
    grid-template-columns: 1fr 1fr;
  }

  .letter, .card, .info-card, .option, .note-card, .verdict {
    padding: 20px;
  }
}

@media (hover: hover) {
  .chip:hover,
  .btn-secondary:hover,
  .radio-pill:hover {
    border-color: var(--lagoon);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
