:root {
  color-scheme: light dark;
  --bg: #fafbf9;
  --surface: #fff;
  --ink: #202925;
  --muted: #69746e;
  --line: #e0e6e1;
  --line-strong: #c8d3ca;
  --wash: #f6f9f6;
  --accent: #255c49;
  --accent-hover: #194534;
  --accent-text: #245c47;
  --focus: #5aa583;
  --error: #a23d34;
  --success: #246d4b;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.shell { width: min(100% - 40px, 584px); margin: 0 auto; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 82px; border-bottom: 1px solid var(--line); }
.brand { font-size: 15px; font-weight: 720; letter-spacing: -.035em; }
.brand span { color: var(--muted); font-weight: 440; margin-left: 4px; }
.privacy { display: inline-flex; gap: 7px; align-items: center; white-space: nowrap; color: var(--muted); font-size: 12px; }
.privacy-dot { width: 7px; height: 7px; background: #3b996d; border-radius: 50%; }
.intro { padding: 54px 0 27px; }
h1 { font-size: clamp(32px, 7vw, 43px); line-height: 1.2; margin: 0; letter-spacing: -.065em; font-weight: 740; }
h1 span { color: var(--accent); font-weight: 460; padding: 0 3px; }
.intro p { color: var(--muted); margin: 8px 0 0; line-height: 1.55; font-size: 14px; }
.converter { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 21px; }
.panel-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 16px; }
h2 { font-size: 15px; font-weight: 690; line-height: 1.3; letter-spacing: -.02em; margin: 0; }
.panel-heading > span { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.dropzone, .selected-file {
  border: 1px dashed var(--line-strong);
  background: var(--wash);
  min-height: 91px;
  padding: 16px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  gap: 13px;
}
.dropzone { cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.dropzone:hover, .dropzone.drag-over { background: #eff6ef; border-color: var(--accent); }
.file-symbol { width: 43px; height: 43px; flex: none; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; color: var(--accent); }
.file-prompt { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.45; }
.file-prompt strong { font-size: 14px; font-weight: 680; }
.file-prompt span { color: var(--muted); font-size: 12px; margin-top: 2px; }
.browse-hint { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; font-weight: 640; font-size: 12px; }
.selected-file { border-style: solid; }
.file-type { display: grid; flex: none; place-items: center; width: 43px; height: 43px; color: var(--accent-text); border-radius: 8px; background: var(--surface); border: 1px solid var(--line); font-size: 10px; font-weight: 750; }
.selected-file-info { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.4; }
.selected-file-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 650; }
.selected-file-info span { color: var(--muted); font-size: 12px; margin-top: 3px; }
.subtle-button { padding: 8px 0 8px 10px; border: 0; color: var(--accent-text); background: none; font: inherit; font-size: 12px; font-weight: 660; cursor: pointer; }
.action-bar { display: flex; gap: 9px; margin-top: 13px; }
.primary-button, .secondary-button { min-height: 44px; padding: 10px 17px; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: background .15s ease; }
.primary-button { flex: 1; color: white; background: var(--accent); border: 1px solid var(--accent); }
.primary-button:not(:disabled):hover { background: var(--accent-hover); }
.primary-button:disabled { background: #d6dfd9; border-color: #d6dfd9; color: #6b8172; cursor: not-allowed; }
.secondary-button { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.secondary-button:hover { background: var(--wash); }
.status { color: var(--muted); margin-top: 10px; text-align: center; font-size: 11.5px; line-height: 1.5; min-height: 17px; overflow-wrap: anywhere; }
.status.error { color: var(--error); }
.status.success { color: var(--success); }
.progress-track { height: 3px; margin-top: 12px; border-radius: 4px; background: var(--line); overflow: hidden; }
.progress-track div { width: 32%; height: 100%; background: var(--accent); animation: slide 1.1s ease-in-out infinite alternate; }
@keyframes slide { from { transform: translateX(-90%); } to { transform: translateX(310%); } }
.download-link { display: flex; align-items: center; justify-content: space-between; background: #ecf5ef; border: 1px solid #cde1d1; border-radius: 8px; text-decoration: none; color: #1f5c3e; font-weight: 720; padding: 11px 14px; margin-top: 13px; }
.download-link:hover { background: #e1f0e6; }
.warnings { margin-top: 12px; font-size: 12px; color: var(--muted); }
.warnings summary { font-weight: 660; cursor: pointer; }
.warnings ul { padding-left: 17px; max-height: 145px; overflow: auto; overflow-wrap: anywhere; }
.privacy-note { margin: 17px 0 0; text-align: center; color: var(--muted); font-size: 12px; }
.footer { display: flex; justify-content: space-between; gap: 8px 18px; margin-top: 60px; padding: 17px 0 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.dropzone:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
@media (max-width: 480px) {
  .shell { width: min(100% - 32px, 584px); }
  .site-header { min-height: 66px; }
  .intro { padding: 36px 0 22px; }
  h1 { font-size: 34px; }
  .converter { padding: 15px; border-radius: 11px; }
  .dropzone, .selected-file { padding: 12px; min-height: 83px; gap: 10px; }
  .file-symbol, .file-type { width: 38px; height: 38px; }
  .footer { margin-top: 44px; flex-wrap: wrap; }
}
@media (max-width: 350px) {
  .browse-hint { display: none; }
  .panel-heading > span { display: none; }
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111715; --surface: #19211e; --ink: #edf4ef; --muted: #a4b3a9; --line: #33423a; --line-strong: #52675a; --wash: #202b25; --accent: #34795d; --accent-hover: #408c6b; --accent-text: #a1dcc0; --focus: #80c3a1; --error: #ff9c91; --success: #99ddac; }
  .dropzone:hover, .dropzone.drag-over { background: #2a4033; }
  .primary-button:disabled { background: #34453b; border-color: #34453b; color: #9db0a0; }
  .download-link { background: #1e3526; border-color: #315942; color: #b0eac4; }
  .download-link:hover { background: #264b31; }
}
@media (prefers-reduced-motion: reduce) { .progress-track div { animation: none; width: 100%; } }
