:root {
  color-scheme: light;
  --page: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8f9fc;
  --ink: #121829;
  --muted: #626b7d;
  --line: #dfe4ed;
  --line-strong: #cbd3e0;
  --accent: #5b5ce2;
  --accent-dark: #4446c7;
  --accent-soft: #ededff;
  --success: #16794c;
  --danger: #b42318;
  --picked: #5b5ce2;
  --picked-contrast: #ffffff;
  --shadow: 0 22px 60px rgba(29, 38, 65, 0.1);
  --radius-lg: 24px;
  --radius-md: 16px;
  --system-font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--page);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% -4%, rgba(103, 105, 230, 0.11), transparent 27rem),
    radial-gradient(circle at 90% 20%, rgba(31, 177, 161, 0.08), transparent 24rem),
    var(--page);
  font-family: var(--system-font);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
canvas:focus-visible {
  outline: 3px solid rgba(91, 92, 226, 0.35);
  outline-offset: 3px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  color: #fff;
  background: var(--ink);
  border-radius: 9px;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header,
main,
.site-footer {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
}

.brand {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  color: var(--ink);
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  grid-template-columns: repeat(2, 8px);
  gap: 2px;
  padding: 5px;
  background: var(--ink);
  border-radius: 9px;
}

.brand-mark span {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.brand-mark span:nth-child(1) { background: #f96d61; }
.brand-mark span:nth-child(2) { background: #f7c859; }
.brand-mark span:nth-child(3) { background: #54d5b6; }
.brand-mark span:nth-child(4) { background: #7577ee; }

.local-badge {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 8px 11px;
  color: #3f4960;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(203, 211, 224, 0.8);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(10px);
}

.local-badge svg {
  width: 15px;
  fill: var(--success);
}

.hero {
  max-width: 780px;
  margin: 62px auto 36px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 13px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.hero-copy {
  max-width: 650px;
  margin: 23px auto 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.55;
}

.privacy-line {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin: 20px 0 0;
  color: var(--success);
  font-size: 13px;
  font-weight: 700;
}

.privacy-line svg {
  width: 17px;
  fill: currentColor;
}

.picker {
  margin-top: 28px;
}

.upload-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 374px;
  padding: 58px 28px 32px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.83);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
  backdrop-filter: blur(12px);
}

.upload-panel::before {
  position: absolute;
  inset: 10px;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 17px;
  content: "";
}

.upload-panel.is-dragging {
  background: #f1f1ff;
  border-color: var(--accent);
  transform: translateY(-2px);
}

.upload-icon {
  display: grid;
  width: 64px;
  height: 64px;
  margin-bottom: 18px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 18px;
  place-items: center;
}

.upload-icon svg {
  width: 31px;
  fill: currentColor;
}

.upload-panel h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.035em;
}

.upload-panel > p {
  margin: 8px 0 0;
  color: var(--muted);
}

.upload-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
  margin-top: 23px;
}

.button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 12px;
  font-weight: 750;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  box-shadow: 0 8px 18px rgba(91, 92, 226, 0.23);
}

.button-primary:hover {
  background: var(--accent-dark);
  box-shadow: 0 10px 22px rgba(91, 92, 226, 0.29);
}

.button svg {
  width: 18px;
  fill: currentColor;
}

.button-secondary {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
}

.upload-panel .paste-hint {
  margin-top: 22px;
  font-size: 12px;
}

.paste-hint-touch {
  display: none;
}

kbd {
  min-width: 22px;
  padding: 2px 5px;
  color: #4f586b;
  background: #f1f3f7;
  border: 1px solid #d9dee7;
  border-bottom-width: 2px;
  border-radius: 5px;
  font-family: var(--system-font);
  font-size: 10px;
  font-weight: 750;
}

.upload-panel .format-hint {
  margin-top: 14px;
  color: #858da0;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.upload-panel .input-status {
  min-height: 20px;
  margin-top: 14px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 650;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 370px;
  gap: 18px;
  align-items: start;
}

.workspace[hidden],
.upload-panel[hidden] {
  display: none;
}

.canvas-card,
.result-card,
.palette-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.canvas-card {
  min-width: 0;
  overflow: hidden;
}

.canvas-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  padding: 14px 18px 13px 21px;
  border-bottom: 1px solid var(--line);
}

.toolbar-label,
.result-kicker {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.image-meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.toolbar-actions {
  display: flex;
  gap: 3px;
  align-items: center;
}

.zoom-level {
  min-width: 48px;
  padding-right: 7px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  text-align: right;
}

.text-button {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 38px;
  padding: 0 10px;
  color: var(--accent-dark);
  background: transparent;
  border: 0;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.text-button:hover {
  background: var(--accent-soft);
}

.text-button svg {
  width: 16px;
  fill: currentColor;
}

.canvas-frame {
  position: relative;
  display: grid;
  aspect-ratio: 3 / 2;
  min-height: 280px;
  overflow: hidden;
  background-color: #e9ecf2;
  background-image:
    linear-gradient(45deg, #dfe3eb 25%, transparent 25%),
    linear-gradient(-45deg, #dfe3eb 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #dfe3eb 75%),
    linear-gradient(-45deg, transparent 75%, #dfe3eb 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
  place-items: stretch;
}

#display-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

#display-canvas.is-pan-ready {
  cursor: grab;
}

#display-canvas.is-panning {
  cursor: grabbing;
}

.canvas-marker {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  width: 44px;
  height: 44px;
  pointer-events: none;
  transform: translate3d(-100px, -100px, 0) translate(-50%, -50%);
  transform-origin: center;
}

.canvas-marker svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
}

.canvas-marker .marker-outline {
  stroke: rgba(0, 0, 0, 0.76);
  stroke-width: 4;
}

.canvas-marker .marker-highlight {
  stroke: #fff;
  stroke-width: 1.5;
}

.canvas-marker.is-selected {
  width: 48px;
  height: 48px;
}

.magnifier {
  --magnifier-cell: 12px;
  position: absolute;
  z-index: 4;
  top: 0;
  left: 0;
  width: 144px;
  height: 144px;
  padding: 5px;
  pointer-events: none;
  background: #fff;
  border: 1px solid rgba(18, 24, 41, 0.28);
  border-radius: 50%;
  box-shadow: 0 10px 30px rgba(18, 24, 41, 0.28);
  will-change: transform;
}

.magnifier::before,
.magnifier::after {
  position: absolute;
  pointer-events: none;
  content: "";
}

.magnifier::before {
  inset: 5px;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.46) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.46) 1px, transparent 1px);
  background-size: var(--magnifier-cell) var(--magnifier-cell);
  border-radius: 50%;
}

