:root {
  --o: #ff3b00;
  --g: #1fbf62;
  --y: #f4a300;
  --r: #e03939;
  --ink: #111;
  --muted: #666;
  --line: #e8e8e8;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: #f6f6f6;
  color: var(--ink);
  font-family: Arial, "Segoe UI", sans-serif;
}
header, main { max-width: 880px; margin: auto; }
header {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #111;
  text-decoration: none;
  font-weight: 900;
  letter-spacing: .08em;
}
.brand img { width: 112px; }
.menu {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
}
.menu i {
  display: block;
  width: 18px;
  height: 2px;
  background: #111;
  border-radius: 9px;
  margin: 4px auto;
}
.hero {
  margin: 24px 16px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 34px 22px;
  box-shadow: 0 18px 52px #0001;
}
.hero h1 {
  margin: 0;
  font-size: clamp(42px, 10vw, 78px);
  line-height: .95;
  font-weight: 950;
  letter-spacing: -.04em;
}
.hero span { color: var(--o); }
.panel, .result {
  margin: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 16px;
  box-shadow: 0 10px 34px #0000000b;
}
.head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}
.head > b {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--o);
  color: #fff;
  display: grid;
  place-items: center;
}
.head h2 { margin: 0; font-size: 21px; }
.head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.tire {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 13px;
  margin-bottom: 12px;
}
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 900;
}
.remove {
  border: 1px solid #ddd;
  background: #fafafa;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 900;
}
.uploads {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}
.up {
  min-height: 112px;
  border: 2px dashed #d8d8d8;
  border-radius: 18px;
  padding: 13px;
  background: #fbfbfb;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 12px;
}
.up:before {
  content: "";
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  opacity: .16;
  pointer-events: none;
  z-index: 0;
}
.up:nth-child(1):before {
  background-image: url("assets/upload-front.png");
  background-position: right center;
  background-size: auto 96%;
  opacity: .2;
}
.up:nth-child(2):before {
  background-image: url("assets/upload-tread.png");
  opacity: .18;
}
.up:nth-child(3):before {
  background-image: url("assets/upload-dot.png");
  opacity: .2;
}
.up input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.ico {
  width: 72px;
  height: 72px;
  border: 2px solid var(--o);
  border-radius: 18px;
  color: transparent;
  display: grid;
  place-items: center;
  background: #fff;
  flex: 0 0 72px;
  overflow: hidden;
  font-size: 0;
  position: relative;
}
.up .ico, .up b, .up small {
  position: relative;
  z-index: 1;
}
.copy {
  position: relative;
  z-index: 1;
  min-width: 0;
  flex: 1;
}
.ico svg { display: none; }
.ico:before {
  content: "";
  position: absolute;
  left: 16px;
  top: 24px;
  width: 40px;
  height: 28px;
  border: 4px solid var(--o);
  border-radius: 9px;
  background: #fff;
  color: var(--o);
  box-shadow: none;
}
.ico:after {
  content: "";
  position: absolute;
  left: 29px;
  top: 31px;
  width: 14px;
  height: 14px;
  border: 4px solid var(--o);
  border-radius: 50%;
  background: #fff;
  color: var(--o);
  box-shadow: none;
}
.up:nth-child(3) .ico:after { display: block; }
.up img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
.up.done img { display: block; }
.up.done:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #000b, #0003);
}
.up.done .ico, .up.done b, .up.done small {
  position: relative;
  z-index: 1;
  color: #fff;
  border-color: #fff;
}
.up small { display: block; color: var(--muted); margin-top: 3px; }
.pick {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.pick button {
  border: 1px solid var(--o);
  border-radius: 999px;
  background: #fff;
  color: var(--o);
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
}
.up.done .pick button {
  border-color: #fff;
  color: #fff;
  background: #ffffff20;
}
.qs {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.q {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  background: #fafafa;
}
.q p { margin: 0 0 8px; font-weight: 900; font-size: 13px; }
.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.seg button {
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 13px;
  padding: 9px;
  font-weight: 900;
}
.seg .on { background: #111; color: #fff; border-color: #111; }
.primary, .light {
  width: calc(100% - 32px);
  margin: 0 16px 14px;
  min-height: 54px;
  border: 0;
  border-radius: 17px;
  background: var(--o);
  color: #fff;
  font-size: 16px;
  font-weight: 950;
  box-shadow: 0 14px 30px #ff3b0038;
}
.light {
  width: 100%;
  margin: 0;
  background: #fff;
  color: #111;
  border: 1px solid #ddd;
  box-shadow: none;
}
.status {
  display: none;
  align-items: center;
  gap: 12px;
  margin: 0 16px 14px;
  padding: 12px;
  background: #fff7f4;
  border: 1px solid #ffe0d5;
  border-radius: 17px;
  color: #5b2514;
  font-weight: 850;
}
.status.show { display: flex; }
.status i {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 8px solid #111;
  border-top-color: var(--o);
  position: relative;
  animation: tireSpin .95s linear infinite;
  flex: 0 0 48px;
}
.status i:before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 6px solid #ddd;
  border-radius: 50%;
  background: #fff;
}
.status i:after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #777;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
@keyframes tireSpin { to { transform: rotate(360deg); } }
.result { display: none; }
.result.show { display: block; }
.card {
  border: 1px solid #0001;
  background: #fffc;
  border-radius: 20px;
  padding: 13px;
  margin-bottom: 12px;
}
.row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}
.badge {
  border-radius: 999px;
  color: #fff;
  font-weight: 950;
  font-size: 12px;
  padding: 8px 10px;
  white-space: nowrap;
}
.green { background: var(--g); }
.yellow { background: var(--y); color: #111; }
.red { background: var(--r); }
.pill {
  display: inline-flex;
  margin: 8px 6px 6px 0;
  padding: 7px 10px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-weight: 900;
  font-size: 12px;
}
.pale {
  background: #fff;
  color: #444;
  border: 1px solid #ddd;
}
.bar {
  height: 14px;
  margin: 18px 0 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--r) 0 40%, var(--y) 40% 70%, var(--g) 70%);
  position: relative;
}
.mark {
  position: absolute;
  top: -7px;
  left: calc(var(--s) * 10%);
  width: 3px;
  height: 28px;
  background: #111;
  border-radius: 3px;
  box-shadow: 0 0 0 3px #fff;
}
.nums {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  font-size: 9px;
  color: #555;
  font-weight: 900;
  text-align: center;
}
.copy { font-weight: 750; color: #333; }
.note { text-align: center; font-weight: 850; }
.note b { color: var(--o); }
.toast {
  display: none;
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  background: #111;
  color: #fff;
  border-radius: 999px;
  padding: 12px 16px;
  font-weight: 900;
  max-width: calc(100vw - 32px);
  text-align: center;
}

@media (min-width: 760px) {
  .uploads { grid-template-columns: repeat(3, 1fr); }
  .up {
    min-height: 158px;
    display: flex;
    align-items: center;
  }
  .qs { grid-template-columns: repeat(3, 1fr); }
}
