/* The free tools under /tools: the hub and each tool's page. Tokens only (theme.css), so both themes work. */

[hidden] { display: none !important; }

.tools-rack .tool-tag .product-body { padding-top: 22px; }
.tool-free { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--lime-ink); }

/* ---------- color change calculator ---------- */

.cc { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 18px; align-items: start; }
.cc-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px; min-width: 0; }
.cc-h { font-size: 15px; font-weight: 700; color: var(--text); margin: 0 0 10px; }

.cc-chip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 14px; padding: 8px 12px; border-radius: var(--r-pill); background: var(--cobalt-wash); color: var(--text-2); font-size: 14px; }
.cc-chip b { color: var(--text); font-weight: 650; }
.cc-chip .text-link { font-size: 13px; }

.cc-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 168px; padding: 24px; text-align: center; border: 1.5px dashed var(--field-line); border-radius: var(--r-card); background: var(--bg-2); background-image: var(--plate-grid); background-size: var(--plate-pitch) var(--plate-pitch); cursor: pointer; transition: border-color 160ms var(--ease-out), background-color 160ms var(--ease-out); }
.cc-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.cc-drop strong { font-size: 19px; font-stretch: 110%; font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
.cc-drop span { max-width: 34ch; font-size: 14px; color: var(--muted); }
.cc-drop.is-over, .cc-drop:hover { border-color: var(--cobalt); }
.cc-drop:focus-within { border-color: var(--cobalt); box-shadow: 0 0 0 3px rgb(43 89 255 / 0.4); }
.cc-or { margin: 12px 0 18px; font-size: 15px; color: var(--text-2); }

.cc-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.cc-field small { font-size: 12px; color: var(--muted); }
.cc-unit { position: relative; display: block; }
.cc-unit input { width: 100%; padding-right: 44px; }
.cc-unit em { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; font-family: var(--mono); font-size: 13px; color: var(--muted); pointer-events: none; }

.cc-memory { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; font-size: 14px; color: var(--text-2); }
.cc-memory summary { cursor: pointer; font-weight: 650; color: var(--text); }
.cc-memory > * + * { margin-top: 12px; }
.cc-check { display: flex; gap: 10px; align-items: flex-start; }
.cc-check input { margin-top: 3px; accent-color: var(--cobalt); }
.cc-check small, .cc-memory-foot small { color: var(--muted); }
.cc-recent ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cc-recent li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.cc-recent small { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.cc-note { margin-top: 14px; color: var(--text-2); }

.cc-status { color: var(--muted); font-size: 16px; }
.cc-status.is-error { color: var(--danger); font-weight: 600; }
.cc-file { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.cc-file b { font-family: var(--mono); font-size: 15px; font-weight: 500; color: var(--lime-ink); overflow-wrap: anywhere; }
.cc-file span { font-size: 13px; color: var(--muted); }

.cc-changes { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 8px; }
.cc-change { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-control); background: var(--bg-2); }
.cc-change.is-on { border-color: var(--cobalt); background: var(--cobalt-wash); }
.cc-change label { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; cursor: pointer; }
.cc-change input { width: 18px; height: 18px; accent-color: var(--cobalt); }
.cc-layer { font-size: 18px; color: var(--text); }
.cc-layer b { font-size: 22px; font-stretch: 112%; font-weight: 800; font-variant-numeric: tabular-nums; }
.cc-z { font-family: var(--mono); font-size: 13px; color: var(--text-2); }
.cc-tag { margin-left: auto; padding: 2px 10px; border-radius: var(--r-pill); background: var(--cobalt); color: #fff; font-size: 12px; font-weight: 700; }
.cc-change small { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); }
.cc-change .cc-warn { color: var(--danger); }
.cc-none { padding: 10px 0; color: var(--muted); font-size: 15px; }

.cc-preview { display: grid; grid-template-columns: minmax(0, 1fr) 56px; gap: 10px; }
.cc-plate { position: relative; border-radius: var(--r-well); background: var(--bg-2); background-image: var(--plate-grid); background-size: var(--plate-pitch) var(--plate-pitch); overflow: hidden; }
.cc-plate canvas { display: block; width: 100%; aspect-ratio: 16 / 10; }
.cc-plate-label { position: absolute; left: 10px; bottom: 8px; padding: 3px 8px; border-radius: var(--r-pill); background: var(--sticker-bg); font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.cc-profile { border-radius: var(--r-well); background: var(--bg-2); padding: 6px 4px; cursor: pointer; }
.cc-profile svg { display: block; width: 100%; height: 100%; }
.cc-profile line { stroke: var(--text); stroke-width: 0.6; vector-effect: non-scaling-stroke; stroke-dasharray: 3 2; }
.cc-profile rect { opacity: 0.85; }
.cc-profile rect.is-here { opacity: 1; stroke: var(--text); stroke-width: 1; vector-effect: non-scaling-stroke; }
.cc-slider { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 650; color: var(--text-2); }
.cc-slider input { flex: 1; accent-color: var(--cobalt); }
.cc-colors { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px 18px; }
.cc-color { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); }
.cc-color input { width: 38px; height: 30px; padding: 0; border: 1px solid var(--swatch-edge); border-radius: 8px; background: none; cursor: pointer; }
.cc-color small { display: block; font-family: var(--mono); font-size: 11px; color: var(--muted); }

.cc-weights { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.cc-weights ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-width: 360px; }
.cc-weights li { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--text-2); }
.cc-weights li b { margin-left: auto; font-family: var(--mono); font-weight: 500; color: var(--text); }
.cc-weights li i { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--swatch-edge); }
.cc-weights .cc-total { padding-top: 6px; border-top: 1px solid var(--line); font-weight: 650; color: var(--text); }
.cc-weights p { margin: 10px 0 12px; font-size: 13px; color: var(--muted); max-width: 52ch; }

.cc-share { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.cc-share-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 10px; }
.cc-share-row .field { flex: 1 1 200px; }
.cc-share-note { margin-top: 8px; color: var(--text-2); }
.cc-unlock { color: var(--text-2); }

.cc-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 24px 0 22px; }
.cc-tabs button { height: 40px; padding: 0 16px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); font-weight: 650; cursor: pointer; }
.cc-tabs button[aria-selected="true"] { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.cc-tabs button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.cc-steps h3 { margin: 28px 0 16px; font-size: 21px; color: var(--text); }
.js .cc-tabs:not([hidden]) ~ .cc-steps h3 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.cc-steps b { color: var(--text); }
.cc-slicers .section-lead b { color: var(--text); }

.cc-designs .rack { margin-top: 28px; }
.cc-fit { display: contents; }
.cc-designs[data-prefer="large"] [data-fit="large"] > *, .cc-designs[data-prefer="small"] [data-fit="small"] > * { order: -1; }
.cc-more { margin-top: 26px; }
.cc-more .button, .cc-weights .button { max-width: 100%; height: auto; min-height: 46px; padding-top: 10px; padding-bottom: 10px; white-space: normal; }

@media (max-width: 900px) {
  .cc { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .cc-panel { padding: 16px; border-radius: var(--r-card); }
  .cc-fields { grid-template-columns: minmax(0, 1fr); }
  .cc-preview { grid-template-columns: minmax(0, 1fr) 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .cc-drop { transition: none; }
}
