.media-hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 6rem max(5vw, 24px) 4rem;
  background:
    radial-gradient(circle at 75% 20%, #d4f58a 0, transparent 20%),
    radial-gradient(circle at 20% 15%, #d5faf4 0, transparent 24%);
}
.media-hero h1 {
  margin: 0.25rem 0 1rem;
  font-size: clamp(3.1rem, 7vw, 6.2rem);
  letter-spacing: -0.08em;
  line-height: 0.9;
}
.media-hero h1 em {
  color: #335dff;
  font-style: normal;
}
.media-hero p {
  max-width: 630px;
  color: #5e677f;
  font-size: 1.04rem;
}
.media-directory {
  max-width: 1180px;
  margin: 0 auto;
  padding: 3rem max(5vw, 24px) 0;
}
.media-directory .section-heading h2 {
  font-size: clamp(2rem, 4vw, 3.3rem);
}
.media-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}
.media-card {
  min-height: 138px;
  padding: 1rem;
  border: 1px solid #e0e5ef;
  border-radius: 15px;
  background: #fff;
  color: #26314b;
  text-align: left;
  transition: 0.18s ease;
}
.media-card:not(.disabled):hover,
.media-card.is-active {
  transform: translateY(-3px);
  border-color: #335dff;
  box-shadow: 0 12px 26px rgba(51, 93, 255, 0.12);
}
.media-card i {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  margin-bottom: 0.65rem;
  border-radius: 10px;
  background: #e9edff;
  color: #335dff;
  font-style: normal;
  font-size: 1rem;
  font-weight: 850;
}
.media-card strong,
.media-card small {
  display: block;
}
.media-card strong {
  letter-spacing: -0.035em;
}
.media-card small {
  margin-top: 0.22rem;
  color: #707b92;
  font-size: 0.74rem;
}
.media-card.disabled {
  background: #f3f5f8;
  opacity: 0.74;
  cursor: not-allowed;
}
.media-workspace {
  max-width: 1180px;
  margin: 4rem auto 5rem;
  padding: clamp(1.25rem, 4vw, 3rem) max(5vw, 24px);
  display: grid;
  grid-template-columns: 1.4fr 0.65fr;
  gap: 3rem;
  color: #fff;
  background: #0b1020;
  border-radius: 22px;
}
.media-workspace h2 {
  margin: 0.2rem 0 0.5rem;
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -0.06em;
}
.media-workspace h3 {
  font-size: 1.2rem;
  letter-spacing: -0.04em;
}
.media-workspace > div > p:not(.eyebrow),
.media-workspace aside p {
  color: #aeb7ce;
}
.media-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  margin: 1.5rem 0 0.7rem;
  padding: 1.5rem;
  border: 1.5px dashed #647097;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  text-align: center;
  cursor: pointer;
}
.media-drop:hover,
.media-drop.is-dragging {
  border-color: #58e0d0;
  background: rgba(88, 224, 208, 0.08);
}
.media-drop input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.media-drop span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 0.55rem;
  border-radius: 50%;
  color: #58e0d0;
  background: #354268;
  font-size: 1.4rem;
}
.media-drop small,
.media-file-name,
.media-status {
  color: #aeb7ce;
  font-size: 0.8rem;
}
.media-file-name {
  margin: 0.5rem 0;
}
.media-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 1rem 0;
}
.media-options label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #c5cce0;
  font-size: 0.78rem;
}
.media-options input,
.media-options select {
  padding: 0.45rem;
  border: 0;
  border-radius: 7px;
  color: #17213a;
}
.media-status {
  min-height: 1.35em;
}
.media-status.error {
  color: #ffb4a1;
}
.media-status.success {
  color: #58e0d0;
}
.media-warning {
  padding: 0.8rem;
  border-left: 3px solid #ff7a59;
  background: rgba(255, 122, 89, 0.09);
  font-size: 0.77rem;
}
@media (max-width: 760px) {
  .media-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .media-workspace {
    grid-template-columns: 1fr;
    margin-left: 20px;
    margin-right: 20px;
    gap: 1.5rem;
  }
}
@media (max-width: 450px) {
  .media-card-grid {
    grid-template-columns: 1fr;
  }
}
.image-preview {
  margin: 1.15rem 0;
  padding: 1rem;
  border: 1px solid rgba(132, 150, 194, 0.42);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.055);
}
.image-preview[hidden] {
  display: none;
}
.preview-heading {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  color: #fff;
  font-size: 0.84rem;
}
.preview-heading span {
  color: #9ca9c8;
  font-size: 0.73rem;
}
.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 0.8rem;
}
.preview-grid figure {
  min-width: 0;
  margin: 0;
}
.preview-grid figcaption {
  margin-bottom: 0.38rem;
  color: #cdd5e9;
  font-size: 0.7rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.preview-frame {
  display: grid;
  min-height: 138px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(173, 188, 226, 0.25);
  border-radius: 9px;
  background: #1a2340;
}
.preview-frame img,
.preview-frame canvas {
  display: block;
  max-width: 100%;
  max-height: 230px;
  object-fit: contain;
}
.checkerboard {
  background-color: #1a2340;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.08) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.08) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.08) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.08) 75%);
  background-size: 18px 18px;
  background-position:
    0 0,
    0 9px,
    9px -9px,
    -9px 0;
}
.image-preview p {
  margin: 0.75rem 0 0;
  color: #aeb7ce;
  font-size: 0.74rem;
  line-height: 1.45;
}
.media-options .proportion-toggle {
  padding: 0.34rem 0.48rem;
  border: 1px solid rgba(151, 166, 207, 0.42);
  border-radius: 7px;
  color: #d5dcf0;
}
.media-options .proportion-toggle input {
  accent-color: #58e0d0;
}
@media (max-width: 520px) {
  .preview-grid {
    grid-template-columns: 1fr;
  }
  .preview-frame {
    min-height: 170px;
  }
}
