@font-face {
  font-family: 'Cairo';
  src: url('/_studio/fonts/cairo-arabic.woff2') format('woff2');
  font-weight: 400 900;
  font-display: swap;
}

@font-face {
  font-family: 'Outfit';
  src: url('/_studio/fonts/outfit-latin.woff2') format('woff2');
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-light: #EFF6FF;
  --bg: #F1F5F9;
  --surface: #FFFFFF;
  --text: #0F172A;
  --text-sec: #475569;
  --text-muted: #94A3B8;
  --border: #E2E8F0;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --success: #10B981;
  --success-light: #D1FAE5;
  --success-border: #A7F3D0;
  --success-text: #065F46;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --danger: #EF4444;
  --danger-light: #FEE2E2;
  --danger-border: #FECACA;
  --danger-text: #DC2626;
  --ai-bg: #F5F3FF;
  --ai-border: #DDD6FE;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Cairo', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  letter-spacing: 0.2px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* App container filling the browser window */
.studio-app {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

/* Top bar */
.topbar {
  height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  z-index: 20;
  flex-shrink: 0;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
}

.brand svg {
  width: 28px;
  height: 28px;
  color: var(--primary);
}

.site-badge {
  background: var(--primary-light);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
}

.toolbar-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.toggle-group {
  display: flex;
  background: var(--bg);
  border-radius: 8px;
  padding: 3px;
  border: 1px solid var(--border);
}

.toggle-btn {
  padding: 6px 14px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-family: 'Cairo', 'Outfit', sans-serif;
  font-size: 0.88rem;
  color: var(--text-sec);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.toggle-btn.active {
  background: white;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

.tool-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.tool-btn:hover:not(:disabled) {
  background: var(--bg);
  border-color: #CBD5E1;
}

.tool-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.status-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  background: #F8FAFC;
  border: 1px solid var(--border);
  color: var(--text-sec);
}

.status-chip.saved {
  color: var(--success);
  border-color: #D1FAE5;
  background: #ECFDF5;
}

.status-chip.saving {
  color: var(--warning);
  border-color: #FEF3C7;
  background: #FFFBEB;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.92rem;
  transition: background 0.2s;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.2);
}

/* Main workspace area */
.workspace-content {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* Structure Sidebar (Right in RTL, Left in LTR) */
.structure-sidebar {
  width: 290px;
  flex: 0 0 290px;
  background: var(--surface);
  border-inline-start: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 15px rgba(0,0,0,0.03);
  z-index: 10;
  flex-shrink: 0;
  overflow-y: auto;
}

.sidebar-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  background: #F8FAFC;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-label {
  padding: 18px 24px 8px;
  font-size: 0.82rem;
  color: var(--text-sec);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.page-list {
  list-style: none;
  margin: 0;
  padding: 0 12px;
}

.page-item {
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 4px;
  cursor: pointer;
  font-size: 0.95rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-sec);
  font-weight: 600;
  transition: all 0.15s;
}

.page-item:hover {
  background: var(--bg);
  color: var(--text);
}

.page-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}

.block-list {
  list-style: none;
  margin: 0;
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.scene-item-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid #FFFFFF;
  background: #FFFFFF;
  text-align: start;
  cursor: pointer;
  width: 100%;
  transition: all 0.15s;
  font-family: inherit;
  outline: none;
}

.scene-item-btn:hover {
  border-color: #9AB2F0;
  background: #F8FAFC;
}

.scene-item-btn.active {
  border-color: #9AB2F0;
  background: #EFF4FF;
}

.scene-item-btn.hidden {
  opacity: 0.55;
}

.scene-type-chip {
  width: 44px;
  height: 30px;
  border-radius: 6px;
  background: #F2F4F7;
  border: 1px solid #E3E7EE;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #475467;
  font-weight: 600;
  flex-shrink: 0;
}

.scene-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}

.scene-title {
  font-size: 14px;
  font-weight: 600;
  color: #101828;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scene-kind {
  font-size: 12px;
  color: #475467;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scene-eye-btn {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  color: #98A2B3;
  flex-shrink: 0;
  transition: all 0.15s;
}

