@font-face {
  font-family: "Pretendard";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Pretendard";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Pretendard";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --accent: #6c47ff;
  --accent-strong: #4f29e0;
  --accent-soft: #f0ecff;
  --accent-line: #d8cfff;
  --warm: #ff7c3a;
  --ink: #1a1a2e;
  --text: #2e3340;
  --muted: #8b929c;
  --line: #e4e8ef;
  --soft-line: #f0f2f7;
  --page: #f4f5fb;
  --card: #ffffff;
  --field: #f6f7fb;
  --danger: #f53b3b;
  --focus: 0 0 0 3px rgba(108, 71, 255, .22);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html,
body {
  min-width: 320px;
  background: var(--page);
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Pretendard", "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

.container {
  min-height: 100vh;
  background: var(--page);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 68px;
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto minmax(160px, 1fr);
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  background: linear-gradient(105deg, #1a1040 0%, #2a1b6e 60%, #1e1650 100%);
  border-bottom: 2px solid rgba(108, 71, 255, .45);
  box-shadow: 0 6px 24px rgba(30, 14, 80, .28);
}

.header-brand,
.header-actions,
.mode-tabs,
.q-type-btn,
.pill-btn,
.nav-btn,
.period-pill,
.setting-switch,
.result-filter button,
.result-summary,
.q-card__bottom,
.q-option-row,
.table-toolbar {
  display: flex;
  align-items: center;
}

.header-brand {
  gap: 10px;
  min-width: 0;
}

.header-brand__mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ff7c3a 0%, #ffc355 100%);
  box-shadow: 0 2px 10px rgba(255, 124, 58, .45), inset 0 -4px 0 rgba(0, 0, 0, .12);
  position: relative;
}

.header-brand__mark::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 5px;
  right: 5px;
  bottom: 9px;
  background: rgba(255, 255, 255, .55);
  border-radius: 3px;
}

.header-title {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
}

.mode-tabs {
  align-self: center;
  gap: 4px;
  justify-content: center;
  height: 40px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
}

.mode-tab {
  position: relative;
  height: 30px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(220, 210, 255, .8);
  font-size: 15px;
  font-weight: 700;
  transition: color .18s;
}

.mode-tab.is-active {
  background: linear-gradient(135deg, #8060ff, #6c47ff);
  color: #fff;
  box-shadow: 0 2px 10px rgba(108, 71, 255, .38);
}

.mode-tab.is-active::after {
  display: none;
}

.header-actions {
  justify-content: flex-end;
  gap: 8px;
}

.nav-btn,
.pill-btn,
.plain-btn,
.primary-btn,
.small-btn,
.icon-btn,
.more-btn {
  border: 0;
  border-radius: 6px;
  transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}

.nav-btn {
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.nav-btn--draft {
  background: rgba(255, 255, 255, .14);
  color: #f5f0ff;
}

.nav-btn--view {
  border: 1px solid rgba(255, 255, 255, .18);
  background: transparent;
  color: #f5f0ff;
}

.nav-btn--save,
.primary-btn {
  background: linear-gradient(135deg, #8060ff, #6c47ff);
  color: #fff;
  box-shadow: 0 2px 10px rgba(108, 71, 255, .35);
}

.nav-btn--delete {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .14);
  color: #ddd0ff;
}

.nav-btn:hover,
.primary-btn:hover {
  filter: brightness(1.08);
}

.workspace {
  min-height: calc(100vh - 68px);
  padding: 22px 24px 48px;
  background:
    linear-gradient(180deg, rgba(108, 71, 255, .07), rgba(244, 245, 251, 0) 200px),
    var(--page);
}

.builder-layout {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 302px;
  gap: 18px;
  align-items: start;
}

.editor-column {
  min-width: 0;
}

.form-head,
.settings-panel,
.result-summary,
.result-filter,
.result-card {
  background: var(--card);
  border: 1px solid rgba(108, 71, 255, .10);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(30, 14, 80, .08);
}

.q-card {
  background: var(--card);
  border: 1px solid rgba(108, 71, 255, .10);
  border-radius: 12px;
 /*  border-left: 4px solid var(--accent); */
  box-shadow: 0 4px 20px rgba(30, 14, 80, .08);
}

.form-head {
  overflow: hidden;
}

.cover-box {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 178px;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(135deg, rgba(108, 71, 255, .22) 0%, rgba(255, 124, 58, .18) 100%),
    #f5f2ff;
  background-position: center;
  background-size: cover;
  color: var(--accent-strong);
  overflow: hidden;
  cursor: pointer;
}

.cover-box:hover .cover-box__empty {
  transform: scale(1.04);
}

.cover-box.has-image .cover-box__empty {
  opacity: 0;
}

.cover-box::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(108, 71, 255, .07) 1px, transparent 1px),
    linear-gradient(0deg, rgba(108, 71, 255, .07) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 1;
  pointer-events: none;
}

.cover-box__empty {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border: 1.5px dashed rgba(108, 71, 255, .35);
  border-radius: 10px;
  background: rgba(255, 255, 255, .6);
  backdrop-filter: blur(4px);
  color: var(--accent-strong);
  font-size: 15px;
  font-weight: 700;
  text-shadow: none;
  transition: transform .2s ease;
}

.cover-box__empty svg {
  width: 28px;
  height: 28px;
}

.file-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.saved-cover {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--accent-line);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 600;
}

.saved-cover button {
  border: 1px solid var(--accent-line);
  border-radius: 6px;
  background: #fff;
  color: var(--accent-strong);
  padding: 5px 8px;
  font-size: 12px;
}

.title-card {
  padding: 20px 22px 18px;
}

.meta-title,
.meta-desc,
.q-title-input,
.q-desc-input,
.q-option-input,
.table-input,
.consent-input,
.inline-field input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.meta-title {
  height: 42px;
  font-size: 22px;
  font-weight: 700;
}

.meta-desc {
  display: block;
  min-height: 42px;
  resize: vertical;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: #646b75;
  font-size: 14px;
  line-height: 1.55;
}

.meta-title::placeholder,
.meta-desc::placeholder,
.q-title-input::placeholder,
.q-desc-input::placeholder,
.q-option-input::placeholder,
.table-input::placeholder,
.consent-input::placeholder {
  color: #b4bac3;
}

.period-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 14px;
}

