:root {
  color-scheme: light dark;

  /* Modern Color Palette */
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --primary-300: #93c5fd;
  --primary-400: #60a5fa;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --primary-800: #1e40af;
  --primary-900: #1e3a8a;
  --primary-950: #172554;

  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --gray-950: #030712;

  --success-50: #f0fdf4;
  --success-100: #dcfce7;
  --success-200: #bbf7d0;
  --success-300: #86efac;
  --success-400: #4ade80;
  --success-500: #22c55e;
  --success-600: #16a34a;
  --success-700: #15803d;
  --success-800: #166534;
  --success-900: #14532d;

  --warning-50: #fffbeb;
  --warning-100: #fef3c7;
  --warning-200: #fde68a;
  --warning-300: #fcd34d;
  --warning-400: #fbbf24;
  --warning-500: #f59e0b;
  --warning-600: #d97706;
  --warning-700: #b45309;
  --warning-800: #92400e;
  --warning-900: #78350f;

  --danger-50: #fef2f2;
  --danger-100: #fee2e2;
  --danger-200: #fecaca;
  --danger-300: #fca5a5;
  --danger-400: #f87171;
  --danger-500: #ef4444;
  --danger-600: #dc2626;
  --danger-700: #b91c1c;
  --danger-800: #991b1b;
  --danger-900: #7f1d1d;

  /* Theme Variables */
  --background-color: light-dark(#ffffff, #0f172a);
  --surface-color: light-dark(var(--gray-50), var(--gray-900));
  --surface-elevated: light-dark(#ffffff, var(--gray-800));
  --text-color: light-dark(var(--gray-900), var(--gray-100));
  --text-muted: light-dark(var(--gray-600), var(--gray-400));
  --text-subtle: light-dark(var(--gray-500), var(--gray-500));
  --inverted-text-color: light-dark(var(--gray-100), var(--gray-900));

  /* Component Colors */
  --link-color: var(--primary-600);
  --link-hover: var(--primary-700);
  --border-color: light-dark(var(--gray-200), var(--gray-700));
  --border-subtle: light-dark(var(--gray-100), var(--gray-800));
  --shadow-sm: light-dark(0 1px 2px 0 rgb(0 0 0 / 0.05), 0 1px 2px 0 rgb(0 0 0 / 0.3));
  --shadow-md: light-dark(0 4px 6px -1px rgb(0 0 0 / 0.1), 0 4px 6px -1px rgb(0 0 0 / 0.4));
  --shadow-lg: light-dark(0 10px 15px -3px rgb(0 0 0 / 0.1), 0 10px 15px -3px rgb(0 0 0 / 0.4));

  --remove-link-color: light-dark(var(--danger-600), var(--danger-400));
  --example-text-color: light-dark(var(--gray-700), var(--gray-300));
  --example-border-color: light-dark(var(--gray-300), var(--gray-600));

  --step-background: light-dark(var(--primary-50), var(--primary-900));
  --step-hover-background: light-dark(var(--primary-100), var(--primary-800));
  --builtin-step-background: light-dark(var(--success-50), var(--success-900));
  --builtin-step-hover-background: light-dark(var(--success-100), var(--success-800));
  --builtin-step-border: light-dark(var(--success-200), var(--success-700));
  --mine-step-background: light-dark(var(--warning-50), var(--warning-900));
  --mine-step-hover-background: light-dark(var(--warning-100), var(--warning-800));
  --mine-step-border: light-dark(var(--warning-200), var(--warning-700));

  --button-background: light-dark(#ffffff, var(--gray-800));
  --button-hover-background: light-dark(var(--gray-50), var(--gray-700));
  --button-border: light-dark(var(--gray-300), var(--gray-600));
  --primary-button-background: var(--primary-600);
  --primary-button-hover: var(--primary-700);

  --download-button-background: light-dark(var(--success-100), var(--success-800));
  --download-button-border: light-dark(var(--success-300), var(--success-600));
  --download-button-hover-background: light-dark(var(--success-200), var(--success-700));
  --download-button-hover-border: light-dark(var(--success-400), var(--success-500));
  --download-button-hover-text: light-dark(var(--success-800), var(--success-100));

  /* Typography */
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  --font-size-5xl: 3rem;

  --line-height-tight: 1.25;
  --line-height-snug: 1.375;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;
  --line-height-loose: 2;

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Spacing */
  --spacing-1: 0.25rem;
  --spacing-2: 0.5rem;
  --spacing-3: 0.75rem;
  --spacing-4: 1rem;
  --spacing-5: 1.25rem;
  --spacing-6: 1.5rem;
  --spacing-8: 2rem;
  --spacing-10: 2.5rem;
  --spacing-12: 3rem;
  --spacing-16: 4rem;
  --spacing-20: 5rem;

  /* Border Radius */
  --radius-sm: 0.125rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms;
  --transition-normal: 200ms;
  --transition-slow: 300ms;
  --transition-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  background-color: var(--background-color);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-optical-sizing: auto;
  color: var(--text-color);
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  font-weight: var(--font-weight-normal);
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  padding: 0;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: var(--spacing-6) var(--spacing-4);
  background: linear-gradient(135deg, var(--background-color) 0%, var(--surface-color) 100%);
  min-height: 100vh;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--spacing-6);
  padding: var(--spacing-8) 0;
  margin-bottom: var(--spacing-8);
  background: var(--surface-elevated);
  border-radius: var(--radius-2xl);
  padding: var(--spacing-8);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(8px);
}

header h1 {
  text-wrap: balance;
  flex-shrink: 0;
}

dialog {
  border: none;
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  padding: var(--spacing-8);
  background: var(--surface-elevated);
  color: var(--text-color);
  backdrop-filter: blur(8px);
  max-width: 90vw;
  max-height: 90vh;
}

dialog::backdrop {
  background: rgb(0 0 0 / 0.5);
  backdrop-filter: blur(4px);
}

dialog h2 {
  margin-top: 0;
  color: var(--text-color);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-xl);
  margin-bottom: var(--spacing-4);
}

header > div {
  flex-grow: 1;
}

header p {
  line-height: var(--line-height-relaxed);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  margin: var(--spacing-4) 0 0 0;
  max-width: 60ch;
}

summary {
  cursor: pointer;
  transition: color var(--transition-fast) var(--transition-ease);
}

summary:hover {
  color: var(--primary-600);
}

input, select, textarea {
  padding: var(--spacing-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  color: var(--text-color);
  font-size: var(--font-size-sm);
  transition: all var(--transition-fast) var(--transition-ease);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
}

input:hover, select:hover, textarea:hover {
  border-color: var(--primary-400);
}

h1 {
  font-family: 'EB Garamond', Georgia, serif;
  font-optical-sizing: auto;
  font-weight: var(--font-weight-bold);
  font-style: normal;
  font-size: clamp(var(--font-size-3xl), 5vw, var(--font-size-5xl));
  margin: 0;
  line-height: var(--line-height-tight);
  background: linear-gradient(135deg, var(--primary-600), var(--primary-800));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.025em;
}

a:any-link {
  color: var(--link-color);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: all var(--transition-fast) var(--transition-ease);
}

a:any-link:hover {
  color: var(--link-hover);
  text-decoration: none;
  transform: translateY(-1px);
}

#blueprint-builder {
  display: flex;
  margin-top: var(--spacing-8);
  flex-wrap: wrap;
  gap: var(--spacing-16) var(--spacing-4);
  background: var(--surface-elevated);
  border-radius: var(--radius-2xl);
  padding: var(--spacing-8);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-subtle);
}

