.auth-page {
  background:
    radial-gradient(1200px 500px at 50% -200px, rgba(37,99,235,.12), transparent),
    #f4f6fb;
  min-height: 100svh;
  width: 100%;
  max-width: 100%;
}

.hidden {
  display: none !important;
}

.auth-wrap {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px 6vw;
  gap: 5px;
}

.auth-card {
  width: min(520px, 92vw);
  background: #ffffff;
  border-radius: 28px;
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.18);
  border: 1px solid #e5e7eb;
  padding: 24px 24px 28px;
  position: relative;
  overflow: visible;
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 160px;
  background: #111111;
  border-radius: 28px;
}

.auth-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.08), transparent 40%),
    radial-gradient(circle at 80% 30%, rgba(255, 255, 255, 0.1), transparent 45%),
    radial-gradient(circle at 40% 70%, rgba(255, 255, 255, 0.05), transparent 50%);
  pointer-events: none;
}

.auth-header {
  position: relative;
  z-index: 1;
  color: #ffffff;
  display: grid;
  gap: 5px;
  padding: 10px 10px 40px;
}

.logo.mark {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  background: #ffffff;
  color: #111111;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.05rem;
}

.auth-header h1 {
  font-size: var(--font-h3);
}

.auth-form {
  position: relative;
  z-index: 1;
  background: #ffffff;
  margin-top: -12px;
  border-radius: 22px;
  padding: 22px;
  display: grid;
  gap: 5px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
}

.auth-form #reset-password {
  margin-top: 20px;
  justify-self: center;
  font-size: 0.75rem;
}

.auth-form label {
  display: grid;
  gap: 5px;
  font-size: var(--font-body);
  color: #667085;
}

.auth-form input {
  padding: 4px 6px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
}

.auth-btn {
  background: var(--accent);
  color: #ffffff;
  padding: 4px 6px;
  border-radius: 12px;
  width: 100%;
}

.auth-footer {
  margin-top: 6px;
  font-size: 0.85rem;
  color: #6b7280;
  text-align: center;
}

.auth-footer a {
  color: #111111;
  font-weight: 600;
  text-decoration: none;
}

.auth-error {
  display: block;
  margin-top: 6px;
  color: #dc2626;
  font-size: 0.85rem;
  text-align: center;
}



.dash-page {
  background: #f4f4f5;
  min-height: 100svh;
  width: 100%;
  max-width: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 5px;
}

.app-logo {
  height: clamp(72px, 7vw, 96px);
  width: auto;
  display: block;
}

.app-logo.compact {
  height: clamp(64px, 6vw, 88px);
}

.app-logo.xl {
  height: clamp(160px, 18vw, 280px);
}

.auth-logo {
  margin-top: 6px;
}

.title-logo {
  height: clamp(32px, 4vw, 48px);
  width: auto;
  display: block;
}

.top-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
}

.workflow-page {
  background: #f4f4f5;
  min-height: 100svh;
}

.workflow-stage {
  position: relative;
  min-height: calc(100svh - 70px);
  overflow: visible;
  background: #f8fafc;
}

.workflow-placeholder {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 40px;
}

.workflow-placeholder-card {
  max-width: 520px;
  text-align: center;
  padding: 36px 38px;
  border-radius: 24px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
}

.workflow-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-weight: 600;
  font-size: 0.9rem;
}

.workflow-placeholder-card h1 {
  margin: 16px 0 8px;
  font-size: var(--font-h1);
}

.workflow-placeholder-card p {
  margin: 0;
  color: #64748b;
}

.workflow-canvas {
  position: absolute;
  width: 1400px;
  height: 600px;
  transform: translate(0, 0);
  cursor: grab;
}

.workflow-canvas.dragging {
  cursor: grabbing;
}

.workflow-lines {
  position: absolute;
  inset: 0;
  stroke: #cbd5f5;
  stroke-width: 3;
  fill: none;
}

.workflow-node {
  position: absolute;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 6px 10px;
  box-shadow: var(--shadow);
}

.workflow-node.start,
.workflow-node.end {
  background: #111827;
  color: #ffffff;
  border: none;
}

.public-page {
  background: #f8fafc;
}

.public-wrap {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px 6vw;
  width: 100%;
  max-width: 100%;
}

