:root {
  --bg: #0f1115;
  --panel: #171a21;
  --border: #262b36;
  --text: #e8eaf0;
  --muted: #8b93a5;
  --accent: #5b8cff;
  --accent-hover: #4577ff;
  --danger: #ff6b6b;
  --radius: 10px;
}

* { box-sizing: border-box; }

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

.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
}
.brand { color: var(--text); font-weight: 700; font-size: 18px; text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 18px; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 14px; }
.nav-links a:hover { color: var(--text); }
.inline-form { display: inline; }

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 20px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 520px;
  margin: 0 auto;
}
.card.wide { max-width: 820px; }
.card.narrow { max-width: 400px; }

h1 { margin-top: 0; font-size: 24px; }
.muted { color: var(--muted); font-size: 14px; }
.muted.small { font-size: 13px; margin-top: 20px; }

.alert { padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; }
.alert-error { background: rgba(255,107,107,0.12); color: var(--danger); border: 1px solid rgba(255,107,107,0.3); }

.dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 160px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  margin: 20px 0;
  text-align: center;
  padding: 16px;
  transition: border-color .15s, background .15s;
}
.dropzone.dragover { border-color: var(--accent); background: rgba(91,140,255,0.06); }
.dropzone input { display: none; }
#dropzoneLabel { color: var(--muted); font-size: 14px; }

.btn {
  display: inline-block;
  background: #232735;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn:hover { background: #2a2f3f; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-large { padding: 14px 24px; font-size: 16px; }
.btn-oauth { display: block; width: 100%; margin-bottom: 8px; }
.btn[disabled] { opacity: .6; cursor: default; }

.field-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.link-row { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.link-row input {
  flex: 1;
  min-width: 160px;
  background: #0d0f14;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
}
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; }

.stack-form { display: flex; flex-direction: column; gap: 14px; }
.stack-form label { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.stack-form input {
  background: #0d0f14;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
}
.stack-form .hint { font-size: 12px; color: var(--muted); }

.divider { text-align: center; color: var(--muted); font-size: 12px; margin: 18px 0; position: relative; }

.link-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 0; text-decoration: underline; }
.link-btn:hover { color: var(--text); }
.link-btn.danger { color: var(--danger); }

.row-between { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }

.file-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 12px; }
.file-table th, .file-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }
.file-table th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.file-table a { color: var(--text); text-decoration: none; }
.file-table a:hover { color: var(--accent); }
.mini-link { width: 100%; background: #0d0f14; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); padding: 5px 8px; font-size: 12px; }

/* --- upload progress --- */
.file-size-label {
  margin-top: -12px;
  margin-bottom: 4px;
  font-size: 13px;
}
.file-list-names {
  font-size: 12px;
  opacity: .8;
}
.progress-wrap {
  margin: 4px 0 16px;
}
.progress-track {
  width: 100%;
  height: 10px;
  background: #0d0f14;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .15s ease-out;
}
.progress-text {
  margin-top: 6px;
  font-size: 13px;
}

/* --- multi-file upload success list --- */
.uploaded-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.uploaded-item:last-of-type {
  border-bottom: none;
}

/* --- responsive "Downloads" column label: full word on desktop, "D" on mobile --- */
.short-label { display: none; }

/* --- mobile layout for the dashboard ("My files") table --- */
@media (max-width: 700px) {
  .container {
    padding: 20px 0;
  }
  .card.wide {
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    padding: 20px 10px;
  }
  .row-between {
    padding: 0 6px;
  }
  .table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .file-table {
    font-size: 12.5px;
  }
  .file-table th,
  .file-table td {
    padding: 8px 5px;
    white-space: nowrap;
  }
  .full-label { display: none; }
  .short-label { display: inline; }
}