.arrow {
  margin-top: var(--spacing-20);
  font-size: var(--font-size-2xl);
  color: var(--primary-500);
  font-weight: var(--font-weight-bold);
  display: flex;
  align-items: center;
  justify-content: center;
}

#steps-group {
  display: flex;
}

#step-library-holder {
  width: 280px;
  min-height: 600px;
  border: 1px solid var(--border-color);
  border-right-width: 0;
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-xl);
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  flex: 1;
  overflow: hidden;
  background: var(--surface-color);
}

#filter-holder {
  display: flex;
  flex-direction: row;
  height: auto;
  padding: var(--spacing-4);
  gap: var(--spacing-3);
  background: var(--surface-elevated);
  border-bottom: 1px solid var(--border-subtle);
}

#filter-holder label {
  white-space: nowrap;
}

#step-library {
  overflow: auto;
  min-height: 540px;
  padding: var(--spacing-2);
}

#blueprint-steps {
  width: 500px;
  min-height: 600px;
  overflow: auto;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-xl);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  z-index: 1;
  background-color: var(--surface-color);
  flex: 2;
}

#blueprint-builder > div {
  display: flex;
  flex-direction: column;
}

#steps-holder {
  flex: 3 1 0;
}

#blueprint-holder,
#blueprint-compiled-holder {
  flex: 1 1 0;
  background: var(--surface-elevated);
  border-radius: var(--radius-xl);
  padding: var(--spacing-6);
  border: 1px solid var(--border-subtle);
}