.public-card {
  width: min(720px, 92vw);
  background: #ffffff;
  border-radius: 24px;
  padding: 32px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  display: grid;
  gap: 24px;
}

.public-slide {
  display: grid;
  gap: 5px;
  position: relative;
}

.public-slide .next-btn {
  position: absolute;
  right: 0;
  bottom: 0;
  border: none;
  background: #111111;
  color: #ffffff;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  cursor: pointer;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 26px 32px;
  border-bottom: 1px solid var(--line);
  background: #f7f7f7;
  position: sticky;
  top: 0;
  z-index: 20;
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 0.95rem;
  flex: 1;
}

.crumbs .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #9ca3af;
  display: inline-block;
}

.crumbs .sep {
  opacity: 0.6;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.save-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #ecfeff;
  color: #0f766e;
  font-size: 0.75rem;
}

.publish-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: #ffedd5;
  color: #c2410c;
  font-size: 0.8rem;
  font-weight: 700;
}

.top-actions .btn.primary {
  padding: 14px 20px;
  font-size: 1rem;
  line-height: 1;
}

.left-panel #add-ending,
.right-panel #add-media,
.right-panel #option-add-btn {
  background: var(--accent);
  color: #ffffff;
  border: none;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.25);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 22px 32px;
  background: #f7f7f7;
  border-bottom: 1px solid var(--line);
}

.brand-page {
  background: radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.15), transparent 45%),
    radial-gradient(circle at 80% 10%, rgba(249, 115, 22, 0.2), transparent 50%),
    #f8fafc;
  min-height: 100svh;
  width: 100%;
  max-width: 100%;
}

.brand-main {
  padding: 40px 32px 70px;
}

.brand-hero {
  position: relative;
  overflow: visible;
}

.brand-glow {
  position: absolute;
  inset: -40%;
  background: conic-gradient(from 120deg, rgba(37, 99, 235, 0.2), rgba(249, 115, 22, 0.25), rgba(14, 165, 233, 0.18), transparent 70%);
  filter: blur(80px);
  animation: glowShift 12s ease-in-out infinite;
  pointer-events: none;
}

.brand-card {
  position: relative;
  background: #ffffff;
  border-radius: 28px;
  padding: 34px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.12);
  border: 1px solid #e5e7eb;
}

.brand-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.brand-header h1 {
  margin: 0 0 6px;
}

.brand-badge {
  background: #eef2ff;
  color: #4338ca;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 600;
}

.brand-badge.pulse {
  box-shadow: 0 0 0 10px rgba(79, 70, 229, 0.12);
  transition: box-shadow 0.6s ease;
}

.brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 28px;
  margin-top: 26px;
}

.brand-panel {
  background: #f8fafc;
  border-radius: 20px;
  padding: 6px;
  border: 1px solid #e5e7eb;
}

.brand-panel h3 {
  margin-top: 0;
}

.brand-field {
  display: flex;
  justify-content: space-between;
  padding: 4px 6px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  margin-bottom: 16px;
}

.brand-logo {
  display: grid;
  gap: 16px;
}

.logo-preview {
  width: 160px;
  height: 160px;
  border-radius: 26px;
  background: #eef2ff;
  color: #4f46e5;
  display: grid;
  place-items: center;
  font-weight: 700;
  background-size: cover;
  background-position: center;
  box-shadow: 0 16px 40px rgba(37, 99, 235, 0.2);
}

.logo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.brand-ideas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 26px;
}

.account-page .dash-main {
  padding: 32px 32px 70px;
}

.account-header {
  margin-bottom: 20px;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.account-free-usage {
  margin-bottom: 18px;
}

.account-free-usage .account-card {
  display: grid;
  gap: 14px;
}

.account-free-usage-subtitle {
  margin: 0;
  color: #52525b;
  font-size: 1.03rem;
}

.account-free-usage-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 1.1rem;
}

.account-free-usage-track {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.account-free-usage-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.25s ease, background-color 0.25s ease;
}

.account-free-usage-fill.is-empty {
  background: transparent;
}

.account-free-usage-fill.is-active {
  background: #3d67ff;
}

.account-free-usage-fill.is-limit {
  background: #dc2626;
}

.account-free-usage-reset {
  margin: 0;
  color: #52525b;
}

.dash-free-usage {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #bae6fd;
  background: #f0f9ff;
  display: grid;
  gap: 10px;
}

