/* ETCRAFT Library — community gallery */

.library-page [hidden],
dialog[hidden],
[hidden] {
  display: none !important;
}

.library-page {
  min-height: 70vh;
}

.lib-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
}

.library-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.library-hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url("../img/library-community-hero-v2.png") center 48% / cover no-repeat;
  filter: saturate(0.85);
  transform: scale(1.02);
}
.library-hero-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(8, 9, 15, 0.98) 0%, rgba(8, 9, 15, 0.9) 42%, rgba(8, 9, 15, 0.55) 78%, rgba(8, 9, 15, 0.75) 100%),
    linear-gradient(180deg, rgba(8, 9, 15, 0.55) 0%, rgba(8, 9, 15, 0.25) 45%, rgba(8, 9, 15, 0.98) 100%);
}
.library-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgb(var(--brand-rgb) / 0.4), transparent);
}

.lib-auth {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.lib-auth-note {
  max-width: 270px;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: rgba(8, 9, 15, 0.68);
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--muted);
  backdrop-filter: blur(12px);
}
.lib-auth-note strong {
  color: var(--paper);
  font-weight: 600;
}
.lib-auth-note a {
  color: var(--mint);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.lib-auth-note a:hover {
  color: #ffdcaa;
}

/* Avatars */
.lib-avatar {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(243, 245, 248, 0.14);
  background: linear-gradient(135deg, #3a3b41, #1c1e23);
  color: var(--mint);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  user-select: none;
}
.lib-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.lib-avatar--sm {
  width: 26px;
  height: 26px;
  font-size: 0.6rem;
}
.lib-avatar--lg {
  width: 44px;
  height: 44px;
  font-size: 0.86rem;
}
.lib-avatar--xl {
  width: 56px;
  height: 56px;
  font-size: 1rem;
}

/* Account menu */
.lib-user {
  position: relative;
}
.lib-user-button {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 260px;
  padding: 0.35rem 0.7rem 0.35rem 0.35rem;
  border: 1px solid rgba(243, 245, 248, 0.12);
  border-radius: 999px;
  background: rgba(8, 9, 15, 0.74);
  color: var(--paper);
  text-align: left;
  backdrop-filter: blur(14px);
  transition: border-color 0.18s ease, background-color 0.18s ease;
}
.lib-user-button:hover,
.lib-user-button[aria-expanded="true"] {
  border-color: rgb(var(--brand3-rgb) / 0.4);
  background: rgba(13, 15, 23, 0.92);
}
.lib-user-copy {
  display: grid;
  min-width: 0;
  line-height: 1.2;
}
.lib-user-name {
  overflow: hidden;
  font-size: 0.78rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lib-user-handle {
  margin-top: 0.18rem;
  overflow: hidden;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.58rem;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lib-user-chevron {
  flex: none;
  color: var(--muted);
  transition: transform 0.2s ease;
}
.lib-user-button[aria-expanded="true"] .lib-user-chevron {
  transform: rotate(180deg);
}
.lib-user-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 70;
  width: 245px;
  padding: 0.4rem;
  border: 1px solid rgba(243, 245, 248, 0.1);
  border-radius: 0.8rem;
  background: #18191f;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
}
.lib-user-menu[hidden] {
  display: none;
}
.lib-user-menu-head {
  padding: 0.65rem 0.7rem 0.75rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.35rem;
}
.lib-user-menu-head p:first-child {
  font-size: 0.8rem;
  font-weight: 700;
}
.lib-user-menu-head p:last-child {
  margin-top: 0.2rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.6rem;
  color: var(--muted);
}
.lib-menu-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.65rem;
  padding: 0.62rem 0.7rem;
  border-radius: 0.5rem;
  color: #cccdd1;
  font-size: 0.8rem;
  text-align: left;
  transition: background-color 0.16s ease, color 0.16s ease;
}
.lib-menu-item:hover {
  background: rgba(243, 245, 248, 0.05);
  color: var(--paper);
}
.lib-menu-item svg {
  color: var(--brand);
}
.lib-menu-item--danger {
  color: #d9aaa5;
}
.lib-menu-item--danger svg {
  color: #c4635a;
}
.lib-menu-item--danger:hover {
  background: rgba(196, 99, 90, 0.08);
  color: #f0c8c3;
}

/* Hero stats */
.lib-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  max-width: 560px;
  border: 1px solid rgba(243, 245, 248, 0.09);
  border-radius: 0.85rem;
  background: rgba(243, 245, 248, 0.09);
}
@media (min-width: 640px) {
  .lib-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.lib-stat {
  padding: 0.85rem 1rem;
  background: rgba(14, 16, 21, 0.78);
  backdrop-filter: blur(12px);
}
.lib-stat dt {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.56rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.lib-stat dd {
  margin-top: 0.35rem;
  font-size: 1.2rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--paper);
}

/* Guest gate */
.library-gate {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(227, 167, 101, 0.3);
  border-radius: 0.7rem;
  background: rgba(227, 167, 101, 0.07);
  font-size: 0.78rem;
  line-height: 1.55;
  color: #e1c39b;
}
.library-gate[hidden] {
  display: none;
}
.library-gate--error {
  border-color: rgba(196, 99, 90, 0.38);
  background: rgba(196, 99, 90, 0.08);
  color: #e7b8b2;
}
.library-gate svg {
  flex: none;
  margin-top: 0.15rem;
}
.library-gate strong {
  color: #f6ead7;
}
.library-gate a {
  color: var(--mint);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Buttons and chrome */
.btn-sm {
  padding: 0.58rem 0.95rem;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
}
.btn-danger {
  background: #b5524a;
  color: #fff;
  box-shadow: 0 3px 0 0 rgba(181, 82, 74, 0.22);
}
.btn-danger:hover {
  background: #c45d54;
}
.btn-soft {
  border: 1px solid rgb(var(--brand-rgb) / 0.25);
  background: rgb(var(--brand-rgb) / 0.1);
  color: var(--mint);
}
.btn-soft:hover {
  border-color: rgb(var(--brand-rgb) / 0.5);
  background: rgb(var(--brand-rgb) / 0.16);
}
.icon-btn {
  display: inline-flex;
  flex: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: rgba(243, 245, 248, 0.025);
  color: var(--muted);
  transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}
.icon-btn:hover {
  border-color: rgb(var(--brand3-rgb) / 0.35);
  background: rgb(var(--brand3-rgb) / 0.06);
  color: var(--paper);
}
.icon-btn[disabled] {
  opacity: 0.45;
  pointer-events: none;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.45rem;
  border-radius: 0.28rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.54rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-admin {
  background: var(--brand);
  color: #150c05;
  font-weight: 700;
}
.badge-soft {
  border: 1px solid var(--line);
  background: rgba(243, 245, 248, 0.03);
  color: var(--muted);
}
.badge-hidden {
  border: 1px solid rgba(227, 167, 101, 0.35);
  background: rgba(227, 167, 101, 0.1);
  color: #e3b277;
}
.badge-live {
  border: 1px solid rgb(var(--brand-rgb) / 0.35);
  background: rgb(var(--brand-rgb) / 0.1);
  color: var(--mint);
}

/* Toolbar */
.lib-toolbar {
  position: sticky;
  top: 4rem;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 -0.35rem;
  padding: 0.7rem 0.35rem;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 9, 15, 0.82);
  backdrop-filter: blur(18px);
}
.lib-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: #17191e;
}
.lib-tab {
  padding: 0.48rem 0.85rem;
  border-radius: 0.42rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease),
    transform 0.26s var(--ease-out), box-shadow 0.26s var(--ease-out);
}
.lib-tab:hover {
  color: var(--paper);
  transform: translateY(-1px);
}
.lib-tab[aria-selected="true"] {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #150c05;
  box-shadow: 0 8px 20px -12px rgb(var(--brand-rgb) / 0.8);
}
.lib-toolbar-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  color: var(--muted);
}
.lib-toolbar-meta strong {
  color: var(--paper);
  font-weight: 600;
}

