:root {
  --pad: 16px;
  --gap: 12px;
  --radius: 14px;
  --font: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: #0f172a;
  color: #e2e8f0;
}

.container { padding: var(--pad); max-width: 900px; margin: 0 auto; }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: var(--pad);
}

.link { color: #93c5fd; text-decoration: none; font-weight: 600; }
.link:hover { text-decoration: underline; }

.card {
  background: #111827; border-radius: var(--radius); padding: var(--pad);
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
}

.centered { max-width: 420px; margin: 10vh auto 0; }

.form { display: grid; gap: var(--gap); }
label { font-size: 1.1rem; }
input[type="password"], input[type="text"] {
  font-size: 1.2rem; padding: 14px; border-radius: 12px; border: 1px solid #334155;
  background: #0b1220; color: #e2e8f0;
}
button {
  font-size: 1.2rem; padding: 14px 18px; border-radius: 12px; border: 0;
  background: #2563eb; color: white; font-weight: 700;
}
button:disabled { opacity: .5; }

.error { color: #fca5a5; margin: 6px 0 0; }

.grid-portal {
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(4, 1fr);
  gap: var(--gap); min-height: calc(100vh - 140px);
}

.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #111827; color: #e5e7eb; border-radius: 18px; text-decoration: none;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.tile:hover { outline: 2px solid #2563eb44; }
.tile-icon { font-size: 2.2rem; margin-bottom: 8px; }
.tile-title { font-size: 1.2rem; font-weight: 700; }
.placeholder { opacity: .2; }

.picker input[type="file"] {
  width: 100%;
  font-size: 1.1rem;
  padding: 12px;
  background: #0b1220;
  border: 1px dashed #334155;
  border-radius: 12px;
  color: #93c5fd;
}

.thumbs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: var(--pad);
}
.thumb {
  position: relative; border-radius: 12px; overflow: hidden; background: #0b1220;
  border: 2px solid transparent;
}
.thumb.selected { border-color: #2563eb; }
.thumb img { display: block; width: 100%; height: auto; }
.thumb .meta {
  position: absolute; left: 6px; bottom: 6px; font-size: .75rem; background: rgba(0,0,0,.5);
  padding: 2px 6px; border-radius: 8px;
}

.floating-btn {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 1000;
  padding: 16px 22px;
  font-size: 1.2rem;
  border-radius: 999px;
  background: #10b981;
  color: #052e1a;
  border: 0;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}

.progress-panel {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%);
  width: min(700px, 92vw);
  background: #111827; border-radius: 14px; padding: 12px 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
}
.hidden { display: none; }
progress { width: 100%; height: 16px; }
.note { opacity: .8; font-size: .9rem; }
