:root {
  color-scheme: dark;
  --bg: #0d1117;
  --panel: #161b22;
  --panel-hover: #1c2128;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --primary: #58a6ff;
  --primary-strong: #1f6feb;
  --success: #3fb950;
  --danger: #f85149;
  --warning: #d29922;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #172238 0, var(--bg) 38rem);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

.shell {
  width: min(900px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 24px;
}

.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.header h1 {
  margin: 10px 0 4px;
  font-size: clamp(2.1rem, 6vw, 3.25rem);
  line-height: 1.05;
  background: linear-gradient(135deg, #79c0ff, #bc8cff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.header p, .upload-zone p, .notice { color: var(--muted); }
.owner-badge, .badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
}

.owner-badge { color: var(--primary); border: 1px solid #244a72; background: #14283d; }
.panel, .file-card {
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.login-panel { max-width: 570px; padding: 26px; margin: 70px auto; }
.login-panel h2 { margin: 0; }
.login-panel label { display: block; margin: 20px 0 7px; font-weight: 700; }
.login-row { display: flex; gap: 10px; }
.login-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 11px 13px;
  color: var(--text);
  background: var(--bg);
}
.login-row input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }

.button {
  border: 0;
  border-radius: 9px;
  padding: 10px 15px;
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s ease, filter .15s ease, opacity .15s ease;
}
.button:hover:not(:disabled) { filter: brightness(1.12); transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .45; }
.button-primary { background: var(--primary-strong); }
.button-success { background: #238636; }
.button-danger { background: #9e2f2a; }
.button-ghost { background: #272d35; border: 1px solid var(--border); }
.button-small { padding: 6px 10px; font-size: .78rem; }

.status-strip {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: .88rem;
}
.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--warning);
}
.status-dot.ok { background: var(--success); }
.status-dot.error { background: var(--danger); }

.upload-zone {
  padding: 50px 24px;
  text-align: center;
  border: 2px dashed var(--border);
  border-radius: 18px;
  background: var(--panel);
  transition: .2s ease;
}
.upload-zone:hover, .upload-zone.dragover, .upload-zone:focus-visible {
  outline: none;
  border-color: var(--primary);
  background: var(--panel-hover);
  transform: translateY(-2px);
}
.upload-zone h2 { margin: 6px 0; }
.upload-icon { font-size: 48px; }
.notice { margin: 14px 4px 34px; font-size: .88rem; }
.section { margin-top: 32px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.section-heading h2 { font-size: 1.2rem; }
.file-list { display: grid; gap: 12px; }
.file-card { padding: 16px; }
.file-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.file-name { font-weight: 700; overflow-wrap: anywhere; }
.file-meta { color: var(--muted); font-size: .8rem; margin-top: 3px; }
.badge { flex: 0 0 auto; text-transform: uppercase; letter-spacing: .03em; background: #30363d; color: var(--muted); }
.badge-receiving, .badge-drive_uploading { color: var(--primary); background: #14283d; }
.badge-completed { color: var(--success); background: #17351f; }
.badge-retryable_failed, .badge-permanent_failed { color: var(--danger); background: #3d1d1d; }
.badge-queued, .badge-retrying { color: #e3b341; background: #382d16; }
.badge-cancelled, .badge-expired { color: var(--muted); }

.progress-label { display: flex; justify-content: space-between; margin-top: 13px; color: var(--muted); font-size: .78rem; }
.progress-track { height: 7px; margin-top: 5px; overflow: hidden; border-radius: 99px; background: #30363d; }
.progress-fill { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #1f6feb, #79c0ff); transition: width .2s ease; }
.progress-fill.drive { background: linear-gradient(90deg, #8957e5, #bc8cff); }
.file-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.drive-link { color: var(--primary); font-weight: 700; text-decoration: none; font-size: .86rem; }
.drive-link:hover { text-decoration: underline; }
.message { margin: 10px 0 0; font-size: .86rem; }
.message-error { color: #ff7b72; }
.empty-state { padding: 24px; text-align: center; color: var(--muted); border: 1px dashed var(--border); border-radius: 12px; }

footer { padding: 26px 16px 42px; text-align: center; color: var(--muted); font-size: .85rem; }
footer strong { color: var(--text); }

@media (max-width: 620px) {
  .shell { width: min(100% - 22px, 900px); padding-top: 24px; }
  .header, .status-strip, .file-top { align-items: stretch; flex-direction: column; }
  .login-row { flex-direction: column; }
  .upload-zone { padding: 38px 16px; }
}