/* Masonry feed */
.masonry {
  columns: 1;
  column-gap: 1rem;
}
@media (min-width: 640px) {
  .masonry {
    columns: 2;
  }
}
@media (min-width: 1024px) {
  .masonry {
    columns: 3;
  }
}
.post-card {
  position: relative;
  display: block;
  width: 100%;
  margin: 0 0 1rem;
  overflow: hidden;
  break-inside: avoid;
  border: 1px solid var(--line);
  border-radius: 0.95rem;
  background: linear-gradient(180deg, #1e1f25 0%, #17191e 100%);
  text-align: left;
  transition: transform 0.3s var(--ease-out), border-color 0.22s var(--ease),
    box-shadow 0.3s var(--ease-out);
  animation: lib-rise 0.42s ease both;
}
.post-card:hover {
  transform: translateY(-4px);
  border-color: rgb(var(--brand-rgb) / 0.38);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.42), 0 0 0 1px rgb(var(--brand-rgb) / 0.07);
}
.post-card:focus-visible {
  outline: 2px solid rgb(var(--brand-rgb) / 0.75);
  outline-offset: 3px;
}
.post-card--hidden {
  border-style: dashed;
  border-color: rgba(227, 167, 101, 0.32);
}
.post-media {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  background: #0c0e13;
  cursor: zoom-in;
}
.post-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.post-card:hover .post-media img {
  transform: scale(1.035);
}
.post-media-count {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.35rem;
  background: rgba(9, 10, 16, 0.72);
  color: #fff;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.56rem;
  letter-spacing: 0.06em;
  backdrop-filter: blur(8px);
}
.post-media-shade {
  position: absolute;
  inset: auto 0 0;
  height: 38%;
  background: linear-gradient(180deg, transparent, rgba(8, 9, 15, 0.5));
  opacity: 0;
  transition: opacity 0.25s ease;
}
.post-card:hover .post-media-shade {
  opacity: 1;
}
.post-media-empty {
  display: grid;
  aspect-ratio: 4 / 3;
  place-items: center;
  background:
    repeating-linear-gradient(
      135deg,
      rgb(var(--brand3-rgb) / 0.035) 0 10px,
      transparent 10px 20px
    ),
    #0c0e13;
  color: rgb(var(--brand3-rgb) / 0.55);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.58rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.post-body {
  padding: 0.85rem 0.95rem 0.95rem;
}
.post-author {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}
.post-author-copy {
  display: grid;
  min-width: 0;
  line-height: 1.25;
}
.post-name {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.79rem;
  font-weight: 700;
  color: var(--paper);
}
.post-name > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.post-time {
  margin-top: 0.12rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.55rem;
  color: var(--muted);
}
.post-caption {
  display: -webkit-box;
  margin-top: 0.7rem;
  overflow: hidden;
  color: #cccdd1;
  font-size: 0.83rem;
  line-height: 1.62;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.post-caption--empty {
  color: var(--muted);
  font-style: italic;
}
.post-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.8rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--line);
}
.post-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.58rem;
  color: var(--muted);
}
.post-open {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--mint);
  transition: color 0.16s ease, gap 0.16s ease;
}
.post-card:hover .post-open {
  gap: 0.45rem;
  color: var(--brand);
}
.post-hidden-note {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin-top: 0.7rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid rgba(227, 167, 101, 0.24);
  border-radius: 0.4rem;
  background: rgba(227, 167, 101, 0.06);
  color: #d6b184;
  font-size: 0.66rem;
  line-height: 1.45;
}

