:root {
  --sidebar-w: 360px;
  --bg-dark: #09111f;
  --bg-panel: #141b2d;
  --bg-border: #2a3547;
  --accent: #f97316;
  --accent-dark: #ea580c;
}

body.builder-studio {
  margin: 0;
  padding: 0;
  height: 100vh;
  overflow: hidden;
  background: linear-gradient(135deg, var(--bg-dark) 0%, #0d1522 100%);
  color: #f8fafc;
  display: flex;
  font-family: 'DM Sans', sans-serif;
}

body.builder-studio.builder-light-mode {
  background: #ffffff;
  color: #0f172a;
}

body.builder-studio.builder-light-mode .preview-header {
  background: #ffffff !important;
  border-bottom-color: #dbe3ef !important;
}

body.builder-studio.builder-light-mode .preview-header .logo {
  color: #0f172a !important;
}

body.builder-studio.builder-light-mode .preview-header .logo .dot {
  color: var(--accent) !important;
}

body.builder-studio .preview-header .logo {
  color: #f8fafc;
}

body.builder-studio .preview-header .logo .logo-tagline {
  color: #94a3b8;
}

body.builder-studio.builder-light-mode .preview-header .logo .logo-tagline {
  color: #64748b !important;
}

body.builder-studio.builder-light-mode .builder-theme-toggle,
body.builder-studio.builder-light-mode .preview-header .btn-ghost {
  background: rgba(15, 23, 42, 0.04) !important;
  color: #0f172a !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
}

body.builder-studio.builder-light-mode .preview-header .btn-ghost:hover {
  background: rgba(15, 23, 42, 0.08) !important;
  border-color: rgba(15, 23, 42, 0.18) !important;
}

body.builder-studio.builder-light-mode .right-sidebar,
body.builder-studio.builder-light-mode .sidebar {
  background: #ffffff !important;
  border-color: #dbe3ef !important;
}

body.builder-studio.builder-light-mode .sidebar-header,
body.builder-studio.builder-light-mode .right-sidebar .sidebar-header {
  background: #f8fafc !important;
  border-color: #dbe3ef !important;
}

body.builder-studio.builder-light-mode .sidebar-header .logo {
  color: #0f172a !important;
}

body.builder-studio.builder-light-mode .sidebar-content label,
body.builder-studio.builder-light-mode .sidebar-content p,
body.builder-studio.builder-light-mode .sidebar-content span,
body.builder-studio.builder-light-mode .panel-section h3,
body.builder-studio.builder-light-mode .tool-group label,
body.builder-studio.builder-light-mode .sidebar-header h3,
body.builder-studio.builder-light-mode .template-item span,
body.builder-studio.builder-light-mode .template-item strong,
body.builder-studio.builder-light-mode .empty-state {
  color: #0f172a !important;
}

body.builder-studio.builder-light-mode .sidebar-content input,
body.builder-studio.builder-light-mode .sidebar-content textarea,
body.builder-studio.builder-light-mode .sidebar-content select,
body.builder-studio.builder-light-mode .right-sidebar input,
body.builder-studio.builder-light-mode .right-sidebar textarea,
body.builder-studio.builder-light-mode .right-sidebar select {
  background: #f8fafc !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

body.builder-studio.builder-light-mode .right-sidebar input::placeholder,
body.builder-studio.builder-light-mode .right-sidebar textarea::placeholder {
  color: #64748b !important;
}

body.builder-studio.builder-light-mode .template-item {
  background: #f8fafc !important;
  border-color: #dbe3ef !important;
}

body.builder-studio.builder-light-mode .template-item:hover,
body.builder-studio.builder-light-mode .template-item.active {
  background: #eef4ff !important;
  border-color: var(--accent) !important;
}

body.builder-studio.builder-light-mode .right-sidebar div[style*="background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(249, 115, 22, 0.05))"] {
  background: #ffffff !important;
  border-color: #dbe3ef !important;
}

body.builder-studio.builder-light-mode .right-sidebar div[style*="background: rgba(255, 255, 255, 0.05)"] {
  background: #f8fafc !important;
}

body.builder-studio.builder-light-mode .right-sidebar div[style*="border: 1px solid rgba(255, 255, 255, 0.1)"] {
  border-color: #cbd5e1 !important;
}

body.builder-studio .preview-area,
body.builder-studio .preview-container {
  background: var(--bg-dark);
}

body.builder-studio.template-picker-active.builder-light-mode .preview-area,
body.builder-studio.template-picker-active.builder-light-mode .preview-container {
  background: #ffffff !important;
}

body.builder-studio.template-picker-active #template-selection {
  background: transparent;
  color: #cbd5e1;
}

body.builder-studio.template-picker-active.builder-light-mode #template-selection {
  background: #ffffff !important;
  color: #0f172a !important;
  border-radius: 16px;
  margin: 0;
}

