.color-tool-page {
  background:
    linear-gradient(180deg, rgba(236, 246, 255, 0.8), rgba(255, 255, 255, 0) 520px),
    #fff;
}

.color-tool-hero {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 72px var(--page-pad) 42px;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(420px, 0.7fr);
  gap: 48px;
  align-items: center;
}

.color-tool-hero h1 {
  max-width: 900px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(3.4rem, 6vw, 7rem);
  line-height: 0.96;
}

.color-tool-hero .lead {
  max-width: 760px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.22rem;
  line-height: 1.75;
}

.color-hero-board {
  min-height: 420px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 26px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 26px 68px rgba(28, 82, 141, 0.12);
}

.color-hero-board span {
  min-height: 128px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0)),
    var(--swatch);
  border: 1px solid rgba(20, 31, 43, 0.1);
}

.color-hero-board strong {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 74px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  font-size: 1.45rem;
  letter-spacing: 0;
}

.color-starter-section,
.color-guide-section {
  background: #fff;
}

.color-preset-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.color-preset-grid button {
  min-height: 156px;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 18px;
  text-align: left;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 14px 36px rgba(28, 82, 141, 0.06);
  cursor: pointer;
}

.color-preset-grid button:hover,
.color-preset-grid button.active {
  border-color: #b9d7fb;
  box-shadow: 0 18px 48px rgba(28, 82, 141, 0.12);
}

.color-preset-grid span {
  display: block;
  width: 100%;
  height: 56px;
  background: var(--swatch);
  border: 1px solid rgba(20, 31, 43, 0.1);
}

.color-preset-grid strong {
  font-size: 1.02rem;
  line-height: 1.25;
}

.color-preset-grid small {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
}

.color-tool-workspace {
  display: grid;
  grid-template-columns: minmax(340px, 0.42fr) minmax(0, 0.58fr);
  gap: 26px;
  align-items: start;
  background: #f7fbff;
}

.color-controls,
.color-output-panel {
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 18px 48px rgba(28, 82, 141, 0.08);
}

