@import url('https://fonts.googleapis.com/css2?family=Amaranth:wght@400;700&family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500&display=swap');

/* ── Design tokens ──────────────────────────────────────────── */
:root {
  --teal:       #2BBDA4;
  --teal-deep:  #1E9B85;
  --teal-dim:   rgba(43,189,164,.12);
  --ink:        #0E1B18;
  --ink-soft:   #4A5B57;
  --ink-muted:  #7A9490;
  --paper:      #F5F9F8;
  --paper-raised:#FFFFFF;
  --paper-mid:  #EDF4F2;
  --line:       #DDE8E5;
  --line-soft:  #EBF2F0;
  --tg:         #229ED9;
  --wa:         #25D366;
  --red:        #E5534B;
  --amber:      #D97706;

  --bg:         var(--paper);
  --bg-raised:  var(--paper-raised);
  --bg-mid:     var(--paper-mid);
  --text:       var(--ink);
  --text-soft:  var(--ink-soft);
  --text-muted: var(--ink-muted);
  --border:     var(--line);
  --border-soft:var(--line-soft);
  --shadow-sm:  0 1px 2px rgba(14,27,24,.04);
  --shadow:     0 1px 2px rgba(14,27,24,.05), 0 2px 6px -3px rgba(14,27,24,.06);
  --radius:     10px;
  --radius-lg:  14px;
  --sidebar-w:  240px;
}

[data-theme="dark"] {
  --ink:         #E8F2EF;
  --ink-soft:    #90ADA8;
  --ink-muted:   #5C7A74;
  --paper:       #0B1614;
  --paper-raised:#0F1F1C;
  --paper-mid:   #132420;
  --line:        #1E3530;
  --line-soft:   #172B27;
  --teal-dim:    rgba(43,189,164,.10);
  --shadow-sm:   0 1px 2px rgba(0,0,0,.14);
  --shadow:      0 1px 3px rgba(0,0,0,.16), 0 3px 8px -4px rgba(0,0,0,.2);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
.mono { font-family: 'JetBrains Mono', monospace; }

/* ── Brand ──────────────────────────────────────────────────── */
.brand { display: flex; align-items: center; gap: 8px; }
.brand img { height: 28px; width: auto; }
.brand-word {
  font-family: 'Amaranth', cursive;
  font-size: 20px;
  font-weight: 700;
}
.brand-word .w1 { color: var(--text); }
.brand-word .w2 { color: var(--teal); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: var(--radius); font-weight: 600; font-size: 13.5px;
  border: 1px solid transparent; transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap; line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn-solid  { background: var(--teal); color: #04231C; border-color: var(--teal); }
.btn-solid:hover { background: var(--teal-deep); color: #fff; border-color: var(--teal-deep); }
.btn-ghost  { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-mid); }
.btn-danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-icon {
  width: 34px; height: 34px; padding: 0; border-radius: var(--radius);
  background: transparent; border: 1px solid transparent; color: var(--text-soft);
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: var(--bg-mid); color: var(--text); border-color: var(--border); }
.btn-icon svg { width: 16px; height: 16px; }
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ── Form controls ──────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text); }
.field .hint  { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.field .error-text { font-size: 12px; color: var(--red); display: none; }
.field.invalid .error-text { display: block; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--red) !important; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="url"], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg-raised); color: var(--text);
  font-size: 14px; outline: none; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--teal); }
