:root {
  --text-soft: #6F5049;
  --gold: #F2D27F;
}

[hidden] {
  display: none !important;
}

.foot a[aria-current] {
  color: var(--cherry);
}

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.tool {
  padding-top: 24px;
  padding-bottom: var(--section);
}

.tool-head {
  max-width: 1040px;
}

.tool-head h1 {
  margin-top: 12px;
}

.tool-box {
  margin-top: 32px;
}

.tool .prose {
  margin-top: 72px;
}

.tool .prose h2:first-child {
  margin-top: 0;
}

.tool .app-cta {
  max-width: 680px;
  margin-top: 56px;
}

.tool .panel {
  padding: 24px 20px;
}

.tool .panel h2 {
  font-size: 28px;
}

.panel-text {
  margin-top: 12px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
}

.panel .fine {
  color: var(--text-soft);
}

.field {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.field legend,
.field-top label {
  padding: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 17px;
}

.field-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.field-top output {
  font-family: var(--serif);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  --p: 50%;
  display: block;
  width: 100%;
  height: 44px;
  margin: 2px 0 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  touch-action: pan-y;
}

input[type="range"]:focus {
  outline: none;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 6px;
  background: linear-gradient(to right, var(--cherry) var(--p), rgba(43, 23, 18, 0.14) var(--p));
}

input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 6px;
  background: rgba(43, 23, 18, 0.14);
}

input[type="range"]::-moz-range-progress {
  height: 6px;
  border-radius: 6px;
  background: var(--cherry);
}

input[type="range"]::-webkit-slider-thumb {
  width: 28px;
  height: 28px;
  margin-top: -11px;
  border: 2px solid var(--cherry);
  border-radius: 50%;
  background: var(--raised);
  box-shadow: 0 2px 6px rgba(43, 23, 18, 0.16);
  -webkit-appearance: none;
  appearance: none;
}

input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border: 2px solid var(--cherry);
  border-radius: 50%;
  background: var(--raised);
  box-shadow: 0 2px 6px rgba(43, 23, 18, 0.16);
}

input[type="range"]:focus-visible::-webkit-slider-thumb {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

input[type="range"]:focus-visible::-moz-range-thumb {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

button {
  font: inherit;
  color: inherit;
}

.button {
  border: 0;
  cursor: pointer;
}

.button.soft {
  background: var(--raised);
  color: var(--ink);
}

.button.soft:hover {
  background: #fff;
}

.button.small {
  height: 44px;
  padding: 0 22px;
  font-size: 16px;
}

.button:focus-visible,
label.button:focus-within,
.bump:focus-visible,
.link-button:focus-visible,
.chip input:focus-visible + span,
.choice:focus-visible,
.back:focus-visible,
select:focus-visible,
.tool-links a:focus-visible,
.related a:focus-visible,
.prose a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--cherry);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.bump {
  flex: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background:
    linear-gradient(var(--cherry), var(--cherry)) center / 14px 2px no-repeat,
    var(--raised);
  cursor: pointer;
}

.bump.up {
  background:
    linear-gradient(var(--cherry), var(--cherry)) center / 14px 2px no-repeat,
    linear-gradient(var(--cherry), var(--cherry)) center / 2px 14px no-repeat,
    var(--raised);
}

.adjust {
  display: flex;
  align-items: center;
  gap: 12px;
}

.adjust input[type="range"] {
  margin: 0;
}

.num {
  display: inline-block;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--cherry);
  color: var(--canvas);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 15px;
  line-height: 28px;
  text-align: center;
}

.sim {
  display: grid;
  gap: 14px;
}

.stage {
  display: flex;
  flex-direction: column;
}

.tool .panel.stage {
  justify-content: center;
  padding: 16px 0 4px;
  border-radius: var(--r-panel) var(--r-panel) 0 0;
}

.stage svg {
  width: 100%;
  height: auto;
  aspect-ratio: 34 / 40;
  margin: 0 auto;
}

.stage .nail {
  fill: rgba(251, 217, 218, 0.4);
  stroke: var(--ink);
  stroke-opacity: 0.6;
}

.stage .finger {
  fill: var(--canvas);
  stroke: var(--ink);
}

.stage .crease {
  fill: none;
  stroke: var(--ink);
  stroke-opacity: 0.45;
}

.stage .band {
  fill: var(--gold);
  stroke: var(--ink);
}

