:root {
  --bg: #f6f7f4;
  --panel: #ffffff;
  --text: #1d2420;
  --muted: #66736d;
  --line: #d8ded8;
  --primary: #176b4d;
  --primary-dark: #0e4d38;
  --warn: #9b5b00;
  --danger: #a53030;
  --blue: #285f91;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Tahoma, Arial, Helvetica, sans-serif;
}

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

button {
  border: 0;
  cursor: pointer;
}

.shell {
  min-height: 100vh;
}

.topbar {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 42px);
  position: sticky;
  top: 0;
  z-index: 4;
}

.brand {
  align-items: center;
  display: flex;
  gap: 10px;
  font-weight: 800;
}

.mark {
  align-items: center;
  background: var(--primary);
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}

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

.nav button,
.secondary,
.ghost {
  background: #eef2ee;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  min-height: 38px;
  padding: 8px 12px;
}

.nav button.active,
.primary {
  background: var(--primary);
  border-radius: 8px;
  color: #fff;
  min-height: 40px;
  padding: 9px 14px;
}

.danger {
  background: #f7e8e8;
  color: var(--danger);
}

.main {
  margin: 0 auto;
  max-width: 1180px;
  padding: 24px clamp(14px, 4vw, 42px) 56px;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.two {
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.section-title {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}

h1,
h2,
h3 {
  letter-spacing: 0;
  line-height: 1.15;
  margin: 0;
}

h1 {
  font-size: clamp(28px, 6vw, 46px);
}

h2 {
  font-size: 22px;
}

h3 {
  font-size: 17px;
}

p {
  color: var(--muted);
  line-height: 1.55;
  margin: 8px 0 0;
}

label {
  color: #34413b;
  display: grid;
  font-size: 13px;
  font-weight: 700;
  gap: 6px;
}

input,
textarea,
select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  min-height: 42px;
  padding: 10px 12px;
  width: 100%;
}

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

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

.fields.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.check-row {
  align-items: center;
  display: flex;
  gap: 10px;
}

.check-row input {
  min-height: 0;
  width: auto;
}

.survey-list {
  display: grid;
  gap: 10px;
}

.survey-item {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 14px;
}

.pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 9px;
}

.pill.published {
  background: #dff3e8;
  color: var(--primary-dark);
}

.pill.draft {
  background: #eceff3;
  color: #46515c;
}

.pill.closed,
.pill.archived {
  background: #f7e8e8;
  color: var(--danger);
}

.question-box,
.option-row {
  background: #f8faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.option-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero {
  background: linear-gradient(135deg, #174c3a 0%, #1f7050 58%, #e4ede6 58%, #f6f7f4 100%);
  color: #fff;
  padding: clamp(28px, 7vw, 64px) clamp(16px, 5vw, 56px);
}

.hero-inner {
  max-width: 980px;
  position: relative;
}

.hero p {
  color: #e8f2ec;
  max-width: 680px;
}

.public-admin-link {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.public-admin-link a {
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  min-height: 36px;
  padding: 8px 11px;
  text-decoration: none;
}

.public-admin-link a:hover {
  background: rgba(255, 255, 255, 0.2);
}

.survey-page {
  margin: 0 auto;
  max-width: 780px;
  padding: 18px clamp(12px, 4vw, 24px) 42px;
}

.status-line {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 14px;
  gap: 10px;
  margin-top: 14px;
}

.answer {
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  padding: 12px;
}

.answer input {
  margin-top: 4px;
  min-height: 0;
  width: auto;
}

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

.bar span {
  background: var(--blue);
  display: block;
  height: 100%;
}

.message {
  border-radius: 8px;
  margin: 12px 0;
  padding: 12px;
}

.message.ok {
  background: #e1f2e8;
  color: var(--primary-dark);
}

.message.error {
  background: #f8e6e6;
  color: var(--danger);
}

.suggestion-panel {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 14px;
}

.suggestion-row {
  align-items: center;
  background: #f8faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 12px;
}

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

.small {
  font-size: 13px;
}

.developer-footer {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  gap: 6px;
  justify-content: center;
  padding: 18px 14px 28px;
}

.developer-footer a,
.developer-credit a {
  color: var(--primary-dark);
  font-weight: 800;
  text-decoration: none;
}

.developer-footer a:hover,
.developer-credit a:hover {
  text-decoration: underline;
}

.developer-credit {
  border-top: 1px solid var(--line);
  font-size: 13px;
  margin-top: 18px;
  padding-top: 12px;
}

@media (max-width: 820px) {
  .grid.two,
  .fields.two {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .survey-item,
  .option-row,
  .suggestion-row {
    grid-template-columns: 1fr;
  }

  .hero {
    background: #174c3a;
  }
}
