:root {
  --bg: #f6f8f7;
  --surface: #fff;
  --ink: #17211c;
  --muted: #5c6861;
  --soft: #eef2ef;
  --border: #d8dfdb;
  --border-strong: #bec9c2;
  --green: #178447;
  --green-dark: #106638;
  --green-soft: #eaf6ee;
  --coral: #db685f;
  --blue: #3c78e8;
  --shadow: 0 14px 38px rgba(22, 44, 32, .07);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  letter-spacing: 0;
}
button, select, input { font: inherit; letter-spacing: 0; }
button, select, input[type="range"] { cursor: pointer; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible {
  outline: 3px solid rgba(23, 132, 71, .2);
  outline-offset: 2px;
}
a { color: inherit; }
svg { width: 18px; height: 18px; stroke-width: 2; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.header-inner, .footer-inner, main { width: min(100% - 40px, 1240px); margin: 0 auto; }
.header-inner { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; }
.brand img { display: block; width: 116px; height: auto; }
.header-actions { display: flex; align-items: center; gap: 18px; }
.local-badge, .tools-link { display: inline-flex; align-items: center; gap: 7px; font-size: .82rem; font-weight: 700; }
.local-badge { color: var(--green-dark); }
.tools-link { color: #38463e; text-decoration: none; }
.tools-link:hover { color: var(--green); }
.lang-switch { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--border); border-radius: 8px; background: #f4f6f5; }
.lang-btn { min-width: 42px; min-height: 33px; padding: 5px 9px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: .78rem; font-weight: 700; }
.lang-btn.active { background: white; color: var(--ink); box-shadow: 0 1px 4px rgba(22, 33, 27, .12); }

main { padding: 34px 0 60px; }
.intro { display: flex; justify-content: space-between; align-items: end; gap: 32px; margin-bottom: 22px; }
.eyebrow { display: block; margin-bottom: 8px; color: var(--green); font-size: .7rem; font-weight: 700; }
h1 { margin: 0; font-size: 2.35rem; line-height: 1.12; letter-spacing: 0; }
.intro p { margin: 8px 0 0; color: var(--muted); font-size: .98rem; }
.trust-line { display: flex; align-items: center; gap: 9px; color: #2f5d43; font-size: .81rem; font-weight: 700; }
.trust-line svg { color: var(--green); }

.workspace { min-height: 590px; display: grid; grid-template-columns: 220px minmax(0, 1fr); border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.tool-sidebar { border-right: 1px solid var(--border); background: #fbfcfb; }
.sidebar-title { padding: 22px 18px 10px; color: #829087; font-size: .66rem; font-weight: 700; }
.tool-sidebar nav { padding: 0 10px 18px; display: grid; gap: 3px; }
.tool-button { width: 100%; min-height: 45px; display: flex; align-items: center; gap: 11px; padding: 7px 10px; border: 0; border-radius: 6px; background: transparent; color: #526158; text-align: left; font-size: .82rem; font-weight: 600; }
.tool-button:hover { background: #f0f4f1; color: var(--ink); }
.tool-button.active { position: relative; background: var(--green-soft); color: var(--green-dark); font-weight: 700; }
.tool-button.active::before { position: absolute; left: -10px; width: 3px; height: 25px; border-radius: 0 3px 3px 0; background: var(--green); content: ""; }
.tool-icon { width: 29px; height: 29px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 6px; color: white; }
.tool-icon svg { width: 15px; height: 15px; }
.tool-button:nth-child(5n+1) .tool-icon { background: #f39a4c; }
.tool-button:nth-child(5n+2) .tool-icon { background: #5384ec; }
.tool-button:nth-child(5n+3) .tool-icon { background: #8b4ee6; }
.tool-button:nth-child(5n+4) .tool-icon { background: #e76c69; }
.tool-button:nth-child(5n+5) .tool-icon { background: #32ad69; }

.converter { min-width: 0; padding: 26px; }
.converter-heading { min-height: 52px; display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.active-tool-mark { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 7px; background: var(--green-soft); color: var(--green); }
.converter-heading h2 { margin: 0; font-size: 1.15rem; }
.converter-heading p { margin: 3px 0 0; color: var(--muted); font-size: .78rem; }

.dropzone { width: 100%; min-height: 280px; padding: 26px 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1.5px dashed #aab5ae; border-radius: 8px; background: #fcfdfc; color: var(--ink); text-align: center; transition: background .16s ease, border-color .16s ease; }
.dropzone:hover, .dropzone.dragover { border-color: var(--green); background: #f4faf6; }
.upload-file { position: relative; width: 58px; height: 68px; display: grid; place-items: center; margin-bottom: 17px; border-radius: 8px; background: linear-gradient(145deg, #58a06f, #188447); color: white; box-shadow: 0 8px 20px rgba(23,132,71,.18); }
.upload-file::after { position: absolute; top: 0; right: 0; width: 17px; height: 17px; border-radius: 0 7px 0 5px; background: rgba(255,255,255,.38); content: ""; }
.upload-file svg { width: 25px; height: 25px; }
.drop-title { font-size: 1.08rem; font-weight: 700; }
.browse { color: var(--green-dark); text-decoration: underline; text-underline-offset: 3px; }
.drop-hint { margin-top: 7px; color: var(--muted); font-size: .82rem; }
.format-row { min-height: 25px; display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.format-pill { padding: 3px 8px; border: 1px solid var(--border); border-radius: 4px; background: white; color: #69766e; font-size: .62rem; font-weight: 700; }
.private-note { display: flex; align-items: center; gap: 6px; margin-top: 18px; color: #87938c; font-size: .67rem; }
.private-note svg { width: 13px; height: 13px; }

.queue { margin-top: 15px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.queue-head { min-height: 46px; padding: 8px 12px; display: flex; align-items: center; justify-content: space-between; background: #f8faf9; font-size: .78rem; }
.queue-head strong { margin-right: 7px; }
.queue-head span { color: var(--muted); }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 6px; background: white; color: #57645d; }
.icon-button:hover { color: #ad443d; border-color: #e5c4c1; }
.file-row { min-height: 50px; display: grid; grid-template-columns: 30px minmax(0,1fr) auto auto; align-items: center; gap: 9px; padding: 8px 12px; border-top: 1px solid var(--border); }
.file-type { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 5px; background: #f0f4f1; color: var(--green); }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; font-weight: 600; }
.file-size { color: var(--muted); font-size: .7rem; }
.remove-file { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 5px; background: transparent; color: #859088; }
.remove-file:hover { background: #f7e9e7; color: #b24740; }

.settings { margin-top: 15px; padding: 17px; border: 1px solid var(--border); border-radius: 8px; background: #fafcfa; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.section-heading h3 { margin: 0; font-size: .83rem; }
.section-heading span { color: var(--muted); font-size: .68rem; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { min-width: 0; display: grid; gap: 6px; }
.field-label { color: #4d5b53; font-size: .7rem; font-weight: 700; }
.field select { width: 100%; min-height: 39px; padding: 7px 34px 7px 10px; border: 1px solid var(--border-strong); border-radius: 6px; background: white; color: var(--ink); font-size: .78rem; }
.range-wrap { min-height: 39px; display: flex; align-items: center; gap: 10px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 6px; background: white; }
.range-wrap input { min-width: 0; flex: 1; accent-color: var(--green); }
.range-value { width: 38px; color: var(--green-dark); text-align: right; font-size: .72rem; font-weight: 700; }
.check-field { min-height: 39px; display: flex; align-items: center; gap: 9px; padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: 6px; background: white; font-size: .75rem; font-weight: 600; }
.check-field input { width: 16px; height: 16px; accent-color: var(--green); }

.action-bar { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.status { min-width: 0; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .74rem; }
.status svg { flex: 0 0 auto; width: 16px; height: 16px; }
.status.success { color: var(--green-dark); }
.status.error { color: #a53e38; }
.status.working svg { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.convert-button { min-height: 42px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 17px; border: 1px solid var(--green); border-radius: 6px; background: var(--green); color: white; font-size: .78rem; font-weight: 700; box-shadow: 0 5px 14px rgba(23,132,71,.16); }
.convert-button:hover:not(:disabled) { background: var(--green-dark); }
.convert-button:disabled { cursor: not-allowed; opacity: .45; box-shadow: none; }
.progress { height: 4px; overflow: hidden; border-radius: 3px; background: #e5ebe7; }
.progress span { width: 0; height: 100%; display: block; background: var(--green); transition: width .2s ease; }

.benefits { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 22px; border: 1px solid var(--border); border-radius: 8px; background: white; overflow: hidden; }
.benefits article { min-width: 0; display: flex; gap: 11px; padding: 17px; }
.benefits article + article { border-left: 1px solid var(--border); }
.benefits svg { flex: 0 0 auto; color: var(--coral); }
.benefits h3 { margin: 0; font-size: .76rem; }
.benefits p { margin: 3px 0 0; color: var(--muted); font-size: .68rem; }
.site-footer { border-top: 1px solid var(--border); background: white; }
.footer-inner { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--muted); font-size: .76rem; }
.footer-inner a { color: var(--ink); font-weight: 700; text-decoration: none; }
.footer-inner a:hover { color: var(--green); text-decoration: underline; }

#render-stage { position: fixed; left: -10000px; top: 0; width: 794px; background: white; pointer-events: none; }

@media (max-width: 900px) {
  .local-badge { display: none; }
  .workspace { grid-template-columns: 176px minmax(0, 1fr); }
  .converter { padding: 20px; }
  .tool-button { padding-inline: 8px; font-size: .75rem; }
  .benefits { grid-template-columns: 1fr; }
  .benefits article + article { border-left: 0; border-top: 1px solid var(--border); }
}

@media (max-width: 680px) {
  .header-inner, .footer-inner, main { width: min(100% - 28px, 1240px); }
  .header-inner { min-height: 58px; }
  .brand img { width: 96px; }
  .header-actions { gap: 9px; }
  .tools-link span { display: none; }
  main { padding: 23px 0 42px; }
  .intro { align-items: start; flex-direction: column; gap: 12px; }
  h1 { font-size: 1.9rem; }
  .intro p { font-size: .86rem; }
  .trust-line { font-size: .72rem; }
  .workspace { display: block; min-height: 0; overflow: visible; }
  .tool-sidebar { position: sticky; top: 58px; z-index: 20; border-right: 0; border-bottom: 1px solid var(--border); overflow: hidden; }
  .sidebar-title { display: none; }
  .tool-sidebar nav { padding: 8px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  .tool-sidebar nav::-webkit-scrollbar { display: none; }
  .tool-button { width: auto; min-width: max-content; min-height: 39px; padding: 5px 9px; border: 1px solid var(--border); background: white; }
  .tool-button.active::before { display: none; }
  .tool-icon { width: 26px; height: 26px; }
  .converter { padding: 15px; }
  .converter-heading { margin-bottom: 12px; }
  .converter-heading h2 { font-size: 1rem; }
  .dropzone { min-height: 235px; padding: 22px 12px; }
  .drop-title { font-size: .96rem; }
  .settings-grid { grid-template-columns: 1fr; }
  .action-bar { padding: 13px 0; align-items: stretch; flex-direction: column; }
  .convert-button { width: 100%; }
  .footer-inner { min-height: 70px; padding: 13px 0; flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
