/* Palette Town — shared styles for the standalone tool pages (color, contrast, gradient).
   Loaded after style.css; relies on its theme tokens. */

html, body { height: auto; overflow: auto; }
body { min-height: 100vh; }
a { color: inherit; }
.logo-link { text-decoration: none; }
.toolbar-right .nav-link { text-decoration: none; }
.nav-link.active { background: var(--pop-4); color: var(--clay); }

.tool-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 18px 60px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.tool-main h1 { font-size: 30px; line-height: 1.15; }
.tool-main h2 { font-size: 20px; margin-bottom: 12px; }
.tool-main h3 { font-size: 15px; margin-bottom: 8px; color: var(--ink-2); }
.tool-main p { color: var(--ink-2); font-weight: 600; line-height: 1.55; }
.tool-main p.lead { font-size: 16px; }

.card {
  background: var(--clay);
  border-radius: var(--r);
  padding: 20px 22px;
  box-shadow: var(--clay-shadow);
}
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.mono { font-family: var(--mono); font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* inputs */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.text-input, .num-input, .select {
  border: 0; background: var(--clay-deep); color: var(--ink);
  border-radius: var(--r-sm); padding: 10px 14px; font-size: 14px;
  box-shadow: var(--recess); outline: none; min-width: 0; width: 100%;
}
.text-input:focus, .num-input:focus, .select:focus { box-shadow: var(--recess), 0 0 0 3px color-mix(in srgb, var(--pop-4) 45%, transparent); }
.hex-field { display: flex; align-items: center; gap: 8px; background: var(--clay-deep); border-radius: var(--r-sm); padding: 6px 8px; box-shadow: var(--recess); }
.hex-field input[type="text"] { flex: 1; border: 0; background: transparent; color: var(--ink); font-family: var(--mono); font-size: 15px; outline: none; min-width: 0; padding: 6px; }
input[type="color"].picker {
  -webkit-appearance: none; appearance: none; border: 0; width: 36px; height: 36px; padding: 0;
  border-radius: 10px; background: none; cursor: pointer; flex: none;
}
input[type="color"].picker::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"].picker::-webkit-color-swatch { border: 0; border-radius: 10px; box-shadow: 0 0 0 2px var(--hi) inset; }
input[type="color"].picker::-moz-color-swatch { border: 0; border-radius: 10px; }
input[type="range"].slider { width: 100%; accent-color: var(--pop); }

/* hero swatch */
.hero { display: grid; grid-template-columns: minmax(220px, 1fr) 1.4fr; gap: 22px; align-items: stretch; }
.hero-swatch {
  border-radius: var(--r); min-height: 220px; box-shadow: var(--clay-shadow);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 20px; gap: 6px; cursor: pointer;
}
.hero-swatch .hex { font-family: var(--font-display); font-size: 34px; letter-spacing: .02em; }
.hero-swatch .name { font-size: 16px; opacity: .85; }
.hero-info { display: flex; flex-direction: column; gap: 14px; justify-content: center; }

/* conversion table */
.conv-table { width: 100%; border-collapse: collapse; }
.conv-table td { padding: 9px 10px; border-bottom: 1px solid var(--lo-2); vertical-align: middle; }
.conv-table tr:last-child td { border-bottom: 0; }
.conv-table td:first-child { color: var(--muted); font-size: 12px; letter-spacing: .08em; width: 70px; }
.conv-table button {
  border: 0; background: transparent; color: var(--ink); font-family: var(--mono); font-size: 14px;
  cursor: pointer; text-align: left; padding: 4px 8px; border-radius: 8px; width: 100%;
}
.conv-table button:hover { background: var(--clay-deep); }

/* ramps / strips */
.ramp { display: flex; border-radius: var(--r-sm); overflow: hidden; box-shadow: var(--clay-shadow); height: 58px; }
.ramp a, .ramp span {
  flex: 1; display: block; position: relative; transition: flex .18s var(--ease-out); text-decoration: none; min-width: 0;
}
.ramp a:hover { flex: 2.4; }
.ramp a::after {
  content: attr(data-hex); position: absolute; inset: auto 0 6px 0; text-align: center;
  font-family: var(--mono); font-size: 10px; opacity: 0; color: inherit;
}
.ramp a:hover::after { opacity: 1; }
.ramp.tall { height: 84px; }
.ramp-block { display: flex; flex-direction: column; gap: 8px; }

/* harmonies */
.harmony { display: flex; flex-direction: column; gap: 8px; }
.harmony .ramp { height: 84px; }

/* cvd */
.cvd-row { display: grid; grid-template-columns: 150px 1fr 1fr auto; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--lo-2); }
.cvd-row:last-child { border-bottom: 0; }
.cvd-row .chip { height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 12px; }
.cvd-row .pct { font-family: var(--font-display); font-size: 20px; text-align: right; min-width: 70px; }
.cvd-row .who { color: var(--muted); font-size: 12px; }