textarea { resize: vertical; min-height: 80px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234A5B57' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.35);
  z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-raised); border-radius: var(--radius-lg);
  border: 1px solid var(--border); width: 100%; max-width: 480px;
  padding: 28px; transform: translateY(10px); transition: transform .2s;
  max-height: 90vh; overflow-y: auto;
}
.modal-backdrop.open .modal { transform: translateY(0); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; gap: 12px; }
.modal-header h3 { font-size: 16px; font-weight: 700; margin: 0; }
.modal-close { background: none; border: none; padding: 4px; color: var(--text-soft); margin: -4px; }
.modal-close:hover { color: var(--text); }
.modal-close svg { width: 18px; height: 18px; }
.modal-body { display: flex; flex-direction: column; gap: 16px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.modal-wide { max-width: 640px; }

/* ── Dropdown menu ──────────────────────────────────────────── */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 4px; min-width: 180px;
  z-index: 100; opacity: 0; pointer-events: none;
  transform: translateY(-4px); transition: opacity .15s, transform .15s;
}
.dropdown-menu.open { opacity: 1; pointer-events: all; transform: translateY(0); }
.dropdown-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px;
  border-radius: 7px; font-size: 13.5px; color: var(--text); cursor: pointer;
  background: none; border: none; width: 100%; text-align: left;
}
.dropdown-item:hover { background: var(--bg-mid); }
.dropdown-item.danger { color: var(--red); }
.dropdown-item svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--text-muted); }
.dropdown-item.danger svg { color: var(--red); }
.dropdown-sep { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Toast ──────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 500;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  background: var(--ink); color: var(--paper);
  padding: 11px 16px; border-radius: var(--radius); font-size: 13.5px;
  font-weight: 500; pointer-events: all; opacity: 0;
  transform: translateX(20px); transition: opacity .2s, transform .2s;
  max-width: 320px;
}
[data-theme="dark"] .toast { background: var(--paper-raised); color: var(--text); border: 1px solid var(--border); }
.toast.show { opacity: 1; transform: translateX(0); }
.toast.success::before { content: "✓ "; color: var(--teal); }
.toast.error::before   { content: "✕ "; color: var(--red); }

/* ── Error banner ───────────────────────────────────────────── */
.error-banner {
  background: rgba(229,83,75,.08); border: 1px solid rgba(229,83,75,.25);
  color: var(--red); padding: 10px 14px; border-radius: var(--radius);
  font-size: 13px; display: none;
}

/* ── Pill / badge ───────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
}
.pill-wa  { background: rgba(37,211,102,.12); color: #18a057; }
.pill-tg  { background: rgba(34,158,217,.12); color: #1478a8; }
.pill-both{ background: var(--teal-dim); color: var(--teal-deep); }
[data-theme="dark"] .pill-wa  { color: #25D366; }
[data-theme="dark"] .pill-tg  { color: #229ED9; }
[data-theme="dark"] .pill-both{ color: var(--teal); }

/* ── Avatar ─────────────────────────────────────────────────── */
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--teal-dim); color: var(--teal-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 56px 24px; text-align: center; gap: 12px;
}
.empty-state svg { color: var(--text-muted); opacity: .5; }
.empty-state h4 { font-size: 15px; font-weight: 600; margin: 0; }
.empty-state p  { font-size: 13.5px; color: var(--text-soft); margin: 0; max-width: 280px; }

/* ════════════════════════════════════════════════════════════
   AUTH PAGE  (login.html)
═══════════════════════════════════════════════════════════════ */
.auth-page {
  min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg);
}
.auth-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 32px; border-bottom: 1px solid var(--border);
}
.auth-main {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px;
}
.auth-card h1 { font-size: 22px; font-weight: 800; margin: 0 0 6px; }
.auth-card .sub { font-size: 13.5px; color: var(--text-soft); margin: 0 0 24px; }
.auth-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.auth-tab {
  flex: 1; padding: 10px; background: none; border: none;
  font-size: 13.5px; font-weight: 600; color: var(--text-soft);
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s;
}
.auth-tab.active { color: var(--teal); border-bottom-color: var(--teal); }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-submit { width: 100%; margin-top: 4px; padding: 11px; }
.auth-foot { text-align: center; font-size: 13px; color: var(--text-soft); margin-top: 16px; }
.auth-foot a { color: var(--teal); font-weight: 600; }

/* OTP panel */
.otp-panel { text-align: center; }
.otp-icon { color: var(--teal); margin-bottom: 16px; }
.otp-panel h1 { font-size: 20px; margin: 0 0 8px; }
.otp-panel .sub { font-size: 13.5px; color: var(--text-soft); margin: 0 0 24px; line-height: 1.6; }
.otp-inputs { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 20px; }
.otp-digit {
  width: 46px; height: 52px; text-align: center; font-size: 22px; font-weight: 700;
  border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--bg-raised);
  color: var(--text); transition: border-color .15s;
}
.otp-digit:focus { border-color: var(--teal); outline: none; }
.otp-sep { font-size: 18px; color: var(--text-muted); margin: 0 2px; }
.otp-resend { font-size: 13px; color: var(--text-soft); margin-top: 16px; }
.link-btn { background: none; border: none; color: var(--teal); font-weight: 600; font-size: inherit; padding: 0; }
.link-btn:disabled { color: var(--text-muted); }

