:root {
  color-scheme: dark;
  --bg: #0c1020;
  --card: #151b2e;
  --card-strong: #1f2942;
  --text: #f4f7fb;
  --muted: #a8b3c7;
  --accent: #7cdbb3;
  --accent-strong: #49be8b;
  --danger: #ff817a;
  --border: #2b3550;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(124, 219, 179, 0.18), transparent 32rem),
    linear-gradient(135deg, #090c18 0%, var(--bg) 55%, #12192b 100%);
  color: var(--text);
}

button,
input,
textarea,
a.button-link {
  font: inherit;
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0;
}

.hero {
  max-width: 720px;
  margin-bottom: 28px;
}

.hero-banner {
  width: calc(100% - 24px);
  margin: 0 auto 28px;
}

.hero-banner img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #0f1426;
}

.hero-banner--admin {
  margin-bottom: 16px;
}

.hero-banner--admin img {
  width: 100%;
  height: auto;
}

.legal-content {
  line-height: 1.7;
}

.legal-content h2,
.legal-content h3,
.legal-content h4 {
  margin: 1.6em 0 0.6em;
  line-height: 1.3;
}

.legal-content h2:first-child,
.legal-content h3:first-child,
.legal-content h4:first-child {
  margin-top: 0;
}

.legal-content p,
.legal-content ul,
.legal-content ol {
  margin: 0 0 1em;
}

.legal-content ul,
.legal-content ol {
  padding-left: 1.4em;
}

.legal-content li + li {
  margin-top: 0.35em;
}

.legal-content a {
  color: var(--accent);
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 0.9;
  letter-spacing: -0.08em;
}

.hero p {
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.7;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.card,
.message {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(21, 27, 46, 0.88);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.card {
  padding: 28px;
}

.card h2 {
  margin: 0 0 16px;
  font-size: 1.6rem;
}

.muted {
  color: var(--muted);
}

form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--accent);
  cursor: pointer;
}

.checkbox-label span {
  line-height: 1.5;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #0f1426;
  color: var(--text);
  padding: 13px 14px;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 96px;
}

select {
  cursor: pointer;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(124, 219, 179, 0.15);
}

button {
  cursor: pointer;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #06130f;
  padding: 13px 18px;
  font-weight: 800;
  transition:
    transform 0.18s ease,
    background 0.18s ease;
}

button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

button.secondary {
  border: 1px solid var(--border);
  background: var(--card-strong);
  color: var(--text);
}

button.danger {
  background: transparent;
  color: var(--danger);
}

.message {
  margin-bottom: 20px;
  padding: 16px 18px;
}

.message.error {
  border-color: rgba(255, 129, 122, 0.6);
  color: #ffd8d5;
}

.message.success {
  border-color: rgba(124, 219, 179, 0.65);
  color: #dcfff0;
}

.status-toast {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 200;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(21, 27, 46, 0.94);
  padding: 8px 14px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  animation: status-toast-fade 3.5s ease forwards;
}

.status-toast__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-toast--on .status-toast__dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(124, 219, 179, 0.18);
}

.status-toast--off .status-toast__dot {
  background: var(--muted);
}

.status-toast--on {
  color: #baffde;
}

@keyframes status-toast-fade {
  0%,
  70% {
    opacity: 1;
    transform: translateY(0);
  }

  100% {
    opacity: 0;
    transform: translateY(-6px);
  }
}

.dashboard {
  display: grid;
  gap: 24px;
}

.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 14px 10px;
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--card-strong);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.status.pending {
  color: #ffe3ad;
}

.status.active {
  color: #baffde;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inline-form {
  display: inline;
}

.small {
  font-size: 0.9rem;
}