/* Feed states */
.lib-skeleton {
  break-inside: avoid;
  margin-bottom: 1rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.95rem;
  background: var(--panel);
}
.lib-skeleton-media {
  height: 190px;
}
.lib-skeleton-lines {
  padding: 0.9rem;
}
.lib-skeleton-line {
  height: 10px;
  border-radius: 4px;
}
.lib-skeleton-line + .lib-skeleton-line {
  margin-top: 0.55rem;
}
.shimmer {
  background: linear-gradient(
    90deg,
    #1b1d24 22%,
    rgb(var(--brand-rgb) / 0.15) 46%,
    #1b1d24 70%
  );
  background-size: 240% 100%;
  animation: lib-shimmer 1.6s linear infinite;
}
.lib-empty {
  padding: 3.2rem 1.5rem;
  border: 1px dashed rgb(var(--brand3-rgb) / 0.23);
  border-radius: 1.1rem;
  background: radial-gradient(80% 100% at 50% 0%, rgb(var(--brand-rgb) / 0.08), transparent 70%);
  text-align: center;
}
.lib-empty[hidden] {
  display: none;
}
.lib-empty-icon {
  display: inline-flex;
  color: var(--brand);
  opacity: 0.85;
}
.lib-empty h3 {
  margin-top: 1.1rem;
  font-size: 1.05rem;
  font-weight: 700;
}
.lib-empty p {
  max-width: 380px;
  margin: 0.55rem auto 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.65;
}
.lib-empty .btn {
  margin-top: 1.25rem;
}
.lib-feed-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(196, 99, 90, 0.35);
  border-radius: 0.65rem;
  background: rgba(196, 99, 90, 0.08);
  color: #e7b8b2;
  font-size: 0.78rem;
}
.lib-feed-error[hidden] {
  display: none;
}

/* Dialog base */
.lib-dialog {
  width: min(680px, calc(100vw - 1.5rem));
  max-width: none;
  max-height: calc(100dvh - 1.5rem);
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--paper);
  overflow: visible;
}
.lib-dialog::backdrop {
  background: rgba(8, 9, 15, 0.78);
  backdrop-filter: blur(7px);
}
.lib-dialog-card {
  display: flex;
  max-height: calc(100dvh - 1.5rem);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(243, 245, 248, 0.12);
  border-radius: 1rem;
  background: linear-gradient(180deg, #1e1f25 0%, #121419 100%);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.65);
}
.lib-dialog-head {
  display: flex;
  flex: none;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--line);
}
.lib-dialog-head h2 {
  margin-top: 0.3rem;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.lib-dialog-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1.2rem 1.25rem;
}
.lib-dialog-foot {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.95rem 1.25rem;
  border-top: 1px solid var(--line);
  background: rgba(11, 12, 17, 0.45);
}
.lib-dialog-foot-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.lib-dialog-sub {
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--muted);
}

