.tp-intro h1 { margin: 0 0 8px; font-size: 26px; }
.tp-intro p { margin: 0; max-width: 70ch; }
.hint { font-weight: 400; font-size: 13px; color: var(--muted); }
[hidden] { display: none !important; }

.tp-answers { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tp-answers:empty { display: none; }
.tp-answers button {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface);
  border-radius: 99px; padding: 5px 12px; font: inherit; font-size: 14px; cursor: pointer; color: var(--text);
}
.tp-answers button::after { content: "×"; color: var(--muted); }
.tp-answers .restart::after { content: none; }
.tp-answers i { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .2); }

.tp-step, .tp-results { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.tp-step h2, .tp-results h2 { margin: 0; font-size: 19px; }
.tp-step > .btn { align-self: flex-start; }
.tp-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tp-opt {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 10px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; font: inherit; color: var(--text);
}
.tp-opt:hover, .tp-opt:focus-visible { border-color: var(--blue); outline: none; }
.tp-opt img { width: 100%; height: 80px; object-fit: contain; background: #fff; border-radius: 8px; }
.tp-opt b { font-size: 14px; }
.tp-opt span { font-size: 12px; color: var(--muted); }
.tp-options.sizes { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
.tp-options.sizes .tp-opt b { font-size: 18px; }
.tp-options.colors { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.tp-options.colors .tp-opt { flex-direction: row; justify-content: flex-start; text-align: left; padding: 8px 10px; }
.tp-options.colors .tp-opt i { width: 24px; height: 24px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .2); flex: none; }

.tp-results-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.tp-results-head input { flex: 1 1 260px; max-width: 420px; font: inherit; padding: 9px 12px; border: 2px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--text); }
.tp-parts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tp-parts button {
  width: 100%; height: 100%; display: flex; flex-direction: column; gap: 6px; padding: 10px; text-align: left;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; font: inherit; color: var(--text);
}
.tp-parts button:hover, .tp-parts button:focus-visible { border-color: var(--blue); outline: none; }
.tp-parts img { width: 100%; height: 90px; object-fit: contain; background: #fff; border-radius: 8px; }
.tp-parts b { font-size: 13px; line-height: 1.3; }
.tp-parts span { font-size: 12px; color: var(--muted); }

.tp-pick { border: 0; border-radius: var(--radius); padding: 20px; max-width: 560px; width: calc(100% - 32px); background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tp-pick::backdrop { background: rgba(0, 0, 0, .45); }
.tp-close { position: absolute; top: 8px; right: 8px; margin: 0; }
.tp-close button { border: 0; background: none; font-size: 26px; cursor: pointer; color: var(--muted); }
.tp-pick-head { display: flex; gap: 14px; align-items: center; padding-right: 30px; }
.tp-pick-head img { width: 120px; height: 96px; object-fit: contain; background: #fff; border-radius: 10px; flex: none; }
.tp-pick-head h2 { margin: 0; font-size: 18px; }
.tp-pick-head p { margin: 4px 0 0; }
.tp-pick h3 { font-size: 15px; margin: 16px 0 6px; }
.tp-colors { display: flex; flex-wrap: wrap; gap: 4px; max-height: 140px; overflow: auto; }
.tp-colors button {
  display: flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: var(--surface); border-radius: 99px;
  padding: 2px 8px 2px 3px; font: inherit; font-size: 12px; cursor: pointer; color: var(--text);
}
.tp-colors button i { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .2); }
.tp-colors button[aria-pressed="true"] { outline: 2px solid var(--blue); border-color: var(--blue); }
.tp-pick-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.tp-pick-add input { width: 80px; font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text); }
.tp-where ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tp-where li { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.tp-where img { width: 48px; height: 36px; object-fit: contain; background: #fff; border-radius: 6px; }
.tp-where p { margin: 0; }

@media (max-width: 520px) {
  .tp-options, .tp-parts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tp-options.sizes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tp-opt img, .tp-parts img { height: 64px; }
  .tp-opt span { display: none; }
  .tp-step, .tp-results { padding: 14px; }
}
