:root {
  color-scheme: light;
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-strong: #f4f4f5;
  --ink: #18181b;
  --muted: #71717a;
  --line: #d4d4d8;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --green: #138a5e;
  --orange: #d97706;
  --red: #b42318;
  --shadow: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 8px;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-left: auto;
}

.nav-links a,
.site-footer a {
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

.nav-links a:hover,
.site-footer a:hover {
  color: var(--brand);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 6px;
}

.brand-text {
  display: grid;
  line-height: 1.1;
}

.brand-name {
  font-size: 1.18rem;
  font-weight: 900;
}

.brand-domain {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.install-button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.install-button[hidden] {
  display: none;
}

main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 44px;
}

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

h1 {
  max-width: 760px;
  margin: 0 0 8px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.1;
  letter-spacing: 0;
}

.intro {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 1.04rem;
}

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

.app-grid-single {
  grid-template-columns: 1fr;
}

.converter {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.drop-zone {
  display: grid;
  place-items: center;
  min-height: 210px;
  padding: 24px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  transition: background 160ms ease;
}

.drop-zone.dragging {
  background: #ecfdf5;
}

.drop-title {
  display: block;
  margin-bottom: 6px;
  font-size: 1.2rem;
  font-weight: 900;
}

.file-name {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.file-button,
.download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  margin-top: 14px;
  border-radius: 6px;
  background: var(--brand);
  color: #ffffff;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.file-button:hover,
.download:hover {
  background: var(--brand-dark);
}

input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
}

.check {
  align-content: end;
  grid-template-columns: auto 1fr;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
}

.check input {
  width: 18px;
  height: 18px;
  margin-top: 12px;
  accent-color: var(--brand);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 22px;
}

button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 900;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.primary {
  background: var(--brand);
  color: #ffffff;
}

.primary:hover:not(:disabled) {
  background: var(--brand-dark);
}

.secondary {
  border-color: var(--line);
  background: #ffffff;
  color: var(--ink);
}

.status {
  min-height: 24px;
  color: var(--muted);
}

.status.error {
  color: var(--red);
  font-weight: 800;
}

.progress-wrap {
  padding: 0 22px 22px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

progress {
  width: 100%;
  height: 16px;
  overflow: hidden;
  border: 0;
  border-radius: 4px;
  background: #e4e4e7;
}

progress::-webkit-progress-bar {
  background: #e4e4e7;
  border-radius: 4px;
}

progress::-webkit-progress-value {
  background: var(--green);
  border-radius: 4px;
}

progress::-moz-progress-bar {
  background: var(--green);
  border-radius: 4px;
}

.result {
  display: none;
  gap: 14px;
  padding: 0 22px 22px;
}

.result.ready {
  display: grid;
}

audio,
video {
  width: 100%;
  max-height: 420px;
  border-radius: 6px;
  background: #18181b;
}

.download {
  width: fit-content;
  margin-top: 0;
  background: var(--green);
}

.ad-column {
  display: grid;
  gap: 14px;
}

.ad-slot {
  display: grid;
  place-items: center;
  min-height: 250px;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
}

.content-ad {
  min-height: 180px;
}

.home-ad {
  margin-bottom: 18px;
}

.page-ad {
  margin-bottom: 18px;
}

.ad-slot[data-filled="true"] {
  border-style: solid;
  background: var(--surface);
}

.seo-content {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.seo-content section {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

h2,
h3 {
  margin: 0 0 8px;
  letter-spacing: 0;
}

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

.format-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.format-list li {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 32px;
  color: var(--muted);
  font-size: 0.92rem;
}

.content-page {
  max-width: 920px;
}

.article {
  display: grid;
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.article h1 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.article h2,
.article h3,
.article p {
  margin: 0;
}

.article p {
  color: var(--muted);
}

.article-lede {
  color: var(--ink);
  font-size: 1.08rem;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.guide-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-strong);
}

.guide-card h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.guide-card a {
  color: var(--ink);
  text-decoration: none;
}

.guide-card a:hover {
  color: var(--brand);
}

@media (max-width: 920px) {
  .topline {
    align-items: start;
    flex-direction: column;
  }

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

  .ad-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .site-header,
  main,
  .site-footer {
    width: min(100% - 20px, 1120px);
  }

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

  .nav-links {
    margin-left: 0;
  }

  .controls,
  .ad-column,
  .guide-grid {
    grid-template-columns: 1fr;
  }

  .drop-zone,
  .controls,
  .actions,
  .progress-wrap,
  .result {
    padding-left: 18px;
    padding-right: 18px;
  }
}
