:root {
  --bg: #eef2f6;
  --surface: #ffffff;
  --text: #152033;
  --muted: #5c6b7a;
  --accent: #1f6feb;
  --accent-dark: #1554b5;
  --danger: #c62828;
  --border: #d5dde6;
  --shadow: 0 10px 30px rgba(21, 32, 51, 0.08);
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(1200px 500px at 10% -10%, #d9e8ff 0%, transparent 55%),
    radial-gradient(900px 400px at 100% 0%, #e7f5ef 0%, transparent 50%),
    var(--bg);
  color: var(--text);
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px max(16px, env(safe-area-inset-right)) 40px max(16px, env(safe-area-inset-left));
}

.head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.site-home {
  color: inherit;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.site-home:hover,
.site-home:focus-visible {
  color: var(--ink, #1a1a1a);
  border-bottom-color: currentColor;
  outline: none;
}

h1 {
  margin: 0;
  font-size: 1.8rem;
  letter-spacing: -0.02em;
}

.sub, .hint {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 14px;
}

.card h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover { background: var(--accent-dark); }

.btn--ghost {
  background: #eef3f8;
  color: var(--text);
}

.btn--danger {
  background: rgba(198, 40, 40, 0.1);
  color: var(--danger);
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.auth-form {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.auth-form input {
  flex: 1 1 180px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
}

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  min-height: 140px;
  border: 2px dashed #b7c6d8;
  border-radius: 14px;
  background: #f7fafc;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.drop.is-over {
  border-color: var(--accent);
  background: #eaf2ff;
}

.drop__icon { font-size: 1.6rem; }
.drop__text { font-weight: 600; color: var(--accent-dark); }

.progress {
  margin-top: 12px;
  height: 8px;
  border-radius: 999px;
  background: #e5ebf2;
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.15s ease;
}

.list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fbfcfd;
}

.file-row__name {
  font-weight: 600;
  word-break: break-word;
}

.file-row__meta {
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--muted);
}

.file-row__actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.alert {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(198, 40, 40, 0.25);
  background: rgba(198, 40, 40, 0.08);
  color: var(--danger);
}

.alert.is-ok {
  border-color: rgba(31, 111, 235, 0.25);
  background: rgba(31, 111, 235, 0.08);
  color: var(--accent-dark);
}

.empty {
  margin: 8px 0 0;
  color: var(--muted);
}

@media (max-width: 560px) {
  .file-row {
    grid-template-columns: 1fr;
  }

  .file-row__actions {
    width: 100%;
  }

  .file-row__actions .btn {
    flex: 1;
  }
}
