/* ==========================================================================
   初二三班 · 班级空间
   Design: black paper, bone type, cinnabar accent. Built by wonderder.
   ========================================================================== */

:root {
  color-scheme: dark;
  --ink: #0b0b0b;
  --ink-2: #0f0f0e;
  --panel: #141413;
  --panel-2: #191918;
  --panel-3: #1e1d1b;
  --line: #2b2a27;
  --line-soft: #211f1d;
  --paper: #ece7dc;
  --paper-bright: #f6f1e6;
  --paper-dim: #c3bcae;
  --muted: #8a857b;
  --muted-2: #68645c;
  --accent: #d65a3a;
  --accent-strong: #e66a49;
  --accent-dim: #7d3627;
  --moss: #9aa184;
  --blue: #8b9ba5;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", "Cascadia Mono", "Roboto Mono", Consolas, "Liberation Mono", monospace;
  --shell: min(1180px, calc(100% - 64px));
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

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

html {
  min-width: 300px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

::selection {
  background: var(--accent);
  color: #fff;
}

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

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

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

::-webkit-scrollbar-track {
  background: var(--ink);
}

::-webkit-scrollbar-thumb {
  background: #33312d;
  border: 3px solid var(--ink);
}

::-webkit-scrollbar-thumb:hover {
  background: #48453f;
}

/* Film grain. Very quiet, just enough to take the plastic off. */
.grain {
  position: fixed;
  inset: 0;
  z-index: 400;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.65'/%3E%3C/svg%3E");
}

.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;
}

.mono {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
}

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

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

.mobile-only {
  display: none;
}

.shell {
  width: var(--shell);
  margin-inline: auto;
}

.view {
  min-height: calc(100vh - 380px);
  outline: none;
  animation: page-in 0.36s ease both;
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

#site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--ink);
  border-bottom: 1px solid var(--line);
}

.utility-bar {
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted-2);
}

.utility-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 28px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.utility-inner .utility-center {
  color: var(--muted);
}

.utility-inner .utility-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.site-masthead {
  display: flex;
  align-items: center;
  min-height: 74px;
  gap: 40px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-mark {
  width: 38px;
  height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: 5px;
  border: 1px solid var(--paper-dim);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.02;
  letter-spacing: 0.04em;
  position: relative;
}

.brand-mark::after {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 5px;
  height: 1px;
  background: var(--accent);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-copy strong {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.2;
}

.brand-copy small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 30px;
  margin-left: auto;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 0 9px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  transition: color 0.18s ease;
}

.nav-link svg {
  width: 15px;
  height: 15px;
  opacity: 0.75;
}

.nav-link:hover {
  color: var(--paper);
}

.nav-link.is-active {
  color: var(--paper-bright);
}

.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--accent);
}

.nav-badge {
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1;
  letter-spacing: 0;
}

.account {
  position: relative;
  margin-left: 2px;
  padding-left: 28px;
  border-left: 1px solid var(--line);
}

.account-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: none;
  border: 0;
  padding: 4px 0;
  max-width: 200px;
}

.account-button .user-chip-name {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--paper-dim);
}

.account-button .chevron {
  width: 12px;
  height: 12px;
  color: var(--muted);
  transition: transform 0.18s ease;
}

.account-button[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  z-index: 120;
  width: 220px;
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: fade-in 0.15s ease;
}

.account-menu-head {
  padding: 10px 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 6px;
}

.account-menu-head strong {
  display: block;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
}

.account-menu-head span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

.account-menu a,
.account-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 0;
  background: none;
  color: var(--paper-dim);
  font-size: 12px;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.account-menu a svg,
.account-menu button svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.account-menu a:hover,
.account-menu button:hover {
  background: var(--panel-3);
  color: var(--paper-bright);
}

.account-menu .menu-sep {
  height: 1px;
  background: var(--line-soft);
  margin: 6px 0;
}

.account-menu .danger-link {
  color: #d47e6a;
}

.login-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  padding: 7px 13px;
  color: var(--paper-dim);
  font-size: 11px;
  letter-spacing: 0.08em;
  transition: border-color 0.18s ease, color 0.18s ease;
}

.login-link:hover {
  border-color: var(--paper-dim);
  color: var(--paper);
}

/* --------------------------------------------------------------------------
   Avatars, badges, buttons
   -------------------------------------------------------------------------- */

.avatar {
  --av-size: 38px;
  width: var(--av-size);
  height: var(--av-size);
  flex: 0 0 var(--av-size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--av-bg, #343a32);
  border: 1px solid rgba(236, 231, 220, 0.12);
  color: var(--paper-bright);
  font-family: var(--serif);
  font-size: calc(var(--av-size) * 0.4);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  user-select: none;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-sm { --av-size: 30px; }
.avatar-md { --av-size: 38px; }
.avatar-lg { --av-size: 52px; }
.avatar-xl { --av-size: 104px; }

.identity {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
}

.identity .display-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--paper-bright);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 16em;
}

.identity a.display-name:hover {
  color: var(--accent);
}

.identity .handle {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.03em;
}

.stamp-role {
  display: inline-flex;
  align-items: center;
  height: 15px;
  padding: 0 4px;
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  line-height: 1;
  transform: translateY(-1px);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 6px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  line-height: 1;
  white-space: nowrap;
}

.badge-accent {
  border-color: var(--accent-dim);
  color: var(--accent);
}

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

.badge-danger {
  border-color: #5c2e25;
  color: #d47e6a;
}

.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--paper);
  font-size: 11px;
  letter-spacing: 0.07em;
  line-height: 1.2;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.btn svg {
  width: 14px;
  height: 14px;
}

.btn:hover {
  border-color: var(--paper-dim);
  background: var(--panel-2);
}

.btn-primary {
  background: var(--paper);
  border-color: var(--paper);
  color: #0b0b0b;
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--paper-bright);
  border-color: var(--paper-bright);
}

.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.btn-accent:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.btn-ghost {
  border-color: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  color: var(--paper);
  background: var(--panel-2);
  border-color: var(--line);
}

.btn-sm {
  min-height: 28px;
  padding: 5px 9px;
  font-size: 10px;
}

.btn-block {
  width: 100%;
}

.btn .spin {
  width: 12px;
  height: 12px;
  border: 1px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.text-link {
  color: var(--paper-dim);
  border-bottom: 1px solid var(--line);
  padding-bottom: 1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.text-link:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
}

.icon-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}

.icon-btn:hover {
  color: var(--paper);
  background: var(--panel-2);
}

/* --------------------------------------------------------------------------
   Home
   -------------------------------------------------------------------------- */

.home-page {
  padding: 54px 0 88px;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 72px;
  align-items: end;
  padding-bottom: 42px;
  margin-bottom: 48px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--accent);
}

.home-hero h1 {
  margin-top: 19px;
  font-family: var(--serif);
  font-size: clamp(42px, 5.8vw, 76px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--paper-bright);
}

.home-hero h1 .final {
  color: var(--accent);
}

.hero-note {
  padding-bottom: 5px;
}

.hero-note > p {
  color: var(--paper-dim);
  font-size: 13.5px;
  line-height: 1.85;
  max-width: 330px;
}

.hero-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-top: 25px;
  border-top: 1px solid var(--line);
}

.hero-meta div {
  padding: 12px 12px 0 0;
  border-right: 1px solid var(--line-soft);
}

.hero-meta div:last-child {
  padding-left: 16px;
  border-right: 0;
}

.hero-meta dt {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-meta dd {
  margin: 4px 0 0;
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 324px;
  gap: 64px;
  align-items: start;
}

.feed-column {
  min-width: 0;
}

.feed-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--paper-dim);
}

.feed-heading h2,
.side-heading h2 {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.2;
}