/* Forms */
.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #cccdd1;
}
.field-label span {
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.58rem;
  font-weight: 400;
}
.field-input {
  width: 100%;
  padding: 0.78rem 0.9rem;
  border: 1px solid rgba(243, 245, 248, 0.12);
  border-radius: 0.6rem;
  background: #101217;
  color: var(--paper);
  font-size: 0.86rem;
  line-height: 1.55;
  outline: none;
  resize: vertical;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.field-input::placeholder {
  color: #6c6d72;
}
.field-input:focus {
  border-color: rgb(var(--brand-rgb) / 0.65);
  box-shadow: 0 0 0 3px rgb(var(--brand-rgb) / 0.12);
}
.form-error {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid rgba(196, 99, 90, 0.38);
  border-radius: 0.55rem;
  background: rgba(196, 99, 90, 0.08);
  color: #e7b8b2;
  font-size: 0.76rem;
  line-height: 1.5;
}
.form-error[hidden] {
  display: none;
}
.form-success {
  padding: 0.65rem 0.8rem;
  border: 1px solid rgb(var(--brand-rgb) / 0.35);
  border-radius: 0.55rem;
  background: rgb(var(--brand-rgb) / 0.08);
  color: var(--mint);
  font-size: 0.76rem;
}

/* Composer */
.composer-dialog {
  width: min(760px, calc(100vw - 1.5rem));
}
.composer-drop {
  display: flex;
  min-height: 160px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 1.6rem;
  border: 1px dashed rgb(var(--brand3-rgb) / 0.32);
  border-radius: 0.8rem;
  background:
    radial-gradient(60% 100% at 50% 0%, rgb(var(--brand-rgb) / 0.08), transparent 70%),
    #111218;
  text-align: center;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}
.composer-drop:hover,
.composer-drop.is-dragging {
  border-color: rgb(var(--brand-rgb) / 0.7);
  background-color: rgb(var(--brand-rgb) / 0.05);
}
.composer-drop-icon {
  display: inline-flex;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgb(var(--brand-rgb) / 0.28);
  border-radius: 0.65rem;
  background: rgb(var(--brand-rgb) / 0.09);
  color: var(--mint);
}
.composer-drop-title {
  font-size: 0.88rem;
  font-weight: 600;
}
.composer-drop-title button {
  color: var(--mint);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.composer-drop-hint {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.58rem;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.composer-previews {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 0.75rem;
}
@media (min-width: 640px) {
  .composer-previews {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.composer-preview {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: #0d0f14;
}
.composer-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.composer-preview-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.4rem;
  background: rgba(8, 9, 15, 0.72);
  color: var(--paper);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.54rem;
  letter-spacing: 0.04em;
  text-align: center;
  backdrop-filter: blur(2px);
}
.composer-preview-state--error {
  background: rgba(75, 25, 22, 0.82);
  color: #f0c7c2;
}
.composer-preview-remove {
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  z-index: 2;
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(8, 9, 15, 0.75);
  color: #fff;
  font-size: 0.8rem;
  line-height: 1;
}
.composer-preview-remove:hover {
  background: #a74740;
}
.composer-caption-wrap {
  position: relative;
  margin-top: 0.45rem;
}
.composer-caption-wrap .field-input {
  padding-bottom: 2.6rem;
}
.composer-tools {
  position: absolute;
  right: 0.55rem;
  bottom: 0.5rem;
  left: 0.55rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  pointer-events: none;
}
.composer-tools > * {
  pointer-events: auto;
}
.emoji-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.45rem;
  border-radius: 0.35rem;
  background: rgba(243, 245, 248, 0.05);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 600;
}
.emoji-trigger:hover {
  color: var(--mint);
  background: rgb(var(--brand-rgb) / 0.1);
}
.composer-count {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.56rem;
  color: var(--muted);
}
.composer-count.is-near {
  color: #e0b779;
}
.emoji-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.4rem);
  z-index: 20;
  display: grid;
  width: 264px;
  max-height: 190px;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  overflow-y: auto;
  padding: 0.45rem;
  border: 1px solid rgba(243, 245, 248, 0.13);
  border-radius: 0.6rem;
  background: #1b1c22;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
}
.emoji-panel[hidden] {
  display: none;
}
/* The composer's trigger sits at the far left of the dialog body, so a
   right-anchored 264px panel would hang outside it and get clipped. */
.composer-dialog .emoji-panel {
  left: 0;
  right: auto;
  width: min(264px, calc(100vw - 4rem));
}
.emoji-panel button {
  display: inline-flex;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 0.3rem;
  font-size: 1.05rem;
}
.emoji-panel button:hover {
  background: rgb(var(--brand-rgb) / 0.16);
}

/* Detail dialog */
.detail-dialog {
  width: min(1160px, calc(100vw - 1.5rem));
  max-height: calc(100dvh - 1.5rem);
}
.detail-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(340px, 0.95fr);
  height: min(860px, calc(100dvh - 1.5rem));
  overflow: hidden;
  border: 1px solid rgba(243, 245, 248, 0.12);
  border-radius: 1rem;
  background: #121419;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7);
}
.detail-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  z-index: 8;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(8, 9, 15, 0.65);
  color: #fff;
  backdrop-filter: blur(8px);
}
.detail-media {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #0a0b11;
}
.detail-stage {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 1.2rem;
}
.detail-stage img {
  max-width: 100%;
  max-height: 100%;
  cursor: zoom-in;
  object-fit: contain;
  border-radius: 0.25rem;
}
.detail-stage-empty {
  color: var(--muted);
  font-size: 0.8rem;
}
.detail-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(8, 9, 15, 0.65);
  color: #fff;
  transform: translateY(-50%);
  backdrop-filter: blur(8px);
  transition: background-color 0.18s ease;
}
.detail-nav:hover {
  background: rgb(var(--brand-rgb) / 0.75);
  color: #0f1016;
}
.detail-nav--prev {
  left: 0.85rem;
}
.detail-nav--next {
  right: 0.85rem;
}
.detail-thumbs {
  display: flex;
  flex: none;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.55rem 0.8rem 0.7rem;
  border-top: 1px solid var(--line);
}
.detail-thumb {
  flex: none;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 0.4rem;
  opacity: 0.55;
  transition: opacity 0.18s ease, border-color 0.18s ease;
}
.detail-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.detail-thumb:hover {
  opacity: 0.85;
}
.detail-thumb.is-active {
  border-color: var(--brand);
  opacity: 1;
}
.detail-side {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  background: #121419;
}
.detail-head {
  flex: none;
  padding: 1rem 1.1rem 0.9rem;
  border-bottom: 1px solid var(--line);
}
.detail-author {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding-right: 2.2rem;
}
.detail-author-copy {
  min-width: 0;
  line-height: 1.25;
}
.detail-author-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 700;
}
.detail-author-name .is-handle {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.6rem;
  font-weight: 400;
  color: var(--muted);
}
.detail-meta {
  margin-top: 0.18rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.56rem;
  color: var(--muted);
}
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.8rem;
}
.detail-action {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.32rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 0.38rem;
  background: transparent;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}
