:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  color: #172033;
  background: #f5f7fb;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --blue: #4169e1;
  --border: #dce2eb;
  --muted: #687386;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, calc((100vw - 1120px) / 2));
  background: #fff;
  border-bottom: 1px solid #e8ebf1;
}

.brand {
  color: #172033;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.brand span {
  color: var(--blue);
}

.back-link,
.related-links a,
.site-footer a {
  color: #3658bb;
  text-decoration: none;
}

.back-link:hover,
.related-links a:hover,
.site-footer a:hover {
  text-decoration: underline;
}

.page-shell {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
}

.intro {
  max-width: 700px;
  margin: 52px auto 28px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: #3658bb;
  font-size: 0.8rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  color: #121a2b;
  font-size: clamp(2rem, 5vw, 2.8rem);
  letter-spacing: -0.045em;
  line-height: 1.12;
}

.intro > p:last-child {
  margin-bottom: 0;
  color: #596579;
  font-size: 1.05rem;
  line-height: 1.65;
}

.converter {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 36px rgb(25 42 75 / 7%);
}

.drop-zone {
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 24px;
  padding: 28px 20px;
  border: 2px dashed #b8c5db;
  border-radius: 12px;
  background: #fafbfe;
  cursor: pointer;
  text-align: center;
  transition: border-color 150ms ease, background 150ms ease;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--blue);
  background: #f3f6ff;
}

.drop-zone:focus-within {
  outline: 3px solid rgb(65 105 225 / 25%);
  outline-offset: 2px;
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.folder-picker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: -10px 24px 18px;
  color: var(--muted);
  font-size: 0.8rem;
}

.folder-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid #cbd5e5;
  border-radius: 7px;
  background: #fff;
  color: #294a9e;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 650;
}

.folder-button:hover {
  background: #f3f6ff;
}

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

.folder-button:focus-within {
  outline: 3px solid rgb(65 105 225 / 25%);
  outline-offset: 2px;
}

.folder-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.upload-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #eaf0ff;
  color: var(--blue);
  font-size: 1.65rem;
  font-weight: 500;
}

.drop-title {
  color: #24314a;
  font-size: 1.03rem;
  font-weight: 650;
}

.drop-title span {
  color: var(--blue);
}

.drop-hint {
  color: var(--muted);
  font-size: 0.78rem;
}

.notice {
  display: none;
  margin: -8px 24px 18px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
}

.notice.visible {
  display: block;
}

.notice.error {
  color: #8b1e1e;
  background: #fff0f0;
}

.notice.success {
  color: #17633a;
  background: #eaf8f0;
}

.settings,
.results-section {
  padding: 23px 28px;
  border-top: 1px solid #e9edf3;
}

.settings h2,
.results-heading h2,
.help-section h2 {
  margin-bottom: 16px;
  color: #1d293d;
  font-size: 1.05rem;
}

.settings-grid {
  max-width: 420px;
}

.field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #344055;
  font-size: 0.87rem;
  font-weight: 600;
}

.field > span:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.field input:not([type="range"]):not([type="color"]),
.field select {
  width: 100%;
  height: 42px;
  padding: 0 11px;
  border: 1px solid #cdd5e1;
  border-radius: 7px;
  background: #fff;
  color: #1d293d;
}

.field input:focus,
.field select:focus {
  outline: 3px solid rgb(65 105 225 / 20%);
  border-color: var(--blue);
}

.primary-button,
.secondary-button,
.text-button,
.download-link,
.retry-button,
.remove-button {
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 650;
}

.primary-button {
  width: 100%;
  margin-top: 22px;
  padding: 11px 18px;
  background: var(--blue);
  color: #fff;
}

.primary-button:hover:not(:disabled) {
  background: #3154c2;
}

.primary-button:disabled,
.secondary-button:disabled,
.text-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.batch-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.secondary-button,
.retry-button {
  padding: 8px 12px;
  border: 1px solid #cbd5e5;
  background: #fff;
  color: #294a9e;
}

