/* lattice.css */

.lattice-body {
  background-color: var(--bg);
}

.lattice-main {
  min-height: 100vh;
  padding: 120px 24px 24px 24px;
  box-sizing: border-box;
}

.lattice-workspace {
  display: flex;
  gap: 32px;
  max-width: 1400px;
  margin: 0 auto;
  height: calc(100vh - 144px);
}

.control-panel {
  width: 380px;
  background: var(--glass);
  border: 1px solid var(--soft-line);
  border-radius: 16px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.04);
  overflow-y: auto;
}

.panel-header h2 {
  margin: 0 0 8px 0;
  font-size: 24px;
  color: var(--ink);
}

.panel-header p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 12px;
}

.color-pickers {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.color-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.5);
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--soft-line);
}

input[type="color"] {
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  background: none;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
}

.del-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s;
}

.del-btn:hover {
  background: #ffebee;
  color: #c62828;
}

.slider-section label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 12px;
}

.val-badge {
  background: var(--ink);
  color: #fff;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--ink);
}

.action-footer {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid var(--soft-line);
}

.download-hint {
  margin: 12px 0 0 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.highlight {
  background: linear-gradient(135deg, #2c5af2, #688af7);
  border: none;
  color: #fff;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.highlight:hover {
  background: linear-gradient(135deg, #1b47d1, #5175e5);
  transform: translateY(-1px);
}

.preview-panel {
  flex-grow: 1;
  background: var(--glass);
  border: 1px solid var(--soft-line);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.04);
  overflow: hidden;
}

.canvas-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.08);
  background: #fafafa;
}

.canvas-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}

@media (max-width: 900px) {
  .lattice-workspace {
    flex-direction: column;
    height: auto;
  }
  .control-panel {
    width: 100%;
    max-height: none;
    flex-shrink: 0;
  }
  .preview-panel {
    min-height: 400px;
  }
}