body.builder-studio.template-picker-active #template-selection h2 {
  color: #cbd5e1 !important;
}

body.builder-studio.template-picker-active.builder-light-mode #template-selection h2 {
  color: #0f172a !important;
}

body.builder-studio.template-picker-active .template-tile {
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 8px 24px rgba(2,6,23,0.5);
}

body.builder-studio.template-picker-active .template-tile iframe {
  background: #0b1220;
}

body.builder-studio.template-picker-active .template-tile > div {
  color: #e6eef8;
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,0.03));
}

body.builder-studio.template-picker-active.builder-light-mode .template-tile {
  background: #ffffff;
  border: 1px solid #dbe3ef;
  box-shadow: 0 8px 24px rgba(15, 35, 86, 0.08);
}

body.builder-studio.template-picker-active.builder-light-mode .template-tile iframe {
  background: #f8fafc;
}

body.builder-studio.template-picker-active.builder-light-mode .template-tile > div {
  color: #0f172a;
  background: linear-gradient(180deg, rgba(255,255,255,0), rgba(248,250,252,0.9));
}

body.builder-studio.builder-light-mode #element-editor-panel {
  background: linear-gradient(135deg, #ffffff, #f8fafc) !important;
  border-color: #dbe3ef !important;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}

body.builder-studio.builder-light-mode #element-editor-panel > div:first-child {
  background: linear-gradient(135deg, #f8fafc, #eef4ff) !important;
  border-bottom-color: #dbe3ef !important;
}

body.builder-studio.builder-light-mode #element-editor-panel #element-editor-content {
  background: #ffffff !important;
  color: #0f172a !important;
}

body.builder-studio.builder-light-mode #element-editor-panel h3,
body.builder-studio.builder-light-mode #element-editor-panel label,
body.builder-studio.builder-light-mode #element-editor-panel input,
body.builder-studio.builder-light-mode #element-editor-panel textarea,
body.builder-studio.builder-light-mode #element-editor-panel select,
body.builder-studio.builder-light-mode #element-editor-panel button {
  color: #0f172a !important;
}

body.builder-studio.builder-light-mode #element-editor-panel input,
body.builder-studio.builder-light-mode #element-editor-panel textarea,
body.builder-studio.builder-light-mode #element-editor-panel select {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

body.builder-studio.builder-light-mode #element-editor-panel input:focus,
body.builder-studio.builder-light-mode #element-editor-panel textarea:focus,
body.builder-studio.builder-light-mode #element-editor-panel select:focus {
  outline: none;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.16) !important;
}

body.builder-studio.builder-light-mode #element-editor-panel label {
  color: #334155 !important;
}

body.builder-studio.builder-light-mode #element-editor-panel button:hover {
  filter: brightness(0.98);
}

body.builder-studio.builder-light-mode #element-editor-panel .btn-primary {
  color: #ffffff !important;
}

body.builder-studio.builder-light-mode #element-editor-panel .btn-ghost {
  color: #0f172a !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
}

.builder-layout {
  display: flex;
  width: 100%;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--bg-panel) 0%, #0f1724 100%);
  border-right: 1px solid var(--bg-border);
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--bg-border);
  background: rgba(255, 255, 255, 0.02);
}

.sidebar-header .logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
}
.sidebar-header .logo svg path[fill="#e2e8f0"] { fill: #fff; }

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.panel-section h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  font-weight: 700;
  color: #cbd5e1;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.item-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.template-item {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.template-item:hover {
  background: rgba(249, 115, 22, 0.08);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.template-item.active {
  border-color: var(--accent);
  background: rgba(249, 115, 22, 0.12);
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.2);
}

