* { box-sizing: border-box; margin: 0; padding: 0; }

:root { --bg: #f3f2f1; --surface: #fff; --border: #b1b4b6; --text: #0b0c0c; --text-muted: #505a5f; --accent: #386193; --input-bg: #fff; --heading: #0e335b; --error: #d4351c; --file-bg: #fafafa; }
[data-theme="dark"] { --bg: #0d1117; --surface: #161b22; --border: #30363d; --text: #e6edf3; --text-muted: #8b949e; --accent: #58a6ff; --input-bg: #0d1117; --heading: #e6edf3; --error: #f85149; --file-bg: #161b22; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background 0.2s, color 0.2s;
}

header, #mast {
  background: #386193;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

#mast img, #logo { max-width: 100%; height: 60px; }

.logout-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  padding: 5px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.8em;
  transition: all 0.2s ease;
}
.logout-btn:hover { background: rgba(255,255,255,0.3); border-color: rgba(255,255,255,0.7); }

.user-bar { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.user-email { color: rgba(255,255,255,0.85); font-size: 0.85em; }

main { max-width: 800px; margin: 32px auto; padding: 0 24px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 32px;
}

.card h2 { color: var(--heading); margin-bottom: 8px; font-size: 1.3rem; }
.card p { color: var(--text-muted); margin-bottom: 16px; line-height: 1.5; }

.input-group { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.input-group label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; width: 100%; color: var(--text); }
.input-group input {
  flex: 1;
  min-width: 200px;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: 4px;
  font-size: 1rem;
  font-family: monospace;
  background: var(--input-bg);
  color: var(--text);
}
.input-group input:focus { outline: 3px solid #fd0; border-color: var(--accent); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary:hover { opacity: 0.9; }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
}
.btn-secondary:hover { opacity: 0.8; }

.error { color: var(--error); font-size: 0.9rem; margin-top: 8px; }

.files-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.meta { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 16px; }

.files-list { display: flex; flex-direction: column; gap: 12px; }

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--file-bg);
}

.file-item .file-name {
  font-weight: 500;
  word-break: break-all;
  flex: 1;
}
.file-item .file-size { color: var(--text-muted); font-size: 0.85rem; margin: 0 16px; white-space: nowrap; }

.file-actions { display: flex; gap: 8px; }
.file-actions a {
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
  text-decoration: none;
  border: 1px solid var(--accent);
  color: var(--accent);
}
.file-actions a:hover { background: var(--accent); color: #fff; }

.loading { text-align: center; padding: 24px; color: var(--text-muted); }

.theme-toggle { background:none; border:none; cursor:pointer; font-size:1.2em; padding:0 4px; line-height:1 }
.theme-toggle:hover { opacity:0.7 }
