:root {
  color: #1d1d1f;
  background: #f5f5f7;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(420px, 100%);
}
.brand {
  font-weight: 700;
  letter-spacing: 0.04em;
}
h1 {
  font-size: 28px;
  margin: 8px 0;
}
h2 {
  font-size: 22px;
  margin: 0;
}
.muted {
  color: #86868b;
}
.error {
  color: #ff3b30;
}

.card,
.panel,
.node-card,
.post,
.table-wrap {
  background: #fff;
  border: 1px solid #e5e5e7;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.card,
.panel {
  padding: 20px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}
input,
select {
  height: 38px;
  border: 1px solid #e5e5e7;
  border-radius: 10px;
  padding: 0 12px;
  background: #fff;
}
input[type='checkbox'] {
  height: auto;
  width: auto;
  padding: 0;
}
.primary,
.ghost,
.danger {
  height: 36px;
  border-radius: 10px;
  padding: 0 14px;
  border: 0;
}
.primary {
  background: #0a84ff;
  color: #fff;
}
.ghost {
  background: #fff;
  border: 1px solid #e5e5e7;
}
.danger {
  background: #fff;
  color: #ff3b30;
  border: 1px solid #ffd1cc;
}
.primary:disabled,
.ghost:disabled {
  opacity: 0.5;
  cursor: default;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
}
#view {
  padding: 0 24px 40px;
}
.row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.spread {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.node-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.node-card:hover {
  border-color: #0a84ff;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: #aeaeb2;
  display: inline-block;
}
.dot.on {
  background: #30d158;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: #f5f5f7;
  padding: 2px 8px;
  font-size: 12px;
  color: #636366;
}

.tabs {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}
.tabs a {
  padding: 6px 12px;
  border-radius: 999px;
  color: #636366;
}
.tabs a.active {
  background: #1d1d1f;
  color: #fff;
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filters input,
.filters select {
  min-width: 140px;
}

.posts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.post {
  overflow: hidden;
  padding: 0;
  text-align: left;
  width: 100%;
}
.post img,
.cover-fallback {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: #f5f5f7;
  display: block;
}
.post div {
  padding: 10px 12px 12px;
}
.post strong,
.post span {
  display: block;
}
.post span {
  color: #86868b;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid #f0f0f2;
  vertical-align: top;
  font-size: 14px;
}
th {
  color: #86868b;
  font-weight: 500;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #f5f5f7;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 5;
}
.modal[hidden] {
  display: none;
}
.modal .card {
  width: min(860px, 100%);
  max-height: min(90vh, 900px);
  overflow: auto;
}
.modal video,
.modal img.full {
  width: 100%;
  max-height: 70vh;
  background: #000;
}
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #1d1d1f;
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  z-index: 6;
}
.key-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
  background: #f5f5f7;
  border-radius: 10px;
  padding: 12px;
}

@media (max-width: 720px) {
  .top,
  #view {
    padding-left: 16px;
    padding-right: 16px;
  }
  table {
    display: block;
    overflow-x: auto;
  }
}
