/*
 * Free tools and guides on groomworth.com (D-75): the grooming price
 * calculator and the price-increase guide with its letter maker.
 *
 * Loaded after styles.css and built only from its tokens, so both themes
 * follow. No inline styles anywhere: the site's Content-Security-Policy
 * allows stylesheets from this site only.
 */

.tool-head .lede {
  margin-bottom: 0;
}

/* The calculator: the form beside its answer, stacked on a phone. */
.tool {
  display: grid;
  gap: 24px;
  padding: clamp(32px, 5vw, 56px) 0 clamp(24px, 4vw, 40px);
}
@media (min-width: 860px) {
  .tool {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 40px;
    align-items: start;
  }
}

.tool-form {
  display: grid;
  gap: 20px;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.tool-form legend {
  padding: 0;
  margin-bottom: 4px;
  font: 600 13px/1.3 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.seg {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: var(--paper-sunk);
  border: 1px solid var(--rule);
  gap: 4px;
}
.seg label {
  padding: 8px 16px;
  border-radius: 999px;
  font: 600 15px/1 var(--sans);
  color: var(--ink-2);
  cursor: pointer;
}
.seg input:checked + label {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 2px rgb(0 0 0 / 12%);
}
.seg input:focus-visible + label {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.field {
  display: grid;
  gap: 6px;
}
.field > label {
  font: 600 16px/1.3 var(--sans);
}
.field .hint {
  margin: 0;
  color: var(--ink-3);
  font-size: 14px;
  line-height: 1.45;
}
.input {
  display: flex;
  align-items: center;
  max-width: 260px;
  border: 1px solid var(--rule-strong);
  border-radius: 14px;
  background: var(--card);
  overflow: hidden;
}
.input:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-tint);
}
.input span {
  padding: 0 0 0 14px;
  color: var(--ink-3);
  font: 600 18px/1 var(--sans);
  white-space: nowrap;
}
.input span.after {
  padding: 0 14px 0 0;
}
.input input {
  flex: 1;
  min-width: 0;
  padding: 13px 14px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 600 20px/1.2 var(--sans);
  font-variant-numeric: tabular-nums;
}
.input input:focus {
  outline: none;
}

/* The answer. */
.answer {
  padding: clamp(22px, 3vw, 32px);
  border-radius: 24px;
  background: var(--band);
  color: var(--band-ink);
  min-width: 0;
}
.answer .eyebrow {
  margin-bottom: 8px;
  color: var(--band-accent);
}
.answer-figure {
  margin: 0;
  font: 700 clamp(56px, 9vw, 84px)/1 var(--display);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.answer-line {
  margin: 12px 0 20px;
  color: var(--band-muted);
  font-size: 16px;
  line-height: 1.5;
}
.answer-rows {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--band-rule);
  font-size: 15px;
}
.answer-rows div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.answer-rows dt {
  color: var(--band-muted);
}
.answer-rows dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.verdict {
  display: inline-block;
  margin: 14px 0 0;
  padding: 7px 14px;
  border-radius: 999px;
  font: 600 15px/1.3 var(--sans);
}
.verdict.under {
  background: var(--caution-bg);
  color: var(--caution-ink);
}
.verdict.over {
  background: var(--positive-bg);
  color: var(--positive-ink);
}
.verdict[hidden] {
  display: none;
}

/* Sections under the tool. */
.tool-section {
  padding: clamp(32px, 5vw, 56px) 0;
  border-top: 1px solid var(--rule);
}
.tool-section > h2,
.tool-section .split h2 {
  margin: 0 0 12px;
  font: 650 clamp(26px, 3.4vw, 32px)/1.2 var(--serif);
  letter-spacing: -0.012em;
  text-wrap: balance;
}
.tool-section p,
.tool-section li {
  max-width: 40em;
  color: var(--ink-2);
}
.tool-section .tool {
  padding-top: 8px;
}

.table-scroll {
  overflow-x: auto;
  margin: 16px 0 8px;
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: var(--card);
}
.ladder {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.ladder th,
.ladder td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
.ladder thead th {
  background: var(--paper-sunk);
  color: var(--ink-3);
  font: 600 12px/1.3 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ladder tbody tr:last-child th,
.ladder tbody tr:last-child td {
  border-bottom: 0;
}
.ladder td.strong {
  font-weight: 650;
  color: var(--ink);
}

/* A table of words, not prices: cells wrap, and on phones each row stacks
   with its column name above each cell, like the pricing page's compare table. */
.ladder.terms {
  font-size: 15px;
  font-variant-numeric: normal;
}
.ladder.terms th,
.ladder.terms td {
  white-space: normal;
  vertical-align: top;
  line-height: 1.45;
}
.ladder.terms tbody th {
  color: var(--ink);
  font: 650 15px/1.45 var(--sans);
  letter-spacing: 0;
  text-transform: none;
}
@media (max-width: 600px) {
  .ladder.terms thead {
    display: none;
  }
  .ladder.terms tr {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--rule);
  }
  .ladder.terms tbody tr:last-child {
    border-bottom: 0;
  }
  .ladder.terms th,
  .ladder.terms td {
    display: block;
    padding: 0;
    border: 0;
  }
  .ladder.terms td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--ink-3);
    font: 600 11px/1.4 var(--sans);
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
}

.formula {
  display: inline-block;
  margin: 4px 0 16px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--paper-sunk);
  color: var(--ink);
  font: 600 16px/1.5 var(--sans);
}

