:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #222222;
  background: #f6f5f1;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
}

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

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid #dedbd2;
  background: #ffffff;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #222222;
  font-weight: 700;
  text-decoration: none;
}

.brand-icon {
  display: inline-block;
  width: 26px;
  height: 26px;
  border-radius: 7px;
}

.site-header nav a {
  color: #3f5f6f;
  font-weight: 600;
  text-decoration: none;
}

.auth-gate {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-gate[hidden] {
  display: none;
}

.auth-card {
  display: grid;
  gap: 18px;
  width: min(440px, 100%);
  border: 1px solid #dedbd2;
  border-radius: 8px;
  padding: 32px;
  background: #ffffff;
}

.auth-card[hidden] {
  display: none;
}

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

.auth-card p {
  color: #4f5756;
  line-height: 1.65;
}

.auth-kicker {
  color: #2f6464;
  font-weight: 700;
}

.auth-primary-button,
.auth-secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.auth-primary-button {
  border: 1px solid #2f6464;
  color: #ffffff;
  background: #2f6464;
}

.auth-primary-button:hover {
  background: #255455;
}

.auth-secondary-button {
  border: 1px solid #cfd8d7;
  color: #222222;
  background: #ffffff;
}

.auth-secondary-button:hover {
  background: #f7fbfb;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(0, 680px);
  gap: 28px;
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
}

.app-shell[hidden] {
  display: none;
}

.mobile-nav {
  display: none;
}

.mobile-app-title {
  display: none;
}

.side-nav {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
  padding: 32px 12px 32px 0;
}

.side-brand {
  margin-bottom: 28px;
  font-size: 1.2rem;
}

.side-brand .brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.nav-menu {
  display: grid;
  gap: 8px;
}

.nav-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  padding: 12px 14px;
  color: #222222;
  background: transparent;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.icon {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.nav-item:hover,
.nav-item.active {
  background: #ffffff;
}

.nav-item:disabled {
  color: #9a9a92;
  cursor: default;
}

.nav-item:disabled:hover {
  background: transparent;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  margin-left: auto;
  border-radius: 999px;
  padding: 0 7px;
  color: #ffffff;
  background: #2f6464;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
}

.nav-badge[hidden] {
  display: none;
}

.auth-box {
  margin-top: 12px;
  padding: 0 10px;
}

.auth-button {
  border: 0;
  padding: 0;
  color: #68706f;
  background: transparent;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.auth-button:hover {
  color: #222222;
  text-decoration: underline;
}

.auth-button:disabled {
  opacity: 0.55;
  cursor: default;
}

.profile-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  margin-top: 28px;
  border: 0;
  border-radius: 8px;
  padding: 10px;
  color: #222222;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.profile-link:hover {
  background: #ffffff;
}

.profile-avatar,
.profile-panel-avatar,
.post-avatar {
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: #2f6464;
  background-position: center;
  background-size: cover;
  font-weight: 700;
}

.profile-avatar,
.profile-panel-avatar {
  flex: 0 0 auto;
}

.profile-avatar.has-image,
.profile-panel-avatar.has-image,
.post-avatar.has-image {
  color: transparent;
}

.profile-avatar {
  width: 42px;
  height: 42px;
}

.profile-link-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.profile-name {
  font-weight: 700;
}

.profile-name,
.profile-handle {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-handle,
.profile-panel-handle {
  color: #68706f;
}

.profile-bio {
  color: #3f4544;
  overflow-wrap: anywhere;
}

.profile-handle {
  font-size: 0.9rem;
}

.timeline-layout,
.admin-layout {
  display: grid;
  gap: 28px;
  width: min(1120px, calc(100% - 32px));
  margin: 32px auto;
}

.timeline-layout {
  position: relative;
  width: 100%;
}

.post-detail-layout {
  display: grid;
  gap: 0;
  width: min(680px, calc(100% - 32px));
  margin: 24px auto;
}

.post-detail-layout[hidden] {
  display: none;
}

.post-detail-header {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid #dedbd2;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  padding: 14px;
  background: #ffffff;
}

.post-detail-header h1,
.post-detail-header p {
  margin: 0;
}

.post-detail-header h1 {
  font-size: 1.25rem;
}

.post-detail-header p {
  color: #68706f;
  font-size: 0.9rem;
}

.post-back-link {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  text-decoration: none;
}

.post-back-link:hover {
  background: #f7fbfb;
}

.refresh-indicator {
  position: absolute;
  top: -48px;
  left: 50%;
  z-index: 1;
  min-width: 96px;
  border: 1px solid #d5e2e1;
  border-radius: 999px;
  padding: 8px 14px;
  color: #3f5f6f;
  background: #ffffff;
  font-size: 0.9rem;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 0);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.admin-layout {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
}

.post-list-panel,
.post-detail,
.editor,
.profile-panel,
.search-panel,
.home-composer,
.timeline-post {
  background: #ffffff;
  border: 1px solid #dedbd2;
  border-radius: 8px;
  padding: 24px;
}

.post-detail-thread,
.comment-composer,
.comment-list {
  background: #ffffff;
  border-left: 1px solid #dedbd2;
  border-right: 1px solid #dedbd2;
}

.comment-list {
  border-bottom: 1px solid #dedbd2;
  border-radius: 0 0 8px 8px;
}

.post-detail-post {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  border-top: 1px solid #dedbd2;
  padding: 16px 12px;
}

.comment-composer {
  border-top: 1px solid #dedbd2;
  padding: 12px;
}

.comment-composer textarea {
  min-height: 52px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  padding: 8px 0;
  background: #ffffff;
  resize: none;
}

.comment-composer textarea:focus {
  outline: none;
}

.comment-composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #eee9df;
  padding-top: 10px;
}

.comment-composer-actions .form-message {
  margin: 0;
}

.comment-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  border-top: 1px solid #dedbd2;
  padding: 12px;
}

.timeline > .comment-item {
  border: 1px solid #dedbd2;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.timeline > .comment-item:hover {
  background: #f7fbfb;
}

.comment-list > .comment-item {
  cursor: pointer;
}

.comment-list > .comment-item:hover {
  background: #f7fbfb;
}

.comment-item.highlighted-comment {
  background: #edf7f6;
  box-shadow: inset 4px 0 0 #2f6464;
}

.comment-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  color: #ffffff;
  background: #2f6464;
  background-position: center;
  background-size: cover;
  font-weight: 700;
}