.template-item strong { color: #fff; font-size: 1rem; display: block; font-weight: 600; }
.template-item span { color: #94a3b8; font-size: 0.85rem; }

.separator {
  border: none;
  border-top: 1px solid var(--bg-border);
  margin: 0;
}

.btn-block {
  width: 100%;
  text-align: center;
  justify-content: center;
  padding: 0.85rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.2);
}
.btn-block:hover { 
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.3);
  transform: translateY(-2px);
}
.btn-block:active {
  transform: translateY(0);
}

/* Preview Area */
.preview-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-dark);
  min-width: 0;
}

.preview-header {
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--bg-border);
  background: linear-gradient(180deg, rgba(20, 27, 45, 0.8) 0%, rgba(15, 23, 36, 0.5) 100%);
  backdrop-filter: blur(10px);
}

.preview-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 1.2rem;
  color: #fff;
}

.preview-actions {
  display: flex;
  gap: 1rem;
}

.btn {
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-primary { 
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff; 
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.2);
}
.btn-primary:hover { 
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.3);
  transform: translateY(-2px);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-ghost { 
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1; 
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.btn-ghost:hover { 
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.preview-container {
  flex: 1;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.preview-frame {
  flex: 1;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  overflow-y: auto;
  overflow-x: hidden;
  color: #1e293b;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  max-width: 100%;
  pointer-events: auto;
}

.preview-content-wrapper {
  max-width: 100%;
}

.empty-state {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: #cbd5e1;
  font-size: 1.1rem;
  font-weight: 500;
}

/* Right Sidebar */
.right-sidebar {
  width: 300px;
  background: linear-gradient(180deg, var(--bg-panel) 0%, #0f1724 100%);
  border-left: 1px solid var(--bg-border);
  display: flex;
  flex-direction: column;
}

.right-sidebar .sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--bg-border);
  background: rgba(255, 255, 255, 0.02);
}

.tool-group {
  margin-bottom: 1.5rem;
}
.tool-group label {
  display: block;
  font-size: 0.8rem;
  color: #cbd5e1;
  margin-bottom: 0.6rem;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.tool-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  padding: 0.65rem 0.75rem;
  font-family: inherit;
  box-sizing: border-box;
  transition: all 0.2s;
}
.tool-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
  background: rgba(255, 255, 255, 0.08);
}
.tool-input[type="color"] {
  height: 44px;
  padding: 4px;
  cursor: pointer;
  border-radius: 8px;
}

/* Scrollbar Styling */
.sidebar-content::-webkit-scrollbar,
.preview-frame::-webkit-scrollbar {
  width: 8px;
}

.sidebar-content::-webkit-scrollbar-track,
.preview-frame::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb,
.preview-frame::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover,
.preview-frame::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Button Styling */
#select-location-btn {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#select-location-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(249, 115, 22, 0.3) !important;
}

#select-location-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.2) !important;
}

/* Get Website Online Modal */
.gwo-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 5000;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.6);
  overflow-y: auto;
}

.gwo-dialog {
  width: min(1180px, calc(100vw - 2rem));
  max-width: 1180px;
  max-height: calc(100vh - 2rem);
  margin: 0 auto;
  padding: 2.25rem 1.2rem 1.2rem;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.2rem;
  align-items: start;
  position: relative;
  border-radius: 14px;
  border: 1px solid rgba(249, 115, 22, 0.3);
  background: linear-gradient(135deg, rgba(20, 27, 45, 0.98), rgba(15, 23, 36, 0.98));
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.gwo-close {
  position: absolute;
  top: 0.2rem;
  right: 0.25rem;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: none;
  color: #94a3b8;
  font-size: 1.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.gwo-form-panel {
  min-width: 0;
  height: 100%;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.4rem;
  box-shadow: 0 4px 12px rgba(15, 35, 86, 0.02);
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  min-height: 0;
  overflow-y: auto;
}

.gwo-form-title {
  margin: 0;
  font-size: 1.95rem;
  line-height: 1.15;
  color: #0f172a;
  font-weight: 700;
}

.gwo-form {
  display: flex;
  flex-direction: column;
  gap: 0.78rem;
}

/* Template selection grid and tile improvements */
#template-selection {
  align-items: start !important;
  justify-content: flex-start !important;
  width: 100%;
  min-height: auto;
  box-sizing: border-box;
  background: transparent;
  color: #cbd5e1;
  border-radius: 0;
}

body.builder-studio.template-picker-active .preview-container {
  padding: 0.45rem 0.9rem 0.9rem;
}

body.builder-studio.template-picker-active #template-selection {
  padding: 1.2rem 0.2rem 1.9rem !important;
  gap: 1.4rem !important;
}

