.color-picker-page {
  max-width: 1180px;
  margin: 40px auto 60px;
  padding: 0 24px;
}

.color-picker-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 24px;
}

.page-hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 28px;
  align-items: center;
  margin-bottom: 28px;
}

.page-hero h1 {
  margin: 0 0 12px;
  font-size: 38px;
  line-height: 1.05;
  color: #0f172a;
}

.page-hero p {
  margin: 0;
  font-size: 16px;
  line-height: 1.8;
  color: #475569;
  max-width: 620px;
}

.page-hero-code {
  display: grid;
  gap: 16px;
  justify-items: end;
}

.color-sample {
  width: 180px;
  height: 180px;
  border-radius: 24px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #3490dc;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

.color-hero-values {
  display: grid;
  gap: 8px;
  text-align: right;
}

.color-hero-values span {
  display: block;
  font-weight: 600;
  color: #0f172a;
}

.color-picker-panel {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
}

.color-picker-controls,
.color-picker-summary {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 26px;
}

.control-group,
.range-group {
  margin-bottom: 24px;
}

.control-group label,
.range-field label {
  display: block;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #1f2937;
}

.control-group input[type="text"],
.range-field input[type="number"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 15px;
  color: #0f172a;
  background: #f8fafc;
}

.control-group input[type="color"] {
  width: 100%;
  height: 56px;
  border: none;
  border-radius: 16px;
  padding: 0;
  cursor: pointer;
}

.range-group {
  display: grid;
  gap: 18px;
}

.range-field {
  display: grid;
  gap: 10px;
}

.range-field input[type="range"] {
  width: 100%;
}

.range-field input[type="number"] {
  width: 100%;
}

.color-output-box {
  display: grid;
  gap: 16px;
}

.color-output-box h2,
.swatch-panel h2 {
  margin: 0;
  font-size: 18px;
  color: #0f172a;
}

.color-picker-sidebar {
  position: sticky;
  top: 100px;
  align-self: start;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 24px;
}

.sidebar-card h2 {
  margin: 0 0 18px;
  font-size: 16px;
  color: #0f172a;
}

.color-picker-sidebar nav {
  display: grid;
  gap: 10px;
}

.color-wheel {
  width: 100%;
  max-width: 200px;
  height: auto;
  border-radius: 16px;
  cursor: pointer;
  display: block;
  margin: 0 auto 12px;
  border: 1px solid #e2e8f0;
}

.sidebar-hint {
  margin: 0;
  font-size: 12px;
  color: #64748b;
  text-align: center;
}

.color-picker-sidebar a {
  display: block;
  padding: 12px 14px;
  border-radius: 10px;
  color: #1d4ed8;
  background: #f8fafc;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.2s ease;
}

.color-picker-sidebar a:hover,
.color-picker-sidebar a:focus {
  background: #e0f2fe;
  transform: translateX(2px);
}

#cssOutput {
  margin: 0;
  padding: 18px;
  border-radius: 14px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 14px;
  line-height: 1.6;
  overflow-x: auto;
}

button#copyCssBtn,
button#saveSwatchBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 12px;
  background: #1d4ed8;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.2s ease;
}

button#copyCssBtn:hover,
button#saveSwatchBtn:hover {
  background: #2563eb;
}

.swatch-panel {
  margin-top: 10px;
}

.swatch-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.swatch-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.swatch-cell {
  display: grid;
  grid-template-columns: 56px auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8fafc;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}

.swatch-cell:hover {
  transform: translateY(-1px);
  background: #eff6ff;
}

.swatch-swatch {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.1);
}

.swatch-meta {
  display: grid;
  gap: 6px;
}

.swatch-meta strong {
  display: block;
  color: #0f172a;
  font-size: 14px;
}

.swatch-meta span {
  color: #475569;
  font-size: 13px;
}

.swatch-help {
  margin: 16px 0 0;
  font-size: 13px;
  color: #64748b;
}

@media (max-width: 980px) {
  .color-picker-layout {
    grid-template-columns: 1fr;
  }

  .page-hero {
    grid-template-columns: 1fr;
  }

  .page-hero-code {
    justify-items: start;
  }

  .color-picker-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .page-hero {
    gap: 18px;
  }

  .color-sample {
    width: 100%;
    min-height: 160px;
  }
}