.period-row__label {
  color: #767d86;
  font-size: 13px;
  font-weight: 700;
}

.period-pill {
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
}

.period-pill svg,
.pill-btn svg,
.nav-btn svg,
.icon-btn svg,
.small-btn svg {
  width: 16px;
  height: 16px;
}

.head-actions,
.q-footer {
  display: flex;
  justify-content: center;
  border-top: 1px solid var(--line);
}

.pill-btn {
  justify-content: center;
  gap: 6px;
  min-width: 132px;
  height: 44px;
  margin: 0;
  background: transparent;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
}

.pill-btn:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.builder-questions {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.q-card {
  padding: 18px 18px 0;
}

.q-card__top {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.q-type-btn {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 16px;
  gap: 8px;
  min-width: 178px;
  width: 220px;
  max-width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.q-type-btn svg {
  width: 17px;
  height: 17px;
}

.q-type-btn svg:last-child {
  justify-self: end;
}

.q-type-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.q-title-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 5px;
  align-items: center;
  margin-bottom: 10px;
}

.q-req {
  color: var(--danger);
  font-weight: 700;
}

.q-idx,
.consent-index {
  color: #202124;
  font-size: 16px;
  font-weight: 700;
}

.q-title-input {
  height: 34px;
  font-size: 16px;
  font-weight: 700;
}

.q-desc-input {
  height: 34px;
  margin-bottom: 14px;
  color: #767d86;
  font-size: 14px;
}

.q-divider {
  height: 1px;
  background: var(--line);
  margin: 0 0 14px;
}

.q-options {
  display: grid;
  gap: 8px;
}

.q-option-row {
  gap: 10px;
  min-height: 42px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--field);
  border: 1px solid transparent;
  transition: border-color .15s;
}

.q-option-row:hover {
  border-color: var(--accent-line);
}

.option-dot {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border: 2px solid var(--accent-line);
  border-radius: 50%;
  background: #fff;
}

.q-option-input {
  height: 38px;
  font-size: 14px;
}

.icon-btn {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #9aa0a8;
}

.icon-btn:hover {
  background: #edf1f4;
  color: #4f5661;
}

.option-actions,
.table-actions {
  display: flex;
  gap: 8px;
  padding: 12px 0 2px 26px;
}

.small-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: #66707b;
  font-size: 13px;
  font-weight: 700;
}