.color-controls {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.color-controls .control-block {
  display: grid;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.color-controls .control-block:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.color-controls .control-block.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.color-controls .control-block.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.color-controls .control-block .eyebrow {
  grid-column: 1 / -1;
  margin: 0;
}

.color-controls label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.color-controls input,
.color-controls select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

.color-controls input[type="range"] {
  padding: 0;
}

.color-controls input[type="color"] {
  min-height: 72px;
  padding: 4px;
}

.color-picker-label {
  grid-row: span 2;
}

.color-controls output {
  color: var(--ink);
  font-size: 0.82rem;
}

.color-fine-panel {
  display: grid;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.color-fine-panel .eyebrow {
  margin: 0;
}

.color-fine-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px;
  gap: 14px;
  min-height: 280px;
}

.color-plane {
  position: relative;
  min-height: 280px;
  padding: 0;
  border: 1px solid #d8e2ed;
  border-radius: 8px;
  background:
    linear-gradient(to bottom, transparent 0%, rgba(255, 255, 255, 0.98) 100%),
    linear-gradient(to right, #ff1f12, #ffef00, #22f60b, #00efda, #1665ff, #bc00ff, #ff1678);
  cursor: crosshair;
}

.color-plane span {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 3px solid #fff;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(20, 31, 43, 0.36), 0 6px 14px rgba(20, 31, 43, 0.22);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.color-fine-preview {
  min-height: 280px;
  border: 1px solid rgba(20, 31, 43, 0.12);
  border-radius: 8px;
  background: var(--current-color, #176fdf);
}

.color-range-label {
  display: grid;
  gap: 8px;
}

.color-range-label input[type="range"] {
  min-height: 20px;
  accent-color: var(--current-color, #176fdf);
}

.color-range-label input[name="value"] {
  background: linear-gradient(to right, #020617, var(--fine-full, #176fdf));
}

.alpha-range-label input[type="range"] {
  background:
    linear-gradient(to right, rgba(255, 255, 255, 0), var(--current-color, #176fdf)),
    linear-gradient(45deg, #d8e2ed 25%, transparent 25%) 0 0 / 14px 14px,
    linear-gradient(45deg, transparent 75%, #d8e2ed 75%) 0 0 / 14px 14px,
    #fff;
}

.color-tune-code {
  display: grid;
  grid-template-columns: minmax(140px, 0.38fr) minmax(0, 1fr);
  gap: 12px;
}

.color-tune-components {
  display: grid;
  gap: 12px;
}

.color-tune-components label {
  grid-template-columns: minmax(88px, 0.34fr) minmax(0, 1fr);
  align-items: center;
}

.color-tune-components input {
  min-height: 44px;
}

.color-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.color-form-actions span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.color-output-panel {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 18px;
  padding: 22px;
}

.color-current-card {
  min-height: 220px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.42fr);
  gap: 18px;
  padding: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.62)),
    var(--current-color, #176fdf);
  border: 1px solid rgba(20, 31, 43, 0.1);
}

.color-current-card > div {
  align-self: end;
  display: grid;
  gap: 10px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(20, 31, 43, 0.1);
}

.color-current-card strong {
  color: var(--ink);
  font-size: 2.1rem;
  line-height: 1;
}

.color-current-card span {
  color: var(--muted);
  font-weight: 800;
}

.color-current-card button {
  min-height: 100%;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0)),
    var(--current-color, #176fdf);
  border: 1px solid rgba(20, 31, 43, 0.16);
  cursor: pointer;
}

.color-format-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.color-format-grid button {
  min-height: 92px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 16px;
  text-align: left;
  color: var(--ink);
  background: #fff;
  border: 1px solid #e3edf8;
  cursor: pointer;
}

.color-format-grid button:hover {
  border-color: #b9d7fb;
  background: #f8fbff;
}

.color-format-grid span,
.color-shade-grid span,
.color-panel-heading .eyebrow {
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1.2;
}

.color-format-grid strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.96rem;
  line-height: 1.35;
}

.color-preview-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  min-height: 112px;
  border: 1px solid var(--line);
  overflow: hidden;
}

.color-preview-strip button {
  min-height: 112px;
  border: 0;
  cursor: pointer;
}

.color-preview-strip button:hover {
  outline: 3px solid rgba(255, 255, 255, 0.78);
  outline-offset: -8px;
}

.color-shade-panel,
.color-css-panel,
.color-code-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid #e3edf8;
  background: #fff;
}

.color-panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
}

.color-panel-heading p {
  margin: 0 0 6px;
}

.color-panel-heading strong {
  color: var(--ink);
  font-size: 1.08rem;
  line-height: 1.3;
}

.color-code-list {
  display: grid;
  gap: 12px;
}

.color-code-list button {
  min-height: 62px;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 26px;
  gap: 18px;
  align-items: center;
  padding: 0 18px;
  text-align: left;
  color: var(--ink);
  background: #fbfdff;
  border: 1px solid #cfd7df;
  border-radius: 7px;
  cursor: pointer;
}

.color-code-list button:hover {
  border-color: #9ec8f8;
  background: #f6fbff;
}

.color-code-list span {
  color: #6b7280;
  font-size: 0.84rem;
  font-weight: 850;
}

.color-code-list strong {
  overflow-wrap: anywhere;
  color: #20242b;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.96rem;
  line-height: 1.35;
}

.color-code-list i {
  position: relative;
  width: 18px;
  height: 20px;
  justify-self: end;
}

.color-code-list i::before,
.color-code-list i::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 14px;
  border: 2px solid #4b5563;
  border-radius: 2px;
  background: transparent;
}

.color-code-list i::before {
  left: 1px;
  top: 1px;
}

.color-code-list i::after {
  left: 6px;
  top: 5px;
  background: #fbfdff;
}

.color-shade-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 8px;
}

.color-shade-grid button {
  min-height: 120px;
  display: grid;
  align-content: end;
  gap: 6px;
  padding: 10px;
  text-align: left;
  background: var(--shade);
  border: 1px solid rgba(20, 31, 43, 0.1);
  cursor: pointer;
}

.color-shade-grid strong {
  width: fit-content;
  padding: 4px 6px;
  color: var(--shade-text);
  background: rgba(255, 255, 255, 0.76);
  font-size: 0.78rem;
  line-height: 1;
}

.color-shade-grid span {
  width: fit-content;
  padding: 4px 6px;
  color: var(--shade-text);
  background: rgba(255, 255, 255, 0.76);
}

.color-css-panel pre {
  max-height: 340px;
  margin: 0;
  padding: 18px;
  overflow: auto;
  color: #1e293b;
  background: #f8fbff;
  border: 1px solid #e3edf8;
  font-size: 0.92rem;
  line-height: 1.65;
}

.color-workflow-section {
  background:
    linear-gradient(180deg, #fff, #f8fbff);
}

.color-workflow-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.color-workflow-grid a {
  min-height: 188px;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 26px;
  color: var(--ink);
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 16px 42px rgba(28, 82, 141, 0.07);
}

.color-workflow-grid a:hover {
  border-color: #b9d7fb;
  box-shadow: 0 18px 52px rgba(28, 82, 141, 0.12);
}

.color-workflow-grid strong {
  font-size: 1.2rem;
}

.color-workflow-grid span,
.color-guide-section p {
  color: var(--muted);
  line-height: 1.75;
}

.color-guide-section p {
  max-width: 920px;
  font-size: 1.05rem;
}

.color-faq-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.color-faq-grid article {
  padding: 24px;
  background:
    linear-gradient(145deg, rgba(237, 245, 255, 0.74), rgba(255, 255, 255, 0) 62%),
    #fff;
  border: 1px solid var(--line);
  box-shadow: 0 14px 36px rgba(28, 82, 141, 0.06);
}

.color-faq-grid h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1.32;
}

.color-faq-grid p {
  margin: 0;
  font-size: 0.96rem;
}

@media (max-width: 1120px) {
  .color-tool-hero,
  .color-tool-workspace {
    grid-template-columns: 1fr;
  }

  .color-output-panel {
    position: static;
  }

  .color-preset-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .color-format-grid,
  .color-tune-code,
  .color-workflow-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .color-shade-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .color-tool-hero {
    padding-top: 46px;
  }

  .color-tool-hero h1 {
    font-size: 3.2rem;
  }

  .color-hero-board {
    min-height: 280px;
    grid-template-columns: 1fr 1fr;
    padding: 16px;
  }

  .color-hero-board span {
    min-height: 80px;
  }

  .color-preset-grid,
  .color-controls .control-block.two-col,
  .color-controls .control-block.three-col,
  .color-fine-picker,
  .color-tune-code,
  .color-current-card,
  .color-format-grid,
  .color-workflow-grid,
  .color-faq-grid {
    grid-template-columns: 1fr;
  }

  .color-fine-picker,
  .color-plane,
  .color-fine-preview {
    min-height: 220px;
  }

  .color-code-list button,
  .color-tune-components label {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 14px;
  }

  .color-code-list i {
    display: none;
  }

  .color-preview-strip {
    grid-template-columns: 1fr;
  }

  .color-preview-strip button {
    min-height: 70px;
  }

  .color-shade-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