.finger,
.nail,
.crease,
.band,
.gem-o,
.gem-f {
  stroke-width: 1.6px;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.gem-o {
  fill: #fff;
  stroke: var(--ink);
}

.gem-f {
  fill: none;
  stroke: var(--ink);
  stroke-opacity: 0.4;
  stroke-width: 1px;
}

.scale {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  font-size: 13px;
  color: var(--text-soft);
}

.scale span {
  display: block;
  height: 6px;
  border: 1.5px solid var(--ink);
  border-top: 0;
}

.readout {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin-top: -14px;
  padding: 4px 20px 22px;
  border-radius: 0 0 var(--r-panel) var(--r-panel);
  background: var(--sky);
}

.readout p + p {
  text-align: right;
}

.readout b {
  display: block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.readout span {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.35;
  color: var(--text-soft);
}

.controls {
  display: grid;
  align-content: start;
  gap: 28px;
  padding: 24px 20px 20px;
  border-radius: var(--r-panel);
  background: var(--card);
}

.chips {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.chip {
  position: relative;
  display: block;
}

.chip input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
}

.chip span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 2px 10px;
  border-radius: 16px;
  background: var(--raised);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.chip svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4px;
  stroke-linejoin: round;
}

.chip svg path {
  vector-effect: non-scaling-stroke;
}

.chip input:checked + span {
  background: var(--cherry);
  color: var(--canvas);
}

.photo {
  display: grid;
  gap: 24px;
  margin-top: 14px;
}

.photo-copy > .button,
.photo-actions {
  margin-top: 24px;
}

.photo-art {
  justify-self: center;
  width: auto;
  height: 200px;
}

.frame {
  position: relative;
  justify-self: center;
  width: fit-content;
  max-width: 100%;
  border-radius: var(--r-card);
  overflow: hidden;
  line-height: 0;
}

.frame img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 72vh;
  max-height: 72svh;
}

.frame svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.frame .gem-o {
  fill: rgba(255, 255, 255, 0.88);
}

.frame .guide {
  stroke: var(--cherry);
  stroke-width: 1.5px;
  stroke-dasharray: 5 5;
  vector-effect: non-scaling-stroke;
}

.frame .pin {
  fill: var(--cherry);
}

.frame .dot {
  fill: rgba(255, 251, 246, 0.3);
  stroke: var(--cherry);
  stroke-width: 2.5px;
  vector-effect: non-scaling-stroke;
}

.frame .hit {
  fill: transparent;
  cursor: grab;
  touch-action: none;
}

.frame .drag {
  cursor: grab;
  touch-action: none;
}

.frame [tabindex]:focus-visible {
  outline: none;
}

.frame [tabindex]:focus-visible .dot,
.frame .drag:focus-visible .gem-o {
  stroke: var(--ink);
  stroke-width: 3px;
}

.photo-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}

.tool .prose table {
  font-variant-numeric: tabular-nums;
}

.tool .prose th,
.tool .prose td {
  white-space: nowrap;
}

.tool .prose th:first-child,
.tool .prose td:first-child {
  position: sticky;
  left: 0;
  background: var(--raised);
}

.tool .prose th:first-child {
  background: var(--card);
}

.convert {
  display: grid;
  gap: 20px;
}

.convert-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.select {
  display: grid;
  gap: 6px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 15px;
}

select {
  width: 100%;
  height: 52px;
  padding: 0 40px 0 16px;
  border: 0;
  border-radius: 16px;
  background:
    linear-gradient(45deg, transparent 50%, var(--cherry) 50%) calc(100% - 22px) 23px / 6px 6px no-repeat,
    linear-gradient(-45deg, transparent 50%, var(--cherry) 50%) calc(100% - 16px) 23px / 6px 6px no-repeat,
    var(--raised);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 17px;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.equiv {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.equiv li {
  padding: 12px 12px 10px;
  border-radius: 16px;
  background: var(--raised);
}

.equiv span {
  display: block;
  font-size: 13px;
  color: var(--text-soft);
}

.equiv b {
  display: block;
  margin-top: 2px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.2;
}

.table-card {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--raised);
  overflow: hidden;
}

.size-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.3;
  text-align: center;
}

.size-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 12px 4px;
  background: var(--card);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  vertical-align: bottom;
}

.size-table th small {
  display: block;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 12px;
  color: var(--text-soft);
}

.size-table td {
  padding: 9px 4px;
  border-top: 1px solid var(--line);
}

.size-table td:first-child {
  font-family: var(--serif);
  font-weight: 600;
}

