:root {
  --bg: #0a0b0f;
  --bg-elevated: #12141c;
  --bg-card: #181b26;
  --border: rgba(255, 255, 255, 0.08);
  --text: #eef0f6;
  --text-muted: #8b90a5;
  --accent: #10b981;
  --accent-dim: rgba(16, 185, 129, 0.15);
  --accent-glow: rgba(16, 185, 129, 0.35);
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --font: "DM Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", monospace;
  --sidebar-w: 260px;
  --topbar-h: 64px;
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(16, 185, 129, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 90% 100%, rgba(59, 130, 246, 0.08), transparent);
  pointer-events: none;
  z-index: 0;
}

.app {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: rgba(18, 20, 28, 0.92);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar__logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 4px 20px var(--accent-glow);
  line-height: 0;
}

.sidebar__logo img {
  width: 100%;
  height: 100%;
  display: block;
}

.sidebar__brand strong {
  display: block;
  font-size: 1rem;
}

.sidebar__brand span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.sidebar__nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
  width: 100%;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-icon {
  opacity: 0.7;
  font-size: 1.1rem;
}

.sidebar__footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.status-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning);
  animation: pulse 2s infinite;
}

.status-pill.online .dot {
  background: var(--accent);
}

.status-pill.offline .dot {
  background: var(--danger);
  animation: none;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: 0.4
  }
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 90;
}

.menu-toggle {
  display: none;
}

/* Main */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 11, 15, 0.75);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar__title {
  font-size: 1.25rem;
  font-weight: 600;
  flex: 1;
}

.content {
  flex: 1;
  padding: 28px;
  max-width: 1400px;
}

/* Views */
.view {
  display: none;
  animation: fadeIn 0.35s ease;
}

.view--active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* Cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat-card__label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-card__value {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 4px;
}

