/* =========================================================
   Tools (/tools/ hub + individual browser tools)
   Loads after styles.css + blog.css (+ features.css for hub cards).
   ========================================================= */

.tool { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 1.2rem; margin: 1.6em 0 2.2em; }

/* ---- empty state ---- */
.pci-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.7rem; text-align: center;
  min-height: 260px; border: 2px dashed var(--line-strong); border-radius: var(--r-md); padding: 1.6rem; background: var(--paper);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.pci-drop.over { border-color: var(--clay); background: var(--sand); }
.pci-drop p { margin: 0; color: var(--ink-soft); }
.pci-drop .pci-small { font-size: 0.85rem; color: var(--muted); }
.pci-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; }
.pci-btn {
  display: inline-flex; align-items: center; gap: 0.4rem; border: 1px solid var(--line-strong); background: #fff; color: var(--ink);
  font: inherit; font-weight: 600; font-size: 0.92rem; border-radius: 999px; padding: 0.6rem 1.1rem; cursor: pointer;
}
.pci-btn.primary { background: var(--clay-deep); border-color: var(--clay-deep); color: var(--paper); }
.pci-btn:hover { box-shadow: var(--shadow-sm); }
.pci-file-label input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.pci-file-label:focus-within { outline: 3px solid var(--clay); outline-offset: 2px; }

/* ---- working state ---- */
.pci-work { display: none; }
#pci.has-image .pci-drop { display: none; }
#pci.has-image .pci-work { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.pci-stage { position: relative; line-height: 0; }
#pci-canvas { width: 100%; height: auto; border-radius: var(--r-md); cursor: crosshair; touch-action: manipulation; }
.pci-marker {
  position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%;
  border: 3px solid #fff; box-shadow: 0 0 0 1.5px rgba(31, 27, 22, 0.6), 0 2px 8px rgba(0, 0, 0, 0.3); pointer-events: none;
}
.pci-side { display: grid; gap: 1rem; min-width: 0; }
.pci-result { display: grid; grid-template-columns: 84px 1fr; gap: 0.9rem; align-items: start; }
.pci-result .pci-hint { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 0.95rem; }
.pci-swatch { width: 84px; height: 84px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); }
.pci-name { font-family: var(--serif); font-size: 1.25rem; color: var(--ink); margin: 0 0 0.2em !important; line-height: 1.2 !important; }
.pci-hex { margin: 0 0 0.5em !important; display: flex; align-items: center; gap: 0.5rem; }
.pci-hex code { font-size: 1rem; font-weight: 600; color: var(--ink); background: var(--sand); padding: 2px 8px; border-radius: 6px; }
.pci-copy { border: 1px solid var(--line-strong); background: #fff; border-radius: 999px; font: inherit; font-size: 0.8rem; padding: 2px 10px; cursor: pointer; }
.pci-data dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 0.7rem; font-size: 0.88rem; }
.pci-data dt { color: var(--muted); }
.pci-data dd { margin: 0; color: var(--ink-soft); }
.pci-pal-title { font-weight: 600; font-size: 0.9rem; color: var(--ink); margin: 0 0 0.5em !important; }
.pci-pal-row { display: flex; height: 78px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); }
.pci-chip { border: none; cursor: pointer; flex-basis: 0; min-width: 0; overflow: hidden; display: flex; align-items: flex-end; padding: 6px 5px; font: inherit; }
.pci-chip span { font-size: 0.62rem; white-space: nowrap; line-height: 1.25; color: #fff; text-align: left; font-weight: 600; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); }
.pci-chip.light span { color: var(--ink); text-shadow: none; }
.pci-chip:focus-visible { outline: 3px solid var(--clay); outline-offset: -3px; }
.pci-foot { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; flex-wrap: wrap; font-size: 0.82rem; color: var(--muted); }
.pci-foot p { margin: 0 !important; font-size: 0.82rem !important; }
@media (max-width: 720px) {
  #pci.has-image .pci-work { grid-template-columns: 1fr; }
}

/* static example swatches (no inline styles: CSP) */
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--line-strong); vertical-align: -2px; margin-right: 6px; }
.sw-b7af9d { background: #B7AF9D; }
.sw-ae9371 { background: #AE9371; }
