:root {
  --bg:           #09090b;
  --surface:      #0f1012;
  --surface2:     #16181c;
  --surface3:     #1c1f24;
  --border:       #1e2126;
  --border-mid:   #272c33;
  --border-bright:#303540;
  --accent:       #e8703a;
  --accent-dim:   rgba(232,112,58,0.12);
  --accent-glow:  rgba(232,112,58,0.08);
  --accent2:      #6ee7b7;
  --accent2-dim:  rgba(110,231,183,0.12);
  --accent3:      #818cf8;
  --accent3-dim:  rgba(129,140,248,0.12);
  --text:         #e1e4ea;
  --text-dim:     #60677a;
  --text-muted:   #343840;
  --mono:         'JetBrains Mono', monospace;
  --display:      'Syne', sans-serif;
  --radius:       8px;
  --radius-sm:    5px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}
.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto 1fr;
  min-height: 100vh;
  max-width: 1440px;
  margin: 0 auto;
}
header {
  grid-column: 1 / -1;
  padding: 22px 36px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(9,9,11,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 110;
}
.logo-area h1 {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1;
}
.logo-area h1 span { color: var(--accent); }
.logo-area p {
  color: var(--text-dim);
  font-size: 10px;
  margin-top: 5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.badge {
  background: var(--surface2);
  border: 1px solid var(--border-mid);
  color: var(--text-dim);
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  transition: all 0.2s;
  white-space: nowrap;
}
.badge.has-items {
  background: var(--accent2-dim);
  border-color: rgba(110,231,183,0.3);
  color: var(--accent2);
}
.btn-clear {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  background: transparent;
  border: 1px solid var(--border-mid);
  color: var(--text-dim);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-clear:hover {
  border-color: #e05252;
  color: #e05252;
  background: rgba(224,82,82,0.06);
}
.btn-clear:active { transform: scale(0.97); }
.main-content {
  padding: 28px 32px 80px;
  overflow-y: auto;
  height: calc(100vh - 114px);
  border-right: 1px solid var(--border);
  scroll-behavior: smooth;
}
.sidebar {
  position: sticky;
  top: 114px;
  height: calc(100vh - 114px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-header h2 {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.sidebar-header p {
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.03em;
}
.script-preview {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  background: #060709;
}
.script-preview pre {
  font-size: 12px;
  line-height: 1.75;
  color: #6a7d96;
  white-space: pre-wrap;
  word-break: break-all;
}
.script-preview .sh-comment { color: #343d4d; }
.script-preview .sh-cmd     { color: #5cb88e; }
.script-preview .sh-flag    { color: #7c86e0; }
.script-preview .sh-section { color: var(--accent); font-weight: 600; }
.script-preview .sh-string  { color: #d4a64a; }
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  background: var(--surface);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  letter-spacing: 0.04em;
  width: 100%;
}
.btn-primary {
  background: var(--accent);
  color: #0b0d0f;
}
.btn-primary:hover  { background: #f07a44; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(232,112,58,0.3); }
.btn-primary:active { transform: translateY(0); box-shadow: none; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-mid);
  color: var(--text-dim);
}
.btn-ghost:hover { border-color: var(--border-bright); color: var(--text); background: var(--surface2); }
.section {
  margin-bottom: 40px;
  scroll-margin-top: 20px;
}
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.section-icon {
  width: 3px;
  height: 28px;
  border-radius: 2px;
  flex-shrink: 0;
  align-self: center;
}
.section-title {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.section-subtitle {
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 2px;
  letter-spacing: 0.02em;
}
.section-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-dim);
  background: var(--surface2);
  border: 1px solid var(--border-mid);
  padding: 2px 9px;
  border-radius: 20px;
  transition: all 0.2s;
  white-space: nowrap;
}
.section-count.has-items {
  background: var(--accent2-dim);
  border-color: rgba(110,231,183,0.3);
  color: var(--accent2);
}
.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 6px;
}
.option-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  user-select: none;
  display: flex;
  align-items: center;
}
.option-card:hover {
  border-color: var(--border-bright);
  background: var(--surface2);
}
.option-card.selected {
  border-color: rgba(110,231,183,0.45);
  background: rgba(110,231,183,0.04);
}
.check-box {
  width: 15px;
  height: 15px;
  border: 1px solid var(--border-bright);
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--bg);
  font-size: 9px;
  margin-right: 9px;
  transition: all 0.12s;
}
.option-card.selected .check-box {
  background: var(--accent2);
  border-color: var(--accent2);
  color: #06100a;
}
.option-label {
  font-size: 13px;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.option-card.selected .option-label { color: #d1f5e8; }
.option-tag {
  display: inline-block;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 6px;
  background: var(--surface3);
  color: var(--text-muted);
  border: 1px solid var(--border);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.option-card.selected .option-tag { opacity: 0.5; }
.radio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
}
.radio-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  user-select: none;
  display: flex;
  align-items: center;
}
.radio-card:hover { border-color: var(--border-bright); background: var(--surface2); }
.radio-card.selected { border-color: rgba(129,140,248,0.45); background: var(--accent3-dim); }
.radio-dot {
  width: 13px;
  height: 13px;
  border: 1px solid var(--border-bright);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 9px;
  flex-shrink: 0;
  background: var(--bg);
  transition: all 0.12s;
  position: relative;
}
.radio-dot::after {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent3);
  opacity: 0;
  transition: opacity 0.12s;
}
.radio-card.selected .radio-dot { border-color: var(--accent3); }
.radio-card.selected .radio-dot::after { opacity: 1; }
.radio-label { font-size: 13px; color: var(--text); }
.radio-card.selected .radio-label { color: #c7d2fe; }
.php-grid { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.php-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 18px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  user-select: none;
  text-align: center;
  min-width: 80px;
}
.php-card:hover { border-color: var(--border-bright); background: var(--surface2); }
.php-card.selected { border-color: rgba(232,112,58,0.5); background: var(--accent-dim); }
.php-version { font-size: 14px; font-weight: 700; letter-spacing: -0.3px; }
.php-sub { font-size: 11px; color: var(--text-dim); margin-top: 3px; letter-spacing: 0.02em; }
.php-card.selected .php-version { color: var(--accent); }
.php-card.selected .php-sub { color: rgba(232,112,58,0.6); }
.section-controls { display: flex; gap: 6px; margin-bottom: 10px; }
.ctrl-btn {
  font-family: var(--mono);
  font-size: 11px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s;
  letter-spacing: 0.04em;
}
.ctrl-btn:hover { border-color: var(--border-bright); color: var(--text); background: var(--surface2); }
.ext-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.ext-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 11px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.12s;
  user-select: none;
  color: var(--text-dim);
}
.ext-pill:hover { border-color: var(--border-bright); color: var(--text); }
.ext-pill.selected {
  background: var(--accent-dim);
  border-color: rgba(232,112,58,0.4);
  color: var(--accent);
}
.subsection-label {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.ext-controls { display: flex; gap: 5px; }
.empty-preview {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 2.2;
}
.version-tag {font-size: 10px; color: var(--text-dim)}
.empty-preview .icon { display: none; }
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(70px);
  background: var(--surface3);
  border: 1px solid var(--border-mid);
  color: var(--text);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: var(--radius);
  z-index: 9999;
  transition: transform 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-bright); }

@media (max-width: 900px) {
  .sidebar {
    position: static;
    height: auto;
    max-height: 380px;
    border-top: 1px solid var(--border);
  }
  .main-content { height: auto; }
  header { padding: 14px 18px; }
  .main-content { padding: 18px; }
}
