.demo-bar {
  background: var(--demo-bar-bg);
  color: white;
  padding: 8px 24px;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
}
.demo-bar .label { opacity: 0.7; margin-right: 6px; }
.demo-bar a { color: var(--demo-bar-link); text-decoration: none; font-weight: 500; }
.demo-bar .toggle { display: flex; gap: 8px; align-items: center; }
.demo-bar .toggle a {
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
}
.demo-bar .toggle a.active {
  background: var(--demo-toggle-active, var(--accent));
  color: white;
}

.view { display: none; }
.view.active { display: block; }

.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: white;
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  max-height: 86vh;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}
.modal .modal-head, .modal .modal-foot { flex-shrink: 0; }
.modal .modal-body { flex: 1; overflow-y: auto; }
.modal-head {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-head h3 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.modal-head .close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-3);
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.modal-head .close:hover { color: var(--text); }
.modal-body { padding: 20px 22px; }
.modal-row { margin-bottom: 16px; }
.modal-row label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.modal-row input[type="text"],
.modal-row input[type="number"],
.modal-row textarea,
.modal-row select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
}
.modal-row input:focus,
.modal-row textarea:focus,
.modal-row select:focus { border-color: var(--accent); }
.modal-row .input-prefix {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.modal-row .input-prefix span {
  padding: 10px 12px;
  background: var(--bg);
  color: var(--text-2);
  font-weight: 600;
  border-right: 1px solid var(--border);
  font-size: 13.5px;
}
.modal-row .input-prefix input {
  border: none;
  flex: 1;
  padding: 10px 12px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
}
.modal-foot {
  padding: 14px 22px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.modal-foot button {
  padding: 9px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  font-family: inherit;
}
.modal-foot button.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.modal-foot button:hover { background: var(--bg); }
.modal-foot button.primary:hover { background: #4F46E5; }

.lr-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #10B981;
  color: white;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  font-family: Inter, sans-serif;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  z-index: 2000;
  animation: fadeOut 2s forwards;
}