#blueprint-holder > div,
#blueprint-compiled-holder > div {
  height: auto;
  white-space: nowrap;
  font-weight: var(--font-weight-semibold);
  color: var(--text-color);
  margin-bottom: var(--spacing-4);
  font-size: var(--font-size-lg);
}

#title-holder {
  height: auto;
  margin-bottom: var(--spacing-6);
  padding: var(--spacing-4);
  background: var(--surface-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

#title-holder input {
  width: 100%;
  max-width: 500px;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
  padding: var(--spacing-4);
}

textarea#blueprint, textarea#blueprint-compiled {
  height: 520px;
  width: 100%;
  border: 1px solid var(--border-color);
  padding: var(--spacing-4);
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
  white-space: pre-wrap;
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-lg);
  background: var(--surface-elevated);
  resize: vertical;
  transition: all var(--transition-normal) var(--transition-ease);
}

textarea#blueprint:focus, textarea#blueprint-compiled:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1), var(--shadow-md);
}

.step {
  padding: var(--spacing-4);
  margin: var(--spacing-2);
  border: 1px solid var(--border-color);
  background-color: var(--step-background);
  color: var(--text-color);
  cursor: pointer;
  border-radius: var(--radius-lg);
  z-index: 3;
  transition: all var(--transition-normal) var(--transition-ease);
  position: relative;
  overflow: hidden;
}

.step:focus {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgb(59 130 246 / 0.1);
}

.step.builtin {
  background-color: var(--builtin-step-background);
  border-color: var(--builtin-step-border);
}

#step-library .step.builtin {
  display: none;
}

.step.mine {
  background-color: var(--mine-step-background);
  border-color: var(--mine-step-border);
}

#step-library .step.hidden,
#step-library .step.mine.hidden,
#step-library.show-builtin .step.builtin.hidden {
  display: none;
}

#step-library.show-builtin .step.builtin {
  display: block;
}

#step-library .step {
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}

#step-library .step::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-500), var(--primary-600));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-normal) var(--transition-ease);
}

#step-library .step:hover::before {
  transform: scaleX(1);
}

#step-library .step .add,
.step .options {
	display: none;
}

#step-library .step .options {
	display: block;
	float: right;
}
#step-library .step .options summary::marker {
  content: none;
}

#step-library .step .options summary::after {
  content: " +";
  float: right;
  text-align: right;
}

#step-library .step .options[open] summary::after {
  content: " -"
}
#step-library .step .options[open]  {
  width: 100%;
}
.step .options button {
	margin-right: .5em;
}


.step .info {
  font-size: var(--font-size-xs);
  white-space: nowrap;
  color: var(--text-subtle);
  margin-top: var(--spacing-1);
}

.step td > input,
.step td > label {
  vertical-align: top;
}

.step td > textarea {
  vertical-align: top;
  width: 27em;
  height: 3em;
}

.step td > input[type=text] {
  width: 27em;
}

.step td > label {
  display: inline-block;
}

.step .examples {
  margin-left: 30em;
  margin-top: -2.7em;
  font-size: 13px;
}

.step .examples[open] {
  margin-left: 0;
  margin-top: 0;
}

.step .remove {
  margin-left: 2em;
}

.step .remove:any-link {
  color: var(--remove-link-color);
  text-decoration: none;
  margin-top: -8px;
}

#step-library-holder .step .examples,
#step-library-holder .step .info,
#step-library-holder .step .vars,
#step-library-holder .step .remove,
#blueprint-steps .step.collapsed .examples,
#blueprint-steps .step.collapsed .vars,
#blueprint-steps .step.collapsed .remove {
  display: none;
}

#blueprint-steps .step {
  overflow: clip;
}

div.header {
  display: flex;
  gap: 1em;
  line-height: 1.3;
  justify-content: right;
  align-items: flex-start;
  margin-bottom: .5em;
}

div.header span.stepname {
  flex-grow: 1;
}

div.header button, div.header a {
  line-height: 1.3;
  font-size: .9em;
}