.dash-free-usage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dash-free-usage-head p {
  margin: 0;
  font-weight: 600;
  color: #0c4a6e;
}

.dash-free-usage-track {
  height: 10px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.dash-free-usage-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: #4bc2fc;
  transition: width 0.25s ease, background-color 0.25s ease;
}

.dash-free-usage-count {
  margin: 0;
  color: #0c4a6e;
  font-weight: 700;
}

.dash-free-usage.is-limit {
  border-color: #fecaca;
  background: #fef2f2;
}

.dash-free-usage.is-limit .dash-free-usage-head p,
.dash-free-usage.is-limit .dash-free-usage-count {
  color: #991b1b;
}

.dash-free-usage.is-limit .dash-free-usage-fill {
  background: #dc2626;
}

.account-card {
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid var(--line);
  padding: 18px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.account-card h2,
.account-card h3 {
  margin-top: 0;
}

.account-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  margin-top: 10px;
}

.account-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.account-unpaid {
  margin-top: 12px;
  border: 1px solid #fca5a5;
  background: #fef2f2;
  border-radius: 14px;
  padding: 12px;
}

.account-unpaid-title {
  margin: 0;
  color: #991b1b;
  font-weight: 700;
}

.account-unpaid-desc {
  margin: 6px 0 10px;
  color: #7f1d1d;
  font-size: 0.92rem;
}

#upgrade-to-pro,
#go-pro-editor,
#mobile-go-pro-editor {
  background: #4bc2fc !important;
  border-color: #4bc2fc !important;
  color: #ffffff !important;
}

#upgrade-to-pro:hover,
#go-pro-editor:hover,
#mobile-go-pro-editor:hover {
  background: #36b7f7 !important;
  border-color: #36b7f7 !important;
}

.soon-card {
  border-style: dashed;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.soon-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.soon-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c;
  font-weight: 700;
  font-size: 0.8rem;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
}

.layout {
  display: grid;
  grid-template-columns:
    minmax(280px, 360px)
    minmax(0, 1fr)
    minmax(300px, 380px);
  gap: 20px;
  padding: 30px 32px 50px;
  max-width: 100%;
}

.left-panel,
.right-panel {
  background: linear-gradient(180deg, #ffffff 0%, #f4f7ff 100%);
  border-radius: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding: 6px;
  min-height: calc(100svh - 200px);
  overflow: auto;
  gap: 22px;
}

.center-panel {
  display: grid;
  gap: 16px;
}

.canvas {
  background: var(--card);
  border-radius: 20px;
  border: 1px solid var(--line);
  min-height: calc(100svh - 380px);
  display: grid;
  justify-items: center;
  align-items: start;
  box-shadow: var(--shadow);
  position: relative;
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.canvas-content {
  text-align: center;
  max-width: 980px;
  display: grid;
  gap: 16px;
  font-size: 1.3rem;
  margin: 0 auto;
  padding: 250px 24px 120px;
}

.canvas-content h1 {
  font-size: var(--font-h1);
}

.canvas-content h2 {
  font-size: var(--font-h2);
}

.canvas .btn.primary {
  font-size: 1.05rem;
  padding: 14px 22px;
}

.canvas.mobile {
  width: min(430px, 90vw);
  min-height: clamp(520px, 70vh, 720px);
  max-height: clamp(720px, 90vh, 1000px);
  margin: 0 auto;
  border-radius: 36px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.15);
  padding: 0;
  justify-items: center;
  align-items: center;
}

.canvas.mobile .canvas-content {
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
}

.canvas:not(.mobile) .canvas-content {
  max-width: 980px;
}

.canvas.desktop-scale #canvas-body.welcome-layout {
  transform: none;
}

#canvas-body.welcome-layout {
  max-width: 720px;
  gap: 5px;
}

#canvas-body.welcome-layout .type-badge {
  font-size: 0.75rem;
  padding: 5px 10px;
}

#canvas-body.welcome-layout h1 {
  font-size: var(--font-h1);
}

#canvas-body.welcome-layout p,
#canvas-body.welcome-layout small {
  font-size: var(--font-body);
}

#canvas-body.welcome-layout .meta-badge {
  font-size: 0.8rem;
  padding: 6px 12px;
}

#canvas-body.welcome-layout .btn.primary {
  justify-self: center;
  width: auto;
  min-width: 220px;
  padding: 6px 10px;
  font-size: 1rem;
}

