:root {
  color-scheme: dark;
  --bg: #150f0b;
  --panel: #2b1d14;
  --panel-strong: #3a291a;
  --panel-soft: #513621;
  --line: #7c5738;
  --text: #fff5de;
  --muted: #d8b98d;
  --accent: #f58a3d;
  --leaf: #8ecb62;
  --gold: #f5c84c;
  --safe: #80bd63;
  --questionable: #d5963e;
  --explicit: #c7564c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 10% 18%, rgba(245, 138, 61, 0.14), transparent 18%),
    radial-gradient(circle at 86% 6%, rgba(142, 203, 98, 0.12), transparent 17%),
    repeating-linear-gradient(135deg, rgba(255, 238, 200, 0.025) 0 1px, transparent 1px 18px),
    var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  min-height: 64px;
  padding: 0 18px;
  border-bottom: 1px solid #4a321f;
  background:
    linear-gradient(180deg, rgba(255, 235, 193, 0.06), transparent),
    #1f150f;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 800;
  white-space: nowrap;
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 10px;
}

.brand-mark {
  position: relative;
  width: 28px;
  height: 28px;
  background: #fff0d0;
  border-radius: 50% 50% 46% 46%;
  box-shadow: inset -4px -3px 0 #e6c99b, 0 0 0 2px #6a4428;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  top: -9px;
  width: 8px;
  height: 19px;
  background: #fff0d0;
  border: 2px solid #6a4428;
  border-bottom: 0;
  border-radius: 8px 8px 2px 2px;
}

.brand-mark::before {
  left: 4px;
  transform: rotate(-18deg);
}