.comment-avatar.has-image {
  color: transparent;
}

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

.notification-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  border: 0;
  border-top: 1px solid #dedbd2;
  padding: 12px 14px;
  background: #ffffff;
  cursor: pointer;
}

.notification-item:first-child {
  border-top: 0;
  border-radius: 8px 8px 0 0;
}

.notification-item:last-child {
  border-radius: 0 0 8px 8px;
}

.notification-item:hover {
  background: #f7fbfb;
}

.notification-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  color: #ffffff;
  background: #2f6464;
  background-position: center;
  background-size: cover;
  font-weight: 700;
}

.notification-avatar.has-image {
  color: transparent;
}

.notification-content {
  min-width: 0;
}

.notification-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #3f4645;
  line-height: 1.4;
}

.notification-type-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 999px;
  color: #ffffff;
  background: #2f6464;
  font-size: 0.82rem;
  font-weight: 800;
}

.notification-type-icon.like {
  background: #d64574;
}

.notification-type-icon .icon {
  width: 14px;
  height: 14px;
  stroke-width: 2.4;
}

.notification-text {
  min-width: 0;
}

.notification-text p {
  margin: 0;
}

.notification-header time {
  display: block;
  margin-top: 1px;
  color: #68706f;
  font-size: 0.9rem;
}

.notification-body {
  margin-top: 8px;
  color: #3f4645;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.notification-body p {
  margin: 0;
}

.home-composer {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  padding: 12px;
}

.home-composer[hidden] {
  display: none;
}

.search-panel {
  padding: 12px;
}

.search-panel[hidden] {
  display: none;
}

.search-form {
  margin: 0;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid #d5e2e1;
  border-radius: 999px;
  padding: 0 14px;
  color: #68706f;
  background: #f7fbfb;
}

.search-input-wrap:focus-within {
  border-color: #2f6464;
  background: #ffffff;
}

.search-input-wrap input {
  width: 100%;
  border: 0;
  padding: 10px 0;
  color: #222222;
  background: transparent;
  font: inherit;
}

.search-input-wrap input:focus {
  outline: none;
}

.search-results {
  margin-top: 12px;
}