.small-btn:hover {
  border-color: #cbd1d8;
  background: #fafbfc;
}

.short-preview,
.long-preview {
  min-height: 42px;
  padding: 12px 14px;
  border-radius: 6px;
  background: var(--field);
  color: #a7adb6;
  font-size: 14px;
}

.long-preview {
  min-height: 116px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.matrix-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  background: #fff;
}

.matrix-table th,
.matrix-table td {
  border: 1px solid var(--line);
  padding: 0;
  text-align: center;
}

.matrix-table th {
  background: var(--accent-soft);
}

.matrix-table th:first-child {
  width: 160px;
  background: #fafbfc;
}

.table-input {
  height: 42px;
  padding: 0 10px;
  text-align: center;
  font-size: 14px;
}

.table-cell-dot {
  display: inline-flex;
  width: 17px;
  height: 17px;
  border: 2px solid #c5cad2;
  border-radius: 50%;
  background: #fff;
}

.table-toolbar {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.table-toolbar strong {
  color: #3b424c;
  font-size: 14px;
}

.participant-options,
.consent-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.radio-chip,
.check-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #525a64;
  font-size: 14px;
  font-weight: 700;
}

.radio-chip input,
.check-chip input {
  accent-color: var(--accent);
}

.participant-preview {
  padding: 12px 14px;
  border-radius: 6px;
  background: var(--field);
  color: #9aa0a8;
  font-size: 14px;
}

.consent-panel {
  display: grid;
  gap: 10px;
}

[data-consent-panel="third"] {
  margin-top: 18px;
}

.consent-title {
  display: flex;
  gap: 6px;
  align-items: center;
  color: #202124;
  font-weight: 700;
}

.consent-row {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--field);
}

.consent-row span {
  color: #59606a;
  font-size: 13px;
  font-weight: 700;
}

.consent-input {
  height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  background: #fff;
}

.q-card__bottom {
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.q-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #59606a;
  font-size: 13px;
  font-weight: 700;
}

.switch {
  position: relative;
  display: inline-flex;
  width: 38px;
  height: 22px;
}

.switch input,
.setting-switch input {
  position: absolute;
  opacity: 0;
}

.switch span,
.setting-switch::after {
  transition: background .16s ease, transform .16s ease;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 11px;
  background: #cfd4db;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform .16s ease;
}

.switch input:checked + span {
  background: var(--accent);
}

.switch input:checked + span::after {
  transform: translateX(16px);
}

.q-card-tools {
  display: flex;
  gap: 4px;
}

/* 카드 드래그 핸들 */
.q-card-grip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 26px;
  height: 38px;
  border-radius: 6px;
  color: #9aa0a8;
  cursor: grab;
  touch-action: none;
  transition: color .15s, background .15s;
}

.q-card-grip:hover {
  color: #60686f;
  background: var(--soft-line);
}

.q-card-grip:active {
  cursor: grabbing;
}

.q-card-grip svg {
  width: 15px;
  height: 15px;
  pointer-events: none;
}

/* 카드 드래그 중 상태 */
.q-card.isCardTouchDragging,
.q-card.isCardDragging {
  opacity: 0.3;
}

.cardDragGhost {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  background: var(--card);
  border: 1px solid var(--accent-line);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(30, 14, 80, .22);
  transform: rotate(1deg) scale(1.01);
  overflow: hidden;
  max-height: 120px;
  opacity: 0.9;
}

.isCardBodyDragging {
  user-select: none;
  cursor: grabbing !important;
}

.settings-panel {
  position: relative;
  top: auto;
  max-height: calc(100vh - 104px);
  overflow: auto;
  padding: 16px 14px;
  align-self: start;
  transform: translateY(var(--settings-y, 0));
  transition: transform .14s ease-out;
  will-change: transform;
  scrollbar-gutter: stable;
}

.settings-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);
}