.feed-heading .heading-sub {
  display: block;
  margin-top: 3px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.feed-tabs {
  display: flex;
  gap: 20px;
}

.feed-tab {
  background: none;
  border: 0;
  padding: 4px 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  position: relative;
}

.feed-tab:hover {
  color: var(--paper);
}

.feed-tab.is-active {
  color: var(--paper-bright);
}

.feed-tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -13px;
  height: 1px;
  background: var(--accent);
}

/* Composer */

.composer {
  margin: 24px 0 34px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.composer.is-collapsed {
  padding: 18px 20px;
}

.composer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.composer-head .composer-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.composer-main {
  display: flex;
  gap: 13px;
  padding: 17px 16px 12px;
}

.composer-main textarea {
  flex: 1;
  width: 100%;
  min-height: 78px;
  max-height: 300px;
  padding: 2px 0;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--paper);
  font-size: 14px;
  line-height: 1.8;
}

.composer-main textarea::placeholder {
  color: var(--muted-2);
}

.composer-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--line-soft);
}

.composer-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
}

.composer-tool:hover {
  color: var(--paper);
}

.composer-tool svg {
  width: 14px;
  height: 14px;
}

.composer-count {
  margin-left: auto;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.composer-count.is-near {
  color: var(--accent);
}

.composer-submit {
  min-height: 32px;
  padding-inline: 18px;
}

.composer-preview {
  position: relative;
  margin: 0 16px 14px;
  border: 1px solid var(--line);
  max-width: 360px;
}

.composer-preview img {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
}

.composer-preview button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 25px;
  height: 25px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.join-card {
  margin: 24px 0 34px;
  padding: 25px 24px;
  border: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.join-card h3 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 500;
}

.join-card p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.join-card .join-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Posts */

.post-list {
  border-top: 1px solid var(--line);
}

.post {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 15px;
  padding: 25px 0 23px;
  border-bottom: 1px solid var(--line);
}

.post.is-pinned {
  position: relative;
}

.post.is-pinned::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 29px;
  width: 2px;
  height: 22px;
  background: var(--accent);
}

.post-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.post-head .post-time {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.post-head .post-time::before {
  content: "·";
  margin-right: 6px;
  color: var(--line);
}

.pin-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 16px;
  padding: 0 4px;
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.05em;
  line-height: 1;
}

.post-content {
  margin-top: 7px;
  color: #ddd8cd;
  font-size: 14px;
  line-height: 1.85;
  word-break: break-word;
}

.post-content a {
  color: var(--paper-bright);
  border-bottom: 1px solid var(--line);
}

.post-image {
  margin-top: 14px;
  border: 1px solid var(--line);
  background: #0c0c0b;
  max-width: 560px;
}

.post-image img {
  width: 100%;
  max-height: 620px;
  object-fit: contain;
}

.post-actions {
  display: flex;
  align-items: center;
  gap: 19px;
  margin-top: 14px;
  color: var(--muted);
}

.post-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.02em;
  transition: color 0.15s ease;
}

.post-action svg {
  width: 14px;
  height: 14px;
}

.post-action:hover {
  color: var(--paper);
}

.post-action.is-liked {
  color: var(--accent);
}

.post-action.is-liked svg {
  fill: var(--accent);
}

.post-delete {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted-2);
  background: none;
  border: 0;
  padding: 2px;
}

.post-delete:hover {
  color: #d47e6a;
}

.feed-end {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 24px 0 0;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.feed-end::before,
.feed-end::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.feed-end::before {
  width: 28px;
}

.feed-end::after {
  flex: 1;
}

.feed-loading {
  padding: 48px 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
}

/* Sidebar */

.side-column {
  position: sticky;
  top: 114px;
  min-width: 0;
}

.side-block {
  margin-bottom: 42px;
}

.side-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding-top: 11px;
  padding-bottom: 12px;
  border-top: 1px solid var(--paper-dim);
}

.side-heading .side-link {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
}

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

.notice-mini-list {
  border-top: 1px solid var(--line);
}

.notice-mini {
  display: block;
  padding: 15px 0 14px;
  border-bottom: 1px solid var(--line);
  transition: opacity 0.15s ease;
}

.notice-mini:hover .notice-mini-title {
  color: var(--accent);
}

.notice-mini-top {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
}

.notice-mini-title {
  color: var(--paper);
  font-size: 12.5px;
  line-height: 1.5;
  transition: color 0.15s ease;
}

.notice-mini-date {
  display: block;
  margin-top: 5px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.06em;
}

.cat-tag {
  display: inline-flex;
  align-items: center;
  height: 16px;
  padding: 0 4px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.cat-announce {
  border-color: var(--accent-dim);
  color: var(--accent);
}

.cat-class {
  border-color: #4a4639;
  color: #b3a985;
}

.cat-event {
  border-color: #34453f;
  color: #8fa89b;
}

.cat-remind {
  border-color: #3b3f4a;
  color: var(--blue);
}

.about-card {
  padding: 20px 19px 18px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.about-card .about-kicker {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.15em;
}

.about-card h3 {
  margin-top: 9px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.3;
}

.about-card p {
  margin-top: 9px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.8;
}

.about-card .about-rule {
  height: 1px;
  margin: 16px 0 13px;
  background: var(--line);
}

.about-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
}

.about-meta span {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.07em;
  line-height: 1.7;
}

.about-meta strong {
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.06em;
}

.site-stamp {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 55px;
  height: 55px;
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.09em;
  line-height: 1.7;
  transform: rotate(-3deg);
  user-select: none;
}

.site-stamp strong {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.07em;
}

.rule-note {
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.8;
}

.rule-note strong {
  color: var(--paper-dim);
  font-weight: 400;
}

/* --------------------------------------------------------------------------
   Public notices page
   -------------------------------------------------------------------------- */

.notices-page {
  padding: 58px 0 88px;
}

.page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 70px;
  align-items: end;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--line);
}

.page-head h1 {
  margin-top: 16px;
  font-family: var(--serif);
  font-size: clamp(44px, 6vw, 76px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.04em;
  color: var(--paper-bright);
}

.page-head .page-head-note {
  color: var(--paper-dim);
  font-size: 13px;
  line-height: 1.85;
  padding-bottom: 6px;
}

.page-head .page-head-note .mono {
  display: block;
  margin-top: 16px;
  color: var(--muted-2);
}

.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.notice-list {
  max-width: 980px;
}

.notice-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 130px;
  gap: 28px;
  padding: 32px 0 30px;
  border-bottom: 1px solid var(--line);
}

.notice-card.is-pinned {
  padding-left: 17px;
  border-left: 1px solid var(--accent);
}

.notice-index {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  padding-top: 7px;
}

.notice-card h2 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.notice-body {
  margin-top: 12px;
  color: var(--paper-dim);
  font-size: 13.5px;
  line-height: 1.9;
  white-space: pre-line;
  word-break: break-word;
}

.notice-side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  padding-top: 5px;
}

.notice-side time {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.notice-admin-actions {
  display: flex;
  gap: 10px;
  margin-top: 3px;
}

.notice-admin-actions button {
  border: 0;
  background: none;
  padding: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

.notice-admin-actions button:hover {
  color: var(--accent);
}

.notice-admin-actions button.danger:hover {
  color: #d47e6a;
}

/* --------------------------------------------------------------------------
   Post detail
   -------------------------------------------------------------------------- */

.post-page {
  max-width: 780px;
  margin: 0 auto;
  padding: 42px 0 90px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.back-link:hover {
  color: var(--paper);
}

.post-detail {
  margin-top: 26px;
  padding: 30px 0 26px;
  border-top: 1px solid var(--paper-dim);
  border-bottom: 1px solid var(--line);
}

.post-detail .post-content {
  font-size: 16px;
  line-height: 1.95;
  color: var(--paper);
}

.post-detail .post-image {
  max-width: 100%;
}

.post-detail .post-image img {
  max-height: 760px;
}

.comments-section {
  padding-top: 30px;
}

.comments-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.comments-head h2 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
}

.comments-head span {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
}

.comment-form {
  display: flex;
  gap: 12px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.comment-form textarea {
  flex: 1;
  min-height: 60px;
  padding: 9px 11px;
  resize: vertical;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--paper);
  font-size: 12.5px;
  line-height: 1.7;
}

.comment-form textarea:focus {
  outline: 0;
  border-color: var(--paper-dim);
}

.comment-form .comment-submit {
  align-self: flex-end;
}

.comment-list {
  border-top: 0;
}

.comment {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 11px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line-soft);
}

.comment-main {
  min-width: 0;
}

.comment-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px;
}

