@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap');

:root {
  --bg: #000000;
  --panel: #111111;
  --panel-2: #181818;
  --text: #ffffff;
  --muted: #d0d0d0;
  --red: #d71319;
  --red-2: #b11015;
  --border: #333333;
  --accent-dark: #000000;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Open Sans', Arial, sans-serif;
  background: #000000;
  color: var(--text);
}
body.modal-open {
  overflow: hidden;
}
.shell { max-width: 1180px; margin: 0 auto; padding: 24px 20px 60px; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; }
.card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 16px 36px rgba(0,0,0,.08);
  padding: 20px;
}
.topbar { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 24px; }
.compact-topbar { align-items: flex-start; }
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.site-logo {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 24px rgba(0,0,0,.28);
  background: #0a0a0a;
}
.auth-card {
  width: min(100%, 460px);
}
.auth-brand {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 8px;
  margin-bottom: 18px;
}
.auth-logo {
  width: 128px;
  height: 128px;
}
.tag, .small, time { color: var(--muted); }
.form { display: grid; gap: 14px; }
label { display: grid; gap: 8px; font-weight: 600; }
input, textarea {
  width: 100%;
  background: #0a0a0a;
  color: var(--text);
  border: 1px solid #444444;
  border-radius: 10px;
  padding: 12px 14px;
}
textarea { resize: vertical; }
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--red), var(--red-2));
  color: white;
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  min-height: 46px;
}
button.secondary,
.button.secondary {
  background: #1f1f1f;
  border: 1px solid var(--border);
}
button:hover,
.button:hover {
  filter: brightness(1.06);
}
.flash { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; }
.flash.error { background: #2b0f12; border: 1px solid #d71319; }
.flash.success { background: #132017; border: 1px solid #5b8a5f; }
.posts { display: grid; gap: 14px; margin-top: 18px; }
.post-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.post-image {
  margin-top: 12px;
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.comments-block {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.comments-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.comments-toggle {
  flex: 1;
}
.comments-summary-text {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.comments-summary-text::before {
  content: '▸';
  display: inline-block;
  font-size: 0.9rem;
  transform: rotate(0deg);
  transition: transform 120ms ease;
}
.comments-toggle[open] .comments-summary-text::before {
  transform: rotate(90deg);
}
.comments-summary-text::-webkit-details-marker {
  display: none;
}
.comments-panel {
  margin-top: 12px;
}
.comments-list {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.card-subtle {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 12px 14px;
}
.comment-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}
.comment-form textarea {
  min-height: 88px;
}
.comment-actions {
  display: flex;
  justify-content: flex-end;
}
.invitees { color: var(--muted); padding-left: 20px; }
.empty { text-align: center; color: var(--muted); }
a { color: #c92a33; }
code {
  display: inline-block;
  background: #0a0a0a;
  border: 1px solid #444444;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 1rem;
}
.settings-button {
  min-width: 52px;
  font-size: 1.5rem;
  line-height: 1;
  padding: 8px 14px;
}
.settings-panel-modal {
  width: min(100%, 760px);
  max-height: min(85vh, 900px);
  overflow: auto;
}
.settings-actions-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.settings-action { margin-top: 10px; }
.admin-action { margin-top: 12px; }
.admin-action-button {
  display: inline-flex;
  margin-top: 16px;
  clear: both;
}
.post > .admin-action-button {
  display: flex;
  width: fit-content;
}
.inline-delete { display: inline; margin-left: 8px; }
.inline-form { display: inline; margin: 0; }
.danger { background: #7d1118 !important; }
.tiny { padding: 6px 10px; font-size: 0.8rem; }
.feed-toolbar {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 18px;
}
.post-dialog {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
}
.post-dialog[hidden] {
  display: none;
}
.post-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}
.unstyled-backdrop {
  border: 0;
  padding: 0;
  cursor: default;
}
.post-dialog-panel {
  position: relative;
  width: min(100%, 640px);
  z-index: 1;
}
.dialog-close-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}
.dialog-close {
  min-width: 46px;
  padding: 10px 14px;
  font-size: 1.25rem;
  line-height: 1;
}
.composer-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.dialog-actions {
  justify-content: flex-end;
}
.file-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  text-decoration: none;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }
.three-col-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
}
.main-column { min-width: 0; }
.right-gutter {
  position: sticky;
  top: 24px;
  height: fit-content;
}
.member-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.member-list li a { text-decoration: none; font-weight: 600; }

@media (max-width: 900px) {
  .three-col-layout { grid-template-columns: 1fr; }
  .right-gutter { position: static; }
}

@media (max-width: 700px) {
  .topbar { flex-direction: column; align-items: flex-start; }
  .brand-lockup { align-items: flex-start; }
  .site-logo { width: 72px; height: 72px; }
  .auth-logo { width: 104px; height: 104px; }
  .settings-actions-row { flex-direction: column; }
  .composer-actions { flex-direction: column; align-items: stretch; }
}