.scene-eye-btn:hover {
  background: #E2E8F0;
  color: #475467;
}

.add-block-btn {
  margin: 12px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1.5px dashed #9AB2F0;
  border-radius: 12px;
  color: #1D4ED8;
  font-size: 14px;
  font-weight: 600;
  background: transparent;
  transition: all 0.2s;
  cursor: pointer;
}

.add-block-btn:hover {
  background: #EFF4FF;
  border-color: #1D4ED8;
}

/* Scene elements list («عناصر …») */
.scene-elements-section {
  border-top: 1px solid #E3E7EE;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.scene-elements-title {
  margin: 0 0 4px;
  font-size: 13px;
  color: #475467;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scene-element-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: transparent;
  font-size: 13px;
  color: #101828;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
}

.scene-element-item:hover {
  background: #F8FAFC;
}

.scene-element-item.active {
  background: #EFF4FF;
  border-color: #9AB2F0;
  font-weight: 600;
}

.scene-element-chip {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #F2F4F7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #475467;
  font-weight: 600;
  flex-shrink: 0;
}

.scene-element-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.block-actions {
  color: var(--text-sec);
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  position: relative;
}

.block-actions:hover {
  background: var(--bg);
  color: var(--text);
}

.context-menu {
  position: absolute;
  top: 100%;
  inset-inline-end: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 6px 0;
  min-width: 140px;
  z-index: 100;
}

.menu-item {
  padding: 8px 14px;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.menu-item.danger {
  color: var(--danger);
}

.menu-item.danger:hover {
  background: #FEE2E2;
}

/* Central Canvas Area */
.canvas-area {
  flex: 1;
  padding: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-image: radial-gradient(#CBD5E1 1px, transparent 1px);
  background-size: 24px 24px;
  position: relative;
  overflow: auto;
}

/* Calm notice banner when images are unavailable in preview */
.asset-notice-banner {
  position: absolute;
  top: 16px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #B45309;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  z-index: 10;
  pointer-events: none;
}

/* Phone Frame (390px x 844px) */
.phone-frame {
  width: 390px;
  height: 844px;
  background: #F8FAFC;
  border-radius: 44px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3), 0 0 0 14px #0F172A, 0 0 0 16px #334155;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  flex-shrink: 0;
  transition: all 0.3s ease-in-out;
}

/* Desktop Frame (1440px) */
.desktop-frame {
  width: 100%;
  max-width: 1200px;
  height: 100%;
  min-height: 720px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15), 0 0 0 1px var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.3s ease-in-out;
}

.desktop-header-mock {
  height: 36px;
  background: #E2E8F0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 8px;
}

.mock-window-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #94A3B8;
}

.canvas-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: white;
  flex: 1;
}

/* Inspector Drawer (Opposite to structure panel) */
.inspector-sidebar {
  width: 330px;
  flex: 0 0 330px;
  background: var(--surface);
  border-inline-end: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 15px rgba(0,0,0,0.03);
  z-index: 10;
  flex-shrink: 0;
  overflow-y: auto;
}