.detail-action--danger {
  color: #d99a93;
}
.detail-action:hover {
  border-color: rgb(var(--brand3-rgb) / 0.3);
  background: rgb(var(--brand3-rgb) / 0.05);
  color: var(--paper);
}
.detail-action--danger:hover {
  border-color: rgba(196, 99, 90, 0.45);
  background: rgba(196, 99, 90, 0.08);
  color: #efb9b3;
}
.detail-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.detail-caption {
  padding: 0.95rem 1.1rem;
  border-bottom: 1px solid var(--line);
  color: #d7d9dc;
  font-size: 0.86rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.detail-caption--empty {
  color: var(--muted);
  font-style: italic;
}
.detail-hidden-note {
  margin-top: 0.7rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(227, 167, 101, 0.26);
  border-radius: 0.45rem;
  background: rgba(227, 167, 101, 0.06);
  color: #d8b58b;
  font-size: 0.68rem;
  line-height: 1.5;
}
.detail-comments-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.1rem 0.4rem;
}
.detail-comments-head h3 {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.comment-list {
  padding: 0 1.1rem 0.4rem;
}
.comment {
  display: flex;
  gap: 0.6rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}
.comment:last-child {
  border-bottom: 0;
}
.comment-main {
  min-width: 0;
  flex: 1;
}
.comment-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.comment-name {
  font-size: 0.75rem;
  font-weight: 700;
}
.comment-time {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.52rem;
  color: var(--muted);
}
.comment-body {
  margin-top: 0.28rem;
  color: #cccdd1;
  font-size: 0.78rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.comment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.35rem;
  opacity: 0.55;
  transition: opacity 0.16s ease;
}
.comment:hover .comment-actions,
.comment:focus-within .comment-actions {
  opacity: 1;
}
.comment-action {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--muted);
}
.comment-action:hover {
  color: var(--mint);
}
.comment-action--danger:hover {
  color: #d88c84;
}
.comment-edit {
  margin-top: 0.45rem;
}
.comment-edit-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.35rem;
}
.comment-more {
  display: block;
  width: 100%;
  padding: 0.7rem;
  color: var(--mint);
  font-size: 0.68rem;
  font-weight: 600;
  text-align: center;
}
.comment-more:hover {
  background: rgb(var(--brand-rgb) / 0.05);
}
.comments-empty {
  padding: 1rem 1.1rem 1.4rem;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.6;
}
.comment-composer {
  flex: none;
  padding: 0.8rem 1rem 0.95rem;
  border-top: 1px solid var(--line);
  background: #101217;
}
.comment-composer-form {
  display: flex;
  align-items: flex-end;
  gap: 0.55rem;
}
.comment-composer-input {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  max-height: 126px;
  padding: 0.6rem 0.75rem;
  border: 1px solid rgba(243, 245, 248, 0.12);
  border-radius: 0.55rem;
  background: #0b0d12;
  color: var(--paper);
  font-size: 0.78rem;
  line-height: 1.55;
  outline: none;
  resize: none;
  transition: border-color 0.18s ease;
}
.comment-composer-input:focus {
  border-color: rgb(var(--brand-rgb) / 0.6);
}
.comment-send {
  display: inline-flex;
  flex: none;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  background: var(--brand);
  color: #150c05;
  transition: background-color 0.16s ease, opacity 0.16s ease;
}
.comment-send:hover {
  background: var(--brand);
}
.comment-send[disabled] {
  opacity: 0.45;
}
.comment-login {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.5;
}
.comment-login a {
  flex: none;
  color: var(--mint);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.comment-emoji {
  position: relative;
}
.comment-emoji-panel {
  bottom: calc(100% + 0.45rem);
  right: 0;
}
.detail-loading {
  display: grid;
  min-height: 420px;
  place-items: center;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

/* Lightbox */
.lib-lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
}
.lib-lightbox::backdrop {
  background: rgba(0, 0, 0, 0.92);
}
.lib-lightbox-inner {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.lib-lightbox img {
  max-width: 96vw;
  max-height: 90dvh;
  object-fit: contain;
}
.lib-lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

/* Report dialog */
.report-target {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: #111218;
}
.report-target img {
  width: 58px;
  height: 58px;
  flex: none;
  border-radius: 0.4rem;
  object-fit: cover;
}
.report-target > div {
  flex: 1;
  min-width: 0;
}
.report-target p {
  color: #cccdd1;
  font-size: 0.76rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.report-target span {
  display: block;
  margin-bottom: 0.2rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.54rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.report-reasons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}
.report-reason {
  position: relative;
  display: flex;
  cursor: pointer;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: #111218;
  font-size: 0.74rem;
  color: #cccdd1;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}
.report-reason:hover {
  border-color: rgb(var(--brand3-rgb) / 0.3);
}
.report-reason input {
  accent-color: var(--brand);
}
.report-reason:has(input:checked) {
  border-color: rgb(var(--brand-rgb) / 0.55);
  background: rgb(var(--brand-rgb) / 0.08);
  color: var(--paper);
}

/* Sessions dialog */
.session-list {
  display: grid;
  gap: 0.55rem;
}
.session-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: #111218;
}
.session-icon {
  display: inline-flex;
  width: 36px;
  height: 36px;
  flex: none;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  color: var(--mint);
}
.session-main {
  min-width: 0;
  flex: 1;
}
.session-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
}
.session-meta {
  margin-top: 0.22rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.55rem;
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.session-revoke {
  flex: none;
  font-size: 0.62rem;
  font-weight: 600;
  color: #d88c84;
}
.session-revoke:hover {
  color: #f0b6b0;
  text-decoration: underline;
}

/* Confirm dialog */
.confirm-dialog {
  width: min(480px, calc(100vw - 1.5rem));
}
.confirm-body {
  padding: 1.25rem;
}
.confirm-body p {
  color: #cccdd1;
  font-size: 0.84rem;
  line-height: 1.65;
}
.confirm-body .field-label {
  margin-top: 0.9rem;
}

/* Toasts */
.toast--error,
.lib-toast--error {
  border-color: rgba(196, 99, 90, 0.5);
  background: #2a1c1a;
}
.toast--error > span:first-child,
.lib-toast--error > span:first-child {
  color: #e08a80;
}
.lib-toast--info {
  border-color: rgba(121, 174, 232, 0.38);
  background: #18222b;
}
.lib-toast--info > span:first-child {
  color: #8ebbe9;
}

/* Admin */
.admin-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(60% 100% at 15% 0%, rgb(var(--brand-rgb) / 0.12), transparent 70%),
    linear-gradient(180deg, #14151b, #08090f);
}
.admin-shell {
  padding-top: 1rem;
}
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1rem 0 1.2rem;
}
.admin-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(243, 245, 248, 0.02);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  transition: color 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}
.admin-tab:hover {
  color: var(--paper);
  border-color: rgb(var(--brand3-rgb) / 0.3);
}
.admin-tab[aria-selected="true"] {
  border-color: rgb(var(--brand-rgb) / 0.45);
  background: rgb(var(--brand-rgb) / 0.12);
  color: var(--mint);
}
.admin-count {
  display: inline-flex;
  min-width: 18px;
  justify-content: center;
  padding: 0.1rem 0.3rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.54rem;
}
.report-list {
  display: grid;
  gap: 0.85rem;
}
.report-card {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: linear-gradient(180deg, #1e1f25, #17191e);
}
.report-media {
  position: relative;
  min-height: 180px;
  background: #0b0c11;
  border-right: 1px solid var(--line);
}
.report-media img {
  width: 100%;
  height: 100%;
  max-height: 280px;
  object-fit: cover;
}
.report-media-empty {
  display: flex;
  height: 100%;
  min-height: 180px;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.56rem;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
}
.report-content {
  min-width: 0;
  padding: 0.95rem 1.05rem;
}
.report-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}
.report-reason-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.3rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.55rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.report-reason--spam {
  border: 1px solid rgba(227, 167, 101, 0.35);
  background: rgba(227, 167, 101, 0.09);
  color: #e0b77f;
}
.report-reason--harassment {
  border: 1px solid rgba(196, 99, 90, 0.38);
  background: rgba(196, 99, 90, 0.09);
  color: #e5aaa3;
}
.report-reason--inappropriate {
  border: 1px solid rgba(224, 130, 122, 0.32);
  background: rgba(224, 130, 122, 0.08);
  color: #e0a7a1;
}
.report-reason--other {
  border: 1px solid rgba(121, 174, 232, 0.32);
  background: rgba(121, 174, 232, 0.08);
  color: #a6c8ec;
}
.report-time {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.55rem;
  color: var(--muted);
}
.report-excerpt {
  display: -webkit-box;
  margin-top: 0.65rem;
  overflow: hidden;
  color: #cccdd1;
  font-size: 0.8rem;
  line-height: 1.62;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}
.report-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin-top: 0.65rem;
  font-size: 0.64rem;
  color: var(--muted);
}
.report-meta strong {
  color: #cccdd1;
  font-weight: 600;
}
.report-details {
  margin-top: 0.55rem;
  padding: 0.5rem 0.6rem;
  border-left: 2px solid rgba(227, 167, 101, 0.5);
  background: rgba(227, 167, 101, 0.04);
  color: #c3b39e;
  font-size: 0.68rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.8rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}