#blueprint-steps .step .vars {
  display: block;
}

#step-library-holder .step .examples {
  display: none;
}

#blueprint-steps .step .examples {
  display: block;
}

.examples ul li {
  list-style-type: none;
  color: var(--link-color);
  text-decoration: underline;
  display: inline-block;
  margin-right: .5em;
  white-space: nowrap;
}

.examples.for-textarea ul li {
  list-style-type: none;
  color: var(--example-text-color);
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
  font-family: monospace;
  line-height: 1.3;
  vertical-align: top;
  margin-left: .5em;
  padding-left: .5em;
  border-left: 2px solid var(--example-border-color);
}

.examples ul {
  margin: 0;
  padding: 0;
}

.examples ul li:hover {
  text-decoration: none;
}

a.view-source,
#blueprint-steps .step.collapsed a.view-source,
button.save-step,
#blueprint-steps .step.collapsed button.save-step {
  display: none;
}

#blueprint-steps .step a.view-source, #blueprint-steps .step button.save-step {
  display: block;
}

table.vars tr td:first-child {
  font-weight: bold;
  width: 5em;
  vertical-align: top;
  line-height: 1.3;
  padding: .5em .5em .5em 0;
}

button,
#playground-link,
#playground-link-top,
#download-blueprint,
a.submit-to-gh,
#preview-mode,
#examples {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-tight);
  border: 1px solid var(--button-border);
  color: var(--text-color);
  background-color: var(--button-background);
  border-radius: var(--radius-lg);
  padding: var(--spacing-3) var(--spacing-4);
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-2);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition-normal) var(--transition-ease);
  white-space: nowrap;
}

button {
  padding: var(--spacing-3) var(--spacing-5);
}

button:hover,
#playground-link:hover,
#playground-link-top:hover,
#download-blueprint:hover,
#examples:hover {
  background-color: var(--button-hover-background);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: light-dark(var(--primary-300), var(--primary-600));
}

button.save-step {
  border: none;
  background-color: transparent;
  padding: 0;
  box-shadow: none;
  font-size: var(--font-size-sm);
  color: var(--link-color);
  text-decoration: underline;
  font-weight: var(--font-weight-medium);
  transition: all var(--transition-fast) var(--transition-ease);
}

button.save-step:hover {
  background-color: transparent;
  text-decoration: none;
  color: var(--link-hover);
  transform: translateY(-1px);
}

#examples {
  width: 8em;
}

#playground-link,
#playground-link-top {
  background-color: var(--primary-button-background);
  color: white;
  border-color: var(--primary-button-background);
  font-weight: var(--font-weight-semibold);
  padding: var(--spacing-4) var(--spacing-6);
}

#playground-link:hover,
#playground-link-top:hover {
  background-color: var(--primary-button-hover);
  border-color: var(--primary-button-hover);
  color: white;
}

#playground-link-holder {
  display: flex;
  width: 100%;
  gap: var(--spacing-3);
  margin-top: var(--spacing-4);
}

#playground-link {
  flex-grow: 1;
}

#copy-playground-link, #copy-playground-link-top {
  background: var(--surface-color);
  font-size: var(--font-size-lg);
  line-height: 1;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: var(--spacing-3);
  color: var(--text-muted);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast) var(--transition-ease);
}
#copy-playground-link-top:hover,
#copy-playground-link:hover {
  background-color: light-dark(var(--primary-100), var(--primary-900));
  color: light-dark(var(--primary-700), var(--primary-200));
  border-color: light-dark(var(--primary-300), var(--primary-600));
  transform: translateY(-1px);
}

#playground-link-top {
  display: none;
  font-size: 13.3px;
}
#copy-playground-link-top {
  display: none;
}

#playground-link:any-link,
#playground-link-top:any-link {
  color: white;
}

#playground-link:hover,
#playground-link-top:hover,
.step:hover,
.step:focus {
  background-color: var(--step-hover-background);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

#download-blueprint:any-link {
  color: var(--text-color);
  margin-top: var(--spacing-3);
  padding: var(--spacing-4) var(--spacing-6);
  background-color: var(--download-button-background);
  border-color: var(--download-button-border);
  font-weight: var(--font-weight-medium);
}

#download-blueprint:hover {
  background-color: var(--download-button-hover-background);
  border-color: var(--download-button-hover-border);
  color: var(--download-button-hover-text);
}