.inspector-header {
  padding: 16px 16px 0;
  border-bottom: 1px solid var(--border);
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.inspector-tablist {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 3px;
  background: #F2F4F7;
  border-radius: 10px;
  margin-bottom: 12px;
}

.inspector-tab-btn {
  padding: 7px 0;
  border: 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: #475467;
  font-family: inherit;
  transition: all 0.15s;
}

.inspector-tab-btn.active {
  background: #FFFFFF;
  color: #101828;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.inspector-calm-future {
  padding: 36px 16px;
  text-align: center;
  color: #64748B;
  font-size: 13px;
  font-weight: 500;
  background: #F8FAFC;
  border-radius: 10px;
  border: 1px dashed #CBD5E1;
  margin-top: 8px;
}

/* Lines editor */
.lines-editor-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.line-item-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.line-input {
  flex: 1 1 auto;
  min-width: 0;
}

.line-emphasis-btn {
  padding: 8px 10px;
  border: 1px solid #D0D5DD;
  border-radius: 9px;
  background: #FFFFFF;
  font-size: 12px;
  color: #475467;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  flex-shrink: 0;
}

.line-emphasis-btn.emphasized {
  border-color: #5B42F3;
  background: #F1EEFE;
  color: #4527D9;
}

.add-line-btn {
  align-self: flex-start;
  padding: 6px 10px;
  border: 0;
  background: transparent;
  color: #1D4ED8;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* Confirmation Dialog Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.confirm-dialog {
  background: #FFFFFF;
  border-radius: 16px;
  border: 1px solid #E3E7EE;
  box-shadow: 0 20px 40px rgba(16,24,40,0.18);
  padding: 24px;
  max-width: 420px;
  width: 90%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.confirm-dialog-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.confirm-dialog-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #101828;
}

.confirm-dialog-body {
  margin: 0;
  font-size: 13px;
  color: #475467;
  line-height: 1.6;
}

.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.btn-danger {
  padding: 9px 18px;
  border-radius: 10px;
  background: #B42318;
  color: #FFFFFF;
  border: 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.btn-danger:hover {
  background: #991B1B;
}

/* Page selector chip & dropdown */
.page-selector-chip-container {
  position: relative;
  display: inline-flex;
}

.page-selector-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid #E3E7EE;
  border-radius: 10px;
  color: #101828;
  font-size: 14px;
  background: #FFFFFF;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.15s;
}

.page-selector-chip:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
}

.page-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-start: 0;
  background: #FFFFFF;
  border: 1px solid #E3E7EE;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(16,24,40,0.12);
  padding: 6px 0;
  min-width: 180px;
  z-index: 1000;
}

.page-dropdown-item {
  padding: 8px 14px;
  font-size: 13px;
  color: #101828;
  cursor: pointer;
  transition: all 0.15s;
}

.page-dropdown-item:hover {
  background: #F8FAFC;
  color: #1D4ED8;
}

.page-dropdown-item.active {
  background: #EFF4FF;
  color: #1D4ED8;
  font-weight: 600;
}

.inspector-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-sec);
}

.form-input, .form-textarea {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: white;
  outline: none;
  transition: border-color 0.15s;
}

.form-input:focus, .form-textarea:focus {
  border-color: var(--primary);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.bound-notice {
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  color: #92400E;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.empty-inspector {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-sec);
  font-size: 0.95rem;
}

/* Sites list screen */
.sites-container {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 24px;
  width: 100%;
}

.sites-header {
  margin-bottom: 32px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.sites-header h1 {
  margin: 0 0 8px;
  font-size: 1.8rem;
  font-weight: 800;
}

.sites-header p {
  margin: 0;
  color: var(--text-sec);
  font-size: 1rem;
}

.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.site-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all 0.2s;
  cursor: pointer;
}

.site-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.site-card-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
}

.site-card-host {
  font-size: 0.9rem;
}

.site-host-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.site-host-link:hover {
  text-decoration: underline;
  color: var(--primary-hover);
}

.site-card-host-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.site-card-meta {
  font-size: 0.82rem;
  color: var(--text-sec);
}

.sites-empty-state,
.sites-loading-state,
.sites-error-state {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  margin-top: 24px;
}

.sites-empty-state h3 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 800;
}

.sites-empty-state p,
.sites-loading-state p,
.sites-error-state p {
  color: var(--text-sec);
  margin: 0 0 16px;
  font-size: 0.95rem;
}

/* Toast Notification (non-blocking) */
.studio-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #0F172A;
  color: #F8FAFC;
  padding: 12px 20px;
  border-radius: 10px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 1000;
  animation: toast-fade 0.25s ease-out;
}

@keyframes toast-fade {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* Secondary Button */
.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.btn-secondary:hover:not(:disabled) {
  background: #F8FAFC;
  border-color: #CBD5E1;
}

.btn-secondary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Sign-in Screen & Card */
.signin-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
}

.signin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 32px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.signin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}

.signin-brand svg {
  width: 32px;
  height: 32px;
  color: var(--primary);
  flex-shrink: 0;
}

.signin-brand h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
}

.signin-header {
  text-align: center;
}

.signin-header h3 {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
}

.signin-header p {
  margin: 0;
  color: var(--text-sec);
  font-size: 0.9rem;
  line-height: 1.5;
}