.canvas.desktop-scale .canvas-content h1 {
  font-size: var(--font-h1);
}

.canvas.desktop-scale .canvas-content p,
.canvas.desktop-scale .canvas-content small {
  font-size: var(--font-body);
}

.right-panel .settings {
  display: grid;
  gap: 20px;
}

.canvas-question h2 {
  font-size: var(--font-h2);
}

.canvas-question small {
  color: var(--muted);
}

.canvas.has-image {
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: visible;
}

.canvas.has-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.7);
}

.canvas.has-image .canvas-content {
  position: relative;
  z-index: 1;
}

.preview-mode .left-panel,
.preview-mode .right-panel,
.preview-mode .toolbar,
.preview-mode .topbar {
  display: none;
}

.preview-mode .layout {
  grid-template-columns: 1fr;
  padding-top: 40px;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #111827;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(17, 24, 39, 0.2);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 30;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.publish-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 24, 0.4);
  display: grid;
  place-items: center;
  z-index: 5000;
}

.publish-modal.hidden {
  display: none;
}

.publish-card {
  width: min(520px, 92vw);
  background: #ffffff;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 30px 80px rgba(17, 24, 39, 0.25);
  border: 1px solid var(--line);
  display: grid;
  gap: 5px;
}

.share-card {
  width: min(860px, 94vw);
  max-height: min(86vh, 860px);
  padding: 24px;
  gap: 10px;
  overflow: auto;
}

.publish-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.publish-link {
  display: flex;
  gap: 5px;
}

.publish-link input {
  flex: 1;
  padding: 4px 6px;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.publish-actions {
  display: flex;
  justify-content: flex-end;
}

.publish-actions.unpaid-actions {
  gap: 12px;
}

.share-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.share-tab {
  border: 1px solid var(--line);
}

.share-tab.active {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
}

.share-panels {
  display: grid;
  gap: 14px;
  margin-top: 6px;
}

.share-quota-warning {
  margin-top: 4px;
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #9f1239;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.92rem;
  font-weight: 600;
}

.share-panel {
  display: grid;
  gap: 12px;
}

.share-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
}

.code-copy-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 8px;
  background: #fcfcfd;
}

.code-copy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.code-copy-area {
  width: 100%;
  min-height: 130px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.82rem;
  line-height: 1.4;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  resize: vertical;
}

.share-instruction {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  padding: 10px 12px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 24, 0.4);
  display: grid;
  place-items: center;
  z-index: 40;
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: min(1080px, 92vw);
  background: var(--card);
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 30px 80px rgba(17, 24, 39, 0.25);
  border: 1px solid var(--line);
  display: grid;
  gap: 16px;
}