a.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 999px;
  padding: 13px 18px;
  font-weight: 800;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.gallery-item {
  display: grid;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: var(--card-strong);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.gallery-item:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.gallery-meta {
  display: grid;
  gap: 6px;
  padding: 0 14px 14px;
}

.album-placeholder {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  background: var(--card-strong);
  color: var(--accent);
  font-size: 3rem;
  font-weight: 800;
}

.photo-detail {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: #0f1426;
}

.comment-list {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
}

.comment {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  background: var(--card-strong);
}

.comment-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.comment p {
  margin: 0;
}

.small-button {
  padding: 6px 12px;
  font-size: 0.82rem;
}

.comment a {
  color: var(--accent);
  word-break: break-word;
}

.mention {
  color: #baffde;
  font-weight: 800;
}

.mention-field {
  position: relative;
}

.composer-field {
  position: relative;
}

.composer-toolbar {
  display: flex;
  justify-content: flex-start;
  margin-top: 8px;
}

.emoji-toggle {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card-strong);
  color: var(--text);
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 700;
}

.emoji-toggle:hover {
  border-color: var(--accent);
  background: rgba(124, 219, 179, 0.08);
  transform: none;
}

.emoji-picker {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 60;
  display: grid;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(15, 20, 38, 0.98);
  padding: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.emoji-picker-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.emoji-picker-tab {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 700;
}

.emoji-picker-tab.is-active,
.emoji-picker-tab:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--card-strong);
  transform: none;
}

.emoji-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
}

.emoji-picker-item {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  padding: 8px 0;
  font-size: 1.35rem;
  line-height: 1;
}

.emoji-picker-item:hover {
  background: var(--card-strong);
  transform: none;
}

.mention-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 8px);
  z-index: 50;
  display: grid;
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(15, 20, 38, 0.98);
  padding: 8px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.mention-suggestion {
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
  font-weight: 700;
}

.mention-suggestion:hover {
  background: var(--card-strong);
  transform: none;
}

.messages-card {
  padding: 0;
  overflow: hidden;
}

.messages-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  min-height: 560px;
}

.messages-sidebar {
  display: grid;
  align-content: start;
  gap: 12px;
  border-right: 1px solid var(--border);
  padding: 20px;
  background: rgba(15, 20, 38, 0.45);
}

.messages-sidebar-title {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.message-thread-list {
  display: grid;
  gap: 8px;
}

.message-thread {
  display: grid;
  gap: 4px;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--card-strong);
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.message-thread:hover,
.message-thread.is-active {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.message-thread--broadcast {
  border-color: rgba(124, 219, 179, 0.35);
  background: rgba(124, 219, 179, 0.06);
}

.messages-compose--broadcast {
  padding-top: 24px;
}

.message-thread-preview {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.messages-main {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 560px;
}

.messages-main-header {
  padding: 20px 24px 12px;
  border-bottom: 1px solid var(--border);
}

.messages-main-header h3 {
  margin: 0;
}

.message-history {
  display: grid;
  align-content: start;
  gap: 12px;
  overflow-y: auto;
  padding: 20px 24px;
  max-height: 420px;
}

.message-bubble {
  max-width: min(100%, 640px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
  background: var(--card-strong);
}

.message-bubble--own {
  margin-left: auto;
  border-color: rgba(124, 219, 179, 0.45);
  background: rgba(124, 219, 179, 0.08);
}

.message-bubble-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.message-bubble-body {
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.message-bubble-body a {
  color: var(--accent);
  word-break: break-word;
}

.messages-compose {
  border-top: 1px solid var(--border);
  padding: 20px 24px 24px;
}

.messages-compose-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.messages-empty {
  display: grid;
  place-content: center;
  gap: 8px;
  min-height: 560px;
  padding: 24px;
  text-align: center;
}

@media (max-width: 760px) {
  .grid,
  .dashboard-header {
    grid-template-columns: 1fr;
    display: grid;
  }

  .page-shell {
    padding: 32px 0;
  }

  .messages-layout {
    grid-template-columns: 1fr;
  }

  .messages-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .messages-main,
  .messages-empty {
    min-height: auto;
  }

  .message-history {
    max-height: 320px;
  }
}
