.style-image-panel {
  margin: 0 24px 20px;
  padding: 20px;
  border: 1px solid #c6d2d1;
  border-radius: 14px;
  background: #f8fbfa;
  box-shadow: 0 8px 24px rgb(23 58 64 / 7%);
}

.style-image-panel > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.style-image-panel > header h3,
.style-image-current h4 {
  margin: 0;
  color: #173a40;
}

.style-image-panel > :where(header) > span {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 999px;
  background: #dce9e7;
  color: #315a5d;
  font-size: 12px;
  font-weight: 700;
}

.style-image-current {
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr;
  gap: 20px;
  align-items: center;
  padding: 14px;
  border: 1px solid #d7e1df;
  border-radius: 12px;
  background: #fff;
}

.style-image-current-link {
  display: block;
  overflow: hidden;
  min-height: 190px;
  border-radius: 10px;
  background: #edf2f1;
}

.style-image-current-link img,
.style-image-history-link img,
.drawer-style-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.style-image-current > div > h4 {
  margin-top: 10px;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.style-image-current > :where(div) > p,
.style-image-current > :where(div) > small {
  display: block;
  margin-top: 7px;
  color: #607374;
}

.style-image-current > div > a {
  display: inline-flex;
  margin-top: 14px;
  color: #16686b;
  font-weight: 700;
  text-decoration: none;
}

.style-image-current-badge {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  background: #d9eee6;
  color: #27624f;
  font-size: 12px;
  font-weight: 700;
}

.style-image-empty {
  display: grid;
  place-items: center;
  min-height: 210px;
  padding: 28px;
  border: 1px dashed #9cb3b1;
  border-radius: 12px;
  background: #fff;
  text-align: center;
}

.style-image-empty span {
  color: #89a09e;
  font-size: 12px;
  letter-spacing: 0.18em;
}

.style-image-empty b {
  margin-top: 8px;
  color: #29494d;
  font-size: 17px;
}

.style-image-empty small {
  margin-top: 6px;
  color: #6d7f80;
}

.style-image-actions {
  margin-top: 14px;
}

.style-image-actions form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px 14px;
  align-items: center;
}

.style-image-actions form label {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid #aebfbd;
  border-radius: 9px;
  background: #fff;
  color: #385b5e;
  cursor: pointer;
  overflow: hidden;
}

.style-image-actions form input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.style-image-actions form label:focus-within {
  outline: 2px solid #2c7779;
  outline-offset: 2px;
}

.style-image-actions form small {
  grid-column: 1 / -1;
  color: #687a7b;
}

.style-image-readonly {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0;
  padding: 11px 13px;
  border-radius: 9px;
  background: #eef2f2;
  color: #5d6d6e;
}

.style-image-readonly b {
  padding: 3px 7px;
  border-radius: 999px;
  background: #dce3e2;
  color: #445657;
  font-size: 12px;
}

.style-image-history {
  margin-top: 18px;
  border-top: 1px solid #d4dfdd;
  padding-top: 14px;
}

.style-image-history summary {
  color: #294d50;
  font-weight: 750;
  cursor: pointer;
}

.style-image-history-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.style-image-history-item {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 9px;
  border: 1px solid #d9e2e1;
  border-radius: 10px;
  background: #fff;
}

.style-image-history-item.is-current {
  border-color: #6b9d91;
  box-shadow: inset 3px 0 #4f8a7c;
}

.style-image-history-link {
  display: block;
  overflow: hidden;
  width: 78px;
  height: 64px;
  border-radius: 7px;
  background: #edf2f1;
}

.style-image-history-item div {
  min-width: 0;
}

.style-image-history-item b,
.style-image-history-item span,
.style-image-history-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.style-image-history-item b {
  color: #29494d;
}

.style-image-history-item span,
.style-image-history-item small {
  margin-top: 4px;
  color: #6c7e7f;
  font-size: 12px;
}

.style-image-history-item i {
  padding: 4px 7px;
  border-radius: 999px;
  background: #edf2f1;
  color: #577071;
  font-size: 11px;
  font-style: normal;
}

.style-image-history-item.is-current i {
  background: #d9eee6;
  color: #27624f;
}

.style-image-history-empty {
  margin: 12px 0 0;
  color: #718182;
}

.drawer-style-image {
  display: block;
  overflow: hidden;
  width: 96px;
  height: 96px;
  flex: 0 0 96px;
  border: 1px solid #b8c9c7;
  border-radius: 12px;
  background: #eef3f2;
}

.style-image-loading,
.style-image-error {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #607374;
}

.style-image-loading span {
  width: 20px;
  height: 20px;
  border: 2px solid #b7c8c6;
  border-top-color: #2e6d70;
  border-radius: 50%;
  animation: style-image-spin 0.8s linear infinite;
}

.style-image-loading p,
.style-image-error p {
  margin: 0;
}

.style-image-error {
  flex-wrap: wrap;
  border-color: #dfb6b1;
  background: #fff8f7;
  color: #774f4b;
}

@keyframes style-image-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 760px) {
  .style-image-panel {
    margin: 0 12px 16px;
    padding: 15px;
  }

  .style-image-current {
    grid-template-columns: 1fr;
  }

  .style-image-current-link {
    min-height: 220px;
  }

  .style-image-actions form {
    grid-template-columns: 1fr;
  }

  .style-image-actions form small {
    grid-column: auto;
  }

  .style-image-history-item {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .style-image-history-link {
    width: 64px;
    height: 56px;
  }

  .style-image-history-item i {
    display: none;
  }
}