.signin-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.signin-error {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #DC2626;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}

.signin-error svg {
  flex-shrink: 0;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}

.form-field input {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: white;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-field input:disabled {
  background: #F8FAFC;
  cursor: not-allowed;
}

.mfa-input {
  letter-spacing: 0.3em;
  font-size: 1.3rem !important;
  text-align: center;
  font-weight: 700;
}

.signin-submit-btn {
  width: 100%;
  justify-content: center;
  height: 44px;
  font-size: 0.95rem;
  margin-top: 4px;
}

.signin-back-btn {
  width: 100%;
}

.signin-footer {
  text-align: center;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 4px;
}

.app-link {
  color: var(--text-sec);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.app-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* Workspace Picker */
.workspace-picker-container {
  position: relative;
  display: inline-flex;
}

.workspace-picker-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-light);
  color: var(--primary);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(37, 99, 235, 0.15);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.workspace-picker-trigger:hover {
  background: #DBEAFE;
  border-color: rgba(37, 99, 235, 0.3);
}

.workspace-picker-icon {
  flex-shrink: 0;
  color: var(--primary);
}

.workspace-picker-name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-picker-chevron {
  flex-shrink: 0;
  transition: transform 0.2s;
}

.workspace-picker-chevron.open {
  transform: rotate(180deg);
}

.workspace-picker-menu {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  min-width: 240px;
  max-width: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: picker-fade 0.15s ease-out;
}

@keyframes picker-fade {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.workspace-picker-header {
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.workspace-picker-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 280px;
  overflow-y: auto;
}

.workspace-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
  text-align: start;
}

.workspace-picker-item:hover {
  background: #F8FAFC;
}

.workspace-picker-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}

.workspace-picker-item-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-picker-check {
  color: var(--primary);
  flex-shrink: 0;
}

.picker-suggest-btn {
  margin: 12px auto 0;
}

@media (max-width: 900px) {
  .structure-sidebar,
  .inspector-sidebar {
    display: none !important;
  }
  .canvas-area {
    padding: 8px !important;
  }
  .canvas-frame.phone-frame {
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .topbar {
    height: auto;
    min-height: 52px;
    padding: 6px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .brand {
    font-size: 0.95rem;
    gap: 6px;
    white-space: nowrap;
  }

  .brand svg {
    width: 22px;
    height: 22px;
  }

  .workspace-picker-trigger {
    padding: 5px 8px;
    font-size: 0.8rem;
    gap: 6px;
  }

  .workspace-picker-name {
    max-width: 105px;
  }

  .workspace-picker-menu {
    min-width: 200px;
    max-width: calc(100vw - 24px);
  }

  .signin-card {
    padding: 24px 18px;
    border-radius: 12px;
  }
}

/* AI Assistant Panel (Left Sidebar in RTL) */
.ai-panel {
  width: 380px;
  background: white;
  border-inline-end: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 10;
  flex-shrink: 0;
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.03);
  height: 100%;
  overflow: hidden;
}

.ai-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--ai-border);
  background: var(--ai-bg);
  display: flex;
  align-items: center;
  gap: 14px;
}

.ai-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: white;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
  border: 2px solid #8B5CF6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ai-header h2 {
  margin: 0;
  font-size: 1.1rem;
  color: #4C1D95;
  font-weight: 800;
}

.ai-close-btn {
  background: transparent;
  border: none;
  color: #6D28D9;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  border-radius: 6px;
  transition: background 0.15s;
}

.ai-close-btn:hover {
  background: rgba(139, 92, 246, 0.12);
}

.ai-chat {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #FAFAFA;
}

.ai-welcome {
  padding: 16px;
  background: white;
  border: 1px solid var(--ai-border);
  border-radius: 12px;
  font-size: 0.9rem;
  color: #4C1D95;
  line-height: 1.5;
  font-weight: 600;
  text-align: start;
}

.ai-welcome p {
  margin: 0;
}

.chat-bubble {
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.5;
  box-shadow: var(--shadow-sm);
  max-width: 92%;
}

.chat-user {
  background: white;
  border: 1px solid var(--border);
  align-self: flex-start;
  border-start-start-radius: 4px;
  color: var(--text);
}

