:root {
  color-scheme: light;
  --paper: #fbfaf7;
  --ink: #171a1f;
  --muted: #626b78;
  --line: #d8dde3;
  --panel: #ffffff;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --amber: #b45309;
  --danger: #b42318;
  --shadow: 0 18px 48px rgba(20, 26, 35, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(15, 118, 110, 0.05) 1px, transparent 1px),
    var(--paper);
  background-size: 44px 44px;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding: 32px 18px;
}

.workspace {
  width: min(980px, 100%);
  min-height: calc(100vh - 64px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 28px;
  align-items: center;
}

.intro {
  padding: 8px 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  max-width: 9ch;
  font-size: clamp(3rem, 7vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.summary {
  margin: 22px 0 0;
  max-width: 32rem;
  color: var(--muted);
  font-size: 1.12rem;
}

.converter {
  width: 100%;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.dropzone {
  min-height: 220px;
  border: 2px dashed #a9b3bf;
  border-radius: 8px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  cursor: pointer;
  background: #f8faf9;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.dropzone:hover,
.dropzone.is-dragging {
  border-color: var(--accent);
  background: #eef9f6;
  transform: translateY(-1px);
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.drop-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid #cbd5df;
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
}

.drop-icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.drop-title {
  font-size: 1.2rem;
  font-weight: 800;
}

.drop-note {
  color: var(--muted);
  font-size: 0.95rem;
}

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.field {
  min-width: 0;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.number-wrap,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.number-wrap {
  display: flex;
  align-items: center;
  overflow: hidden;
}

.number-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  padding: 10px 12px;
  outline: 0;
}

.number-wrap span {
  padding: 0 12px;
  color: var(--muted);
  font-weight: 800;
}

select {
  padding: 10px 12px;
}

.file-list {
  min-height: 58px;
  margin-top: 16px;
  display: grid;
  gap: 8px;
}

.empty-state {
  min-height: 58px;
  display: grid;
  place-items: center start;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
}

.file-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  background: #edf1f4;
}

.file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.file-size {
  color: var(--muted);
  font-size: 0.88rem;
}

.remove-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

.remove-btn:hover {
  color: var(--danger);
  border-color: #f0b4ad;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.primary,
.secondary {
  min-height: 48px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  text-align: center;
  text-decoration: none;
  font-weight: 900;
}

.primary {
  border: 0;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

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

.primary:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.secondary {
  border: 1px solid var(--accent);
  background: #fff;
  color: var(--accent);
}

.is-hidden {
  display: none;
}

.status {
  min-height: 24px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.status strong {
  color: var(--accent);
}

.status.warn {
  color: var(--amber);
}

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

.seo-content {
  width: min(980px, 100%);
  margin: 32px auto 0;
  padding-bottom: 32px;
}

.content-block {
  max-width: 760px;
}

.content-block h2,
.faq h2 {
  margin: 0 0 12px;
  font-size: 1.65rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.content-block p,
.seo-grid p,
.faq p {
  margin: 0;
  color: var(--muted);
}

.seo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 22px;
}

.seo-grid article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.seo-grid h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  line-height: 1.25;
  letter-spacing: 0;
}

.faq {
  margin-top: 28px;
}

.faq details {
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.52);
}

.faq details:last-child {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  min-height: 54px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 800;
}

.faq details p {
  max-width: 760px;
  padding: 0 0 18px;
}

@media (max-width: 760px) {
  .app-shell {
    align-items: start;
    padding: 22px 14px;
  }

  .workspace {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 18px;
  }

  h1 {
    max-width: 12ch;
    font-size: 3.2rem;
  }

  .summary {
    margin-top: 14px;
    font-size: 1rem;
  }

  .converter {
    padding: 14px;
  }

  .dropzone {
    min-height: 180px;
  }

  .seo-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 460px) {
  .controls,
  .actions {
    grid-template-columns: 1fr;
  }

  .file-item {
    grid-template-columns: 40px minmax(0, 1fr) 34px;
  }
}