.comment-meta .display-name {
  font-size: 11.5px;
  font-weight: 600;
}

.comment-meta .handle,
.comment-meta time {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
}

.comment-content {
  margin-top: 3px;
  color: var(--paper-dim);
  font-size: 12.5px;
  line-height: 1.75;
  white-space: pre-line;
  word-break: break-word;
}

.comment-delete {
  border: 0;
  background: none;
  padding: 2px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
}

.comment-delete:hover {
  color: #d47e6a;
}

.login-prompt {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.login-prompt a {
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   Auth
   -------------------------------------------------------------------------- */

.auth-page {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
  min-height: calc(100vh - 103px);
}

.auth-visual {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 70px clamp(32px, 6vw, 88px) 58px;
  border-right: 1px solid var(--line);
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 44px 44px;
  background-position: -1px -1px;
}

.auth-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(11, 11, 11, 0) 40%, var(--ink) 100%);
  pointer-events: none;
}

.auth-visual > * {
  position: relative;
  z-index: 1;
}

.auth-ghost {
  position: absolute;
  z-index: 0;
  right: -2vw;
  bottom: -58px;
  font-family: var(--serif);
  font-size: clamp(180px, 27vw, 380px);
  line-height: 0.8;
  color: transparent;
  -webkit-text-stroke: 1px #23221f;
  letter-spacing: -0.08em;
  user-select: none;
  pointer-events: none;
}

.auth-visual h1 {
  margin-top: 22px;
  font-family: var(--serif);
  font-size: clamp(48px, 6vw, 80px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.04em;
  color: var(--paper-bright);
  max-width: 600px;
}

.auth-visual h1 em {
  font-style: normal;
  color: var(--accent);
}

.auth-quote {
  max-width: 360px;
  padding-left: 17px;
  border-left: 1px solid var(--accent-dim);
  color: var(--paper-dim);
  font-size: 12.5px;
  line-height: 1.9;
}

.auth-quote span {
  display: block;
  margin-top: 8px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 50px 40px;
  background: var(--ink-2);
}

.auth-form {
  width: min(380px, 100%);
}

.auth-form-head {
  margin-bottom: 28px;
}

.auth-form-head .mono {
  color: var(--accent);
}

.auth-form-head h2 {
  margin-top: 9px;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.auth-form-head p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11.5px;
}

.form-field {
  margin-bottom: 17px;
}

.form-field > label,
.form-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.form-field > label .optional {
  color: var(--muted-2);
  letter-spacing: 0.02em;
  text-transform: none;
}

.field-input,
.field-textarea,
.field-select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #10100f;
  color: var(--paper);
  font-size: 13px;
  outline: 0;
  transition: border-color 0.16s ease;
}

.field-input::placeholder,
.field-textarea::placeholder {
  color: var(--muted-2);
}

.field-input:focus,
.field-textarea:focus,
.field-select:focus {
  border-color: var(--paper-dim);
}

.field-textarea {
  height: auto;
  min-height: 92px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.7;
}

.field-select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 19px, calc(100% - 11px) 19px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.password-wrap {
  position: relative;
}

.password-wrap .field-input {
  padding-right: 52px;
}

.password-toggle {
  position: absolute;
  top: 1px;
  right: 1px;
  height: 42px;
  padding: 0 11px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.05em;
}

.password-toggle:hover {
  color: var(--paper);
}

.form-error {
  margin-bottom: 16px;
  padding: 9px 11px;
  border-left: 2px solid var(--accent);
  background: #20120f;
  color: #e2a28f;
  font-size: 11.5px;
  line-height: 1.6;
}

.form-hint {
  margin-top: 6px;
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.6;
}

.form-actions {
  margin-top: 24px;
}

.auth-switch {
  margin-top: 20px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.auth-switch a {
  color: var(--paper);
  border-bottom: 1px solid var(--line);
}

.auth-switch a:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
}

.auth-fineprint {
  margin-top: 25px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.8;
  letter-spacing: 0.04em;
}

.auth-closed {
  padding: 15px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

/* --------------------------------------------------------------------------
   Messages
   -------------------------------------------------------------------------- */

.messages-page {
  padding: 40px 0 80px;
}

.messages-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 17px;
}

.messages-title-row h1 {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.messages-title-row .mono {
  color: var(--muted);
}

.messages-layout {
  display: grid;
  grid-template-columns: 318px minmax(0, 1fr);
  height: min(680px, calc(100vh - 245px));
  min-height: 520px;
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
}

.thread-list {
  min-width: 0;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--panel);
}

.thread-list-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.thread-empty {
  padding: 44px 24px;
  color: var(--muted);
  text-align: center;
  font-size: 11.5px;
  line-height: 1.8;
}

.thread-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.14s ease;
}

.thread-item:hover {
  background: var(--panel-2);
}

.thread-item.is-active {
  background: #201e1b;
  box-shadow: inset 2px 0 0 var(--accent);
}

.thread-copy {
  min-width: 0;
}

.thread-name {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--paper-dim);
}

.thread-preview {
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted-2);
  font-size: 10.5px;
}

.thread-item.has-unread .thread-name,
.thread-item.has-unread .thread-preview {
  color: var(--paper);
}

.thread-meta {
  align-self: start;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  padding-top: 2px;
}

.thread-meta time {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7.5px;
  white-space: nowrap;
}

.thread-unread {
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-family: var(--mono);
  font-size: 7px;
  line-height: 1;
  border-radius: 50%;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #0e0e0d;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  flex-shrink: 0;
}

.chat-back {
  display: none;
  border: 0;
  background: none;
  color: var(--muted);
  padding: 4px;
}

.chat-head-copy {
  min-width: 0;
  flex: 1;
}

.chat-head-copy strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--paper-bright);
}

.chat-head-copy span {
  display: block;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
}

.chat-head .text-link {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.05em;
}

.chat-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 22px 20px;
}

.chat-empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted-2);
  text-align: center;
}

.chat-empty .chat-empty-mark {
  width: 54px;
  height: 54px;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 22px;
  color: var(--muted);
}

.chat-empty p {
  font-size: 12px;
  line-height: 1.8;
}

.chat-day {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 0 20px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.06em;
}

.chat-day::before,
.chat-day::after {
  content: "";
  height: 1px;
  background: var(--line-soft);
  flex: 1;
}

.msg {
  display: flex;
  gap: 9px;
  max-width: 78%;
  margin-bottom: 14px;
}

.msg.is-mine {
  margin-left: auto;
  flex-direction: row-reverse;
}

.msg-avatar {
  margin-top: 17px;
}

.msg-stack {
  min-width: 0;
}

.msg.is-mine .msg-stack {
  text-align: right;
}

.msg-author {
  margin-bottom: 3px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7.5px;
}

.msg-bubble {
  display: inline-block;
  padding: 9px 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--paper-dim);
  font-size: 12.5px;
  line-height: 1.75;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg.is-mine .msg-bubble {
  background: #2a1b16;
  border-color: #4a2b22;
  color: var(--paper);
}

.msg-time {
  margin-top: 3px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7.5px;
}

