:root {
  --background: #f5f6fa;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #6b7280;
  --line: #e4e7ee;
  --accent: #e53935;
  --accent-dark: #c62828;
  --success: #18794e;
  --shadow: 0 18px 50px rgba(30, 41, 59, 0.08);
}

* { 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(--text);
  background: var(--background);
}
button, input, select { font: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 5vw;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand { color: var(--text); font-size: 1.35rem; font-weight: 900; text-decoration: none; letter-spacing: -0.04em; }
.brand span { color: var(--accent); }
nav { display: flex; gap: 24px; }
nav a { color: var(--text); text-decoration: none; font-size: 0.92rem; font-weight: 650; }

main { width: min(1180px, 92vw); margin: 0 auto; padding: 72px 0; }
.hero { max-width: 820px; margin-bottom: 42px; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-size: 0.76rem; font-weight: 850; letter-spacing: 0.15em; }
h1 { margin: 0; font-size: clamp(2.2rem, 5vw, 4.4rem); line-height: 1.03; letter-spacing: -0.055em; }
.hero > p:last-child, .converter-copy > p, .privacy p { color: var(--muted); line-height: 1.7; }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.tool-card {
  display: flex;
  min-height: 155px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 18px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(30, 41, 59, 0.04);
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.tool-card:hover { transform: translateY(-2px); border-color: #cfd4df; }
.tool-card.active { border-color: rgba(229, 57, 53, 0.5); box-shadow: 0 12px 30px rgba(229, 57, 53, 0.12); }
.tool-icon { display: grid; width: 42px; height: 42px; margin-bottom: auto; place-items: center; border-radius: 12px; background: #fff0ef; color: var(--accent); font-weight: 900; }
.tool-card strong { margin-bottom: 6px; }
.tool-card small { color: var(--muted); }

.converter-panel {
  display: grid;
  grid-template-columns: .75fr 1.25fr;
  gap: 40px;
  padding: 36px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.converter-panel h2, .privacy h2 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.35rem); letter-spacing: -0.04em; }
.tool-note { margin-top: 18px; padding: 12px 14px; color: #7a4d00; background: #fff8e6; border: 1px solid #f1dfa9; border-radius: 12px; font-size: .86rem; line-height: 1.5; }
.tool-note:empty { display: none; }

.drop-zone {
  display: grid;
  min-height: 190px;
  padding: 28px;
  place-items: center;
  align-content: center;
  border: 2px dashed #cfd4df;
  border-radius: 18px;
  background: #fafbfc;
  cursor: pointer;
}
.drop-zone:hover { border-color: var(--accent); }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-title { margin-bottom: 8px; font-size: 1.1rem; font-weight: 800; }
.drop-help { color: var(--muted); text-align: center; font-size: .88rem; }

.file-list { display: grid; gap: 8px; margin: 16px 0; padding: 0; list-style: none; }
.file-list li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: .88rem; }
.file-list span:last-child { color: var(--muted); white-space: nowrap; }

.options-area { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.option-field { display: grid; gap: 7px; }
.option-field.full { grid-column: 1 / -1; }
.option-field label { font-size: .82rem; font-weight: 750; }
.option-field input, .option-field select { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.option-hint { color: var(--muted); font-size: .78rem; }

.primary-button, .download-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0 22px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: white;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
.primary-button:hover, .download-button:hover { background: var(--accent-dark); }
.primary-button:disabled { cursor: wait; opacity: .6; }

.status-box { grid-column: 2; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fafbfc; }
.status-row { display: flex; justify-content: space-between; margin-bottom: 10px; }
.progress-track { height: 10px; overflow: hidden; border-radius: 99px; background: #e8ebf1; }
.progress-bar { width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width .25s ease; }
.download-button { margin-top: 14px; background: var(--success); }
.error-text { margin: 12px 0 0; color: #b42318; }
.privacy { margin-top: 58px; padding: 32px 0; }
footer { display: flex; justify-content: space-between; padding: 28px 5vw; color: var(--muted); border-top: 1px solid var(--line); font-size: .86rem; }
.hidden { display: none !important; }

@media (max-width: 960px) {
  .tool-grid { grid-template-columns: repeat(3, 1fr); }
  .converter-panel { grid-template-columns: 1fr; }
  .status-box { grid-column: 1; }
}
@media (max-width: 680px) {
  nav { display: none; }
  main { padding-top: 44px; }
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .converter-panel { padding: 22px; }
}
@media (max-width: 440px) {
  .tool-grid { grid-template-columns: 1fr; }
  .options-area { grid-template-columns: 1fr; }
  .option-field.full { grid-column: auto; }
}