.modal-card-small {
  width: min(560px, 92vw);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.modal-tabs {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.modal-tabs .tab {
  border: none;
  background: #f3f4f6;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.modal-tabs .tab.active {
  background: linear-gradient(120deg, #6d5bff, #ff6b6b);
  color: #ffffff;
}

.modal-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
}

.modal-left h4 {
  margin: 16px 0 10px;
  font-size: var(--font-h4);
  color: var(--muted);
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.modal-col {
  display: grid;
  gap: 5px;
}

.modal-col h5 {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 2px;
}

.modal-col:nth-child(1) .element {
  background: #ffe4ea;
}

.modal-col:nth-child(2) .element {
  background: #e8f1ff;
}

.modal-col:nth-child(3) .element {
  background: #e9f7ef;
}

.modal-col:nth-child(4) .element {
  background: #fff3d6;
}

.modal-col:nth-child(5) .element {
  background: #ede9fe;
}

.modal-col:nth-child(6) .element {
  background: #e0f2fe;
}

.modal-left .pill.ghost {
  background: #fef3c7;
  border: 1px solid #fde68a;
}

.workflow {
  padding: 30px 24px 60px;
}

.workflow-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.workflow-grid {
  display: grid;
  grid-template-columns: 260px 1fr 280px;
  gap: 20px;
}

.flow-left,
.flow-right {
  background: var(--card);
  border-radius: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: grid;
  gap: 5px;
  min-height: calc(100svh - 240px);
  overflow: auto;
}

.flow-list {
  display: grid;
  gap: 5px;
}

.flow-item {
  padding: 4px 6px;
  border-radius: 12px;
  background: #f7f7f7;
  cursor: pointer;
}

.flow-item.active {
  background: #e7efff;
  border: 1px solid #c7d8ff;
}

.flow-canvas {
  background: var(--card);
  border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  min-height: 520px;
  display: grid;
  place-items: center;
  gap: 16px;
  padding: 6px;
}

.flow-node {
  background: #f3f4f6;
  border-radius: 10px;
  padding: 10px 14px;
  border: 1px solid #e5e7eb;
}

.flow-node.start,
.flow-node.end {
  background: #111827;
  color: #ffffff;
  border: none;
}

.canvas-question {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.canvas-question .choice-item {
  border: 1px solid #c7d8ff;
  background: #eef4ff;
  border-radius: 10px;
  padding: 4px 6px;
  cursor: pointer;

  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
}

.canvas-question .choice-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
}

.plans-page {
  background: radial-gradient(circle at 15% 20%, rgba(47, 107, 255, 0.18), transparent 45%),
    radial-gradient(circle at 80% 12%, rgba(14, 165, 233, 0.2), transparent 42%),
    radial-gradient(circle at 70% 80%, rgba(249, 115, 22, 0.2), transparent 50%),
    #f8fafc;
  font-size: 18px;
}

.plans-hero {
  padding: 32px 8vw 40px;
}

.plans-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.plans-nav-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.plans-hero-content {
  margin-top: 40px;
  max-width: 820px;
  display: grid;
  gap: 5px;
}

.plans-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.8rem;
  font-weight: 700;
  color: #111827;
}

.plans-hero h1 {
  font-size: var(--font-h1);
  line-height: 1.1;
}

.plans-hero p {
  color: #4b5563;
  font-size: var(--font-body);
}

.plans-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.plans-badge {
  border-radius: 999px;
  padding: 6px 10px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  font-weight: 600;
  font-size: 0.9rem;
}

.plans-main {
  padding: 0 8vw 80px;
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
}

.plans-bottom {
  margin-top: 40px;
  display: grid;
  gap: 8px;
}

.plans-strip {
  background: #111827;
  color: #ffffff;
  border-radius: 28px;
  padding: 26px 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.plans-strip p {
  font-size: var(--font-body);
}

.plans-faq {
  display: grid;
  gap: 5px;
}

.plans-faq h3 {
  font-size: var(--font-h3);
}

.plans-faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.plans-faq-item {
  background: #ffffff;
  border-radius: 18px;
  padding: 6px;
  border: 1px solid #e5e7eb;
}

.dash-actions-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--accent);
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 12px;
  cursor: pointer;
}

.auth-page .ghost {
  border: 0px solid var(--line);
}


.dash-topbar {
  position: relative;
}

/* =============================== */
/* Mobile Questions Panel (bottom) */
/* =============================== */

@media (max-width: 768px),
 (max-width: 1024px) and (orientation: portrait) {
  .left-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: -100%;
    top: auto;
    width: 100%;
    height: 80vh;
    background: #fff;
    z-index: 300;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.15);
    transition: bottom 0.3s ease;
    overflow-y: auto;
  }

  /* panneau ouvert */
  .left-panel.panel-open {
    bottom: 0;
  }

  /* petit handle pour UX */
  .left-panel::before {
    content: "";
    width: 40px;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    display: block;
    margin: 8px auto;
  }
}

/* ========================= */
/* Mobile editor bottom bar */
/* ========================= */

/* ========================= */
/* Mobile / Tablet editor bar */
/* ========================= */

@media (max-width: 1024px) {
  .mobile-editor-bar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(env(safe-area-inset-bottom) + 12px);

    height: 64px;
    background: #ffffff;
    border-radius: 20px;

    display: flex;
    justify-content: space-around;
    align-items: center;

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    z-index: 999;
  }


  .mobile-btn {
    background: none;
    border: none;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    font-size: 12px;
    color: var(--text);
    gap: 4px;

    /* 🔥 ZONE DE CLIC ÉLARGIE */
    min-width: 88px;
    min-height: 64px;
    padding: 10px 12px;

    /* UX mobile */
    touch-action: manipulation;
  }


  .mobile-btn.primary {
    /* ⛔ annule l’héritage du bouton standard */
    min-width: 0;
    min-height: 0;
    padding: 0;
    flex-direction: row;

    /* ✅ vrai bouton rond */
    width: 56px;
    height: 56px;
    aspect-ratio: 1 / 1;

    border-radius: 50%;
    background: var(--accent);
    color: #ffffff;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 26px;
    line-height: 1;

    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
  }
}



