* { 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;
  color: #000; /* explicit default — prevents Safari iOS white-on-white in labels */
  -webkit-appearance: none; /* reset Safari form control styling */
}
button::-moz-focus-inner {
  border: 0;
  padding: 0;
}
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: center;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #000;
  gap: 2rem;
}
.brand-link {
  text-decoration: none;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.brand-logo {
  height: 144px;
  width: auto;
  object-fit: contain;
  border-radius: 6px;
}
.nav a { margin-right: 1rem; text-decoration: none; font-weight: 600; }
.nav a:hover { text-decoration: underline; }

.container { max-width: 1400px; margin: 0 auto; padding: 1rem; }

.flashes { max-width: 1400px; 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: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.75rem;
}
.card {
  border: 1px solid #000;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.9rem;
}
.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.8rem; color: #444; }
.card .dms {
  border-top: 1px dashed #000;
  padding-top: 0.4rem;
  font-style: italic;
  font-size: 0.8rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
/* Truncated DMS snippet in gallery cards */
.card .dms-snippet {
  border-top: 1px dashed #000;
  padding-top: 0.4rem;
  font-style: italic;
  font-size: 0.8rem;
}
.view-more {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: #cc1a1a;
  text-decoration: underline;
  cursor: pointer;
}
.view-more:hover { color: #8b0000; }

/* Detail page */
.private-indicator {
  font-size: 0.85rem;
  color: #666;
  font-style: italic;
  margin-bottom: 0.75rem;
}
.detail-info p { font-size: 0.95rem; margin: 0.35rem 0; }
.detail-dms {
  margin-top: 1rem;
  padding: 1rem;
  border-left: 3px solid #cc1a1a;
  background: #fafafa;
  white-space: pre-wrap;
  word-break: break-word;
}
.back-link {
  display: inline-block;
  margin-top: 2rem;
  text-decoration: underline;
  color: #000;
}

.dot { display: inline-block; width: 10px; height: 10px; 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; }

/* Deadman email section */
.email-row {
  border: 1px solid #ccc;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: #fafafa;
}
.email-remove-btn {
  align-self: flex-start;
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
}
.email-actions {
  display: flex;
  justify-content: flex-end;
}

.terms-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-weight: 400;
  font-size: 0.85rem;
  padding-top: 0.5rem;
}
.legal-intro { max-width: 720px; }
section { margin-bottom: 1.5rem; }
section h2 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid #ccc;
  padding-bottom: 0.25rem;
}
section p { max-width: 720px; line-height: 1.6; }

@media (max-width: 600px) {
  .nav { flex-wrap: wrap; gap: 1rem; justify-content: center; }
  .brand-logo { height: 96px; }
  #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; }