* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--c-surface);
  color: var(--c-text);
  font:
    16px/1.6 -apple-system,
    BlinkMacSystemFont,
    "Helvetica Neue",
    sans-serif;
}
a {
  color: var(--c-accent);
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
.button {
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 24px;
  border: 1px solid var(--c-border);
  background: var(--c-bg);
  color: var(--c-text);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button.primary,
.button.primary {
  background: var(--c-accent);
  color: var(--c-button-text);
  border-color: transparent;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
input,
textarea,
select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  background: var(--c-bg);
  color: var(--c-text);
}
textarea {
  min-height: 100px;
  resize: vertical;
}
input[type="checkbox"],
input[type="radio"] {
  width: 22px;
  height: 22px;
  accent-color: var(--c-accent);
  flex-shrink: 0;
}
label {
  display: block;
  margin: 12px 0;
}
label > span {
  display: block;
  font-size: 14px;
  margin-bottom: 5px;
  color: var(--c-text-2);
}
:focus-visible {
  outline: 3px solid var(--c-accent);
  outline-offset: 3px;
}
h1 {
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.15;
  letter-spacing: -0.035em;
}
h2 {
  font-size: 26px;
  letter-spacing: -0.02em;
}
h3 {
  font-size: 20px;
}
.top {
  background: #1d1d1f;
  color: white;
  padding: 14px max(20px, env(safe-area-inset-right));
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
}
.top a {
  color: white;
  text-decoration: none;
}
.brand {
  font-weight: 650;
}
.app {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  max-width: 1600px;
  margin: auto;
}
.sidebar {
  padding: 30px 20px;
}
.sidebar button {
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 8px;
  border: 0;
  background: transparent;
}
.sidebar button[aria-current="page"] {
  background: var(--c-tint-orange);
  color: var(--c-accent);
  font-weight: 650;
}
.workspace {
  padding: 32px;
  min-width: 0;
}
.panel {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  padding: 28px;
  border-radius: 24px;
  margin: 20px 0;
}
.standalone {
  max-width: 800px;
  margin: 6vh auto;
  padding: 24px;
}
.eyebrow {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.13em;
  color: var(--c-accent);
}
.muted {
  color: var(--c-text-2);
  font-size: 14px;
}
.row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.between {
  justify-content: space-between;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 16px;
}
.stat {
  font-size: 40px;
  font-weight: 650;
}
.notice {
  background: var(--c-tint-orange);
  padding: 14px 18px;
  border-radius: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.error {
  color: #b32929;
  font-weight: 600;
}
.field-error {
  color: #b32929;
  font-size: 14px;
}
.listitem {
  padding: 18px 0;
  border-bottom: 1px solid var(--c-border);
}
.listitem:last-child {
  border: 0;
}
.badge {
  display: inline-block;
  border-radius: 12px;
  background: var(--c-surface);
  padding: 3px 10px;
  font-size: 12px;
}
.toolbar {
  position: sticky;
  top: 72px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 18px;
  padding: 12px;
  z-index: 10;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.question {
  padding: 22px;
  border: 1px solid var(--c-border);
  border-radius: 18px;
  margin: 16px 0;
  min-width: 0;
}
.option {
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  padding: 12px;
  margin: 8px 0;
  min-height: 48px;
}
.option span {
  font-size: 16px;
  margin: 0;
  color: var(--c-text);
}
.answer {
  margin: 28px 0;
}
.answer legend {
  font-weight: 600;
  font-size: 19px;
}
.answer fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
progress {
  width: 100%;
  height: 8px;
  accent-color: var(--c-accent);
}
.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.screen-reader {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
details {
  margin: 12px 0;
  border-bottom: 1px solid var(--c-border);
  padding: 10px 0;
}
summary {
  cursor: pointer;
  min-height: 44px;
  padding: 10px;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--c-surface);
  padding: 14px;
  border-radius: 12px;
}
iframe {
  width: 100%;
  height: 65vh;
  border: 1px solid var(--c-border);
  border-radius: 16px;
}
.mobile-menu {
  display: none;
}
#flash {
  position: static;
  max-width: 800px;
  margin-inline: auto;
  padding-inline: 24px;
}
#flash:empty {
  display: none;
}
.sticky-bottom {
  padding-bottom: env(safe-area-inset-bottom);
}
.edit-tree {
  border-left: 2px solid var(--c-border);
  padding-left: 16px;
}
.edit-tree textarea {
  min-height: 70px;
}
button.small {
  padding: 6px 14px;
  font-size: 14px;
}
table {
  width: 100%;
  border-collapse: collapse;
}
td,
th {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--c-border);
  overflow-wrap: anywhere;
}
.table-scroll {
  overflow: auto;
}
main {
  min-width: 0;
}
.survey-intro {
  font-size: 18px;
  white-space: pre-wrap;
}
.break {
  overflow-wrap: anywhere;
}
footer {
  font-size: 13px;
  color: var(--c-text-2);
  margin: 32px 0;
}
.error-box {
  border: 2px solid #b32929;
}
fieldset {
  min-width: 0;
}
#login {
  max-width: 520px;
  margin: 7vh auto;
}
#login h1 {
  font-size: 38px;
}
body:has(#survey) {
  background: var(--c-bg);
}
@media (max-width: 850px) {
  .app {
    display: block;
  }
  .workspace {
    padding: 20px;
  }
  .sidebar {
    display: none;
    padding: 12px 20px;
  }
  .sidebar.open {
    display: block;
  }
  .mobile-menu {
    display: inline-block;
  }
  .panel {
    padding: 20px;
  }
  .toolbar {
    top: 76px;
  }
  .top {
    font-size: 14px;
  }
  .top .brand {
    max-width: 60%;
  }
}
@media (prefers-color-scheme: dark) {
  .error,
  .field-error {
    color: #ff9a90;
  }
}
[hidden] {
  display: none !important;
}

