/* Color Picker, app-specific styles. Shared tokens/components come from ../styles.css
   (dropped beside this app by the build). Reuses the shared .grid/.card/.ic/.mode-*
   vocabulary from Compress PDF / Split PDF so it stays visually identical to them. */

body.shell { --sa-boxed-maxw: 1080px; }
.wrap { max-width: 1080px; padding: 10px 24px 10px; position: relative; z-index: 1; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Warm peach glow rising from the bottom-left, matching the other tools'
   ambient treatment, over the light gray body. */
body.shell::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(65% 60% at 0% 100%, rgba(237,131,54,.55), rgba(246,181,69,.22) 45%, transparent 78%),
    radial-gradient(38% 36% at 100% 100%, rgba(246,181,69,.20), transparent 70%);
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* --- Tool hero --- */
.tool-hero { text-align: center; padding: 0 0 6px; }
.tool-hero h1 { font-size: clamp(30px, 3vw, 38px); line-height: 1.1; }
.tool-hero-lead { color: var(--muted); font-size: 15.5px; margin: 5px auto 0; max-width: 600px; }
.tool-hero-trust {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 8px;
  color: #4d7c0f; background: rgba(132,204,22,.12); border: 1px solid rgba(132,204,22,.35);
  padding: 5px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
}
.tool-hero-trust svg { color: #65a30d; flex: none; }

/* --- Mode selector --- */
.mode-section { margin-top: 0; }
.mode-fieldset { border: none; padding: 0; margin: 0; }
.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.mode-opt {
  position: relative; display: flex; flex-direction: column; gap: 1px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  padding: 7px 14px; cursor: pointer;
  transition: border-color .12s ease, box-shadow .12s ease, background .12s ease, color .12s ease, transform .12s ease;
}
.mode-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mode-opt-label { font-weight: 600; font-size: 15px; color: inherit; }
.mode-opt-hint { color: var(--muted); font-size: 13px; }
.mode-opt:not(:has(input:checked)):hover { box-shadow: var(--shadow-hover); border-color: var(--line-strong); transform: translateY(-1px); }
.mode-opt:has(input:checked) {
  color: #fff; background: linear-gradient(160deg, #a3e635, #65a30d); border-color: transparent;
  box-shadow: 0 0 0 3px rgba(132,204,22,.28);
}
.mode-opt:has(input:checked) .mode-opt-hint { color: rgba(255,255,255,.9); }
.mode-opt:has(input:focus-visible) { outline: none; box-shadow: 0 0 0 3px rgba(132,204,22,.28); border-color: #65a30d; }
.mode-opt[hidden] { display: none; }

/* --- Two-column layout --- */
.picker-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 10px; align-items: start; }
@media (max-width: 760px) { .picker-layout { grid-template-columns: 1fr; } }

.picker-panel, .formats-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px;
}

/* --- Manual picker: SV square + hue slider --- */
.input-panel { display: flex; flex-direction: column; gap: 10px; }
.input-panel[hidden] { display: none; }
.sv-square {
  position: relative; width: 100%; aspect-ratio: 2 / 1; border-radius: 10px; cursor: crosshair;
  background:
    linear-gradient(to top, #000, rgba(0,0,0,0)),
    linear-gradient(to right, #fff, hsl(0, 100%, 50%));
  touch-action: none; outline: none;
}
.sv-square:focus-visible { box-shadow: 0 0 0 3px rgba(132,204,22,.45); }
.sv-thumb {
  position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.4), 0 1px 3px rgba(0,0,0,.4);
  transform: translate(-50%, -50%); pointer-events: none; left: 0%; top: 0%;
}
.hue-slider {
  -webkit-appearance: none; appearance: none; width: 100%; height: 14px; border-radius: 999px;
  background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
  cursor: pointer; outline: none;
}
.hue-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 2px solid #14171f; box-shadow: 0 1px 3px rgba(0,0,0,.35); cursor: pointer;
}
.hue-slider::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid #14171f;
  box-shadow: 0 1px 3px rgba(0,0,0,.35); cursor: pointer;
}
.hue-slider:focus-visible { box-shadow: 0 0 0 3px rgba(132,204,22,.45); }

