:root {
  --bg: linear-gradient(135deg, #f7f4ec 0%, #e8f2f6 100%);
  --card: #ffffff;
  --text: #1c2a39;
  --muted: #5c6d7e;
  --accent: #0c7c59;
  --accent-dark: #08573e;
  --border: #d4dde6;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.container {
  max-width: 920px;
  margin: 24px auto;
  padding: 20px;
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 10px 35px rgba(15, 28, 45, 0.1);
}

h1 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.subtitle {
  margin: 8px 0 20px;
  color: var(--muted);
}

.mode-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.mode-bar select,
.password-row input,
.split-options input {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
}

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.drop-zone.dragging {
  border-color: var(--accent);
  background: #effaf5;
}

.visually-hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

button {
  border: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

button:hover {
  background: var(--accent-dark);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.secondary {
  background: #384b5d;
}

.split-options {
  margin-top: 12px;
}

.split-options label {
  display: block;
  margin-bottom: 6px;
}

.split-options.is-disabled {
  opacity: 0.55;
}

.file-list {
  margin: 16px 0;
  display: grid;
  gap: 10px;
}

.file-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: #fcfdff;
}

.file-card.drag-source {
  opacity: 0.6;
}

.file-head {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 10px;
  align-items: center;
}

.thumb-wrap {
  width: 90px;
  height: 120px;
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #f4f7fb;
  color: var(--muted);
  font-size: 0.75rem;
}

.thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-name {
  font-weight: 600;
  word-break: break-all;
}

.file-size {
  font-size: 0.85rem;
  color: var(--muted);
}

.remove-btn {
  background: #f04438;
}

.password-row {
  margin-top: 8px;
}

.password-row label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.password-row input {
  width: 100%;
}

.pages-wrap {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.page-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 6px 8px;
}

.tiny-btn {
  padding: 6px 8px;
  font-size: 0.8rem;
}

.tiny-active {
  background: #0f8a64;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.progress-wrap {
  margin-top: 16px;
}

.progress-bar {
  width: 100%;
  height: 10px;
  background: #e8edf2;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 0.2s ease;
}

.download-link {
  display: inline-block;
  margin-top: 14px;
  text-decoration: none;
  font-weight: 600;
  color: #0f5132;
}

.error {
  color: var(--danger);
  font-weight: 600;
}

@media (max-width: 640px) {
  .container {
    margin: 0;
    border-radius: 0;
    min-height: 100vh;
  }

  .file-head {
    grid-template-columns: 1fr;
  }

  .thumb-wrap {
    width: 100%;
    height: 150px;
  }

  .page-row {
    flex-wrap: wrap;
  }
}
