:root {
  --bg-a: #f6efe3;
  --bg-b: #fff8ed;
  --text: #201a17;
  --muted: #65574f;
  --line: rgba(127, 101, 82, 0.22);
  --card: rgba(255, 252, 248, 0.9);
  --brand: #da4a26;
  --brand-strong: #b83312;
  --secondary: #2f4f6f;
  --ok: #13795b;
  --warn: #ad6200;
  --bad: #a42f22;
  --shadow: 0 20px 45px rgba(78, 48, 33, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 14% 10%, rgba(241, 168, 93, 0.2), transparent 28%),
    radial-gradient(circle at 80% 0%, rgba(55, 104, 179, 0.12), transparent 33%),
    linear-gradient(180deg, var(--bg-a) 0%, var(--bg-b) 55%, #fff 100%);
  font-family: "Space Grotesk", "IBM Plex Sans", "Avenir Next", sans-serif;
}

.layout {
  margin: 0 auto;
  width: min(1160px, 92%);
  padding: 24px 0 54px;
}

.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.66);
  margin-bottom: 18px;
}

.brand {
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav-link {
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
  padding: 7px 11px;
  border-radius: 10px;
  border: 1px solid transparent;
}

.nav-link:hover {
  border-color: var(--line);
  color: var(--text);
}

.nav-link.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
}

.hero {
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.hero h1 {
  margin: 8px 0 10px;
  font-size: clamp(2.1rem, 4.8vw, 3.4rem);
  line-height: 1.06;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  max-width: 780px;
}

.top-actions {
  margin-top: 16px;
}

.role-switch {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
}

.tab-button {
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  padding: 8px 14px;
}

.tab-button.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
}

.card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.api-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  align-items: end;
}

.view-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}

.view-grid > .card {
  grid-column: span 6;
}

.view-grid > .span-full {
  grid-column: 1 / -1;
}

.is-hidden {
  display: none;
}

h2 {
  margin: 0 0 10px;
  font-size: 1.25rem;
}

label {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 6px;
}

input,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(130, 104, 84, 0.32);
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  margin-bottom: 10px;
  font: inherit;
}

textarea {
  min-height: 130px;
  resize: vertical;
}

input:focus,
textarea:focus {
  outline: 2px solid rgba(218, 74, 38, 0.2);
  border-color: rgba(218, 74, 38, 0.45);
}

.hint {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

button {
  border: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #fff;
  padding: 9px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease;
}

button:hover {
  transform: translateY(-1px);
  filter: saturate(1.05);
}

.button-secondary {
  background: linear-gradient(135deg, #42627f, var(--secondary));
}

.button-danger {
  background: linear-gradient(135deg, #bf3d2c, #9f2b1d);
}

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

pre {
  margin: 10px 0 0;
  min-height: 100px;
  white-space: pre-wrap;
  background: #1c1a19;
  color: #f6ece2;
  border-radius: 12px;
  padding: 11px;
  font-family: "IBM Plex Mono", "Cascadia Code", monospace;
  font-size: 0.86rem;
}

#postsList,
#adminPostsList,
#moderationReportsList,
#blockedUsersList {
  display: grid;
  gap: 10px;
}

.post-item {
  border: 1px solid rgba(133, 104, 83, 0.28);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  padding: 14px;
}

.post-item h3 {
  margin: 6px 0;
}

.post-item p {
  margin: 0 0 10px;
  color: #4a3f38;
}

.post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--muted);
}

.post-identity {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 98px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.badge-pending {
  background: rgba(173, 98, 0, 0.14);
  color: var(--warn);
}

.badge-approved {
  background: rgba(19, 121, 91, 0.14);
  color: var(--ok);
}

.badge-rejected {
  background: rgba(164, 47, 34, 0.14);
  color: var(--bad);
}

.posts-empty {
  border-radius: 12px;
  border: 1px dashed rgba(130, 103, 85, 0.38);
  color: var(--muted);
  padding: 14px;
  background: rgba(255, 255, 255, 0.55);
}

code {
  font-family: "IBM Plex Mono", "Cascadia Code", monospace;
  font-size: 0.82rem;
  word-break: break-all;
}

.metric-card {
  text-align: center;
}

.metric-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.metric-card strong {
  display: block;
  margin-top: 5px;
  font-size: 2rem;
}

.report-summary ul {
  list-style: none;
  margin: 8px 0 12px;
  padding: 0;
  display: grid;
  gap: 6px;
}

.report-summary li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(131, 103, 83, 0.2);
}

.report-row,
.blocked-user-row {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(130, 103, 85, 0.22);
  background: rgba(255, 255, 255, 0.78);
}

.report-row p {
  margin: 5px 0 0;
}

.report-row-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.83rem;
  color: var(--muted);
}

.blocked-user-row {
  grid-template-columns: minmax(140px, 2fr) minmax(130px, 1fr) minmax(200px, 2fr) minmax(170px, 1fr);
  align-items: center;
  font-size: 0.9rem;
}

.bullet-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}

.bullet-grid > .card {
  grid-column: span 6;
}

.bullet-grid > .span-full {
  grid-column: 1 / -1;
}

.talk-list,
.flow-list,
.qa-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

.talk-list li,
.flow-list li,
.qa-list li {
  color: #3f352f;
}

.focus-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.flow-list strong,
.qa-list strong,
.talk-list strong {
  color: var(--text);
}

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

.screenshot-slot {
  border: 1px dashed rgba(130, 103, 85, 0.45);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.66);
}

.screenshot-slot p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.screenshot-slot strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
}

/* Demo Page Document-Style Presentation */
.demo-document {
  margin: 0 auto;
  width: 100%;
  max-width: none;
  padding: 30px 40px 60px;
  max-width: 1000px;
  line-height: 1.65;
}

.demo-header {
  margin-bottom: 30px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
}

.demo-header h1 {
  margin: 0 0 8px;
  font-size: 2rem;
  line-height: 1.2;
}

.demo-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.demo-section {
  margin-bottom: 32px;
}

.demo-section h2 {
  margin: 24px 0 12px;
  font-size: 1.45rem;
  line-height: 1.3;
  color: var(--text);
}

.demo-note {
  margin: 10px 0;
  color: #555;
  font-size: 0.95rem;
}

.demo-list {
  margin: 10px 0 20px 20px;
  padding: 0;
}

.demo-list li {
  margin-bottom: 8px;
  line-height: 1.6;
  color: #3a3a3a;
}

.demo-list strong {
  color: var(--text);
}

.demo-list code {
  background: #f0f0f0;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.9em;
}

.demo-diagram-figure {
  margin: 18px 0 0;
}

.demo-diagram-image {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(130, 103, 85, 0.18);
}

@media (max-width: 980px) {
  .view-grid > .card {
    grid-column: 1 / -1;
  }

  .bullet-grid > .card {
    grid-column: 1 / -1;
  }

  .blocked-user-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .layout {
    width: min(100%, 95%);
  }

  .site-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-links {
    width: 100%;
  }

  .nav-link {
    text-align: center;
    flex: 1 1 100%;
  }

  .actions,
  .section-header {
    flex-direction: column;
    align-items: stretch;
  }

  button {
    width: 100%;
  }
}