:root {
  --bg: #0f0f13;
  --surface: #1a1a22;
  --border: #2e2e3a;
  --text: #e8e8f0;
  --text-muted: #8888aa;
  --accent: #6c63ff;
  --accent-hover: #7d75ff;
  --danger: #e05252;
  --success: #52e09a;
  --warning: #e0b852;
  --radius: 8px;
  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.screen { width: 100%; display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.screen[hidden] { display: none !important; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.container {
  width: 100%;
  max-width: 960px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 0 1rem;
}

.top-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.top-bar .timer { margin-left: auto; font-size: 0.875rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.top-bar .danger-btn { margin-left: 0.5rem; }

.logo { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; color: var(--accent); }
.logo-img { display: block; width: min(220px, 80vw); height: auto; margin: 0 auto 0.75rem; }
.logo-sm { font-size: 1.125rem; font-weight: 700; color: var(--accent); }
.tagline { color: var(--text-muted); font-size: 0.9rem; }
.greeting { color: var(--text-muted); font-size: 0.95rem; }
.status-message { color: var(--text); line-height: 1.5; }
.user-name { color: var(--text-muted); font-size: 0.875rem; }
.error { color: var(--danger); font-size: 0.875rem; }
.contact-info a { color: var(--accent); }
.divider { border: none; border-top: 1px solid var(--border); margin: 0.5rem 0; }

form { display: flex; flex-direction: column; gap: 0.75rem; }
label { font-size: 0.875rem; color: var(--text-muted); }
input, select, textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  padding: 0.625rem 0.75rem;
  width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 80px; }

button[type="submit"], button.primary-btn {
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  cursor: pointer;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.625rem 1.25rem;
}
button[type="submit"]:hover { background: var(--accent-hover); }
button[type="submit"]:disabled { opacity: 0.5; cursor: not-allowed; }

.danger-btn {
  background: transparent;
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  color: var(--danger);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.875rem;
  text-decoration: underline;
}

.category-nav { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.cat-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.875rem;
  padding: 0.375rem 0.875rem;
}
.cat-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.record-list { display: flex; flex-direction: column; gap: 0.5rem; }
.record-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
}
.record-row-meta { color: var(--text-muted); font-size: 0.8rem; margin-top: 0.2rem; }
.record-actions { display: flex; gap: 0.5rem; }
.action-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.25rem 0.625rem;
}

.value-box { background: var(--bg); border: 1px solid var(--accent); border-radius: var(--radius); padding: 1rem; }
.value-content { font-family: monospace; font-size: 0.95rem; word-break: break-all; }
.timer-inline { color: var(--warning); font-size: 0.875rem; }

.corroboration-info, .requester-info {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
}

.ceremony-participants { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.ceremony-participant {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}
.ceremony-participant.authorized { border-color: var(--success); }
.ceremony-participant-name { font-weight: 600; font-size: 0.9rem; }
.ceremony-participant-role { color: var(--text-muted); font-size: 0.8rem; }
.ceremony-status { margin-top: 0.5rem; font-size: 0.8rem; font-weight: 600; }

.update-note { color: var(--text-muted); font-size: 0.875rem; }
.update-field-row { padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.record-label { font-weight: 600; }
.corroborate-actions { display: flex; gap: 0.75rem; }

@media (max-width: 640px) {
  .ceremony-participants { grid-template-columns: 1fr; }
  .card { padding: 1.5rem 1.25rem; }
}
