:root {
  --bg: #eef4ff;
  --bg-deep: #dfeaff;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.88);
  --card: rgba(255, 255, 255, 0.74);
  --line: rgba(148, 163, 184, 0.18);
  --line-strong: rgba(148, 163, 184, 0.28);
  --text: #0f172a;
  --muted: #5b6780;
  --primary: #635bff;
  --primary-2: #0ea5e9;
  --primary-dark: #4338ca;
  --danger: #d92d20;
  --success: #0f9f61;
  --shadow-xs: 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow: 0 20px 60px rgba(99, 91, 255, 0.12), 0 12px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 30px 90px rgba(99, 91, 255, 0.14), 0 16px 50px rgba(15, 23, 42, 0.1);
  --radius: 24px;
  --radius-sm: 18px;
  --radius-xs: 14px;
  --content-width: 1120px;
}

* { box-sizing: border-box; }
html {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  font-family: Inter, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(99, 91, 255, 0.16), transparent 30%),
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.14), transparent 28%),
    linear-gradient(180deg, #f9fbff 0%, #eef4ff 34%, #eaf1ff 100%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.011em;
  line-height: 1.5;
  position: relative;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  width: 42vw;
  height: 42vw;
  border-radius: 999px;
  pointer-events: none;
  z-index: -1;
  filter: blur(42px);
  opacity: 0.45;
}

body::before {
  top: -12vw;
  left: -10vw;
  background: radial-gradient(circle, rgba(99, 91, 255, 0.24), transparent 65%);
}

body::after {
  right: -14vw;
  top: 16vh;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.18), transparent 68%);
}

img, svg, table { max-width: 100%; }
a {
  color: inherit;
  text-decoration-color: rgba(99, 91, 255, 0.35);
  text-underline-offset: 0.16em;
}

a:hover {
  text-decoration-color: rgba(99, 91, 255, 0.7);
}

.container {
  width: min(100% - 24px, var(--content-width));
  margin-inline: auto;
}

.page-wrap { padding: 18px 0 38px; }
.narrow { max-width: 680px; }
.stack-lg > * + * { margin-top: 20px; }
.stack-sm > * + * { margin-top: 12px; }
.small {
  font-size: 0.92rem;
  letter-spacing: -0.01em;
}
.muted { color: var(--muted); }
.lead {
  color: var(--muted);
  line-height: 1.68;
  font-size: 1.01rem;
  max-width: 62ch;
}

.site-header {
  background: rgba(249, 251, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.05);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  min-width: 0;
}

.brand__logo {
  width: auto;
  height: 64px;
  max-width: 200px;
  display: block;
  flex: 0 0 auto;
  filter: drop-shadow(0 10px 20px rgba(99, 91, 255, 0.12));
}

.brand__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand__text strong {
  font-size: 1.08rem;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brand__text span {
  font-size: 0.92rem;
  color: var(--muted);
  letter-spacing: -0.015em;
}

.header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.card,
.poll-item,
.option-card,
.result-item {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.68));
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  width: 100%;
  min-width: 0;
  backdrop-filter: blur(18px) saturate(155%);
  -webkit-backdrop-filter: blur(18px) saturate(155%);
}

.card::before,
.poll-item::before,
.option-card::before,
.result-item::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.35), rgba(99,91,255,0.16));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.card::after,
.poll-item::after,
.option-card::after,
.result-item::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 45%;
  background: linear-gradient(180deg, rgba(255,255,255,0.28), transparent 75%);
  pointer-events: none;
  z-index: -1;
}

.login-card { padding: 24px; }

.poll-hero h1,
.card h1 {
  margin: 0 0 12px;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  line-height: 1.06;
  letter-spacing: -0.05em;
  font-weight: 760;
}

.card h2 {
  margin: 0 0 12px;
  font-size: clamp(1.18rem, 2.4vw, 1.5rem);
  line-height: 1.14;
  letter-spacing: -0.04em;
  font-weight: 720;
}

p { margin: 0; }

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 650;
  font-size: 0.95rem;
  color: #162033;
  letter-spacing: -0.02em;
}

input, textarea, button {
  font: inherit;
}

input[type="text"],
input[type="password"],
input[type="date"],
textarea {
  width: 100%;
  max-width: 100%;
  min-height: 50px;
  padding: 13px 15px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 6px 18px rgba(15, 23, 42, 0.035);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease, transform 180ms ease;
}