/* The letter maker. */
.letter-out {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.letter-box {
  margin: 0;
  padding: 20px 22px;
  border: 1px solid var(--rule-strong);
  border-radius: 18px;
  background: var(--card);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.letter-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.copy-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.copy-row .button {
  padding: 13px 22px;
  font-size: 15px;
  border: 0;
  cursor: pointer;
}
.copy-status {
  color: var(--ink-3);
  font-size: 14px;
}
.tool-form select {
  max-width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--rule-strong);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  font: 16px/1.3 var(--sans);
}
.tool-form input[type="text"],
.tool-form input[type="date"] {
  max-width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--rule-strong);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  font: 16px/1.3 var(--sans);
}
.tool-form input[type="text"]:focus,
.tool-form input[type="date"]:focus,
.tool-form select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-tint);
}

/* The way to the app, at the end of each page. */
.app-cta {
  display: grid;
  gap: 8px;
  margin: clamp(40px, 6vw, 64px) 0 clamp(64px, 9vw, 112px);
  padding: clamp(24px, 4vw, 40px);
  border-radius: 24px;
  background: var(--teal-tint);
  color: var(--ink);
}
.app-cta h2 {
  margin: 0;
  font: 650 clamp(24px, 3vw, 30px)/1.2 var(--serif);
  letter-spacing: -0.012em;
  text-wrap: balance;
}
.app-cta p {
  max-width: 38em;
  margin: 0 0 8px;
  color: var(--ink-2);
}
.app-cta .stores {
  margin-top: 4px;
}

.byline {
  margin: 14px 0 0;
  color: var(--ink-3);
  font-size: 15px;
}

/* A worked example inside a guide. */
.doc .example {
  margin: 20px 0;
  padding: 16px 20px;
  border-left: 3px solid var(--teal);
  background: var(--paper-sunk);
  border-radius: 0 12px 12px 0;
}
.doc .example p {
  margin: 0;
}
.doc .example p + p {
  margin-top: 8px;
}
.doc .table-scroll {
  margin: 20px 0;
}

/* /changelog: one section per update, newest first (D3.5). */
.changelog .change + .change {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--rule);
}
.changelog .change h2 {
  margin-top: 36px;
  font-size: 24px;
}
.changelog .change:first-child h2 {
  margin-top: 0;
}

/* /vs pages: GroomWorth beside another app, row by row (D5.3). */
.vs-table th[scope="row"] {
  width: 26%;
  color: var(--ink);
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
  border-bottom-color: var(--rule);
}
.vs-table td {
  width: 37%;
}
.doc .vs-source,
.doc .vs-small {
  color: var(--ink-3);
  font-size: 14px;
}
.doc .vs-small {
  margin-top: 40px;
}
