/* BrandKit Design System */
/* Fonts — self-hosted, no CDN */
@font-face { font-family:'Lora'; font-style:normal; font-weight:400; font-display:swap; src:url('/assets/fonts/lora-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family:'Lora'; font-style:italic; font-weight:400; font-display:swap; src:url('/assets/fonts/lora-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family:'Lora'; font-style:normal; font-weight:600; font-display:swap; src:url('/assets/fonts/lora-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family:'DM Sans'; font-style:normal; font-weight:300; font-display:swap; src:url('/assets/fonts/dm-sans-latin-300-normal.woff2') format('woff2'); }
@font-face { font-family:'DM Sans'; font-style:normal; font-weight:400; font-display:swap; src:url('/assets/fonts/dm-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family:'DM Sans'; font-style:normal; font-weight:500; font-display:swap; src:url('/assets/fonts/dm-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family:'DM Sans'; font-style:normal; font-weight:600; font-display:swap; src:url('/assets/fonts/dm-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family:'DM Mono'; font-style:normal; font-weight:400; font-display:swap; src:url('/assets/fonts/dm-mono-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family:'DM Mono'; font-style:normal; font-weight:500; font-display:swap; src:url('/assets/fonts/dm-mono-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-weight:300; font-display:swap; src:url('/assets/fonts/inter-latin-300-normal.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-weight:400; font-display:swap; src:url('/assets/fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-weight:500; font-display:swap; src:url('/assets/fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-weight:600; font-display:swap; src:url('/assets/fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family:'Playfair Display'; font-style:normal; font-weight:400; font-display:swap; src:url('/assets/fonts/playfair-display-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family:'Playfair Display'; font-style:italic; font-weight:400; font-display:swap; src:url('/assets/fonts/playfair-display-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family:'Playfair Display'; font-style:normal; font-weight:600; font-display:swap; src:url('/assets/fonts/playfair-display-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family:'Nunito'; font-style:normal; font-weight:300; font-display:swap; src:url('/assets/fonts/nunito-latin-300-normal.woff2') format('woff2'); }
@font-face { font-family:'Nunito'; font-style:normal; font-weight:400; font-display:swap; src:url('/assets/fonts/nunito-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family:'Nunito'; font-style:normal; font-weight:500; font-display:swap; src:url('/assets/fonts/nunito-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family:'Nunito'; font-style:normal; font-weight:600; font-display:swap; src:url('/assets/fonts/nunito-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family:'Raleway'; font-style:normal; font-weight:300; font-display:swap; src:url('/assets/fonts/raleway-latin-300-normal.woff2') format('woff2'); }
@font-face { font-family:'Raleway'; font-style:normal; font-weight:400; font-display:swap; src:url('/assets/fonts/raleway-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family:'Raleway'; font-style:normal; font-weight:500; font-display:swap; src:url('/assets/fonts/raleway-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family:'Raleway'; font-style:normal; font-weight:600; font-display:swap; src:url('/assets/fonts/raleway-latin-600-normal.woff2') format('woff2'); }
/* BrandKit Design System */

:root {
  --teal:         #1A6B6B;
  --teal-dark:    #124D4D;
  --teal-light:   #EAF4F4;
  --teal-mid:     #2D8A8A;
  --sage:         #5C7A5C;
  --sage-light:   #EEF2EE;
  --sand:         #F9F7F4;
  --sand-dark:    #F0EDE8;
  --ink:          #1C1C1A;
  --ink-soft:     #3D3D3A;
  --muted:        #767672;
  --border:       #E0DDD8;
  --border-dark:  #C8C4BE;
  --white:        #FFFFFF;
  --red:          #C0392B;
  --red-light:    #FDF0EE;
  --amber:        #B7791F;
  --amber-light:  #FFFBEB;
  --green:        #276749;
  --green-light:  #ECFDF5;
  --font-sans:    'DM Sans', sans-serif;
  --font-serif:   'Lora', serif;
  --font-mono:    'DM Mono', monospace;
  --radius-sm:    6px;
  --radius-md:    10px;
  --radius-lg:    16px;
  --radius-xl:    24px;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:    0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg:    0 12px 32px rgba(0,0,0,.10), 0 4px 8px rgba(0,0,0,.05);
  --transition:   150ms ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-sans); color: var(--ink); background: var(--sand); line-height: 1.6; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
ul, ol { list-style: none; }

/* Typography */
.font-serif  { font-family: var(--font-serif); }
.font-mono   { font-family: var(--font-mono); }
h1, .h1      { font-family: var(--font-serif); font-size: 2.25rem; font-weight: 600; line-height: 1.2; }
h2, .h2      { font-family: var(--font-serif); font-size: 1.75rem; font-weight: 600; line-height: 1.25; }
h3, .h3      { font-size: 1.25rem; font-weight: 600; line-height: 1.3; }
h4, .h4      { font-size: 1rem; font-weight: 600; line-height: 1.4; }
.text-xs     { font-size: .75rem; }
.text-sm     { font-size: .875rem; }
.text-lg     { font-size: 1.125rem; }
.text-muted  { color: var(--muted); }
.text-teal   { color: var(--teal); }
.text-red    { color: var(--red); }
.text-green  { color: var(--green); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }

/* Layout */
.container    { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.container--sm{ max-width: 640px; }
.container--md{ max-width: 860px; }
.page-content { flex: 1; padding: 40px 0 80px; }

/* Navigation */
.nav { position: sticky; top: 0; z-index: 100; background: rgba(249,247,244,.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; gap: 8px; max-width: 1160px; margin: 0 auto; padding: 0 24px; height: 60px; }
.nav-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-serif); font-size: 1.1rem; font-weight: 600; color: var(--ink); flex-shrink: 0; }
.nav-links { display: flex; align-items: center; gap: 2px; margin-left: 24px; flex: 1; }
.nav-link { padding: 6px 12px; border-radius: var(--radius-sm); font-size: .875rem; font-weight: 500; color: var(--ink-soft); transition: background var(--transition), color var(--transition); }
.nav-link:hover { background: var(--sand-dark); color: var(--ink); }
.nav-link--active { background: var(--teal-light); color: var(--teal); }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.nav-user { position: relative; }
.nav-avatar-btn { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--border); background: var(--sand-dark); cursor: pointer; overflow: hidden; display: flex; align-items: center; justify-content: center; transition: border-color var(--transition); }
.nav-avatar-btn:hover { border-color: var(--teal); }
.nav-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.nav-avatar-initials { font-size: .875rem; font-weight: 600; color: var(--teal); }
.nav-dropdown { position: absolute; right: 0; top: calc(100% + 8px); background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-md); min-width: 220px; box-shadow: var(--shadow-lg); overflow: hidden; }
.nav-dropdown-header { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.nav-dropdown-item { display: block; padding: 10px 16px; font-size: .875rem; color: var(--ink-soft); transition: background var(--transition); }
.nav-dropdown-item:hover { background: var(--sand); color: var(--ink); }
.nav-dropdown-item--danger { color: var(--red); }
.nav-dropdown-item--danger:hover { background: var(--red-light); }

/* Cards */
.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-sm); }
.card--hover { transition: box-shadow var(--transition), transform var(--transition); cursor: pointer; }
.card--hover:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.card-title  { font-size: 1rem; font-weight: 600; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; border-radius: var(--radius-md); font-size: .9rem; font-weight: 500; line-height: 1; cursor: pointer; border: 1px solid transparent; transition: background var(--transition), box-shadow var(--transition), transform var(--transition), opacity var(--transition); white-space: nowrap; text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn-primary  { background: var(--teal); color: var(--white); border-color: var(--teal); }
.btn-primary:hover:not(:disabled) { background: var(--teal-dark); }
.btn-secondary { background: var(--white); color: var(--ink); border-color: var(--border-dark); }
.btn-secondary:hover:not(:disabled) { background: var(--sand); }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--sand-dark); color: var(--ink); }
.btn-danger { background: var(--red); color: var(--white); border-color: var(--red); }
.btn-danger:hover:not(:disabled) { background: #a93226; }
.btn-sm   { padding: 7px 14px; font-size: .8rem; border-radius: var(--radius-sm); }
.btn-lg   { padding: 14px 28px; font-size: 1rem; }
.btn-xl   { padding: 16px 36px; font-size: 1.1rem; border-radius: var(--radius-lg); }
.btn-full { width: 100%; }

/* Forms */
.form-group   { margin-bottom: 20px; }
.form-label   { display: block; font-size: .875rem; font-weight: 500; margin-bottom: 6px; color: var(--ink-soft); }
.form-hint    { font-size: .8rem; color: var(--muted); margin-top: 5px; }
.form-error   { font-size: .8rem; color: var(--red); margin-top: 5px; }
.form-input, .form-select, .form-textarea { width: 100%; padding: 10px 14px; border: 1px solid var(--border-dark); border-radius: var(--radius-md); background: var(--white); color: var(--ink); font-size: .9rem; transition: border-color var(--transition), box-shadow var(--transition); appearance: none; }
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(26,107,107,.12); }
.form-input--error { border-color: var(--red); }
.form-textarea { resize: vertical; min-height: 100px; line-height: 1.5; }
.form-input-group { display: flex; align-items: center; border: 1px solid var(--border-dark); border-radius: var(--radius-md); overflow: hidden; background: var(--white); transition: border-color var(--transition), box-shadow var(--transition); }
.form-input-group:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(26,107,107,.12); }
.form-input-prefix { padding: 10px 12px; background: var(--sand); color: var(--muted); font-size: .875rem; border-right: 1px solid var(--border); white-space: nowrap; }
.form-input-group .form-input { border: none; box-shadow: none; border-radius: 0; }
.form-input-group .form-input:focus { box-shadow: none; }
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle-input { display: none; }
.toggle-track { width: 44px; height: 24px; border-radius: 12px; background: var(--border-dark); transition: background var(--transition); position: relative; flex-shrink: 0; }
.toggle-input:checked + .toggle-track { background: var(--teal); }
.toggle-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: white; transition: transform var(--transition); box-shadow: var(--shadow-sm); }
.toggle-input:checked + .toggle-track::after { transform: translateX(20px); }

/* Badges */
.badge        { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 100px; font-size: .75rem; font-weight: 500; }
.badge-teal   { background: var(--teal-light);  color: var(--teal-dark); }
.badge-green  { background: var(--green-light); color: var(--green); }
.badge-red    { background: var(--red-light);   color: var(--red); }
.badge-amber  { background: var(--amber-light); color: var(--amber); }
.badge-gray   { background: var(--sand-dark);   color: var(--muted); }

/* Alerts */
.alert         { padding: 14px 16px; border-radius: var(--radius-md); font-size: .9rem; display: flex; align-items: flex-start; gap: 10px; border: 1px solid transparent; }
.alert-success { background: var(--green-light); color: var(--green);  border-color: #a7f3d0; }
.alert-error   { background: var(--red-light);   color: var(--red);    border-color: #fecaca; }
.alert-info    { background: var(--teal-light);  color: var(--teal);   border-color: #a5f3eb; }
.alert-warning { background: var(--amber-light); color: var(--amber);  border-color: #fde68a; }

/* Tables */
.table-wrap  { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
table        { width: 100%; border-collapse: collapse; font-size: .875rem; }
thead th     { padding: 12px 16px; text-align: left; font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--sand); border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody td     { padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--ink-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--sand); }

/* Stats */
.stat-grid   { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; }
.stat-card   { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px 24px; }
.stat-label  { font-size: .8rem; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.stat-value  { font-family: var(--font-serif); font-size: 2rem; font-weight: 600; color: var(--ink); }
.stat-delta  { font-size: .8rem; color: var(--muted); margin-top: 4px; }

/* Project grid */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 20px; }
.project-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: box-shadow var(--transition), transform var(--transition); }
.project-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.project-thumb { height: 160px; background: var(--sand-dark); display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--border); overflow: hidden; position: relative; }
.project-thumb-label { font-family: var(--font-serif); font-size: 1.5rem; color: var(--border-dark); user-select: none; }
.project-body { padding: 18px; }
.project-title { font-weight: 600; font-size: .95rem; margin-bottom: 6px; }
.project-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.project-actions { display: flex; gap: 6px; margin-top: 14px; }

/* Template picker */
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 16px; }
.template-card { border: 2px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; cursor: pointer; transition: border-color var(--transition), box-shadow var(--transition); }
.template-card:hover     { border-color: var(--teal); box-shadow: var(--shadow-md); }
.template-card.selected  { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(26,107,107,.15); }
.template-card input[type=radio] { display: none; }
.template-preview { height: 140px; background: var(--sand-dark); overflow: hidden; }
.template-preview img { width: 100%; height: 100%; object-fit: cover; }
.template-name { padding: 12px 14px; font-size: .875rem; font-weight: 500; }

/* Public profile */
.profile-page  { min-height: 100vh; }
.profile-hero  { text-align: center; padding: 60px 24px 40px; }
.profile-avatar { width: 100px; height: 100px; border-radius: 50%; border: 3px solid var(--border); margin: 0 auto 20px; background: var(--sand-dark); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-name     { font-family: var(--font-serif); font-size: 1.9rem; font-weight: 600; }
.profile-headline { color: var(--muted); margin-top: 6px; font-size: 1rem; }
.profile-bio      { max-width: 560px; margin: 20px auto 0; color: var(--ink-soft); line-height: 1.7; }
.profile-actions  { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 24px; }
.profile-section  { max-width: 680px; margin: 0 auto; padding: 0 24px 40px; }
.profile-section-title { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 14px; }
.contact-list { display: flex; flex-direction: column; gap: 10px; }
.contact-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-md); font-size: .9rem; color: var(--ink-soft); transition: border-color var(--transition); }
.contact-item:hover { border-color: var(--teal); color: var(--teal); }
.contact-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--teal-light); color: var(--teal); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.social-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px,1fr)); gap: 10px; }
.social-btn { width: 48px; height: 48px; border-radius: var(--radius-md); background: var(--white); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--muted); transition: all var(--transition); }
.social-btn:hover { background: var(--teal-light); border-color: var(--teal); color: var(--teal); }
.qr-block { text-align: center; padding: 24px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.qr-block img { width: 180px; height: 180px; margin: 0 auto 12px; }

/* Auth pages */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
@media (max-width: 768px) { .auth-page { grid-template-columns: 1fr; } }
.auth-panel { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 60px 40px; min-height: 100vh; }
.auth-panel--brand { background: var(--teal); color: white; position: sticky; top: 0; }
@media (max-width: 768px) { .auth-panel--brand { display: none; } }
.auth-brand-tagline { font-family: var(--font-serif); font-size: 2rem; font-weight: 600; line-height: 1.3; margin-top: 24px; }
.auth-brand-sub { opacity: .75; margin-top: 12px; font-size: .95rem; line-height: 1.6; }
.auth-feature-list { margin-top: 40px; display: flex; flex-direction: column; gap: 16px; }
.auth-feature { display: flex; align-items: flex-start; gap: 12px; font-size: .9rem; opacity: .85; }
.auth-form-wrap { width: 100%; max-width: 420px; }
.auth-logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-serif); font-size: 1.2rem; font-weight: 600; margin-bottom: 40px; }
.auth-title { font-family: var(--font-serif); font-size: 1.7rem; font-weight: 600; margin-bottom: 8px; }
.auth-subtitle { color: var(--muted); font-size: .9rem; margin-bottom: 32px; }
.passkey-btn { width: 100%; padding: 16px; border-radius: var(--radius-lg); border: 2px solid var(--teal); background: var(--teal-light); color: var(--teal); font-size: 1rem; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 12px; transition: all var(--transition); }
.passkey-btn:hover { background: var(--teal); color: white; }
.passkey-btn:disabled { opacity: .5; cursor: not-allowed; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 24px 0; color: var(--muted); font-size: .8rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-footer { margin-top: 28px; text-align: center; font-size: .875rem; color: var(--muted); }
.auth-footer a { color: var(--teal); font-weight: 500; }

/* Onboarding stepper */
.stepper { display: flex; align-items: center; gap: 8px; margin-bottom: 40px; }
.stepper-step { display: flex; align-items: center; gap: 8px; font-size: .875rem; }
.stepper-num { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 600; color: var(--muted); flex-shrink: 0; }
.stepper-step.active .stepper-num { border-color: var(--teal); background: var(--teal); color: white; }
.stepper-step.done   .stepper-num { border-color: var(--green); background: var(--green); color: white; }
.stepper-label { color: var(--muted); }
.stepper-step.active .stepper-label { color: var(--ink); font-weight: 500; }
.stepper-divider { flex: 1; height: 1px; background: var(--border); }

/* Admin */
.admin-layout  { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.admin-sidebar { background: var(--ink); color: rgba(255,255,255,.75); padding: 28px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-sidebar-brand { padding: 0 20px 28px; border-bottom: 1px solid rgba(255,255,255,.1); display: flex; align-items: center; gap: 10px; }
.admin-sidebar-brand span { font-family: var(--font-serif); color: white; font-size: 1.1rem; }
.admin-nav     { padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; }
.admin-nav-item { padding: 9px 12px; border-radius: var(--radius-sm); font-size: .875rem; color: rgba(255,255,255,.65); display: flex; align-items: center; gap: 10px; transition: background var(--transition), color var(--transition); }
.admin-nav-item:hover  { background: rgba(255,255,255,.08); color: white; }
.admin-nav-item.active { background: rgba(26,107,107,.4); color: white; }
.admin-main    { background: var(--sand); padding: 40px; overflow-y: auto; }
.admin-header  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.admin-title   { font-family: var(--font-serif); font-size: 1.6rem; font-weight: 600; }
@media (max-width: 900px) { .admin-layout { grid-template-columns: 1fr; } .admin-sidebar { display: none; } }

/* Builder */
.builder-layout  { display: grid; grid-template-columns: 360px 1fr; gap: 0; min-height: calc(100vh - 60px); }
.builder-panel   { background: var(--white); border-right: 1px solid var(--border); overflow-y: auto; display: flex; flex-direction: column; }
.builder-panel-header { padding: 20px 24px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--white); z-index: 2; }
.builder-panel-body   { padding: 24px; flex: 1; }
.builder-preview      { background: var(--sand); display: flex; flex-direction: column; }
.builder-preview-bar  { padding: 12px 20px; background: var(--white); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.preview-device-btn   { padding: 6px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); font-size: .8rem; cursor: pointer; transition: all var(--transition); background: transparent; }
.preview-device-btn.active { background: var(--teal); color: white; border-color: var(--teal); }
.builder-frame  { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 32px; overflow: auto; }
.builder-frame iframe { background: white; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); border: none; }
@media (max-width: 960px) { .builder-layout { grid-template-columns: 1fr; } .builder-preview { display: none; } }

/* Section helpers */
.section        { margin-bottom: 40px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-title  { font-size: 1rem; font-weight: 600; }
.divider        { height: 1px; background: var(--border); margin: 28px 0; }

/* Empty states */
.empty-state      { text-align: center; padding: 60px 24px; }
.empty-state-icon { width: 64px; height: 64px; background: var(--sand-dark); border-radius: var(--radius-xl); margin: 0 auto 20px; display: flex; align-items: center; justify-content: center; }
.empty-state-title{ font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; }
.empty-state-desc { color: var(--muted); font-size: .9rem; max-width: 360px; margin: 0 auto 24px; line-height: 1.6; }

/* Toasts */
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: var(--ink); color: white; padding: 14px 18px; border-radius: var(--radius-md); font-size: .875rem; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px; pointer-events: auto; animation: slideUp .25s ease; max-width: 320px; }
.toast-success { background: var(--green); }
.toast-error   { background: var(--red); }

/* Animations */
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes fadeIn  { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.fade-in { animation: fadeIn .25s ease both; }

/* Utilities */
.sr-only    { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.items-center     { align-items: center; }
.justify-between  { justify-content: space-between; }
.justify-center   { justify-content: center; }
.gap-2 { gap: 8px; }   .gap-3 { gap: 12px; }  .gap-4 { gap: 16px; }  .gap-6 { gap: 24px; }
.w-full { width: 100%; }
.mt-2 { margin-top: 8px; }   .mt-4 { margin-top: 16px; }  .mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.p-4 { padding: 16px; }   .p-6 { padding: 24px; }
.rounded    { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.truncate   { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid-2     { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3     { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
[x-cloak]   { display: none !important; }
