:root {
  --bg: #050913;
  --panel: rgba(8, 12, 22, 0.94);
  --card: rgba(10, 16, 30, 0.9);
  --border: rgba(110, 156, 219, 0.32);
  --border-strong: rgba(148, 193, 255, 0.5);
  --accent: #66c0ff;
  --accent-2: #8bcaff;
  --text: #e8f1ff;
  --muted: #9fb4d2;
  --danger: #ff7b7b;
  --shadow: rgba(0, 0, 0, 0.55);
  --glare: rgba(117, 185, 255, 0.16);
  --grain: rgba(255, 255, 255, 0.05);
  --font: "Space Grotesk", "JetBrains Mono", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: linear-gradient(160deg, #050913 0%, #03070f 60%, #050913 100%);
  line-height: 1.45;
  letter-spacing: -0.01em;
  color-scheme: dark;
}

body.locked {
  background: linear-gradient(150deg, #040812 0%, #03060f 60%, #050913 100%);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: #a9d8ff;
}

main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 16px 48px;
  position: relative;
  z-index: 1;
}

body.locked main {
  max-width: 840px;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 56px 16px;
}

main::before {
  content: none;
}

.background {
  position: fixed;
  inset: 0;
  background: linear-gradient(175deg, #03060f 0%, #02040a 60%, #03060f 100%);
  overflow: hidden;
  z-index: 0;
}

.background::after {
  content: none;
}

.bg-grid,
.bg-noise {
  display: none;
}

.panel {
  background: rgba(8, 12, 22, 0.95);
  border: 1px solid rgba(110, 156, 219, 0.28);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  backdrop-filter: none;
  position: relative;
  overflow: hidden;
}

.panel::before,
.panel::after {
  content: none;
}

.panel + .panel {
  margin-top: 16px;
}

body.locked .panel {
  border-color: var(--border-strong);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.55);
}

.access-panel {
  display: grid;
  gap: 12px;
  align-items: center;
  justify-items: center;
  padding: 36px 28px 30px;
  text-align: center;
  background: rgba(7, 11, 20, 0.95);
  width: min(620px, 100%);
}

.access-panel .panel-header {
  margin-bottom: 4px;
}

.access-panel .auth-form {
  width: 100%;
  display: grid;
  gap: 6px;
}

.access-panel .input-row {
  width: 100%;
}

.access-panel input[type="password"] {
  font-family: "JetBrains Mono", var(--font);
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.05);
}

.access-panel .btn {
  min-width: 128px;
}

.lock-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.lock-crest {
  position: relative;
  width: 180px;
  aspect-ratio: 1 / 1;
  margin: -6px auto 6px;
  filter: none;
}

.crest-ring {
  position: absolute;
  inset: 0;
  display: block;
  border-radius: 50%;
  border: 1px solid rgba(102, 192, 255, 0.25);
  background: none;
  animation: none;
}

.crest-ring.inner {
  inset: 16px;
  border-color: rgba(102, 192, 255, 0.35);
  animation: none;
}

.crest-core {
  position: absolute;
  inset: 42px;
  display: block;
  border-radius: 50%;
  background: rgba(102, 192, 255, 0.08);
  box-shadow: 0 0 0 1px rgba(102, 192, 255, 0.25);
  animation: none;
}

.crest-spark {
  display: none;
}

.lock-trace {
  width: 100%;
  display: grid;
  gap: 8px;
  justify-items: center;
  margin-top: 2px;
}

.trace-line {
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, rgba(102, 192, 255, 0.35), rgba(102, 192, 255, 0.08));
  filter: none;
}

.login-note {
  margin: 4px 0 0;
}

.btn-compact {
  padding: 8px 12px;
  font-size: 14px;
}

h1,
h2,
h3 {
  margin: 6px 0 8px;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 8px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(102, 192, 255, 0.18);
  background: linear-gradient(120deg, rgba(102, 192, 255, 0.12), rgba(255, 255, 255, 0.02));
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
}

.badge-accent {
  border-color: var(--border-strong);
  color: var(--accent);
  box-shadow: 0 0 0 1px rgba(102, 192, 255, 0.15);
}

.badge-ghost {
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}

.panel-header {
  margin-bottom: 16px;
}

.auth-form label,
.search label {
  font-size: 14px;
  color: var(--muted);
}

.input-row {
  display: flex;
  gap: 8px;
  margin: 8px 0 4px;
}

input[type="password"],
input[type="search"] {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-family: var(--font);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: inset 0 0 0 1px rgba(102, 192, 255, 0.07);
}

input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

input:focus {
  outline: none;
  border-color: var(--border-strong);
  box-shadow: 0 0 0 2px rgba(102, 192, 255, 0.14), inset 0 0 0 1px rgba(102, 192, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
}

.btn {
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: linear-gradient(120deg, #0b5aa1, #118adf);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 18px rgba(17, 138, 223, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(102, 192, 255, 0.24);
}

.btn:hover {
  border-color: rgba(148, 193, 255, 0.8);
  box-shadow: 0 8px 18px rgba(17, 138, 223, 0.35);
}

.btn-ghost:hover {
  background: rgba(102, 192, 255, 0.08);
}

.error {
  margin-top: 8px;
  color: var(--danger);
  font-size: 13px;
}

.hidden {
  display: none !important;
}

.key-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.04), rgba(102, 192, 255, 0.08));
  font-size: 12px;
  color: var(--text);
}

