:root {
  --bg: #0d1117;
  --bg-soft: #161b22;
  --bg-card: #1c2128;
  --text: #e6edf3;
  --text2: #8b949e;
  --accent: #7ee787;
  --accent-dim: rgba(126,231,135,0.12);
  --accent-glow: rgba(126,231,135,0.25);
  --blue: #58a6ff;
  --border: rgba(255,255,255,0.07);
  --red: #f85149;
  --mono: 'Courier New', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* NAVBAR */
.navbar {
  width: 100%;
  background: rgba(13,17,23,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 5%;
}
.logo {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  color: var(--accent);
  font-size: 1.3rem;
  text-decoration: none;
}
.nav-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 6px 16px;
  font-size: 0.82rem;
  color: var(--text2);
}
.nav-pill strong {
  color: var(--accent);
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
}
.nav-badge {
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 20px;
  padding: 2px 9px;
  font-size: 0.7rem;
  font-weight: 600;
  border: 1px solid rgba(126,231,135,0.2);
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text2);
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* WORKSPACE */
.workspace {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* LEFT PANEL */
.left-panel {
  width: 440px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  overflow-y: scroll;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}
.left-panel::-webkit-scrollbar { width: 5px; }
.left-panel::-webkit-scrollbar-track { background: transparent; }
.left-panel::-webkit-scrollbar-thumb { background: #30363d; border-radius: 3px; }

/* SECTION CARDS */
.section {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: border-color .2s;
  flex-shrink: 0;
}
.section:hover { border-color: rgba(126,231,135,0.18); }

.section-header {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}
.section-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.section-arrow {
  color: var(--text2);
  font-size: 10px;
  transition: transform .2s;
}
.section-body {
  display: none;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--border);
  flex-direction: column;
  gap: 9px;
}
.section.open .section-body { display: flex; }
.section.open .section-arrow { transform: rotate(0deg); }
.section:not(.open) .section-arrow { transform: rotate(-90deg); }

/* FIELDS */
.field-row { display: flex; align-items: flex-start; gap: 10px; }
.field-label {
  width: 108px; flex-shrink: 0;
  font-size: 12px; color: var(--text2);
  padding-top: 7px;
}
.field-label small {
  display: block; font-size: 10px;
  color: #484f58; margin-top: 1px; line-height: 1.3;
}

input[type="text"],
input[type="number"],
select,
textarea {
  background: var(--bg);
  border: 1px solid #30363d;
  border-radius: 10px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  padding: 6px 10px;
  width: 100%;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
input::placeholder, textarea::placeholder { color: #484f58; }
select option { background: var(--bg-soft); }
textarea { resize: vertical; min-height: 52px; }

/* TOGGLE */
.toggle-row { display: flex; align-items: center; gap: 10px; }
.toggle {
  width: 38px; height: 21px;
  background: #30363d;
  border-radius: 11px;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: background .2s;
}
.toggle.on { background: var(--accent); }
.toggle::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: #fff;
  transition: left .2s;
}
.toggle.on::after { left: 20px; }
.toggle-label { font-size: 12px; color: var(--text2); }

/* NAME TRIPLE */
.name-triple { display: flex; gap: 5px; flex: 1; align-items: center; }
.name-triple input { flex: 1; min-width: 0; }
.name-sep { color: #484f58; font-size: 12px; flex-shrink: 0; }

/* LIST */
.list-editor { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.list-item { display: flex; gap: 6px; align-items: center; }
.list-item input { flex: 1; }

.ingr-row { display: flex; gap: 5px; align-items: center; }
.ingr-mat { flex: 3; }
.ingr-amt { flex: 1; min-width: 0; }
.ingr-sep { color: #484f58; font-size: 11px; flex-shrink: 0; }

.eff-row { display: flex; gap: 5px; align-items: center; }
.eff-type { flex: 3; }
.eff-lvl, .eff-dur { flex: 1; min-width: 0; }

.btn-remove {
  background: transparent;
  border: 1px solid #30363d;
  border-radius: 8px;
  color: var(--red);
  cursor: pointer;
  width: 28px; height: 28px;
  font-size: 14px;
  flex-shrink: 0;
  transition: background .15s, border-color .15s;
  line-height: 1;
}
.btn-remove:hover { background: rgba(248,81,73,0.12); border-color: var(--red); }

.btn-add {
  background: transparent;
  border: 1px dashed #30363d;
  border-radius: 10px;
  color: var(--text2);
  cursor: pointer;
  padding: 5px 12px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  width: 100%;
  transition: all .15s;
  text-align: left;
}
.btn-add:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* COLOR */
.color-row { display: flex; gap: 8px; align-items: center; flex: 1; }
.color-swatch {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid #30363d;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}

/* RIGHT */
.right-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.yaml-toolbar {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.yaml-toolbar-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex: 1;
}
.btn-copy {
  background: var(--accent);
  border: none;
  border-radius: 20px;
  color: #0d1117;
  cursor: pointer;
  padding: 8px 24px;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 800;
  transition: transform .2s, box-shadow .2s;
}
.btn-copy:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-glow);
}
.yaml-output {
  flex: 1;
  overflow-y: auto;
  padding: 22px 24px;
}
.yaml-output::-webkit-scrollbar { width: 5px; }
.yaml-output::-webkit-scrollbar-track { background: transparent; }
.yaml-output::-webkit-scrollbar-thumb { background: #30363d; border-radius: 3px; }

pre {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-all;
}

/* YAML COLORS */
.y-id  { color: #58a6ff; font-weight: 700; }
.y-key { color: #7ee787; }
.y-str { color: #f0c87b; }
.y-num { color: #79c0ff; }
.y-t   { color: #56d4b0; }
.y-f   { color: #f85149; }
.y-bul { color: #484f58; }

/* TOAST */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--accent);
  color: #0d1117;
  padding: 10px 22px;
  border-radius: 20px;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  transform: translateY(12px);
  transition: all .25s;
  pointer-events: none;
  z-index: 9999;
}
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 860px) {
  .left-panel { width: 320px; }
  .nav-pill { display: none; }
}
@media (max-width: 620px) {
  body { height: auto; overflow: auto; }
  .workspace { flex-direction: column; }
  .left-panel { width: 100%; max-height: 55vh; border-right: none; border-bottom: 1px solid var(--border); }
  .nav-right { display: none; }
}

.server-status {
  margin-top: -20px;
  margin-bottom: 30px;
  font-size: 1rem;
  opacity: 0.9;
}

#server-online {
  color: var(--accent);
  font-weight: 600;
}

/* SERVER STATUS BOX */

.server-box {
  margin-top: 30px;
  background: rgba(22, 27, 34, 0.9);
  border-radius: 18px;
  padding: 18px 22px;

  display: flex;
  justify-content: space-between;
  align-items: center;

  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.server-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.server-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #777;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.server-status-dot.online {
  background: #7ee787;
  box-shadow: 0 0 10px rgba(126, 231, 135, 0.8);
}

.server-name {
  font-weight: 600;
  font-size: 1rem;
}

.server-meta {
  font-size: 0.9rem;
  opacity: .8;
}