:root {
  color-scheme: light;
  font-family: system-ui, sans-serif;
  line-height: 1.5;
  --ink: #172033;
  --muted: #596579;
  --primary: #2457c5;
  --surface: #ffffff;
  --border: #dce1e8;
  --radius: .5rem;
  --space: 1rem;
}

[hidden] { display: none !important; }

body {
  margin: 0;
  color: var(--ink);
  background: #f7f8fa;
}

a { color: #164ba8; }
a:hover { text-decoration-thickness: .14rem; }
:focus-visible { outline: .2rem solid #e19a19; outline-offset: .15rem; }
h1, h2, h3 { line-height: 1.2; }
h1 { margin-top: 0; }
p { overflow-wrap: anywhere; }

main {
  width: min(100% - 2rem, 48rem);
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

form,
article,
fieldset {
  max-width: 100%;
}

textarea,
input,
button,
select {
  box-sizing: border-box;
  max-width: 100%;
  font: inherit;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

textarea,
input[type="email"],
input[type="text"],
input[type="search"] {
  width: 100%;
}

select,
input[type="url"],
input[type="number"] {
  max-width: 100%;
  min-height: 2.5rem;
}

button {
  min-height: 2.75rem;
  padding: 0.55rem 1rem;
  cursor: pointer;
}

label { font-weight: 650; }
form p label { display: block; margin-bottom: .25rem; }
.helptext, form small { color: var(--muted); }
.errorlist { color: #8a1f17; }

[role="alert"] {
  padding: 0.75rem;
  border-left: 0.25rem solid #a1261c;
  background: #fff1f0;
}

.message { padding: .75rem; border-left: .25rem solid #596579; background: #eef1f5; }
.message.success { border-color: #237a3b; background: #edf8f0; }
.message.error { border-color: #a1261c; background: #fff1f0; }
.form-help { margin: .75rem 0; padding: .75rem; background: #eef4ff; }
.form-warning { border-left: .25rem solid #b26a00; padding: .75rem; background: #fff7e6; }

.topbar, .participant-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem max(1rem, calc((100% - 64rem) / 2)); background: #172033; color: white; }
.topbar a { color: white; font-weight: 700; }
.participant-bar a { color: white; font-weight: 800; text-decoration: none; }
.participant-bar span { color: #dce5f7; }
.session-actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.nav-form { display: inline; margin: 0; }
.link-button { min-height: 0; padding: 0; border: 0; background: transparent; color: inherit; font-weight: 700; text-decoration: underline; }
.management { width: min(100% - 2rem, 64rem); }
.participant-shell { width: min(100% - 2rem, 48rem); }
.heading-row, .actions, .copy-row, .inline-form { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.heading-row { justify-content: space-between; }
.card { background: white; border: 1px solid #dce1e8; border-radius: .5rem; margin: 1rem 0; padding: 1rem; }
.management-tabs { display: flex; gap: .25rem; margin: 1rem 0; overflow-x: auto; border-bottom: 1px solid var(--border); }
.management-tabs a { flex: 0 0 auto; padding: .7rem .85rem; color: var(--muted); font-weight: 700; text-decoration: none; }
.management-tabs a[aria-current="page"] { border-bottom: .2rem solid var(--primary); color: var(--ink); }
.settings-list > div { display: grid; grid-template-columns: minmax(8rem, 1fr) 2fr; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--border); }
.settings-list dt { font-weight: 700; }
.settings-list dd { margin: 0; }

.public-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem max(1rem, calc((100% - 68rem) / 2)); background: var(--surface); border-bottom: 1px solid var(--border); }
.public-header nav { display: flex; align-items: center; gap: .8rem; }
.public-brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--ink); font-size: 1.35rem; font-weight: 800; text-decoration: none; }
.public-brand img { display: block; width: 5.5rem; height: auto; }
.public-shell { width: min(100% - 2rem, 68rem); }
.public-hero { padding: clamp(1.5rem, 5vw, 3.5rem) 0; max-width: 48rem; }
.public-hero h1 { font-size: clamp(2rem, 6vw, 3.6rem); letter-spacing: -.035em; }
.public-hero > p:not(.eyebrow), .public-lead { color: var(--muted); font-size: 1.1rem; }
.directory-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 1rem; }
.directory-card { padding: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.directory-card h3 { margin-top: 0; }
.directory-card .actions { margin-top: auto; }
.step-card { border-left: .3rem solid var(--primary); }
.muted { color: var(--muted); }
.eyebrow { color: var(--muted); font-size: .85rem; font-weight: 750; letter-spacing: .04em; margin-bottom: .25rem; text-transform: uppercase; }
.empty-state { border: 1px dashed #aeb7c5; border-radius: .5rem; padding: 1rem; color: var(--muted); }
.progress-summary { font-weight: 700; }
.button, button { border: 0; border-radius: .35rem; background: #2457c5; color: white; text-decoration: none; padding: .6rem 1rem; }
.secondary { background: #e8edf6; color: #172033; }
.danger { background: #a1261c; }
.small { min-height: 2rem; padding: .25rem .5rem; }
.badge { display: inline-block; border-radius: 1rem; background: #e8edf6; padding: .15rem .55rem; font-size: .85rem; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: .75rem; }
.metrics div { background: white; border: 1px solid #dce1e8; border-radius: .5rem; padding: 1rem; }
.metrics strong, .metrics span { display: block; }
.metrics strong { font-size: 1.8rem; }
.challenge-list li { border-bottom: 1px solid #dce1e8; padding: .8rem 0; }
.challenge-list li, .copy-row { display: flex; justify-content: space-between; gap: .75rem; }
.copy-row input { flex: 1; }
.inline { display: inline; }
.one-time { border-left: .3rem solid #2457c5; padding: .75rem; background: #eef4ff; }
.form-stack p { margin-bottom: 1rem; }
.review-warning { border-left: .3rem solid #b26a00; padding: .75rem; background: #fff7e6; }
.result-table { width: 100%; border-collapse: collapse; }
.result-table th, .result-table td { border-bottom: 1px solid #dce1e8; padding: .6rem; text-align: left; vertical-align: top; }
.result-table th { max-width: 10rem; white-space: normal; }
.result-text { min-width: 16rem; }
.technical { overflow-wrap: anywhere; }
.table-scroll { overflow-x: auto; }
.table-scroll:focus-visible { outline: 3px solid #2457c5; outline-offset: 2px; }
.table-hint { color: #49566a; font-size: .9rem; }

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

@media (max-width: 36rem) {
  main {
    width: min(100% - 1rem, 48rem);
    padding-top: 1rem;
  }

  ol {
    padding-left: 1.5rem;
  }

  .topbar, .participant-bar {
    align-items: flex-start;
    flex-direction: column;
    padding: .75rem;
  }

  .topbar nav { display: flex; flex-wrap: wrap; gap: .5rem; }
  .heading-row { align-items: flex-start; }
  .heading-row > *, .actions, .actions > *, .inline-form, .inline-form > * { max-width: 100%; }
  .challenge-list li, .copy-row { align-items: stretch; flex-direction: column; }
  .copy-row input { min-width: 0; width: 100%; }
  .button, button { display: inline-flex; justify-content: center; text-align: center; }
  .result-table { font-size: .9rem; }
  .public-header { align-items: flex-start; flex-direction: column; }
  .public-header nav { width: 100%; flex-wrap: wrap; }
  .settings-list > div { grid-template-columns: 1fr; gap: .15rem; }
}

/* Participant contribution/evaluation flow, adapted from the original CoCo UI. */
.legacy-flow {
  --legacy-blue: #3576b8;
  --legacy-blue-dark: #245681;
  --legacy-green: #46af4b;
  --legacy-red: #d8463b;
  --legacy-gray: #898f98;
  color: #273241;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.legacy-flow-card {
  overflow: hidden;
  border: 1px solid #d8dee7;
  border-radius: .4rem;
  background: #fff;
  box-shadow: 0 .2rem .7rem rgb(23 32 51 / 7%);
}

.legacy-flow-top { min-height: 2.25rem; padding: .25rem .5rem 0; text-align: right; }
.legacy-exit {
  display: inline-grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  border-radius: 50%;
  color: #5f6874;
  font-size: 1.65rem;
  line-height: 1;
  text-decoration: none;
}
.legacy-exit:hover { background: #edf1f5; color: #1c2734; }
.legacy-exit:focus-visible,
.legacy-flow button:focus-visible,
.legacy-flow textarea:focus-visible { outline: 3px solid #173f67; outline-offset: 3px; }

.legacy-flow-brand { padding: 0 1rem .25rem; text-align: center; }
.legacy-flow-brand img { width: min(7.5rem, 34vw); height: auto; }
.legacy-progress { display: flex; justify-content: center; gap: .5rem; margin: .15rem 0 .7rem; }
.legacy-progress span { width: .55rem; height: .55rem; border-radius: 50%; background: #c6cbd2; }
.legacy-progress .done { background: var(--legacy-green); }
.legacy-progress .current { background: var(--legacy-blue); box-shadow: 0 0 0 .22rem rgb(53 118 184 / 20%); }
.legacy-progress-label { margin: -.3rem 1rem .65rem; color: #687482; font-size: .8rem; text-align: center; }
.legacy-kicker,
.legacy-description { margin: 0; padding-inline: 1rem; text-align: center; }
.legacy-kicker { color: #2d3947; font-size: .95rem; font-weight: 750; }
.legacy-description { margin-top: .15rem; color: #687482; font-size: .84rem; }

.legacy-prompt {
  margin: .75rem 0 1rem;
  padding: .85rem max(1rem, 4vw);
  background: linear-gradient(135deg, var(--legacy-blue-dark), var(--legacy-blue));
  color: #fff;
  text-align: center;
}
.legacy-prompt h1 { margin: 0; color: inherit; font-size: clamp(1.05rem, 2vw, 1.4rem); line-height: 1.35; }
.legacy-section,
.legacy-section-header,
.legacy-sent,
.legacy-next { padding-inline: clamp(1rem, 4vw, 2rem); }
.legacy-section-header { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; margin-bottom: .65rem; }
.legacy-section-header h2,
.legacy-sent h2,
.legacy-next h2 { margin: 0; font-size: 1rem; }
.legacy-section-header p { margin: 0; color: #657180; font-size: .85rem; text-align: right; }

.legacy-contribution-form label { display: block; margin-bottom: .4rem; font-weight: 800; }
.legacy-contribution-input {
  display: block;
  width: 100%;
  min-height: 8.5rem;
  resize: vertical;
  border: 2px solid #aeb9c7;
  border-radius: .35rem;
  padding: .8rem;
  background: #fbfcfd;
  color: #1f2935;
  font: inherit;
  line-height: 1.5;
}
.legacy-contribution-input:focus { border-color: var(--legacy-blue); background: #fff; }
.legacy-field-meta { display: flex; justify-content: space-between; gap: 1rem; margin-top: .35rem; color: #667383; font-size: .86rem; }
.legacy-sent { margin-bottom: 1rem; }
.legacy-sent ol { margin-bottom: 0; }
.legacy-sent li { margin-bottom: .35rem; }

.legacy-ideas-panel { margin: 0; padding: 0 clamp(1rem, 4vw, 2rem); list-style: none; }
.legacy-idea {
  position: relative;
  display: grid;
  grid-template-columns: .35rem minmax(0, 1fr) 6.2rem;
  grid-template-rows: 1fr auto;
  min-height: 7.4rem;
  overflow: hidden;
  border: 1px solid #cfd6df;
  border-radius: .35rem;
  margin-bottom: .65rem;
  background: #fff;
  box-shadow: 0 .1rem .3rem rgb(26 41 57 / 6%);
}
.legacy-band { grid-row: 1 / 3; background: var(--legacy-blue); }
.legacy-idea.is-positive .legacy-band { background: var(--legacy-green); }
.legacy-idea.is-negative .legacy-band { background: var(--legacy-red); }
.legacy-idea-text { align-self: center; margin: 0; padding: .8rem 1rem; font-size: .95rem; line-height: 1.4; }
.legacy-vote-column {
  grid-row: 1 / 3;
  grid-column: 3;
  display: grid;
  grid-template-rows: 1fr 1fr auto;
  border-left: 1px solid #d9dfe6;
  background: #f6f7f9;
}
.legacy-vote-button,
.legacy-neutral-button {
  min-width: 0;
  min-height: 2.75rem;
  border: 0;
  border-radius: 0;
  padding: .35rem;
  background: transparent;
  color: #4f5965;
  font-size: .78rem;
  font-weight: 700;
}
.legacy-vote-button { display: flex; align-items: center; justify-content: center; gap: .35rem; }
.legacy-vote-button.positive { grid-row: 1; }
.legacy-vote-button.negative { grid-row: 2; border-top: 1px solid #d9dfe6; }
.legacy-neutral-button { grid-row: 3; border-top: 1px solid #d9dfe6; font-size: .8rem; }
.legacy-vote-button .thumb { width: 1.45rem; height: 1.45rem; object-fit: contain; }
.legacy-vote-button .selected-thumb { display: none; }
.legacy-vote-button[aria-pressed="true"] .neutral-thumb { display: none; }
.legacy-vote-button[aria-pressed="true"] .selected-thumb { display: inline-block; }
.legacy-vote-button[aria-pressed="true"].positive { background: #ebf8eb; color: #226e27; }
.legacy-vote-button[aria-pressed="true"].negative { background: #fff0ee; color: #9f2820; }
.legacy-neutral-button[aria-pressed="true"] { background: #e3e7ec; color: #283440; }
.legacy-idea-state { grid-column: 2; align-self: end; padding: 0 1rem .45rem; color: #687482; font-size: .7rem; font-weight: 750; text-transform: uppercase; }
.legacy-idea.is-positive .legacy-idea-state { color: #27782c; }
.legacy-idea.is-negative .legacy-idea-state { color: #a12e26; }

.legacy-action-dock,
.legacy-flow-actions { padding: .8rem clamp(1rem, 4vw, 2rem) 1rem; text-align: center; }
.legacy-action-dock { display: grid; gap: .45rem; background: #f7f8fa; }
.legacy-action-dock strong,
.legacy-action-dock span { display: block; }
.legacy-action-dock span { margin-top: .15rem; color: #657180; font-size: .88rem; }
.legacy-action-dock p { margin: 0; color: #9f2820; font-size: .9rem; font-weight: 700; }
.legacy-submit {
  display: inline-flex;
  min-width: 9.5rem;
  min-height: 2.65rem;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: .25rem;
  padding: .6rem 1.1rem;
  background: var(--legacy-blue);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}
.legacy-submit:hover { background: var(--legacy-blue-dark); }
.legacy-submit:disabled { cursor: not-allowed; background: #aab1ba; color: #f5f6f7; }
.legacy-success,
.legacy-error { margin: 1rem clamp(1rem, 4vw, 2rem); padding: .8rem 1rem; }
.legacy-success { border-left: .3rem solid var(--legacy-green); background: #ecf8ed; }
.legacy-error { border-left: .3rem solid var(--legacy-red); background: #fff0ee; }
.legacy-next { padding-bottom: 1.5rem; text-align: center; }

@media (max-width: 36rem) {
  .legacy-flow-card { border-radius: .25rem; }
  .legacy-section-header { align-items: flex-start; flex-direction: column; }
  .legacy-section-header p { text-align: left; }
  .legacy-idea { grid-template-columns: .3rem minmax(0, 1fr); grid-template-rows: auto auto auto; min-height: 0; }
  .legacy-band { grid-row: 1 / 4; }
  .legacy-idea-text { grid-column: 2; padding: .75rem .85rem .6rem; }
  .legacy-vote-column { grid-row: 2; grid-column: 2; grid-template-columns: repeat(3, 1fr); grid-template-rows: 3.15rem; border-top: 1px solid #d9dfe6; border-left: 0; }
  .legacy-vote-button.positive,
  .legacy-vote-button.negative,
  .legacy-neutral-button { grid-row: 1; min-height: 3.15rem; }
  .legacy-vote-button.positive { grid-column: 1; }
  .legacy-neutral-button { grid-column: 2; border-top: 0; border-left: 1px solid #d9dfe6; }
  .legacy-vote-button.negative { grid-column: 3; border-top: 0; border-left: 1px solid #d9dfe6; }
  .legacy-vote-button { flex-direction: column; gap: 0; font-size: .72rem; }
  .legacy-vote-button .thumb { width: 1.35rem; height: 1.35rem; }
  .legacy-idea-state { grid-row: 3; grid-column: 2; padding: .4rem .85rem; text-align: center; }
  .legacy-field-meta { align-items: flex-end; flex-direction: column; gap: .15rem; }
  .legacy-submit { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .legacy-flow *, .legacy-flow *::before, .legacy-flow *::after { transition: none !important; animation: none !important; }
}
