.mw-note-root {
  min-width: 0;
}

.mw-note-message {
  margin: 0;
}

.mw-note-owner {
  margin: 0;
  padding: 0.5rem 0.75rem;
  border-left: 3px solid var(--aira-primary-action, #0f766e);
  background: var(--aira-surface-muted, #f8fafc);
  border-radius: 0.5rem;
}

.mw-note-editor,
.mw-note-readonly {
  min-height: 8.5rem;
  border: 1px solid var(--aira-border-subtle, #94a3b8);
  border-radius: 0.65rem;
  background: var(--aira-surface, #fff);
  padding: 0.7rem 0.8rem;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.mw-note-readonly {
  min-height: 5.5rem;
  background: var(--aira-surface-muted, #f8fafc);
}

.mw-note-editor .ProseMirror,
.mw-note-readonly .ProseMirror {
  min-height: 100%;
  outline: none;
  white-space: pre-wrap;
  line-height: 1.25;
}

.mw-note-editor .ProseMirror-focused {
  outline: none;
}

.mw-note-editor:focus-within {
  border-color: var(--aira-primary-action, #0f766e);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.16);
  background: #f8fdfc;
}

.mw-note-editor ul,
.mw-note-readonly ul {
  margin: 0;
  padding-left: 1.5rem;
}

.mw-note-editor li,
.mw-note-readonly li {
  margin: 0.08rem 0;
  padding: 0;
}

.mw-note-editor p,
.mw-note-readonly p {
  margin: 0;
}

.mw-note-editor li.mw-note-outcome-marker,
.mw-note-readonly li.mw-note-outcome-marker {
  border-left: 3px solid #0f766e;
  padding-left: 0.35rem;
  background: rgba(15, 118, 110, 0.06);
  border-radius: 0.35rem;
}

.mw-outcome-panel {
  border-top: 1px solid var(--aira-border-subtle, #d1d5db);
  padding-top: 0.6rem;
}

.mw-outcome-table-wrap {
  overflow-x: auto;
}

.mw-outcome-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.mw-outcome-table th,
.mw-outcome-table td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--aira-border-subtle, #e2e8f0);
  text-align: left;
  vertical-align: top;
}

.mw-outcome-table th {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--aira-text-muted, #475569);
  background: var(--aira-surface-muted, #f8fafc);
}

.mw-outcome-row:last-child td {
  border-bottom: none;
}

.mw-outcome-title {
  margin: 0;
  font-weight: 600;
}

.mw-outcome-text {
  margin-top: 0.2rem;
  color: var(--aira-text-muted, #475569);
}

.mw-outcome-table__actions {
  white-space: nowrap;
}

.mw-note-dirty {
  color: var(--aira-danger, #b91c1c);
  font-size: 0.875rem;
  font-weight: 600;
}

.mw-note-save-state {
  margin: 0;
  color: var(--aira-text-muted, #475569);
  text-align: right;
  white-space: nowrap;
}

.mw-note-actions {
  align-items: center;
}

.mw-note-save-state--saving {
  color: var(--aira-primary-action, #0f766e);
}

.mw-note-save-state--warning {
  color: #92400e;
}

.mw-note-save-state--danger {
  color: var(--aira-danger, #b91c1c);
}

:root {
  --bg: #f7f9fc;
  --text: #1e293b;
  --panel: #ffffff;
  --border: #d7deea;
  --accent: #0f766e;
  --muted: #5b6478;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(180deg, #eef3f9 0%, var(--bg) 100%);
  color: var(--text);
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.container {
  width: min(680px, 92vw);
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

h1 {
  margin: 0 0 0.75rem;
  color: var(--accent);
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
}

p {
  margin: 0;
  line-height: 1.5;
  font-size: 1.05rem;
}

.login-page {
  width: min(860px, 94vw);
  display: grid;
  gap: 1rem;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  padding: 1.5rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.banner {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.tagline {
  color: var(--muted);
  max-width: 40ch;
}

.section-title {
  margin-bottom: 1rem;
  font-weight: 600;
}

.login-form {
  display: grid;
  gap: 0.7rem;
}

.login-form label {
  font-size: 0.95rem;
  font-weight: 600;
}

.login-form .field-error {
  color: #b42318;
  font-weight: 600;
  margin-left: 0.35rem;
}

.login-form .field-error-block {
  display: block;
  margin-left: 0;
  margin-top: -0.2rem;
}

.login-form .field-hint {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: -0.35rem;
}

.login-form input {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid #bac6db;
  border-radius: 8px;
  font-size: 1rem;
}

.login-form input[type="checkbox"],
.login-form input[type="radio"] {
  width: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  margin: 0 0.45rem 0 0;
  vertical-align: middle;
}

.login-form select,
.login-form textarea {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid #bac6db;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
}

.login-form button {
  width: fit-content;
  padding: 0.7rem 1rem;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
}

.login-form button:hover {
  filter: brightness(0.95);
}

.login-form button:disabled {
  background: var(--border);
  color: var(--muted);
  cursor: default;
  filter: none;
}

.login-form .form-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.login-form .button-link {
  display: inline-block;
  width: fit-content;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.login-form .button-link:hover {
  background: #f8fafc;
}

h2 {
  margin: 0 0 0.85rem;
  color: #0f172a;
}

ul {
  margin: 0.5rem 0;
  padding-left: 1.25rem;
}

li {
  margin: 0.3rem 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
}

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

.data-table th {
  background: #edf2f7;
  font-weight: 700;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  background: #ffffff;
  border: 1px solid var(--border);
}

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

.admin-table th {
  background: #eaf0f7;
  color: #0f172a;
  font-weight: 700;
}

.admin-table tbody tr:nth-child(even) {
  background: #f8fafd;
}

.admin-table tbody tr:hover {
  background: #eef4fb;
}

.status-icon {
  display: inline-block;
  font-weight: 700;
}

.status-enabled {
  color: #116149;
}

.status-disabled {
  color: #9a3412;
}

.legal-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--muted);
  width: min(94vw, 860px);
}

.container + .legal-footer {
  width: min(680px, 92vw);
}

.login-page + .legal-footer {
  width: min(860px, 94vw);
}

.doc-page {
  width: min(920px, 94vw);
  display: grid;
  gap: 1rem;
}

.doc-page + .legal-footer {
  width: min(920px, 94vw);
}

.doc-section h2,
.doc-section h3 {
  margin-top: 0;
}

.doc-section p + p,
.doc-section p + ul,
.doc-section p + ol,
.doc-section ul + p,
.doc-section ol + p,
.doc-section ul + ul,
.doc-section ol + ol,
.doc-section ul + ol,
.doc-section ol + ul,
.doc-section .doc-code + p,
.doc-section .doc-code + ul,
.doc-section .doc-code + ol {
  margin-top: 0.85rem;
}

.doc-section ol,
.doc-section ul {
  margin: 0.75rem 0 0;
  padding-left: 1.4rem;
}
.admin-shell {
  width: min(1240px, 96vw);
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1rem;
  align-items: start;
  margin: 1rem auto 0;
}

.admin-shell + .legal-footer {
  width: min(1240px, 96vw);
  margin: 0.75rem auto 1rem;
}

body.admin-page {
  display: block;
  overflow-y: scroll;
}

.admin-rail {
  position: sticky;
  top: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f4f8ff;
  padding: 1rem;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
  max-height: calc(100vh - 2rem);
  overflow: auto;
}

.admin-rail h1 {
  margin-bottom: 0.1rem;
}

.admin-rail-subtitle {
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.admin-nav-group {
  border-top: 1px solid #d5e0ef;
  padding-top: 0.7rem;
  margin-top: 0.7rem;
}

.admin-nav-group h2 {
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: #1f2b46;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.admin-nav-group ul {
  margin: 0;
  padding-left: 1rem;
}

.admin-nav-group li {
  margin: 0.15rem 0;
}

.admin-nav-group a {
  color: #1b3a75;
  text-decoration: none;
}

.admin-nav-group a:hover {
  text-decoration: underline;
}

.admin-rail-footer-link {
  margin-top: 1rem;
  padding-top: 0.7rem;
  border-top: 1px solid #d5e0ef;
}

.admin-main {
  display: grid;
  gap: 1rem;
}

.admin-main .panel {
  margin: 0;
}

.container.admin-with-rail {
  width: min(1240px, 96vw);
  display: flow-root;
}

.container.admin-with-rail + .legal-footer {
  width: min(1240px, 96vw);
}

.container.admin-with-rail > .admin-menu-panel {
  float: left;
  width: 320px;
  margin: 0 1rem 1rem 0;
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow: auto;
  background: #f4f8ff;
}

.container.admin-with-rail > :not(.admin-menu-panel) {
  margin-left: calc(320px + 1rem);
}

.admin-menu-panel {
  margin-bottom: 1rem;
}

.admin-nav-panel {
  display: block;
}

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

.admin-menu-group {
  border: 1px solid #d5e0ef;
  border-radius: 10px;
  background: #f8fbff;
  padding: 0.65rem 0.75rem;
}

.admin-menu-group h3 {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  color: #1f2b46;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.admin-menu-group ul {
  margin: 0;
  padding-left: 1rem;
}

.admin-menu-group li {
  margin: 0.2rem 0;
}

.admin-quick-links {
  margin: 0.5rem 0 1rem;
  padding-left: 1rem;
}

.admin-quick-links li {
  margin: 0.4rem 0;
}

.admin-pill {
  display: inline-block;
  margin-left: 0.45rem;
  padding: 0.05rem 0.45rem;
  border-radius: 10px;
  border: 1px solid #bfd0e8;
  background: #eff5ff;
  color: #33528d;
  font-size: 0.8rem;
  font-weight: 600;
}

@media (max-width: 980px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-rail {
    position: static;
    max-height: none;
  }

  .container.admin-with-rail {
    display: block;
  }

  .container.admin-with-rail > :not(.admin-menu-panel) {
    margin-left: 0;
  }

  .container.admin-with-rail > .admin-menu-panel {
    float: none;
    width: auto;
    margin-right: 0;
    position: static;
    max-height: none;
  }
}

.doc-section li {
  margin: 0.45rem 0;
  line-height: 1.55;
}

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

.doc-code {
  margin: 0.85rem 0 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
  color: #0f172a;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.94rem;
  line-height: 1.5;
}

.doc-code code,
.doc-section code {
  font-family: Consolas, "Courier New", monospace;
}

.checklist {
  list-style: square;
}

/* Docs index landing page */
.doc-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

a.doc-card {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.es-topics-page {
  width: min(760px, 100vw);
  min-height: 100vh;
  padding: 0 0 6.5rem;
  margin: 0 auto;
}

.es-topics-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 1rem 1rem 0.75rem;
  background: linear-gradient(180deg, #eef3f9 0%, rgba(247, 249, 252, 0.98) 100%);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(2px);
}

.es-topics-header h1 {
  margin-bottom: 0.35rem;
  font-size: clamp(1.35rem, 6vw, 1.85rem);
}

.es-topics-campaign {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.es-topics-search-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.es-topics-search {
  width: 100%;
  padding: 0.78rem 0.85rem;
  border: 1px solid #bac6db;
  border-radius: 9px;
  font-size: 1rem;
}

.es-status-message {
  margin: 0.7rem 1rem 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid #b7d8d4;
  border-radius: 8px;
  background: #effaf8;
  color: #0a4f48;
  font-size: 0.92rem;
}

.es-topic-groups {
  padding: 0.8rem 1rem 0;
}

.es-neighborhood-group {
  margin-bottom: 1.35rem;
}

.es-stage-group {
  margin-bottom: 1.15rem;
}

.es-topics-next-step {
  margin-top: 1.25rem;
  border: 2px solid #0f766e;
  border-radius: 14px;
  background: linear-gradient(180deg, #f3fbfa 0%, #ecf9f7 100%);
  padding: 0.95rem;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.12);
}

.es-topics-next-step p {
  margin: 0.4rem 0 0;
}

.es-topics-help {
  color: #334155;
  font-size: 0.92rem;
  line-height: 1.42;
}

.es-primary-cta {
  display: inline-block;
  margin-top: 0.65rem;
  padding: 0.8rem 1rem;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}

.es-primary-cta:hover {
  filter: brightness(0.95);
}

.es-primary-cta:focus-visible {
  outline: 3px solid #0f766e;
  outline-offset: 2px;
}

.es-stage-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: #0f172a;
  letter-spacing: 0.01em;
}

.es-topic-list {
  display: grid;
  gap: 0.75rem;
}

.es-topic-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 0;
  align-items: stretch;
  border: 2px solid #9db0cc;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.09);
  overflow: hidden;
}

.es-topic-row.is-selected {
  border-color: #0f766e;
  background: linear-gradient(180deg, #f3fbfa 0%, #eef9f8 100%);
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.2);
}

.es-topic-row.is-subscribed {
  border-color: #6f9e97;
  background: linear-gradient(180deg, #f1f8f7 0%, #ebf6f4 100%);
  box-shadow: 0 8px 18px rgba(63, 122, 114, 0.18);
}

.es-topic-row.is-meeting-registered {
  border-color: #2563eb;
  background: linear-gradient(180deg, #eff6ff 0%, #e8f0fe 100%);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}

.es-topic-row.is-meeting-registered .es-topic-state {
  border-color: #2563eb;
  color: #1d4ed8;
  background: #dbeafe;
}

.es-review-topic-row.is-reviewed {
  border-color: #8f99aa;
  background: linear-gradient(180deg, #e5e9f0 0%, #dbe2ec 100%);
  box-shadow: 0 8px 18px rgba(71, 85, 105, 0.24);
}

.es-review-topic-row {
  grid-template-columns: 118px 1fr;
}

.es-review-topic-row:not(.is-reviewed) {
  border-color: #5f779a;
  box-shadow: 0 10px 20px rgba(46, 78, 116, 0.2);
}

.es-review-topic-row.is-reviewed h3,
.es-review-topic-row.is-reviewed .es-topic-preview {
  color: #4b5563;
}

.es-topic-row.is-filtered-out {
  display: none !important;
}

.es-review-scale-hint {
  margin: 0 0 0.55rem;
  color: #475569;
  font-size: 0.86rem;
}

.es-review-score-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.62rem 0.5rem;
  background: #e8eef8;
  border-right: 1px solid #c9d7ea;
  min-height: 84px;
}

.es-review-selected-wrap {
  width: 100%;
  text-align: center;
}

.es-review-selected-value {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 2px solid #334155;
  background: #ffffff;
  color: #0f172a;
  font-weight: 800;
  font-size: 1.06rem;
  cursor: pointer;
}

.es-review-edit-wrap {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.3rem;
  width: 100%;
}

.es-review-score-btn {
  border: 1px solid #7891b2;
  background: #ffffff;
  border-radius: 8px;
  padding: 0.35rem 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
}

.es-review-score-btn:hover {
  border-color: #0f766e;
  color: #0f766e;
}

.es-review-topic-row.is-reviewed .es-topic-state {
  border-color: #7f8a99;
  color: #475569;
  background: #eef2f7;
}

.es-review-progress-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 205;
  padding: 0.72rem 0.95rem max(0.72rem, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(247, 249, 252, 0.94), #eef3f9);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 18px rgba(15, 23, 42, 0.12);
  font-weight: 700;
  color: #0f172a;
}

.es-review-comment-label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.es-review-comment-input {
  width: 100%;
  min-height: 120px;
  border: 1px solid #bac6db;
  border-radius: 9px;
  padding: 0.65rem 0.75rem;
  font-size: 0.95rem;
  line-height: 1.42;
  resize: vertical;
  margin-bottom: 0.55rem;
}

.es-review-comment-status {
  margin: 0 0 0.55rem;
  color: #334155;
  font-size: 0.9rem;
}

.es-cdc-review-page {
  padding-bottom: 1.25rem;
}

.es-cdc-intro {
  margin: 0 0 1rem;
  padding: 0.95rem 1rem;
  border: 1px solid #c9d7ea;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
  color: #1e293b;
  box-shadow: 0 6px 18px rgba(30, 41, 59, 0.08);
}

.es-cdc-intro p {
  margin: 0;
  line-height: 1.55;
}

.es-cdc-topic-list {
  display: grid;
  gap: 0.9rem;
}

.es-cdc-topic-row {
  grid-template-columns: 1fr;
}

.es-cdc-topic-body {
  display: grid;
  gap: 0.8rem;
  padding: 0.9rem 0.95rem 1rem;
}

.es-cdc-topic-meta {
  margin: -0.2rem 0 0;
  color: #475569;
  font-size: 0.93rem;
}

.es-cdc-meta-sep {
  padding: 0 0.35rem;
}

.es-cdc-control-block {
  display: grid;
  gap: 0.45rem;
}

.es-cdc-control-label {
  margin: 0;
  font-weight: 700;
  color: #0f172a;
}

.es-cdc-signal-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.5rem;
}

.es-cdc-signal-btn {
  border: 1px solid #8ea4c4;
  background: #ffffff;
  color: #0f172a;
  border-radius: 10px;
  padding: 0.72rem 0.8rem;
  text-align: left;
  font-weight: 700;
  line-height: 1.35;
  cursor: pointer;
}

.es-cdc-signal-btn:hover {
  border-color: #0f766e;
}

.es-cdc-signal-btn.is-active {
  border-color: #0f766e;
  background: #ecfdf5;
  color: #0f5132;
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.12);
}

.es-cdc-signal-btn:disabled,
.es-cdc-policy-action:disabled,
.js-cdc-comment-save:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.es-cdc-comment-actions {
  display: flex;
  justify-content: flex-start;
}

.es-cdc-policy-badge {
  margin: 0;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-weight: 700;
  font-size: 0.9rem;
}

.es-cdc-policy-note {
  margin: 0;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
  font-size: 0.94rem;
}

.es-cdc-policy-action {
  justify-self: start;
}

.es-cdc-row-status {
  margin: 0;
  color: #475569;
  font-size: 0.9rem;
  font-weight: 700;
}

.es-cdc-row-status.is-error {
  color: #991b1b;
}

.es-cdc-topic-row.is-cdc-policy-blocked {
  border-color: #a8b3c2;
  background: linear-gradient(180deg, #f3f4f6 0%, #e5e7eb 100%);
  box-shadow: 0 8px 18px rgba(107, 114, 128, 0.18);
}

.es-cdc-topic-row.is-cdc-policy-blocked h3,
.es-cdc-topic-row.is-cdc-policy-blocked .es-topic-preview,
.es-cdc-topic-row.is-cdc-policy-blocked .es-cdc-topic-meta {
  color: #4b5563;
}

.es-review-edit-wrap[hidden],
.es-review-selected-wrap[hidden],
.es-topic-state[hidden] {
  display: none !important;
}

.es-topic-checkbox-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.9rem 0.35rem;
  background: #f1f5fb;
  border-right: 1px solid #c9d7ea;
}

.es-topic-checkbox {
  width: 24px;
  height: 24px;
}

.es-topic-content {
  min-width: 0;
  cursor: pointer;
  padding: 0.72rem 0.85rem 0.78rem;
}

.es-topic-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.es-topic-top h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.22;
}

.es-topic-state {
  display: inline-block;
  padding: 0.18rem 0.42rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
  color: #334155;
}

.es-topic-row.is-selected .es-topic-state {
  border-color: #0f766e;
  color: #0f766e;
  background: #ebf8f7;
}

.es-topic-row.is-subscribed .es-topic-state {
  border-color: #3f7a72;
  color: #145e54;
  background: #e9f7f5;
}

.es-vote-total {
  font-size: 2rem;
  font-weight: 800;
  color: #0f766e;
  line-height: 1;
}

.es-topic-preview {
  margin: 0.32rem 0 0;
  font-size: 0.89rem;
  line-height: 1.38;
  color: #475569;
}

.es-sticky-action {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  padding: 0.7rem 0.9rem max(0.7rem, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(247, 249, 252, 0.94), #eef3f9);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 18px rgba(15, 23, 42, 0.12);
}

.es-sticky-action button {
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 0.82rem 1rem;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
}

.es-sticky-action button:disabled {
  background: #7f98a6;
  opacity: 0.95;
}

.es-detail-overlay,
.es-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 320;
}

.es-detail-sheet,
.es-confirm-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 321;
  background: #fff;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  padding: 1rem 1rem 1.2rem;
  max-height: 85vh;
  overflow: auto;
  box-shadow: 0 -12px 24px rgba(15, 23, 42, 0.24);
}

.es-detail-sheet h2,
.es-confirm-sheet h2 {
  margin: 0 0 0.55rem;
  font-size: 1.2rem;
}

.es-detail-stage,
.es-detail-state {
  margin: 0 0 0.48rem;
  font-size: 0.9rem;
  color: #334155;
}

.es-detail-description {
  margin: 0.3rem 0 1rem;
  white-space: pre-wrap;
  line-height: 1.5;
}

.es-detail-actions,
.es-confirm-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.es-detail-actions button,
.es-confirm-actions button,
.es-confirm-actions a {
  border: 0;
  border-radius: 9px;
  padding: 0.65rem 0.9rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
}

.es-detail-actions button,
.es-confirm-actions button {
  background: var(--accent);
  color: #fff;
}

.es-secondary-button {
  background: #eef2f7;
  color: #1f2937;
}

.es-confirm-sheet label {
  display: block;
  font-weight: 700;
  margin-top: 0.6rem;
  margin-bottom: 0.3rem;
}

.es-confirm-sheet input[type="email"] {
  width: 100%;
  padding: 0.72rem 0.8rem;
  border: 1px solid #bac6db;
  border-radius: 9px;
  font-size: 1rem;
}

.mw-outcome-dialog,
.mw-remove-outcome-dialog {
  border: 0;
  padding: 0;
  width: min(46rem, calc(100vw - 1.5rem));
  max-width: none;
  background: transparent;
  color: inherit;
}

.mw-outcome-dialog::backdrop,
.mw-remove-outcome-dialog::backdrop {
  background: rgba(15, 23, 42, 0.56);
}

.mw-outcome-dialog__sheet,
.mw-remove-outcome-dialog__sheet {
  background: #fff;
  border: 1px solid #d7e0ea;
  border-radius: 18px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.22);
  padding: 1.1rem 1.1rem 1rem;
}

.mw-outcome-dialog__sheet {
  max-height: min(82vh, 52rem);
  overflow: auto;
}

.mw-remove-outcome-dialog__sheet {
  width: min(32rem, calc(100vw - 1.5rem));
}

.mw-outcome-dialog__context {
  padding: 0.85rem 0.95rem;
  border: 1px solid #d7e0ea;
  border-radius: 14px;
  background: #f8fbfe;
}

.mw-outcome-dialog__preview {
  margin: 0;
  line-height: 1.45;
  font-weight: 700;
  color: #0f172a;
  white-space: pre-wrap;
}

.mw-outcome-dialog__field {
  display: grid;
  gap: 0.38rem;
}

.mw-outcome-dialog__field label {
  font-weight: 700;
  color: #1f2937;
}

.mw-outcome-dialog__control {
  width: 100%;
  border: 1px solid #bac6db;
  border-radius: 12px;
  background: #fff;
  color: #0f172a;
  padding: 0.8rem 0.9rem;
  font: inherit;
}

.mw-outcome-dialog__control:focus {
  outline: 3px solid rgba(37, 99, 235, 0.18);
  border-color: #3b82f6;
}

.mw-outcome-dialog__control[aria-invalid="true"] {
  border-color: #dc2626;
  outline-color: rgba(220, 38, 38, 0.16);
}

.mw-outcome-dialog__field-help,
.mw-outcome-dialog__field-error,
.mw-outcome-dialog__status {
  margin: 0;
  font-size: 0.92rem;
}

.mw-outcome-dialog__field-help,
.mw-outcome-dialog__status {
  color: #475569;
}

.mw-outcome-dialog__field-error,
.mw-outcome-dialog__status--danger {
  color: #b91c1c;
}

.mw-outcome-dialog__actions {
  padding-top: 0.2rem;
}

.mw-outcome-dialog__close {
  flex-shrink: 0;
}

.mw-dialog-open {
  overflow: hidden;
}

.es-name-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.es-name-row input[type="text"] {
  width: 100%;
  padding: 0.72rem 0.8rem;
  border: 1px solid #bac6db;
  border-radius: 9px;
  font-size: 1rem;
}

.es-checkbox-row {
  display: flex;
  gap: 0.45rem;
  align-items: flex-start;
  margin-top: 0.75rem;
  font-weight: 600;
}

.es-checkbox-row input {
  margin-top: 0.15rem;
}

.es-confirm-topic-list {
  margin: 0.5rem 0 0.9rem;
}

.es-confirm-error {
  margin: 0.35rem 0 0.6rem;
  color: #b42318;
  font-weight: 700;
}

.es-vote-error {
  border-color: #f5b0ab;
  background: #fff3f1;
  color: #8b1f15;
}

.es-table-results-actions {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.25rem 1rem 1rem;
}

.es-table-results-actions .es-secondary-button {
  border-radius: 9px;
  padding: 0.65rem 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.es-reg-wrap {
  width: min(1800px, 98vw);
  margin: 0 auto;
  padding: 1rem;
}

.es-reg-grid {
  display: grid;
  grid-template-columns: 40% 60%;
  gap: 1rem;
  align-items: start;
}

.es-reg-left,
.es-reg-right {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  padding: 0.9rem;
}

.es-reg-count {
  font-size: 5rem;
  font-weight: 700;
  margin: 0.25rem 0 1rem;
  line-height: 1;
}

.es-reg-names {
  font-size: 1.15rem;
  line-height: 1.45;
}

.es-reg-mode-badge {
  margin: 0.1rem 0 0.8rem;
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: #fff7db;
  border: 1px solid #f2d176;
  color: #7a5a00;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.es-reg-cleanup {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}

.es-reg-cleanup h2 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
}

.es-reg-cleanup-confirm {
  display: flex;
  gap: 0.45rem;
  align-items: flex-start;
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
}

.es-reg-cleanup-confirm input {
  margin-top: 0.18rem;
}


.es-refresh-floating {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 60;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.16);
}

.es-refresh-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 0.92rem;
  color: #0f172a;
}

.es-refresh-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.es-refresh-slider {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #d4dbe7;
  transition: background 0.2s ease;
}

.es-refresh-slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  left: 3px;
  top: 3px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.3);
  transition: transform 0.2s ease;
}

.es-refresh-switch input:checked + .es-refresh-slider {
  background: #0f766e;
}

.es-refresh-switch input:checked + .es-refresh-slider::before {
  transform: translateX(20px);
}

.es-refresh-hint {
  margin: 0.2rem 0 0.6rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.es-round-current {
  margin: 0;
}

.es-round-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.75rem;
}

.es-table-health-wrap {
  margin-bottom: 0.8rem;
  overflow-x: auto;
}

.es-table-health-table th,
.es-table-health-table td {
  text-align: center;
}

.es-table-health-table th:first-child,
.es-table-health-table td:first-child {
  text-align: left;
}

.es-table-health-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.es-table-health-dot {
  --fill: 0%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid #b8c5d8;
  background: conic-gradient(#0f766e var(--fill), #e2e8f0 0);
}

.es-table-health-value {
  font-weight: 600;
  color: #334155;
}

.es-round-controls {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.es-round-controls button {
  width: fit-content;
  padding: 0.55rem 0.85rem;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
}

.es-round-table-wrap {
  overflow-x: auto;
}

.es-round-table th,
.es-round-table td {
  white-space: nowrap;
}

.es-round-table td:first-child,
.es-round-table th:first-child {
  position: sticky;
  left: 0;
  background: #ffffff;
  z-index: 1;
}

.es-round-table th:first-child {
  background: #eaf0f7;
  z-index: 2;
}

.es-current-round {
  background: #d9f6ee !important;
}

@media (max-width: 1100px) {
  .es-reg-grid {
    grid-template-columns: 1fr;
  }

  .es-reg-count {
    font-size: 3.2rem;
  }
}

body.es-sheet-open {
  overflow: hidden;
}

body.es-confirm-open {
  overflow: hidden;
}

@media (min-width: 920px) {
  .es-topics-page {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .es-sticky-action {
    left: 0;
    right: 0;
    transform: none;
    width: 100%;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }

  .es-detail-sheet,
  .es-confirm-sheet {
    left: 50%;
    transform: translateX(-50%);
    width: min(760px, 100vw);
  }
}

a.doc-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
}

a.doc-card .doc-kicker {
  margin-top: 0;
}

a.doc-card h2 {
  margin: 0.25rem 0 0.5rem;
  font-size: 1.1rem;
}

a.doc-card p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

/* Doc section tables */
.doc-section table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
}

.doc-section th,
.doc-section td {
  text-align: left;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
}

.doc-section th {
  background: var(--panel);
  font-weight: 600;
}

.legal-footer p {
  margin: 0;
  line-height: 1.5;
  font-size: 0.95rem;
}

.legal-footer p + p {
  margin-top: 0.85rem;
}

.legal-footer a {
  color: var(--accent);
}

/* -------------------------
   Admin Users Funnel Dashboard
   ------------------------- */
.stat-cards {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1rem 0 1.75rem;
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 160px;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f4f8ff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.07);
  text-align: center;
}

.stat-card-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: #1b3a75;
  line-height: 1.1;
}

.stat-card-label {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}