.settings-title {
  margin: 0;
  color: var(--accent-strong);
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.settings-title::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 16px;
  border-radius: 4px;
  background: linear-gradient(180deg, #8060ff, var(--accent));
}

.settings-sheet-close {
  display: none;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  align-items: center;
  justify-content: center;
}

.settings-sheet-close svg {
  width: 17px;
  height: 17px;
}

.mobile-settings-fab,
.mobile-settings-backdrop {
  display: none;
}

.setting-group {
  padding: 17px 0;
  border-bottom: 1px solid var(--soft-line);
}

.setting-group h2 {
  margin: 0 0 10px;
  color: #3b424c;
  font-size: 14px;
  font-weight: 700;
}

.setting-switch {
  position: relative;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding-right: 48px;
}

.setting-switch strong {
  display: block;
  color: #3f4650;
  font-size: 13px;
  font-weight: 700;
}

.setting-switch small {
  display: block;
  margin-top: 3px;
  color: #a0a6af;
  font-size: 11px;
  line-height: 1.45;
}

.setting-switch::before {
  content: "";
  position: absolute;
  right: 0;
  top: 11px;
  width: 38px;
  height: 22px;
  border-radius: 11px;
  background: #cfd4db;
}

.setting-switch::after {
  content: "";
  position: absolute;
  right: 19px;
  top: 14px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
}

.setting-switch:has(input:checked)::before {
  background: var(--accent);
}

.setting-switch:has(input:checked)::after {
  transform: translateX(16px);
}

.inline-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  color: #8f96a0;
  font-size: 12px;
}

.inline-field input {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.type-popover-backdrop[hidden],
.type-popover[hidden],
.modal[hidden],
.is-hidden {
  display: none !important;
}

.type-popover-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
}

.type-popover {
  position: fixed;
  z-index: 80;
  width: 360px;
  padding: 10px;
  border: 1px solid #dce1e7;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(25, 31, 40, .16);
}

.type-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: #fff;
  color: #3f4650;
  text-align: left;
  font-size: 14px;
  font-weight: 700;
}

.type-item:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.type-item__icon {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.type-item__icon svg {
  width: 17px;
  height: 17px;
}

.type-item small {
  display: block;
  margin-top: 2px;
  color: #f2a600;
  font-size: 11px;
}

.type-popover__divider {
  height: 1px;
  margin: 8px 0;
  background: var(--line);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 25, 30, .38);
}

.period-modal {
  position: relative;
  width: min(520px, 100%);
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .24);
}

.period-modal__head,
.period-modal__foot {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.period-modal__head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
}

.period-modal__body {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.period-block h3 {
  margin: 0 0 10px;
  color: #3b424c;
  font-size: 14px;
  font-weight: 700;
}

.radio-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  color: #525a64;
  font-size: 14px;
  font-weight: 600;
}

.radio-line input {
  accent-color: var(--accent);
}

.period-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.period-fields input {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #414852;
  padding: 0 10px;
}

.period-fields.is-disabled {
  opacity: .45;
  pointer-events: none;
}

.period-modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.plain-btn,
.primary-btn {
  height: 38px;
  min-width: 78px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 700;
}

.plain-btn {
  background: #eef1f4;
  color: #4f5661;
}

.result-view {
  width: min(980px, 100%);
  margin: 0 auto;
}

.result-summary {
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
}

.status-chip {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.result-summary h1 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
}

.result-summary p {
  margin: 8px 0 0;
  color: #8b929c;
  font-size: 13px;
}

.more-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #9aa0a8;
}

.result-tabs {
  display: flex;
  gap: 18px;
  margin-top: 18px;
}

.result-tab {
  position: relative;
  border: 0;
  background: transparent;
  color: #a0a6af;
  font-size: 13px;
  font-weight: 700;
  padding: 0 0 10px;
}

.result-tab.is-active {
  color: var(--accent);
}

.result-tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent);
}

.result-filter {
  justify-content: space-between;
  margin-top: 8px;
  padding: 10px 16px;
}

.result-filter button {
  gap: 4px;
  border: 0;
  background: transparent;
  color: #3f4650;
  font-size: 13px;
  font-weight: 700;
}

.result-stats {
  display: flex;
  gap: 16px;
  margin: 16px 0 8px;
  color: #767d86;
  font-size: 13px;
  font-weight: 700;
}

.result-stats strong {
  color: var(--accent);
}

.result-list {
  display: grid;
  gap: 12px;
}

.result-card {
  padding: 18px;
}