.step.builtin:hover,.step.builtin:focus {
  background-color: var(--builtin-step-hover-background);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--builtin-step-border);
}
.step.mine:hover,.step.mine:focus {
  background-color: var(--mine-step-hover-background);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--mine-step-border);
}

#view-source iframe {
  width: 800px;
  height: 600px;
}

#blueprint-compiled {
  margin-bottom: 1em;
}

#further-options {
  background: var(--surface-elevated);
  border-radius: var(--radius-lg);
  padding: var(--spacing-4);
  border: 1px solid var(--border-subtle);
  margin-top: var(--spacing-6);
}

#further-options summary {
  font-weight: var(--font-weight-semibold);
  color: var(--text-color);
  padding: var(--spacing-2) 0;
}

#further-options div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-4);
  margin-top: var(--spacing-4);
}

#further-options label {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-color);
}

#draghint {
  margin: var(--spacing-8) var(--spacing-6);
  padding: var(--spacing-8);
  background: var(--surface-elevated);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-xl);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  transition: all var(--transition-normal) var(--transition-ease);
}

#draghint:hover {
  border-color: var(--primary-400);
  background: light-dark(var(--primary-50), var(--primary-950));
  color: light-dark(var(--primary-700), var(--primary-300));
}

#top-buttons {
  white-space: nowrap;
  display: flex;
  gap: var(--spacing-3);
  align-items: center;
  flex-wrap: wrap;
}

#linked-textarea {
  width: min(60vw, 800px);
  height: min(30vw, 400px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: var(--spacing-4);
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
  background: var(--surface-elevated);
}

button.code-editor {
  margin-left: 1em;
}

#autoredirecting {
  text-align: center;
}
#autoredirecting div {
  display: flex;
  justify-content: space-around;
}

@media (max-width: 734px) {
  #blueprint-builder {
    flex-direction: column;
    width: 100%;
  }

  #title-holder {
    margin-top: 0;
  }


  #playground-link-top, #copy-playground-link-top {
    display: inline-block;
  }

  #blueprint-steps .step a.view-source {
    display: none;
  }
}

/* Split view styles */
body.split-view-right #blueprint-builder {
  margin-top: 0;
  flex-direction: column;
  width: 100%;
}
body.split-view-right #title-holder,
body.split-view-bottom #title-holder {
  margin-top: 0;
}

body.split-view-right #playground-link-top,
body.split-view-right #copy-playground-link-top {
  display: inline-block;
}

body.split-view-right #blueprint-steps .step a.view-source {
  display: none;
}

body.split-view-right #blueprint-compiled-holder {
  display: none;
}

/* Apply mobile-like styles when in right split view (narrow layout) */
body.split-view-right #blueprint-builder {
  flex-direction: column;
  width: 100%;
}

body.split-view-right #playground-link-top {
  display: inline-block;
}

body.split-view-right #blueprint-steps .step a.view-source {
  display: none;
}

body.split-view-bottom,
body.split-view-right {
  height: 100vh;
  overflow: hidden;
}

body.split-view-bottom #split-view-wrapper,
body.split-view-right #split-view-wrapper {
  position: relative;
  height: calc(100vh - 100px); /* Account for header height */
}

/* Bottom split view */
body.split-view-bottom #blueprint-builder {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  overflow: auto;
}

body.split-view-bottom #split-view-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  display: block !important;
  border-top: 2px solid var(--border-color);
  z-index: 5;
}

/* Right split view */
body.split-view-right #blueprint-builder {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  overflow: auto;
}

body.split-view-right #split-view-container {
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  display: block !important;
  border-left: 2px solid var(--border-color);
}

body.split-view-bottom #playground-iframe,
body.split-view-right #playground-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Wizard Mode Styles */
#wizard-mode-toggle {
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  color: white;
  border: none;
  font-weight: var(--font-weight-semibold);
  box-shadow: var(--shadow-md);
}

#wizard-mode-toggle:hover {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

#wizard-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--background-color);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#wizard-header {
  background: var(--surface-elevated);
  border-bottom: 1px solid var(--border-color);
  padding: var(--spacing-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

#wizard-progress {
  display: flex;
  gap: var(--spacing-8);
  align-items: center;
}

.wizard-step-indicator {
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
  position: relative;
  transition: all var(--transition-normal) var(--transition-ease);
}

