:root {
  color-scheme: light;
  --bg: #f7f2ff;
  --surface: #fffbff;
  --surface-strong: #ffffff;
  --ink: #24173a;
  --muted: #756987;
  --line: #e2d7f3;
  --line-strong: #cab8e9;
  --accent: #7c3aed;
  --accent-strong: #6424d4;
  --purple-soft: #efe6ff;
  --purple-mid: #a855f7;
  --highlight: #f6b83f;
  --highlight-soft: #fff3cd;
  --danger: #a83232;
  --shadow: 0 24px 70px rgba(68, 36, 120, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 251, 255, 0.92), rgba(247, 242, 255, 0.98)),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.app-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--accent);
  position: relative;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: var(--surface);
}

.brand-mark::before {
  width: 24px;
  height: 24px;
  opacity: 0.92;
}

.brand-mark::after {
  width: 13px;
  height: 13px;
  right: 12px;
  bottom: 11px;
  background: var(--highlight);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4.8vw, 4.8rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.topbar-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 251, 255, 0.78);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 750;
  padding: 0 14px;
  white-space: nowrap;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.13);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  align-items: start;
}

.tool-panel,
.side-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 251, 255, 0.9);
  box-shadow: var(--shadow);
}

.tool-panel {
  padding: clamp(18px, 3vw, 30px);
}

.side-panel {
  display: grid;
  gap: 0;
  overflow: hidden;
}

.detail-block {
  display: grid;
  gap: 8px;
  min-height: 112px;
  border-bottom: 1px solid var(--line);
  padding: 20px;
}

.detail-block:last-child {
  border-bottom: 0;
}

.detail-kicker {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.detail-block strong {
  align-self: end;
  font-size: 1.1rem;
  line-height: 1.18;
}

.download-form {
  display: grid;
  gap: 18px;
}

.field-group {
  display: grid;
  gap: 9px;
}

label {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 850;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

input,
select {
  width: 100%;
  min-width: 0;
  min-height: 54px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-strong);
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  padding: 0 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

input::placeholder {
  color: #9a8aad;
}

input:focus,
select:focus {
  border-color: var(--accent);
  outline: 4px solid rgba(124, 58, 237, 0.16);
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  padding: 0 22px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 12px 28px rgba(124, 58, 237, 0.24);
}

button:hover,
.button:hover {
  background: var(--accent-strong);
}

button:disabled {
  cursor: wait;
  opacity: 0.64;
}

select:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.64;
}

.status {
  display: flex;
  align-items: center;
  margin-top: 20px;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--purple-soft);
  color: var(--muted);
  font-weight: 700;
  line-height: 1.35;
  padding: 14px 16px;
}

.status::before {
  content: "";
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin-right: 11px;
  border-radius: 50%;
  background: var(--highlight);
}

.status.error {
  border-color: rgba(168, 50, 50, 0.35);
  background: #fff5f2;
  color: var(--danger);
}

.status.error::before {
  background: var(--danger);
}

.results {
  margin-top: 20px;
  display: grid;
  gap: 14px;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.result-header strong {
  font-size: 1.12rem;
}

.file-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.file-item {
  display: grid;
  grid-template-rows: auto minmax(78px, 1fr) auto;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
  padding: 12px;
}

.preview {
  width: 100%;
  aspect-ratio: 9 / 16;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--purple-soft);
  display: block;
  object-fit: cover;
}

.preview-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
}

.file-name {
  margin-top: 9px;
  overflow-wrap: anywhere;
  font-weight: 850;
  line-height: 1.25;
}

.media-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid rgba(124, 58, 237, 0.28);
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.09);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 900;
  padding: 0 9px;
  text-transform: uppercase;
}

.file-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.file-item .button {
  width: 100%;
  min-height: 46px;
  box-shadow: none;
}

@media (max-width: 860px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .side-panel {
    grid-template-columns: repeat(3, 1fr);
  }

  .detail-block {
    min-height: 96px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .detail-block:last-child {
    border-right: 0;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100vw - 20px, 1180px);
    padding: 18px 0 28px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-status {
    width: 100%;
    justify-content: center;
  }

  .brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 12px;
  }

  .input-row,
  .side-panel {
    grid-template-columns: 1fr;
  }

  .detail-block {
    min-height: 82px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .detail-block:last-child {
    border-bottom: 0;
  }

  button,
  .button {
    width: 100%;
  }
  }

  .ad-spacer {
  margin: 32px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100px;
  background: rgba(255, 251, 255, 0.4);
  border: 1px dashed var(--line);
  border-radius: 14px;
  overflow: hidden;
  }

  .info-grid {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
  }
  .info-card {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 251, 255, 0.6);
  }

  .info-card h2 {
  margin: 0 0 20px;
  font-size: 1.5rem;
  font-weight: 850;
  color: var(--ink);
  }

  .info-card p {
  margin: 0 0 16px;
  line-height: 1.6;
  color: var(--muted);
  }

  .steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 20px;
  }

  .steps li {
  display: flex;
  gap: 16px;
  }

  .step-num {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--purple-soft);
  color: var(--accent);
  border-radius: 50%;
  font-weight: 900;
  font-size: 0.85rem;
  }

  .steps strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1.05rem;
  font-weight: 800;
  }

  .steps p {
  margin: 0;
  font-size: 0.95rem;
  }

  .features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
  }

  .features li {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.5;
  }

  .features li strong {
  color: var(--ink);
  font-weight: 800;
  }

  @media (max-width: 640px) {
  .info-grid {
  grid-template-columns: 1fr;
  }
  }

  .app-footer {
  margin-top: 60px;
  padding: 32px 0;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  }

  .app-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 800;
  }

  .app-footer a:hover {
  text-decoration: underline;
  }