/* =============================== */
/* Mobile Options Panel (Bottom Sheet) */
/* =============================== */

@media (max-width: 768px),
 (max-width: 1024px) and (orientation: portrait) {
  .right-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: -100%;
    height: 80vh;
    background: #ffffff;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    box-shadow: 0 -8px 24px rgba(0,0,0,0.12);
    transition: bottom 0.3s ease;
    z-index: 300;
    overflow-y: auto;
  }

  .right-panel.panel-open {
    bottom: 0;
  }

  /* Drag handle */
  .right-panel::before {
    content: "";
    display: block;
    width: 36px;
    height: 4px;
    background: #ccc;
    border-radius: 4px;
    margin: 8px auto 12px;
  }
}

/* ========================= */
/* Mobile top-right menu */
/* ========================= */

@media (max-width: 768px),
 (max-width: 1024px) and (orientation: portrait) {

  .mobile-menu-card {
    background: #ffffff;
    padding: 18px;
    border-radius: 0 0 22px 22px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.2);
    animation: slideDown 0.28s cubic-bezier(.4,0,.2,1);
  }

  .mobile-menu-header {
    display: flex;
    justify-content: center;
    padding-bottom: 12px;
  }

  .mobile-logo {
    height: 28px;
    opacity: 0.9;
  }

  .mobile-menu-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
  }

  .mobile-menu-section:last-child {
    margin-bottom: 0;
  }

  .pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
  }

  .pill.primary {
    background: #ff6a00;
    color: #fff;
  }

  .pill.ghost {
    background: #f1f5f9;
    color: #0f172a;
  }

  .pill.ghost:active {
    background: #e2e8f0;
  }

  .publish-badge {
    align-self: center;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #ecfeff;
    color: #0f766e;
  }


  @keyframes slideDown {
    from {
      transform: translateY(-110%);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
}

@media (max-width: 768px),
 (max-width: 1024px) and (orientation: portrait) {
  .mobile-menu-toggle {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 16px);
    right: 16px;

    width: 46px;
    height: 46px;

    border-radius: 14px;
    font-size: 22px;

    background: var(--accent);
    color: #ffffff;
    border: none;

    display: flex;
    align-items: center;
    justify-content: center;

    box-shadow: 0 8px 22px rgba(0,0,0,0.25);
    z-index: 1400;
  }
}

@media (max-width: 768px),
 (max-width: 1024px) and (orientation: portrait) {
  .mobile-top-menu {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(6px);
    z-index: 1300;

    display: flex;
    justify-content: center;
    align-items: flex-start;
  }

  .mobile-menu-card {
    width: 100%;
    height: 60dvh; /* 🔥 60% écran */
    background: #ffffff;

    border-radius: 0 0 28px 28px;
    padding: 28px 20px 24px;

    box-shadow: 0 30px 80px rgba(0,0,0,0.25);
    overflow-y: auto;

    display: flex;
    flex-direction: column;
  }


  .mobile-top-menu.hidden {
    display: none;
  }
}

@media (max-width: 768px),
 (max-width: 1024px) and (orientation: portrait) {
  .mobile-menu-header {
    display: flex;
    justify-content: center;
    padding: 10px 0 24px;
  }

  .mobile-logo {
    height: 112px; /* x4 */
    width: auto;
  }
}

@media (max-width: 768px),
 (max-width: 1024px) and (orientation: portrait) {
  .mobile-menu-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 22px;
  }

  .mobile-menu-section:last-child {
    margin-bottom: 0;
  }
}

@media (max-width: 768px),
 (max-width: 1024px) and (orientation: portrait) {
  .mobile-menu-card button,
  .mobile-menu-card a {
    height: 52px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 500;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #f1f5f9;
    border: none;
  }

  .mobile-menu-card button:active {
    background: #e2e8f0;
  }

  .pill.primary {
    background: var(--accent);
    color: #ffffff;
  }
}

@media (max-width: 768px),
 (max-width: 1024px) and (orientation: portrait) {
  .publish-badge,
  .status {
    background: #ffedd5;   /* orange clair */
    color: #c2410c;        /* orange foncé */
    font-weight: 700;
  }
}