/* ════════════════════════════════════════════════════════════
   APP SHELL  (dashboard, form builder)
═══════════════════════════════════════════════════════════════ */
.app-shell { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* Top bar */
.app-topbar {
  height: 52px; display: flex; align-items: center;
  padding: 0 16px; gap: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised); flex-shrink: 0; z-index: 40;
}
.topbar-brand { margin-right: 8px; }
.topbar-sep { width: 1px; height: 20px; background: var(--border); margin: 0 2px; }
.topbar-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topbar-user {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 8px 4px 4px; border-radius: var(--radius);
  background: none; border: 1px solid transparent; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.topbar-user:hover { background: var(--bg-mid); border-color: var(--border); }
.topbar-user .name { font-size: 13px; font-weight: 600; }
.topbar-user .username { font-size: 11.5px; color: var(--text-muted); }

/* Body split */
.app-body { display: flex; flex: 1; overflow: hidden; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  border-right: 1px solid var(--border); background: var(--bg-raised);
  display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden;
}
.sidebar-section { padding: 12px 8px 4px; }
.sidebar-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-muted);
  padding: 0 8px; margin-bottom: 4px;
}
.sidebar-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 8px; font-size: 13.5px;
  color: var(--text-soft); cursor: pointer; background: none;
  border: none; width: 100%; text-align: left; transition: background .12s, color .12s;
}
.sidebar-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.sidebar-item:hover { background: var(--bg-mid); color: var(--text); }
.sidebar-item.active { background: var(--teal-dim); color: var(--teal-deep); font-weight: 600; }
[data-theme="dark"] .sidebar-item.active { color: var(--teal); }
.sidebar-ws-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-badge {
  margin-left: auto; background: var(--teal-dim); color: var(--teal-deep);
  font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 999px;
}
.sidebar-add {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 10px; border-radius: 8px; font-size: 13px;
  color: var(--text-muted); cursor: pointer; background: none;
  border: 1px dashed var(--border); width: 100%; margin-top: 4px;
  transition: border-color .15s, color .15s;
}
.sidebar-add:hover { border-color: var(--teal); color: var(--teal); }
.sidebar-footer { margin-top: auto; padding: 8px; border-top: 1px solid var(--border); }

/* Main content */
.app-main { flex: 1; overflow-y: auto; }

/* ── Dashboard ──────────────────────────────────────────────── */
.dash-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 28px 32px 20px; border-bottom: 1px solid var(--border);
}
.dash-header h2 { font-size: 20px; font-weight: 800; margin: 0; }
.dash-header p  { font-size: 13.5px; color: var(--text-soft); margin: 4px 0 0; }
.dash-body { padding: 24px 32px; }

/* Workspace card */
.ws-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.ws-card {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px; display: flex; flex-direction: column;
  gap: 14px; transition: border-color .15s; cursor: pointer;
}
.ws-card:hover { border-color: var(--teal); }
.ws-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.ws-card-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--teal-dim); color: var(--teal-deep);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
[data-theme="dark"] .ws-card-icon { color: var(--teal); }
.ws-card-icon svg { width: 20px; height: 20px; }
.ws-card h4 { font-size: 15px; font-weight: 700; margin: 0 0 4px; }
.ws-card .meta { font-size: 12px; color: var(--text-muted); }
.ws-card .desc { font-size: 13px; color: var(--text-soft); line-height: 1.5; }
.ws-card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 8px; border-top: 1px solid var(--border-soft); }
.ws-card-stats { font-size: 12px; color: var(--text-muted); display: flex; gap: 12px; }
.ws-card-id { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-muted); }

