/* Hide cursor for canvas and all children when laser pointer is active */
.laser-pointer-active,
.laser-pointer-active * {
  cursor: none !important;
}
:root {
  --bg: #0b1021;
  --panel: #11182f;
  --accent: #8ef1ff;
  --text: #e6f1ff;
  --muted: #9fb3c8;
  --danger: #ff6b6b;
  --success: #7cf3c0;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", sans-serif;
  background: repeating-conic-gradient(from 45deg, #0f162d 0deg 45deg, #0c1226 45deg 90deg);
  background-size: 40px 40px;
  color: var(--text);
}

a {
  color: var(--accent);
}

button,
input,
select,
textarea {
  font: inherit;
}

.btn {
  background: var(--accent);
  color: #0b1021;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 50px rgba(0, 0, 0, 0.45);
}

.layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 12px;
  padding: 12px;
  min-height: 100vh;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--shadow);
}

#canvas-wrapper {
  position: relative;
  background: #0d1327;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  min-height: 520px;
}

#canvas {
  position: relative;
  width: 100%;
  height: 100%;
  background: repeating-conic-gradient(from 45deg, #0f162d 0deg 45deg, #0c1226 45deg 90deg);
  background-size: 40px 40px;
  user-select: none;
  touch-action: none;
}

.element {
  position: absolute;
  border: 1px dashed rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  overflow: hidden;
  cursor: move;
}

.element.selected {
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(142, 241, 255, 0.2);
}

.handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: nwse-resize;
}

.handle.br {
  bottom: 0;
  right: 0;
}

.form-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.form-row label {
  flex: 0 0 110px;
  color: var(--muted);
  font-size: 14px;
}

.form-row input,
.form-row select,
.form-row textarea {
  flex: 1;
  background: #0c1225;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px;
}

.password-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper input {
  width: 100%;
  flex: 1;
  background: #0c1225;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 40px 8px 8px;
  margin-right: -6px;
}

.toggle-password {
  position: absolute;
  right: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  transition: opacity 150ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.toggle-password:hover {
  opacity: 0.8;
}

.toggle-password:active {
  transform: scale(0.95);
}

.eye-icon {
  width: 18px;
  height: 18px;
  filter: invert(1) brightness(1.2);
}

.login-card {
  max-width: 360px;
  margin: 120px auto;
  padding: 24px;
  background: var(--panel);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.notice {
  color: var(--muted);
  font-size: 14px;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  background: #0c1225;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  cursor: pointer;
  transition: border 120ms ease, transform 120ms ease;
}

.list-item:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.list-item.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(142, 241, 255, 0.2);
}

.action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: var(--panel);
  border-radius: 12px;
  box-shadow: var(--shadow);
  min-width: 360px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  animation: slideUp 300ms ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text);
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 120ms ease;
}

.modal-close:hover {
  color: var(--accent);
}

.modal-body {
  padding: 20px;
}

#rename-input {
  width: 100%;
  background: #0c1225;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  transition: border-color 120ms ease;
}

#rename-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(142, 241, 255, 0.1);
}

.modal-footer {
  display: flex;
  gap: 12px;
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  justify-content: flex-end;
}

.modal-footer .btn {
  min-width: 100px;
}

#prompt-input {
  width: 100%;
  background: #0c1225;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  margin-top: 10px;
  transition: border-color 120ms ease;
}

#prompt-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(142, 241, 255, 0.1);
}

.modal-body p {
  margin: 0 0 10px 0;
  color: var(--text);
}