@media (max-width: 768px),
 (max-width: 1024px) and (orientation: portrait) {
  .mobile-menu-card a[href*="forfaits"] {
    background: var(--accent); /* BLEU */
    color: #ffffff;
    font-weight: 600;
  }

  .mobile-menu-card a[href*="forfaits"]:active {
    background: #1e4ed8;
  }
}
@media (max-width: 768px),
 (max-width: 1024px) and (orientation: portrait) {
  .mobile-back-btn {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 16px);
    left: 16px;

    width: 46px;
    height: 46px;

    border-radius: 14px;
    font-size: 22px;

    background: #ffffff;
    color: #0f172a;
    border: 1px solid var(--line);

    display: flex;
    align-items: center;
    justify-content: center;

    box-shadow: 0 8px 22px rgba(0,0,0,0.18);
    z-index: 1400;
  }

  .mobile-back-btn:active {
    background: #f1f5f9;
  }
}

@media (max-width: 768px),
 (max-width: 1024px) and (orientation: portrait) {
  /* Bouton Publier */
  #mobile-publish {
    background: #ff6a00; /* ORANGE desktop */
    color: #ffffff;
  }

  #mobile-publish:active {
    background: #e65d00;
  }
}

/* Caché sur desktop ET tablette paysage */
@media (min-width: 769px) and (orientation: landscape) {
  .mobile-menu-toggle,
  .mobile-top-menu {
    display: none;
  }
}

/* =========================
   MOBILE CLEAN MODE
   ========================= */
@media (max-width: 768px),
 (max-width: 1024px) and (orientation: portrait) {

  /* Header desktop */
  .topbar {
    display: none !important;
  }

  /* Toolbar desktop */
  .toolbar {
    display: none !important;
  }



  /* View toggle desktop */
  .view-toggle {
    display: none !important;
  }
} /* ========================= */

@media (max-width: 768px),
 (max-width: 1024px) and (orientation: portrait) {

  main.layout {
    margin: 0;
    padding: 0;
    height: 100dvh;
    overflow: hidden;
  }

  .center-panel {
    width: 100%;
    height: 100%;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* important */
    overflow: hidden;
  }

  .canvas {
    width: 100%;
    max-width: 100vw;          /* 🔥 empêche le débordement */
    height: 100%;
    border-radius: 0;
    overflow-x: hidden;
    display: flex;
    overscroll-behavior: contain;
    touch-action: pan-y;
    justify-content: center;   /* 🔥 centre le contenu */
    transform-origin: center top;
  }

  /* ⚠️ ON NE TOUCHE PAS AU CONTENU */
}

@media (max-width: 768px),
 (max-width: 1024px) and (orientation: portrait) {
  .canvas {
    position: relative;
    z-index: 1;
  }
}

@media (max-width: 768px),
 (max-width: 1024px) and (orientation: portrait) {
  .canvas {
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }
}


@media (max-width: 768px),
 (max-width: 1024px) and (orientation: portrait) {
  .left-panel,
  .right-panel {
    padding-bottom: 120px;
  }
}

.left-panel .question-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;

  padding: 16px 18px 24px; /* 🔥 RESPIRATION */
}

.right-panel .settings {
  flex: 1;
  min-height: 0;
  overflow-y: auto;

  padding: 18px 18px 28px; /* 🔥 RESPIRATION */
}

.left-panel .panel-title {
  padding: 16px 18px 14px;   /* haut | côtés | bas */
  margin: 0;

  text-align: left;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;

  background: transparent;
  border: none;
  cursor: text;

  word-break: break-word;
}

.left-panel .panel-title {
  box-shadow: inset 0 -1px 0 var(--line);
}

@media (max-width: 768px),
 (max-width: 1024px) and (orientation: portrait) {
  html,
  body {
    touch-action: manipulation;
    overscroll-behavior: none;
    position: fixed;
    width: 100%;
    height: 100%;
  }
}


/* ❌ Cache la barre mobile sur desktop ET tablette paysage */
@media (min-width: 769px) and (orientation: landscape) {
  .mobile-editor-bar {
    display: none !important;
  }
}

/* ❌ Cache le bouton retour sur desktop + tablette paysage */
@media (min-width: 769px) and (orientation: landscape) {
  .mobile-back-btn {
    display: none !important;
  }
}
