.mesh-bg {
  background-color: #0a0f1a;
  background-image:
    radial-gradient(ellipse 80% 60% at 20% -10%, rgba(51, 163, 255, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 10%, rgba(99, 102, 241, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 50% 100%, rgba(51, 163, 255, 0.08) 0%, transparent 50%);
}
.grid-pattern {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 20%, transparent 70%);
}
.glass {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.glass-hover:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(51, 163, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 20px 40px -12px rgba(51, 163, 255, 0.15);
}
.text-gradient {
  background: linear-gradient(135deg, #ffffff 0%, #8ed8ff 50%, #33a3ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.input-field {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-field:focus {
  outline: none;
  border-color: rgba(51, 163, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(51, 163, 255, 0.12);
}
select.input-field option { background: #141b2d; color: #fff; }
.btn-primary {
  background: #33a3ff;
  color: #fff;
  font-weight: 500;
  transition: background 0.2s, box-shadow 0.2s;
}
.btn-primary:hover { background: #59c0ff; box-shadow: 0 8px 24px -8px rgba(51, 163, 255, 0.5); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.75);
  transition: background 0.2s;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }
.tool-nav-btn.active {
  background: rgba(51, 163, 255, 0.12);
  border-color: rgba(51, 163, 255, 0.3);
  color: #8ed8ff;
}
.tool-panel { display: none; }
.tool-panel.active { display: block; }
.output-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: ui-monospace, Cascadia Code, Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.6;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(51, 163, 255, 0.12);
  color: #8ed8ff;
  border: 1px solid rgba(51, 163, 255, 0.2);
}

/* Color converter */
.col-layout {
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 768px) {
  .col-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; }
}
.col-preview-card {
  position: relative;
  border-radius: 1.25rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  min-height: 220px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.col-preview-bg {
  position: absolute;
  inset: 0;
  transition: background-color 0.2s ease;
}
.col-preview-checker {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(45deg, rgba(255,255,255,.08) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,.08) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,.08) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.08) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.col-preview-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 220px;
  padding: 1.25rem;
}
.col-preview-sample {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}
.col-preview-meta {
  font-size: 0.75rem;
  font-family: ui-monospace, Cascadia Code, Consolas, monospace;
  opacity: 0.85;
  transition: color 0.2s;
}
.col-swatch {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.15);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.5);
}
.col-swatch input[type="color"] {
  position: absolute;
  inset: -8px;
  width: calc(100% + 16px);
  height: calc(100% + 16px);
  border: none;
  padding: 0;
  cursor: pointer;
}
.col-channel {
  display: grid;
  grid-template-columns: 1.5rem 1fr 3rem;
  gap: 0.625rem;
  align-items: center;
  margin-bottom: 0.625rem;
}
.col-channel label {
  font-size: 0.75rem;
  font-weight: 600;
  font-family: ui-monospace, Cascadia Code, Consolas, monospace;
  color: rgba(255, 255, 255, 0.45);
}
.col-channel input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  appearance: none;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
}
.col-channel input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(0, 0, 0, 0.2);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.col-channel input[type="number"] {
  width: 100%;
  padding: 0.35rem 0.5rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-family: ui-monospace, Cascadia Code, Consolas, monospace;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  text-align: center;
}
.col-format {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 0.875rem;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.col-format span {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.35);
  width: 2.25rem;
  flex-shrink: 0;
}
.col-format code {
  flex: 1;
  font-family: ui-monospace, Cascadia Code, Consolas, monospace;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.85);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.col-preset {
  width: 2rem;
  height: 2rem;
  border-radius: 0.625rem;
  border: 2px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.col-preset:hover { transform: scale(1.08); border-color: rgba(255, 255, 255, 0.35); }
.col-preset.active { border-color: #33a3ff; box-shadow: 0 0 0 2px rgba(51, 163, 255, 0.35); }
