:root {
  color-scheme: light;
  --ink: #19202a;
  --muted: #5c6878;
  --line: #d9e1ea;
  --panel: #ffffff;
  --soft: #f5f8fb;
  --blue: #2563eb;
  --teal: #0f766e;
  --amber: #b45309;
  --red: #b42318;
  --shadow: 0 18px 50px rgba(31, 41, 55, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #eef3f7;
  letter-spacing: 0;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  padding: 12px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(217, 225, 234, 0.9);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #0f766e);
  font-size: 13px;
}

.nav {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

.nav a {
  text-decoration: none;
}

.tool-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(360px, 1.15fr);
  gap: clamp(24px, 5vw, 56px);
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(34px, 7vw, 72px) clamp(18px, 4vw, 40px) 28px;
}

.intro h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 0.95;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--teal);
  font-weight: 760;
  text-transform: uppercase;
  font-size: 13px;
}

.lede {
  max-width: 620px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.trust-row span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  padding: 8px 12px;
  color: #344054;
  font-size: 13px;
}

.converter-panel,
.result-box,
.faq details {
  border: 1px solid rgba(217, 225, 234, 0.9);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

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

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.tab {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

.tab.active {
  border-color: rgba(37, 99, 235, 0.4);
  background: #eaf1ff;
  color: var(--blue);
  font-weight: 750;
}

.input-mode {
  display: none;
}

.input-mode.active {
  display: block;
}

.dropzone {
  display: grid;
  min-height: 232px;
  place-items: center;
  align-content: center;
  gap: 10px;
  border: 1.5px dashed #97a8ba;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(37, 99, 235, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(15, 118, 110, 0.05) 1px, transparent 1px),
    #fbfdff;
  background-size: 28px 28px;
  cursor: pointer;
  text-align: center;
  transition: border-color 140ms ease, transform 140ms ease;
}

.dropzone.dragging {
  border-color: var(--blue);
  transform: translateY(-1px);
}

.dropzone.has-file {
  border-style: solid;
  border-color: rgba(15, 118, 110, 0.82);
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(37, 99, 235, 0.06) 1px, transparent 1px),
    #f4fffb;
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.16);
}

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

.drop-icon {
  display: grid;
  width: 68px;
  height: 82px;
  place-items: center;
  border: 1px solid #9db1c7;
  border-radius: 8px;
  background: #fff;
  color: var(--blue);
  font-size: 14px;
  font-weight: 800;
}

.dropzone.has-file .drop-icon {
  border-color: rgba(15, 118, 110, 0.6);
  background: #e7fbf6;
  color: var(--teal);
}

.drop-title {
  font-weight: 780;
  font-size: 18px;
}

.drop-copy {
  color: var(--muted);
  font-size: 14px;
}

.drop-file {
  display: none;
  max-width: min(520px, 90%);
  overflow: hidden;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 8px;
  background: #fff;
  padding: 8px 12px;
  color: var(--teal);
  font-size: 14px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropzone.has-file .drop-file {
  display: block;
}

.field-label {
  display: block;
  margin: 4px 0 10px;
  color: #344054;
  font-weight: 700;
}

.field-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

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

.inline-input input {
  min-width: 0;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
}

.options-grid {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  color: #344054;
  font-size: 14px;
}

.primary-button,
.secondary-button,
.ghost-button,
.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  font-weight: 780;
}

.primary-button {
  width: 100%;
  color: #fff;
  background: var(--blue);
  margin-bottom: 10px;
}

.primary-button:disabled,
.ghost-button:disabled,
.download-button.disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.secondary-button {
  color: #fff;
  background: var(--ink);
}

.ghost-button {
  width: 100%;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

.download-button {
  width: 160px;
  color: #fff;
  background: var(--teal);
}

.download-button.muted {
  background: #334155;
}

.status-area {
  margin-top: 16px;
}

.progress-wrap {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6ecf3;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--teal));
  transition: width 180ms ease;
}

#statusText {
  min-height: 22px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px clamp(18px, 4vw, 40px) 42px;
}

.result-box {
  min-height: 220px;
  padding: 22px;
  box-shadow: none;
}

.result-box.wide {
  grid-column: 1 / -1;
}

.result-box h2,
.content-band h2,
.faq h2 {
  margin: 0 0 16px;
  font-size: 24px;
}

.summary-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.summary-list div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.summary-list dt {
  color: var(--muted);
}

.summary-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

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

.download-card p {
  min-height: 48px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.log-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  margin: 0;
  overflow: auto;
  padding-left: 22px;
  color: #344054;
}

.log-list li.error {
  color: var(--red);
}

.log-list li.warn {
  color: var(--amber);
}

.explainer-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px clamp(18px, 4vw, 40px) 48px;
}

.explainer-header {
  max-width: 780px;
  margin-bottom: 22px;
}

.explainer-header h2 {
  margin: 0 0 12px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.08;
  letter-spacing: 0;
}

.explainer-header p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.explainer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.explainer-card {
  min-height: 260px;
  border: 1px solid rgba(217, 225, 234, 0.95);
  border-radius: 8px;
  background: #fff;
  padding: 22px;
}

.explainer-card h3 {
  margin: 0 0 12px;
  font-size: 20px;
}

.explainer-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.68;
}

.explainer-card code {
  border: 1px solid #dbe4ee;
  border-radius: 6px;
  background: #f7fafc;
  padding: 1px 5px;
  color: #334155;
  font-size: 0.92em;
}

.content-band {
  background: #0f172a;
  color: #fff;
}

.content-inner {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(24px, 5vw, 56px);
  max-width: 1180px;
  margin: 0 auto;
  padding: 56px clamp(18px, 4vw, 40px);
}

.content-inner p,
.feature-list p {
  color: #cbd5e1;
  line-height: 1.65;
}

.feature-list {
  display: grid;
  gap: 14px;
}

.feature-list div {
  border-left: 3px solid #22c55e;
  padding-left: 16px;
}

.feature-list h3 {
  margin: 0 0 6px;
}

.feature-list a {
  color: #fff;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.faq {
  max-width: 860px;
  margin: 0 auto;
  padding: 48px clamp(18px, 4vw, 40px) 58px;
}

.faq details {
  margin-top: 12px;
  padding: 16px 18px;
  box-shadow: none;
}

.faq summary {
  cursor: pointer;
  font-weight: 760;
}

.faq p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 22px clamp(18px, 4vw, 56px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: #fff;
  font-size: 14px;
}

.article-shell {
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(34px, 7vw, 72px) clamp(18px, 4vw, 40px) 58px;
}

.article-shell h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
  letter-spacing: 0;
}

.article-shell h2 {
  margin: 34px 0 12px;
  font-size: 25px;
}

.article-shell p,
.article-shell li {
  color: var(--muted);
  line-height: 1.7;
}

.article-shell ol,
.article-shell ul {
  display: grid;
  gap: 10px;
  padding-left: 22px;
}

.article-note {
  margin: 28px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}

.article-note strong {
  color: var(--ink);
}

.code-line {
  display: block;
  overflow-x: auto;
  border-radius: 8px;
  background: #0f172a;
  color: #dbeafe;
  padding: 14px 16px;
  white-space: nowrap;
}

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

  .tool-shell,
  .content-inner,
  .explainer-grid,
  .results-grid {
    grid-template-columns: 1fr;
  }

  .converter-panel {
    min-width: 0;
  }

  .tabs,
  .inline-input {
    grid-template-columns: 1fr;
  }

  .summary-list div {
    grid-template-columns: 1fr;
  }
}