.chip-ghost {
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.chip-ghost::before {
  content: "•";
  color: rgba(255, 255, 255, 0.35);
}

.chip-live {
  color: var(--accent);
  border-color: rgba(102, 192, 255, 0.5);
  box-shadow: none;
  animation: none;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(102, 192, 255, 0.18);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.02), rgba(102, 192, 255, 0.04));
  border-radius: 12px;
  padding: 12px;
  margin: -6px -12px 6px;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-tabs {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.nav-tab {
  background: transparent;
  color: var(--text);
  border: none;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.01em;
}

.nav-tab + .nav-tab {
  border-left: 1px solid var(--border);
}

.nav-tab.active {
  background: linear-gradient(120deg, rgba(102, 192, 255, 0.18), rgba(51, 134, 255, 0.16));
  box-shadow: 0 0 0 1px rgba(102, 192, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.nav-tab:hover {
  background: rgba(255, 255, 255, 0.06);
}

.label {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.ticker {
  margin: 16px 0 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(102, 192, 255, 0.08), rgba(51, 134, 255, 0.07));
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.ticker-label {
  padding: 8px 12px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.ticker-track {
  padding: 10px 12px;
  white-space: nowrap;
  animation: ticker 26s linear infinite;
}

.ticker-track span {
  display: inline-block;
  padding-right: 48px;
}

@keyframes ticker {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.stat-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.stat-value {
  font-size: 32px;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.stat-value.warning {
  color: var(--accent-2);
}

.board-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}

.search-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.category-bar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.category-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.threads,
.thread-detail {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.search {
  margin-bottom: 0;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0 8px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.intel-box {
  padding: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.24);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.intel-box ul {
  padding-left: 18px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.category-card,
.member-card {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease, background 0.2s ease;
  position: relative;
  overflow: hidden;
}

.category-card::before,
.member-card::before {
  content: none;
}

.category-card:hover,
.member-card:hover {
  border-color: rgba(148, 193, 255, 0.6);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

.category-card.active {
  background: rgba(102, 192, 255, 0.08);
  border-color: var(--border-strong);
  box-shadow: 0 8px 18px rgba(102, 192, 255, 0.08);
}

.category-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

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

.category-meta,
.member-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.member-card {
  cursor: default;
}

.member-card::after {
  content: none;
}

.member-name {
  font-weight: 700;
}

.threads-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.thread-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 600px;
  overflow-y: auto;
  padding-right: 4px;
}

.thread-card {
  padding: 12px 12px 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease, background 0.2s ease;
  position: relative;
}

.thread-card::before {
  content: "";
  position: absolute;
  inset: 10px auto 10px 6px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), rgba(102, 192, 255, 0.1));
  opacity: 0.6;
}

.thread-card:hover {
  border-color: rgba(102, 192, 255, 0.6);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
  background: rgba(255, 255, 255, 0.03);
}

.thread-card.active {
  border-color: var(--border-strong);
  background: rgba(102, 192, 255, 0.08);
  box-shadow: 0 8px 18px rgba(102, 192, 255, 0.1);
}

.thread-meta,
.post-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.tag {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(102, 192, 255, 0.3);
  font-size: 12px;
  background: rgba(102, 192, 255, 0.08);
  color: var(--text);
}

.thread-detail {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 540px;
  overflow: hidden;
}

.thread-header {
  margin: -14px -14px 12px;
  width: calc(100% + 28px);
  padding: 18px 22px 16px;
  background: rgba(10, 16, 28, 0.95);
  border-bottom: 1px solid var(--border-strong);
  border-radius: 12px 12px 10px 10px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

.board-main {
  display: grid;
  grid-template-columns: minmax(340px, 420px) 1fr;
  gap: 12px;
}

.thread-meta {
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.thread-title {
  margin: 0;
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  max-height: 600px;
  padding-right: 4px;
}

.post {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  box-shadow: none;
  position: relative;
}

.post::before {
  content: none;
}

.post-body {
  line-height: 1.5;
  white-space: pre-wrap;
}

.attachments {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.attachment {
  border: 1px dashed rgba(255, 255, 255, 0.2);
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.link {
  color: var(--accent);
}

.members-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.member-line {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.member-note {
  color: var(--muted);
  font-size: 13px;
}

.board-note {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  box-shadow: none;
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}

::-webkit-scrollbar-thumb {
  background: rgba(102, 192, 255, 0.3);
  border-radius: 12px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(102, 192, 255, 0.45);
}

@media (max-width: 1100px) {
  .search-row {
    grid-template-columns: 1fr;
  }
  .board-main {
    grid-template-columns: 1fr;
  }
  .thread-detail {
    min-height: auto;
  }
}

@media (max-width: 700px) {
  main {
    padding: 16px 12px 32px;
  }
  .pinned {
    grid-template-columns: 1fr;
  }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}