/* Form list (inside workspace) */
.form-list { display: flex; flex-direction: column; gap: 1px; }
.form-row {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border-radius: var(--radius); background: var(--bg-raised);
  border: 1px solid var(--border); transition: border-color .15s;
}
.form-row:hover { border-color: var(--teal); }
.form-row-icon {
  width: 36px; height: 36px; border-radius: 8px; background: var(--bg-mid);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  color: var(--text-soft);
}
.form-row-icon svg { width: 17px; height: 17px; }
.form-row-info { flex: 1; min-width: 0; }
.form-row-name { font-size: 14px; font-weight: 600; color: var(--text); }
.form-row-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; font-family: 'JetBrains Mono', monospace; }
.form-row-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

/* Member chip */
.member-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.member-row:last-child { border-bottom: none; }
.member-info { flex: 1; }
.member-name { font-size: 13.5px; font-weight: 600; }
.member-username { font-size: 12px; color: var(--text-muted); }
.role-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.role-owner { background: var(--teal-dim); color: var(--teal-deep); }
.role-member { background: var(--bg-mid); color: var(--text-muted); }
[data-theme="dark"] .role-owner { color: var(--teal); }

/* ── Form Builder ───────────────────────────────────────────── */
.builder-shell { display: flex; height: 100%; }