.search-user-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  border-top: 1px solid #dedbd2;
  padding: 12px 0;
  cursor: pointer;
}

.search-user-card:first-child {
  border-top: 0;
}

.search-user-card:hover {
  background: #f7fbfb;
}

.search-user-avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  color: #ffffff;
  background: #2f6464;
  background-position: center;
  background-size: cover;
  font-weight: 700;
}

.search-user-avatar.has-image {
  color: transparent;
}

.search-user-main {
  min-width: 0;
}

.search-user-name,
.search-user-handle,
.search-user-bio {
  margin: 0;
}

.search-user-name {
  font-weight: 800;
}

.search-user-name,
.search-user-handle {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-user-handle {
  color: #68706f;
}

.search-user-bio {
  margin-top: 6px;
  color: #3f4645;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.search-results > .timeline-post,
.search-results > .comment-item {
  border: 0;
  border-top: 1px solid #dedbd2;
  border-radius: 0;
  padding: 12px 0;
  background: transparent;
  cursor: pointer;
}

.search-results > .timeline-post:first-child,
.search-results > .comment-item:first-child {
  border-top: 0;
}

.search-results > .timeline-post:hover,
.search-results > .comment-item:hover {
  background: #f7fbfb;
}

.composer-avatar {
  width: 48px;
  height: 48px;
}

.home-post-form {
  gap: 6px;
}

.home-post-form textarea {
  min-height: 52px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  padding: 8px 0;
  background: #ffffff;
  resize: none;
}

.home-post-form textarea:focus {
  outline: none;
}

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #eee9df;
  padding-top: 6px;
}

.composer-actions .form-message {
  margin: 0;
}

.composer-feedback {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  min-width: 0;
}

.character-counter {
  color: #6f6b65;
  font-size: 0.82rem;
  white-space: nowrap;
}

.character-counter.over-limit {
  color: #b42318;
  font-weight: 700;
}

#homePostButton:disabled {
  opacity: 0.65;
  cursor: default;
}

.timeline-post {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  padding: 12px;
}

.post-avatar {
  width: 48px;
  height: 48px;
}

.profile-panel {
  --avatar-size: 112px;
  --cover-height: 200px;
  display: block;
  overflow: hidden;
  padding: 0;
  position: relative;
  text-align: left;
}

.profile-panel[hidden] {
  display: none;
}

