:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #181b21;
  --muted: #667085;
  --line: #d7dce5;
  --accent: #0f766e;
  --accent-strong: #0a5f59;
  --warn: #8a4b00;
  --danger: #a4343a;
  --shadow: 0 12px 28px rgba(18, 24, 38, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

body {
  margin: 0;
}

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

a:hover {
  color: var(--accent);
}

button,
.button-link {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  min-height: 38px;
  padding: 0 14px;
}

button:hover,
.button-link:hover {
  background: var(--accent-strong);
  color: #fff;
}

button.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.topbar {
  align-items: center;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 clamp(16px, 4vw, 44px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-size: 1.25rem;
  font-weight: 850;
}

.nav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.page {
  margin: 0 auto;
  max-width: 1180px;
  padding: 28px clamp(16px, 4vw, 44px) 56px;
}

.narrow {
  max-width: 780px;
}

.feed-layout {
  align-items: start;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr) 280px;
}

.section-title {
  margin-bottom: 20px;
}

h1,
h2 {
  letter-spacing: 0;
  line-height: 1.12;
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
  font-size: 1.05rem;
}

.section-title p,
.meta,
.profile-head p,
.empty {
  color: var(--muted);
}

.post-grid {
  column-count: 2;
  column-gap: 18px;
}

.post,
.panel,
.sidebar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.post {
  break-inside: avoid;
  display: inline-block;
  margin: 0 0 18px;
  overflow: hidden;
  width: 100%;
}

.post-head,
.post-actions,
.tags,
.reblog-source,
.post-body {
  padding-left: 16px;
  padding-right: 16px;
}

.post-head {
  align-items: center;
  display: flex;
  gap: 10px;
  padding-bottom: 12px;
  padding-top: 14px;
}

.avatar {
  align-items: center;
  background: #111827;
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  flex: 0 0 auto;
  font-weight: 800;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.avatar.large {
  font-size: 2rem;
  height: 88px;
  width: 88px;
}

.author {
  font-weight: 800;
}

.media-wrap {
  background: #eef1f6;
  position: relative;
}

.media-wrap img {
  display: block;
  height: auto;
  max-height: 820px;
  object-fit: contain;
  width: 100%;
}

.media-wrap.compact {
  border-radius: 6px;
  margin-top: 10px;
  overflow: hidden;
}

.media-wrap.is-blurred img {
  filter: blur(22px);
  transform: scale(1.03);
}

.adult-cover {
  align-items: center;
  background: rgba(24, 27, 33, 0.76);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 6px;
  inset: 0;
  justify-content: center;
  min-height: 180px;
  padding: 24px;
  position: absolute;
  text-align: center;
}

.post-body {
  line-height: 1.55;
  padding-bottom: 14px;
  padding-top: 14px;
}

.content-warning {
  background: #fff7ed;
  border-bottom: 1px solid #fed7aa;
  border-top: 1px solid #fed7aa;
  color: var(--warn);
  font-weight: 750;
  padding: 10px 16px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 8px;
  padding-top: 4px;
}

.tag-cloud a {
  background: #e8f5f3;
  border: 1px solid #b7dcd8;
  border-radius: 999px;
  color: #0b625c;
  display: inline-flex;
  font-weight: 750;
  gap: 6px;
  line-height: 1;
  padding: 8px 10px;
}

.tags a {
  color: var(--muted);
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.2;
}

.post-actions {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.84rem;
  gap: 8px;
  padding-bottom: 10px;
  padding-top: 8px;
}

.post-actions a,
.post-actions span,
.post-actions summary {
  color: var(--muted);
  font-weight: 750;
}

.post-actions a:hover,
.post-actions summary:hover {
  color: var(--accent);
}

.post-actions button {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: inherit;
  font-weight: 750;
  min-height: 0;
  padding: 0;
}

.post-actions button:hover {
  background: transparent;
  color: var(--accent);
}

.post-actions button.danger {
  background: transparent;
  border: 0;
  color: var(--danger);
}

.inline-form {
  display: inline;
  margin: 0;
}

.report-box {
  color: var(--muted);
  margin-left: auto;
}

.report-box form {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  width: min(260px, 80vw);
}

.reblog-source {
  background: #f9fafb;
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding-bottom: 14px;
  padding-top: 14px;
}

.sidebar,
.panel,
.profile-head {
  padding: 20px;
}

.sidebar {
  position: sticky;
  top: 88px;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.auth-panel,
.search-panel,
.single-post {
  margin: 0 auto;
  max-width: 720px;
}

.compose-shell {
  display: grid;
  gap: 18px;
}

.compose-grid {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
}

.compose-media,
.compose-details {
  display: grid;
  gap: 16px;
}

.dropzone {
  align-items: center;
  background: #f8fafc;
  border: 2px dashed #a7b3c4;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  justify-items: center;
  min-height: 150px;
  padding: 22px;
  text-align: center;
}

.dropzone span {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 850;
}

.dropzone small,
.field-note {
  color: var(--muted);
  font-weight: 650;
  line-height: 1.4;
}

.dropzone input {
  margin-top: 12px;
}

.media-preview {
  align-items: center;
  aspect-ratio: 4 / 3;
  background: #eef1f6;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-content: center;
  overflow: hidden;
  padding: 8px;
}

.media-preview img {
  aspect-ratio: 1;
  border-radius: 6px;
  height: auto;
  object-fit: cover;
  width: 100%;
}

.media-preview span {
  align-self: center;
  grid-column: 1 / -1;
  justify-self: center;
}

.editor-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.editor-toolbar button {
  background: #fff;
  color: var(--accent);
  min-height: 34px;
  min-width: 42px;
  padding: 0 10px;
}

.rich-editor {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  line-height: 1.55;
  min-height: 360px;
  padding: 14px;
}

.rich-editor:empty::before {
  color: var(--muted);
  content: attr(data-placeholder);
}

.rich-editor:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(15, 118, 110, 0.14);
}

.rich-editor p,
.rich-body p {
  margin: 0 0 12px;
}

.rich-editor blockquote,
.rich-body blockquote {
  border-left: 4px solid var(--line);
  color: #344054;
  margin: 12px 0;
  padding-left: 12px;
}

.rich-editor ul,
.rich-editor ol,
.rich-body ul,
.rich-body ol {
  margin: 0 0 12px 22px;
  padding: 0;
}

.editor-image {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 14px 0;
  overflow: hidden;
}

.editor-image img {
  display: block;
  max-height: 520px;
  object-fit: contain;
  width: 100%;
}

.editor-image figcaption {
  border-top: 1px solid var(--line);
  color: var(--muted);
  min-height: 42px;
  padding: 10px 12px;
}

.editor-image figcaption:empty::before {
  color: #98a2b3;
  content: attr(data-placeholder);
}

.legacy-body {
  display: none;
}

.compose-options {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  padding-top: 14px;
}

.compose-submit {
  display: flex;
  justify-content: flex-end;
}

form {
  display: grid;
  gap: 14px;
}

label {
  color: #344054;
  display: grid;
  gap: 7px;
  font-weight: 750;
}

input,
textarea,
select {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  min-height: 42px;
  padding: 10px 12px;
  width: 100%;
}

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

.check {
  align-items: center;
  display: flex;
  gap: 10px;
}

.check input {
  min-height: auto;
  width: auto;
}

.form-row {
  display: grid;
  gap: 14px;
  grid-template-columns: 180px minmax(0, 1fr);
}

.flash {
  border-radius: 8px;
  font-weight: 750;
  margin-bottom: 18px;
  padding: 12px 14px;
}

.flash.notice {
  background: #edfdf9;
  border: 1px solid #99f6e4;
  color: #115e59;
}

.flash.error {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: var(--danger);
}

.profile-head {
  align-items: center;
  display: flex;
  gap: 18px;
  margin-bottom: 22px;
}

.search-form {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
}

pre {
  background: #111827;
  border-radius: 6px;
  color: #f8fafc;
  overflow: auto;
  padding: 14px;
}

.site-footer {
  background: #fff;
  border-top: 1px solid var(--line);
}

.footer-inner {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1180px;
  padding: 20px clamp(16px, 4vw, 44px);
}

.footer-inner p {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-links a {
  font-weight: 750;
}

.legal-page {
  display: grid;
  gap: 22px;
  line-height: 1.65;
  margin: 0 auto;
  max-width: 860px;
}

.legal-head {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px;
  padding-bottom: 18px;
}

.legal-head p,
.legal-page section p {
  color: #344054;
  margin: 0;
}

.legal-page section {
  display: grid;
  gap: 8px;
}

.legal-page h2 {
  font-size: 1.15rem;
}

.legal-note {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  color: var(--warn) !important;
  font-weight: 750;
  padding: 10px 12px;
}

.admin-shell {
  display: grid;
  gap: 18px;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-tabs a {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 800;
  padding: 10px 12px;
}

.stat-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 6px;
  padding: 16px;
}

.stat span {
  color: var(--muted);
  font-weight: 750;
}

.stat strong {
  font-size: 2rem;
  line-height: 1;
}

.admin-panel {
  overflow: hidden;
}

.admin-panel h2 {
  margin-bottom: 14px;
}

.table-wrap {
  overflow-x: auto;
}

.admin-table {
  border-collapse: collapse;
  min-width: 860px;
  width: 100%;
}

.admin-table th,
.admin-table td {
  border-top: 1px solid var(--line);
  padding: 14px;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.admin-table p {
  color: var(--muted);
  line-height: 1.45;
  margin: 6px 0 0;
}

.admin-thumb {
  background: #eef1f6;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: block;
  margin-top: 8px;
  max-height: 140px;
  max-width: 180px;
  object-fit: cover;
}

.status {
  border-radius: 999px;
  display: inline-flex;
  font-weight: 850;
  margin: 0 6px 6px 0;
  padding: 6px 9px;
}

.status.open {
  background: #fff7ed;
  color: #9a3412;
}

.status.reviewed {
  background: #ecfdf5;
  color: #047857;
}

.status.dismissed {
  background: #fff1f2;
  color: var(--danger);
}

.admin-action {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.admin-action input {
  min-width: 220px;
}

@media (max-width: 900px) {
  .feed-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding-bottom: 12px;
    padding-top: 12px;
  }

  .nav {
    justify-content: flex-start;
  }

  .post-grid {
    column-count: 1;
  }

  .form-row,
  .search-form,
  .compose-grid {
    grid-template-columns: 1fr;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .profile-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
