*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0f0f0f;
  color: #e0e0e0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* nav */
.nav {
  width: 100%;
  background: #141414;
  border-bottom: 1px solid #222;
}
.nav-inner {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
}
.nav-brand {
  font-size: .95rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}
.nav-tabs {
  display: flex;
  gap: 4px;
}
.nav-tab {
  background: none;
  border: none;
  color: #888;
  font-size: .82rem;
  padding: 7px 14px;
  border-radius: 7px;
  cursor: pointer;
  transition: color .2s, background .2s;
  font-weight: 500;
  white-space: nowrap;
}
.nav-tab:hover { color: #ccc; background: rgba(255,255,255,.04); }
.nav-tab.active {
  color: #fff;
  background: rgba(124,92,252,.18);
}

/* pages */
.page {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  padding: 32px 20px;
}
.page.hidden { display: none; }
.container {
  width: 100%;
  max-width: 520px;
}
h1 {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #fff;
}
.subtitle {
  text-align: center;
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 28px;
}

/* drop zone */
.drop-zone {
  border: 2px dashed #444;
  border-radius: 12px;
  padding: 48px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  position: relative;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: #7c5cfc;
  background: rgba(124,92,252,.06);
}
.drop-zone-icon {
  font-size: 2.4rem;
  margin-bottom: 10px;
}
.drop-zone p { color: #aaa; font-size: .9rem; }
.drop-zone .highlight { color: #7c5cfc; font-weight: 500; }
input[type="file"] { display: none; }

/* file list */
.file-list {
  display: none;
  margin-top: 16px;
  border-radius: 10px;
  overflow: hidden;
}
.file-list.show { display: block; }
.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #1a1a1a;
  padding: 12px 16px;
  border-bottom: 1px solid #252525;
  transition: background .2s;
}
.file-item:first-child { border-radius: 10px 10px 0 0; }
.file-item:last-child { border-radius: 0 0 10px 10px; border-bottom: none; }
.file-item:only-child { border-radius: 10px; }
.file-item:hover { background: #1e1e1e; }
.file-icon { font-size: 1.3rem; flex-shrink: 0; }
.file-detail { flex: 1; min-width: 0; }
.file-name { font-weight: 500; font-size: .85rem; color: #ddd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-status { font-size: .75rem; margin-top: 2px; }
.file-status.pending  { color: #777; }
.file-status.progress { color: #b59eff; }
.file-status.done     { color: #4ade80; }
.file-status.error    { color: #f87171; }
.file-actions { flex-shrink: 0; display: flex; gap: 6px; align-items: center; }
.file-remove {
  background: none; border: none; color: #555; cursor: pointer;
  font-size: 1.1rem; padding: 4px 8px; border-radius: 6px; transition: color .2s;
}
.file-remove:hover { color: #f55; }
.file-dl {
  display: none;
  background: #22c55e; color: #000; border: none;
  padding: 5px 10px; border-radius: 6px; font-size: .78rem;
  font-weight: 600; cursor: pointer; transition: opacity .2s;
}
.file-dl.show { display: inline-block; }
.file-dl:hover { opacity: .85; }

/* status bar */
.status {
  display: none;
  margin-top: 14px;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: .85rem;
  text-align: center;
}
.status.info    { display: block; background: rgba(124,92,252,.12); color: #b59eff; }
.status.success { display: block; background: rgba(34,197,94,.12);  color: #4ade80; }
.status.error   { display: block; background: rgba(239,68,68,.12);  color: #f87171; }

/* buttons */
.btn {
  display: none;
  width: 100%;
  margin-top: 14px;
  padding: 12px;
  border: none;
  border-radius: 10px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s;
}
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-convert { background: #7c5cfc; color: #fff; }
.btn-convert:hover:not(:disabled) { opacity: .85; }
.btn-download-all { background: #22c55e; color: #000; }
.btn-download-all:hover:not(:disabled) { opacity: .85; }

.footer { text-align: center; margin-top: 32px; font-size: .75rem; color: #555; }

/* split page specific */
.split-summary {
  display: none;
  margin-top: 14px;
  padding: 12px 16px;
  background: rgba(124,92,252,.08);
  border-radius: 8px;
  font-size: .85rem;
  text-align: center;
  color: #b59eff;
  line-height: 1.6;
}
.split-summary.show { display: block; }
.split-summary strong { color: #fff; }

.split-settings {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  justify-content: center;
}
.split-settings label {
  font-size: .8rem;
  color: #999;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: default;
}
.split-settings input {
  width: 56px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 6px;
  color: #e0e0e0;
  padding: 6px 8px;
  font-size: .85rem;
  text-align: center;
  font-family: inherit;
}
.split-settings input:focus {
  border-color: #7c5cfc;
  outline: none;
}
