/* The price range: a light filter on a white page, the prices chosen in teal. */
:root {
  --page: #ffffff;          /* the page */
  --ink: #1c1b18;
  --muted: #85827a;
  --line: #eceae4;
  --bar: #e6e3dc;           /* a bar outside the range */
  --accent: #14a08a;        /* the range chosen */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Sofia Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.price {
  width: min(440px, 100%);
  padding: 24px 24px 26px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: #ffffff;
  box-shadow: 0 18px 40px -26px rgba(28, 27, 24, 0.25);
}

.price__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.price__title {
  margin: 0;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.price__note {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.price__count {
  margin: 2px 0 0;
  padding: 5px 11px;
  border-radius: 999px;
  background: #e6f6f2;
  color: #0b6f60;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- the chart */
.price__chart {
  position: relative;
  height: 150px;
  margin-top: 22px;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.price__bars {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 86px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
}

.price__bar {
  flex: 1;
  min-width: 0;
  border-radius: 3px 3px 1px 1px;
  background: var(--bar);
  transform-origin: 50% 100%;
}

.price__track {
  position: absolute;
  left: 0;
  right: 0;
  top: 98px;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
}

.price__fill {
  position: absolute;
  inset: 0;
  border-radius: 2px;
  background: var(--accent);
  transform-origin: 0 50%;
}

.price__thumb {
  position: absolute;
  top: 100px;
  left: 0;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 3px 10px -2px rgba(20, 60, 54, 0.3);
  pointer-events: none;
}

.price__thumb.is-focus {
  outline: 3px solid rgba(20, 160, 138, 0.35);
  outline-offset: 2px;
}

.price__tag {
  position: absolute;
  top: 122px;
  left: 0;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.price__tag--both {
  opacity: 0;
}

/* the two real sliders, under the drawn ones: for the keys and for screen readers */
.price__range {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
  opacity: 0;
}

/* ---------------------------------------------------------------- the fields */
.price__fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin-top: 8px;
}

.field {
  display: block;
}

.field__label {
  display: block;
  margin: 0 0 6px 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.field__box {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 46px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  color: var(--muted);
  font-size: 16px;
  transition: border-color 0.2s;
}

.field__box:focus-within {
  border-color: var(--accent);
}

.field__input {
  flex: 1;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 650 16px 'Sofia Sans Variable', system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  outline: none;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
