*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface2: #f4f4f5;
  --border: #e4e4e7;
  --accent: #e11d48;       /* red — PDF brand color */
  --accent2: #0ea5e9;
  --accent-light: #fff1f2;
  --success: #16a34a;
  --text: #18181b;
  --muted: #71717a;
  --label: #52525b;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

/* NAV */
nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}
.nav-logo { font-size: 18px; font-weight: 700; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.nav-logo .pdf-icon { background: var(--accent); color: #fff; padding: 2px 7px; border-radius: 6px; font-size: 13px; font-weight: 800; }
.nav-links { margin-left: auto; display: flex; gap: 20px; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 14px; }
.nav-links a:hover { color: var(--text); }

/* CONTAINER */
.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* HOME HEADER */
.page-header { text-align: center; padding: 52px 0 36px; }
.page-header h1 { font-size: clamp(24px, 4vw, 38px); font-weight: 800; margin-bottom: 10px; }
.page-header h1 span { color: var(--accent); }
.page-header p { color: var(--muted); font-size: 16px; max-width: 520px; margin: 0 auto; }

/* TOOLS GRID */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  padding-bottom: 60px;
}
.tool-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 18px;
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s, transform .15s;
  display: block;
}
.tool-item:hover { border-color: var(--accent); box-shadow: 0 4px 16px rgba(225,29,72,.08); transform: translateY(-2px); }
.tool-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 12px; }
.tool-item-title { font-weight: 700; font-size: 14px; margin-bottom: 5px; }
.tool-item-desc { color: var(--muted); font-size: 12px; line-height: 1.5; }

/* TOOL PAGE */
.tool-page { max-width: 640px; margin: 0 auto; padding: 36px 0 80px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 13px; margin-bottom: 24px; }
.back-link:hover { color: var(--accent); }
.tool-title { font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.tool-desc { color: var(--muted); font-size: 14px; margin-bottom: 28px; }

/* DROP ZONE */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  background: var(--surface);
  position: relative;
}
.dropzone:hover, .dropzone.drag-over { border-color: var(--accent); background: var(--accent-light); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone-icon { font-size: 40px; margin-bottom: 12px; }
.dropzone-text { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.dropzone-sub { font-size: 13px; color: var(--muted); }
.dropzone-limit { margin-top: 8px; font-size: 11px; color: var(--muted); background: var(--surface2); display: inline-block; padding: 2px 8px; border-radius: 10px; }

/* FILE LIST */
.file-list { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.file-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.file-item-icon { font-size: 20px; flex-shrink: 0; }
.file-item-name { flex: 1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item-size { color: var(--muted); flex-shrink: 0; }
.file-item-remove { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 18px; flex-shrink: 0; line-height: 1; }
.file-item-remove:hover { color: var(--accent); }
.drag-handle { color: var(--muted); cursor: grab; }

/* ACTIONS */
.action-bar { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }
.btn { padding: 11px 22px; border: none; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .15s; display: inline-flex; align-items: center; gap: 6px; }
.btn-red { background: var(--accent); color: #fff; }
.btn-red:hover { background: #be123c; }
.btn-gray { background: var(--surface2); color: var(--label); border: 1px solid var(--border); }
.btn-gray:hover { background: var(--border); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* PROGRESS */
.progress-wrap { margin-top: 16px; display: none; }
.progress-wrap.show { display: block; }
.progress-bar { height: 6px; border-radius: 10px; background: var(--border); overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 10px; transition: width .3s; width: 0%; }
.progress-label { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* RESULT */
.result-box { margin-top: 16px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 12px; padding: 16px 20px; display: none; align-items: center; gap: 14px; }
.result-box.show { display: flex; }
.result-info { flex: 1; }
.result-info strong { font-size: 14px; color: var(--success); }
.result-info p { font-size: 12px; color: #166534; margin-top: 2px; }
.btn-download { background: var(--success); color: #fff; }
.btn-download:hover { background: #15803d; }

/* TIPS */
.tips { margin-top: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; }
.tips h3 { font-size: 13px; font-weight: 600; color: var(--label); margin-bottom: 10px; }
.tips ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.tips li { font-size: 13px; color: var(--muted); padding-left: 16px; position: relative; }
.tips li::before { content: "→"; position: absolute; left: 0; color: var(--accent); }

/* SEO CONTENT */
.seo-content { margin-top: 36px; font-size: 14px; line-height: 1.8; color: var(--muted); }
.seo-content h2 { font-size: 18px; color: var(--text); font-weight: 700; margin: 24px 0 10px; }
.seo-content h2:first-child { margin-top: 0; }
.seo-content p, .seo-content li { margin-bottom: 6px; }
.seo-content ul, .seo-content ol { padding-left: 20px; }
.seo-content strong { color: var(--text); }
.related-links { margin-top: 20px; font-size: 13px; }
.related-links a { color: var(--accent); text-decoration: none; margin-right: 16px; }
.related-links a:hover { text-decoration: underline; }

/* SECURITY NOTE */
.security { margin-top: 16px; font-size: 12px; color: var(--muted); display: flex; align-items: flex-start; gap: 8px; }
.security span:first-child { flex-shrink: 0; }

/* FOOTER */
footer { border-top: 1px solid var(--border); padding: 24px 20px; text-align: center; color: var(--muted); font-size: 12px; background: var(--surface); }

@media (max-width: 600px) { .tool-page { padding: 20px 0 60px; } .tools-grid { grid-template-columns: 1fr 1fr; } }