.chat-ai {
  background: var(--ai-bg);
  color: #4C1D95;
  border: 1px solid rgba(139, 92, 246, 0.2);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.05);
  align-self: flex-end;
  border-start-end-radius: 4px;
  width: 100%;
  max-width: 100%;
}

.diff-preview {
  background: white;
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 12px;
  padding: 16px;
  margin-top: 12px;
  font-size: 0.88rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.08);
}

.diff-preview::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.06) 0%, transparent 70%);
  animation: diffRotate 12s linear infinite;
  pointer-events: none;
}

@keyframes diffRotate {
  100% {
    transform: rotate(360deg);
  }
}

.diff-preview h4 {
  margin: 0 0 12px;
  color: var(--text);
  font-weight: 800;
  font-size: 0.95rem;
}

.diff-rows {
  position: relative;
  z-index: 1;
}

.diff-line {
  display: flex;
  flex-direction: column;
  margin-bottom: 8px;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 8px;
}

.diff-line:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.diff-label {
  font-size: 0.8rem;
  color: var(--text-sec);
  margin-bottom: 4px;
  font-weight: 700;
}

.diff-content {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.diff-old {
  text-decoration: line-through;
  color: #EF4444;
  flex: 1;
  opacity: 0.85;
  font-size: 0.88rem;
}

.diff-new {
  color: #10B981;
  font-weight: 800;
  flex: 1;
  font-size: 0.88rem;
}

.diff-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  position: relative;
  z-index: 1;
}

.diff-btn {
  flex: 1;
  padding: 9px 14px;
  text-align: center;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 700;
  border: none;
  font-family: inherit;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-apply {
  background: #10B981;
  color: white;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.btn-apply:hover {
  background: #059669;
}

.btn-undo {
  background: var(--bg);
  color: var(--text-sec);
  border: 1px solid var(--border);
}

.btn-undo:hover {
  background: #E2E8F0;
}

.diff-applied-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #10B981;
  font-weight: 700;
  font-size: 0.88rem;
  margin-top: 10px;
  padding: 8px 12px;
  background: #ECFDF5;
  border-radius: 6px;
  border: 1px solid #D1FAE5;
  position: relative;
  z-index: 1;
}

.diff-error {
  color: #EF4444;
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 8px;
  padding: 8px 12px;
  background: #FEF2F2;
  border-radius: 6px;
  border: 1px solid #FECACA;
  position: relative;
  z-index: 1;
}

.ai-image-requests {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.ai-image-card {
  background: white;
  border: 1px dashed #C4B5FD;
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: #6D28D9;
  font-weight: 600;
}

.ai-progress-box {
  padding: 12px 16px;
  background: white;
  border: 1px solid var(--ai-border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}

.ai-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ai-progress-subtext {
  font-size: 0.8rem;
  color: var(--text-sec);
  line-height: 1.4;
  padding-inline-start: 24px;
}

.ai-progress-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #6D28D9;
}

.ai-elapsed {
  font-size: 0.82rem;
  color: var(--text-sec);
  font-weight: 600;
}

.ai-cancel-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-sec);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.ai-cancel-btn:hover {
  background: #F8FAFC;
  color: var(--danger);
  border-color: #FECACA;
}

.ai-timeout-box {
  padding: 12px 16px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.88rem;
  color: #92400E;
  font-weight: 600;
}

.ai-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 20px;
  background: white;
  border-top: 1px solid #F1F5F9;
}

.suggestion-chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-sec);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.suggestion-chip:hover:not(:disabled) {
  background: var(--ai-bg);
  border-color: var(--ai-border);
  color: #6D28D9;
  transform: translateY(-1px);
}

.suggestion-chip:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ai-input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  background: white;
  align-items: center;
}