.chat-compose {
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.chat-compose textarea {
  flex: 1;
  min-height: 44px;
  max-height: 140px;
  padding: 10px 11px;
  resize: none;
  border: 1px solid var(--line);
  background: #10100f;
  color: var(--paper);
  font-size: 12.5px;
  line-height: 1.65;
  outline: 0;
}

.chat-compose textarea:focus {
  border-color: var(--paper-dim);
}

.chat-compose .btn {
  min-height: 44px;
}

.chat-hint {
  padding: 0 14px 10px;
  background: var(--panel);
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.03em;
}

/* --------------------------------------------------------------------------
   Profile
   -------------------------------------------------------------------------- */

.profile-page {
  max-width: 980px;
  margin: 0 auto;
  padding: 55px 0 88px;
}

.profile-head {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--paper-dim);
}

.profile-avatar {
  flex-shrink: 0;
}

.profile-id {
  min-width: 0;
  flex: 1;
}

.profile-id .profile-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.profile-id h1 {
  margin-top: 6px;
  font-family: var(--serif);
  font-size: clamp(34px, 4.6vw, 52px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--paper-bright);
}

.profile-handle {
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.03em;
}

.profile-bio {
  margin-top: 14px;
  max-width: 520px;
  color: var(--paper-dim);
  font-size: 12.5px;
  line-height: 1.85;
  white-space: pre-line;
}

.profile-bio.is-empty {
  color: var(--muted-2);
  font-style: normal;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.profile-side {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
}

.profile-stats {
  display: flex;
  gap: 26px;
}

.profile-stat {
  text-align: right;
}

.profile-stat strong {
  display: block;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 500;
  line-height: 1.1;
  color: var(--paper-bright);
}

.profile-stat span {
  display: block;
  margin-top: 4px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.07em;
}

.profile-since {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.profile-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 25px 0 12px;
  border-bottom: 1px solid var(--line);
}

.profile-section-head h2 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
}

.profile-section-head span {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
}

/* --------------------------------------------------------------------------
   Admin
   -------------------------------------------------------------------------- */

.admin-page {
  padding: 34px 0 90px;
}

.admin-shell {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  gap: 38px;
  align-items: start;
}

.admin-side {
  position: sticky;
  top: 118px;
  padding-right: 22px;
  border-right: 1px solid var(--line);
}

.admin-side-title {
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}

.admin-side-title strong {
  display: block;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 500;
  line-height: 1.2;
}

.admin-side-title span {
  display: block;
  margin-top: 3px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.admin-tabs {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 13px 0;
}

.admin-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 9px;
  border: 0;
  border-left: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  text-align: left;
}

.admin-tab span {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
}

.admin-tab:hover {
  color: var(--paper);
  background: var(--panel);
}

.admin-tab.is-active {
  color: var(--paper-bright);
  border-left-color: var(--accent);
  background: var(--panel);
}

.admin-side-foot {
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7.5px;
  line-height: 1.8;
  letter-spacing: 0.03em;
}

.admin-main {
  min-width: 0;
}

.admin-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--paper-dim);
}

.admin-head h1 {
  font-family: var(--serif);
  font-size: 35px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.admin-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.admin-head .admin-head-meta {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  text-align: right;
  white-space: nowrap;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 22px;
  border: 1px solid var(--line);
}

.metric {
  padding: 16px 15px 14px;
  border-right: 1px solid var(--line);
  background: var(--panel);
}

.metric:last-child {
  border-right: 0;
}

.metric-label {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.metric-value {
  margin-top: 7px;
  font-family: var(--serif);
  font-size: 31px;
  font-weight: 500;
  line-height: 1;
  color: var(--paper-bright);
}

.metric-note {
  margin-top: 7px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.02em;
}

.admin-split {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  gap: 18px;
  margin-top: 18px;
}

.admin-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  margin-top: 18px;
}

.admin-split .admin-panel {
  margin-top: 0;
}

.admin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.admin-panel-head h2 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
}

.admin-panel-head .mono {
  color: var(--muted-2);
}

.admin-panel-body {
  padding: 16px;
}

.activity-chart {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  height: 138px;
  padding: 6px 0 0;
}

.activity-day {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.activity-bars {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
}

.activity-bar {
  width: 7px;
  min-height: 2px;
  background: var(--muted-2);
}

.activity-bar.is-post {
  background: var(--accent);
}

.activity-day small {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7px;
  white-space: nowrap;
}

.chart-legend {
  display: flex;
  gap: 14px;
  margin-top: 10px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7.5px;
}

.chart-legend i {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 4px;
}

.quick-list {
  border-top: 1px solid var(--line-soft);
}

.quick-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
}

.quick-row:last-child {
  border-bottom: 0;
}

.quick-row-copy {
  min-width: 0;
  flex: 1;
}

.quick-row-copy strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--paper-dim);
  font-size: 10.5px;
  font-weight: 400;
}

.quick-row-copy span {
  display: block;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7.5px;
}

.quick-row time {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7px;
  white-space: nowrap;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 0;
}

.admin-toolbar-copy {
  color: var(--muted);
  font-size: 11px;
}

.admin-toolbar-copy strong {
  color: var(--paper-dim);
  font-weight: 400;
}

.admin-search {
  display: flex;
  gap: 6px;
}

.admin-search input {
  width: 185px;
  height: 31px;
  padding: 0 9px;
  border: 1px solid var(--line);
  background: #10100f;
  color: var(--paper);
  font-size: 11px;
  outline: 0;
}

.admin-search input:focus {
  border-color: var(--paper-dim);
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.data-table th {
  padding: 9px 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7.5px;
  font-weight: 400;
  letter-spacing: 0.09em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
  background: #111110;
}

.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  color: var(--paper-dim);
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover td {
  background: #181816;
}

.cell-user {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 170px;
}

.cell-user-copy {
  min-width: 0;
}

.cell-user-copy strong {
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--paper);
  font-size: 11px;
  font-weight: 500;
}

.cell-user-copy strong .badge {
  height: 13px;
  padding: 0 3px;
  font-size: 7px;
  flex-shrink: 0;
}

.cell-user-copy span {
  display: block;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7.5px;
}

.cell-muted {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  white-space: nowrap;
}

.cell-excerpt {
  max-width: 330px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--paper-dim);
}

.cell-excerpt-wrap {
  max-width: 340px;
}

.cell-excerpt-wrap strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--paper-dim);
  font-size: 11px;
  font-weight: 400;
}

.cell-excerpt-wrap span {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 9.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 260px;
}

.row-action {
  border: 0;
  background: none;
  padding: 0;
  color: var(--muted);
  font-size: 9.5px;
  white-space: nowrap;
}

.row-action:hover {
  color: var(--paper);
}

.row-action.is-accent {
  color: var(--accent);
}

.row-action.is-danger {
  color: #bd7160;
}

.row-action.is-danger:hover {
  color: #ef8f79;
}

.row-action:disabled {
  color: var(--muted-2);
  opacity: 0.5;
}

.admin-empty {
  padding: 50px 20px;
  color: var(--muted-2);
  text-align: center;
  font-size: 11.5px;
}

.admin-note {
  padding: 11px 14px;
  border-left: 2px solid var(--line);
  background: #111110;
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.8;
  margin-bottom: 14px;
}

.admin-note strong {
  color: var(--paper-dim);
  font-weight: 400;
}

.admin-form {
  padding: 18px;
}

.admin-form .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.admin-form .form-field {
  margin-bottom: 15px;
}

.admin-form .form-field.is-wide {
  grid-column: 1 / -1;
}

.setting-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #111110;
  margin-bottom: 16px;
}

.setting-toggle input {
  margin-top: 3px;
  accent-color: var(--accent);
}

.setting-toggle label {
  font-size: 11px;
  color: var(--paper-dim);
}

.setting-toggle p {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 9.5px;
}

.log-list {
  border-top: 1px solid var(--line);
}

.log-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) 95px;
  gap: 14px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 10px;
}

.log-row:last-child {
  border-bottom: 0;
}

.log-action {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 8px;
}