body.builder-studio.template-picker-active #template-selection h2 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.2;
}

#template-selection h2 {
  color: #cbd5e1 !important;
}

#template-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 1rem;
  width: 100% !important;
  max-width: none !important;
  justify-content: stretch !important;
  align-items: start !important;
}

.template-tile {
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(2,6,23,0.5);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.22s, border-color 0.18s;
  display: flex;
  flex-direction: column;
  position: relative;
  cursor: pointer;
}

.template-tile iframe {
  width: 100%;
  height: 160px;
  border: none;
  display: block;
  object-fit: cover;
  background: #0b1220;
}

.template-tile > div {
  padding: 0.6rem 0.75rem;
  text-align: center;
  color: #e6eef8;
  font-weight: 700;
  font-size: 0.95rem;
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,0.03));
}

.template-tile:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 18px 40px rgba(15, 35, 86, 0.32);
  border-color: var(--accent);
}

.template-tile:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.template-tile:active {
  transform: translateY(-2px) scale(1.01);
}

@media (max-width: 720px) {
  #template-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important; }
  .template-tile iframe { height: 120px; }
}

.gwo-name-row {
  display: flex;
  gap: 0.75rem;
}

.gwo-input,
.gwo-select,
.gwo-textarea {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 0.8rem 0.85rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.35;
}

.gwo-textarea {
  resize: none;
  min-height: 84px;
}

.gwo-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
}

.gwo-consent label {
  font-size: 0.9rem;
  color: #475569;
  cursor: pointer;
  line-height: 1.4;
}

body.builder-studio.template-picker-page {
  width: 100vw;
  max-width: 100vw;
  min-height: 100vh;
  height: auto;
  overflow-y: auto;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(249, 115, 22, 0.22), transparent 34%),
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.18), transparent 28%),
    linear-gradient(160deg, #081120 0%, #0d1729 45%, #09111f 100%);
}

body.builder-studio.template-picker-page .template-picker-shell {
  min-height: 100vh;
  width: 100vw;
  max-width: 100vw;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

body.builder-studio.template-picker-page.builder-light-mode {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 30%),
    radial-gradient(circle at top right, rgba(249, 115, 22, 0.12), transparent 28%),
    linear-gradient(160deg, #f8fbff 0%, #eef4fb 45%, #e8eef7 100%);
}

body.builder-studio.template-picker-page.template-picker-active.builder-light-mode #template-selection {
  width: min(100vw, 1680px) !important;
  max-width: 100vw !important;
  margin: 0 auto !important;
  background: transparent !important;
  border-radius: 0 !important;
}

body.builder-studio.template-picker-page.builder-light-mode .picker-header {
  background: rgba(255, 255, 255, 0.82);
  border-bottom-color: rgba(15, 23, 42, 0.08);
}

body.builder-studio.template-picker-page.builder-light-mode .picker-brand {
  color: #0f172a;
}

body.builder-studio.template-picker-page.builder-light-mode .picker-back-link {
  color: #0f172a;
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.12);
}

body.builder-studio.template-picker-page.builder-light-mode .picker-intro,
body.builder-studio.template-picker-page.builder-light-mode .picker-intro h1,
body.builder-studio.template-picker-page.builder-light-mode .picker-intro p {
  color: #0f172a;
}

body.builder-studio.template-picker-page.builder-light-mode .picker-kicker {
  color: #c2410c;
}

body.builder-studio.template-picker-page.builder-light-mode .template-picker-card {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.10);
}