.ai-input {
  flex: 1;
  padding: 10px 16px;
  border-radius: 24px;
  border: 1px solid var(--border);
  font-family: inherit;
  outline: none;
  background: var(--bg);
  color: var(--text);
  font-size: 0.92rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ai-input:focus {
  border-color: #8B5CF6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
  background: white;
}

.ai-send {
  background: #6D28D9;
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, background 0.2s;
  flex-shrink: 0;
}

.ai-send:hover:not(:disabled) {
  background: #5B21B6;
  transform: scale(1.05);
}

.ai-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.sheet-drag-bar {
  display: none;
}

.assistant-toggle-btn.active {
  background: var(--ai-bg);
  border-color: var(--ai-border);
  color: #6D28D9;
  font-weight: 700;
}

@media (max-width: 768px) {
  .ai-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 85vh;
    height: 85vh;
    border-radius: 24px 24px 0 0;
    border-inline-end: none;
    border-top: 1px solid var(--ai-border);
    box-shadow: 0 -10px 35px rgba(0, 0, 0, 0.25);
    z-index: 200;
    animation: slideUpSheet 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .sheet-drag-bar {
    display: block;
    width: 44px;
    height: 5px;
    border-radius: 3px;
    background: #CBD5E1;
    margin: 8px auto 0;
    flex-shrink: 0;
  }
}

@keyframes slideUpSheet {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

/* Publish Screen matching approved mockup publish.html */
.publish-container {
  overflow-y: auto;
  background: var(--bg);
  min-height: 100vh;
}

.publish-content {
  flex: 1;
  padding: 48px;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.publish-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.publish-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #3B82F6, #8B5CF6);
}

.publish-card h2 {
  margin: 0 0 24px;
  font-size: 1.4rem;
  color: var(--text);
  font-weight: 800;
}

/* Progress Pipeline */
.pipeline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
  position: relative;
}

.pipeline::before {
  content: "";
  position: absolute;
  top: 24px;
  right: 0;
  left: 0;
  height: 2px;
  background: var(--border);
  z-index: 1;
}

.pipeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 2;
  width: 100px;
}

.step-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-sec);
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  transition: all 0.2s ease;
}

.step-icon.done {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.step-icon.active {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}

.step-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}

/* Checklist */
.checklist {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.check-item {
  display: flex;
  gap: 16px;
  background: #F8FAFC;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
}

.check-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.status-icon {
  width: 32px;
  height: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-ok {
  background: #D1FAE5;
  color: #059669;
}

.status-warn {
  background: #FEF3C7;
  color: #D97706;
}

.status-error {
  background: #FEE2E2;
  color: #DC2626;
}

.check-content strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 4px;
  color: var(--text);
}

.check-content p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-sec);
  line-height: 1.5;
}

/* Host Box */
.host-box {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
  text-align: left;
  direction: ltr;
}

.host-label {
  font-size: 0.85rem;
  color: #1E3A8A;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.host-link {
  color: var(--primary);
  font-size: 1.05rem;
  font-weight: 800;
  text-decoration: none;
  font-family: 'Outfit', sans-serif;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  word-break: break-all;
  gap: 10px;
}

.host-link:hover {
  text-decoration: underline;
}

/* Publish button */
.btn-publish {
  background: var(--success);
  color: white;
  width: 100%;
  font-size: 1.2rem;
  font-weight: 800;
  padding: 20px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.4);
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  font-family: 'Cairo', sans-serif;
  display: block;
  text-align: center;
}

.btn-publish:hover:not(:disabled) {
  transform: scale(1.02);
}

.btn-publish:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* History List */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.history-item {
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #F8FAFC;
  gap: 12px;
}

.history-info h4 {
  margin: 0 0 6px;
  font-size: 1rem;
  color: var(--text);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-info p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-sec);
}

.btn-rollback {
  background: white;
  color: var(--text-sec);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Cairo', sans-serif;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.btn-rollback:hover:not(:disabled) {
  background: #E2E8F0;
  color: var(--text);
}

.btn-rollback:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.badge-current {
  background: #D1FAE5;
  color: #065F46;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 800;
  margin-inline-start: 8px;
}

/* Modal Overlay & Box */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
  backdrop-filter: blur(2px);
}