.brand-mark::after {
  right: 4px;
  transform: rotate(18deg);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.site-nav a,
.quiet-button,
.search button,
.view-controls button,
.inspector-actions button,
.tag-chip {
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
}

.site-nav a {
  padding: 8px 12px;
}

.site-nav a.active,
.site-nav a:hover,
.quiet-button:hover {
  background: #4a321f;
}

.quiet-button {
  padding: 8px 12px;
}

.hamburger {
  display: inline-grid;
  gap: 4px;
  width: 40px;
  height: 40px;
  place-content: center;
  border: 1px solid #7c5738;
  border-radius: 999px;
  background: #3a291a;
}

.hamburger span {
  display: block;
  width: 17px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
}

.app {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.command-deck {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(280px, 1fr);
  gap: 16px;
  align-items: end;
  padding: 18px;
  border: 1px solid #6a4529;
  border-radius: 10px;
  background:
    radial-gradient(circle at 8% 18%, rgba(245, 138, 61, 0.2), transparent 21%),
    radial-gradient(circle at 88% 16%, rgba(142, 203, 98, 0.17), transparent 18%),
    linear-gradient(135deg, #3b2718, #21150e);
}

.eyebrow,
.command-deck h1,
.command-deck p {
  margin: 0;
}

.eyebrow {
  color: var(--leaf);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.command-deck h1 {
  max-width: 620px;
  margin-top: 4px;
  font-size: clamp(28px, 4vw, 54px);
  line-height: 0.98;
}

.search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.search input {
  min-width: 0;
  border: 1px solid #7c5738;
  border-radius: 999px;
  padding: 12px 14px;
  background: #fff6e3;
  color: #2d1d12;
}

.search button,
.view-controls button,
.inspector-actions button {
  border-color: #7c5738;
  background: #5a3a22;
  padding: 10px 14px;
}

.search button:hover,
.view-controls button:hover,
.view-controls button.active,
.inspector-actions button:hover {
  background: #704827;
}

.quick-tags {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(10, 6, 4, 0.58);
}

.tag-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 21;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 14px;
  width: min(420px, calc(100vw - 28px));
  height: 100vh;
  padding: 18px;
  border-left: 1px solid #7c5738;
  background:
    radial-gradient(circle at 18% 12%, rgba(245, 138, 61, 0.14), transparent 18%),
    linear-gradient(180deg, #2b1d14, #1b120d);
  box-shadow: -24px 0 50px rgba(0, 0, 0, 0.42);
  transform: translateX(104%);
  transition: transform 180ms ease;
}

.tag-drawer.open {
  transform: translateX(0);
}

.drawer-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drawer-heading h2,
.drawer-heading p {
  margin: 0;
}

.drawer-heading h2 {
  font-size: 28px;
}

.drawer-heading button {
  width: 36px;
  height: 36px;
  border: 1px solid #7c5738;
  border-radius: 999px;
  background: #5a3a22;
  color: var(--text);
}

.drawer-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.drawer-search input {
  min-width: 0;
  border: 1px solid #7c5738;
  border-radius: 999px;
  padding: 10px 12px;
  background: #fff6e3;
  color: #2d1d12;
}

.drawer-search button {
  border: 1px solid #7c5738;
  border-radius: 999px;
  background: #5a3a22;
  color: var(--text);
  padding: 10px 12px;
}

.atlas-grid {
  align-content: start;
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.atlas-tag {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(255, 245, 222, 0.14);
  border-radius: 8px;
  background: rgba(21, 15, 11, 0.3);
  color: var(--text);
  padding: 10px;
  text-align: left;
}

.atlas-tag:hover,
.atlas-tag.active {
  border-color: var(--accent);
  background: rgba(112, 72, 39, 0.55);
}

.atlas-tag small {
  color: var(--muted);
}

.tag-chip {
  border-color: rgba(255, 245, 222, 0.16);
  background: rgba(21, 15, 11, 0.3);
  padding: 7px 10px;
  color: var(--muted);
}

.tag-chip strong {
  color: var(--text);
}

.tag-chip.active,
.tag-chip:hover {
  border-color: var(--accent);
  color: var(--text);
}

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.full-board-workbench {
  grid-template-columns: 1fr;
}

.chamber-view {
  display: grid;
  gap: 14px;
}

.chamber-nav {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid #4a321f;
  border-radius: 10px;
  padding: 10px;
  background: rgba(43, 29, 20, 0.94);
}

.chamber-nav p {
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.chamber-nav div {
  display: flex;
  gap: 8px;
}

.chamber-nav button,
.nav-button,
.wide-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #7c5738;
  border-radius: 999px;
  background: #5a3a22;
  color: var(--text);
  padding: 10px 14px;
}

.chamber-nav button:hover,
.nav-button:hover,
.wide-button:hover {
  background: #704827;
}

.chamber {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  overflow: hidden;
  border: 1px solid #4a321f;
  border-radius: 12px;
  background: rgba(43, 29, 20, 0.94);
}

.chamber-art {
  display: grid;
  min-height: min(72vh, 780px);
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 90%, rgba(48, 28, 16, 0.78), transparent 46%),
    radial-gradient(circle at 18% 14%, rgba(255, 235, 187, 0.17), transparent 20%),
    linear-gradient(135deg, var(--c1), var(--c2));
}

.chamber-art svg {
  width: min(72vw, 920px);
  max-height: 720px;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.36));
}

.chamber-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
  border-left: 1px solid #4a321f;
  background: rgba(31, 21, 15, 0.78);
}

.chamber-panel h1,
.chamber-panel h2,
.chamber-panel p {
  margin: 0;
}

.chamber-panel h1,
.chamber-panel h2 {
  font-size: 28px;
}

.chamber-panel > p:not(.rating-pill) {
  color: var(--muted);
}

.wide-button {
  width: 100%;
}

.auth-dialog {
  width: min(420px, calc(100vw - 28px));
  padding: 0;
  border: 1px solid #7c5738;
  border-radius: 12px;
  background: #24170f;
  color: var(--text);
}

.auth-dialog::backdrop {
  background: rgba(10, 6, 4, 0.68);
}

.auth-card {
  position: relative;
  display: grid;
  gap: 13px;
  padding: 22px;
  background:
    radial-gradient(circle at 18% 12%, rgba(245, 138, 61, 0.15), transparent 20%),
    linear-gradient(180deg, #2f2015, #1d130d);
}

.auth-card h2,
.auth-card p {
  margin: 0;
}

.auth-card h2 {
  font-size: 30px;
}

.auth-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.provider-stack {
  display: grid;
  gap: 8px;
}

.provider-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid #7c5738;
  border-radius: 999px;
  background: #fff6e3;
  color: #2d1d12;
  font-weight: 800;
}

.provider-button.discord {
  background: #5865f2;
  color: #ffffff;
}

.provider-button.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  background: rgba(255, 245, 222, 0.16);
}