.profile-cover {
  height: var(--cover-height);
  background:
    linear-gradient(135deg, rgba(47, 100, 100, 0.88), rgba(117, 153, 154, 0.52)),
    linear-gradient(45deg, #dce8e4, #f0eee8);
  background-position: center;
  background-size: cover;
}

.profile-content {
  display: grid;
  gap: 6px;
  padding: calc(var(--avatar-size) / 2 + 8px) 24px 24px;
}

.profile-panel-avatar {
  position: absolute;
  top: calc(var(--cover-height) - var(--avatar-size) / 2);
  left: 24px;
  width: var(--avatar-size);
  height: var(--avatar-size);
  border: 4px solid #ffffff;
  font-size: 2.2rem;
}

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

.profile-panel h1 {
  margin-bottom: 2px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-panel-main {
  display: grid;
  gap: 0;
  justify-items: start;
  min-width: 0;
  width: 100%;
}

.profile-panel-handle {
  margin-bottom: 0;
}

.profile-timeline {
  margin-top: 0;
}

.profile-edit-button {
  position: absolute;
  top: calc(var(--cover-height) + 16px);
  right: 24px;
  min-height: 38px;
  border: 1px solid #cfd8d7;
  border-radius: 999px;
  padding: 8px 16px;
  color: #222222;
  background: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

.profile-edit-button:hover {
  border-color: #75999a;
  background: #f7fbfb;
}

.profile-edit-form {
  display: grid;
  gap: 12px;
}

.profile-edit-form[hidden] {
  display: none;
}

.profile-edit-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-cancel-button {
  border: 1px solid #cfd8d7;
  border-radius: 8px;
  padding: 10px 14px;
  color: #222222;
  background: #ffffff;
  cursor: pointer;
}

.profile-cancel-button:hover {
  background: #f7fbfb;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(34, 34, 34, 0.32);
}

.modal-backdrop[hidden] {
  display: none;
}

.profile-edit-modal {
  width: min(620px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(34, 34, 34, 0.22);
}

.post-edit-modal {
  width: min(560px, 100%);
  max-height: min(620px, calc(100vh - 48px));
  overflow: auto;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(34, 34, 34, 0.22);
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid #dedbd2;
  background: #ffffff;
}

.modal-header h2 {
  margin: 0;
}

.profile-edit-modal form {
  padding: 20px;
}

.profile-edit-preview {
  --edit-cover-height: 180px;
  --edit-avatar-size: 112px;
  --edit-avatar-offset: 56px;
  position: relative;
  min-height: calc(var(--edit-cover-height) + var(--edit-avatar-offset) + 16px);
  margin: -20px -20px 0;
}

.image-picker {
  display: block;
  cursor: pointer;
  font-weight: 700;
}

.profile-cover-preview {
  display: block;
  height: var(--edit-cover-height);
  background:
    linear-gradient(135deg, rgba(47, 100, 100, 0.88), rgba(117, 153, 154, 0.52)),
    linear-gradient(45deg, #dce8e4, #f0eee8);
  background-position: center;
  background-size: cover;
}

.profile-avatar-picker {
  position: absolute;
  left: 20px;
  top: calc(var(--edit-cover-height) - var(--edit-avatar-offset));
}

.profile-avatar-preview {
  display: grid;
  place-items: center;
  width: var(--edit-avatar-size);
  height: var(--edit-avatar-size);
  border: 4px solid #ffffff;
  border-radius: 999px;
  color: #ffffff;
  background: #2f6464;
  background-position: center;
  background-size: cover;
  font-size: 2.2rem;
}

.profile-avatar-preview.has-image {
  color: transparent;
}

#profileAvatarImage,
#profileCoverImage {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.profile-bio {
  margin-top: 5px;
}

h1,
h2 {
  margin: 0 0 18px;
  line-height: 1.25;
}

h1 {
  font-size: 1.8rem;
}

h2 {
  font-size: 1.25rem;
}

.post-list {
  display: grid;
  gap: 10px;
}

.post-list-item {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 14px;
  text-align: left;
  background: #f7fbfb;
  border: 1px solid #d5e2e1;
  border-radius: 8px;
  cursor: pointer;
}

.post-list-item:hover {
  border-color: #75999a;
}

.post-list-item span {
  font-weight: 700;
}

.post-list-item small,
.timeline-post time,
.section-heading p,
.empty-message,
.form-message {
  color: #68706f;
}

.timeline {
  display: grid;
  align-content: start;
  gap: 0;
}

.timeline[hidden] {
  display: none;
}

.post-detail-panel {
  display: grid;
  align-content: start;
}

.post-detail-panel[hidden] {
  display: none;
}

.post-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #dedbd2;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  padding: 12px;
  background: #ffffff;
}

.post-detail-header h1 {
  margin: 0;
  font-size: 1.1rem;
}

.post-detail-back-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  color: #222222;
  background: transparent;
  cursor: pointer;
}

.post-detail-back-button:hover {
  background: #f7fbfb;
}

.post-detail-panel .post-detail-thread {
  border-top: 0;
}

.post-detail-panel .timeline-post {
  border: 0;
  border-radius: 0;
  padding: 16px 12px;
}

.timeline-post time {
  font-size: 0.9rem;
}

.timeline > .timeline-post {
  cursor: pointer;
}

.timeline > .timeline-post:hover {
  background: #f7fbfb;
}

.post-content {
  min-width: 0;
}

.post-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.post-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 6px;
}

.post-author {
  font-weight: 700;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-handle {
  color: #68706f;
  font-size: 0.95rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-handle + time {
  margin-left: 8px;
}

.author-profile-link {
  cursor: pointer;
}

.post-author.author-profile-link:hover,
.post-handle.author-profile-link:hover {
  text-decoration: underline;
}

.post-menu {
  position: relative;
}

.post-menu-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  color: #68706f;
  background: transparent;
  cursor: pointer;
}

.post-menu-button:hover {
  color: #2f6464;
  background: #f7fbfb;
}

.post-menu-popover {
  position: absolute;
  top: 34px;
  right: 0;
  z-index: 2;
  display: none;
  min-width: 120px;
  border: 1px solid #dedbd2;
  border-radius: 8px;
  padding: 6px;
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(34, 34, 34, 0.14);
}

.post-menu.open .post-menu-popover {
  display: grid;
}

.post-menu-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  border-radius: 6px;
  padding: 6px 12px;
  color: #222222;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.post-menu-item:hover {
  background: #f7fbfb;
}

.delete-post-action,
.delete-comment-action {
  color: #c0392b;
}

.delete-post-action:hover,
.delete-comment-action:hover {
  background: #fff1ef;
}

.post-body {
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.post-body p {
  margin: 0;
}

.body-toggle-button {
  border: 0;
  padding: 4px 0 0;
  color: #2f6464;
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}

.body-toggle-button:hover {
  text-decoration: underline;
}

.loading-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  color: #68706f;
  font-size: 0.92rem;
}

.loading-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #d5e2e1;
  border-top-color: #2f6464;
  border-radius: 999px;
  animation: spin 800ms linear infinite;
}

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

