/* Remove default spin buttons */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] {
  -moz-appearance: textfield;
}

/* ── Base ─────────────────────────────────────────────── */
body {
  font-size: 14px;
  background-color: #f8f9fa;
  color: #333;
}

/* ── Typography ───────────────────────────────────────── */
h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 1rem;
  margin-bottom: 0.25rem;
}

h1 small {
  font-size: 0.8rem;
  display: block;
  color: #666;
  font-weight: 400;
  margin-top: 0.3rem;
}

h2 {
  font-size: 1.3rem;
  font-weight: 600;
  border-bottom: 2px solid #dee2e6;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  color: #212529;
}

h2 {
  position: relative;
}

h2 input {
  position: absolute;
  cursor: pointer;
  width: 100%;
  z-index: 1;
  opacity: 0;
  top: 0;
  height: 47px;
}

h2 input + i {
  position: absolute;
  right: 0;
  top: 50%;
  padding: 1.4rem;
  transform: translateY(-50%);
  margin: 0;
  line-height: 1.65rem;
}

h2 input + i:before,
h2 input + i:after {
  transition: all 0.25s ease-in-out;
  content: "";
  position: absolute;
  background-color: #555;
  width: 2px;
  height: 14px;
  margin-top: -7px;
}

h2 input + i:before {
  transform: translate(2px, 0) rotate(45deg);
}

h2 input[type="checkbox"]:checked ~ i::before {
  margin-top: -5px;
  height: 8px;
  transform: translate(2px, 0) rotate(45deg);
}

h2 input + i:after {
  transform: translate(2px, 0) rotate(-45deg);
}

h2 input[type="checkbox"]:checked ~ i::after {
  margin-top: -5px;
  height: 8px;
  transform: translate(-2px, 0) rotate(-45deg);
}

h2:has(input[type="checkbox"]:checked) ~ div,
h2:has(input[type="checkbox"]:checked) ~ h3 {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translate(0, 50%);
  margin: 0;
  height: 0;
  font-size: 0;
  padding: 0;
  border: 0;
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
  clear: both;
  color: #444;
}

h3 small {
  margin-left: 14px;
  font-size: 0.8rem;
  color: #777;
  font-weight: 400;
}

h3 .colorbox {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 5px;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  vertical-align: middle;
}

th {
  text-align: left;
  padding-right: 1rem;
}

/* ── Layout ───────────────────────────────────────────── */
.container {
  position: relative;
}

.clearfix {
  content: "";
  clear: both;
  display: table;
}

.album {
  background-color: #f0f2f5 !important;
  padding-top: 1.5rem !important;
  padding-bottom: 2rem !important;
}

/* ── Set image ────────────────────────────────────────── */
.set-img {
  float: right;
  max-height: 90px;
  margin-left: 1rem;
  margin-bottom: 1rem;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* ── Cards ────────────────────────────────────────────── */
.card {
  height: 100%;
  border: none;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
  transform: translateY(-2px);
}

.piece {
  height: 100%;
  border-radius: 10px;
  padding: 0.65rem;
  text-align: center;
  background: #fff;
  display: flex;
  flex-direction: column;
}

/* ── Part images ──────────────────────────────────────── */
.img-container {
  height: 7em;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

img {
  max-height: 7em;
  object-fit: contain;
}

.img-container a img {
  border-radius: 4px;
  transition: opacity 0.2s;
}

.img-container a:hover img {
  opacity: 0.85;
}

/* ── Part title ───────────────────────────────────────── */
.title-container {
  min-height: 2.8rem;
  font-size: 0.78rem;
  color: #555;
  line-height: 1.35;
  margin-bottom: 0.5rem;
}

/* ── Controls ─────────────────────────────────────────── */
label {
  width: 100%;
  display: block;
  margin-top: 0.3rem;
  border-radius: 6px;
  font-size: 0.8rem;
}

label.btn-outline-success {
  background-color: #d1e7dd;
  border-color: #a3cfbb;
  color: #0a3622;
}

/* ── Animations ───────────────────────────────────────── */
.hiding {
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.hidden {
  display: none;
}

/* ── Footer ───────────────────────────────────────────── */
.footer {
  clear: left;
  margin-top: 6rem;
  padding: 1.5rem 0;
  border-top: 1px solid #dee2e6;
  font-size: 0.85rem;
  color: #666;
}

.footer a {
  color: #0d6efd;
}

.footer table {
  margin-top: 0.75rem;
}

.footer td {
  padding-left: 1rem;
  color: #555;
}

/* ── Print ────────────────────────────────────────────── */
@media print {
  .checkbox input {
    display: none;
  }

  .checkbox:after {
    content: '☐';
  }

  .footer {
    display: none;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}