body.builder-studio.template-picker-page.builder-light-mode .template-picker-body h3,
body.builder-studio.template-picker-page.builder-light-mode .template-picker-audience {
  color: #0f172a;
}

body.builder-studio.template-picker-page.builder-light-mode .template-picker-desc,
body.builder-studio.template-picker-page.builder-light-mode .template-picker-features li {
  color: #475569;
}

body.builder-studio.template-picker-page.builder-light-mode .template-picker-features li::before {
  color: #f97316;
}

body.builder-studio.template-picker-page.builder-light-mode .template-picker-cta {
  box-shadow: 0 12px 28px rgba(249, 115, 22, 0.18);
}

body.builder-studio.template-picker-page .picker-main,
body.builder-studio.template-picker-page #template-selection {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.275rem;
  width: min(100vw, 1680px);
  max-width: 100vw;
  min-width: 0;
  margin: 0 auto;
  box-sizing: border-box;
  padding: clamp(0.5rem, 0.75vw, 0.7rem) clamp(3rem, 4vw, 4.5rem) clamp(1rem, 1.4vw, 1.25rem);
}

body.builder-studio.template-picker-page .picker-intro {
  max-width: 720px;
  margin: 0;
  color: #f8fafc;
}

body.builder-studio.template-picker-page .picker-kicker {
  margin: 0 0 0.6rem;
  color: #f97316;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

body.builder-studio.template-picker-page .picker-intro h1 {
  margin: 0;
  font-family: 'Outfit', sans-serif;
  font-size: clamp(2.4rem, 4vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

body.builder-studio.template-picker-page .picker-intro p {
  margin: 0.5rem 0 0;
  max-width: 58ch;
  color: #cbd5e1;
  font-size: 1.05rem;
  line-height: 1.7;
}

body.builder-studio.template-picker-page #template-grid,
body.builder-studio.template-picker-page .picker-grid {
  flex: 1;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 0.625rem;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  align-items: start !important;
  margin: 0 auto;
}

body.builder-studio.template-picker-page.template-picker-active #template-selection {
  flex: 1;
  padding: clamp(0.5rem, 0.75vw, 0.7rem) clamp(3rem, 4vw, 4.5rem) clamp(1rem, 1.4vw, 1.25rem) !important;
  gap: 0.275rem;
}

body.builder-studio.template-picker-page .template-picker-card {
  min-height: 0;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.35);
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-align: left;
  backdrop-filter: blur(14px);
}

body.builder-studio.template-picker-page .template-picker-card > div {
  padding: 0;
  text-align: center;
  background: transparent;
}

body.builder-studio.template-picker-page .template-picker-card > .template-picker-body {
  padding: 0.5rem 1.5rem 1.75rem;
}

body.builder-studio.template-picker-page .template-picker-preview {
  width: 100%;
  display: block;
  border: none;
  pointer-events: none;
  background: #0b1220;
  height: 208px !important;
  margin-bottom: 0.175rem;
}

body.builder-studio.template-picker-page .template-picker-cover {
  position: relative;
  min-height: 250px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.45), rgba(37, 99, 235, 0.42));
}

body.builder-studio.template-picker-page .template-picker-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.builder-studio.template-picker-page .template-picker-cover--blank {
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,0.18), transparent 28%),
    linear-gradient(135deg, rgba(30, 58, 138, 0.92), rgba(249, 115, 22, 0.75));
}

body.builder-studio.template-picker-page .template-picker-cover-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

body.builder-studio.template-picker-page .template-picker-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: center;
  text-align: center;
}

body.builder-studio.template-picker-page .template-picker-body h3 {
  margin: 0.1rem 0 0;
  color: #f8fafc;
  font-family: 'Outfit', sans-serif;
  font-size: 1.45rem;
  line-height: 1.05;
}

body.builder-studio.template-picker-page .template-picker-audience {
  margin: 0 auto;
  max-width: 30ch;
  color: #f8fafc;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.45;
}

body.builder-studio.template-picker-page .template-picker-desc {
  margin: 0 auto;
  max-width: 33ch;
  color: #cbd5e1;
  font-size: 0.96rem;
  line-height: 1.65;
}

body.builder-studio.template-picker-page .template-picker-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
  justify-items: center;
  width: 100%;
}

