/* The AMOUNT control: preset chips over the one input, the currency seated
 * inside the input as a prefix the way the date part seats its calendar
 * affordance. The chips are the field register, not the CTA's: they sit among
 * inputs and read as one. */

/* A fieldset for the group semantics, reset like the choice list: the UA's
 * box and legend inset are not the kit's. */
.sk-amount {
  margin: 0 0 var(--kit-space-3);
  padding: 0;
  border: 0;
  min-width: 0;
}
.sk-amount > legend {
  padding: 0;
}
/* The chips sit `columns` across (three at rest) and hold their count on a
 * phone: a chip is a short number, not a choice row's sentence. */
.sk-amount-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--kit-space-1);
  margin-bottom: var(--kit-space-2);
}
.sk-amount-presets[data-sk-columns="1"] {
  grid-template-columns: minmax(0, 1fr);
}
.sk-amount-presets[data-sk-columns="2"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.sk-amount-preset {
  padding: 0.6rem 0.75rem;
  font: inherit;
  font-size: var(--sk-text-detail-size);
  font-weight: 600;
  color: var(--sk-ink);
  background: var(--sk-field);
  border: var(--sk-border-width-min) solid var(--sk-stroke);
  border-radius: var(--sk-control-radius);
  cursor: pointer;
  transition:
    background-color 140ms ease,
    color 140ms ease,
    border-color 140ms ease;
}
.sk-amount-preset:hover {
  border-color: var(--sk-ink);
}
/* Pressed ink is --sk-btn-ink, as on the date part's selected day: the overlay
 * ink remaps move the accent fill but not --sk-bg. */
.sk-amount-preset[aria-pressed="true"] {
  background: var(--sk-accent);
  color: var(--sk-btn-ink);
  border-color: var(--sk-accent);
}

.sk-amount-input {
  position: relative;
  display: block;
}
.sk-amount-currency {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  translate: 0 -50%;
  pointer-events: none;
  color: var(--sk-ink-muted);
}
/* Room for the prefix; the focused border thickens by --sk-focus-grow (base),
 * so the padding gives back exactly that much and the number does not jump. */
.sk-amount-control {
  padding-left: 2.1rem;
}
.sk-amount-control:focus-visible {
  padding-left: calc(2.1rem - var(--sk-focus-grow));
}
/* The authored banner follows the WRAP, so the control's bottom corners square
 * off against it the way the select's and the date's do. */
.sk-field[data-invalid="true"] .sk-amount-input:has(+ .sk-field-error) .sk-amount-control {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.sk-amount-input + .sk-field-error .sk-field-error-banner {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
