/* CircuitNotion Dataset Collector UI */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-muted: #f4f4f5;
  --surface-hover: #f1f5f9;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --muted: #71717a;
  --text: #18181b;
  --text-soft: #52525b;
  --accent: #047857;
  --accent-hover: #065f46;
  --accent-soft: #ecfdf5;
  --accent-ring: rgba(4, 120, 87, 0.22);
  --error: #b91c1c;
  --error-bg: #fef2f2;
  --radius: 8px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-card: 0 8px 24px rgba(15, 23, 42, 0.06);
  --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
}

body,
button,
input,
textarea {
  font-family: var(--font-sans);
}

[hidden] {
  display: none !important;
}

a {
  color: var(--accent);
}

.container {
  width: calc(100% - 2rem);
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.narrow-container {
  max-width: 560px;
}

.container-wide {
  max-width: 1180px;
}

.data-access-notice {
  width: 100%;
  max-width: 760px;
  margin: 0 auto 1.5rem;
  padding: 0.8rem 1rem;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  line-height: 1.55;
  text-align: center;
}

.data-access-notice a,
.site-footer a,
.panel-intro a,
.callback-help a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), color var(--transition);
}

.data-access-notice a:hover,
.site-footer a:hover,
.panel-intro a:hover,
.callback-help a:hover {
  color: var(--accent-hover);
  border-bottom-color: currentColor;
}

.header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1.75rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.header-eyebrow {
  margin-bottom: 0.7rem;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.header h1 {
  width: 100%;
  max-width: 760px;
  margin-bottom: 0.7rem;
  color: var(--text);
  font-size: clamp(1.65rem, 4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.18;
  overflow-wrap: break-word;
}

.header-lede {
  width: 100%;
  max-width: 620px;
  margin: 0 auto 1rem;
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.65;
}

.header .badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.35rem 0.75rem;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(4, 120, 87, 0.18);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  margin-top: 1rem;
}

.btn-submit,
.btn-secondary,
.btn-ghost,
a.btn-earn,
a.btn-earn:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-xs);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
  max-width: 100%;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition), color var(--transition), filter var(--transition), transform 0.12s ease;
}

.btn-submit,
a.btn-earn,
a.btn-earn:visited {
  color: #ffffff;
  background: var(--accent);
  border: 1px solid var(--accent);
  box-shadow: 0 1px 2px rgba(4, 120, 87, 0.18);
  cursor: pointer;
}

.btn-submit {
  width: 100%;
}

.btn-submit:hover,
a.btn-earn:hover,
a.btn-earn:active,
a.btn-earn:focus {
  color: #ffffff;
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-submit:active,
a.btn-earn:active {
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  filter: none;
  transform: none;
}

.btn-secondary,
.btn-ghost {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  cursor: pointer;
}

.btn-secondary:hover,
.btn-ghost:hover {
  color: var(--text);
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.btn-submit:focus-visible,
.btn-secondary:focus-visible,
.btn-ghost:focus-visible,
.btn-earn:focus-visible,
.nav-tab:focus-visible,
.text-link:focus-visible {
  outline: 3px solid var(--accent-ring);
  outline-offset: 2px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text-soft);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
}

.text-link:hover {
  color: var(--accent-hover);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 1.25rem;
  align-items: start;
}

.contributor-grid {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
}

.submission-column,
.summary-column {
  min-width: 0;
}

.summary-column {
  display: grid;
  gap: 1rem;
}

.summary-column > .form-card,
.summary-column > .table-section {
  margin-bottom: 0;
}

@media (min-width: 900px) {
  .summary-column {
    position: sticky;
    top: 1rem;
  }
}

.nav-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 4px;
  margin-bottom: 1rem;
  padding: 4px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 0;
}

.nav-tab {
  min-width: 0;
  min-height: 42px;
  padding: 0.6rem 0.7rem;
  color: var(--text-soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
}

.nav-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
}