.log-detail {
  color: var(--paper-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-time {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7.5px;
  text-align: right;
}

.admin-notice-row {
  border-bottom: 1px solid var(--line-soft);
  padding: 14px 16px;
}

.admin-notice-row:last-child {
  border-bottom: 0;
}

.admin-notice-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-notice-top h3 {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
}

.admin-notice-body {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.75;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-line;
}

.admin-notice-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7.5px;
}

.admin-notice-foot .row-actions {
  margin-left: auto;
}

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(3, 3, 3, 0.82);
  animation: fade-in 0.16s ease both;
}

.modal {
  width: min(500px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  border: 1px solid #3a3732;
  background: #151514;
  box-shadow: var(--shadow);
  animation: page-in 0.2s ease both;
}

.modal-lg {
  width: min(640px, 100%);
}

.modal-sm {
  width: min(390px, 100%);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 21px 15px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.3;
}

.modal-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.6;
}

.modal-close {
  width: 27px;
  height: 27px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: none;
  color: var(--muted);
}

.modal-close:hover {
  color: var(--paper);
  background: var(--panel-2);
}

.modal-body {
  padding: 20px 21px;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 21px;
  border-top: 1px solid var(--line);
}

.modal-body p {
  color: var(--paper-dim);
  font-size: 12px;
  line-height: 1.8;
}

.modal-body .modal-note {
  margin-top: 8px;
  color: var(--muted-2);
  font-size: 10px;
}

.avatar-editor {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
}

.avatar-editor .avatar {
  --av-size: 72px;
}

.avatar-editor-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
}

.avatar-editor-actions .mono {
  color: var(--muted-2);
  font-size: 8px;
}

.avatar-editor-actions .text-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  font-size: 10px;
}

.avatar-editor-actions .text-btn:hover {
  text-decoration: underline;
}

.temp-password {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  padding: 13px;
  border: 1px dashed var(--accent-dim);
  background: #1e1210;
}

.temp-password code {
  flex: 1;
  color: var(--paper-bright);
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.08em;
  word-break: break-all;
}

.temp-password button {
  border: 1px solid var(--accent-dim);
  background: transparent;
  color: var(--accent);
  padding: 5px 8px;
  font-size: 9px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--paper-dim);
  font-size: 11px;
}

.check-row input {
  accent-color: var(--accent);
}

/* --------------------------------------------------------------------------
   Toasts, empty, loading
   -------------------------------------------------------------------------- */

.toast-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 350;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.toast {
  min-width: 210px;
  max-width: min(360px, calc(100vw - 40px));
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--paper-dim);
  background: #181816;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.5);
  color: var(--paper-dim);
  font-size: 11.5px;
  line-height: 1.6;
  animation: toast-in 0.2s ease both;
  pointer-events: auto;
}

.toast.is-success {
  border-left-color: var(--moss);
}

.toast.is-error {
  border-left-color: var(--accent);
  color: #e0b3a7;
}

.empty-state {
  padding: 54px 22px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.empty-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--serif);
  font-size: 22px;
  margin-bottom: 13px;
}

.empty-state h3 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  color: var(--paper-dim);
}

.empty-state p {
  margin-top: 6px;
  color: var(--muted-2);
  font-size: 11.5px;
  line-height: 1.8;
}

.empty-state .btn {
  margin-top: 16px;
}

.loading-block {
  padding: 55px 0;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-align: center;
}

.loading-line {
  display: inline-block;
  width: 28px;
  height: 1px;
  margin-right: 9px;
  vertical-align: middle;
  background: var(--accent);
  animation: loading-pulse 1.2s ease-in-out infinite;
}

@keyframes loading-pulse {
  0%, 100% { transform: scaleX(0.3); opacity: 0.4; }
  50% { transform: scaleX(1); opacity: 1; }
}

.error-panel {
  max-width: 620px;
  margin: 80px auto;
  padding: 36px;
  border: 1px solid var(--line);
  background: var(--panel);
  text-align: center;
}

