:root {
  font-family: system-ui, sans-serif;
  color: #1f2937;
  background: #f8fafc;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: start center;
}

.card {
  width: min(76rem, calc(100% - 2rem));
  box-sizing: border-box;
  margin: 1rem 0;
  padding: 2rem;
  background: white;
  border: 1px solid #dbe3ee;
  border-radius: .75rem;
}

h1,
h2 {
  margin-top: 0;
}

.auth-form {
  width: min(36rem, 100%);
  display: grid;
  gap: .75rem;
}

.auth-form input,
button {
  box-sizing: border-box;
  padding: .7rem .8rem;
  font: inherit;
}

.auth-form input,
.auth-form button {
  width: 100%;
}

.auth-form input {
  border: 1px solid #94a3b8;
  border-radius: .35rem;
}

button {
  margin-top: .5rem;
  color: white;
  background: #1d4ed8;
  border: 0;
  border-radius: .35rem;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: .65;
}

button:focus-visible,
a:focus-visible,
[tabindex="-1"]:focus {
  outline: 3px solid #f59e0b;
  outline-offset: 2px;
}

.secondary-button {
  color: #1d4ed8;
  background: white;
  border: 1px solid #1d4ed8;
}

.authenticated-header,
.section-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.authenticated-header .secondary-button,
.section-heading-row button {
  flex: 0 0 auto;
  margin-top: 0;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
}

.dashboard-section {
  min-width: 0;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid #dbe3ee;
  border-radius: .6rem;
  background: #fff;
}

.dashboard-section h3,
.dashboard-section h4 {
  margin-top: 0;
}

.bootstrap-panel {
  border-color: #93c5fd;
  background: #eff6ff;
}

.bootstrap-result {
  margin-top: 1rem;
  padding: .75rem;
  border: 1px solid #93c5fd;
  border-radius: .4rem;
  background: white;
  overflow-wrap: anywhere;
}

.tree-root,
.tree-children,
.disconnected-list,
.member-list {
  margin: 0;
  padding-left: 1.25rem;
}

.tree-root {
  padding-left: 0;
  list-style: none;
}

.tree-node {
  margin: .45rem 0;
}

.tree-node-button {
  width: 100%;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem;
  text-align: left;
  color: #1f2937;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
}

.tree-node-button:hover {
  background: #eef2ff;
}

.chat-title {
  font-weight: 700;
}

.chat-id {
  color: #475569;
  font-family: ui-monospace, monospace;
}

.status-badge {
  margin-left: auto;
  padding: .15rem .45rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 800;
}

.status-active {
  color: #166534;
  background: #dcfce7;
}

.status-degraded {
  color: #9a3412;
  background: #ffedd5;
}

.status-pending_approval {
  color: #854d0e;
  background: #fef9c3;
}

.status-quarantined {
  color: #991b1b;
  background: #fee2e2;
}

.node-context {
  margin-left: .25rem;
  color: #7c2d12;
  font-size: .78rem;
  font-weight: 800;
}

.disconnected-section {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #dbe3ee;
}

.request-card {
  margin-top: .75rem;
  padding: .75rem;
  border: 1px solid #dbe3ee;
  border-radius: .45rem;
}

.request-card p {
  margin: .35rem 0 0;
  overflow-wrap: anywhere;
}

.warning {
  padding: .65rem .75rem;
  color: #713f12;
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
}

.empty-state {
  color: #64748b;
}

.error {
  margin-bottom: 0;
  color: #b91c1c;
}

.notice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.notice-form {
  display: grid;
  gap: .65rem;
}

.notice-form input,
.notice-form textarea,
.notice-controls select {
  box-sizing: border-box;
  width: 100%;
  padding: .55rem;
  font: inherit;
  border: 1px solid #94a3b8;
  border-radius: .35rem;
}

.notice-form fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.notice-form fieldset label {
  width: auto;
}

.notice-preview {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: .7rem;
  background: #eff6ff;
  border: 1px solid #93c5fd;
  border-radius: .35rem;
}

.notice-controls {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.notice-controls select {
  width: auto;
}

.notice-card,
.notice-detail {
  margin-top: .75rem;
  padding: .75rem;
  border: 1px solid #dbe3ee;
  border-radius: .45rem;
}

.notice-row {
  margin: .35rem 0;
  overflow-wrap: anywhere;
}

[hidden] {
  display: none !important;
}

@media (max-width: 48rem) {
  .card {
    width: 100%;
    margin: 0;
    padding: 1rem;
    border-width: 0;
    border-radius: 0;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .notice-grid {
    grid-template-columns: 1fr;
  }

  .notice-controls {
    width: 100%;
    flex-wrap: wrap;
  }

  .authenticated-header,
  .section-heading-row {
    flex-direction: column;
  }

  .authenticated-header .secondary-button,
  .section-heading-row button {
    width: 100%;
  }
}
