* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: #ffffff;
  color: #000000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

a { color: #000; }
button { font: inherit; cursor: pointer; background: #fff; border: 1px solid #000; padding: 0.4rem 0.9rem; }
button:hover { background: #000; color: #fff; }
button.danger { border-color: #c00; color: #c00; }
button.danger:hover { background: #c00; color: #fff; }

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #000;
  gap: 0.5rem;
}
.nav a { margin-right: 1rem; text-decoration: none; font-weight: 600; }
.nav a:hover { text-decoration: underline; }

.container { max-width: 1100px; margin: 0 auto; padding: 1rem; }

.flashes { max-width: 1100px; margin: 0.5rem auto 0; padding: 0 1rem; }
.flash { border: 1px solid #000; padding: 0.5rem 0.75rem; margin-bottom: 0.5rem; }
.flash-error { border-color: #c00; }
.flash-success { border-color: #080; }

/* Gallery */
.gallery-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
#search-input { width: 320px; max-width: 100%; padding: 0.5rem; border: 1px solid #000; }
.status-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.status-filters button.active { background: #000; color: #fff; }

.gallery { display: flex; flex-wrap: wrap; gap: 1rem; }
.card {
  flex: 1 1 250px;
  max-width: 350px;
  border: 1px solid #000;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.card .meta { display: flex; align-items: center; gap: 0.5rem; }
.card .name { font-weight: 700; overflow-wrap: anywhere; }
.card .last-seen { font-size: 0.85rem; color: #444; }
.card .dms {
  border-top: 1px dashed #000;
  padding-top: 0.5rem;
  font-style: italic;
  font-size: 0.9rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.dot-green { background: #1a9c1a; }
.dot-yellow { background: #d4b400; }
.dot-red { background: #cc1a1a; }

.loading, .empty { text-align: center; padding: 1.5rem; color: #444; }

/* Forms */
.form { display: flex; flex-direction: column; gap: 1rem; max-width: 480px; }
.form label { display: flex; flex-direction: column; gap: 0.25rem; font-weight: 600; }
.form input[type="text"], .form input[type="date"], .form textarea {
  padding: 0.5rem; border: 1px solid #000; font: inherit;
}
.form fieldset { border: 1px solid #000; padding: 0.75rem; display: flex; flex-wrap: wrap; gap: 1rem; }
.form fieldset label { flex-direction: row; align-items: center; gap: 0.4rem; font-weight: 400; }
.hint { font-size: 0.85rem; color: #444; font-weight: 400; }

/* Token display */
.token-box { border: 2px solid #000; padding: 1.5rem; margin: 1.5rem 0; text-align: center; }
.token { font-size: 2.2rem; font-weight: 800; letter-spacing: 0.1em; font-family: ui-monospace, Menlo, Consolas, monospace; }
.warning { margin: 1rem 0; }
.token-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

.success-box { border: 1px solid #080; padding: 1rem; max-width: 480px; }
.stats { list-style: none; }
.stats li { padding: 0.4rem 0; display: flex; align-items: center; gap: 0.5rem; }

hr { border: none; border-top: 1px solid #000; margin: 1.5rem 0; }

@media (max-width: 600px) {
  .nav { flex-direction: column; align-items: flex-start; }
  #search-input { width: 100%; }
}

.lang-bar {
  direction: ltr;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  padding: 0.4rem 1rem;
  border-bottom: 1px solid #000;
  font-size: 0.85rem;
}
.lang-bar a { text-decoration: none; }
.lang-bar a.active { font-weight: 800; text-decoration: underline; }
.about { max-width: 640px; }
.about p { margin-bottom: 1rem; }