.post-actions {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 10px;
}

.post-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  border: 0;
  padding: 0;
  color: #68706f;
  background: transparent;
  cursor: pointer;
}

.post-action:hover {
  color: #2f6464;
}

.static-action,
.static-action:hover {
  color: #68706f;
  cursor: default;
}

.like-action.active {
  color: #e0245e;
}

.bookmark-action.active {
  color: #1d9bf0;
}

.like-effect {
  display: inline-grid;
  place-items: center;
  position: relative;
  width: 22px;
  height: 22px;
}

.like-icon {
  position: relative;
  z-index: 2;
  font-size: 18px;
  line-height: 1;
  color: currentColor;
}

.like-donut {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.like-donut::after {
  content: "";
  width: 10px;
  height: 10px;
  border: 2px solid #f6a5c0;
  border-radius: 999px;
  opacity: 0;
}

.like-bubbles {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.like-bubbles span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: #e0245e;
  opacity: 0;
  transform: translate(-50%, -50%);
}

.like-bubbles span:nth-child(2n) {
  background: #f6a5c0;
}

.like-action.animate .like-icon {
  animation: like-heart 520ms ease-out forwards;
}

.like-action.animate .like-donut::after {
  animation: like-donut 520ms ease-out forwards;
}

.like-action.animate .like-bubbles span:nth-child(1) {
  animation: like-bubble-1 620ms ease-out forwards;
}

.like-action.animate .like-bubbles span:nth-child(2) {
  animation: like-bubble-2 620ms ease-out forwards;
}

.like-action.animate .like-bubbles span:nth-child(3) {
  animation: like-bubble-3 620ms ease-out forwards;
}

.like-action.animate .like-bubbles span:nth-child(4) {
  animation: like-bubble-4 620ms ease-out forwards;
}

.like-action.animate .like-bubbles span:nth-child(5) {
  animation: like-bubble-5 620ms ease-out forwards;
}

.like-action.animate .like-bubbles span:nth-child(6) {
  animation: like-bubble-6 620ms ease-out forwards;
}

.like-action.animate .like-bubbles span:nth-child(7) {
  animation: like-bubble-7 620ms ease-out forwards;
}

.like-action.animate .like-bubbles span:nth-child(8) {
  animation: like-bubble-8 620ms ease-out forwards;
}

.comment-count,
.like-count {
  min-width: 1ch;
  text-align: right;
}

@keyframes like-heart {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(0);
  }
  58% {
    transform: scale(1.35);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes like-donut {
  0% {
    opacity: 0;
    border-width: 2px;
    transform: scale(0.4);
  }
  45% {
    opacity: 1;
    border-width: 7px;
    transform: scale(1.7);
  }
  100% {
    opacity: 0;
    border-width: 1px;
    transform: scale(2.1);
  }
}

@keyframes like-bubble-1 {
  40% { opacity: 0; transform: translate(-50%, -50%); }
  72% { opacity: 1; transform: translate(8px, -22px); }
  100% { opacity: 0; transform: translate(12px, -28px); }
}

@keyframes like-bubble-2 {
  40% { opacity: 0; transform: translate(-50%, -50%); }
  72% { opacity: 1; transform: translate(20px, -10px); }
  100% { opacity: 0; transform: translate(28px, -12px); }
}

@keyframes like-bubble-3 {
  40% { opacity: 0; transform: translate(-50%, -50%); }
  72% { opacity: 1; transform: translate(18px, 8px); }
  100% { opacity: 0; transform: translate(24px, 14px); }
}

@keyframes like-bubble-4 {
  40% { opacity: 0; transform: translate(-50%, -50%); }
  72% { opacity: 1; transform: translate(6px, 20px); }
  100% { opacity: 0; transform: translate(8px, 28px); }
}

@keyframes like-bubble-5 {
  40% { opacity: 0; transform: translate(-50%, -50%); }
  72% { opacity: 1; transform: translate(-10px, 18px); }
  100% { opacity: 0; transform: translate(-14px, 26px); }
}

@keyframes like-bubble-6 {
  40% { opacity: 0; transform: translate(-50%, -50%); }
  72% { opacity: 1; transform: translate(-22px, 6px); }
  100% { opacity: 0; transform: translate(-30px, 8px); }
}

@keyframes like-bubble-7 {
  40% { opacity: 0; transform: translate(-50%, -50%); }
  72% { opacity: 1; transform: translate(-18px, -12px); }
  100% { opacity: 0; transform: translate(-26px, -16px); }
}

@keyframes like-bubble-8 {
  40% { opacity: 0; transform: translate(-50%, -50%); }
  72% { opacity: 1; transform: translate(-6px, -22px); }
  100% { opacity: 0; transform: translate(-8px, -30px); }
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.section-heading p {
  margin: 0;
}

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

.post-edit-form {
  padding: 20px;
}

.post-edit-form textarea {
  min-height: 180px;
  resize: vertical;
}

.post-edit-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.post-edit-actions .form-message {
  margin: 0;
}

label {
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfcac0;
  border-radius: 8px;
  padding: 12px;
  background: #fffdf8;
}

textarea {
  resize: vertical;
}

button[type="submit"],
#newPostButton,
#homePostButton {
  width: fit-content;
  border: 0;
  border-radius: 8px;
  padding: 11px 16px;
  color: #ffffff;
  background: #2f6464;
  cursor: pointer;
}

button[type="submit"]:hover,
#newPostButton:hover,
#homePostButton:hover {
  background: #244f4f;
}

.admin-user-layout {
  display: grid;
  gap: 18px;
  width: min(1040px, calc(100% - 32px));
  margin: 32px auto;
}

.admin-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  border-bottom: 1px solid #dedbd2;
}