.magnifier::after {
  top: 50%;
  left: 50%;
  width: var(--magnifier-cell);
  height: var(--magnifier-cell);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(18, 24, 41, 0.88);
  transform: translate(-50%, -50%);
}

.magnifier canvas {
  display: block;
  width: 132px;
  height: 132px;
  overflow: hidden;
  border-radius: 50%;
  image-rendering: pixelated;
}

.canvas-loading {
  position: absolute;
  inset: 0;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  color: #353d50;
  background: rgba(245, 247, 251, 0.84);
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(3px);
}

.canvas-loading[hidden] {
  display: none;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #c7ccef;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(1turn); }
}

.pixel-readout {
  display: flex;
  gap: 20px;
  align-items: center;
  min-height: 46px;
  padding: 10px 20px;
  color: #4f586a;
  background: #fafbfc;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.readout-label {
  margin-right: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pixel-readout output {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.result-card {
  padding: 22px;
}

.palette-card {
  grid-column: 1 / -1;
  padding: 22px;
}

.palette-heading-row {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}

.palette-card h2 {
  margin: 5px 0 0;
  font-size: 20px;
  letter-spacing: -0.035em;
}

.palette-copy-all {
  flex: 0 0 auto;
}

.palette-copy-all:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.palette-description,
.palette-empty,
.palette-status {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.palette-description {
  margin: 9px 0 0;
}

.palette-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
  margin: 17px 0 0;
  padding: 0;
  list-style: none;
}

.palette-item {
  min-width: 0;
}

.palette-color {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  grid-template-rows: 1fr 1fr;
  width: 100%;
  min-height: 64px;
  padding: 8px;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
}

.palette-color:hover {
  background: var(--accent-soft);
  border-color: #c9c9f8;
}

.palette-swatch {
  grid-row: 1 / 3;
  width: 46px;
  height: 46px;
  background: var(--palette-color);
  border: 3px solid #fff;
  border-radius: 9px;
  box-shadow: 0 0 0 1px var(--line-strong);
}

.palette-hex,
.palette-color small {
  min-width: 0;
  margin-left: 10px;
}

.palette-hex {
  align-self: end;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.palette-color small {
  align-self: start;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.palette-empty {
  margin: 16px 0 0;
  padding: 18px;
  background: var(--surface-soft);
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  text-align: center;
}

.palette-status {
  min-height: 18px;
  margin: 10px 0 0;
  color: var(--success);
  font-weight: 700;
  text-align: right;
}

.result-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.result-kicker {
  color: var(--accent-dark);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.result-card h2 {
  margin: 5px 0 0;
  font-size: 20px;
  letter-spacing: -0.035em;
}

.selected-swatch {
  width: 44px;
  height: 44px;
  background-color: #fff;
  background-image:
    linear-gradient(var(--picked), var(--picked)),
    linear-gradient(45deg, #d7dbe4 25%, transparent 25%),
    linear-gradient(-45deg, #d7dbe4 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d7dbe4 75%),
    linear-gradient(-45deg, transparent 75%, #d7dbe4 75%);
  background-position: 0 0, 0 0, 0 5px, 5px -5px, -5px 0;
  background-size: auto, 10px 10px, 10px 10px, 10px 10px, 10px 10px;
  border: 5px solid #fff;
  border-radius: 13px;
  box-shadow: 0 0 0 1px var(--line-strong), 0 5px 14px rgba(19, 24, 41, 0.13);
}

.empty-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  padding: 30px 22px;
  color: var(--muted);
  text-align: center;
}

.empty-result[hidden],
.color-results[hidden] {
  display: none;
}

.empty-result p {
  max-width: 205px;
  margin: 17px 0 0;
  font-size: 13px;
  line-height: 1.55;
}

.target-icon {
  position: relative;
  width: 58px;
  height: 58px;
  border: 1px dashed #a9b0bf;
  border-radius: 50%;
}

.target-icon::before,
.target-icon::after {
  position: absolute;
  background: #a9b0bf;
  content: "";
}

.target-icon::before { top: 28px; left: 12px; width: 34px; height: 1px; }
.target-icon::after { top: 12px; left: 28px; width: 1px; height: 34px; }

.primary-color {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 142px;
  margin: 18px 0 14px;
  padding: 20px;
  color: var(--picked-contrast);
  background-color: #fff;
  background-image:
    linear-gradient(var(--picked), var(--picked)),
    linear-gradient(45deg, #d8dce5 25%, transparent 25%),
    linear-gradient(-45deg, #d8dce5 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d8dce5 75%),
    linear-gradient(-45deg, transparent 75%, #d8dce5 75%);
  background-position: 0 0, 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: auto, 20px 20px, 20px 20px, 20px 20px, 20px 20px;
  border-radius: 16px;
  transition: background-color 120ms linear;
}

.primary-color-label {
  margin-bottom: 5px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.primary-color strong {
  font-size: 29px;
  letter-spacing: -0.04em;
}

.value-list {
  border: 1px solid var(--line);
  border-radius: 14px;
}

.value-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 63px;
  padding: 10px 10px 10px 14px;
}

.value-row > div {
  min-width: 0;
  padding-right: 8px;
}

.value-row + .value-row {
  border-top: 1px solid var(--line);
}

.value-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.value-row output {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

.value-note {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.3;
}

.copy-button {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  min-height: 35px;
  padding: 0 9px;
  color: #515a6d;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.copy-button:hover {
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-color: #c9c9f8;
}

.copy-button:disabled {
  color: #7d8595;
  cursor: not-allowed;
  opacity: 0.62;
}

.copy-button svg {
  width: 14px;
  fill: currentColor;
}

.copy-status {
  min-height: 18px;
  margin: 10px 0 0;
  color: var(--success);
  font-size: 11px;
  font-weight: 700;
  text-align: right;
}

.contrast-section {
  margin-top: 14px;
  padding: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.contrast-section h3,
.history-section h3 {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.02em;
}

.contrast-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.contrast-tile {
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: center;
  padding: 11px 8px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.contrast-white {
  color: #121829;
  background: #fff;
}

.contrast-black {
  color: #fff;
  background: #000;
  border-color: #000;
}

.contrast-chip {
  display: grid;
  width: 48px;
  height: 34px;
  color: var(--chip-text, #121829);
  background: var(--picked);
  border: 1px solid rgba(127, 127, 127, 0.35);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  place-items: center;
}

.contrast-tile small {
  font-size: 9px;
  font-weight: 700;
}

.not-applicable {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.history-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.history-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.history-heading-row > span {
  color: var(--muted);
  font-size: 9px;
}

.history-list {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 7px;
  margin-top: 10px;
}

.history-color {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  background-color: #fff;
  background-image:
    linear-gradient(var(--history-color), var(--history-color)),
    linear-gradient(45deg, #d7dbe4 25%, transparent 25%),
    linear-gradient(-45deg, #d7dbe4 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d7dbe4 75%),
    linear-gradient(-45deg, transparent 75%, #d7dbe4 75%);
  background-position: 0 0, 0 0, 0 4px, 4px -4px, -4px 0;
  background-size: auto, 8px 8px, 8px 8px, 8px 8px, 8px 8px;
  border: 2px solid #fff;
  border-radius: 9px;
  box-shadow: 0 0 0 1px var(--line-strong);
  cursor: pointer;
}

.history-color:hover,
.history-color:focus-visible {
  box-shadow: 0 0 0 2px var(--accent);
}

.interaction-help {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  min-height: 42px;
  padding: 11px 20px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.interaction-help svg {
  flex: 0 0 auto;
  width: 16px;
  fill: #8a92a3;
}

.interaction-help p {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
}

.interaction-tip-touch {
  display: none;
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 42px 0 60px;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.trust-strip > div {
  position: relative;
  padding: 24px 25px;
  background: rgba(255, 255, 255, 0.72);
}

.trust-number {
  position: absolute;
  top: 21px;
  right: 22px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.trust-strip strong {
  display: block;
  font-size: 13px;
}

.trust-strip p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.guide-section,
.about-section,
.faq-section {
  margin-block: 88px;
  content-visibility: auto;
  contain-intrinsic-size: auto 700px;
}

.section-kicker {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.guide-section > h2,
.about-section h2,
.faq-section > h2 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(30px, 4.5vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.section-intro {
  max-width: 710px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.guide-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
}

.guide-steps li {
  display: flex;
  gap: 15px;
  min-width: 0;
  padding: 24px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.step-number {
  display: grid;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-radius: 9px;
  font-size: 12px;
  font-weight: 800;
  place-items: center;
}

.guide-steps h3 {
  margin: 3px 0 0;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.guide-steps p,
.about-copy p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.about-section {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
  gap: clamp(36px, 7vw, 100px);
  align-items: start;
  padding: 46px;
  background: var(--ink);
  border-radius: 26px;
}

.about-section .section-kicker {
  color: #aeb0ff;
}

.about-section h2 {
  color: #fff;
}

.about-copy p {
  margin: 0;
  color: #c9cfdd;
  font-size: 15px;
}

.about-copy p + p {
  margin-top: 18px;
}

.faq-section {
  max-width: 880px;
  margin-inline: auto;
}

.faq-list {
  margin-top: 30px;
  border-top: 1px solid var(--line-strong);
}

.faq-list details {
  border-bottom: 1px solid var(--line-strong);
}

.faq-list summary {
  position: relative;
  padding: 22px 52px 22px 0;
  cursor: pointer;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.02em;
  list-style: none;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  position: absolute;
  top: 21px;
  right: 8px;
  color: var(--accent-dark);
  font-size: 22px;
  font-weight: 500;
  content: "+";
}

.faq-list details[open] summary::after {
  content: "−";
}

.faq-list details > p {
  max-width: 760px;
  margin: -5px 52px 22px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.faq-list a,
.legal-page a:not(.button),
.site-footer a {
  color: var(--accent-dark);
  text-underline-offset: 3px;
}

.site-footer {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0 30px;
  color: #7e8799;
  border-top: 1px solid var(--line);
  font-size: 11px;
}

.site-footer span:first-child {
  color: var(--ink);
  font-weight: 800;
}

.site-footer nav {
  display: flex;
  gap: 18px;
  margin-left: auto;
}

.site-footer a {
  color: #626b7d;
}

.legal-page {
  max-width: 800px;
  padding: 70px 0 100px;
}

.legal-page > h1 {
  max-width: 720px;
  font-size: clamp(42px, 7vw, 68px);
}

.legal-lead {
  margin: 26px 0 56px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.65;
}

.legal-page section {
  margin-top: 38px;
}

.legal-page h2 {
  margin: 0;
  font-size: 23px;
  letter-spacing: -0.035em;
}

.legal-page section p {
  margin: 12px 0 0;
  color: #4f586b;
  font-size: 15px;
  line-height: 1.72;
}

.legal-updated {
  margin: 46px 0 18px;
  color: var(--muted);
  font-size: 12px;
}

.legal-home {
  width: fit-content;
  text-decoration: none;
}

.not-found-page {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  max-width: 700px;
  padding-block: 48px;
}

.not-found-code {
  margin: 80px 0 10px;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.not-found-page > p:not(.not-found-code) {
  margin: 24px 0;
  color: var(--muted);
  font-size: 18px;
}

.not-found-page .button {
  width: fit-content;
  text-decoration: none;
}

.drop-overlay {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: none;
  padding: 24px;
  background: rgba(28, 30, 57, 0.72);
  backdrop-filter: blur(8px);
  place-items: center;
}

.drop-overlay.is-visible {
  display: grid;
}

.drop-overlay > div {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: center;
  width: min(520px, 90vw);
  min-height: 280px;
  color: #fff;
  border: 2px dashed rgba(255,255,255,.7);
  border-radius: 28px;
}

.drop-overlay span {
  display: grid;
  width: 58px;
  height: 58px;
  color: var(--ink);
  background: #fff;
  border-radius: 50%;
  font-size: 29px;
  place-items: center;
}

.drop-overlay strong {
  font-size: 22px;
}

@media (max-width: 840px) {
  .hero { margin-top: 45px; }
  .workspace { grid-template-columns: 1fr; }
  .result-card { display: block; }
  .guide-steps { grid-template-columns: 1fr; }
  .about-section { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .site-header,
  main,
  .site-footer { width: min(100% - 24px, 1180px); }
  .site-header { min-height: 64px; }
  .local-badge { padding: 7px 9px; font-size: 10px; }
  .hero { margin: 36px auto 28px; }
  h1 { font-size: clamp(40px, 13vw, 57px); }
  .hero-copy { font-size: 16px; }
  .privacy-line { align-items: flex-start; font-size: 12px; text-align: left; }
  .upload-panel { min-height: 350px; padding: 45px 18px 27px; border-radius: 19px; }
  .upload-actions { flex-direction: column; width: min(100%, 230px); }
  .button { width: 100%; }
  .canvas-card,
  .result-card,
  .palette-card { border-radius: 18px; }
  .canvas-toolbar { min-height: 62px; padding: 11px 12px 10px 15px; }
  .toolbar-actions { gap: 0; }
  .zoom-level { display: none; }
  .text-button { padding-inline: 7px; }
  .canvas-frame { min-height: 230px; }
  .interaction-help { padding-inline: 15px; }
  .pixel-readout { align-items: flex-start; flex-direction: column; gap: 5px; }
  .result-card { display: block; padding: 18px; }
  .palette-card { padding: 18px; }
  .palette-heading-row { align-items: flex-start; flex-direction: column; gap: 13px; }
  .palette-copy-all { width: 100%; }
  .palette-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-list { grid-template-columns: repeat(4, 1fr); }
  .magnifier { --magnifier-cell: 10.909px; width: 132px; height: 132px; }
  .magnifier canvas { width: 120px; height: 120px; }
  .trust-strip { grid-template-columns: 1fr; }
  .guide-section,
  .about-section,
  .faq-section { margin-block: 62px; }
  .guide-steps li { padding: 20px; }
  .about-section { gap: 28px; padding: 28px 22px; border-radius: 20px; }
  .faq-list summary { padding-block: 19px; font-size: 15px; }
  .faq-list summary::after { top: 17px; }
  .faq-list details > p { margin-right: 0; }
  .site-footer { gap: 10px; align-items: flex-start; flex-direction: column; }
  .site-footer nav { margin-left: 0; }
  .legal-page { padding: 44px 0 70px; }
  .legal-lead { margin-bottom: 42px; font-size: 17px; }
}

@media (max-width: 350px) {
  .canvas-toolbar { flex-wrap: wrap; row-gap: 2px; }
  .toolbar-actions { width: 100%; justify-content: flex-end; }
}

@media (hover: none), (pointer: coarse) {
  .paste-hint-desktop,
  .interaction-tip-desktop { display: none; }
  .paste-hint-touch,
  .interaction-tip-touch { display: block; }
  .copy-button,
  .text-button { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