.result-card__meta {
  margin-bottom: 10px;
  color: #767d86;
  font-size: 12px;
  font-weight: 700;
}

.result-card h2 {
  margin: 0 0 12px;
  color: #202124;
  font-size: 16px;
  font-weight: 700;
}

.result-body {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.donut {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) 0deg, var(--accent) 360deg);
  display: grid;
  place-items: center;
}

.donut::after {
  content: "0";
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--accent);
  font-weight: 700;
}

.result-bars {
  display: grid;
  gap: 10px;
}

.result-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  color: #3f4650;
  font-size: 13px;
  font-weight: 700;
}

.bar-track {
  height: 8px;
  border-radius: 4px;
  background: #edf0f4;
  overflow: hidden;
}

.bar-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
}

.result-empty {
  margin: 30px 0 0;
  padding: 24px;
  border: 1px dashed #cbd1d8;
  border-radius: 8px;
  background: #fff;
  color: #8b929c;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
}

.public-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 52px;
  background: linear-gradient(105deg, #1a1040 0%, #2a1b6e 60%, #1e1650 100%);
  border-bottom: 2px solid rgba(108, 71, 255, .4);
  box-shadow: 0 4px 16px rgba(26, 16, 64, .28);
}

.public-header__inner {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 14px;
}

.public-header__mark {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: linear-gradient(135deg, #ff7c3a 0%, #ffc355 100%);
  box-shadow: 0 2px 8px rgba(255, 124, 58, .40);
  flex: 0 0 auto;
}

.public-header__name {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.public-view {
  min-height: calc(100vh - 52px);
  padding: 28px 14px 64px;
  background:
    linear-gradient(180deg, #1e1550 0, var(--page) 140px),
    var(--page);
}

.public-shell {
  width: min(720px, 100%);
  margin: 0 auto;
}

.public-cover,
.public-form-card,
.public-q-card,
.public-empty {
  background: #fff;
  border: 1px solid rgba(108, 71, 255, .10);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(26, 16, 64, .10);
}

.public-cover {
  min-height: 204px;
  background-position: center;
  background-size: cover;
  overflow: hidden;
}

.public-cover--empty {
  position: relative;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(108, 71, 255, .30) 0%, rgba(255, 124, 58, .22) 100%),
    #f5f2ff;
  color: #1a1040;
  font-size: 20px;
  font-weight: 700;
  overflow: hidden;
}

.public-cover--empty::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(108, 71, 255, .09) 1px, transparent 1px),
    linear-gradient(0deg, rgba(108, 71, 255, .09) 1px, transparent 1px);
  background-size: 34px 34px;
}

.public-cover--empty::after {
  content: "";
  position: absolute;
  bottom: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255, 124, 58, .15);
  pointer-events: none;
}

.public-cover--empty span {
  position: relative;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 0 22px;
  border: 1.5px solid rgba(108, 71, 255, .22);
  border-radius: 999px;
  background: rgba(255, 255, 255, .78);
  backdrop-filter: blur(6px);
  font-size: 16px;
  letter-spacing: -.01em;
}

.public-form-card,
.public-q-card {
  margin-top: 12px;
  padding: 20px;
 /*  border-left: 4px solid var(--accent); */
}

.public-form-card--head h1,
.public-empty h1 {
  margin: 0;
  color: #2d243f;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.35;
}

.public-form-card--head p,
.public-empty p {
  margin: 10px 0 0;
  color: #646b75;
  font-size: 14px;
  line-height: 1.6;
}

.public-period {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 600;
}

.public-period strong {
  color: var(--ink);
  font-weight: 700;
}

.public-q-card__meta {
  display: inline-flex;
  align-items: center;
  margin-bottom: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
}

.public-q-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.45;
}

.public-q-card h2 span {
  color: var(--danger);
}

.public-q-desc,
.public-muted {
  margin: 8px 0 0;
  color: #767d86;
  font-size: 14px;
  line-height: 1.55;
}

.public-options {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.public-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: #fafbff;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}

.public-option:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 2px 12px rgba(108, 71, 255, .10);
}

.public-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.public-option input {
  accent-color: var(--accent);
}

.public-option--consent {
  margin-top: 8px;
}