.modal-box {
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  max-width: 480px;
  width: 100%;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .publish-content {
    grid-template-columns: 1fr;
    padding: 24px 16px;
    gap: 24px;
  }

  .publish-card {
    padding: 20px;
    margin-bottom: 20px;
  }

  .checklist {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .pipeline-step {
    width: 65px;
  }

  .step-icon {
    width: 38px;
    height: 38px;
    font-size: 0.9rem;
  }

  .step-label {
    font-size: 0.78rem;
  }

  .history-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-rollback {
    width: 100%;
    text-align: center;
  }
}






@media (pointer: coarse) {
  .tool-btn,
  .btn-primary,
  .scene-item-btn,
  .scene-eye-btn,
  .add-block-btn,
  .inspector-tab-btn,
  .line-emphasis-btn,
  .add-line-btn,
  .btn-danger,
  .btn-secondary,
  .signin-submit-btn,
  .signin-back-btn,
  .picker-suggest-btn,
  .ai-close-btn,
  .diff-btn,
  .btn-apply,
  .btn-undo,
  .ai-cancel-btn,
  .assistant-toggle-btn,
  .btn-publish,
  .btn-rollback,
  .page-selector-chip,
  .toggle-btn {
    min-width: 44px;
    min-height: 44px;
  }
}

/* New site dialog */
.new-site-box { max-width: 560px; display: flex; flex-direction: column; gap: 16px; max-height: 90vh; overflow-y: auto; box-sizing: border-box; }
.new-site-title { margin: 0; font-size: 1.25rem; font-weight: 800; }
.new-site-field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; font-weight: 600; }
.new-site-field legend { padding: 0; margin-bottom: 6px; font-weight: 600; }
.new-site-field small, .new-site-note { color: var(--text-sec); font-weight: 400; font-size: 0.85rem; margin: 0; }
.new-site-packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; width: 100%; }
.new-site-pack { min-width: 0; }
.new-site-pack { display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; text-align: start; font: inherit; color: inherit; }
.new-site-pack.is-on { border-color: var(--primary, #4f46e5); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary, #4f46e5) 25%, transparent); }
.new-site-pack img, .new-site-pack-blank { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 8px; background: var(--bg, #f3f4f6); display: block; }
.new-site-pack-name { font-weight: 700; font-size: 0.9rem; }
.new-site-error { margin: 0; padding: 10px 12px; border-radius: 10px; background: #fee2e2; color: #991b1b; font-size: 0.9rem; }
.new-site-actions { display: flex; justify-content: flex-end; gap: 10px; }
.brand-box { max-width: 640px; }
.brand-site { font-weight: 500; color: var(--text-sec); }
.brand-picture { display: grid; grid-template-columns: minmax(0, 1fr) 64px auto; gap: 8px; align-items: end; }
.brand-thumb { width: 64px; height: 64px; border: 1px dashed var(--border); border-radius: 10px; background: var(--bg, #f3f4f6); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.brand-thumb img { width: 100%; height: 100%; object-fit: contain; }
.brand-thumb-note { font-size: 0.7rem; color: var(--text-sec); text-align: center; padding: 4px; font-weight: 400; }
.brand-colour-row { display: flex; gap: 8px; align-items: center; }
.brand-colour-row .form-input { flex: 1; min-width: 0; }
.brand-picker { width: 44px; height: 38px; padding: 2px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; flex: none; }
.brand-sample { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px; border-radius: 12px; border: 1px solid var(--border); font-weight: 600; }
.brand-sample-btn { border: 0; border-radius: 10px; padding: 8px 16px; font: inherit; font-weight: 700; }
.brand-warning { margin: 0; padding: 8px 12px; border-radius: 10px; background: #fef3c7; color: #92400e; font-size: 0.85rem; font-weight: 400; }
.brand-notice { margin: 0; padding: 8px 12px; border-radius: 10px; background: #e0f2fe; color: #075985; font-size: 0.9rem; }
.brand-error { color: #991b1b; font-weight: 500; }
.form-input.is-invalid { border-color: #dc2626; }
.brand-clear { padding: 6px 10px; font-size: 0.8rem; }
@media (max-width: 480px) {
  .brand-picture { grid-template-columns: minmax(0, 1fr) 56px; }
  .brand-picture .brand-clear { grid-column: 1 / -1; justify-self: start; }
  .brand-thumb { width: 56px; height: 56px; }
}