body.builder-studio.template-picker-page .template-picker-features li {
  position: relative;
  padding-left: 0;
  display: inline-flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0.35rem;
  color: #e2e8f0;
  font-size: 0.94rem;
  line-height: 1.45;
  text-align: center;
}

body.builder-studio.template-picker-page .template-picker-features li::before {
  content: '✓';
  position: static;
  color: #f97316;
  font-weight: 800;
}

body.builder-studio.template-picker-page .template-picker-cta {
  margin-top: 0.35rem;
  border: none;
  border-radius: 999px;
  padding: 0.95rem 1.15rem;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 0.98rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(249, 115, 22, 0.26);
}

body.builder-studio.template-picker-page .template-picker-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(249, 115, 22, 0.32);
}

body.builder-studio.template-picker-page .template-tile:hover {
  transform: translateY(-8px) scale(1.01);
}

@media (max-width: 1120px) {
  body.builder-studio.template-picker-page #template-grid,
  body.builder-studio.template-picker-page .picker-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 900px) {
  body.builder-studio.template-picker-page .preview-header {
    padding: 0.85rem 1rem;
    align-items: center;
    gap: 0.75rem;
  }

  body.builder-studio.template-picker-page .preview-header .logo {
    max-width: calc(100% - 3.5rem);
    min-width: 0;
  }

  body.builder-studio.template-picker-page .preview-header .logo > div {
    min-width: 0;
  }

  body.builder-studio.template-picker-page .preview-header .logo-tagline {
    display: none !important;
  }

  body.builder-studio.template-picker-page .preview-actions,
  body.builder-studio.template-picker-page #preview-mobile-btn {
    display: none !important;
  }
}

@media (max-width: 720px) {
  body.builder-studio.template-picker-page .picker-main {
    padding: 1rem 1rem 1.5rem;
  }

  body.builder-studio.template-picker-page .template-picker-cover {
    min-height: 200px;
  }

  body.builder-studio.template-picker-page .template-picker-preview,
  body.builder-studio.template-picker-page .template-tile iframe {
    display: none !important;
  }

  body.builder-studio.template-picker-page .template-picker-card,
  body.builder-studio.template-picker-page .template-tile {
    border-radius: 18px;
  }

  body.builder-studio.template-picker-page .template-picker-body {
    padding-top: 1.1rem;
  }

  body.builder-studio.template-picker-page .template-picker-preview {
    height: 220px !important;
  }
}

.gwo-submit {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.95rem 1rem;
  border-radius: 10px;
  justify-content: center;
}

.gwo-pricing-wrap {
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: stretch;
}

.gwo-pricing-card {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  overflow-y: auto;
  padding: 1.65rem;
  border-radius: 16px;
  border: 1px solid rgba(59, 130, 246, 0.2);
  background: linear-gradient(160deg, #ffffff 0%, #f1f5f9 100%);
  box-shadow: 0 4px 12px rgba(15, 35, 86, 0.02);
}

.gwo-pricing-title {
  margin: 0 0 0.95rem;
  font-family: 'Outfit', sans-serif;
  font-size: 1.85rem;
  font-weight: 700;
  color: #003d82;
  line-height: 1.1;
}

.gwo-pricing-copy {
  margin: 0;
  font-size: 1.06rem;
  line-height: 1.5;
  color: #0f172a;
}

.gwo-price-block {
  margin: 1rem 0 1.1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(59, 130, 246, 0.1);
}

.gwo-starting-price {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.6rem;
}

.gwo-starting-label {
  color: #0f172a;
  margin-bottom: 6px;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
}

.gwo-starting-free {
  color: #003d82;
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1;
}

.gwo-monthly-copy {
  color: #0f172a;
  font-size: 1.05rem;
  line-height: 1.45;
}

.gwo-total {
  margin-bottom: 0.95rem;
  padding: 1rem 1.1rem;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f3f4f6;
}

.gwo-total-label {
  display: block;
  margin-bottom: 5px;
  color: #374151;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1;
}

.gwo-total-amount {
  display: block;
  color: #111827;
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1;
}

.gwo-total-note {
  display: block;
  margin-top: 8px;
  color: #6b7280;
  font-size: 0.92rem;
  line-height: 1.35;
}

.gwo-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.74rem;
}