input::placeholder,
textarea::placeholder {
  color: #8391a7;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(99, 91, 255, 0.45);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 0 0 4px rgba(99, 91, 255, 0.12), 0 10px 30px rgba(99, 91, 255, 0.12);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 16px;
  text-decoration: none;
  border: 1px solid transparent;
  font-weight: 680;
  letter-spacing: -0.02em;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease;
  position: relative;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

button.btn { width: 100%; }

.btn--primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, #5b7cff 52%, var(--primary-2) 100%);
  box-shadow: 0 14px 30px rgba(99, 91, 255, 0.24), inset 0 1px 0 rgba(255,255,255,0.2);
}

.btn--primary:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #546efc 52%, #0284c7 100%);
  box-shadow: 0 18px 40px rgba(99, 91, 255, 0.28), inset 0 1px 0 rgba(255,255,255,0.18);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(148, 163, 184, 0.2);
  box-shadow: var(--shadow-xs);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(99, 91, 255, 0.2);
}

.btn--danger {
  background: rgba(255, 240, 239, 0.76);
  color: var(--danger);
  border-color: rgba(217, 45, 32, 0.16);
}

.alert {
  border-radius: 18px;
  padding: 13px 15px;
  font-weight: 650;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.alert--error {
  background: rgba(255, 242, 240, 0.78);
  color: #9b1c1c;
  border: 1px solid rgba(245, 194, 190, 0.88);
}

.alert--success {
  background: rgba(236, 253, 243, 0.78);
  color: #0d7d4e;
  border: 1px solid rgba(183, 239, 207, 0.92);
}

.pill,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 680;
  font-size: 0.83rem;
  letter-spacing: -0.01em;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.pill {
  background: rgba(239, 244, 255, 0.84);
  color: var(--primary);
  border: 1px solid rgba(99, 91, 255, 0.12);
}

.form-grid,
.admin-grid,
.poll-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.button-row,
.poll-item__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.button-row > *,
.poll-item__actions > * {
  flex: 1 1 180px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 430;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.section-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.share-box {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.poll-list,
.option-list,
.result-list {
  display: grid;
  gap: 14px;
}

.poll-item {
  border: 1px solid rgba(255,255,255,0.82);
  border-radius: 20px;
  padding: 16px;
  display: grid;
  gap: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.82), rgba(255,255,255,0.66));
  box-shadow: var(--shadow-xs);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.poll-page { padding-top: 10px; }

.option-card {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  width: 100%;
  padding: 15px;
  border: 1px solid rgba(255,255,255,0.85);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,255,255,0.72));
  box-shadow: var(--shadow-xs);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.option-card:hover {
  transform: translateY(-1px);
  border-color: rgba(99, 91, 255, 0.24);
  box-shadow: 0 14px 34px rgba(99, 91, 255, 0.11), 0 8px 20px rgba(15, 23, 42, 0.06);
}

.option-card input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--primary);
}

.option-card__content { min-width: 0; }

.option-card__title {
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.option-card__meta {
  color: var(--muted);
  margin-top: 5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.result-item {
  border: 1px solid rgba(255,255,255,0.82);
  border-radius: 20px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.86), rgba(255,255,255,0.68));
  box-shadow: var(--shadow-xs);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

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

.progress {
  margin: 12px 0 12px;
  height: 11px;
  background: rgba(226, 232, 240, 0.78);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #7c8cff 0%, #635bff 52%, #0ea5e9 100%);
  border-radius: inherit;
  box-shadow: 0 0 24px rgba(99, 91, 255, 0.34);
}

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

.chip {
  background: rgba(239, 246, 255, 0.82);
  color: #3154d5;
  border: 1px solid rgba(99, 91, 255, 0.1);
  margin-bottom: 0;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 18px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 680px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255,255,255,0.74);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

th, td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  text-align: left;
  vertical-align: top;
}

th {
  background: rgba(248, 251, 255, 0.78);
  font-weight: 680;
  letter-spacing: -0.02em;
}

tr:last-child td {
  border-bottom: 0;
}

@media (min-width: 760px) {
  .page-wrap { padding: 24px 0 44px; }
  .card { padding: 24px; }
  button.btn { width: auto; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .share-box { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 980px) {
  .admin-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
    align-items: start;
  }

  .poll-layout {
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.8fr);
    align-items: start;
    gap: 24px;
  }

  .sticky-card {
    position: sticky;
    top: 98px;
  }
}

@media (max-width: 640px) {
  .container { width: min(100% - 16px, var(--content-width)); }

  .header-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .brand {
    align-items: center;
padding-left: 8px;
  }

  .brand__text {
    display: none;
  }

  .brand__logo {
    height: 56px;
    max-width: 170px;
  }

  .header-actions > * {
    flex: 1 1 auto;
  }

  .poll-item__actions > *,
  .button-row > * {
    flex-basis: 100%;
  }

  .card,
  .poll-item,
  .result-item,
  .option-card {
    border-radius: 20px;
  }
}