.error-panel .error-code {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.error-panel h1 {
  margin-top: 10px;
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 500;
}

.error-panel p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.error-panel .btn {
  margin-top: 20px;
}

.boot {
  min-height: 55vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.boot-mark {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  color: var(--paper-dim);
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.08em;
  animation: boot-turn 2.4s ease-in-out infinite;
}

@keyframes boot-turn {
  0%, 100% { transform: rotate(0); }
  50% { transform: rotate(2deg); }
}

.noscript {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 500;
  padding: 14px;
  background: var(--accent);
  color: #fff;
  text-align: center;
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-foot {
  border-top: 1px solid var(--line);
  padding: 42px 0 60px;
  margin-top: 40px;
}

.foot-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
}

.foot-brand strong {
  display: block;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.foot-brand p {
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.foot-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-top: 9px;
}

.foot-meta a:hover {
  color: var(--paper-dim);
}

.foot-rule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 30px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.05em;
}

.foot-rule .wonderder {
  color: var(--paper-dim);
  letter-spacing: 0.12em;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  :root {
    --shell: min(100% - 48px, 1060px);
  }

  .home-grid {
    gap: 42px;
    grid-template-columns: minmax(0, 1fr) 290px;
  }

  .home-hero {
    gap: 40px;
  }

  .site-nav {
    gap: 22px;
  }

  .admin-shell {
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 28px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .metric:nth-child(2) {
    border-right: 0;
  }

  .metric:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 900px) {
  .home-hero {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .hero-note > p {
    max-width: 560px;
  }

  .hero-meta {
    max-width: 390px;
  }

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

  .side-column {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
    margin-top: 10px;
  }

  .side-block {
    margin-bottom: 0;
  }

  .page-head {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .page-head .page-head-note {
    max-width: 520px;
  }

  .auth-page {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .auth-visual {
    min-height: 300px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 44px 32px 38px;
  }

  .auth-visual h1 {
    font-size: clamp(44px, 9vw, 64px);
  }

  .auth-quote {
    margin-top: 34px;
  }

  .auth-panel {
    padding: 46px 32px 70px;
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-side {
    position: static;
    padding-right: 0;
    border-right: 0;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--line);
  }

  .admin-side-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 0;
  }

  .admin-tabs {
    flex-direction: row;
    overflow-x: auto;
    gap: 4px;
    padding: 10px 0 0;
    scrollbar-width: none;
  }

  .admin-tabs::-webkit-scrollbar {
    display: none;
  }

  .admin-tab {
    width: auto;
    flex-shrink: 0;
    border-left: 0;
    border-bottom: 2px solid transparent;
    padding: 8px 10px;
  }

  .admin-tab.is-active {
    border-left-color: transparent;
    border-bottom-color: var(--accent);
  }

  .admin-tab span {
    display: none;
  }

  .admin-side-foot {
    display: none;
  }

  .admin-split {
    grid-template-columns: 1fr;
  }

  .profile-head {
    flex-wrap: wrap;
  }

  .profile-side {
    width: 100%;
    align-items: flex-start;
    flex-direction: row;
    justify-content: space-between;
    border-top: 1px solid var(--line-soft);
    padding-top: 18px;
  }

  .profile-stat {
    text-align: left;
  }

  .messages-layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  :root {
    --shell: calc(100% - 36px);
  }

  body {
    padding-bottom: 63px;
    font-size: 13.5px;
  }

  .grain {
    opacity: 0.035;
  }

  #site-header {
    position: relative;
  }

  .utility-bar {
    display: none;
  }

  .site-masthead {
    min-height: 62px;
    gap: 10px;
  }

  .brand {
    gap: 9px;
  }

  .brand-mark {
    width: 32px;
    height: 37px;
    font-size: 14px;
  }

  .brand-mark::after {
    top: 18px;
  }

  .brand-copy strong {
    font-size: 18px;
  }

  .brand-copy small {
    font-size: 7px;
  }

  .site-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    margin: 0;
    height: calc(60px + env(safe-area-inset-bottom));
    padding: 0 12px env(safe-area-inset-bottom);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    background: #10100f;
    border-top: 1px solid var(--line);
  }

  .nav-link {
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    height: 100%;
    padding: 0;
    font-size: 9.5px;
    letter-spacing: 0.06em;
  }

  .nav-link svg {
    width: 17px;
    height: 17px;
  }

  .nav-link.is-active::after {
    left: 50%;
    right: auto;
    bottom: 9px;
    width: 14px;
    height: 1px;
    transform: translateX(-50%);
  }

  .nav-link .nav-badge {
    position: absolute;
    top: 8px;
    left: calc(50% + 7px);
    min-width: 14px;
    height: 14px;
    font-size: 7px;
  }

  .account,
  .site-masthead > .login-link {
    margin-left: auto;
  }

  .account {
    padding-left: 0;
    border-left: 0;
  }

  .account-button {
    gap: 6px;
  }

  .account-button .user-chip-name {
    display: none;
  }

  .account-button .avatar {
    --av-size: 30px;
  }

  .account-button .chevron {
    display: none;
  }

  .account-menu {
    position: fixed;
    top: 68px;
    right: 18px;
    width: 205px;
  }

  .login-link {
    padding: 6px 10px;
    font-size: 10px;
  }

  .home-page {
    padding: 34px 0 62px;
  }

  .home-hero {
    padding-bottom: 27px;
    margin-bottom: 34px;
    gap: 20px;
  }

  .home-hero h1 {
    margin-top: 13px;
    font-size: clamp(38px, 11.5vw, 55px);
  }

  .hero-note > p {
    font-size: 12.5px;
  }

  .hero-meta {
    margin-top: 19px;
  }

  .home-grid {
    gap: 34px;
  }

  .feed-heading {
    align-items: center;
  }

  .feed-heading h2 {
    font-size: 16px;
  }

  .feed-tab.is-active::after {
    bottom: -13px;
  }

  .composer {
    margin: 18px 0 27px;
  }

  .composer-main {
    padding: 14px 13px 9px;
  }

  .composer-main .avatar {
    --av-size: 32px;
  }

  .composer-main textarea {
    min-height: 72px;
    font-size: 13px;
  }

  .composer-foot {
    padding: 8px 12px;
  }

  .composer-count {
    font-size: 8px;
  }

  .join-card {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
  }

  .join-card h3 {
    font-size: 19px;
  }

  .post {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 11px;
    padding: 20px 0;
  }

  .post .avatar {
    --av-size: 32px;
  }

  .post-content {
    font-size: 13.5px;
    line-height: 1.8;
  }

  .post-head .display-name {
    font-size: 12px;
  }

  .post-head .post-time {
    font-size: 8px;
  }

  .post-actions {
    gap: 15px;
    margin-top: 11px;
  }

  .post-image {
    margin-top: 11px;
  }

  .side-column {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .about-card {
    padding: 17px;
  }

  .site-foot {
    padding: 30px 0 34px;
    margin-top: 26px;
  }

  .foot-inner {
    flex-direction: column;
    gap: 20px;
  }

  .foot-brand strong {
    font-size: 26px;
  }

  .foot-meta {
    justify-content: flex-start;
    gap: 12px;
    padding-top: 0;
  }

  .foot-rule {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-top: 22px;
  }

  .notices-page {
    padding: 35px 0 60px;
  }

  .page-head {
    padding-bottom: 27px;
    gap: 18px;
  }

  .page-head h1 {
    margin-top: 12px;
    font-size: clamp(38px, 12vw, 55px);
  }

  .notice-card {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 23px 0 21px;
  }

  .notice-card.is-pinned {
    padding-left: 12px;
  }

  .notice-index {
    padding-top: 0;
    font-size: 8px;
  }

  .notice-card h2 {
    font-size: 20px;
  }

  .notice-body {
    margin-top: 7px;
    font-size: 12.5px;
  }

  .notice-side {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding-top: 2px;
  }

  .notice-admin-actions {
    margin-top: 0;
    margin-left: auto;
  }

  .post-page {
    padding: 28px 0 65px;
  }

  .post-detail {
    margin-top: 18px;
    padding: 22px 0 19px;
  }

  .post-detail .post-content {
    font-size: 14.5px;
  }

  .post-detail .avatar {
    --av-size: 34px;
  }

  .comments-section {
    padding-top: 23px;
  }

  .comment-form {
    gap: 8px;
  }

  .comment-form .avatar {
    display: none;
  }

  .comment {
    grid-template-columns: 26px minmax(0, 1fr) auto;
    gap: 8px;
  }

  .comment .avatar {
    --av-size: 26px;
  }

  .auth-visual {
    min-height: 225px;
    padding: 30px 20px 26px;
  }

  .auth-visual h1 {
    margin-top: 13px;
    font-size: clamp(38px, 11vw, 52px);
  }

  .auth-quote {
    display: none;
  }

  .auth-ghost {
    bottom: -35px;
    font-size: 190px;
  }

  .auth-panel {
    padding: 32px 20px 54px;
  }

  .auth-form-head {
    margin-bottom: 23px;
  }

  .auth-form-head h2 {
    font-size: 28px;
  }

  .field-input {
    height: 46px;
  }

  .messages-page {
    padding: 25px 0 10px;
  }

  .messages-title-row {
    padding-bottom: 13px;
  }

  .messages-title-row h1 {
    font-size: 29px;
  }

  .messages-layout {
    display: block;
    height: calc(100vh - 226px);
    min-height: 480px;
    border-left: 0;
    border-right: 0;
    margin-inline: -18px;
  }

  .thread-list {
    border-right: 0;
    height: 100%;
  }

  .messages-layout.has-thread .thread-list {
    display: none;
  }

  .chat-panel {
    height: 100%;
    display: none;
  }

  .messages-layout.has-thread .chat-panel {
    display: flex;
  }

  .chat-back {
    display: inline-flex;
  }

  .chat-body {
    padding: 16px 13px;
  }

  .msg {
    max-width: 88%;
  }

  .msg-avatar {
    display: none;
  }

  .chat-compose {
    padding: 9px;
  }

  .chat-hint {
    display: none;
  }

  .profile-page {
    padding: 32px 0 62px;
  }

  .profile-head {
    gap: 16px;
    padding-bottom: 24px;
  }

  .profile-head .avatar-xl {
    --av-size: 72px;
  }

  .profile-id h1 {
    font-size: clamp(30px, 8vw, 40px);
  }

  .profile-bio {
    margin-top: 10px;
    font-size: 12px;
  }

  .profile-actions .btn {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 10px;
  }

  .profile-side {
    gap: 10px;
  }

  .profile-stat strong {
    font-size: 23px;
  }

  .profile-section-head {
    padding: 20px 0 10px;
  }

  .profile-section-head h2 {
    font-size: 18px;
  }

  .admin-page {
    padding: 25px 0 60px;
  }

  .admin-side-title strong {
    font-size: 22px;
  }

  .admin-head {
    padding-bottom: 13px;
  }

  .admin-head h1 {
    font-size: 29px;
  }

  .admin-head-meta {
    display: none;
  }

  .metric {
    padding: 13px 12px;
  }

  .metric-value {
    font-size: 27px;
  }

  .admin-panel-head {
    padding: 11px 13px;
  }

  .admin-panel-head h2 {
    font-size: 16px;
  }

  .admin-panel-body {
    padding: 13px;
  }

  .admin-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .admin-search input {
    flex: 1;
    width: auto;
  }

  .admin-search {
    width: 100%;
  }

  .admin-form {
    padding: 14px;
  }

  .admin-form .form-grid {
    grid-template-columns: 1fr;
  }

  .admin-form .form-field.is-wide {
    grid-column: auto;
  }

  .log-row {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 8px;
  }

  .log-time {
    display: none;
  }

  .data-table th,
  .data-table td {
    padding: 9px 10px;
  }

  .modal-backdrop {
    padding: 12px;
    align-items: flex-end;
  }

  .modal {
    max-height: calc(100vh - 24px);
  }

  .modal-head,
  .modal-body {
    padding-left: 17px;
    padding-right: 17px;
  }

  .modal-foot {
    padding: 12px 17px;
  }

  .toast-root {
    left: 16px;
    right: 16px;
    bottom: 74px;
    align-items: stretch;
  }

  .toast {
    max-width: none;
    min-width: 0;
  }

  .error-panel {
    margin: 46px auto;
    padding: 26px 20px;
  }

  .error-panel h1 {
    font-size: 28px;
  }
}

@media (max-width: 420px) {
  .brand-copy small {
    display: none;
  }

  .brand-copy strong {
    font-size: 17px;
  }

  .login-link {
    font-size: 9px;
  }

  .home-hero h1 {
    font-size: 36px;
  }

  .hero-meta {
    grid-template-columns: 1fr;
  }

  .hero-meta div {
    padding: 10px 0 0;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .hero-meta div:last-child {
    padding-left: 0;
    border-bottom: 0;
  }

  .composer-tool span {
    display: none;
  }

  .composer-count {
    display: none;
  }

  .composer-submit {
    margin-left: auto;
  }

  .post-actions {
    gap: 12px;
  }

  .post-head {
    gap: 6px;
  }

  .post-head .stamp-role {
    display: none;
  }

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

  .metric {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metric:last-child {
    border-bottom: 0;
  }

  .profile-head .avatar-xl {
    --av-size: 60px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------------------------------
   Mobile refinement
   A dedicated phone pass: compact home header, safe areas, 16px inputs,
   full-height chat, and card-style admin tables.
   -------------------------------------------------------------------------- */

.mobile-notice {
  display: none;
  align-items: center;
  gap: 11px;
  min-height: 48px;
  margin: 0 0 22px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  background: var(--panel);
}

.mobile-notice-kicker {
  flex-shrink: 0;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.08em;
}

.mobile-notice-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--paper-dim);
  font-size: 11.5px;
}

.mobile-notice-arrow {
  flex-shrink: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

@media (max-width: 760px) {
  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body {
    min-height: 100dvh;
    padding-bottom: calc(62px + env(safe-area-inset-bottom));
    -webkit-tap-highlight-color: transparent;
  }

  button,
  a,
  input,
  textarea,
  select {
    touch-action: manipulation;
  }

  #site-header {
    padding-top: env(safe-area-inset-top);
  }

  .site-nav {
    height: calc(60px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  body.is-typing {
    padding-bottom: 0;
  }

  body.is-typing .site-nav {
    transform: translateY(110%);
    opacity: 0;
    pointer-events: none;
  }

  .home-page {
    padding: 25px 0 62px;
  }

  .home-hero {
    gap: 15px;
    padding-bottom: 21px;
    margin-bottom: 22px;
  }

  .home-hero h1 {
    margin-top: 11px;
    font-size: clamp(31px, 9.2vw, 36px);
    line-height: 1.12;
  }

  .hero-note > p {
    font-size: 12px;
    line-height: 1.8;
  }

  .hero-meta {
    display: flex;
    margin-top: 13px;
    border-top: 1px solid var(--line);
  }

  .hero-meta div {
    flex: 1;
    min-width: 0;
    padding: 8px 10px 0 0;
    border-right: 1px solid var(--line-soft);
    border-bottom: 0;
  }

  .hero-meta div:last-child {
    padding-left: 11px;
    border-right: 0;
  }

  .hero-meta dt {
    font-size: 7px;
  }

  .hero-meta dd {
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 9px;
  }

  .hero-meta .desktop-only {
    display: none;
  }

  .hero-meta .mobile-only {
    display: inline;
  }

  .mobile-notice {
    display: flex;
    margin-bottom: 20px;
  }

  .join-card {
    gap: 12px;
    margin: 18px 0 26px;
    padding: 16px;
  }

  .join-card h3 {
    font-size: 18px;
  }

  .join-card p {
    margin-top: 3px;
    font-size: 11.5px;
    line-height: 1.7;
  }

  .join-card .join-actions .btn {
    min-height: 33px;
    padding: 6px 12px;
  }

  .feed-heading {
    padding-bottom: 10px;
  }

  .feed-tab {
    min-height: 32px;
    padding: 6px 0;
  }

  .feed-tab.is-active::after {
    bottom: -11px;
  }

  .composer {
    margin: 18px 0 26px;
  }

  .composer-main textarea {
    min-height: 88px;
    font-size: 16px;
    line-height: 1.7;
  }

  .composer-tool {
    min-height: 32px;
  }

  .composer-tool span,
  .composer-count {
    display: inline;
  }

  .post {
    padding: 20px 0 19px;
  }

  .post-action {
    min-height: 32px;
    padding: 4px 0;
  }

  .post-delete {
    min-height: 32px;
    padding: 4px 0;
  }

  .post-page {
    padding: 22px 18px 76px;
  }

  .post-page .post {
    padding-left: 0;
    padding-right: 0;
  }

  .post-detail {
    margin-top: 17px;
    padding-top: 22px;
    padding-bottom: 20px;
  }

  .comments-section {
    padding-bottom: 20px;
  }

  .comment-form textarea {
    font-size: 16px;
  }

  .field-input,
  .field-textarea,
  .field-select,
  .admin-search input,
  .admin-form .field-input,
  .admin-form .field-textarea,
  .admin-form .field-select {
    font-size: 16px;
  }

  .admin-search input {
    height: 36px;
  }

  .field-textarea {
    line-height: 1.65;
  }

  .auth-visual {
    min-height: 210px;
    padding-top: 29px;
    padding-bottom: 25px;
  }

  .auth-visual h1 {
    font-size: clamp(36px, 10vw, 48px);
  }

  .auth-panel {
    padding-top: 28px;
  }

  .auth-form-head h2 {
    font-size: 27px;
  }

  .form-field {
    margin-bottom: 16px;
  }

  .messages-page {
    padding: 22px 0 0;
  }

  .messages-layout {
    height: calc(100dvh - 218px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    min-height: 340px;
    max-height: none;
  }

  .thread-item {
    padding: 14px 15px;
  }

  .chat-head {
    padding: 11px 13px;
  }

  .chat-compose {
    padding: 9px 10px;
    padding-bottom: calc(9px + env(safe-area-inset-bottom) * 0.2);
  }

  .chat-compose textarea {
    min-height: 46px;
    font-size: 16px;
  }

  .chat-compose .btn {
    min-height: 46px;
  }

  .profile-page {
    padding-top: 28px;
  }

  .profile-actions {
    gap: 7px;
  }

  .profile-actions .btn {
    min-height: 34px;
  }

  .admin-page {
    padding-top: 22px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .metric:nth-child(2n) {
    border-right: 0;
  }

  .metric:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .admin-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    overflow: visible;
    padding-top: 10px;
  }

  .admin-tab {
    width: 100%;
    min-height: 36px;
    justify-content: center;
    padding: 7px 4px;
    border: 1px solid var(--line);
    border-left: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: #111110;
    font-size: 11px;
    text-align: center;
  }

  .admin-tab.is-active {
    border-color: var(--accent-dim);
    border-left-color: var(--accent-dim);
    border-bottom-color: var(--accent);
    background: var(--panel);
    color: var(--paper-bright);
  }

  .account-menu a,
  .account-menu button {
    padding-top: 11px;
    padding-bottom: 11px;
  }

  .thread-name {
    font-size: 12.5px;
  }

  .thread-preview {
    font-size: 11px;
  }

  .thread-meta time {
    font-size: 8px;
  }

  .modal-close {
    width: 34px;
    height: 34px;
  }

  .admin-toolbar {
    padding: 13px 0;
  }

  .admin-search .btn {
    min-height: 36px;
  }

  .table-wrap {
    -webkit-overflow-scrolling: touch;
  }

  .modal-backdrop {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .toast-root {
    bottom: calc(74px + env(safe-area-inset-bottom));
  }

  .foot-rule {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

@media (max-width: 620px) {
  .table-wrap {
    padding: 0 13px;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table thead {
    display: none;
  }

  .data-table tbody tr {
    padding: 12px 0 10px;
    border-bottom: 1px solid var(--line);
  }

  .data-table tbody tr:last-child {
    border-bottom: 0;
    padding-bottom: 2px;
  }

  .data-table td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    padding: 5px 0;
    border: 0;
    text-align: right;
    font-size: 11px;
    line-height: 1.6;
  }

  .data-table td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    padding-top: 1px;
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 7.5px;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-align: left;
    text-transform: uppercase;
  }

  .data-table td:first-child {
    display: block;
    padding: 0 0 10px;
    text-align: left;
  }

  .data-table td:first-child::before {
    display: none;
  }

  .data-table td:last-child {
    display: block;
    padding-top: 9px;
    text-align: left;
  }

  .data-table td:last-child::before {
    display: block;
    margin-bottom: 6px;
  }

  .data-table td[colspan] {
    display: block;
    padding: 0;
    text-align: left;
  }

  .data-table td[colspan]::before {
    display: none;
  }

  .cell-user {
    min-width: 0;
  }

  .cell-user-copy strong {
    max-width: 230px;
  }

  .cell-excerpt,
  .cell-excerpt-wrap {
    max-width: 100%;
  }

  .cell-excerpt-wrap {
    text-align: left;
  }

  .cell-excerpt-wrap strong,
  .cell-excerpt-wrap span {
    text-align: left;
  }

  .data-table td .cell-user {
    justify-content: flex-start;
  }

  .data-table .row-actions {
    max-width: none;
    gap: 6px;
  }

  .data-table .row-action {
    min-height: 30px;
    padding: 6px 9px;
    border: 1px solid var(--line);
    font-size: 10px;
  }

  .data-table .row-action.is-accent {
    border-color: var(--accent-dim);
  }

  .data-table .row-action.is-danger {
    border-color: #5c2e25;
  }

  .admin-toolbar .mono {
    font-size: 8px;
  }
}

@media (max-width: 360px) {
  .home-hero h1 {
    font-size: 30px;
  }

  .hero-meta {
    display: block;
  }

  .hero-meta div,
  .hero-meta div:last-child {
    padding: 8px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .hero-meta div:last-child {
    border-bottom: 0;
  }

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

  .metric,
  .metric:nth-child(2n) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metric:last-child {
    border-bottom: 0;
  }
}

/* --------------------------------------------------------------------------
   Private chat: emoji, spring motion, and small physical details
   -------------------------------------------------------------------------- */

.chat-panel {
  position: relative;
}

.chat-composer {
  position: relative;
  flex-shrink: 0;
  background: var(--panel);
}

.chat-compose .emoji-toggle {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: #10100f;
  color: var(--muted);
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease, transform 0.16s cubic-bezier(0.2, 1.4, 0.35, 1);
}

.chat-compose .emoji-toggle:hover {
  color: var(--paper);
  border-color: var(--paper-dim);
}

.chat-compose .emoji-toggle[aria-expanded="true"] {
  color: var(--accent);
  border-color: var(--accent-dim);
  background: #20130f;
}

.chat-compose .emoji-toggle:active {
  transform: scale(0.92);
}

.chat-compose .chat-send {
  min-height: 44px;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.16s cubic-bezier(0.2, 1.4, 0.35, 1);
}

.chat-compose .chat-send.is-ready {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.chat-compose .chat-send:active {
  transform: scale(0.96);
}

.chat-composer.is-emoji-pulse .chat-compose {
  animation: composer-pulse 0.36s cubic-bezier(0.2, 1.4, 0.35, 1);
}

@keyframes composer-pulse {
  0% { transform: scale(1); }
  38% { transform: scale(0.992) translateY(1px); }
  70% { transform: scale(1.006); }
  100% { transform: scale(1); }
}

/* Emoji sheet */

.emoji-picker {
  position: absolute;
  left: 12px;
  bottom: calc(100% + 8px);
  z-index: 20;
  width: min(330px, calc(100% - 24px));
  max-height: min(310px, 52vh);
  overflow-y: auto;
  padding: 11px 12px 12px;
  border: 1px solid #3b3731;
  background: #171614;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.62);
  transform-origin: left bottom;
  animation: emoji-sheet-in 0.24s cubic-bezier(0.18, 1.32, 0.36, 1) both;
}

.emoji-picker[hidden] {
  display: none;
}

.emoji-recents[hidden] {
  display: none;
}

@keyframes emoji-sheet-in {
  from {
    opacity: 0;
    transform: translateY(9px) scale(0.93);
  }
  65% {
    opacity: 1;
    transform: translateY(-1px) scale(1.012);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.emoji-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.emoji-close {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: none;
  color: var(--muted);
}

.emoji-close:hover {
  color: var(--paper);
}

.emoji-section-label {
  margin: 9px 0 5px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}

.emoji-recents .emoji-grid {
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

.emoji-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  min-height: 36px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.16s cubic-bezier(0.2, 1.4, 0.35, 1);
}

.emoji-item:hover {
  background: var(--panel-3);
}

.emoji-item:active {
  transform: scale(0.78) rotate(-4deg);
}

.emoji-item:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: -2px;
}

/* Big emoji messages */

.msg-bubble.is-emoji {
  padding: 2px 0;
  border-color: transparent;
  background: transparent;
  color: inherit;
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: 0.02em;
}

.msg.is-mine .msg-bubble.is-emoji {
  padding: 2px 0;
  border-color: transparent;
  background: transparent;
  color: inherit;
}

.msg-bubble {
  transition: transform 0.16s cubic-bezier(0.2, 1.4, 0.35, 1);
  transform-origin: center;
}

.msg-bubble:active {
  transform: scale(0.975);
}

/* New messages arrive with a little weight. */

.msg.is-new.is-mine {
  animation: msg-spring-mine 0.48s cubic-bezier(0.16, 1.22, 0.3, 1) both;
}

.msg.is-new:not(.is-mine) {
  animation: msg-spring-theirs 0.48s cubic-bezier(0.16, 1.22, 0.3, 1) both;
}

@keyframes msg-spring-mine {
  0% {
    opacity: 0;
    transform: translate3d(18px, 8px, 0) scale(0.94);
  }
  62% {
    opacity: 1;
    transform: translate3d(-2px, -1px, 0) scale(1.012);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes msg-spring-theirs {
  0% {
    opacity: 0;
    transform: translate3d(-18px, 8px, 0) scale(0.94);
  }
  62% {
    opacity: 1;
    transform: translate3d(2px, -1px, 0) scale(1.012);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

/* A tiny physical emoji burst from the picker / send button. */

.emoji-mote {
  position: fixed;
  z-index: 360;
  pointer-events: none;
  font-size: 16px;
  line-height: 1;
  will-change: transform, opacity;
}

/* Return-to-latest control */

.chat-jump {
  position: absolute;
  right: 15px;
  bottom: 92px;
  z-index: 16;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: #0b0b0b;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
  animation: jump-in 0.25s cubic-bezier(0.18, 1.35, 0.4, 1) both;
  transition: transform 0.16s cubic-bezier(0.2, 1.4, 0.35, 1);
}

.chat-jump[hidden] {
  display: none;
}

.chat-jump:hover {
  transform: translateY(-2px);
}

.chat-jump:active {
  transform: scale(0.92);
}

@keyframes jump-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.82);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 760px) {
  .chat-jump {
    right: 12px;
    bottom: 78px;
    width: 36px;
    height: 36px;
  }

  .emoji-picker {
    left: 10px;
    width: calc(100% - 20px);
    max-height: min(300px, 48vh);
    padding: 10px;
  }

  .emoji-item {
    min-height: 38px;
    font-size: 21px;
  }

  .emoji-close {
    width: 30px;
    height: 30px;
  }

  .msg-bubble.is-emoji {
    font-size: 32px;
  }
}