/* --- Eyedropper panel --- */
.panel-note { color: var(--muted); font-size: 14.5px; }
#panel-eyedropper { align-items: flex-start; }
#btn-eyedropper { background: linear-gradient(135deg, #a3e635, #65a30d); box-shadow: 0 6px 22px rgba(101,163,13,.35); }

/* --- Image sampling panel --- */
.image-dropzone {
  border: 2px dashed var(--line-strong); border-radius: 10px; background: var(--bg);
  display: grid; place-items: center; min-height: 160px; overflow: hidden;
}
.image-empty { text-align: center; padding: 24px; display: grid; gap: 8px; place-items: center; }
.image-empty p { color: var(--muted); font-size: 14.5px; }
#image-canvas { display: block; width: 100%; height: auto; cursor: crosshair; }

/* --- Right column: swatch + fields --- */
.color-swatch {
  width: 100%; height: 38px; border-radius: 10px; border: 1px solid var(--line-strong);
  box-shadow: var(--shadow); margin-bottom: 8px; background: #65a30d;
}
.field-row { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.field-row label { width: 36px; flex: none; font-weight: 600; font-size: 13.5px; color: var(--muted); }
.field-row input {
  flex: 1; min-width: 0; font: inherit; font-size: 14.5px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text);
  transition: border-color .12s ease, box-shadow .12s ease;
}
.field-row input:focus { outline: none; border-color: #65a30d; box-shadow: 0 0 0 3px rgba(132,204,22,.22); }
.field-row input.invalid { border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220,38,38,.15); }
.copy-btn {
  flex: none; background: var(--surface); color: #4d7c0f; border: 1px solid #bef264;
  border-radius: 8px; padding: 8px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .12s ease;
}
.copy-btn:hover { background: rgba(132,204,22,.1); }

.swatch-block { margin-top: 8px; }
.swatch-title { font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.swatch-row { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch {
  width: 28px; height: 28px; border-radius: 7px; border: 1px solid rgba(0,0,0,.1); cursor: pointer;
  padding: 0; transition: transform .12s ease, box-shadow .12s ease;
}
.swatch:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.swatch:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(132,204,22,.45); }

/* --- Trust group --- */
.info-panel { margin-top: 8px; }
.info-panel .benefits.grid { margin: 0; gap: 10px; }
.info-panel .card { padding: 8px 12px; transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease; }
.info-panel .card h3 { font-size: 15px; margin-bottom: 3px; }
.info-panel .card p { font-size: 13px; line-height: 1.4; }
.info-panel .card .ic { width: 32px; height: 32px; border-radius: 9px; margin-bottom: 7px; }
.info-panel .card .ic svg { width: 17px; height: 17px; }
.info-panel .card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); border-color: var(--line-strong); }
.info-panel .card .ic { color: #fff; }
.info-panel .card .ic-blue  { background: var(--accent); }
.info-panel .card .ic-amber { background: var(--amber); }
.info-panel .card .ic-green { background: var(--good); }

.privacy {
  margin: 9px 0 0; display: flex; align-items: center; gap: 10px;
  color: var(--muted); font-size: 13px;
}
.privacy .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.privacy .dot.good { background: var(--good); box-shadow: 0 0 0 3px rgba(28,164,99,.18); }

/* --- Toast --- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 16px);
  background: var(--text); color: #fff; padding: 11px 18px; border-radius: 10px;
  font-size: 14px; opacity: 0; pointer-events: none; z-index: 60;
  transition: opacity .2s ease, transform .2s ease; max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
  .picker-panel, .formats-panel { padding: 14px; }
  .field-row label { width: 32px; }
}
