:root {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: #172922;
  background: #f3f5ef;
  font-size: 16px;
  line-height: 1.55;
  --ink: #172922;
  --muted: #4a5b53;
  --paper: #fff;
  --line: #d3ddd4;
  --soft: #e9eee7;
  --accent: #c9ef81;
  --green: #265340;
  --danger: #a3312c;
  --radius: 16px;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; min-height: 100vh; }
h1, h2, h3, p { margin: 0; }
a { color: var(--green); }
p, h1, h2, h3, td, th, legend { overflow-wrap: anywhere; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled, input:disabled, textarea:disabled { cursor: wait; opacity: .7; }
:focus-visible { outline: 3px solid #477451; outline-offset: 3px; }

.skip {
  position: absolute;
  z-index: 1;
  padding: .65rem 1rem;
  background: white;
  top: .5rem;
  left: -100vw;
}

.skip:focus { left: .5rem; }
.site-header { color: #fff; background: var(--ink); }
.topbar {
  max-width: 76rem;
  min-height: 4.5rem;
  margin: 0 auto;
  padding: .65rem clamp(1rem, 3.5vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: #fff;
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 750;
  line-height: 1.2;
}

.brand small {
  display: block;
  margin-top: .13rem;
  color: var(--accent);
  font-size: .875rem;
  font-weight: 600;
}

.brand-icon, .hero-mark {
  display: inline-flex;
  flex: none;
  align-items: end;
  justify-content: center;
  gap: .2rem;
  width: 2.42rem;
  height: 2.42rem;
  padding: .52rem;
  border-radius: .7rem;
  background: var(--accent);
  color: var(--ink);
}

.brand-icon span, .hero-mark span {
  width: .32rem;
  height: 50%;
  background: currentColor;
  border-radius: 2px 2px 0 0;
}

.brand-icon span:nth-child(2), .hero-mark span:nth-child(2) { height: 78%; }
.brand-icon span:nth-child(3), .hero-mark span:nth-child(3) { height: 100%; }

.account, .actions, .inline, .paging {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .55rem;
}
.account { flex-wrap: nowrap; justify-content: end; min-width: 0; }
.account-name { max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account .button { border-color: #688074; color: white; }
.account .button:hover { background: #354c40; }
.account .button:focus-visible, .brand:focus-visible { outline-color: var(--accent); }

.container {
  width: min(100%, 76rem);
  margin: 0 auto;
  padding: clamp(1.4rem, 4vw, 3.75rem) clamp(1rem, 3.5vw, 2.5rem) 4rem;
}
.container:focus { outline: none; }

.auth-layout {
  display: grid;
  max-width: 66rem;
  margin: clamp(.25rem, 3vw, 2.5rem) auto 0;
  gap: 1rem;
}

.hero, .card, .survey-row, .form-question, .result-question, .response-card {
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: end;
  overflow: hidden;
  gap: 1.1rem;
  padding: clamp(1.25rem, 5vw, 3rem);
  background: var(--ink);
  color: #fff;
  isolation: isolate;
}

.hero::after {
  position: absolute;
  z-index: -1;
  content: "";
  width: 18rem;
  height: 18rem;
  border: 1px solid #a9cb8b46;
  border-radius: 43% 57% 63% 37%;
  right: -9rem;
  top: -10rem;
  box-shadow: 0 0 0 1.2rem #a9cb8b20, 0 0 0 2.4rem #a9cb8b20, 0 0 0 3.6rem #a9cb8b20;
  transform: rotate(28deg);
}

.hero-mark { width: 3.1rem; height: 3.1rem; padding: .67rem; gap: .28rem; display: none; }
.hero-mark span { width: .4rem; }
.hero p { max-width: 30rem; color: #dce8df; }
h1 { font-size: clamp(1.9rem, 4.4vw, 3.1rem); line-height: 1.04; letter-spacing: -.038em; }
h2 { font-size: clamp(1.2rem, 2.4vw, 1.5rem); line-height: 1.2; letter-spacing: -.023em; }
h3 { font-size: 1.03rem; line-height: 1.3; }

.card { padding: clamp(1.05rem, 3vw, 2rem); background: var(--paper); }
.narrow { max-width: 48rem; margin-inline: auto; }
.stack { display: grid; gap: 1rem; }
.section-stack { display: grid; gap: 1.6rem; }
.form { display: grid; gap: 1.15rem; }
.heading { display: grid; gap: .45rem; }
.heading p, .help, .muted, .empty, .meta { color: var(--muted); }
.heading .description { white-space: pre-wrap; max-width: 68ch; }

.toolbar, .survey-row, .question-top, .result-line {
  display: flex;
  justify-content: space-between;
  align-items: start;
  flex-wrap: wrap;
  gap: .85rem;
}

.toolbar { margin-bottom: 1.5rem; }
.toolbar > .heading { flex: 1 1 17rem; }
.survey-list { display: grid; gap: .8rem; }
.survey-row, .form-question, .result-question, .response-card {
  background: var(--paper);
  padding: 1rem clamp(.8rem, 2.5vw, 1.3rem);
}

.survey-row > .heading { flex: 1 1 13rem; }
.survey-row .actions { align-self: center; }
.survey-row h2 { font-size: 1.14rem; }
.meta { font-size: .9rem; }
.badge {
  display: inline-flex;
  flex: none;
  border-radius: .35rem;
  padding: .15rem .45rem;
  background: #e9eee7;
  color: #394b42;
  font-size: .875rem;
  font-weight: 650;
}
.badge.published, .badge.answered { background: #e6f3d9; color: #254c27; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 2.75rem;
  padding: .5rem .85rem;
  border: 1px solid transparent;
  border-radius: .65rem;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  font-size: .93rem;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.button[hidden] { display: none; }
.primary { background: var(--accent); border-color: #acd567; }
.primary:hover { background: #b6e367; }
.secondary { border-color: #adbbb1; background: #fff; }
.secondary:hover { background: #f0f3ef; }
.quiet { color: var(--green); }
.quiet:hover { background: var(--soft); }
.danger { color: var(--danger); }
.danger:hover { background: #fff3f1; }
.small { min-height: 2.5rem; padding-inline: .62rem; }
.form > .primary { justify-self: start; }

.mode-switch {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .25rem;
  padding: .25rem;
  border-radius: .76rem;
  background: var(--soft);
}
.mode-switch .button[aria-pressed="true"] { border-color: #c6d3c8; background: white; }

.field { display: grid; min-width: 0; gap: .35rem; }
.field > label, .response-name { font-weight: 700; }
input:not([type="radio"]), textarea {
  display: block;
  width: 100%;
  min-height: 2.85rem;
  padding: .55rem .65rem;
  border: 1px solid #a0b0a5;
  border-radius: .6rem;
  background: #fff;
  color: var(--ink);
}

textarea { resize: vertical; min-height: 5.4rem; }
.help { font-size: .9rem; }
.feedback:empty { display: none; }
.feedback {
  border-radius: .6rem;
  padding: .7rem .8rem;
  color: #274c37;
  background: #eaf3e9;
}
.feedback.error { background: #fff0ee; color: #8c2824; }
.empty { padding: 1.3rem; text-align: center; border: 1px dashed #a9baad; border-radius: var(--radius); }
.empty .button { margin-top: .65rem; }
.privacy { color: #355347; background: #eaf0e8; border-left: 3px solid #63826d; padding: .75rem .9rem; border-radius: 0 .45rem .45rem 0; }
.question-top { align-items: center; }
.question-top h2 { font-size: 1.05rem; }
.option-row { display: grid; grid-template-columns: minmax(0, 1fr) max-content; gap: .4rem; align-items: end; }
.option-row .button { min-height: 2.85rem; }
.form-question .field label { font-size: .9rem; }

fieldset { min-width: 0; margin: 0; }
.choice-group { display: grid; gap: .55rem; border: 1px solid var(--line); padding: .7rem .9rem .9rem; border-radius: .75rem; }
.choice-group legend { padding: 0 .3rem; font-weight: 750; }
.choice {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-height: 2.75rem;
  padding: .5rem .65rem;
  border: 1px solid var(--line);
  border-radius: .55rem;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.choice:has(input:checked) { background: #eaf5dd; border-color: #83a45b; }
.choice input { flex: none; margin: 0; accent-color: var(--green); width: 1.05rem; height: 1.05rem; }

.result-questions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: .85rem; }
.result-line { flex-wrap: nowrap; align-items: baseline; gap: .35rem; }
.result-line strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar { width: 100%; height: .48rem; border: none; border-radius: .3rem; appearance: none; overflow: hidden; color: #5b825d; background: var(--soft); }
.bar::-webkit-progress-bar { background: var(--soft); }
.bar::-webkit-progress-value { background: #5b825d; }
.bar::-moz-progress-bar { background: #5b825d; }
.response-card summary { cursor: pointer; overflow-wrap: anywhere; }
.response-card summary:hover { color: var(--green); }
.response-card[open] summary { margin-bottom: .75rem; }
.response-card dl { display: grid; gap: .55rem; margin: 0; }
.response-card dt { font-weight: 650; }
.response-card dd { margin: 0; color: var(--muted); overflow-wrap: anywhere; }

@media (min-width: 48rem) {
  .auth-layout { grid-template-columns: 1.05fr 1fr; gap: 1.15rem; }
  .auth-layout .card { padding: clamp(1.5rem, 3.8vw, 2.75rem); }
  .hero { justify-content: center; min-height: 27rem; }
  .hero-mark { display: inline-flex; }
}

@media (max-width: 29rem) {
  .account-name { display: none; }
  .actions { width: 100%; }
}