.report-action {
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  color: #cccdd1;
  font-size: 0.62rem;
  font-weight: 600;
  transition: color 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}
.report-action:hover {
  border-color: rgb(var(--brand3-rgb) / 0.35);
  background: rgb(var(--brand3-rgb) / 0.05);
  color: var(--mint);
}
.report-action--danger {
  color: #d88c84;
}
.report-action--danger:hover {
  border-color: rgba(196, 99, 90, 0.42);
  background: rgba(196, 99, 90, 0.08);
  color: #f0b6b0;
}
.report-action--muted {
  color: var(--muted);
}
.report-state {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.6rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.54rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
}
.report-state--hidden {
  color: #e0b77f;
}
.report-state--deleted {
  color: #e5aaa3;
}
.audit-list {
  display: grid;
  gap: 0.45rem;
}
.audit-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: #17191e;
}
.audit-main {
  min-width: 0;
  flex: 1;
}
.audit-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.76rem;
  font-weight: 600;
}
.audit-meta {
  margin-top: 0.2rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.53rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.audit-details {
  margin-top: 0.3rem;
  color: #a1a2a7;
  font-size: 0.64rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.admin-empty {
  padding: 2.5rem 1.5rem;
  border: 1px dashed rgb(var(--brand3-rgb) / 0.22);
  border-radius: 0.9rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}
.admin-guard {
  max-width: 620px;
  margin: 4rem auto;
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--panel);
  text-align: center;
}
.admin-guard h1 {
  margin-top: 0.8rem;
  font-size: 1.35rem;
  font-weight: 800;
}
.admin-guard p {
  margin: 0.65rem auto 0;
  max-width: 430px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.65;
}
.admin-guard .btn {
  margin-top: 1.2rem;
}
.admin-page {
  min-height: 70vh;
}
.admin-identity {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.35rem;
  padding: 0.45rem 0.75rem 0.45rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 9, 15, 0.7);
}
.admin-identity-copy {
  display: grid;
  line-height: 1.25;
}
.admin-identity-name {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--paper);
}
.admin-identity-handle {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.55rem;
  color: var(--muted);
}
.admin-queue-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.admin-summary {
  margin: 0 0 1rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.58rem;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.admin-layout {
  display: grid;
  gap: 1rem;
  align-items: start;
}
@media (min-width: 1100px) {
  .admin-layout {
    grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr);
  }
  .admin-audit .admin-panel {
    position: sticky;
    top: 5rem;
  }
  .admin-audit .audit-list {
    max-height: calc(100vh - 15rem);
    overflow-y: auto;
    padding-right: 0.2rem;
  }
}
.admin-panel {
  padding: 0.95rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: #17191e;
}
.admin-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}
.admin-panel-head h2 {
  margin-top: 0.15rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--paper);
}
.admin-panel-head .eyebrow {
  font-size: 0.55rem;
}
.admin-audit .audit-list {
  margin-top: 0.1rem;
}
.admin-audit .admin-empty {
  padding: 1.4rem 1rem;
  font-size: 0.72rem;
}
.admin-audit .btn-ghost {
  width: 100%;
  margin-top: 0.6rem;
}
.admin-queue .lib-feed-error {
  margin-bottom: 0.8rem;
}
.admin-loading {
  padding: 2.2rem 1rem;
  border: 1px dashed var(--line);
  border-radius: 0.9rem;
  text-align: center;
}
.admin-loading .spinner {
  margin: 0 auto 0.6rem;
}
.admin-report-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.admin-report-author {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.6rem;
  font-size: 0.68rem;
  color: var(--muted);
}
.admin-report-author strong {
  color: #dcdde1;
  font-weight: 600;
}
.admin-report-author .is-handle {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.58rem;
}
.admin-report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.8rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}
.admin-report-actions .report-action {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 30px;
  text-decoration: none;
}
.admin-report-actions .report-action[disabled] {
  opacity: 0.45;
  pointer-events: none;
}
.report-action--resolve {
  border-color: rgb(var(--brand-rgb) / 0.35);
  background: rgb(var(--brand-rgb) / 0.08);
  color: var(--mint);
}
.report-action--resolve:hover {
  border-color: rgb(var(--brand-rgb) / 0.6);
  background: rgb(var(--brand-rgb) / 0.16);
  color: #ffdcaa;
}
.admin-status-note {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.64rem;
}
.admin-status-note--resolved {
  color: var(--mint);
}
.admin-status-note--dismissed {
  color: #a6c8ec;
}
.audit-action--danger {
  color: #e5aaa3;
}
.audit-action--success {
  color: var(--mint);
}
.audit-action--neutral {
  color: #a6c8ec;
}
@media (max-width: 767px) {
  .admin-identity {
    margin-top: 1rem;
  }
  .admin-tabs {
    margin-top: 0.7rem;
  }
  .admin-panel {
    padding: 0.8rem;
  }
}