.step-number {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  transition: all var(--transition-normal) var(--transition-ease);
}

.wizard-step-indicator.active .step-number {
  background: var(--primary-500);
  color: white;
}

.wizard-step-indicator.completed .step-number {
  background: var(--success-500);
  color: white;
}

.step-title {
  font-weight: var(--font-weight-medium);
  color: var(--text-muted);
  transition: color var(--transition-normal) var(--transition-ease);
}

.wizard-step-indicator.active .step-title {
  color: var(--text-color);
  font-weight: var(--font-weight-semibold);
}

.wizard-step-indicator.completed .step-title {
  color: var(--text-color);
}

#wizard-close {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: var(--spacing-2) var(--spacing-4);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  transition: all var(--transition-fast) var(--transition-ease);
}

#wizard-close:hover {
  background: light-dark(var(--danger-100), var(--danger-900));
  border-color: light-dark(var(--danger-300), var(--danger-600));
  color: light-dark(var(--danger-700), var(--danger-300));
}

#wizard-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-8);
  background: var(--surface-color);
}

.wizard-step {
  max-width: 800px;
  margin: 0 auto;
}

.wizard-step h2 {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--spacing-4);
  color: var(--text-color);
}

.wizard-step p {
  font-size: var(--font-size-lg);
  color: var(--text-muted);
  margin-bottom: var(--spacing-8);
  line-height: var(--line-height-relaxed);
}

.wizard-form-group {
  margin-bottom: var(--spacing-6);
}

.wizard-form-group label {
  display: block;
  font-weight: var(--font-weight-semibold);
  color: var(--text-color);
  margin-bottom: var(--spacing-2);
  font-size: var(--font-size-lg);
}

.wizard-form-group input,
.wizard-form-group textarea {
  width: 100%;
  padding: var(--spacing-4);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-base);
  background: var(--surface-elevated);
  transition: all var(--transition-normal) var(--transition-ease);
}

.wizard-form-group input:focus,
.wizard-form-group textarea:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
  outline: none;
}

.wizard-form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.wizard-form-group small {
  display: block;
  margin-top: var(--spacing-2);
  color: var(--text-subtle);
  font-size: var(--font-size-sm);
}

.wizard-step-categories {
  display: grid;
  gap: var(--spacing-8);
  margin-bottom: var(--spacing-8);
}

.wizard-category h3 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--spacing-4);
  color: var(--text-color);
}

.wizard-step-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--spacing-4);
}

.wizard-step-card {
  background: var(--surface-elevated);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--spacing-4);
  cursor: pointer;
  transition: all var(--transition-normal) var(--transition-ease);
}

.wizard-step-card:hover {
  border-color: var(--primary-300);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.wizard-step-card.selected {
  border-color: var(--primary-500);
  background: light-dark(var(--primary-50), var(--primary-950));
  box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
}

.wizard-step-card h4 {
  margin: 0 0 var(--spacing-2) 0;
  font-weight: var(--font-weight-semibold);
  color: var(--text-color);
}

.wizard-step-card p {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  line-height: var(--line-height-normal);
}

.wizard-selected-steps {
  background: var(--surface-elevated);
  border-radius: var(--radius-xl);
  padding: var(--spacing-6);
  border: 1px solid var(--border-color);
}

.wizard-selected-steps h3 {
  margin-top: 0;
  margin-bottom: var(--spacing-4);
  color: var(--text-color);
}

#wizard-selected-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-2);
}

.wizard-selected-item {
  background: light-dark(var(--primary-100), var(--primary-900));
  color: light-dark(var(--primary-800), var(--primary-100));
  padding: var(--spacing-2) var(--spacing-3);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
}

.wizard-selected-item .remove {
  cursor: pointer;
  color: light-dark(var(--primary-600), var(--primary-300));
  font-weight: var(--font-weight-bold);
}

.wizard-selected-item .remove:hover {
  color: light-dark(var(--danger-600), var(--danger-400));
}

.wizard-summary {
  display: grid;
  gap: var(--spacing-6);
}

.wizard-summary-section {
  background: var(--surface-elevated);
  border-radius: var(--radius-lg);
  padding: var(--spacing-6);
  border: 1px solid var(--border-color);
}

.wizard-summary-section h3 {
  margin-top: 0;
  margin-bottom: var(--spacing-4);
  color: var(--text-color);
}