.stat-card__badge {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.stat-card__badge.on {
  background: var(--accent-dim);
  color: var(--accent);
}

.stat-card__badge.off {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 6px;
  flex-shrink: 0;
}

.status-dot.on {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
  animation: status-pulse-on 2s infinite;
}

.status-dot.off {
  background: var(--danger);
  box-shadow: 0 0 6px var(--danger);
}

@keyframes status-pulse-on {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }

  70% {
    box-shadow: 0 0 0 5px rgba(16, 185, 129, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.stat-card__restart {
  margin-top: 10px;
  width: 100%;
}

.stat-card--split {
  grid-column: span 1;
}

@media (min-width: 901px) {
  .stat-card--split {
    grid-column: span 2;
  }
}

/* Panels */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.panel h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.panel__head h2 {
  margin: 0;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.dashboard-history-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.table-wrap--dashboard {
  max-height: min(420px, 50vh);
  overflow: auto;
}

.table-wrap--dashboard .data-table {
  font-size: 0.82rem;
}

.table-wrap--dashboard .data-table td:nth-child(2),
.table-wrap--dashboard .data-table td:nth-child(3) {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .dashboard-history-grid {
    grid-template-columns: 1fr;
  }
}

.muted {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.hint {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-bottom: 16px;
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

input,
textarea,
select {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text);
  font: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.mono,
textarea.mono {
  font-family: var(--mono);
  font-size: 0.85rem;
}

.checkbox-row {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.inline-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.inline-form input {
  flex: 1;
  min-width: 120px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all var(--transition);
}

.btn--primary {
  background: var(--accent);
  color: #041510;
}

.btn--primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn--secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn--secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn--danger {
  background: var(--danger);
  color: #fff;
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn--ghost:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn--sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.06);
}

.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Lists */
.path-list,
.select-list {
  list-style: none;
}

.path-list li,
.select-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 0.88rem;
  word-break: break-all;
}

.select-list li {
  cursor: pointer;
  transition: all var(--transition);
}

.select-list li:hover,
.select-list li.active {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}

.tag-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.78rem;
}

.tag-list button {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 1rem;
}

.folder-assign-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.folder-row {
  display: grid;
  grid-template-columns: 1fr minmax(140px, auto) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.folder-row path {
  font-size: 0.85rem;
  word-break: break-all;
}

/* Drag list */
.drag-list {
  list-style: none;
}

.drag-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: grab;
  transition: all var(--transition);
}

.drag-item:active {
  cursor: grabbing;
}

.drag-item.dragging {
  opacity: 0.5;
  border-style: dashed;
  border-color: var(--accent);
}

.drag-item.drag-over {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.drag-handle {
  color: var(--text-muted);
  font-size: 1.2rem;
  user-select: none;
}

.drag-item__body {
  flex: 1;
  min-width: 0;
}

.drag-item__title {
  font-weight: 600;
  font-size: 0.88rem;
}

.drag-item__mode {
  font-weight: 500;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-left: 6px;
}

.drag-item__mode {
  font-weight: 500;
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-left: 8px;
}

.drag-item__meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
  word-break: break-all;
}

.drag-item__actions {
  display: flex;
  gap: 6px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.tab {
  padding: 10px 18px;
  border: none;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition);
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* Table */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table th {
  text-align: left;
  padding: 12px 14px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.badge-ok {
  color: var(--accent);
}

.badge-err {
  color: var(--danger);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}

.modal__box {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: modalIn 0.3s ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.modal__box::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.modal__box::-webkit-scrollbar-track {
  background: transparent;
}

.modal__box::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
}

.modal__box::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal__body {
  padding: 24px;
}

.modal__foot {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Toast */
.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
}

.toast {
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: 0.88rem;
  animation: toastIn 0.35s ease;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.toast.success {
  border-left: 3px solid var(--accent);
}

.toast.error {
  border-left: 3px solid var(--danger);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

/* Help & didactic UI */
.help-banner {
  background: var(--accent-dim);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
}

.help-banner strong {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
}

.help-banner p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: 0;
  line-height: 1.55;
}

.help-banner--warn {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
}

.help-banner--warn strong {
  color: var(--warning);
}

.help-list {
  margin: 12px 0 0 1.1rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.help-list li {
  margin-bottom: 4px;
}

.inline-code,
code.inline-code {
  font-family: var(--mono);
  font-size: 0.82em;
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 4px;
}

.field-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.field-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 700;
  cursor: help;
  flex-shrink: 0;
}

.field-tip:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

.subheading {
  font-size: 0.88rem;
  font-weight: 600;
  margin: 16px 0 10px;
  color: var(--text-muted);
}

.preview-box {
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 12px 0 16px;
}

.preview-box__label,
.preview-box__title {
  font-size: 0.72rem;
  text-transform: none;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  display: block;
  margin-bottom: 6px;
}

.preview-box__value {
  display: block;
  word-break: break-all;
  color: var(--accent);
  font-size: 0.85rem;
}

.preview-box__note {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 8px 0 0;
}

.preview-box--modal {
  margin-bottom: 0;
}

.preview-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  font-size: 0.82rem;
  margin: 0;
}

.preview-dl dt {
  color: var(--text-muted);
  font-weight: 600;
}

.preview-dl dd {
  margin: 0;
  word-break: break-all;
  font-family: var(--mono);
  font-size: 0.78rem;
}

.var-legend {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.var-legend li {
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color var(--transition);
}

.var-legend li:hover {
  border-color: var(--accent);
}

.var-legend code {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.78rem;
}

.var-legend span {
  display: block;
  color: var(--text-muted);
  font-size: 0.72rem;
  margin-top: 4px;
}

.form-section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.form-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.form-section__title {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}

.form-section__desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.45;
}

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

.form-modal .form-field--full {
  grid-column: 1 / -1;
}

.form-modal .form-field--muted {
  opacity: 0.45;
  pointer-events: none;
}

.form-grid--2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (max-width: 640px) {
  .form-grid--2 {
    grid-template-columns: 1fr;
  }
}

.modal--wide .modal__box {
  max-width: 780px;
}

/* Responsive */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.open {
    display: block;
  }

  .menu-toggle {
    display: block;
  }

  .main {
    margin-left: 0;
  }

  .content {
    padding: 16px;
  }

  .topbar {
    padding: 0 16px;
  }
}

.name-mode-switch {
  margin-bottom: 16px;
}

.name-mode-switch__track {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.name-mode-switch__slider {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 2px 12px var(--accent-glow);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 0;
}

.name-mode-switch__track[data-active="fields"] .name-mode-switch__slider {
  transform: translateX(100%);
}

.name-mode-switch__btn {
  position: relative;
  z-index: 1;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 10px 12px;
  cursor: pointer;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.name-mode-switch__btn.is-active,
.name-mode-switch__track[data-active="pattern"] .name-mode-switch__btn[data-name-mode="pattern"],
.name-mode-switch__track[data-active="fields"] .name-mode-switch__btn[data-name-mode="fields"] {
  color: #fff;
}

.name-mode-switch__btn:hover:not(.is-active) {
  color: var(--text);
}

.name-mode-panel {
  margin-bottom: 8px;
}

.name-mode-panel--inactive {
  display: none;
}

.preview-box--inline {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.var-insert-select {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.88rem;
}

.var-insert-select option {
  font-family: var(--mono);
}

/* ── Botão flutuante: Manual do Usuário ─────────────────────────────────── */
.fab-help {
  position: fixed;
  bottom: 84px;
  /* acima do toast-stack */
  right: 24px;
  z-index: 290;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #041510;
  font-family: var(--font);
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 18px var(--accent-glow);
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
  cursor: pointer;
  user-select: none;
}

.fab-help:hover {
  filter: brightness(1.12);
  transform: translateY(-2px) scale(1.06);
  box-shadow: 0 8px 28px var(--accent-glow);
}

.fab-help:active {
  transform: scale(0.96);
}

/* --- Input Group and Variable Inserter Popover --- */
.input-group {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 6px;
}

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

.var-popover-wrapper {
  position: relative;
  display: flex;
  align-items: stretch;
}

.var-popover-btn {
  font-weight: 600;
  padding: 0 14px !important;
  font-family: var(--mono) !important;
  font-size: 0.95rem !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid var(--border) !important;
  cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.var-popover-btn:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: var(--text);
  border-color: var(--accent) !important;
}

.var-popover-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  min-width: 280px;
  max-height: 250px;
  overflow-y: auto;
  padding: 6px 0;
  display: none;
}

.var-popover-menu.is-active {
  display: block;
}

.var-popover-item {
  padding: 8px 12px;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: background var(--transition);
  text-align: left;
}

.var-popover-item:last-child {
  border-bottom: none;
}

.var-popover-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.var-popover-item code {
  font-family: var(--mono);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.82rem;
}

.var-popover-item span {
  font-size: 0.72rem;
  color: var(--text-muted);
}