:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f7f7fb;
}

* { box-sizing: border-box; }
body { margin: 0; }
main { max-width: 1280px; margin: 0 auto; padding: 32px 20px; }

.card {
  background: #fff;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 10px 30px rgba(25, 32, 56, .08);
  margin-bottom: 20px;
}

h1 { margin: 0 0 8px; font-size: 32px; }
h2 { margin: 0 0 12px; }
h3 { margin: 24px 0 10px; }
p { color: #4b5565; }

.search {
  display: grid;
  grid-template-columns:
    minmax(160px, 1fr)
    minmax(220px, 1.35fr)
    minmax(145px, .85fr)
    minmax(170px, 1fr)
    minmax(185px, 1fr)
    max-content;
  column-gap: 16px;
  row-gap: 12px;
  align-items: end;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  color: #283247;
}

input[type="text"], select {
  width: 100%;
  height: 46px;
  border: 1px solid #d7dce8;
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
}

button, .button {
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  background: #172033;
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
  white-space: nowrap;
}

button:disabled { opacity: .6; cursor: wait; }
.secondary { background: #eef0f6; color: #172033; }
.muted { color: #647084; font-size: 13px; }

.message {
  padding: 10px 12px;
  border-radius: 12px;
  margin-top: 12px;
  background: #eef0f6;
  color: #172033;
}
.message.error { background: #fee2e2; color: #7f1d1d; }
.message.warning { background: #fff7ed; color: #7c2d12; }

.section-head, .details-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid #e5e9f2;
  border-radius: 14px;
}

table { width: 100%; border-collapse: collapse; background: #fff; }
th, td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf0f5;
  vertical-align: middle;
  text-align: left;
  font-size: 14px;
}
th {
  background: #f5f7fb;
  color: #4b5565;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
tr:last-child td { border-bottom: 0; }

.cover-button {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
}
.cover-thumb {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #e5e9f2;
  background: #f2f4f8;
}
.no-cover {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  border: 1px solid #e5e9f2;
  background: #f2f4f8;
  color: #8b95a7;
  font-size: 11px;
  display: grid;
  place-items: center;
  text-align: center;
}
.title-cell { min-width: 260px; font-weight: 800; }
.nowrap { white-space: nowrap; }

.details-panel { scroll-margin-top: 20px; }
.detail-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 22px;
  align-items: start;
}
.detail-cover, .detail-placeholder {
  width: 100%;
  border-radius: 14px;
  background: #f2f4f8;
}
.detail-placeholder {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  color: #8b95a7;
}
.detail-list {
  display: grid;
  gap: 8px;
  margin: 0;
}
.detail-list div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
}
dt { color: #647084; font-weight: 700; }
dd { margin: 0; }
.notes { white-space: pre-wrap; }
.image-list { display: grid; gap: 8px; }
.image-list a { word-break: break-all; }

@media (max-width: 1120px) {
  .search { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .search button { width: 100%; }
}
@media (max-width: 860px) {
  .search { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  main { padding: 20px 12px; }
  .search, .detail-grid { grid-template-columns: 1fr; }
  .section-head, .details-head { align-items: flex-start; flex-direction: column; }
}
