:root {
  --color-bg: #f5f6f8;
  --color-surface: #ffffff;
  --color-border: #e1e4e8;
  --color-text: #1f2328;
  --color-text-muted: #6b7280;
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-success: #16a34a;
  --color-error: #dc2626;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.page-header h1 {
  font-size: 24px;
  margin: 0 0 4px;
}

.subtitle {
  color: var(--color-text-muted);
  margin: 0 0 24px;
  font-size: 14px;
}

.login-section {
  margin-bottom: 24px;
}

.login-form,
.upload-form {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
}

.password-field {
  display: flex;
  gap: 8px;
}

.password-field input {
  flex: 1;
}

.link-button {
  flex-shrink: 0;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
  background: #eef2ff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
}

.link-button:hover {
  background: #dce4fd;
}

.form-hint {
  color: var(--color-text-muted);
  font-size: 13px;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}

.field input[type='range'] {
  width: 100%;
}

.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 28px 16px;
  text-align: center;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone-active {
  border-color: var(--color-primary);
  background: #eef2ff;
}

.dropzone-text {
  margin: 0;
  font-size: 14px;
  color: var(--color-text-muted);
  pointer-events: none;
}

.dropzone-link {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: underline;
}

.dropzone-selected {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text);
  line-height: 1.5;
  word-break: break-word;
  pointer-events: none;
}

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

.dropzone-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.hint {
  color: var(--color-text-muted);
  font-size: 12px;
  margin: 6px 0 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
}

.btn-secondary {
  background: #eef2ff;
  color: var(--color-primary);
}

.btn-small {
  padding: 6px 12px;
  font-size: 13px;
  background: var(--color-success);
  color: #fff;
}

.error-text {
  color: var(--color-error);
  font-size: 14px;
  margin: 12px 0 0;
}

.file-list-section {
  margin-top: 24px;
}

.file-list-section h2 {
  font-size: 16px;
  margin: 0 0 12px;
}

.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-row {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.file-row-main {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.file-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  color: var(--color-text-muted);
  white-space: nowrap;
}

.file-row-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--color-border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--color-primary);
  transition: width 0.2s ease;
}

.progress-bar-fill.indeterminate {
  background: repeating-linear-gradient(
    45deg,
    var(--color-primary),
    var(--color-primary) 10px,
    var(--color-primary-hover) 10px,
    var(--color-primary-hover) 20px
  );
  background-size: 200% 100%;
  animation: progress-stripes 1s linear infinite;
}

@keyframes progress-stripes {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 28px 0;
  }
}

.file-status {
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.file-status.status-error {
  color: var(--color-error);
}

.file-status.status-success {
  color: var(--color-success);
}

.action-row {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.merge-label {
  font-size: 14px;
  color: var(--color-text-muted);
}