#wizard-final-blueprint {
  width: 100%;
  min-height: 300px;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
  background: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--spacing-4);
  resize: vertical;
}

#wizard-navigation {
  background: var(--surface-elevated);
  border-top: 1px solid var(--border-color);
  padding: var(--spacing-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 -1px 3px 0 rgb(0 0 0 / 0.1);
}

#wizard-step-info {
  font-weight: var(--font-weight-medium);
  color: var(--text-muted);
}

#wizard-prev,
#wizard-next,
#wizard-finish {
  padding: var(--spacing-3) var(--spacing-6);
  font-weight: var(--font-weight-semibold);
  border-radius: var(--radius-lg);
  transition: all var(--transition-normal) var(--transition-ease);
}

#wizard-prev {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  color: var(--text-color);
}

#wizard-prev:hover:not(:disabled) {
  background: var(--button-hover-background);
  transform: translateY(-1px);
}

#wizard-prev:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#wizard-next,
#wizard-finish {
  background: var(--primary-500);
  border: 1px solid var(--primary-500);
  color: white;
}

#wizard-next:hover,
#wizard-finish:hover {
  background: var(--primary-600);
  border-color: var(--primary-600);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

#wizard-configuration-area {
  display: grid;
  gap: var(--spacing-6);
}

.wizard-config-step {
  background: var(--surface-elevated);
  border-radius: var(--radius-lg);
  padding: var(--spacing-6);
  border: 1px solid var(--border-color);
}

.wizard-config-step h4 {
  margin-top: 0;
  margin-bottom: var(--spacing-4);
  color: var(--text-color);
  font-weight: var(--font-weight-semibold);
}

.wizard-url-input-group {
  margin-bottom: var(--spacing-6);
}

.wizard-url-input-group .wizard-form-group {
  display: flex;
  gap: var(--spacing-3);
  align-items: flex-end;
  margin-bottom: var(--spacing-2);
}

.wizard-url-input-group input {
  flex: 1;
  margin-bottom: 0;
}

.wizard-url-input-group button {
  background: var(--primary-500);
  color: white;
  border: 1px solid var(--primary-500);
  padding: var(--spacing-3) var(--spacing-4);
  border-radius: var(--radius-lg);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all var(--transition-normal) var(--transition-ease);
  white-space: nowrap;
}

.wizard-url-input-group button:hover {
  background: var(--primary-600);
  border-color: var(--primary-600);
  transform: translateY(-1px);
}

.wizard-selected-items {
  background: var(--surface-elevated);
  border-radius: var(--radius-lg);
  padding: var(--spacing-4);
  border: 1px solid var(--border-subtle);
  margin-top: var(--spacing-4);
}

.wizard-selected-items h4 {
  margin: 0 0 var(--spacing-3) 0;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--text-color);
}

.wizard-url-item {
  background: light-dark(var(--primary-100), var(--primary-900));
  color: light-dark(var(--primary-800), var(--primary-100));
  padding: var(--spacing-2) var(--spacing-3);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-2);
  gap: var(--spacing-3);
}

.wizard-url-item:last-child {
  margin-bottom: 0;
}

.wizard-url-item .url-text {
  flex: 1;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  font-size: var(--font-size-xs);
  word-break: break-all;
}

.wizard-url-item .remove {
  cursor: pointer;
  color: light-dark(var(--primary-600), var(--primary-300));
  font-weight: var(--font-weight-bold);
  padding: var(--spacing-1);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast) var(--transition-ease);
}

.wizard-url-item .remove:hover {
  color: light-dark(var(--danger-600), var(--danger-400));
  background: light-dark(var(--danger-100), var(--danger-900));
}

.wizard-selected-items .empty-state {
  color: var(--text-muted);
  font-style: italic;
  font-size: var(--font-size-sm);
  text-align: center;
  padding: var(--spacing-4);
}

@media (max-width: 1100px) {
  header {
    flex-direction: column;
  }

  #filter-holder {
    flex-direction: column;
    height: auto;
  }

  #filter-holder label {
    display: none;
  }

  #wizard-progress {
    flex-direction: column;
    gap: var(--spacing-4);
    align-items: flex-start;
  }

  .wizard-step-indicator:not(:last-child)::after {
    display: none;
  }

  .wizard-step-grid {
    grid-template-columns: 1fr;
  }

  #wizard-navigation {
    flex-direction: column;
    gap: var(--spacing-4);
  }
}