.gwo-feature {
  display: flex;
  align-items: center;
  color: #0f172a;
  font-size: 1.08rem;
  line-height: 1.45;
}

.gwo-feature-check {
  color: #22c55e;
  font-size: 1.18rem;
  font-weight: 700;
  margin-right: 10px;
  line-height: 1;
}

/* Responsive */
@media (max-width: 1200px) {
  .right-sidebar {
    width: 280px;
  }
}

@media (max-width: 900px) {
  body.builder-studio {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .builder-layout {
    height: auto !important;
    min-height: 100vh;
  }

  .right-sidebar {
    width: 100% !important;
    border-right: none;
    border-left: none;
    display: flex;
    flex-direction: column;
    height: 100vh; /* take full height */
  }

  .right-sidebar .sidebar-header {
    flex-shrink: 0; /* don't let the header shrink or scroll */
  }

  .right-sidebar .sidebar-content {
    flex: 1;
    overflow-y: auto !important;
    padding-bottom: 2rem; /* Add breathing room at bottom */
    /* Remove max-height since flex handles the scaling now */
  }

  .preview-area {
    display: none !important;
  }

  body.mobile-preview-open .right-sidebar {
    display: none !important;
  }

  body.mobile-preview-open .preview-area {
    display: flex !important;
    flex: 1 !important;
    position: relative !important;
    width: 100% !important;
  }

  body.mobile-preview-open {
    overflow: hidden !important;
  }

  .preview-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 999 !important;
    padding: 0.9rem 0.75rem;
    gap: 0.6rem;
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .preview-actions {
    margin-left: 0;
    width: 100%;
    gap: 0.55rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  #preview-mobile-btn,
  #publish-btn {
    width: 100%;
    justify-content: center;
  }

  #preview-mobile-btn {
    display: inline-flex !important;
  }

  #help-btn {
    display: none !important;
  }

  #sidebar-help-btn {
    display: inline-flex !important;
  }

  /* Hide real-time preview text on mobile */
  div[style*="padding-top: 1.25rem"] > p {
    display: none !important;
  }

  /* Help Modal - Mobile Optimizations */
  #helpModal {
    padding: 1rem !important;
  }

  #helpModal > div {
    max-width: 100% !important;
    padding: 1.5rem !important;
  }

  #helpModal h2 {
    font-size: 1.3rem !important;
  }

  #helpModal input,
  #helpModal textarea {
    padding: 0.85rem !important;
    font-size: 16px !important;
  }

  #helpModal button[type="submit"] {
    padding: 0.85rem !important;
  }

  /* Get Website Online Modal - Mobile Optimizations */
  #getWebsiteOnlineModal {
    padding: 0 !important;
    background: rgba(0, 0, 0, 0.85) !important;
    height: 100vh !important;
    overflow-y: auto !important;
  }

  #getWebsiteOnlineModal > div {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    padding: 0 !important;
    flex-wrap: nowrap !important;
    max-width: 100% !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: linear-gradient(135deg, rgba(20, 27, 45, 0.98), rgba(15, 23, 36, 0.98)) !important;
    height: auto !important;
    min-height: 100vh !important;
    position: relative !important;
    overflow-y: auto !important;
  }

  #getWebsiteOnlineModal > div > div {
    flex: auto !important;
    min-width: 100% !important;
    height: auto !important;
    padding: 2rem 1.5rem !important;
    border-radius: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  #getWebsiteOnlineModal > div > div:first-of-type {
    background: #fff !important;
    border-bottom: 2px solid #e2e8f0 !important;
  }

  #getWebsiteOnlineModal form {
    gap: 1rem !important;
  }

  /* Stack First Name and Last Name on mobile */
  #getWebsiteOnlineModal #getWebsiteOnlineForm > div:first-child {
    flex-direction: column !important;
    gap: 1rem !important;
  }

  #getWebsiteOnlineModal #getWebsiteOnlineForm > div:first-child input {
    flex: 1 !important;
    min-width: 100% !important;
  }

  #getWebsiteOnlineModal input,
  #getWebsiteOnlineModal select,
  #getWebsiteOnlineModal textarea {
    padding: 1rem !important;
    font-size: 16px !important;
    width: 100% !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
  }

  /* Keep consent checkboxes as compact checkboxes on mobile */
  #getWebsiteOnlineModal input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    padding: 0 !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 4px !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
  }

  #onlineMarketing,
  #onlineTerms {
    align-self: flex-start !important;
    margin-top: 2px !important;
  }

  #onlineMarketing + label,
  #onlineTerms + label {
    line-height: 1.35 !important;
  }

  #getWebsiteOnlineModal h2 {
    font-size: 1.6rem !important;
    line-height: 1.3 !important;
    margin-bottom: 0.8rem !important;
  }

  #getWebsiteOnlineModal h3 {
    font-size: 1.3rem !important;
  }

  #getWebsiteOnlineModal p {
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
    margin-bottom: 1.5rem !important;
  }

  #getWebsiteOnlineModal button[type="submit"] {
    width: 100% !important;
    padding: 1.2rem !important;
    font-size: 1rem !important;
    align-self: auto !important;
    margin-top: 0.5rem !important;
    border-radius: 10px !important;
  }

  #getWebsiteOnlineModal button[type="button"]#closeGetWebsiteOnlineModal {
    top: 1.5rem !important;
    right: 1.5rem !important;
    z-index: 5001 !important;
  }

  #getWebsiteOnlineModal .gwo-consent {
    margin-top: 1rem !important;
    margin-bottom: 0.5rem !important;
  }

  #getWebsiteOnlineModal .gwo-consent label {
    font-size: 0.9rem !important;
  }

  body.mobile-preview-open .preview-container {
    padding: 0 !important;
  }

  body.mobile-preview-open .preview-frame {
    width: 100vw !important;
    max-width: 100vw !important;
    border-radius: 0;
    box-shadow: none;
  }

  /* Get Website Online Modal - Class-based phone layout */
  #getWebsiteOnlineModal.gwo-modal {
    padding: 0 !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    overflow-y: auto !important;
  }

  #getWebsiteOnlineModal .gwo-dialog {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 100dvh !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow-y: auto !important;
  }

  #getWebsiteOnlineModal .gwo-close {
    position: fixed !important;
    top: max(10px, env(safe-area-inset-top)) !important;
    right: 10px !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 999px !important;
    background: rgba(15, 23, 42, 0.58) !important;
    color: #e2e8f0 !important;
    z-index: 5100 !important;
  }

  #getWebsiteOnlineModal .gwo-form-panel,
  #getWebsiteOnlineModal .gwo-pricing-wrap,
  #getWebsiteOnlineModal .gwo-pricing-card {
    width: 100% !important;
    min-width: 100% !important;
    height: auto !important;
  }

  #getWebsiteOnlineModal .gwo-form-panel {
    padding: 2.2rem 1rem 1.25rem !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
  }

  #getWebsiteOnlineModal .gwo-name-row {
    flex-direction: column !important;
    gap: 1rem !important;
  }

  #getWebsiteOnlineModal .gwo-pricing-wrap {
    border-top: 2px solid #e2e8f0 !important;
    background: linear-gradient(135deg, rgba(20, 27, 45, 0.98), rgba(15, 23, 36, 0.98)) !important;
  }

  #getWebsiteOnlineModal .gwo-pricing-card {
    padding: 1.25rem 1rem 1.4rem !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  #getWebsiteOnlineModal .gwo-pricing-title {
    font-size: 1.42rem !important;
    margin-bottom: 0.7rem !important;
  }

  #getWebsiteOnlineModal .gwo-pricing-copy,
  #getWebsiteOnlineModal .gwo-monthly-copy {
    font-size: 0.96rem !important;
    line-height: 1.5 !important;
  }

  #getWebsiteOnlineModal .gwo-starting-free {
    font-size: 2.25rem !important;
  }

  #getWebsiteOnlineModal .gwo-total-amount {
    font-size: 1.65rem !important;
  }

  #getWebsiteOnlineModal .gwo-features {
    gap: 0.58rem !important;
  }

  #getWebsiteOnlineModal .gwo-feature {
    font-size: 0.98rem !important;
  }
}
