:root {
  --bg: #f4f6fb;
  --card-bg: #ffffff;
  --accent: #4f46e5;
  --accent-soft: #e0e7ff;
  --text-main: #111827;
  --text-muted: #6b7280;
  --text-soft: #9ca3af;
  --border: #e5e7eb;
  --success: #16a34a;
  --danger: #dc2626;
  --radius-lg: 18px;
  --radius-md: 16px;
  --shadow-soft: 0 14px 40px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #e0e7ff 0, #f4f6fb 45%, #f9fafb 100%);
  color: var(--text-main);
  min-height: 100vh;
  margin: 0;
  padding: 0 16px 24px;
}

.page {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.page--narrow {
  max-width: 480px;
}

.brand {
  text-align: center;
  margin-bottom: 18px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #22c55e);
  color: #ffffff;
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 8px;
  box-shadow: 0 10px 30px rgba(79, 70, 229, 0.4);
}

.brand-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #4b5563;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 22px 20px 18px;
}

@media (min-width: 640px) {
  .card {
    padding: 26px 24px 20px;
  }
}

h1 {
  font-size: 22px;
  line-height: 1.2;
  margin-bottom: 10px;
  text-align: center;
}

h2 {
  font-size: 16px;
  color: var(--text-main);
  margin-bottom: 8px;
}

h3 {
  font-size: 15px;
  color: var(--text-main);
  margin: 12px 0 6px;
}

.subtitle {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.5;
}

.upload-area {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  background-color: #f9fafb;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.1s ease;
  cursor: pointer;
  outline: none;
}

.upload-area.dragover,
.upload-area:focus-visible {
  border-color: var(--accent);
  background-color: var(--accent-soft);
  transform: translateY(-1px);
}

.upload-icon {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #eef2ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  color: #4f46e5;
  font-size: 22px;
}

.upload-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.upload-text {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.upload-hint {
  font-size: 12px;
  color: var(--text-soft);
}

.upload-input {
  display: none;
}

.file-info {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  min-height: 18px;
  word-break: break-word;
}

.file-info span {
  font-weight: 500;
  color: var(--text-main);
}

.file-list {
  margin-top: 14px;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.file-list li {
  margin-bottom: 4px;
  word-break: break-word;
}

.control-group,
.quality-group {
  margin-top: 16px;
}

.control-label,
.quality-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-main);
}

.control-select,
.quality-select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  background: #ffffff;
  color: var(--text-main);
}

.actions {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-primary {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 12px 25px rgba(79, 70, 229, 0.45);
  transition: transform 0.08s ease, box-shadow 0.08s ease, opacity 0.2s ease;
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-primary:not(:disabled):active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

.btn-secondary {
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  padding: 6px 10px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.btn-secondary:focus-visible,
.btn-primary:focus-visible,
.control-select:focus-visible,
.quality-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.status {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
  min-height: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background-color: var(--accent);
  flex-shrink: 0;
}

.status-dot.ok {
  background-color: var(--success);
}

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

.progress {
  margin-top: 12px;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background-color: #e5e7eb;
  overflow: hidden;
  display: none;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #22c55e);
  transition: width 0.15s ease;
}

.download-link,
.download-list {
  margin-top: 12px;
  font-size: 14px;
  display: none;
}

.download-link a,
.download-list a,
.link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.download-link a:hover,
.download-list a:hover,
.link:hover {
  text-decoration: underline;
}

.download-list ul {
  padding-left: 18px;
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.6;
}

.security-note {
  margin-top: 18px;
  font-size: 11px;
  color: var(--text-soft);
  text-align: center;
  line-height: 1.5;
}

.seo-block {
  margin-top: 20px;
  font-size: 14px;
  color: #4b5563;
  line-height: 1.6;
}

.seo-block p {
  margin-bottom: 8px;
}

.tools-links {
  margin-top: 24px;
  font-size: 14px;
  color: #4b5563;
}

.link-list {
  list-style: none;
  padding-left: 0;
}

.link-list li {
  margin-bottom: 6px;
}

.site-footer {
  margin-top: 18px;
  text-align: center;
  font-size: 11px;
  color: var(--text-soft);
}

.site-footer a {
  color: #6b7280;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-page {
  max-width: 800px;
}

.legal-card {
  background: #ffffff;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.legal-card h1 {
  text-align: left;
  font-size: 24px;
  margin-bottom: 16px;
}

.legal-card h2 {
  font-size: 18px;
  margin-top: 20px;
  margin-bottom: 8px;
}

.legal-card p,
.legal-card li {
  font-size: 14px;
  color: #4b5563;
  line-height: 1.6;
}

.legal-card ul {
  padding-left: 20px;
}

.legal-card a {
  color: var(--accent);
  text-decoration: none;
}

.legal-card a:hover {
  text-decoration: underline;
}

.skip-link {
  position: absolute;
  top: -48px;
  left: 12px;
  background: #111827;
  color: #ffffff;
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
  z-index: 1000;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
}

.skip-link:focus {
  top: 12px;
}

.site-header {
  width: 100%;
  margin-bottom: 4px;
  padding-top: 8px;
}

.header-inner {
  max-width: 560px;
  margin: 0 auto;
  padding: 8px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px 20px;
  flex-wrap: wrap;
}

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

.brand-link:hover {
  text-decoration: none;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 14px;
}

.main-nav a {
  font-size: 14px;
  color: #1f2937;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}

.main-nav a:hover {
  color: #4f46e5;
}

.main-nav a:focus-visible,
.brand-link:focus-visible,
.skip-link:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
  border-radius: 6px;
}

.link,
.tools-links a,
.site-footer a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link:hover,
.tools-links a:hover,
.site-footer a:hover {
  text-decoration-thickness: 2px;
}

@media (max-width: 640px) {
  .header-inner {
    justify-content: center;
  }

  .main-nav {
    width: 100%;
  }
}