.public-input,
.public-textarea {
  width: 100%;
  margin-top: 16px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fafbff;
  color: var(--text);
  outline: 0;
  font-size: 14px;
  transition: border-color .16s, box-shadow .16s;
}

.public-input:focus,
.public-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108, 71, 255, .14);
}

.public-input {
  height: 46px;
  padding: 0 14px;
}

.public-textarea {
  min-height: 130px;
  padding: 12px 14px;
  resize: vertical;
}

.public-table-wrap {
  overflow-x: auto;
  margin-top: 16px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
}

.public-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  background: #fff;
}

.public-table th,
.public-table td {
  height: 48px;
  padding: 10px;
  border: 1px solid var(--line);
  color: #414852;
  font-size: 14px;
  text-align: center;
}

.public-table th {
  background: linear-gradient(135deg, var(--accent-soft), #ede8ff);
  font-weight: 700;
  color: var(--accent-strong);
}

.public-table-radio {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.public-table-radio input {
  accent-color: var(--accent);
}

.public-consent {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.public-consent__box {
  padding: 14px;
  border-radius: 6px;
  background: #f7f8fa;
}

.public-consent__box strong {
  display: block;
  margin-bottom: 8px;
  color: #202124;
  font-size: 14px;
}

.public-consent__box p {
  margin: 4px 0;
  color: #68717d;
  font-size: 13px;
  line-height: 1.45;
}

.public-submit {
  width: 100%;
  height: 54px;
  margin-top: 16px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #8060ff 0%, #6c47ff 50%, #5534e8 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .01em;
  box-shadow: 0 6px 20px rgba(108, 71, 255, .38);
  transition: filter .18s, transform .14s, box-shadow .18s;
}

.public-submit:hover {
  filter: brightness(1.08);
  box-shadow: 0 8px 28px rgba(108, 71, 255, .48);
}

.public-submit:active {
  transform: translateY(1px);
  box-shadow: 0 4px 14px rgba(108, 71, 255, .32);
}

.public-complete {
  margin-top: 14px;
  padding: 18px 20px;
  border: 1.5px solid var(--accent-line);
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 4px 16px rgba(108, 71, 255, .10);
}

.public-empty {
  width: min(560px, 100%);
  margin: 80px auto 0;
  padding: 28px;
  text-align: center;
}

input:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline: 0;
  box-shadow: var(--focus);
}

@media (max-width: 1024px) {
  .app-header {
    grid-template-columns: 1fr;
    height: auto;
    padding: 12px 18px 0;
  }

  .header-brand,
  .header-actions {
    justify-content: center;
  }

  .mode-tabs {
    order: 3;
    height: 48px;
  }

  .mode-tab {
    height: 48px;
  }

  .builder-layout {
    grid-template-columns: 1fr;
  }

  .settings-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 120;
    max-height: min(74vh, calc(100dvh - 80px));
    padding: 18px 16px 24px;
    border-radius: 18px 18px 0 0;
    overflow: auto;
    transform: translateY(105%) !important;
    transition: transform .24s ease;
    box-shadow: 0 -20px 50px rgba(35, 28, 50, .22);
  }

  .settings-panel.is-mobile-open {
    transform: translateY(0) !important;
  }

  .settings-sheet-close {
    display: inline-flex;
  }

  .mobile-settings-fab {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 90;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 128px;
    height: 46px;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 12px 28px rgba(124, 58, 237, .28);
  }

  .mobile-settings-fab svg {
    width: 17px;
    height: 17px;
  }

  .mobile-settings-backdrop {
    position: fixed;
    inset: 0;
    z-index: 110;
    display: block;
    background: rgba(24, 20, 34, .42);
    backdrop-filter: blur(2px);
  }

  .mobile-settings-backdrop[hidden] {
    display: none;
  }

  body.settings-sheet-lock {
    overflow: hidden;
  }
}

@media (max-width: 720px) {
  .workspace {
    padding: 14px 10px 34px;
  }

  .cover-box {
    min-height: 136px;
  }

  .title-card,
  .q-card {
    padding-left: 14px;
    padding-right: 14px;
  }

  .period-row,
  .q-card__bottom,
  .table-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .type-popover {
    left: 10px !important;
    right: 10px;
    width: auto;
  }

  .consent-row {
    grid-template-columns: 1fr;
  }

  .result-body {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}