/* contrast cards */
.contrast-card { border-radius: var(--r-sm); padding: 16px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--clay-shadow); }
.contrast-card .big { font-family: var(--font-display); font-size: 30px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 800; }
.badge.good { background: var(--pop-3); color: #123; }
.badge.warn { background: var(--pop-2); color: #332; }
.badge.bad { background: var(--pop); color: #fff; }

/* named colors */
.name-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.name-tile { border-radius: var(--r-sm); padding: 14px; min-height: 96px; display: flex; flex-direction: column; justify-content: flex-end; text-decoration: none; box-shadow: var(--clay-shadow); transition: transform .18s var(--ease); }
.name-tile:hover { transform: translateY(-3px); }
.name-tile .n { font-family: var(--font-display); font-size: 15px; }
.name-tile .h { font-family: var(--mono); font-size: 11px; opacity: .85; }

/* contrast page */
.ratio-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.ratio-box { border-radius: var(--r); padding: 26px; display: flex; flex-direction: column; align-items: center; gap: 8px; box-shadow: var(--clay-shadow); text-align: center; }
.ratio-box .ratio { font-family: var(--font-display); font-size: 64px; line-height: 1; }
.stars { font-size: 26px; letter-spacing: 3px; color: var(--pop-2); }
.stars .off { opacity: .25; }
.pass-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.pass { background: var(--clay-deep); border-radius: var(--r-sm); padding: 10px; box-shadow: var(--recess); display: flex; flex-direction: column; gap: 4px; }
.pass .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.pass .v { display: flex; gap: 6px; flex-wrap: wrap; }
.sample { border-radius: var(--r); padding: 28px; min-height: 180px; box-shadow: var(--clay-shadow); outline: none; }
.sample h3 { font-size: 30px; color: inherit; margin-bottom: 10px; font-family: var(--font-display); }
.sample p { color: inherit; font-size: 16px; }
.sample .ui-demo { margin-top: 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sample .ui-demo .btn-demo { padding: 8px 16px; border-radius: var(--r-pill); border: 2px solid currentColor; font-weight: 800; }
.sample .ui-demo .field-demo { padding: 8px 12px; border-radius: 10px; border: 2px solid currentColor; opacity: .8; }
.fix-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fix { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-sm); background: var(--clay-deep); box-shadow: var(--recess); }
.fix .chip { width: 52px; height: 52px; border-radius: 12px; flex: none; box-shadow: 0 0 0 2px var(--hi) inset; }
.fix .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fix .meta .t { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.wcag-note { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.wcag-note div { background: var(--clay-deep); border-radius: var(--r-sm); padding: 12px 14px; box-shadow: var(--recess); }
.wcag-note strong { display: block; margin-bottom: 4px; }

/* gradient page */
.gradient-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; align-items: start; }
.gradient-preview { border-radius: var(--r); height: 340px; box-shadow: var(--clay-shadow); }
.stops { display: flex; flex-direction: column; gap: 8px; }
.stop { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; align-items: center; background: var(--clay-deep); border-radius: var(--r-sm); padding: 6px 8px; box-shadow: var(--recess); }
.stop input[type="text"] { background: transparent; border: 0; color: var(--ink); font-family: var(--mono); outline: none; min-width: 0; width: 100%; }
.stop input[type="number"] { width: 64px; background: var(--clay); border: 0; color: var(--ink); border-radius: 8px; padding: 6px 8px; text-align: right; outline: none; }
.css-out { background: var(--clay-deep); border-radius: var(--r-sm); padding: 14px; font-family: var(--mono); font-size: 13px; white-space: pre-wrap; word-break: break-all; box-shadow: var(--recess); max-height: 160px; overflow: auto; }
.segmented { display: inline-flex; background: var(--clay-deep); border-radius: var(--r-pill); padding: 4px; box-shadow: var(--recess); }
.segmented button { border: 0; background: transparent; color: var(--ink-2); padding: 7px 14px; border-radius: var(--r-pill); cursor: pointer; font-size: 13px; }
.segmented button.active { background: var(--clay); color: var(--ink); box-shadow: var(--clay-shadow); }
.palette-strip { display: flex; border-radius: var(--r-sm); overflow: hidden; box-shadow: var(--clay-shadow); height: 110px; }
.palette-strip a { flex: 1; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px; font-family: var(--mono); font-size: 11px; text-decoration: none; min-width: 0; }

.tool-footer { text-align: center; color: var(--muted); font-size: 12px; padding: 20px; }
.tool-footer a { margin: 0 6px; }

@media (max-width: 760px) {
  .hero, .ratio-hero, .gradient-layout, .fix-list { grid-template-columns: 1fr; }
  .cvd-row { grid-template-columns: 1fr 1fr; }
  .cvd-row .who { grid-column: 1 / -1; }
  .pass-grid { grid-template-columns: 1fr; }
  .toolbar { height: auto; flex-wrap: wrap; padding: 10px 14px; }
  .toolbar-right { flex-wrap: wrap; }
  .tool-main h1 { font-size: 24px; }
  .ratio-box .ratio { font-size: 48px; }
}

/* 404 page */
.nf-main { align-items: center; text-align: center; padding-top: 30px; }
.nf-code { font-family: var(--font-display); font-size: clamp(96px, 22vw, 180px); line-height: 1; letter-spacing: -.04em; background: linear-gradient(120deg, var(--pop), var(--pop-4), var(--pop-3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nf-strip { width: 100%; max-width: 720px; height: 130px; }
.nf-main .card { width: 100%; max-width: 720px; }
.nf-links { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.nf-links a { background: var(--clay-deep); border-radius: var(--r-pill); padding: 8px 16px; text-decoration: none; box-shadow: var(--recess); font-size: 14px; }
.nf-links a:hover { color: var(--pop); }

/* extract page */
.extract-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  text-align: center; padding: 56px 24px; cursor: pointer;
  border: 3px dashed var(--muted); box-shadow: none; transition: border-color .18s, background .18s;
}
.extract-drop:hover { border-color: var(--pop-4); background: color-mix(in srgb, var(--pop-4) 8%, var(--clay)); }
.extract-drop svg { color: var(--muted); }
.extract-drop p { margin: 0; }
.extract-result { display: flex; flex-direction: column; gap: 16px; }
.extract-row { align-items: flex-start; }
.extract-thumb { width: 160px; height: 160px; object-fit: contain; background: var(--clay-deep); border-radius: var(--r-sm); box-shadow: var(--clay-shadow); flex: none; }
.extract-strip { flex: 1; min-width: 220px; height: 160px; }
@media (max-width: 760px) {
  .extract-thumb { width: 100%; height: 160px; }
  .extract-strip { width: 100%; }
}

/* tailwind page */
textarea.text-input { resize: vertical; font-family: var(--mono); line-height: 1.5; }
.scales { display: flex; flex-direction: column; gap: 18px; }
.tw-base { width: 34px; height: 34px; border-radius: 10px; box-shadow: 0 0 0 2px var(--hi) inset; flex: none; }
.tw-name { width: 180px; font-family: var(--mono); }
.tw-strip { display: grid; grid-template-columns: repeat(11, 1fr); gap: 6px; margin-top: 14px; }
.tw-swatch { border: 0; cursor: pointer; border-radius: 12px; min-height: 84px; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; padding: 8px; gap: 2px; font-family: var(--mono); box-shadow: var(--clay-shadow); transition: transform .18s var(--ease); min-width: 0; }
.tw-swatch:hover { transform: translateY(-3px); }
.tw-step { font-weight: 800; font-size: 12px; }
.tw-hex { font-size: 10px; opacity: .85; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tw-out { max-height: 360px; }
@media (max-width: 760px) {
  .tw-strip { grid-template-columns: repeat(4, 1fr); }
  .tw-swatch { min-height: 64px; }
}