.secondary-button:hover:not(:disabled),
.retry-button:hover {
  background: #f3f6ff;
}

.text-button,
.remove-button {
  padding: 8px;
  background: transparent;
  color: #647087;
}

.text-button:hover:not(:disabled),
.remove-button:hover {
  color: #aa3030;
}

.results-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.results-heading h2 {
  margin-bottom: 3px;
}

.results-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.83rem;
}

.file-list {
  display: grid;
  gap: 10px;
}

.empty-state {
  padding: 20px 12px;
  border: 1px dashed #d8dee8;
  border-radius: 9px;
  color: #69758a;
  font-size: 0.88rem;
  text-align: center;
}

.file-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 10px;
  border: 1px solid #e4e8ef;
  border-radius: 9px;
  background: #fff;
}

.preview {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 7px;
  background: #f0f2f6;
  color: #7b8596;
  font-size: 0.72rem;
}

.preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-details {
  min-width: 0;
}

.file-name {
  overflow: hidden;
  margin-bottom: 4px;
  color: #253149;
  font-size: 0.88rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-status {
  margin: 0;
  color: #69758a;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.file-status[data-kind="success"] {
  color: #187248;
}

.file-status[data-kind="error"] {
  color: #ad3232;
}

.file-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.download-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  background: #edf2ff;
  color: #294a9e;
  font-size: 0.8rem;
  text-decoration: none;
  white-space: nowrap;
}

.download-link:hover {
  background: #e0e9ff;
}

.help-section {
  max-width: 740px;
  margin: 38px auto 48px;
  color: #505d72;
  font-size: 0.93rem;
  line-height: 1.7;
}

.common-technical-help > summary {
  color: #344055;
  cursor: pointer;
  font-weight: 650;
}

.common-technical-help-content {
  padding-top: 4px;
}

.common-technical-help-content h2:first-child {
  margin-top: 12px;
}

.help-section h2 {
  margin: 27px 0 10px;
}

.help-section ol {
  padding-left: 22px;
}

.help-section p {
  margin-bottom: 14px;
}

.conversion-guide {
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.conversion-guide ol {
  margin: 12px 0 0;
}

.conversion-faqs {
  display: grid;
  gap: 8px;
}

.conversion-faqs details {
  padding: 11px 13px;
  border: 1px solid #e1e6ef;
  border-radius: 8px;
  background: #fff;
}

.conversion-faqs summary {
  color: #253149;
  cursor: pointer;
  font-weight: 650;
}

.conversion-faqs details p {
  margin: 8px 0 0;
}

.conversion-page-links strong {
  width: 100%;
  color: #344055;
}

.privacy-note {
  padding: 12px 14px;
  border-left: 3px solid #7192ec;
  background: #edf2ff;
}

.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 22px;
  font-size: 0.88rem;
}

.site-footer {
  padding: 22px 16px;
  border-top: 1px solid #e4e8ef;
  background: #fff;
  color: #69758a;
  font-size: 0.82rem;
  text-align: center;
}

@media (max-width: 640px) {
  .site-header {
    height: 58px;
    padding: 0 18px;
  }

  .page-shell {
    width: min(100% - 20px, 520px);
  }

  .intro {
    margin: 35px auto 22px;
    padding: 0 8px;
  }

  .intro > p:last-child {
    font-size: 0.95rem;
  }

  .drop-zone {
    min-height: 180px;
    margin: 12px;
    padding: 22px 12px;
  }

  .folder-picker {
    margin: -2px 12px 16px;
  }

  .settings,
  .results-section {
    padding: 20px 16px;
  }

  .results-heading {
    align-items: flex-start;
  }

  .batch-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .file-card {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 10px;
  }

  .preview {
    width: 48px;
    height: 48px;
  }

  .file-actions {
    grid-column: 2;
    justify-content: flex-start;
    margin-top: -4px;
  }

  .help-section {
    margin: 30px auto 36px;
    padding: 0 6px;
  }

  .conversion-guide {
    padding: 18px 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
