:root {
  color-scheme: light;
  --canvas: #f4f6f3;
  --surface: #ffffff;
  --surface-soft: #f7f9f6;
  --ink: #17231f;
  --muted: #64736c;
  --line: #dce5df;
  --signal: #c9f36a;
  --field: #f1f6f1;
  --focus: #33735a;
  --danger: #b54747;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: #f5f6f2;
  font: 15px/1.6 var(--sans);
  letter-spacing: -.012em;
}
button, input, textarea { font: inherit; }
button, a, label { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
::selection { background: var(--signal); color: var(--ink); }

.site-header, .page-shell, .site-footer { width: min(1160px, calc(100% - 64px)); margin-inline: auto; }
.site-header {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid rgb(220 229 223 / 85%);
}
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 760; letter-spacing: -.045em; text-decoration: none; }
.brand-mark { width: 31px; height: 31px; flex: none; color: #315c49; }
.header-actions { display: flex; align-items: center; gap: 23px; }
.privacy-chip, .github-link { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; text-decoration: none; }
.privacy-chip { padding: 7px 11px; border: 1px solid #dce8d6; border-radius: 999px; background: #f7fbf1; color: #38513f; font-weight: 650; }
.icon { width: 18px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.privacy-chip .icon { width: 14px; height: 15px; }
.github-link svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.github-link:hover, .site-footer a:hover { color: var(--ink); text-decoration: underline; }

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(390px, .94fr);
  align-items: center;
  gap: clamp(42px, 7vw, 92px);
  padding: clamp(64px, 8vw, 104px) 6px clamp(72px, 8vw, 104px);
}
.intro-copy { position: relative; z-index: 1; }
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 22px; color: #52655b; font-size: 11px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow-mark { width: 10px; height: 10px; display: inline-block; border: 2px solid #315c49; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 4px #eaf2e5; }
h1 { max-width: 690px; margin: 0; font: 780 clamp(54px, 6.1vw, 82px)/.98 var(--display); letter-spacing: -.075em; }
.intro-text { max-width: 470px; margin: 24px 0 0; color: #66766e; font-size: clamp(15px, 1.4vw, 17px); line-height: 1.75; }
.jump-link { min-height: 48px; display: inline-flex; align-items: center; gap: 17px; margin-top: 28px; padding: 0 19px; border: 1px solid #244b3a; border-radius: 9px; background: #244b3a; color: #fff; box-shadow: 0 5px 12px rgb(30 64 48 / 12%); font-size: 13px; font-weight: 720; text-decoration: none; transition: transform .16s, background-color .16s, box-shadow .16s; }
.jump-link span { color: var(--signal); font-size: 18px; line-height: 1; }
.jump-link:hover { transform: translateY(-2px); background: #183a2d; box-shadow: 0 9px 18px rgb(30 64 48 / 16%); }
.jump-link:hover span { color: #fff; }

.hero-visual {
  min-width: 0;
  margin: 0;
  padding: clamp(14px, 2.3vw, 24px);
  border: 1px solid #d8e5d9;
  border-radius: 22px;
  background: linear-gradient(145deg, #e5f4dc, #d7edcd 58%, #cce6c5);
  box-shadow: 0 24px 60px rgb(44 75 53 / 9%), inset 0 1px 0 rgb(255 255 255 / 85%);
}
.magnet-art { display: block; width: 100%; height: auto; overflow: visible; }
.art-loop { fill: none; stroke: rgb(37 66 48 / 38%); stroke-width: 1.3; stroke-dasharray: 2 8; stroke-linecap: round; }
.art-loop-inner { stroke: rgb(37 66 48 / 22%); stroke-dasharray: 1 6; }
.art-trail { fill: none; stroke: #244b3a; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.art-file path, .art-file circle { fill: none; stroke: #244b3a; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.art-file path:first-child { fill: #fff; }
.art-magnet path:first-child { fill: none; stroke: #244b3a; stroke-width: 24; stroke-linecap: square; stroke-linejoin: round; }
.art-magnet .art-pole { fill: none; stroke: #f5fbf2; stroke-width: 7; stroke-linecap: square; }
.art-link path { fill: none; stroke: #244b3a; stroke-width: 6; stroke-linecap: round; }
.art-signal { fill: #fff; stroke: #244b3a; stroke-width: 2; }
.art-signal-small { fill: #244b3a; }
.art-label { fill: #294c38; font: 700 10px var(--mono); letter-spacing: .7px; }
.art-protocol { fill: #294c38; font: 700 10px var(--mono); letter-spacing: .25px; }
.hero-visual figcaption { display: flex; align-items: center; gap: 11px; padding: 12px 6px 1px; color: #435c49; font-size: 11px; font-weight: 650; }
.figure-index { width: 24px; height: 24px; display: inline-grid; flex: none; place-items: center; border: 1px solid #b3cdb0; border-radius: 50%; background: rgb(255 255 255 / 45%); font: 700 10px var(--mono); }

.converter {
  scroll-margin-top: 18px;
  overflow: hidden;
  border: 1px solid #dce5df;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 22px 65px rgb(32 60 44 / 7%), 0 2px 8px rgb(32 60 44 / 3%);
}
.workspace-topbar {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 21px clamp(22px, 3.6vw, 42px);
  border-bottom: 1px solid rgb(255 255 255 / 9%);
  background: linear-gradient(110deg, #193b2e, #245440);
  color: #f8fbf6;
}
.workspace-kicker { margin: 0 0 3px; color: #b8cbbd; font-size: 10px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.workspace-topbar h2 { margin: 0; font: 720 25px/1.2 var(--display); letter-spacing: -.045em; }
.workspace-promise { display: inline-flex; align-items: center; gap: 9px; margin: 0; color: #d7e4d8; font-size: 11px; }
.workspace-promise .icon { color: var(--signal); }
.workspace-grid { display: grid; grid-template-columns: minmax(300px, .82fr) minmax(0, 1.18fr); }
.upload-panel, .output-panel { min-width: 0; padding: clamp(24px, 3.1vw, 36px); }
.upload-panel { border-right: 1px solid var(--line); background: linear-gradient(180deg, #f8faf7, #f4f8f3); }
.panel-heading { min-width: 0; display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.panel-heading h3 { margin: 0; font-size: 15px; font-weight: 760; letter-spacing: -.035em; line-height: 1.35; }
.panel-heading p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.step-index { width: 30px; height: 30px; display: grid; flex: none; place-items: center; border: 1px solid #cddbd1; border-radius: 9px; background: #fff; color: #496655; font: 700 10px var(--mono); }
.step-index-output { border-color: #d5e6bb; background: #edf7df; color: #3e633c; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.dropzone {
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 25px 18px;
  border: 1.5px dashed #b5cbb9;
  border-radius: 14px;
  background: linear-gradient(180deg, #f3f8ef, #eef6e9);
  text-align: center;
  cursor: pointer;
  transition: background-color .16s, border-color .16s, transform .16s, box-shadow .16s;
}
.dropzone:hover { border-color: #5b8c68; background: #eaf5e3; box-shadow: 0 8px 22px rgb(62 99 60 / 7%); }
.dropzone.is-dragging { border: 2px solid #39734d; background: #e1f4ca; box-shadow: inset 0 0 0 4px rgb(57 115 77 / 7%); transform: scale(.99); }
.dropzone.is-working { border-style: solid; border-color: #789b7a; cursor: progress; }
#file-input:focus-visible + .dropzone { outline-width: 3px; outline-style: solid; outline-color: var(--focus); outline-offset: 4px; }
#file-input:disabled + .dropzone { cursor: progress; }
.drop-icon-wrap { width: 56px; height: 56px; display: grid; place-items: center; margin-bottom: 14px; border: 1px solid #dce9d3; border-radius: 16px; background: #fff; color: #376849; box-shadow: 0 5px 14px rgb(53 89 61 / 7%); transform: none; transition: transform .16s; }
.dropzone:hover .drop-icon-wrap, .dropzone.is-dragging .drop-icon-wrap { transform: translateY(-2px); }
.drop-icon { width: 36px; height: 36px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.drop-title { font-size: 16px; font-weight: 760; letter-spacing: -.035em; }
.drop-hint { margin-top: 4px; color: #74837a; font-size: 11px; }
.browse-button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 13px; margin-top: 17px; padding: 8px 15px; border: 1px solid #244b3a; border-radius: 8px; background: #244b3a; color: #fff; font-size: 11px; font-weight: 720; box-shadow: 0 4px 10px rgb(30 64 48 / 10%); }
.browse-button span { color: var(--signal); font-size: 15px; line-height: 1; }
.dropzone:hover .browse-button, .dropzone.is-dragging .browse-button { background: #173a2d; color: #fff; }
.dropzone:hover .browse-button span, .dropzone.is-dragging .browse-button span { color: var(--signal); }
.conversion-progress { width: 100%; height: 6px; display: block; margin: 16px 0 0; overflow: hidden; border: 0; border-radius: 99px; background: #e2eae2; accent-color: #4f865c; }
.conversion-progress::-webkit-progress-bar { border-radius: 99px; background: #e2eae2; }
.conversion-progress::-webkit-progress-value { border-radius: 99px; background: #4f865c; transition: width .18s ease; }
.conversion-progress::-moz-progress-bar { border-radius: 99px; background: #4f865c; }
.conversion-progress[hidden] { display: none; }
.status-message { min-height: 22px; margin: 12px 0 0; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.local-note { display: flex; align-items: center; gap: 8px; margin: 15px 0 0; padding-top: 13px; border-top: 1px solid var(--line); color: #718078; font-size: 10px; }
.local-note .icon { width: 14px; height: 15px; color: #4e805b; }

.output-panel { display: flex; flex-direction: column; }
.output-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 7px; }
.output-heading .panel-heading { margin: 0; }
.results-title-actions { display: flex; align-items: center; gap: 11px; flex: none; }
.file-count { min-width: 54px; padding: 5px 9px; border: 1px solid #e1e9df; border-radius: 999px; background: #f5f8f3; color: #506359; font-size: 10px; font-weight: 700; text-align: center; white-space: nowrap; }
.clear-button { min-height: 34px; padding: 5px 0 5px 4px; border: 0; background: transparent; color: #748078; font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }
.clear-button:hover:enabled { color: var(--danger); }
.clear-button:disabled { opacity: .42; cursor: default; }
.batch-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 13px 0 4px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.batch-actions[hidden] { display: none; }
.links-ready { color: #587064; font-size: 11px; font-weight: 700; }
.batch-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.batch-button { min-height: 36px; padding: 6px 12px; border: 1px solid #cfdcd1; border-radius: 8px; background: #fff; color: #355545; font-size: 10px; font-weight: 730; transition: background-color .14s, color .14s, border-color .14s; }
.batch-button:hover { border-color: #a9c48f; background: #eff8e5; }
.results { display: grid; }
.result-row { min-width: 0; padding: 18px 0; border-bottom: 1px solid var(--line); animation: result-arrive .18s ease-out both; }
.result-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.result-header-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.result-heading { min-width: 0; }
.result-title { margin: 0; color: #263b30; font-size: 13px; font-weight: 750; line-height: 1.45; overflow-wrap: anywhere; }
.result-meta { margin: 4px 0 0; color: #7a8880; font-size: 10px; }
.protocol-tag { padding: 4px 8px; border: 1px solid #deebd0; border-radius: 6px; background: #f2f8e9; color: #527143; font: 700 9px var(--mono); white-space: nowrap; }
.remove-button { min-height: 30px; padding: 4px 2px 4px 7px; border: 0; background: transparent; color: #7a8880; font-size: 10px; text-decoration: underline; text-underline-offset: 3px; }
.remove-button:hover { color: var(--danger); }
.magnet-field-label { display: block; margin-bottom: 6px; color: #748078; font-size: 10px; font-weight: 650; }
.magnet-output { width: 100%; min-height: 76px; display: block; padding: 11px 12px; border: 1px solid #dce6dd; border-left: 3px solid #b7df7d; border-radius: 9px; background: #f7faf6; color: #355044; font: 10px/1.65 var(--mono); overflow-wrap: anywhere; resize: vertical; }
.result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 11px; margin-top: 10px; }
.copy-button { min-width: 116px; min-height: 38px; padding: 8px 14px; border: 1px solid #244b3a; border-radius: 8px; background: #244b3a; color: #fff; font-size: 11px; font-weight: 730; box-shadow: 0 3px 9px rgb(30 64 48 / 9%); transition: background-color .14s, color .14s, transform .14s; }
.copy-button:hover { transform: translateY(-1px); background: #173a2d; }
.copy-status { flex: 1 1 150px; margin: 0; color: #748078; font-size: 10px; overflow-wrap: anywhere; }
.error-message { margin: 7px 0 0; color: var(--danger); font-size: 11px; }
.empty-state { min-height: 178px; display: flex; align-items: center; justify-content: flex-start; gap: 16px; padding: 24px 10px; color: var(--muted); }
.empty-spark { width: 44px; height: 44px; display: grid; flex: none; place-items: center; border: 1px solid #deeadb; border-radius: 13px; background: #f7faf5; color: #69906b; font-size: 22px; }
.empty-state p { margin: 0 0 3px; color: #40574a; font-size: 13px; font-weight: 750; }
.empty-state span { color: #849188; font-size: 10px; }
.output-panel:has(.result-row) .empty-state { display: none; }

.how-it-works { border-top: 1px solid var(--line); background: #fcfdfb; }
.how-it-works summary { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px clamp(22px, 3.6vw, 42px); color: #344c3e; cursor: pointer; font-size: 11px; font-weight: 740; list-style: none; }
.how-it-works summary::-webkit-details-marker { display: none; }
.disclosure-icon { position: relative; width: 16px; height: 16px; flex: none; }
.disclosure-icon::before, .disclosure-icon::after { position: absolute; content: ''; background: #6c8173; }
.disclosure-icon::before { top: 7px; left: 0; width: 16px; height: 1px; }
.disclosure-icon::after { top: 0; left: 7px; width: 1px; height: 16px; }
.how-it-works[open] .disclosure-icon::after { display: none; }
.how-it-works p { max-width: 780px; margin: 0; padding: 0 clamp(22px, 3.6vw, 42px) 22px; color: #687970; font-size: 11px; line-height: 1.8; }
.site-footer { min-height: 75px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 0 23px; color: #78877e; font-size: 10px; }
.site-footer a { color: #3f6650; font-weight: 700; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.noscript-note { padding: 10px; border: 1px solid var(--danger); color: var(--danger); }

@keyframes result-arrive { from { opacity: .65; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

@media (min-width: 1500px) { .intro { padding-top: 112px; padding-bottom: 112px; } }
@media (max-width: 900px) {
  .site-header, .page-shell, .site-footer { width: min(100% - 48px, 760px); }
  .intro { grid-template-columns: minmax(0, 1fr) minmax(300px, .9fr); gap: 30px; padding-inline: 0; }
  h1 { font-size: clamp(52px, 7.6vw, 70px); }
  .workspace-grid { grid-template-columns: minmax(265px, .82fr) minmax(0, 1.18fr); }
  .upload-panel, .output-panel { padding: 23px; }
  .output-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
}
@media (max-width: 680px) {
  .site-header, .page-shell, .site-footer { width: calc(100% - 34px); }
  .site-header { min-height: 68px; }
  .brand { gap: 8px; font-size: 14px; }
  .brand-mark { width: 26px; height: 26px; }
  .header-actions { gap: 10px; }
  .privacy-chip { padding: 6px; font-size: 0; gap: 0; }
  .privacy-chip .icon { width: 16px; height: 17px; }
  .github-link { gap: 5px; font-size: 10px; }
  .intro { grid-template-columns: 1fr; gap: 28px; padding: 43px 0 46px; }
  .eyebrow { margin-bottom: 18px; font-size: 10px; }
  h1 { font-size: clamp(49px, 12.8vw, 72px); }
  .intro-text { max-width: 450px; margin-top: 17px; font-size: 14px; }
  .jump-link { margin-top: 20px; }
  .hero-visual { padding: 10px; border-radius: 16px; }
  .hero-visual figcaption { padding-top: 9px; font-size: 10px; }
  .workspace-topbar { min-height: 82px; align-items: flex-start; flex-direction: column; gap: 8px; padding: 17px 19px; }
  .workspace-topbar h2 { font-size: 22px; }
  .workspace-promise { font-size: 10px; }
  .workspace-grid { grid-template-columns: 1fr; }
  .upload-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .upload-panel, .output-panel { padding: 22px 18px; }
  .dropzone { min-height: 220px; }
  .output-heading { align-items: center; flex-direction: row; gap: 8px; }
  .output-heading .panel-heading { gap: 9px; }
  .panel-heading h3 { font-size: 14px; }
  .panel-heading p { font-size: 10px; }
  .results-title-actions { gap: 7px; }
  .file-count { min-width: auto; padding-inline: 7px; font-size: 9px; }
  .clear-button { font-size: 10px; }
  .batch-actions { align-items: flex-start; flex-direction: column; }
  .batch-buttons { justify-content: flex-start; }
  .empty-state { min-height: 130px; }
  .how-it-works summary { padding-inline: 18px; }
  .how-it-works p { padding-inline: 18px; }
  .site-footer { align-items: flex-start; flex-direction: column; gap: 5px; padding: 15px 0 20px; }
}
@media (max-width: 390px) {
  .site-header, .page-shell, .site-footer { width: calc(100% - 28px); }
  .brand { font-size: 13px; }
  .header-actions { gap: 8px; }
  .github-link { font-size: 9px; }
  .intro { padding-top: 35px; }
  h1 { font-size: 47px; }
  .workspace-topbar { padding-inline: 15px; }
  .output-heading { align-items: flex-start; flex-direction: column; }
  .output-panel { padding-inline: 15px; }
  .result-header-actions { gap: 7px; }
  .protocol-tag { font-size: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