@media (max-width: 850px) {
  .top {
    position: static;
    flex-wrap: wrap;
  }
  .top .brand {
    max-width: none;
    flex: 1 0 100%;
  }
  .top .row {
    width: 100%;
    justify-content: flex-end;
    gap: 10px;
  }
  .toolbar {
    top: 0;
  }
}

.other-editor,
.other-answer {
  margin: 20px 0;
  padding: 20px;
  border-inline-start: 3px solid var(--c-accent);
  background: var(--c-surface-2);
  border-radius: 12px;
}
.matrix {
  display: grid;
  gap: 16px;
  min-width: 0;
}
.matrix-row {
  padding: 16px;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  min-width: 0;
}
.matrix-row legend {
  font-size: 18px;
  padding: 0 6px;
}
.matrix-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}
.matrix-options .option {
  margin: 0;
  min-height: 44px;
  overflow-wrap: anywhere;
}
.matrix-options input {
  flex-shrink: 0;
}
@media (max-width: 600px) {
  .matrix-options {
    grid-template-columns: 1fr;
  }
  .other-editor,
  .other-answer {
    padding: 14px;
    margin-inline: 0;
  }
}
.survey-share {
  scroll-margin-top: 200px;
}
.survey-share > summary {
  font-weight: 650;
  cursor: pointer;
  min-height: 44px;
}
.survey-share-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.survey-qr {
  margin: 0;
  text-align: center;
}
.survey-qr img {
  display: block;
  width: 240px;
  max-width: 100%;
  height: auto;
  background: white;
  border-radius: 12px;
}
.survey-qr figcaption {
  font-size: 14px;
  margin-top: 8px;
}
.survey-share input[readonly] {
  font-size: 16px;
}
@media (max-width: 700px) {
  .survey-share-layout {
    grid-template-columns: 1fr;
  }
  .survey-qr {
    max-width: 240px;
    margin-inline: auto;
  }
  .survey-share {
    scroll-margin-top: 80px;
  }
}

@media (max-width: 700px) {
  .survey-actions {
    position: static;
  }
  .survey-share {
    scroll-margin-top: 24px;
  }
  #flash {
    position: static;
  }
}
.question-number {
  margin: 0 0 16px;
  color: var(--c-accent);
  font-size: 18px;
}

.feedback-host:empty {
  display: none;
}
.admin-feedback {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 16px;
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.5;
}
.admin-feedback > span {
  flex: 1;
  min-width: 0;
}
.feedback-close {
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  padding: 4px;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 24px;
  line-height: 1;
}

.answer .muted {
  white-space: pre-wrap;
}
.answer .muted a,
.survey-intro a {
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.file-upload {
  min-width: 0;
}
.file-upload input[type="file"] {
  width: 100%;
  min-height: 44px;
  font-size: 16px;
}
.upload-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--c-border);
  border-radius: 14px;
  margin-top: 12px;
  overflow-wrap: anywhere;
}
.upload-item progress {
  width: 100%;
}
.attachment-download {
  display: inline-block;
  padding-block: 10px;
  overflow-wrap: anywhere;
}

.survey-landing h1 {
  font-size: clamp(30px, 5vw, 44px);
  text-wrap: balance;
}
.survey-landing-intro {
  line-height: 1.8;
}
.survey-countdown {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 540px;
  background: var(--c-tint-orange);
  border: 1px solid var(--c-border);
  border-radius: 18px;
  padding: 16px 20px;
  margin: 24px 0;
}
.countdown-badge {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  flex: 0 0 64px;
  color: var(--c-accent);
}
.countdown-badge strong {
  font-size: 34px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.countdown-badge small {
  font-size: 14px;
}
.countdown-copy {
  min-width: 0;
  flex: 1;
}
.countdown-copy p {
  margin: 0 0 12px;
  font-size: 15px;
}
.countdown-copy progress {
  display: block;
  height: 5px;
}
@media (max-width: 480px) {
  .survey-countdown {
    padding: 16px;
    gap: 12px;
  }
  .countdown-badge {
    flex-basis: 50px;
  }
}

.event-ticket {
  max-width: 260px;
  background: #fff;
  padding: 12px;
  border-radius: 12px;
  margin: 16px auto;
}
.event-ticket svg {
  display: block;
  width: 100%;
  height: auto;
}
.event-field {
  margin-top: 16px;
}
#events .panel {
  margin: 24px 0;
}
#events .button {
  margin: 8px 8px 8px 0;
}
#events p {
  overflow-wrap: anywhere;
  white-space: pre-line;
}
#events summary {
  cursor: pointer;
}
