@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@500;600;700&family=Karla:wght@400;500;700&display=swap');

:root {
  --accent: #c1622d;
  --accent2: oklch(58% 0.07 130);
  --bg: oklch(97% 0.016 80);
  --ink: oklch(28% 0.03 50);
  --ink-soft: oklch(42% 0.02 50);
  --ink-softer: oklch(45% 0.02 50);
  --card: oklch(100% 0 0 / 0.55);
  --border: oklch(82% 0.02 60);
  --dash: oklch(78% 0.03 60);
}

/* min-width: 0 overrides the default flex/grid item "min-width: auto",
   which otherwise floors an item at its unwrapped text width and is the
   classic cause of a flex child (a long choice option, a long label next
   to a fixed-width control, etc.) silently pushing the page wider than
   the screen instead of wrapping its text. Safe everywhere else too -
   it only relaxes a flex/grid-specific floor, it doesn't force anything
   to shrink that isn't already under layout pressure. */
* { box-sizing: border-box; min-width: 0; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
}

body {
  font-family: 'Karla', ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  line-break: normal;
  overflow-wrap: break-word;
  word-break: break-word;
  position: relative;
  overflow-x: hidden;
  width: 100%;
}

.display { font-family: 'Quicksand', ui-rounded, system-ui, sans-serif; }

a { color: var(--accent); text-decoration: none; }

.blob {
  position: fixed;
  width: 340px;
  height: 340px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.22;
}

.tap { cursor: pointer; transition: transform 0.08s ease; }
.tap:active { transform: scale(0.97); }

.page {
  position: relative;
  z-index: 2;
  max-width: 560px;
  margin: 0 auto;
  padding: 28px 22px 60px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.brand-name {
  font-family: 'Quicksand', sans-serif;
  font-size: 21px;
  font-weight: 700;
  color: var(--ink);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Quicksand', sans-serif;
  font-size: 13px;
  font-weight: 700;
}

.card {
  background: var(--card);
  border-radius: 18px;
  padding: 18px 20px;
  margin-bottom: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--accent);
  color: white;
  font-family: 'Quicksand', sans-serif;
  font-size: 16px;
  font-weight: 700;
  padding: 14px 22px;
  min-height: 46px;
  box-sizing: border-box;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  text-align: center;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn.secondary {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}

.btn.small {
  font-size: 14.5px;
  padding: 10px 16px;
  min-height: 40px;
}

.pill-tabs {
  display: flex;
  gap: 6px;
  background: oklch(100% 0 0 / 0.5);
  border-radius: 999px;
  padding: 5px;
  margin-bottom: 20px;
}
.pill-tab {
  flex: 1;
  text-align: center;
  padding: 13px 9px;
  min-height: 46px;
  box-sizing: border-box;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-soft);
}
.pill-tab.active { background: white; color: var(--accent); }

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.choice-opt {
  flex: 1;
  min-width: 96px;
  max-width: 100%;
  text-align: center;
  padding: 13px;
  min-height: 46px;
  box-sizing: border-box;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: oklch(100% 0 0 / 0.4);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: break-word;
  word-break: break-word;
}
.choice-opt.selected { background: var(--accent); border-color: var(--accent); color: white; }

input[type="text"], input[type="email"], input[type="password"], textarea, select {
  width: 100%;
  border: 1.5px dashed var(--dash);
  border-radius: 16px;
  padding: 13px 14px;
  font-size: 16px;
  margin-bottom: 12px;
  outline: none;
  background: oklch(99% 0.008 80 / 0.6);
  color: var(--ink);
  font-family: 'Karla', sans-serif;
}
textarea { resize: vertical; min-height: 80px; }

.other-input { margin-top: 2px; }

.label-sm {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.muted { color: var(--ink-softer); font-size: 14.5px; }

.error-box {
  background: oklch(94% 0.06 30);
  color: oklch(38% 0.15 25);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14.5px;
  margin-bottom: 12px;
}

.status-chip {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  flex-shrink: 0;
  white-space: nowrap;
}
.status-chip.live { color: oklch(42% 0.12 150); background: oklch(94% 0.06 150); }
.status-chip.draft { color: oklch(45% 0.02 50); background: oklch(92% 0.01 60); }

.bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.bar-track { flex: 1; height: 8px; background: oklch(92% 0.01 60); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--accent); }
.bar-fill.alt { background: var(--accent2); }