.size-table tr.q td {
  color: var(--text-soft);
}

.size-table tr.q td:first-child {
  font-weight: 400;
}

.size-table tr.on td {
  background: var(--butter);
  color: var(--ink);
}

.strip-box {
  display: grid;
  gap: 20px;
  margin-top: 14px;
}

.strip-preview {
  padding: 16px;
  border-radius: var(--r-card);
  background: var(--raised);
}

.strip-preview svg {
  width: 100%;
  height: auto;
}

.strip-box .button {
  justify-self: start;
}

.print-sheet {
  display: none;
}

.sizer {
  display: grid;
  gap: 14px;
}

.step-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.step-card .panel-text {
  margin-top: 0;
}

.zone {
  display: grid;
  place-items: center;
  margin: 0 -20px;
  padding: 12px 0;
  overflow: hidden;
}

.id-card {
  position: relative;
  border: 2px solid var(--ink);
  background: rgba(255, 255, 255, 0.55);
  box-sizing: border-box;
}

.id-card::before {
  content: "";
  position: absolute;
  width: 12.5%;
  height: 16%;
  left: 11%;
  top: 34%;
  border: 1.5px solid var(--ink);
  border-radius: 18%;
  opacity: 0.5;
}

.id-card.tall::before {
  width: 16%;
  height: 12.5%;
  left: 34%;
  top: 11%;
}

.disc {
  position: relative;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  box-sizing: border-box;
}

.disc::before,
.disc::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: var(--cherry);
  opacity: 0.6;
}

.disc::before {
  width: 40%;
  height: 1px;
  transform: translate(-50%, -50%);
}

.disc::after {
  width: 1px;
  height: 40%;
  transform: translate(-50%, -50%);
}

.step-card.is-done #t1,
.step-card.is-done #a1,
.step-card.is-done #save {
  display: none;
}

.step-card.off .adjust,
.step-card.off .zone {
  opacity: 0.4;
  pointer-events: none;
}

.saved {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  font-size: 16px;
}

.result {
  padding: 16px 18px;
  border-radius: var(--r-card);
  background: var(--raised);
}

.result b {
  display: block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 34px;
  line-height: 1.1;
}

.result span {
  display: block;
  margin-top: 6px;
  font-size: 15px;
  color: var(--text-soft);
}

.quiz {
  display: grid;
  justify-items: center;
}

.tool .quiz {
  padding: 20px 16px 28px;
}

.quiz .stars-end {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 44px;
  opacity: 0.55;
  transform: scaleX(-1);
}

.quiz-in {
  position: relative;
  width: 100%;
  max-width: 520px;
}

.quiz-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 44px;
}

.back {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--raised);
  cursor: pointer;
}

.back svg {
  width: 9px;
  height: 15px;
}

.back[disabled] {
  visibility: hidden;
}

.bar {
  flex: 1;
  height: 5px;
  border-radius: 5px;
  background: rgba(43, 23, 18, 0.12);
  overflow: hidden;
}

.bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 5px;
  background: var(--cherry);
  transition: width 0.35s ease;
}

.quiz-art {
  position: relative;
  display: grid;
  place-items: center;
  height: 168px;
  margin-top: 12px;
  border-radius: var(--r-card);
  background: var(--butter);
}

.quiz-art img {
  width: auto;
  height: 128px;
}

.quiz-art svg {
  width: auto;
  height: 116px;
  overflow: visible;
}

.quiz-art .gem-o {
  fill: var(--raised);
}

.quiz-q {
  margin: 24px 0 18px;
  font-size: 26px;
  line-height: 1.2;
}

.quiz-q:focus {
  outline: none;
}

.choices {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 12px 18px;
  border: 0;
  border-radius: 18px;
  background: var(--raised);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.choice:hover {
  background: #fff;
}

.choice[aria-pressed="true"] {
  background: var(--cherry);
  color: var(--canvas);
}

.choice svg {
  flex: none;
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4px;
  stroke-linejoin: round;
}

.choice svg path {
  vector-effect: non-scaling-stroke;
}

.picks {
  margin: 20px 0 0;
  padding: 0 18px;
  border-radius: 18px;
  background: var(--raised);
  list-style: none;
}

.picks li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.picks li + li {
  border-top: 1px solid var(--line);
}

.picks span {
  font-size: 15px;
  color: var(--text-soft);
}

.picks b {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 18px;
  line-height: 1.25;
  text-align: right;
}

.why {
  margin-top: 20px;
  font-size: 17px;
  line-height: 1.6;
}

.tool-links {
  display: grid;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.tool-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 12px 18px;
  border-radius: 16px;
  background: var(--raised);
  font-family: var(--serif);
  font-weight: 600;
  text-decoration: none;
}

.tool-links a::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--cherry);
  border-right: 2px solid var(--cherry);
  transform: rotate(45deg);
}

