/* The calculator is the entry point. Its profile card is the only order summary. */
body {
  background:
    radial-gradient(ellipse 780px 490px at 75% 5%, #162d432e, transparent),
    #0b1017;
}
.header {
  height: 66px;
}
.preview-notice {
  min-height: 30px;
  padding-block: 6px;
}
.workbench-heading {
  padding: 35px 0 25px;
}
.workbench-heading h1 {
  font-size: clamp(34px, 3.8vw, 52px);
  font-weight: 640;
  letter-spacing: -0.055em;
  line-height: 1.08;
  margin: 0;
  color: #f1f5fc;
}
.workbench-heading em {
  color: #98c5f8;
  font-weight: inherit;
  font-style: normal;
}
.workbench-heading p {
  color: #a6b6c8;
  font-size: 14px;
  margin: 10px 0 0;
}
.calculator-section {
  padding-top: 0;
}
.builder-layout {
  grid-template-columns: minmax(0, 1.4fr) minmax(340px, 1fr);
  align-items: start;
  gap: 22px;
}
.builder-main {
  gap: 16px;
}
.level-panel,
.payment-panel {
  padding: 23px;
  border-color: #303e50;
}
.panel-heading {
  margin-bottom: 17px;
}
.panel-heading h2,
.craft-copy h2 {
  color: #eff4fc;
  font-size: 19px;
  letter-spacing: -0.035em;
  line-height: 1.25;
  font-weight: 600;
}
.level-inputs {
  grid-template-columns: minmax(0, 1fr) 35px minmax(0, 1fr);
}
.level-field {
  padding-block: 12px;
}
.number-row {
  margin-top: 6px;
}
.level-field:focus-within {
  border-color: #8cbdff;
}
.level-field input::placeholder {
  color: #8298b1;
  font-size: 0.68em;
  letter-spacing: 0;
}
.plan-total > div,
.mobile-estimate > div,
.receipt-total {
  min-width: 0;
  overflow-wrap: anywhere;
}
.plan-total {
  flex-wrap: wrap;
}
.payment-option {
  padding-block: 11px 9px;
}
.payment-bottom {
  margin-top: 9px;
  padding-top: 7px;
}
.payment-help {
  padding: 0;
  margin: 13px 0 0;
}
.plan-card {
  position: sticky;
  top: 82px;
  overflow: hidden;
  border-radius: 14px;
  background: #141e2a;
  border: 1px solid #3b5068;
  min-width: 0;
  box-shadow:
    inset 0 1px #ffffff0c,
    0 14px 40px #0003;
}
.plan-scene {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-flow: column;
  justify-content: space-between;
  height: 194px;
  padding: 19px 22px 21px;
  background: #152d42;
  border-bottom: 1px solid #7393b94d;
  overflow: hidden;
}
.scene-art,
.scene-trim {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.scene-art {
  background: url("assets/azure-ridge.svg") center 42% / cover no-repeat;
}
.plan-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, #0a17243b, transparent 70%),
    linear-gradient(0deg, #081421f0, transparent 66%);
}
.scene-art {
  z-index: -3;
}
.scene-trim {
  z-index: -1;
  margin: 8px;
  border: 1px solid #c5e8ff32;
  border-radius: 5px;
}
.plan-scene h2 {
  align-self: flex-start;
  z-index: 1;
  font-weight: 550;
  font-size: 13px;
  letter-spacing: 0;
  color: #eff6ff;
  text-shadow: 0 1px 6px #071524;
  line-height: 1.4;
}
.plan-scene .preview-profile-head {
  gap: 13px;
  padding: 0;
}
.plan-scene .avatar-frame {
  width: 60px;
  height: 60px;
  min-width: 60px;
  padding: 3px;
  border-radius: 4px;
  border-color: #afd8fd;
  box-shadow:
    0 2px 12px #06152277,
    inset 0 0 0 1px #578ec2;
}
.plan-scene .avatar-frame::before,
.plan-scene .avatar-frame::after {
  width: 9px;
  height: 9px;
}
.plan-scene .preview-identity strong {
  font-size: 19px;
  color: #f7fbff;
  max-width: none;
  text-shadow: 0 1px 4px #0a1222;
}
.plan-scene .preview-identity > span {
  font-size: 11px;
  margin-top: 2px;
  color: #c7d5e5;
}
.plan-scene .preview-identity .gain-chip {
  padding: 0;
  margin-top: 5px;
  border: 0;
  font-size: 11px;
  color: #cee4ff;
  background: none;
}
.plan-scene .profile-target {
  min-width: 67px;
  gap: 4px;
}
.plan-scene .profile-target > span:first-child {
  margin: 0;
  color: #dae4f1;
  font-size: 9px;
  letter-spacing: 1px;
}
.plan-scene .profile-level {
  --badge-size: 62px;
  font-size: 26px;
  isolation: isolate;
  text-align: center;
  filter: drop-shadow(0 2px 3px #040b13);
}
.plan-scene .profile-level::before {
  content: "";
  position: absolute;
  inset: 2%;
  border-radius: 50%;
  background: radial-gradient(closest-side, #102430b8, transparent);
  z-index: -1;
}
.plan-content {
  padding: 17px 22px 18px;
}
.plan-content .studio-controls {
  margin: 0;
  padding: 0;
  gap: 5px;
  flex-wrap: wrap;
}
.plan-content .studio-controls > span {
  font-size: 12px;
  color: #b1c0d2;
  letter-spacing: 0;
}
.plan-content .studio-controls > div {
  gap: 2px;
}
.plan-content .frame-choice {
  min-height: 32px;
  padding: 5px 7px;
  color: #b5c3d4;
  font-size: 11px;
}
.plan-content .frame-choice.active {
  background: #263649;
  border-color: #536680;
  color: #edf5ff;
}
.frame-choice[data-preview-style="azure"] i {
  border: 1px solid #a2cbf5;
  background: #3e6287;
}
.frame-choice[data-preview-style="graphite"] i {
  border: 1px solid #a7b2bb;
  background: repeating-linear-gradient(135deg, #60666e 0 1px, #2b3137 2px 3px);
}
.frame-choice[data-preview-style="ember"] i {
  background: #db9f75;
  transform: rotate(45deg);
  border-radius: 0;
  margin-inline: 1px;
}
.frame-note {
  font-size: 10px;
  color: #98a9bf;
  margin: 3px 0 13px;
}
.plan-details {
  margin: 0;
  padding: 11px 0;
  border-block: 1px solid #314052;
}
.plan-details > div,
.plan-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.plan-details > div {
  padding: 5px 0;
  font-size: 13px;
}
.plan-details dt {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #acbdcf;
}
.plan-details dt svg {
  width: 15px;
  height: 15px;
  color: #859fb9;
}
.plan-details dd {
  margin: 0;
  color: #ecf2f9;
  font-variant-numeric: tabular-nums;
}
.plan-details dd > span {
  color: #a2b5cb;
}
.plan-total {
  padding: 14px 0 12px;
}
.plan-total > span {
  font-size: 14px;
  color: #d4dfed;
}
.plan-total strong {
  font-size: clamp(27px, 2.8vw, 37px);
  font-weight: 590;
  line-height: 1.15;
  letter-spacing: -0.055em;
  font-variant-numeric: tabular-nums;
}
.plan-total small {
  color: #96abc1;
  font-size: 10px;
  margin-left: 2px;
}
.plan-content .primary-button {
  width: 100%;
  min-height: 44px;
}
.plan-content .calculation-note {
  color: #9badc2;
  line-height: 1.55;
  margin: 10px 0 0;
  font-size: 11px;
}

/* Separate materials and silhouettes; the Steam level itself keeps the native frame. */
.plan-card[data-style="graphite"] {
  border-color: #66707c;
}
[data-style="graphite"] .scene-art {
  background:
    repeating-linear-gradient(
      125deg,
      transparent 0 43px,
      #b3c2c72c 43px 44px,
      #14191d8c 44px 49px,
      transparent 50px 92px
    ),
    repeating-linear-gradient(0deg, #b8c5ce0d 0 1px, transparent 1px 3px),
    linear-gradient(110deg, #262c32 10%, #6c7c83 52%, #373f47 69%, #1e272f);
}
[data-style="graphite"] .scene-trim {
  margin: 7px;
  border: 2px ridge #9aa7ac70;
  border-radius: 0;
  background:
    radial-gradient(circle at 5px 5px, #333 1px, #b4b8bc 2px, transparent 3px)
      top left / 100% 100%,
    radial-gradient(
      circle at calc(100% - 5px) 5px,
      #333 1px,
      #b4b8bc 2px,
      transparent 3px
    );
}
[data-style="graphite"] .avatar-frame {
  border: 3px ridge #c5cdd3;
  border-radius: 0;
  padding: 2px;
  box-shadow: 2px 3px 0 #0b1219;
}
[data-style="graphite"] .avatar-frame::before,
[data-style="graphite"] .avatar-frame::after {
  display: none;
}
.plan-card[data-style="ember"] {
  border-color: #8b6450;
}
[data-style="ember"] .scene-art {
  filter: sepia(0.9) saturate(1.8) hue-rotate(337deg);
  background-position: 70% 30%;
  transform: scaleX(-1);
}
[data-style="ember"] .scene-trim {
  margin: 7px;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(
        135deg,
        transparent 6px,
        #edb989 6px 8px,
        transparent 8px 12px,
        #d59b69 12px 14px,
        transparent 14px
      )
      top left / 34px 26px,
    linear-gradient(
        225deg,
        transparent 6px,
        #edb989 6px 8px,
        transparent 8px 12px,
        #d59b69 12px 14px,
        transparent 14px
      )
      top right / 34px 26px,
    linear-gradient(45deg, transparent 6px, #edb989 6px 8px, transparent 8px)
      bottom left / 34px 26px,
    linear-gradient(315deg, transparent 6px, #edb989 6px 8px, transparent 8px)
      bottom right / 34px 26px;
  background-repeat: no-repeat;
}
[data-style="ember"] .avatar-frame {
  border: 0;
  padding: 4px;
  background: linear-gradient(
    130deg,
    #ffe2b6,
    #895139 36%,
    #c18b63 64%,
    #ffdaa8
  );
  clip-path: polygon(
    8px 0,
    100% 0,
    100% calc(100% - 8px),
    calc(100% - 8px) 100%,
    0 100%,
    0 8px
  );
  border-radius: 0;
}
[data-style="ember"] .avatar-frame img {
  clip-path: polygon(
    6px 0,
    100% 0,
    100% calc(100% - 6px),
    calc(100% - 6px) 100%,
    0 100%,
    0 6px
  );
}
[data-style="ember"] .avatar-frame::before,
[data-style="ember"] .avatar-frame::after {
  display: none;
}

/* An illustrated, one-pass explanation of a badge craft. */
.craft-guide {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  align-items: center;
  gap: 32px;
  padding: 24px 30px;
  margin-top: 22px;
  border: 1px solid #2b3b4b;
  border-radius: 14px;
  background: linear-gradient(109deg, #161f2c 8%, #182838 62%, #142130);
}
.craft-copy p {
  font-size: 13px;
  line-height: 1.6;
  color: #aabacb;
  max-width: 330px;
  margin-top: 6px;
}
.craft-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  list-style: none;
  margin: 0;
  padding: 0;
}
.craft-stage {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: end;
  gap: 5px;
}
.craft-stage > span {
  font-size: 11px;
  color: #b3c3d4;
  text-align: center;
}
.craft-stage:not(:last-child)::after {
  content: "→";
  font-size: 23px;
  line-height: 1;
  color: #738da6;
  position: absolute;
  right: -11px;
  top: 22px;
}
.craft-deck {
  position: relative;
  width: 84px;
  height: 66px;
}
.craft-deck i {
  display: block;
  position: absolute;
  width: 37px;
  height: 54px;
  bottom: 3px;
  left: 24px;
  transform-origin: bottom center;
  border: 2px solid #b2cde3;
  border-radius: 4px;
  background: #294b70 url("assets/azure-ridge.svg") 68% 50% / auto 100%;
  box-shadow:
    inset 0 0 0 2px #203854,
    1px 2px 5px #09131bbb;
}
.craft-deck i::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  height: 3px;
  border-block: 1px solid #bcd6e4a1;
}
.craft-deck i:first-child {
  transform: translateX(-10px) rotate(-22deg);
  filter: sepia(0.9) saturate(1.4);
}
.craft-deck i:nth-child(2) {
  transform: translateX(10px) rotate(20deg);
  filter: hue-rotate(305deg);
}
.craft-deck i:last-child {
  transform: translateY(-4px) rotate(-3deg);
}
.craft-medal {
  width: 64px;
  height: 66px;
  filter: drop-shadow(0 3px 5px #080f1b99);
}
.craft-xp {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 66px;
  font-size: 30px;
  letter-spacing: -0.06em;
  font-weight: 620;
  color: #d6f0e8;
}
.craft-xp small {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #a3d5c5;
}
@media (prefers-reduced-motion: no-preference) {
  .craft-flow.in-view .craft-deck {
    animation: craft-pass 0.65s ease-out both;
  }
  .craft-flow.in-view .craft-deck i:first-child {
    animation: gather-left 1.2s 0.15s ease-in-out;
  }
  .craft-flow.in-view .craft-deck i:nth-child(2) {
    animation: gather-right 1.2s 0.15s ease-in-out;
  }
  .craft-flow.in-view .craft-medal {
    animation: craft-pass 0.65s 0.4s ease-out both;
  }
  .craft-flow.in-view .craft-xp {
    animation: craft-pass 0.65s 0.8s ease-out both;
  }
}
@keyframes craft-pass {
  from {
    opacity: 0.5;
    transform: translateX(-8px) scale(0.93);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes gather-left {
  45% {
    transform: translateX(-1px) rotate(-3deg);
  }
}
@keyframes gather-right {
  45% {
    transform: translateX(1px) rotate(-3deg);
  }
}
.mobile-estimate {
  display: none;
}
@media (min-width: 761px) and (max-height: 800px) {
  .workbench-heading {
    padding-block: 23px 17px;
  }
  .plan-scene {
    height: 169px;
  }
}
@media (max-width: 940px) and (min-width: 761px) {
  .builder-layout {
    grid-template-columns: minmax(0, 1.18fr) minmax(290px, 1fr);
    gap: 13px;
  }
  .level-panel,
  .payment-panel,
  .plan-content {
    padding: 15px;
  }
  .plan-scene {
    padding-inline: 15px;
  }
  .plan-scene .preview-identity strong {
    font-size: 16px;
  }
  .plan-scene .avatar-frame {
    width: 45px;
    height: 45px;
    min-width: 45px;
  }
  .plan-content .studio-controls {
    gap: 2px;
  }
  .plan-content .frame-choice {
    padding-inline: 4px;
  }
}
@media (max-width: 760px) {
  html {
    scroll-padding-bottom: 90px;
  }
  .header {
    height: 62px;
  }
  .workbench-heading {
    padding: 25px 0 18px;
  }
  .workbench-heading h1 {
    font-size: clamp(30px, 7.8vw, 43px);
  }
  .workbench-heading p {
    font-size: 12px;
    margin-top: 8px;
  }
  .builder-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
  .builder-main {
    gap: 14px;
  }
  .level-panel,
  .payment-panel {
    padding: 17px;
  }
  .panel-heading h2,
  .craft-copy h2 {
    font-size: 17px;
  }
  .level-field {
    padding: 10px;
  }
  .level-inputs {
    grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr);
  }
  .plan-card {
    position: static;
    width: 100%;
    max-width: none;
  }
  .plan-content {
    padding: 16px;
  }
  .plan-scene {
    height: 185px;
    padding: 16px;
  }
  .plan-content .frame-choice {
    min-height: 36px;
  }
  .plan-content .primary-button {
    min-height: 44px;
  }
  .craft-guide {
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 18px;
    margin-top: 14px;
  }
  .craft-copy p {
    max-width: none;
    font-size: 12px;
  }
  .craft-stage > span {
    font-size: 10px;
  }
  .craft-stage:not(:last-child)::after {
    right: -6px;
    top: 25px;
    font-size: 15px;
  }
  .craft-xp {
    font-size: 25px;
  }
  .mobile-estimate {
    position: fixed;
    z-index: 12;
    inset: auto 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px max(16px, env(safe-area-inset-right))
      calc(9px + env(safe-area-inset-bottom))
      max(16px, env(safe-area-inset-left));
    background: #111c29f7;
    backdrop-filter: blur(15px);
    border-top: 1px solid #405267;
    box-shadow: 0 -4px 18px #07101a33;
  }
  .mobile-estimate > div {
    display: grid;
  }
  .mobile-estimate span {
    font-size: 11px;
    color: #a9bdcf;
  }
  .mobile-estimate strong {
    font-size: 20px;
    line-height: 1.1;
    color: #eef5fc;
    font-variant-numeric: tabular-nums;
  }
  .mobile-estimate .primary-button {
    width: auto;
    flex-shrink: 0;
    min-height: 44px;
    padding: 9px 15px;
  }
  body:has(dialog[open]) .mobile-estimate {
    display: none;
  }
  .toast {
    bottom: calc(80px + env(safe-area-inset-bottom));
  }
}
@media (max-width: 370px) {
  .plan-scene .preview-identity strong {
    font-size: 15px;
  }
  .plan-scene .avatar-frame {
    height: 48px;
    width: 48px;
    min-width: 48px;
  }
  .plan-scene .profile-target {
    min-width: 49px;
  }
  .plan-scene .profile-level {
    --badge-size: 49px;
    font-size: 21px;
  }
  .craft-guide {
    padding: 14px;
  }
}

.key-payment {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 18px;
  border: 1px solid #5c5140;
  border-radius: 12px;
  background: #202127;
}
.key-payment small {
  display: block;
  color: #bdaf98;
  margin-top: 4px;
}
.market-switch {
  display: flex;
  gap: 4px;
  padding-block: 20px 0;
}
.market-switch a {
  font-weight: 700;
  text-decoration: none;
  color: #aac1d4;
  background: #151f2b;
  border: 1px solid #344659;
  padding: 9px 19px;
  border-radius: 7px;
}
.market-switch a[aria-current="page"] {
  background: #243c4c;
  color: #b0eaff;
  border-color: #52849b;
}
.sell-section {
  padding-block: 32px 48px;
  scroll-margin-top: 80px;
}
#sell[hidden],
#calculator[hidden] {
  display: none;
}
.sell-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 20px;
}
.sell-form,
.sell-terms {
  padding: clamp(20px, 4vw, 38px);
}
.sell-form label,
.sell-payout span {
  display: block;
  color: #c0cddd;
  font-weight: 650;
}
.sell-form input {
  margin-top: 10px;
  font-size: 1.6rem;
}
.sell-form .calculation-note {
  text-align: start;
  margin-block: 10px 23px;
}
.sell-payout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #344356;
  padding-block: 18px;
}
.sell-payout strong {
  font-size: 1.8rem;
  color: #f1ca83;
}
.sell-terms {
  background: linear-gradient(125deg, #262a32, #121b27);
}
.sell-terms p {
  line-height: 1.55;
  color: #b7c4d1;
  max-width: 39ch;
}
.sell-icons {
  display: flex;
  align-items: center;
  gap: 15px;
  color: #e6c185;
  margin-bottom: 20px;
}
.sell-icons svg {
  width: 34px;
  height: 34px;
}
.sell-terms .key-stock {
  color: #e6c185;
  font-weight: 650;
  margin-top: 22px;
}
@media (max-width: 650px) {
  .sell-grid {
    grid-template-columns: 1fr;
  }
  .market-switch {
    padding-top: 12px;
  }
  .sell-section {
    padding-top: 20px;
  }
}
.key-payment .key-terms {
  margin-inline-start: auto;
  text-align: end;
}
.key-payment #key-rate {
  color: #f1ca83;
  font-variant-numeric: tabular-nums;
}