.nav-tab.active {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.contributor-panel {
  display: none;
}

.contributor-panel.active {
  display: block;
}

.form-card,
.table-section {
  min-width: 0;
  margin-bottom: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.form-card {
  padding: 1.5rem;
}

.form-card h2,
.stats-section h2 {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.35;
}

.form-card h2 {
  margin-bottom: 1.15rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.panel-intro {
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
  color: var(--text-soft);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-xs);
  font-size: 0.875rem;
  line-height: 1.65;
}

.panel-intro strong {
  color: var(--text);
  font-weight: 700;
}

.panel-intro code {
  padding: 0.05rem 0.22rem;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.82em;
}

.turn-block {
  padding: 1.25rem 0 0;
  margin-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.turn-block:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.turn-title {
  margin-bottom: 0.85rem;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group:last-of-type {
  margin-bottom: 1.15rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field-help {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.form-group input:not([type="file"]),
.form-group textarea {
  width: 100%;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.55;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.form-group input:not([type="file"]) {
  min-height: 46px;
  padding: 0.78rem 0.9rem;
}

.form-group textarea {
  min-height: 112px;
  padding: 0.8rem 0.9rem;
  resize: vertical;
}

.textarea-tall,
.form-group textarea.textarea-tall {
  min-height: 220px;
}

.form-group textarea#answer,
.form-group textarea#paid-answer {
  min-height: 136px;
}

.form-group input[type="file"] {
  width: 100%;
  padding: 0.75rem;
  color: var(--text-soft);
  background: #ffffff;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-xs);
  font-family: var(--font-sans);
  font-size: 0.875rem;
}

.form-group input[type="file"]::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.48rem 0.7rem;
  color: var(--text);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-family: var(--font-sans);
  font-weight: 700;
  cursor: pointer;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--muted);
  opacity: 0.72;
}

.form-group input:hover,
.form-group textarea:hover {
  border-color: var(--muted);
}

.form-group input:not([type="file"]):focus,
.form-group textarea:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.message {
  display: none;
  margin-bottom: 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.5;
}

.message.show {
  display: block;
}

.message.success {
  color: var(--accent-hover);
  background: var(--accent-soft);
  border-color: rgba(4, 120, 87, 0.22);
}

.message.error {
  color: var(--error);
  background: var(--error-bg);
  border-color: rgba(185, 28, 28, 0.2);
}

#global-message:not(.show),
#contributor-message:not(.show) {
  display: none;
}

.stats-section {
  overflow: hidden;
}

.stats-section .stats-section-head {
  padding: 1.2rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}

.stats-section h2 {
  margin-bottom: 0.3rem;
}

.stats-section-sub {
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 1px;
  background: var(--border);
}

.summary-column .stats-row {
  grid-template-columns: 1fr;
}

.stat-card {
  display: flex;
  min-height: 92px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 1rem 0.75rem;
  background: var(--surface);
  text-align: center;
}

.stat-value {
  color: var(--text);
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  max-width: 9rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.35;
  text-transform: uppercase;
}

.auth-gate-card {
  max-width: 720px;
  margin-right: auto;
  margin-left: auto;
}

.profile-card {
  margin-bottom: 1rem;
}

.profile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.profile-head h2 {
  margin-bottom: 0.35rem;
  padding-bottom: 0;
  border-bottom: none;
}

.profile-kicker {
  margin-bottom: 0.4rem;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-meta {
  color: var(--text-soft);
  font-size: 0.875rem;
}

.status-pill {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  min-height: 32px;
  padding: 0.38rem 0.7rem;
  color: var(--text-soft);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.status-pill.is-active {
  color: var(--accent-hover);
  background: var(--accent-soft);
  border-color: rgba(4, 120, 87, 0.22);
}

.form-grid {
  display: grid;
  gap: 1rem;
}

.toggle-card {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 1rem;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  cursor: pointer;
}

.toggle-card input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.toggle-card strong {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--text);
  font-size: 0.9rem;
}

.toggle-card small {
  display: block;
  color: var(--text-soft);
  font-size: 0.8125rem;
  line-height: 1.55;
}

.earnings-card h2 {
  margin-bottom: 0.75rem;
}

.balance-hero {
  margin-bottom: 1rem;
  padding: 1.1rem 1rem;
  background: var(--accent-soft);
  border: 1px solid rgba(4, 120, 87, 0.18);
  border-radius: var(--radius-xs);
  text-align: center;
}

.balance-label {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--accent-hover);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.balance-amount {
  color: var(--accent-hover);
  font-size: clamp(1.55rem, 4vw, 2.1rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.earnings-row {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
}

.withdraw-box {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
}

.withdraw-box h3 {
  margin-bottom: 0.4rem;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
}

.withdraw-box p {
  margin-bottom: 0.85rem;
  color: var(--text-soft);
  font-size: 0.875rem;
  line-height: 1.6;
}

.withdraw-phone {
  width: 100%;
}

.rejected-card h2 {
  margin-bottom: 0.5rem;
}

.rejected-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rejected-item {
  padding: 0.85rem 1rem;
  background: var(--error-bg);
  border: 1px solid rgba(220, 38, 38, 0.18);
  border-radius: var(--radius-xs);
}

.rejected-item-type {
  margin-bottom: 0.35rem;
  color: var(--error);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rejected-item-summary {
  margin-bottom: 0.35rem;
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.5;
}

.rejected-item-reason {
  margin-bottom: 0.2rem;
  color: var(--text-soft);
  font-size: 0.8125rem;
  font-weight: 600;
}

.rejected-item-when {
  color: var(--muted);
  font-size: 0.75rem;
}

.callback-card {
  text-align: center;
}

.callback-card h1 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
  letter-spacing: 0;
}

.callback-card .panel-intro {
  text-align: left;
}

.spinner {
  width: 44px;
  height: 44px;
  margin: 1.5rem auto 1rem;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.callback-help {
  color: var(--text-soft);
  font-size: 0.875rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.site-footer {
  max-width: 760px;
  margin: 1.75rem auto 0;
  padding: 1.2rem 1rem;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  line-height: 1.6;
  text-align: center;
}

/* Legacy table styles kept for compatibility with older views. */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th {
  padding: 0.75rem 1.5rem;
  color: var(--text-soft);
  background: var(--surface-muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
}

td {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  vertical-align: top;
}

tr:hover td {
  background: var(--surface-hover);
}

td.question {
  max-width: 320px;
  color: var(--text);
  font-weight: 600;
}

td.answer {
  max-width: 380px;
  color: var(--text-soft);
  font-size: 0.875rem;
}

td.timestamp {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  white-space: nowrap;
}

.empty-state {
  padding: 2.5rem 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.empty-state p {
  margin-bottom: 0.5rem;
}

.refresh-wrap {
  padding: 0.75rem 1.5rem;
  background: var(--surface-muted);
  border-top: 1px solid var(--border);
}

.btn-refresh {
  padding: 0.4rem 0.75rem;
  color: var(--text-soft);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.btn-refresh:hover {
  color: var(--accent-hover);
  background: var(--surface);
  border-color: var(--accent);
}

.loading {
  opacity: 0.7;
  pointer-events: none;
}

@media (max-width: 900px) {
  .workspace-grid,
  .contributor-grid {
    grid-template-columns: 1fr;
  }

  .summary-column {
    position: static;
  }

  .summary-column .stats-row {
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  }
}

@media (max-width: 640px) {
  .container,
  .narrow-container {
    width: calc(100% - 1.5rem);
    max-width: 1120px;
    padding: 1.25rem 0 2.25rem;
  }

  .narrow-container {
    max-width: 560px;
  }

  .header {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-secondary,
  .btn-ghost,
  .btn-earn,
  .text-link {
    width: 100%;
  }

  .text-link {
    justify-content: center;
  }

  .form-card {
    padding: 1.2rem 1rem;
  }

  .profile-head {
    flex-direction: column;
  }

  .status-pill {
    align-self: flex-start;
  }

  .stats-row,
  .summary-column .stats-row {
    grid-template-columns: 1fr;
  }

  .stat-card {
    min-height: 76px;
    flex-direction: row;
    justify-content: space-between;
    padding: 0.95rem 1rem;
    text-align: left;
  }

  .stat-label {
    max-width: 12rem;
    text-align: right;
  }

  th,
  td {
    padding: 0.75rem 1rem;
  }

  td.question,
  td.answer {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 420px) {
  .nav-tabs {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.admin-summary-card {
  margin-bottom: 1.25rem;
}

.admin-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.admin-summary-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
}

.admin-summary-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.admin-summary-value {
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.admin-summary-email {
  font-size: 0.95rem;
  font-weight: 600;
  word-break: break-all;
}

.admin-table-section .table-wrapper {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.admin-table th,
.admin-table td {
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.admin-row {
  cursor: pointer;
}

.admin-row:hover td {
  background: var(--surface-hover);
}

.admin-detail-card {
  margin-top: 1.25rem;
}

.admin-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-detail-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.admin-detail-stats-grid div {
  padding: 0.85rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
}

.admin-detail-stats-grid span {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.admin-submission-group {
  margin-top: 1.25rem;
}

.admin-submission-group h3 {
  margin-bottom: 0.75rem;
  font-size: 1rem;
  font-weight: 700;
}

.admin-submission-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-submission-card {
  padding: 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
}

.admin-submission-card.is-rejected {
  border-color: rgba(220, 38, 38, 0.25);
  background: var(--error-bg);
}

.admin-submission-card.is-selected {
  border-color: rgba(5, 150, 105, 0.55);
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.18);
  background: rgba(5, 150, 105, 0.06);
  cursor: pointer;
}

.admin-submission-card {
  cursor: default;
}

.admin-select-hint {
  margin-bottom: 0.75rem;
}

.admin-bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
}

.admin-bulk-bar span {
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
}

.admin-submission-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
  margin-bottom: 0.65rem;
}

.admin-submission-type,
.admin-submission-status,
.admin-submission-payment {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.admin-submission-status {
  color: var(--text-soft);
}

.admin-submission-payment {
  color: var(--accent-muted);
}

.admin-submission-payment.is-payable {
  color: #047857;
  font-weight: 700;
}

.admin-submission-preview {
  margin-bottom: 0.5rem;
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-open-book {
  display: inline-flex;
  margin-top: 0.35rem;
}

.admin-json-details {
  margin-top: 0.75rem;
}

.admin-json-details summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 600;
}

.admin-json-details pre {
  margin-top: 0.5rem;
  padding: 0.75rem;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.5;
}

.message-thread {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 360px;
  margin: 0 0 1rem;
  padding: 0.85rem;
  overflow: auto;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
}

.message-thread-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.message-bubble {
  max-width: 92%;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--surface);
}

.message-bubble.is-mine {
  align-self: flex-end;
  background: rgba(5, 150, 105, 0.08);
  border-color: rgba(5, 150, 105, 0.18);
}

.message-bubble.is-theirs {
  align-self: flex-start;
}

.message-bubble.is-unread {
  box-shadow: inset 3px 0 0 #059669;
}

.message-bubble-label {
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.message-bubble-text {
  margin-bottom: 0.35rem;
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 0.875rem;
}

.message-bubble-meta {
  color: var(--muted);
  font-size: 0.72rem;
}

.messages-card,
.admin-inbox-card {
  margin-bottom: 1.25rem;
}

.contributor-message-form {
  margin-top: 0.5rem;
}

.notification-panel-compose {
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--border);
}

.admin-inbox-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-inbox-open {
  width: 100%;
  padding: 0.85rem 1rem;
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  cursor: pointer;
}

.admin-inbox-open:hover,
.admin-inbox-open:focus-visible {
  border-color: rgba(5, 150, 105, 0.35);
}

.admin-inbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.admin-inbox-unread {
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
}

.admin-inbox-preview,
.admin-inbox-when {
  display: block;
  color: var(--muted);
  font-size: 0.8125rem;
}

.admin-inbox-preview {
  margin-bottom: 0.2rem;
  line-height: 1.45;
}

.admin-thread {
  max-height: 320px;
}

.admin-broadcast-card {
  margin-bottom: 1.25rem;
}

.admin-broadcast-card h2 {
  margin-bottom: 0.35rem;
}

.admin-broadcast-form.admin-message-compose {
  margin-bottom: 0;
  padding-top: 0.75rem;
  border-top: none;
}

.admin-message-compose {
  margin: 1.25rem 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.admin-message-compose h3,
.admin-sent-messages h4 {
  margin-bottom: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
}

.admin-sent-messages {
  margin-top: 1rem;
}

.admin-sent-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-sent-item {
  padding: 0.8rem 0.95rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
}

.admin-sent-item p {
  margin-bottom: 0.35rem;
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.55;
}

.admin-sent-item span {
  color: var(--muted);
  font-size: 0.75rem;
}

.admin-book-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0.45rem 0.75rem;
  border: 1px solid rgba(220, 38, 38, 0.35);
  border-radius: var(--radius-xs);
  background: var(--error-bg);
  color: #b91c1c;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.btn-danger:hover {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.55);
  color: #991b1b;
}

.btn-danger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.admin-submission-top .btn-danger {
  margin-left: auto;
}

.viewer-body {
  min-height: 100vh;
  background: var(--bg);
}

.viewer-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.viewer-toolbar h1 {
  font-size: 1.1rem;
  font-weight: 700;
}

.viewer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.viewer-content {
  min-height: calc(100vh - 88px);
  padding: 0;
}

.viewer-frame {
  width: 100%;
  min-height: calc(100vh - 88px);
  border: 0;
  background: #ffffff;
}

.viewer-frame-short {
  min-height: 70vh;
}

.viewer-text {
  margin: 0;
  padding: 1.25rem;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.viewer-fallback {
  padding: 1.25rem;
}

.viewer-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.viewer-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.viewer-modal-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1100px, calc(100% - 2rem));
  height: calc(100vh - 2rem);
  margin: 1rem auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.viewer-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.viewer-modal-head h2 {
  font-size: 1rem;
  font-weight: 700;
}

.viewer-modal-panel .viewer-frame {
  flex: 1;
  min-height: 0;
}

.notification-wrap {
  position: relative;
}

.notification-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.notification-bell svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.notification-bell:hover,
.notification-bell:focus-visible {
  background: var(--surface-hover);
  border-color: var(--accent-ring);
  outline: none;
}

.notification-bell.has-unread {
  animation: bell-ring 1.4s ease-in-out infinite;
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.35);
}

@keyframes bell-ring {
  0%, 100% { transform: rotate(0deg); }
  10% { transform: rotate(14deg); }
  20% { transform: rotate(-12deg); }
  30% { transform: rotate(8deg); }
  40% { transform: rotate(-6deg); }
  50% { transform: rotate(0deg); }
}

.notification-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #dc2626;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.notification-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 30;
  width: min(360px, calc(100vw - 2rem));
  max-height: 420px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}

.notification-panel-head {
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.notification-panel-head h2 {
  margin-bottom: 0.2rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.notification-panel-head p {
  color: var(--muted);
  font-size: 0.8125rem;
}

.notification-list {
  margin: 0;
  padding: 0.5rem 0;
  list-style: none;
}

.notification-item {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}

.notification-item:last-child {
  border-bottom: 0;
}

.notification-item.is-unread {
  background: rgba(5, 150, 105, 0.06);
}

.notification-text {
  margin-bottom: 0.35rem;
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.notification-meta {
  color: var(--muted);
  font-size: 0.75rem;
}

.notification-empty {
  padding: 1.25rem 1rem;
  color: var(--muted);
  font-size: 0.875rem;
}

@media (prefers-reduced-motion: reduce) {
  .notification-bell.has-unread {
    animation: none;
  }
}

@media (max-width: 760px) {
  .admin-detail-head {
    flex-direction: column;
  }

  .admin-table th:nth-child(3),
  .admin-table td:nth-child(3),
  .admin-table th:nth-child(9),
  .admin-table td:nth-child(9) {
    display: none;
  }
}

@media print {
  body * {
    visibility: hidden !important;
  }

  body::before {
    content: "Printing is disabled for this page.";
    display: block;
    max-width: 600px;
    margin: 4rem auto;
    color: #000000;
    font-family: var(--font-sans);
    font-size: 14pt;
    text-align: center;
    visibility: visible !important;
  }
}