.tool-links a:hover {
  background: #fff;
}

.again {
  margin-top: 20px;
}

.quiz .app-cta {
  margin-top: 20px;
}

.fade {
  animation: fade 0.35s ease both;
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

@media (max-width: 899px) {
  .step-card.is-done .zone {
    display: none;
  }
}

@media (max-width: 599px) {
  .quiz .stars,
  .quiz .stars-end {
    display: none;
  }

  .sizer .panel {
    margin-inline: calc(10px - var(--margin));
  }

  .sizer .zone {
    margin-inline: -20px;
  }

  .equiv b {
    font-size: 20px;
  }

  .size-table {
    font-size: 14px;
  }

  .size-table th {
    font-size: 13px;
  }
}

@media (min-width: 600px) {
  .tool .panel {
    padding: 32px;
  }

  .zone {
    margin: 0 -32px;
  }

  .convert {
    align-items: center;
  }

  .tool .quiz {
    padding: 32px 32px 40px;
  }

  .quiz .stars-end {
    right: 24px;
    bottom: 24px;
    width: 56px;
  }

  .quiz-art {
    height: 200px;
  }

  .quiz-art img {
    height: 150px;
  }

  .quiz-q {
    font-size: 30px;
  }
}

@media (min-width: 900px) {
  .tool {
    padding-top: 32px;
  }

  .tool-box {
    margin-top: 40px;
  }

  .tool .panel h2 {
    font-size: 34px;
  }

  .sim {
    grid-template-columns: 7fr 5fr;
    gap: 24px;
  }

  .tool .panel.stage {
    grid-row: 1 / span 2;
    padding: 24px 0;
    border-radius: var(--r-panel);
  }

  .controls {
    grid-column: 2;
    grid-row: 1;
    padding: 32px 32px 28px;
    border-radius: var(--r-panel) var(--r-panel) 0 0;
  }

  .readout {
    grid-column: 2;
    grid-row: 2;
    margin-top: -24px;
    padding: 24px 32px 30px;
    background: var(--card);
  }

  .readout::before {
    content: "";
    position: absolute;
    top: 0;
    left: 32px;
    right: 32px;
    height: 1px;
    background: rgba(43, 23, 18, 0.1);
  }

  .readout b {
    font-size: 30px;
  }

  .stage svg {
    width: auto;
    height: 500px;
  }



  .scale {
    top: 28px;
    right: 32px;
  }

  .photo {
    grid-template-columns: 5fr 7fr;
    align-items: center;
    gap: 40px;
    margin-top: 24px;
    padding: 48px;
  }

  .tool .photo {
    padding: 48px;
  }

  .photo.has-photo {
    align-items: start;
  }

  .photo-art {
    height: 260px;
  }

  .convert {
    grid-template-columns: 5fr 7fr;
    gap: 24px;
  }

  .equiv {
    grid-template-columns: repeat(6, 1fr);
  }

  .sizer {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .tool .prose table {
    display: table;
  }

  .step-card .zone {
    flex: 1;
  }

  .step-card.is-done .zone {
    opacity: 0.45;
  }

  .quiz-art svg {
    height: 140px;
  }

  .size-table {
    font-size: 16px;
  }

  .size-table th {
    font-size: 15px;
    padding: 14px 8px;
  }

  .size-table td {
    padding: 10px 8px;
  }

  .strip-box {
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fade {
    animation: none;
  }

  .bar span {
    transition: none;
  }
}

@media print {
  @page {
    margin: 14mm;
  }

  body {
    background: #fff;
  }

  body > * {
    display: none !important;
  }

  body > .print-sheet {
    display: block !important;
    color: #000;
    font-size: 11pt;
    line-height: 1.45;
  }

  .print-sheet h2 {
    font-size: 18pt;
  }

  .print-sheet p,
  .print-sheet ol {
    margin: 4mm 0 0;
  }

  .print-sheet ol {
    padding-left: 5mm;
  }

  .print-sheet svg {
    display: block;
    margin-top: 6mm;
  }
}