.auth-card input {
  width: 100%;
  border: 1px solid #7c5738;
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff6e3;
  color: #2d1d12;
}

.admin-claim {
  display: grid;
  gap: 10px;
}

.admin-claim label {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.admin-claim input {
  width: 100%;
  border: 1px solid #7c5738;
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff6e3;
  color: #2d1d12;
}

.dialog-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 1px solid #7c5738;
  border-radius: 999px;
  background: #5a3a22;
  color: var(--text);
}

.link-button {
  border: 0;
  background: transparent;
  color: #ffe1b6;
  padding: 4px;
}

.auth-error {
  min-height: 18px;
  color: #ffb2a9;
  font-size: 13px;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  padding: 22px;
  border: 1px solid #6a4529;
  border-radius: 12px;
  background:
    radial-gradient(circle at 8% 18%, rgba(245, 138, 61, 0.2), transparent 21%),
    radial-gradient(circle at 88% 16%, rgba(142, 203, 98, 0.17), transparent 18%),
    linear-gradient(135deg, #3b2718, #21150e);
}

.dashboard-hero h1,
.dashboard-hero p {
  margin: 0;
}

.dashboard-hero h1 {
  max-width: 760px;
  margin-top: 4px;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 0.98;
}

.dashboard-hero > div > p:not(.eyebrow) {
  margin-top: 10px;
  color: var(--muted);
}

.dashboard-actions {
  display: grid;
  gap: 8px;
  min-width: 180px;
}

.danger-button {
  background: #73352c;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) repeat(2, minmax(240px, 1fr));
  gap: 16px;
}

.dashboard-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 240px;
  padding: 18px;
  border: 1px solid #4a321f;
  border-radius: 12px;
  background: rgba(43, 29, 20, 0.94);
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.22);
}

.dashboard-panel h2,
.dashboard-panel p {
  margin: 0;
}

.profile-panel {
  grid-row: span 2;
}

.avatar-seed {
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  border: 2px solid #7c5738;
  border-radius: 26px;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 245, 222, 0.34), transparent 24%),
    linear-gradient(135deg, #8b5a34, #4b2f1c);
  color: #fff5de;
  font-size: 30px;
  font-weight: 900;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.metric-row span,
.provider-status span {
  border: 1px solid rgba(255, 245, 222, 0.14);
  border-radius: 8px;
  padding: 10px;
  background: rgba(21, 15, 11, 0.3);
  color: var(--muted);
}

.metric-row strong {
  display: block;
  color: var(--text);
  font-size: 24px;
}

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

.provider-status {
  display: grid;
  gap: 8px;
}

.provider-status span.active {
  border-color: var(--leaf);
  color: var(--text);
}

.provider-status span.muted {
  opacity: 0.55;
}

.tool-list {
  display: grid;
  gap: 8px;
}

.tool-list button {
  border: 1px solid #7c5738;
  border-radius: 999px;
  background: #5a3a22;
  color: var(--text);
  padding: 10px 14px;
}

.tool-list button:hover {
  background: #704827;
}

.session-list {
  display: grid;
  gap: 8px;
}

.session-item {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(255, 245, 222, 0.14);
  border-radius: 8px;
  padding: 10px;
  background: rgba(21, 15, 11, 0.3);
  color: var(--muted);
}

.session-item strong {
  color: var(--text);
}

.session-item.active {
  border-color: var(--leaf);
}

.related-chamber {
  display: grid;
  gap: 10px;
  border: 1px solid #4a321f;
  border-radius: 10px;
  padding: 14px;
  background: rgba(43, 29, 20, 0.94);
}

.related-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.lane-board,
.post-inspector {
  border: 1px solid #4a321f;
  border-radius: 10px;
  background: rgba(43, 29, 20, 0.94);
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.22);
}