/* Misc */
.lib-loading-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgb(var(--brand3-rgb) / 0.2);
  border-top-color: var(--mint);
  border-radius: 999px;
  animation: lib-spin 0.7s linear infinite;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes lib-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes lib-shimmer {
  from {
    background-position: 140% 0;
  }
  to {
    background-position: -100% 0;
  }
}
@keyframes lib-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Responsive */
@media (max-width: 1000px) {
  .detail-dialog {
    width: calc(100vw - 1rem);
    max-height: 100dvh;
  }
  .detail-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(220px, 42dvh) minmax(0, 1fr);
    height: calc(100dvh - 1rem);
  }
  .detail-media {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .detail-stage {
    padding: 0.75rem 3rem;
  }
  .detail-thumbs {
    padding: 0.4rem 0.6rem 0.5rem;
  }
  .detail-side {
    min-height: 0;
  }
  .detail-author {
    padding-right: 2.5rem;
  }
  .detail-scroll {
    max-height: none;
  }
}

@media (max-width: 767px) {
  .lib-dialog {
    width: calc(100vw - 1rem);
    max-height: calc(100dvh - 1rem);
  }
  .lib-dialog-card {
    max-height: calc(100dvh - 1rem);
    border-radius: 0.9rem;
  }
  .detail-dialog {
    width: 100vw;
    max-height: 100dvh;
  }
  .detail-shell {
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }
  .detail-stage {
    padding: 0.5rem 2.6rem;
  }
  .detail-nav {
    width: 32px;
    height: 32px;
  }
  .detail-nav--prev {
    left: 0.4rem;
  }
  .detail-nav--next {
    right: 0.4rem;
  }
  .detail-close {
    top: 0.5rem;
    right: 0.5rem;
  }
  .composer-previews {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .lib-toolbar {
    top: 4rem;
  }
  .report-card {
    grid-template-columns: 1fr;
  }
  .report-media {
    min-height: 150px;
    max-height: 220px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .report-media img {
    max-height: 220px;
  }
  .report-media-empty {
    min-height: 120px;
  }
  .report-reasons {
    grid-template-columns: 1fr;
  }
  .lib-dialog-foot {
    align-items: stretch;
  }
  .lib-dialog-foot-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .post-card,
  .shimmer,
  .spinner {
    animation: none;
  }
  .post-card,
  .post-media img,
  .btn,
  .detail-action,
  .lib-tab {
    transition: none;
  }
}