/* Left panel — questions list */
.builder-left {
  width: 280px; flex-shrink: 0; border-right: 1px solid var(--border);
  background: var(--bg-raised); display: flex; flex-direction: column; overflow: hidden;
}
.builder-left-head {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.builder-left-head h4 { font-size: 13.5px; font-weight: 700; margin: 0; }
.q-list { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.q-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border-radius: 8px; cursor: pointer; border: 1px solid transparent;
  background: none; text-align: left; width: 100%; transition: background .12s;
  color: var(--text);
}
.q-item:hover { background: var(--bg-mid); }
.q-item.active { background: var(--teal-dim); border-color: rgba(43,189,164,.2); }
.q-item-icon { width: 28px; height: 28px; border-radius: 7px; background: var(--bg-mid); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--text-soft); }
.q-item.active .q-item-icon { background: rgba(43,189,164,.15); color: var(--teal-deep); }
[data-theme="dark"] .q-item.active .q-item-icon { color: var(--teal); }
.q-item-icon svg { width: 14px; height: 14px; }
.q-item-label { flex: 1; min-width: 0; }
.q-item-type  { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.q-item-title { font-size: 13px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-item-drag  { color: var(--text-muted); opacity: 0; cursor: grab; }
.q-item:hover .q-item-drag { opacity: 1; }
.q-item-drag svg { width: 14px; height: 14px; }

/* Add question button area */
.builder-add-q { padding: 8px; border-top: 1px solid var(--border); }
.add-q-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; padding: 9px; border-radius: var(--radius);
  background: none; border: 1px dashed var(--border); color: var(--text-soft);
  font-size: 13px; font-weight: 600; cursor: pointer; transition: border-color .15s, color .15s;
}
.add-q-btn:hover { border-color: var(--teal); color: var(--teal); }

/* Center — editor canvas */
.builder-center {
  flex: 1; overflow-y: auto; padding: 32px;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
}
.q-editor-card {
  width: 100%; max-width: 640px; background: var(--bg-raised);
  border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
}
.q-editor-head {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; background: var(--bg-mid);
}
.q-editor-type { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.q-editor-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.q-editor-actions {
  padding: 12px 16px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px; justify-content: flex-end;
}

/* Rich text toolbar */
.rich-toolbar { display: flex; gap: 2px; margin-bottom: 4px; }
.rich-btn {
  width: 28px; height: 28px; border-radius: 6px; background: none;
  border: 1px solid var(--border); color: var(--text-soft); font-size: 13px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background .12s;
}
.rich-btn:hover { background: var(--bg-mid); color: var(--text); }
.rich-btn.active { background: var(--teal-dim); color: var(--teal-deep); border-color: rgba(43,189,164,.25); }
.rich-editor {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 9px 12px; min-height: 60px; outline: none;
  font-size: 13.5px; line-height: 1.5; background: var(--bg-raised); color: var(--text);
}
.rich-editor:focus { border-color: var(--teal); }

/* Phone prefix */
.phone-wrap { display: flex; gap: 8px; }
.phone-prefix { width: 130px; flex-shrink: 0; }

/* Image input */
.img-input-wrap { display: flex; gap: 8px; }
.img-input-wrap input { flex: 1; }

/* Rating preview */
.rating-preview { display: flex; gap: 6px; flex-wrap: wrap; }
.star-btn { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--teal); opacity: .3; transition: opacity .15s; }
.star-btn.lit { opacity: 1; }

/* Choice options */
.choice-options { display: flex; flex-direction: column; gap: 6px; }
.choice-opt-row { display: flex; align-items: center; gap: 8px; }
.choice-opt-row input { flex: 1; }
.choice-remove { background: none; border: none; color: var(--text-muted); padding: 4px; cursor: pointer; }
.choice-remove:hover { color: var(--red); }
.choice-remove svg { width: 14px; height: 14px; }
.add-option-btn { background: none; border: 1px dashed var(--border); border-radius: var(--radius); padding: 7px 12px; font-size: 13px; color: var(--text-soft); cursor: pointer; width: 100%; text-align: left; transition: border-color .15s, color .15s; }
.add-option-btn:hover { border-color: var(--teal); color: var(--teal); }

/* Right panel — form settings */
.builder-right {
  width: 300px; flex-shrink: 0; border-left: 1px solid var(--border);
  background: var(--bg-raised); overflow-y: auto; display: none;
}
.builder-right.open { display: flex; flex-direction: column; }
.settings-head {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.settings-head h4 { font-size: 13.5px; font-weight: 700; margin: 0; }
.settings-body { padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.settings-sep { height: 1px; background: var(--border); }

/* Builder toolbar */
.builder-toolbar {
  display: flex; align-items: center; gap: 8px; padding: 0 16px;
  height: 52px; border-bottom: 1px solid var(--border); background: var(--bg-raised);
}
.builder-toolbar-title { font-size: 14px; font-weight: 700; flex: 1; }
.toolbar-sep { width: 1px; height: 20px; background: var(--border); }

/* Question type picker */
.qtype-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.qtype-btn {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 10px 6px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg-raised); cursor: pointer; text-align: center;
  transition: border-color .15s, background .15s; color: var(--text);
}
.qtype-btn:hover { border-color: var(--teal); background: var(--teal-dim); }
.qtype-btn svg { width: 18px; height: 18px; color: var(--text-soft); }
.qtype-btn:hover svg { color: var(--teal-deep); }
.qtype-btn span { font-size: 11.5px; font-weight: 600; color: var(--text-soft); line-height: 1.2; }
.qtype-btn:hover span { color: var(--teal-deep); }
[data-theme="dark"] .qtype-btn:hover { color: var(--teal); }
[data-theme="dark"] .qtype-btn:hover svg, [data-theme="dark"] .qtype-btn:hover span { color: var(--teal); }

/* Inline toggle */
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.toggle-label { font-size: 13px; color: var(--text); }
.toggle { position: relative; width: 36px; height: 20px; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--border); transition: background .2s; cursor: pointer;
}
.toggle input:checked + .toggle-track { background: var(--teal); }
.toggle-track::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 14px; height: 14px; border-radius: 50%; background: #fff;
  transition: transform .2s;
}
.toggle input:checked + .toggle-track::after { transform: translateX(16px); }

/* Theme toggle button */
.theme-toggle {
  width: 34px; height: 34px; border-radius: var(--radius);
  background: none; border: 1px solid var(--border);
  color: var(--text-soft); display: flex; align-items: center; justify-content: center;
}
.theme-toggle:hover { background: var(--bg-mid); }
.theme-toggle svg { width: 16px; height: 16px; }

/* Responses table */
.resp-table { width: 100%; border-collapse: collapse; }
.resp-table th { font-size: 12px; font-weight: 700; text-align: left; padding: 10px 14px; background: var(--bg-mid); color: var(--text-muted); border-bottom: 1px solid var(--border); }
.resp-table td { padding: 12px 14px; border-bottom: 1px solid var(--border-soft); font-size: 13.5px; vertical-align: top; }
.resp-table tr:last-child td { border-bottom: none; }
.resp-table tr:hover td { background: var(--bg-mid); }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Util */
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.ml-auto { margin-left: auto; }
.text-muted { color: var(--text-muted); }
.text-soft { color: var(--text-soft); }
.text-teal { color: var(--teal); }
.font-mono { font-family: 'JetBrains Mono', monospace; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