.admin-tab {
  flex: 0 0 auto;
  min-height: 42px;
  border: 0;
  border-radius: 8px 8px 0 0;
  padding: 10px 14px;
  color: #68706f;
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}

.admin-tab:hover,
.admin-tab.active {
  color: #222222;
  background: #ffffff;
}

.admin-panel {
  display: grid;
  gap: 16px;
}

.admin-placeholder {
  display: grid;
  gap: 8px;
  border: 1px solid #dedbd2;
  border-radius: 8px;
  padding: 24px;
  background: #ffffff;
}

.admin-placeholder h1,
.admin-placeholder p {
  margin: 0;
}

.admin-placeholder p {
  color: #68706f;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

#reloadUsersButton,
.admin-user-action {
  border: 1px solid #2f6464;
  border-radius: 999px;
  padding: 8px 14px;
  color: #ffffff;
  background: #2f6464;
  font-weight: 700;
  cursor: pointer;
}

#reloadUsersButton:hover,
.admin-user-action:hover {
  background: #244f4f;
}

#reloadUsersButton:disabled {
  opacity: 0.55;
  cursor: default;
}

.admin-user-header {
  display: grid;
  grid-template-columns: minmax(140px, 1.1fr) minmax(220px, 1.4fr) 90px 130px 150px;
  gap: 12px;
  padding: 0 12px 8px;
  color: #68706f;
  font-size: 0.82rem;
  font-weight: 700;
}

.admin-user-list {
  display: grid;
  gap: 0;
  border: 1px solid #dedbd2;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.admin-user-card {
  display: grid;
  border-bottom: 1px solid #dedbd2;
}

.admin-user-card:last-child {
  border-bottom: 0;
}

.admin-user-card.open {
  background: #f7fbfb;
}

.admin-user-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.1fr) minmax(220px, 1.4fr) 90px 130px 150px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  border: 0;
  padding: 10px 12px;
  color: #222222;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.admin-user-row:hover {
  background: #f7fbfb;
}

.admin-user-cell {
  display: flex;
  align-items: center;
  min-width: 0;
  font-size: 0.92rem;
}