.star-row { display: flex; gap: 8px; margin-bottom: 16px; }
.star {
  font-size: 34px;
  cursor: pointer;
  color: oklch(85% 0.02 60);
}
.star.filled { color: var(--accent); }

.quote {
  border-left: 2.5px solid var(--accent);
  padding-left: 12px;
  font-size: 14.5px;
  line-height: 1.5;
  color: oklch(30% 0.02 50);
  font-style: italic;
  margin-bottom: 10px;
}

.link-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: oklch(100% 0 0 / 0.5);
  border-radius: 999px;
  padding: 8px 8px 8px 16px;
  margin-top: 10px;
}
.link-box input {
  flex: 1;
  border: none;
  background: transparent;
  margin: 0;
  padding: 4px;
  font-size: 14.5px;
}

.share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  min-height: 40px;
  box-sizing: border-box;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: oklch(100% 0 0 / 0.4);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
}

.preview-banner {
  background: oklch(94% 0.06 80);
  color: oklch(38% 0.1 60);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13.5px;
  line-height: 1.4;
  margin-bottom: 18px;
}

.question-row {
  background: oklch(100% 0 0 / 0.5);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.remove-btn {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 999px;
  border: none;
  background: oklch(94% 0.02 60);
  color: var(--ink-soft);
  font-size: 17px;
  cursor: pointer;
}

.row-actions { display: flex; gap: 6px; flex-shrink: 0; }

.icon-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 999px;
  border: none;
  background: oklch(94% 0.02 60);
  color: var(--ink-soft);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn.edit-active { background: var(--accent); color: white; }

.q-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent2);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 3px;
}

.q-label { font-size: 15.5px; font-weight: 600; margin-bottom: 2px; }

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 4px 2px 14px;
  border-bottom: 1px dashed var(--dash);
  margin-bottom: 14px;
}
.toggle-copy { flex: 1; }
.toggle-title { font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.toggle-sub { font-size: 13.5px; color: var(--ink-softer); line-height: 1.4; }

.toggle-switch {
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: oklch(88% 0.02 60);
  flex-shrink: 0;
  border: none;
  cursor: pointer;
  padding: 0;
}
.toggle-switch.on { background: var(--accent); }
.toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: white;
  box-shadow: 0 1px 2px oklch(30% 0 0 / 0.25);
  transition: left 0.15s ease;
}
.toggle-switch.on .toggle-knob { left: 21px; }

.edit-panel {
  border: 1.5px dashed var(--accent);
  background: oklch(97% 0.03 60 / 0.55);
  border-radius: 16px;
  padding: 14px 16px 16px;
  margin-bottom: 10px;
}
.edit-panel .label-sm { color: var(--accent); }
.edit-panel input, .edit-panel textarea { margin-bottom: 10px; }
.edit-actions { display: flex; gap: 8px; margin-top: 2px; }

.back-link {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--accent);
  padding: 8px 0;
  cursor: pointer;
}

.center-note {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-softer);
}

/* ---------------------------------------------------------------
   Responsive layout
   Base styles above are tuned for a phone-width column (.page maxes
   out at 560px). These breakpoints keep small phones comfortable,
   let the same column breathe a bit on tablets, and keep it from
   feeling like a lonely strip on a full desktop monitor without
   turning it into an unreadable full-width block of text.
   --------------------------------------------------------------- */

/* Small phones: tighten the outer gutter so content isn't cramped */
@media (max-width: 380px) {
  .page {
    padding: 20px 16px 48px;
  }
  .card {
    padding: 16px 16px;
  }
}

/* Tablets and up: give the column a little more room to breathe */
@media (min-width: 640px) {
  .page {
    max-width: 640px;
    padding-top: 36px;
  }
  .brand-name { font-size: 22px; }
}

/* Desktop and up: widen further, but keep line lengths readable
   rather than stretching to the full viewport width */
@media (min-width: 1024px) {
  body {
    display: flex;
    justify-content: center;
  }
  .page {
    max-width: 720px;
    padding-top: 44px;
    padding-bottom: 72px;
  }
  .card {
    padding: 20px 24px;
  }
  .btn {
    cursor: pointer;
  }
  .btn:hover { filter: brightness(0.94); }
  .btn.secondary:hover { background: oklch(97% 0.01 60); }
  .choice-opt:not(.selected):hover { border-color: var(--accent); }
  .share-btn:hover, .icon-btn:hover { filter: brightness(0.96); }
}
