/* Mobile-first Design */
:root {
  --bg: #12121a;
  --card: #1d1d29;
  --text: #f0f0f5;
  --muted: #9a9aad;
  --accent: #7c5cff;
  --danger: #e0526a;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  min-height: 100%;
}
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem;
}
header h1 { margin: 0; font-size: 1.4rem; letter-spacing: .02em; }
header h1 span { color: var(--accent); }
main { padding: 0 1rem 3rem; max-width: 640px; margin: 0 auto; }
.hidden { display: none !important; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.1rem;
  margin: 0 0 1rem;
}
.card h2, .card h3 { margin-top: 0; }

label { display: block; margin: 0 0 .9rem; font-size: .9rem; color: var(--muted); }
input, select {
  display: block; width: 100%; margin-top: .35rem;
  padding: .7rem .8rem; border-radius: 10px; border: 1px solid #33334a;
  background: #14141f; color: var(--text); font-size: 1rem;
}

button, .upload-btn, a.ghost {
  display: inline-block; border: 0; border-radius: 10px;
  padding: .75rem 1.1rem; font-size: 1rem; cursor: pointer;
  text-align: center; text-decoration: none;
}
.primary { background: var(--accent); color: #fff; width: 100%; }
.ghost { background: transparent; color: var(--accent); }
.danger { background: transparent; color: var(--danger); width: 100%; margin-top: .5rem; }
.error { color: var(--danger); font-size: .9rem; }
.hint { color: var(--muted); font-size: .85rem; }
.row { display: flex; gap: .5rem; margin-bottom: 1rem; }
.row .primary { flex: 1; }

.tag-list { list-style: none; margin: 0; padding: 0; }
.tag-list li {
  background: var(--card); border-radius: var(--radius);
  padding: .9rem 1.1rem; margin-bottom: .6rem;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer;
}
.tag-list .meta { color: var(--muted); font-size: .85rem; }

.qr-box { text-align: center; }
.qr-box img { width: 180px; height: 180px; background: #fff; border-radius: 10px; padding: 6px; }
.qr-actions { display: flex; justify-content: center; gap: .5rem; margin-top: .5rem; }

.image-grid {
  list-style: none; margin: 0 0 .8rem; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: .5rem;
}
.image-grid li { position: relative; aspect-ratio: 1; }
.image-grid img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.image-grid button {
  position: absolute; top: 4px; right: 4px;
  background: rgba(0,0,0,.65); color: #fff;
  border-radius: 50%; width: 26px; height: 26px; padding: 0; line-height: 1;
}

.toast {
  position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%);
  background: var(--card); color: var(--text);
  padding: .7rem 1.2rem; border-radius: 999px; box-shadow: 0 4px 20px rgba(0,0,0,.5);
  z-index: 100; max-width: 90vw;
}

.header-actions { display: flex; gap: .4rem; }

.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  color: var(--text); margin-bottom: .4rem;
}
.switch-row input { width: auto; margin: 0; }

.user-list { list-style: none; margin: 0; padding: 0; }
.user-list li {
  background: #14141f; border-radius: 10px;
  padding: .8rem .9rem; margin-bottom: .6rem;
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  flex-wrap: wrap;
}
.user-info { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.user-mail { overflow-wrap: anywhere; }
.badge {
  background: var(--accent); color: #fff; font-size: .7rem;
  padding: .1rem .5rem; border-radius: 999px; white-space: nowrap;
}
.badge.you { background: #33334a; color: var(--muted); }
.user-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.user-actions button { padding: .5rem .7rem; font-size: .85rem; }
.danger-inline { background: transparent; color: var(--danger); }

@media (min-width: 700px) {
  header h1 { font-size: 1.7rem; }
  .primary { width: auto; }
  .danger { width: auto; }
}