.admin-user-cell span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.admin-user-name {
  font-weight: 700;
}

.admin-user-email {
  color: #68706f;
}

.admin-mobile-label {
  display: none;
}

.admin-user-note {
  color: #68706f;
  font-size: 0.9rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.85rem;
}

.status-pending {
  color: #705314;
  background: #fff2c7;
}

.status-approved {
  color: #245b43;
  background: #dff3e7;
}

.status-rejected {
  color: #8a2d24;
  background: #ffe1dd;
}

.status-suspended {
  color: #5d546b;
  background: #ebe7f3;
}

.admin-user-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  border-top: 1px solid #dedbd2;
  padding: 10px 12px;
  background: #ffffff;
}

.admin-user-actions .admin-user-action {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 0.85rem;
}

#homePostButton {
  min-height: 38px;
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 700;
}

#commentSubmitButton {
  min-height: 38px;
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 700;
}

#inlineCommentSubmitButton {
  min-height: 38px;
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 700;
}

#homePostButton:disabled {
  opacity: 0.45;
  cursor: default;
}

#commentSubmitButton:disabled {
  opacity: 0.45;
  cursor: default;
}

#inlineCommentSubmitButton:disabled {
  opacity: 0.45;
  cursor: default;
}

#homePostButton:disabled:hover,
#commentSubmitButton:disabled:hover,
#inlineCommentSubmitButton:disabled:hover {
  background: #2f6464;
}

@media (max-width: 820px) {
  body {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  .app-shell {
    grid-template-columns: 1fr;
    width: 100%;
    gap: 0;
  }

  .side-nav {
    display: none;
  }

  .timeline-layout {
    width: 100%;
    gap: 0;
    margin: 0;
    padding: 0;
  }

  .mobile-app-title {
    position: sticky;
    top: 0;
    z-index: 7;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-bottom: 1px solid #dedbd2;
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
    background: rgba(250, 249, 246, 0.96);
    backdrop-filter: blur(14px);
    color: #222222;
    font-size: 1.05rem;
    font-weight: 800;
    text-align: center;
  }

  .mobile-app-title .brand-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }

  .mobile-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 8;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    border-top: 1px solid #dedbd2;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: rgba(250, 249, 246, 0.96);
    backdrop-filter: blur(14px);
  }

  .mobile-nav-item {
    position: relative;
    display: grid;
    place-items: center;
    gap: 3px;
    min-height: 54px;
    border: 0;
    border-radius: 8px;
    color: #68706f;
    background: transparent;
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer;
  }

  .mobile-nav-item .icon {
    width: 22px;
    height: 22px;
  }

  .mobile-nav-item span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-nav-item.active {
    color: #222222;
    background: #ffffff;
  }

  .mobile-nav-badge {
    position: absolute;
    top: 3px;
    right: calc(50% - 24px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 19px;
    height: 19px;
    border: 2px solid #ffffff;
    border-radius: 999px;
    padding: 0 5px;
    color: #ffffff;
    background: #2f6464;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
  }

  .mobile-nav-badge[hidden] {
    display: none;
  }

  .home-composer,
  .timeline-post,
  .search-panel,
  .profile-panel {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .profile-panel {
    --avatar-size: 84px;
    --cover-height: 132px;
  }

  .profile-content {
    padding: calc(var(--avatar-size) / 2 + 8px) 16px 18px;
  }

  .profile-panel-avatar {
    left: 16px;
    border-width: 3px;
    font-size: 1.7rem;
  }

  .profile-edit-button {
    top: calc(var(--cover-height) + 12px);
    right: 16px;
    min-height: 34px;
    padding: 6px 12px;
    font-size: 0.88rem;
  }

  .timeline > .comment-item,
  .notification-item {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .post-detail-panel,
  .post-detail-thread,
  .comment-composer,
  .comment-list {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .empty-message {
    margin: 0;
    padding: 14px 16px;
  }

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

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

  .admin-user-header {
    display: none;
  }

  .admin-user-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 12px;
  }

  .admin-user-cell {
    justify-content: space-between;
    gap: 12px;
  }

  .admin-mobile-label {
    display: inline;
    flex: 0 0 auto;
    color: #68706f;
    font-size: 0.82rem;
    font-weight: 700;
  }

  .admin-user-actions {
    justify-content: flex-start;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }
}