.board-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid #4a321f;
}

.board-topline p {
  margin: 0;
  color: var(--muted);
}

.view-controls {
  display: inline-flex;
  gap: 6px;
}

.view-controls button {
  padding: 7px 11px;
}

.lanes {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.full-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  padding: 14px;
}

.full-gallery.dense {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.lane {
  display: grid;
  gap: 10px;
}

.lane-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.lane-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: 19px;
}

.lane-heading::after {
  content: "";
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, #7c5738, transparent);
}

.lane-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.lanes.dense .lane-cards {
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
}

.post-card {
  display: grid;
  grid-template-rows: minmax(170px, 1fr) auto;
  min-width: 0;
  min-height: 255px;
  overflow: hidden;
  border: 2px solid #7c5738;
  border-radius: 10px;
  background: var(--panel-soft);
  color: var(--text);
  text-align: left;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

.post-card.safe {
  border-color: var(--safe);
}

.post-card.questionable {
  border-color: var(--questionable);
}

.post-card.explicit {
  border-color: var(--explicit);
}

.post-card:hover,
.post-card.selected {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.thumb,
.inspector-art {
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 84%, rgba(48, 28, 16, 0.68), transparent 42%),
    radial-gradient(circle at 20% 18%, rgba(255, 235, 187, 0.18), transparent 20%),
    linear-gradient(135deg, var(--c1), var(--c2));
}

.thumb svg {
  width: 82%;
  max-height: 160px;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.28));
}

.card-body {
  display: grid;
  gap: 6px;
  padding: 10px;
}

.card-body strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.post-inspector {
  position: sticky;
  top: 14px;
  overflow: hidden;
}

.inspector-art {
  min-height: 275px;
}

.inspector-art svg {
  width: 78%;
  max-height: 250px;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.3));
}

.inspector-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.rating-pill {
  justify-self: start;
  margin: 0;
  border-radius: 999px;
  padding: 5px 9px;
  background: #5a3a22;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.inspector-body h2,
.inspector-body p {
  margin: 0;
}

.inspector-body h2 {
  font-size: 25px;
}

.inspector-body > p:not(.rating-pill) {
  color: var(--muted);
}

.stat-list {
  display: grid;
  gap: 7px;
  margin: 0;
}

.stat-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 245, 222, 0.12);
  padding-bottom: 6px;
}

.stat-list dt {
  color: var(--muted);
}

.stat-list dd {
  margin: 0;
}

.inspector-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.inspector-tags button {
  border: 1px solid #7c5738;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  padding: 5px 8px;
}

.inspector-tags a {
  border: 1px solid #7c5738;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  padding: 5px 8px;
}

.inspector-tags button:hover {
  border-color: var(--accent);
}

.inspector-tags a:hover {
  border-color: var(--accent);
}

.inspector-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.inspector-actions button:first-child,
.inspector-actions button:last-child {
  grid-column: 1 / -1;
}

@media (max-width: 980px) {
  .site-header,
  .command-deck,
  .dashboard-hero,
  .dashboard-grid,
  .workbench,
  .chamber,
  .chamber-nav {
    grid-template-columns: 1fr;
  }

  .site-nav {
    order: 3;
  }

  .post-inspector {
    position: static;
  }

  .dashboard-actions {
    min-width: 0;
  }

  .chamber-nav p {
    text-align: left;
  }

  .chamber-panel {
    border-top: 1px solid #4a321f;
    border-left: 0;
  }
}

@media (max-width: 620px) {
  .app {
    padding: 12px;
  }

  .command-deck {
    padding: 14px;
  }

  .search,
  .board-topline {
    grid-template-columns: 1fr;
  }

  .board-topline {
    align-items: flex-start;
    display: grid;
  }

  .lane-cards {
    grid-template-columns: 1fr;
  }

  .full-gallery {
    grid-template-columns: 1fr;
  }
}
