:root {
  --background: #eeeeee;
  --card: #ffffff;
  --text: #111111;
  --secondary-text: #666666;
  --muted-text: #888888;
  --border: #cccccc;
  --input: #ffffff;
  --button: #dddddd;
  --button-hover: #cccccc;
  --primary: #111111;
  --primary-text: #ffffff;
  --bubble: #f1f1f1;
  --highlight: #e5e5e5;
  --highlight-hover: #d5d5d5;
  --overlay: rgba(0, 0, 0, 0.55);
  --shadow: rgba(0, 0, 0, 0.25);
}

body[data-theme="dark"] {
  --background: #101010;
  --card: #1c1c1c;
  --text: #f5f5f5;
  --secondary-text: #aaaaaa;
  --muted-text: #888888;
  --border: #414141;
  --input: #151515;
  --button: #303030;
  --button-hover: #3d3d3d;
  --primary: #f3f3f3;
  --primary-text: #111111;
  --bubble: #141414;
  --highlight: #2b2b2b;
  --highlight-hover: #383838;
  --overlay: rgba(0, 0, 0, 0.72);
  --shadow: rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  width: min(680px, calc(100% - 24px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0 60px;

  background: var(--background);
  color: var(--text);

  font-family: Arial, Helvetica, sans-serif;

  transition:
    background 0.2s ease,
    color 0.2s ease;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
label:focus-visible,
.signup-username-editor:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.78);
  outline-offset: 4px;
}

/* REMOVE THE BROWSER'S BLUE SEARCH X */

input[type="search"] {
  appearance: none;
  -webkit-appearance: none;
}

input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  display: none;
  appearance: none;
  -webkit-appearance: none;
}

input[type="search"]::-ms-clear,
input[type="search"]::-ms-reveal {
  display: none;
  width: 0;
  height: 0;
}

/* HEADER */

.site-header {
  margin-bottom: 20px;
}

.site-header h1 {
  margin: 0;

  color: var(--text);

  font-size: 40px;
  letter-spacing: -1.5px;
}

.site-header p {
  margin: 5px 0 0;
  color: var(--secondary-text);
}

h1,
h2,
h3,
strong,
label {
  color: var(--text);
}

h2 {
  margin-top: 0;
}

h3 {
  margin: 0;
}

.hidden {
  display: none !important;
}

/* CARDS */

.card,
.yap {
  margin-top: 16px;
  padding: 19px;

  background: var(--card);
  color: var(--text);

  border: 1px solid var(--border);
  border-radius: 24px;
}

.auth-card,
.settings-card,
.composer-card {
  border-radius: 28px;
}

.yap {
  border-radius: 26px;
}

/* INPUTS */

input {
  width: 100%;
  height: 44px;
  margin: 6px 0;
  padding: 0 16px;

  background: var(--input);
  color: var(--text);
  caret-color: var(--text);

  border: 1px solid var(--border);
  border-radius: 999px;
  outline: none;
}

textarea {
  width: 100%;
  min-height: 110px;
  margin: 6px 0;
  padding: 14px 16px;

  background: var(--input);
  color: var(--text);
  caret-color: var(--text);

  border: 1px solid var(--border);
  border-radius: 20px;
  outline: none;

  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--text);
}

input::placeholder,
textarea::placeholder {
  color: var(--muted-text);
  opacity: 1;
}

input::selection,
textarea::selection,
p::selection,
span::selection,
strong::selection,
h1::selection,
h2::selection,
h3::selection {
  background: var(--primary);
  color: var(--primary-text);
}

/* BUTTONS */

button {
  height: 42px;
  min-height: 42px;
  padding: 0 18px;
  margin: 0;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;

  background: var(--button);
  color: var(--text);

  border: 1px solid var(--border);
  border-radius: 999px;

  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-align: center;

  cursor: pointer;
  flex-shrink: 0;

  transition:
    background 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease,
    border-color 0.15s ease,
    opacity 0.15s ease;
}

button:hover {
  background: var(--button-hover);
  color: var(--text);
  transform: translateY(-1px);
}

button:active {
  transform: scale(0.97);
}

button:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.primary-button {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
  font-weight: 700;
}

.primary-button:hover {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
  filter: brightness(0.88);
}

.button-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 12px;
}

.auth-buttons button {
  width: 160px;
}

.account-buttons button {
  width: 98px;
}

.theme-buttons button {
  width: 150px;
}

/* ACCOUNT BAR */

.account-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;

  padding: 13px 14px 13px 20px;
  border-radius: 28px;
}

.account-bar .button-row {
  margin-top: 0;
}

/* SETTINGS */

.settings-section {
  margin-top: 18px;
  padding: 17px;

  background: var(--bubble);
  color: var(--text);

  border: 1px solid var(--border);
  border-radius: 21px;
}

.settings-section:first-of-type {
  margin-top: 0;
}

.theme-button.active {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
  font-weight: 800;
}

.theme-button.active:hover {
  background: var(--primary);
  color: var(--primary-text);
}

.password-button {
  width: 190px;
  min-width: 190px;
  margin-top: 10px;
}

.close-settings-button {
  width: 165px;
  margin-top: 16px;
}

#changePasswordMessage {
  min-height: 18px;
  margin: 10px 0 0;

  color: var(--text);

  font-size: 14px;
  font-weight: 700;
}

/* COMPOSER */

.composer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 7px;
}

.character-counter {
  color: var(--secondary-text);
  font-size: 14px;
}

#characterCount.near-limit {
  color: var(--text);
  font-weight: 800;
}

#postButton {
  width: 145px;
  min-width: 145px;
}

#postButton.posted-state {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);

  animation: sentAppear 0.28s ease;
}

#postButton.returning-state {
  animation: sentReturn 0.3s ease;
}

#postMessage {
  min-height: 18px;
  margin-bottom: 0;

  color: var(--text);

  font-size: 14px;
  font-weight: 700;
}

.feed-heading {
  margin: 27px 4px 5px;
  color: var(--text);
}

/* AVATARS */

.profile-avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;

  overflow: hidden;

  background: var(--primary);
  color: var(--primary-text);

  border: 1px solid var(--border);
  border-radius: 50%;

  font-weight: 800;
  text-transform: uppercase;
}

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

  /* Profile pictures stay fully colored */
  filter: none;
}

.avatar-small {
  width: 38px;
  height: 38px;
  font-size: 16px;
}

.avatar-reply {
  width: 30px;
  height: 30px;
  font-size: 13px;
}

.avatar-search {
  width: 46px;
  height: 46px;
  font-size: 18px;
}

.avatar-connection {
  width: 40px;
  height: 40px;
  font-size: 15px;
}

.profile-avatar-large {
  width: 112px;
  height: 112px;
  margin: 0 auto 14px;
  font-size: 42px;
}

.profile-avatar-edit {
  width: 96px;
  height: 96px;
  font-size: 36px;
}

.avatar-profile-button {
  width: auto;
  height: auto;
  min-height: 0;
  padding: 0;

  background: transparent;
  color: var(--text);

  border: 0;
  border-radius: 50%;
}

.avatar-profile-button:hover {
  background: transparent;
  color: var(--text);
  transform: scale(1.04);
}

.avatar-profile-button:active {
  transform: scale(0.96);
}

/* PROFILE LINKS */

.profile-link {
  display: inline;
  width: auto;
  height: auto;
  min-height: 0;

  margin: 0;
  padding: 0;

  background: transparent;
  color: inherit;

  border: 0;
  border-radius: 0;

  line-height: 1.25;
  text-align: left;
}

.profile-link:hover {
  background: transparent;
  color: inherit;
  text-decoration: underline;
  transform: none;
}

.profile-link:active {
  transform: none;
}

/* POST AUTHORS */

.post-author-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.post-author-information {
  min-width: 0;
}

.post-author-display-name {
  display: block;

  color: var(--text);

  font-size: 16px;
  font-weight: 800;

  overflow-wrap: anywhere;
}

.post-author-username {
  display: block;
  margin-top: 2px;

  color: var(--secondary-text);

  font-size: 12px;
  font-weight: 600;

  overflow-wrap: anywhere;
}

.post-date {
  margin-top: 4px;

  color: var(--muted-text);

  font-size: 11px;
}

/* YAP BUBBLES */

.yap-text,
.reply {
  display: inline-block;
  width: fit-content;
  max-width: 100%;

  margin-top: 12px;
  padding: 10px 16px;

  background: var(--bubble);
  color: var(--text);

  border: 1px solid var(--border);
  border-radius: 999px;

  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.yap-text.multiline,
.reply.multiline {
  display: block;
  width: 100%;
  border-radius: 18px;
}

/* POST ACTIONS */

.post-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 15px;
}

.post-actions button {
  width: 165px;
  min-width: 165px;
  height: 42px;
  min-height: 42px;
  padding: 0 15px;
}

/* LIKE BUTTON */

.like-button span {
  color: inherit;
  white-space: nowrap;
}

.heart-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;

  fill: transparent;
  stroke: currentColor;

  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;

  transition:
    fill 0.15s ease,
    stroke 0.15s ease;
}

.like-button.liked {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
}

.like-button.liked:hover {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
  filter: brightness(0.88);
}

.like-button.liked .heart-icon {
  fill: currentColor;
  stroke: currentColor;
}

/* REPLY TOGGLE */

.reply-toggle-button.cancel-state {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
}

.reply-toggle-button.cancel-state:hover {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
  filter: brightness(0.88);
}

.reply-toggle-button.is-morphing {
  animation: buttonMorph 0.25s ease;
}

@keyframes buttonMorph {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  45% {
    transform: scale(0.84);
    opacity: 0.55;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* REPLY COMPOSER */

.reply-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  align-items: center;
  gap: 9px;

  margin-top: 13px;

  transform-origin: top;
}

.reply-composer.is-opening {
  animation: replyComposerOpen 0.26s ease forwards;
}

.reply-composer.is-closing {
  pointer-events: none;
  animation: replyComposerClose 0.26s ease forwards;
}

.reply-composer input {
  height: 42px;
  margin: 0;
}

.reply-composer button {
  width: 120px;
  height: 42px;
}

@keyframes replyComposerOpen {
  from {
    opacity: 0;
    transform: translateY(-8px) scaleY(0.82);
  }

  to {
    opacity: 1;
    transform: translateY(0) scaleY(1);
  }
}

@keyframes replyComposerClose {
  from {
    opacity: 1;
    transform: translateY(0) scaleY(1);
  }

  to {
    opacity: 0;
    transform: translateY(-8px) scaleY(0.82);
  }
}

/* SENT ANIMATIONS */

.send-reply-button.sent-state {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);

  animation: sentAppear 0.28s ease;
}

.send-reply-button.returning-state {
  animation: sentReturn 0.3s ease;
}

@keyframes sentAppear {
  0% {
    transform: scale(0.85);
    opacity: 0.6;
  }

  65% {
    transform: scale(1.07);
    opacity: 1;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes sentReturn {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  45% {
    transform: scale(0.84);
    opacity: 0.55;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* REPLIES */

.replies-list {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 15px;

  margin-top: 14px;
}

.reply-entry {
  width: 100%;
  max-width: 100%;
}

.reply-author-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reply-author-information {
  min-width: 0;
}

.reply-author-display-name {
  display: block;

  color: var(--text);

  font-size: 14px;
  font-weight: 800;

  overflow-wrap: anywhere;
}

.reply-author-username {
  display: block;
  margin-top: 1px;

  color: var(--secondary-text);

  font-size: 11px;
  font-weight: 600;

  overflow-wrap: anywhere;
}

.reply-content {
  max-width: calc(100% - 38px);
  margin-left: 38px;
}

.reply-entry .reply {
  margin-top: 6px;
}

.reply-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 13px;

  margin-top: 5px;
  margin-left: 12px;
}

.reply-text-action,
.reply-control,
.text-button {
  display: inline;
  width: auto;
  height: auto;
  min-height: 0;

  margin: 0;
  padding: 0;

  background: transparent;
  color: var(--secondary-text);

  border: 0;
  border-radius: 0;

  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;

  cursor: pointer;
}

.reply-text-action:hover,
.reply-control:hover,
.text-button:hover {
  background: transparent;
  color: var(--text);
  text-decoration: underline;
  transform: none;
}

.reply-text-action:active,
.reply-control:active,
.text-button:active {
  transform: none;
}

.reply-text-action.active {
  color: var(--text);
}

.replies-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;

  margin-top: 12px;
}

.reply-control {
  font-size: 13px;
}

.reply-control:disabled {
  opacity: 0.55;
  text-decoration: none;
}

/* MESSAGES */

.error,
.success,
#authMessage,
#profileEditMessage,
#profileViewNotice {
  color: var(--text);
  font-weight: 700;
}

#authMessage {
  margin-bottom: 0;
}

#profileEditMessage {
  min-height: 19px;
  margin: 11px 0 0;

  font-size: 13px;
}

#profileViewNotice {
  min-height: 18px;
  margin: 13px 0 0;

  font-size: 13px;
}

/* MODALS */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;

  display: grid;
  place-items: center;

  padding: 18px;

  background: var(--overlay);
  backdrop-filter: blur(5px);
}

.search-overlay {
  z-index: 1040;
}

.profile-overlay {
  z-index: 1050;
}

.delete-modal,
.search-modal,
.profile-modal {
  position: relative;

  width: min(430px, 100%);
  padding: 24px;

  background: var(--card);
  color: var(--text);

  border: 1px solid var(--border);
  border-radius: 26px;

  box-shadow:
    0 24px 70px var(--shadow);

  animation: modalAppear 0.18s ease;
}

.delete-modal h2 {
  margin: 0;
}

.delete-modal p {
  margin: 10px 0 22px;

  color: var(--secondary-text);

  line-height: 1.5;
}

.modal-close-button {
  position: absolute;
  top: 13px;
  right: 13px;

  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;

  background: var(--button);
  color: var(--text);

  border-color: var(--border);

  font-size: 25px;
  font-weight: 400;
}

.modal-close-button:hover {
  background: var(--button-hover);
  color: var(--text);
}

.modal-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.modal-buttons button {
  width: 100%;
}

@keyframes modalAppear {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* SEARCH */

.search-modal {
  width: min(560px, 100%);
  max-height: min(88vh, 720px);
  overflow-y: auto;
}

.search-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px;
  gap: 8px;
  margin-top: 10px;
}

.search-input-row input {
  margin: 0;
}

.search-input-row button {
  width: 90px;
}

.search-status {
  min-height: 18px;
  margin: 12px 3px 8px;

  color: var(--secondary-text);

  font-size: 13px;
}

.search-results {
  display: grid;
  gap: 9px;
}

.search-result {
  width: 100%;
  min-height: 70px;
  height: auto;
  padding: 10px 12px;

  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 11px;

  background: var(--bubble);
  color: var(--text);

  border-radius: 19px;

  text-align: left;
  white-space: normal;
}

.search-result:hover {
  background: var(--button-hover);
  color: var(--text);
}

.search-result-text {
  min-width: 0;
  flex: 1;
}

.search-result-name {
  display: block;

  color: var(--text);

  font-size: 15px;
  font-weight: 800;

  overflow-wrap: anywhere;
}

.search-result-username {
  display: block;
  margin-top: 3px;

  color: var(--secondary-text);

  font-size: 12px;
  font-weight: 600;

  overflow-wrap: anywhere;
}

.relationship-badge {
  flex-shrink: 0;

  padding: 6px 9px;

  background: var(--button);
  color: var(--secondary-text);

  border: 1px solid var(--border);
  border-radius: 999px;

  font-size: 10px;
  font-weight: 800;
}

.relationship-badge.friend {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
}

/* PROFILE */

.profile-modal {
  width: min(580px, 100%);
  max-height: min(90vh, 800px);
  overflow-y: auto;
}

#profileViewSection {
  padding-top: 10px;
  text-align: center;
}

.profile-display-name {
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.profile-handle {
  margin: 5px 0 0;

  color: var(--secondary-text);

  font-weight: 700;
  overflow-wrap: anywhere;
}

.profile-bio {
  min-height: 22px;
  margin: 20px auto;

  color: var(--text);

  line-height: 1.5;
  overflow-wrap: anywhere;
}

.profile-bio.empty {
  color: var(--secondary-text);
  font-style: italic;
}

/* PROFILE STATS */

.profile-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;

  margin-top: 18px;
  padding: 10px 7px;

  background: var(--bubble);

  border: 1px solid var(--border);
  border-radius: 20px;
}

.profile-stat {
  min-width: 0;
  height: auto;
  min-height: 54px;
  padding: 5px 2px;

  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;

  background: transparent;
  color: var(--text);

  border: 0;
  border-radius: 13px;
}

.profile-stat strong {
  color: var(--text);
  font-size: 17px;
  overflow-wrap: anywhere;
}

.profile-stat span {
  color: var(--secondary-text);

  font-size: 9px;
  font-weight: 700;
}

.profile-stat-button:hover {
  background: var(--highlight);
  color: var(--text);
  transform: none;
}

.profile-stat-button.active {
  background: var(--primary);
  color: var(--primary-text);
}

.profile-stat-button.active strong,
.profile-stat-button.active span {
  color: var(--primary-text);
}

/* CONNECTION LIST */

.profile-connections-panel {
  margin-top: 12px;
  padding: 13px;

  background: var(--bubble);
  color: var(--text);

  border: 1px solid var(--border);
  border-radius: 20px;

  text-align: left;
}

.connections-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

  margin-bottom: 9px;
}

.connections-panel-heading h3 {
  color: var(--text);
}

.profile-connections-list {
  display: grid;
  gap: 8px;

  max-height: 128px;

  overflow-y: auto;
  overflow-x: hidden;

  padding-right: 4px;

  scrollbar-color:
    var(--secondary-text)
    var(--bubble);

  scrollbar-width: thin;
}

.profile-connections-list::-webkit-scrollbar {
  width: 7px;
}

.profile-connections-list::-webkit-scrollbar-track {
  background: var(--bubble);
  border-radius: 999px;
}

.profile-connections-list::-webkit-scrollbar-thumb {
  background: var(--secondary-text);
  border-radius: 999px;
}

.connection-item {
  width: 100%;
  height: 60px;
  min-height: 60px;
  padding: 8px 10px;

  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;

  background: var(--card);
  color: var(--text);

  border-radius: 17px;

  text-align: left;
  white-space: normal;
}

.connection-item:hover {
  background: var(--button-hover);
  color: var(--text);
}

.connection-item-text {
  min-width: 0;
  flex: 1;
}

.connection-item-name {
  display: block;

  color: var(--text);

  font-size: 14px;
  font-weight: 800;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-item-username {
  display: block;
  margin-top: 3px;

  color: var(--secondary-text);

  font-size: 11px;
  font-weight: 600;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-list {
  margin: 8px 2px;

  color: var(--secondary-text);

  font-size: 13px;
  text-align: center;
}

/* PROFILE ACTIONS */

.profile-main-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;

  margin-top: 13px;
}

.profile-edit-button,
.profile-follow-button {
  width: 150px;
  min-width: 150px;
}

.profile-follow-button {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
}

.profile-follow-button:hover {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
  filter: brightness(0.88);
}

.profile-follow-button.following {
  background: var(--highlight);
  color: var(--text);
  border-color: var(--border);
}

.profile-follow-button.following:hover {
  background: var(--highlight-hover);
  color: var(--text);
  border-color: var(--border);
  filter: none;
}

.profile-follow-button.follow-animate {
  animation: followPop 0.36s ease;
}

@keyframes followPop {
  0% {
    transform: scale(1);
  }

  38% {
    transform: scale(0.82);
  }

  70% {
    transform: scale(1.08);
  }

  100% {
    transform: scale(1);
  }
}

/* PROFILE EDIT */

.profile-picture-editor {
  display: flex;
  align-items: center;
  gap: 17px;

  margin: 10px 0 20px;
  padding: 15px;

  background: var(--bubble);

  border: 1px solid var(--border);
  border-radius: 21px;
}

.profile-picture-controls {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 8px;
}

.file-picker-label {
  min-height: 40px;
  padding: 0 15px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: var(--button);
  color: var(--text);

  border: 1px solid var(--border);
  border-radius: 999px;

  font-size: 14px;
  font-weight: 700;

  cursor: pointer;
}

.file-picker-label:hover {
  background: var(--button-hover);
  color: var(--text);
}

.profile-file-input {
  display: none;
}

#removeProfilePictureButton {
  height: 40px;
  min-height: 40px;
  padding: 0 15px;

  font-size: 14px;
}

.profile-field {
  display: block;
  margin-top: 14px;
}

.profile-field > span {
  display: block;
  margin: 0 0 3px 5px;

  color: var(--text);

  font-size: 13px;
  font-weight: 800;
}

.profile-field textarea {
  margin-bottom: 0;
}

.bio-counter {
  margin-top: 5px;

  color: var(--secondary-text);

  font-size: 12px;
  text-align: right;
}

.profile-edit-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;

  margin-top: 14px;
}

.profile-edit-actions button {
  width: 100%;
}

/* MOBILE */

@media (max-width: 540px) {
  body {
    width: min(100% - 18px, 680px);
    padding-top: 18px;
  }

  .site-header h1 {
    font-size: 34px;
  }

  .card,
  .yap {
    padding: 16px;
    border-radius: 21px;
  }

  .auth-card,
  .settings-card,
  .composer-card {
    border-radius: 23px;
  }

  .account-bar {
    align-items: flex-start;
    flex-direction: column;

    padding: 17px;

    border-radius: 22px;
  }

  .account-bar .button-row {
    width: 100%;
  }

  .account-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .auth-buttons,
  .theme-buttons,
  .post-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .account-buttons button,
  .auth-buttons button,
  .theme-buttons button,
  .post-actions button {
    width: 100%;
    min-width: 0;
    padding: 0 8px;

    font-size: 13px;
  }

  .password-button {
    width: 190px;
    min-width: 190px;
  }

  .close-settings-button {
    width: 165px;
  }

  #postButton {
    width: 145px;
    min-width: 145px;
  }

  .reply-composer {
    grid-template-columns: 1fr;
  }

  .reply-composer button {
    width: 100%;
  }

  .reply-content {
    max-width: calc(100% - 34px);
    margin-left: 34px;
  }

  .yap-text.multiline,
  .reply.multiline {
    border-radius: 16px;
  }

  .delete-modal,
  .search-modal,
  .profile-modal {
    padding: 20px;
    border-radius: 22px;
  }

  .profile-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .profile-picture-editor {
    align-items: center;
    flex-direction: column;
    text-align: center;
  }

  .profile-picture-controls {
    align-items: center;
  }

  .search-input-row {
    grid-template-columns: 1fr;
  }

  .search-input-row button {
    width: 100%;
  }

  .relationship-badge {
    display: none;
  }
}/* =========================================================
   YAPPER — MONOCHROME LIQUID GLASS OVERRIDE
   Keep the current HTML and JavaScript unchanged.
   Paste this at the VERY BOTTOM of the current CSS.
   ========================================================= */

:root {
  --glass-card: rgba(255, 255, 255, 0.52);
  --glass-card-strong: rgba(255, 255, 255, 0.68);
  --glass-control: rgba(255, 255, 255, 0.38);
  --glass-control-hover: rgba(255, 255, 255, 0.58);
  --glass-bubble: rgba(255, 255, 255, 0.28);
  --glass-border: rgba(255, 255, 255, 0.76);
  --glass-border-soft: rgba(20, 20, 20, 0.12);
  --glass-highlight: rgba(255, 255, 255, 0.72);
  --glass-highlight-soft: rgba(255, 255, 255, 0.24);
  --glass-shadow: rgba(45, 45, 45, 0.18);
  --glass-shadow-deep: rgba(35, 35, 35, 0.24);
  --glass-overlay: rgba(40, 40, 40, 0.30);
  --glass-blur: 28px;
  --glass-control-blur: 16px;
  --glass-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

body[data-theme="dark"] {
  --glass-card: rgba(24, 24, 24, 0.56);
  --glass-card-strong: rgba(28, 28, 28, 0.72);
  --glass-control: rgba(255, 255, 255, 0.075);
  --glass-control-hover: rgba(255, 255, 255, 0.13);
  --glass-bubble: rgba(255, 255, 255, 0.055);
  --glass-border: rgba(255, 255, 255, 0.19);
  --glass-border-soft: rgba(255, 255, 255, 0.075);
  --glass-highlight: rgba(255, 255, 255, 0.16);
  --glass-highlight-soft: rgba(255, 255, 255, 0.065);
  --glass-shadow: rgba(0, 0, 0, 0.46);
  --glass-shadow-deep: rgba(0, 0, 0, 0.62);
  --glass-overlay: rgba(0, 0, 0, 0.48);
}

html {
  background: #d8d8d8;
}

html:has(body[data-theme="dark"]) {
  background: #090909;
}

body {
  position: relative;
  isolation: isolate;

  background:
    radial-gradient(
      circle at 12% 6%,
      rgba(255, 255, 255, 0.92) 0,
      rgba(255, 255, 255, 0.38) 20%,
      transparent 42%
    ),
    radial-gradient(
      circle at 88% 18%,
      rgba(155, 155, 155, 0.34) 0,
      transparent 38%
    ),
    radial-gradient(
      circle at 48% 96%,
      rgba(255, 255, 255, 0.48) 0,
      transparent 36%
    ),
    linear-gradient(145deg, #eeeeee 0%, #d1d1d1 52%, #e5e5e5 100%);

  background-attachment: fixed;
}

body[data-theme="dark"] {
  background:
    radial-gradient(
      circle at 12% 6%,
      rgba(255, 255, 255, 0.10) 0,
      transparent 35%
    ),
    radial-gradient(
      circle at 88% 18%,
      rgba(135, 135, 135, 0.10) 0,
      transparent 36%
    ),
    radial-gradient(
      circle at 48% 96%,
      rgba(255, 255, 255, 0.055) 0,
      transparent 34%
    ),
    linear-gradient(145deg, #080808 0%, #151515 52%, #0b0b0b 100%);

  background-attachment: fixed;
}

/* MAIN GLASS SURFACES */

.card,
.yap,
.delete-modal,
.search-modal,
.profile-modal {
  background:
    linear-gradient(
      145deg,
      var(--glass-highlight-soft) 0%,
      transparent 32%,
      transparent 70%,
      rgba(0, 0, 0, 0.025) 100%
    ),
    var(--glass-card);

  border: 1px solid var(--glass-border);

  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    inset 0 -1px 0 var(--glass-border-soft),
    0 18px 52px var(--glass-shadow),
    0 3px 10px rgba(0, 0, 0, 0.055);

  -webkit-backdrop-filter:
    blur(var(--glass-blur))
    contrast(1.03)
    brightness(1.03);

  backdrop-filter:
    blur(var(--glass-blur))
    contrast(1.03)
    brightness(1.03);

  transition:
    transform 220ms var(--glass-ease),
    box-shadow 280ms var(--glass-ease),
    border-color 220ms ease,
    background 280ms ease,
    color 220ms ease;
}

body[data-theme="dark"] .card,
body[data-theme="dark"] .yap,
body[data-theme="dark"] .delete-modal,
body[data-theme="dark"] .search-modal,
body[data-theme="dark"] .profile-modal {
  -webkit-backdrop-filter:
    blur(var(--glass-blur))
    contrast(1.06)
    brightness(0.92);

  backdrop-filter:
    blur(var(--glass-blur))
    contrast(1.06)
    brightness(0.92);
}

.card:hover,
.yap:hover {
  border-color: var(--glass-highlight);

  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    inset 0 -1px 0 var(--glass-border-soft),
    0 23px 62px var(--glass-shadow-deep),
    0 5px 14px rgba(0, 0, 0, 0.07);
}

.yap:hover {
  transform: translateY(-3px) scale(1.004);
}

/* TRUE LIQUID-GLASS CAPSULE ACCOUNT BAR */

.card.account-bar {
  border-radius: 9999px !important;
  overflow: hidden;

  background:
    linear-gradient(
      105deg,
      var(--glass-highlight-soft) 0%,
      transparent 24%,
      transparent 72%,
      var(--glass-highlight-soft) 100%
    ),
    var(--glass-card-strong);

  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    inset 0 -1px 0 var(--glass-border-soft),
    0 14px 42px var(--glass-shadow);
}

.card.account-bar > strong {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  white-space: nowrap;
}

.card.account-bar .button-row {
  position: relative;
  z-index: 1;
  margin-top: 0;
  flex-wrap: nowrap;
}

/* GLASS CONTROLS */

button,
input,
textarea,
.file-picker-label {
  -webkit-backdrop-filter:
    blur(var(--glass-control-blur))
    contrast(1.02);

  backdrop-filter:
    blur(var(--glass-control-blur))
    contrast(1.02);
}

button {
  position: relative;
  overflow: hidden;

  background:
    linear-gradient(
      145deg,
      var(--glass-highlight-soft) 0%,
      transparent 48%
    ),
    var(--glass-control);

  border-color: var(--glass-border);

  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    inset 0 -1px 0 var(--glass-border-soft),
    0 7px 18px rgba(0, 0, 0, 0.08);
}

button:hover {
  background:
    linear-gradient(
      145deg,
      var(--glass-highlight) 0%,
      transparent 50%
    ),
    var(--glass-control-hover);

  border-color: var(--glass-highlight);

  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    inset 0 -1px 0 var(--glass-border-soft),
    0 11px 25px var(--glass-shadow);

  transform: translateY(-2px) scale(1.015);
}

button:active {
  transform: translateY(0) scale(0.96);

  box-shadow:
    inset 0 2px 7px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 var(--glass-highlight);
}

.primary-button,
.like-button.liked,
.reply-toggle-button.cancel-state,
.theme-button.active,
.profile-follow-button {
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.19) 0%,
      transparent 46%
    ),
    var(--primary);

  color: var(--primary-text);
  border-color: var(--glass-highlight);

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18),
    0 9px 24px var(--glass-shadow);
}

.primary-button:hover,
.like-button.liked:hover,
.reply-toggle-button.cancel-state:hover,
.theme-button.active:hover,
.profile-follow-button:hover {
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.28) 0%,
      transparent 48%
    ),
    var(--primary);

  color: var(--primary-text);
  border-color: var(--glass-highlight);
  filter: none;
}

input,
textarea {
  background:
    linear-gradient(
      145deg,
      var(--glass-highlight-soft) 0%,
      transparent 42%
    ),
    var(--glass-control);

  border-color: var(--glass-border);

  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    inset 0 2px 8px rgba(0, 0, 0, 0.055),
    0 5px 16px rgba(0, 0, 0, 0.045);
}

input:hover,
textarea:hover {
  border-color: var(--glass-highlight);
}

input:focus,
textarea:focus {
  border-color: var(--text);

  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    inset 0 2px 8px rgba(0, 0, 0, 0.055),
    0 9px 24px var(--glass-shadow);

  transform: translateY(-1px);
}

/* INNER GLASS PANELS */

.settings-section,
.profile-stats,
.profile-connections-panel,
.profile-picture-editor,
.search-result,
.connection-item,
.yap-text,
.reply {
  background:
    linear-gradient(
      145deg,
      var(--glass-highlight-soft) 0%,
      transparent 48%
    ),
    var(--glass-bubble);

  border-color: var(--glass-border);

  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    inset 0 -1px 0 var(--glass-border-soft),
    0 7px 20px rgba(0, 0, 0, 0.055);

  -webkit-backdrop-filter:
    blur(var(--glass-control-blur))
    contrast(1.02);

  backdrop-filter:
    blur(var(--glass-control-blur))
    contrast(1.02);
}

.search-result:hover,
.connection-item:hover,
.profile-stat-button:hover {
  background:
    linear-gradient(
      145deg,
      var(--glass-highlight) 0%,
      transparent 52%
    ),
    var(--glass-control-hover);
}

.profile-stat {
  transition:
    transform 180ms var(--glass-ease),
    background 220ms ease,
    color 220ms ease,
    box-shadow 220ms ease;
}

.profile-stat-button:hover {
  transform: translateY(-2px);

  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    0 7px 18px var(--glass-shadow);
}

.profile-stat-button.active {
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.22) 0%,
      transparent 48%
    ),
    var(--primary);

  color: var(--primary-text);

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 8px 22px var(--glass-shadow);
}

/* KEEP TEXT-LIKE BUTTONS CLEAN */

.profile-link,
.avatar-profile-button,
.reply-text-action,
.reply-control,
.text-button,
.inline-hashtag {
  overflow: visible;

  background: transparent;
  border-color: transparent;

  box-shadow: none;

  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.profile-link:hover,
.avatar-profile-button:hover,
.reply-text-action:hover,
.reply-control:hover,
.text-button:hover,
.inline-hashtag:hover {
  background: transparent;
  box-shadow: none;
  transform: none;
}

/* MODALS — WORKS WITH THE CURRENT JS THAT ONLY TOGGLES .hidden */

.modal-overlay {
  background: var(--glass-overlay);

  -webkit-backdrop-filter:
    blur(18px)
    brightness(0.86);

  backdrop-filter:
    blur(18px)
    brightness(0.86);
}

.modal-overlay:not(.hidden) {
  animation:
    liquidGlassBackdropIn
    220ms
    ease
    both;
}

.modal-overlay:not(.hidden) .modal-surface {
  animation:
    liquidGlassPanelIn
    380ms
    var(--glass-ease)
    both;
}

.modal-close-button {
  background:
    linear-gradient(
      145deg,
      var(--glass-highlight-soft),
      transparent 52%
    ),
    var(--glass-control);
}

/* PROFILE PICTURES ARE THE ONLY FULL-COLOR ELEMENTS */

.profile-avatar img,
#profilePicturePreview img,
#profileAvatarDisplay img {
  filter: none !important;
  opacity: 1;
  mix-blend-mode: normal;
}

/* EVERYTHING ELSE REMAINS MONOCHROME */

svg,
.heart-icon {
  color: currentColor;
}

/* SCROLLBARS */

* {
  scrollbar-color:
    var(--secondary-text)
    transparent;
}

*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background:
    linear-gradient(
      180deg,
      var(--glass-highlight),
      var(--secondary-text)
    );

  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

/* SUBTLE LIQUID MOTION */

.settings-card:not(.hidden),
.profile-connections-panel:not(.hidden) {
  animation:
    liquidGlassPanelIn
    360ms
    var(--glass-ease)
    both;
}

@keyframes liquidGlassBackdropIn {
  from {
    opacity: 0;
    -webkit-backdrop-filter: blur(0) brightness(1);
    backdrop-filter: blur(0) brightness(1);
  }

  to {
    opacity: 1;
    -webkit-backdrop-filter: blur(18px) brightness(0.86);
    backdrop-filter: blur(18px) brightness(0.86);
  }
}

@keyframes liquidGlassPanelIn {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.965);
  }

  72% {
    opacity: 1;
    transform: translateY(-2px) scale(1.006);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* BROWSER FALLBACK WHEN BACKDROP-FILTER IS NOT AVAILABLE */

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card,
  .yap,
  .delete-modal,
  .search-modal,
  .profile-modal {
    background: var(--card);
  }

  button,
  input,
  textarea,
  .settings-section,
  .profile-stats,
  .profile-connections-panel,
  .profile-picture-editor,
  .search-result,
  .connection-item,
  .yap-text,
  .reply {
    background: var(--button);
  }
}

@media (max-width: 540px) {
  .card.account-bar {
    border-radius: 34px !important;
  }

  .card,
  .yap,
  .delete-modal,
  .search-modal,
  .profile-modal {
    -webkit-backdrop-filter:
      blur(22px)
      contrast(1.03);

    backdrop-filter:
      blur(22px)
      contrast(1.03);
  }
}

@media (prefers-reduced-motion: reduce) {
  .modal-overlay:not(.hidden),
  .modal-overlay:not(.hidden) .modal-surface,
  .settings-card:not(.hidden),
  .profile-connections-panel:not(.hidden) {
    animation: none !important;
  }
}

/* =========================================================
   REVERSE / CLOSE / CANCEL ANIMATIONS
   Added for the current Yapper JavaScript state classes.
   ========================================================= */

:root {
  --reverse-fast: 200ms;
  --reverse-normal: 240ms;
  --reverse-slow: 300ms;
  --reverse-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --reverse-ease-in: cubic-bezier(0.55, 0, 1, 0.45);
}

/* Stop the older one-way liquid opening keyframes from overriding
   the bidirectional transition classes below. */

.modal-overlay:not(.hidden),
.modal-overlay:not(.hidden) .modal-surface,
.settings-card:not(.hidden),
.profile-connections-panel:not(.hidden) {
  animation: none !important;
}

/* MODALS: Search, Profile, Delete */

.modal-overlay {
  opacity: 0;
  pointer-events: none;

  -webkit-backdrop-filter:
    blur(0)
    brightness(1);

  backdrop-filter:
    blur(0)
    brightness(1);

  transition:
    opacity var(--reverse-normal) ease,
    backdrop-filter var(--reverse-slow) var(--reverse-ease),
    -webkit-backdrop-filter var(--reverse-slow) var(--reverse-ease);
}

.modal-overlay .modal-surface {
  opacity: 0;

  transform:
    translateY(18px)
    scale(0.965);

  transition:
    opacity var(--reverse-fast) ease,
    transform var(--reverse-slow) var(--reverse-ease),
    box-shadow var(--reverse-normal) var(--reverse-ease);
}

.modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;

  -webkit-backdrop-filter:
    blur(18px)
    brightness(0.86);

  backdrop-filter:
    blur(18px)
    brightness(0.86);
}

.modal-overlay.is-open .modal-surface {
  opacity: 1;

  transform:
    translateY(0)
    scale(1);
}

.modal-overlay.is-closing {
  opacity: 0;
  pointer-events: none;

  -webkit-backdrop-filter:
    blur(0)
    brightness(1);

  backdrop-filter:
    blur(0)
    brightness(1);
}

.modal-overlay.is-closing .modal-surface {
  opacity: 0;

  transform:
    translateY(12px)
    scale(0.975);

  transition-timing-function:
    ease,
    var(--reverse-ease-in),
    ease;
}

/* SETTINGS OPEN + CLOSE */

.settings-card {
  transform-origin: top center;
}

.settings-card.is-opening {
  animation:
    liquidSectionOpen
    360ms
    var(--reverse-ease)
    both !important;
}

.settings-card.is-closing {
  pointer-events: none;

  animation:
    liquidSectionClose
    220ms
    var(--reverse-ease-in)
    both !important;
}

/* FOLLOWERS / FOLLOWING / FRIENDS PANEL OPEN + HIDE */

.profile-connections-panel {
  transform-origin: top center;
}

.profile-connections-panel.is-opening {
  animation:
    liquidSectionOpen
    350ms
    var(--reverse-ease)
    both !important;
}

.profile-connections-panel.is-closing {
  pointer-events: none;

  animation:
    liquidSectionClose
    200ms
    var(--reverse-ease-in)
    both !important;
}

/* LOGIN <-> SIGNUP REVERSE TRANSITION */

#loginForm,
#signupForm {
  transform-origin: center top;
}

.auth-panel-entering {
  animation:
    authPanelEnter
    310ms
    var(--reverse-ease)
    both;
}

.auth-panel-leaving {
  pointer-events: none;

  animation:
    authPanelLeave
    240ms
    var(--reverse-ease-in)
    both;
}

/* PROFILE VIEW <-> EDIT PROFILE, INCLUDING CANCEL */

#profileViewSection,
#profileEditSection {
  transform-origin: center top;
}

.profile-section-entering {
  animation:
    profileSectionEnter
    330ms
    var(--reverse-ease)
    both;
}

.profile-section-leaving {
  pointer-events: none;

  animation:
    profileSectionLeave
    260ms
    var(--reverse-ease-in)
    both;
}

/* REPLIES LIST OPEN + HIDE REPLIES */

.replies-area {
  overflow: hidden;
  transform-origin: top center;
}

.replies-area.is-opening {
  animation:
    repliesAreaOpen
    240ms
    var(--reverse-ease)
    both;
}

.replies-area.is-closing {
  pointer-events: none;

  animation:
    repliesAreaClose
    240ms
    var(--reverse-ease-in)
    both;
}

.replies-collapsed-control {
  transform-origin: top left;
  animation:
    repliesControlReturn
    220ms
    var(--reverse-ease)
    both;
}

/* REPLY COMPOSER CANCEL: stronger reverse liquid collapse */

.reply-composer.is-opening {
  animation:
    replyComposerLiquidOpen
    300ms
    var(--reverse-ease)
    both !important;
}

.reply-composer.is-closing {
  pointer-events: none;

  animation:
    replyComposerLiquidClose
    260ms
    var(--reverse-ease-in)
    both !important;
}

/* BUTTON LABELS / SELECTED STATES ALSO RETURN SMOOTHLY */

.reply-toggle-button,
.like-button,
.theme-button,
.profile-follow-button,
.profile-stat-button {
  transition:
    background-color 240ms var(--reverse-ease),
    color 220ms ease,
    border-color 220ms ease,
    box-shadow 240ms var(--reverse-ease),
    transform 180ms var(--reverse-ease);
}

.like-button .heart-icon {
  transition:
    fill 220ms var(--reverse-ease),
    stroke 220ms var(--reverse-ease),
    transform 240ms var(--reverse-ease);
}

.like-button:not(.liked) .heart-icon {
  transform: scale(1);
}

/* KEYFRAMES */

@keyframes liquidSectionOpen {
  0% {
    opacity: 0;
    transform:
      translateY(-12px)
      scaleY(0.9)
      scaleX(0.985);
  }

  72% {
    opacity: 1;
    transform:
      translateY(1px)
      scaleY(1.012)
      scaleX(1.002);
  }

  100% {
    opacity: 1;
    transform:
      translateY(0)
      scale(1);
  }
}

@keyframes liquidSectionClose {
  0% {
    opacity: 1;
    transform:
      translateY(0)
      scale(1);
  }

  100% {
    opacity: 0;
    transform:
      translateY(-10px)
      scaleY(0.91)
      scaleX(0.985);
  }
}

@keyframes authPanelEnter {
  0% {
    opacity: 0;
    transform:
      translateX(18px)
      scale(0.98);
    filter: blur(4px);
  }

  100% {
    opacity: 1;
    transform:
      translateX(0)
      scale(1);
    filter: blur(0);
  }
}

@keyframes authPanelLeave {
  0% {
    opacity: 1;
    transform:
      translateX(0)
      scale(1);
    filter: blur(0);
  }

  100% {
    opacity: 0;
    transform:
      translateX(-16px)
      scale(0.98);
    filter: blur(4px);
  }
}

@keyframes profileSectionEnter {
  0% {
    opacity: 0;
    transform:
      translateY(14px)
      scale(0.975);
    filter: blur(4px);
  }

  72% {
    opacity: 1;
    transform:
      translateY(-1px)
      scale(1.004);
    filter: blur(0);
  }

  100% {
    opacity: 1;
    transform:
      translateY(0)
      scale(1);
    filter: blur(0);
  }
}

@keyframes profileSectionLeave {
  0% {
    opacity: 1;
    transform:
      translateY(0)
      scale(1);
    filter: blur(0);
  }

  100% {
    opacity: 0;
    transform:
      translateY(10px)
      scale(0.975);
    filter: blur(4px);
  }
}

@keyframes repliesAreaOpen {
  0% {
    opacity: 0;
    max-height: 0;
    transform:
      translateY(-8px)
      scaleY(0.88);
  }

  100% {
    opacity: 1;
    max-height: 1200px;
    transform:
      translateY(0)
      scaleY(1);
  }
}

@keyframes repliesAreaClose {
  0% {
    opacity: 1;
    max-height: 1200px;
    transform:
      translateY(0)
      scaleY(1);
  }

  100% {
    opacity: 0;
    max-height: 0;
    transform:
      translateY(-8px)
      scaleY(0.9);
  }
}

@keyframes repliesControlReturn {
  0% {
    opacity: 0;
    transform:
      translateY(-5px)
      scale(0.96);
  }

  100% {
    opacity: 1;
    transform:
      translateY(0)
      scale(1);
  }
}

@keyframes replyComposerLiquidOpen {
  0% {
    opacity: 0;
    max-height: 0;
    transform:
      translateY(-10px)
      scaleY(0.78)
      scaleX(0.985);
  }

  72% {
    opacity: 1;
    max-height: 90px;
    transform:
      translateY(1px)
      scaleY(1.015)
      scaleX(1.002);
  }

  100% {
    opacity: 1;
    max-height: 90px;
    transform:
      translateY(0)
      scale(1);
  }
}

@keyframes replyComposerLiquidClose {
  0% {
    opacity: 1;
    max-height: 90px;
    transform:
      translateY(0)
      scale(1);
  }

  100% {
    opacity: 0;
    max-height: 0;
    margin-top: 0;
    transform:
      translateY(-9px)
      scaleY(0.78)
      scaleX(0.985);
  }
}

@media (prefers-reduced-motion: reduce) {
  .modal-overlay,
  .modal-overlay .modal-surface,
  .settings-card.is-opening,
  .settings-card.is-closing,
  .profile-connections-panel.is-opening,
  .profile-connections-panel.is-closing,
  .auth-panel-entering,
  .auth-panel-leaving,
  .profile-section-entering,
  .profile-section-leaving,
  .replies-area.is-opening,
  .replies-area.is-closing,
  .reply-composer.is-opening,
  .reply-composer.is-closing {
    animation: none !important;
    transition-duration: 1ms !important;
  }
}

/* =========================================================
   FIX — SHORT HASHTAG YAPS MUST STAY COMPACT
   Hashtags are buttons, so this removes the global button
   height/min-height that made one-line yaps look multiline.
   ========================================================= */

.yap-text .inline-hashtag {
  display: inline;

  width: auto;
  min-width: 0;

  height: auto;
  min-height: 0;

  margin: 0;
  padding: 0;

  position: static;
  overflow: visible;

  background: transparent;
  color: inherit;

  border: 0;
  border-radius: 0;

  box-shadow: none;

  font: inherit;
  font-weight: 800;
  line-height: inherit;

  white-space: normal;
  vertical-align: baseline;

  -webkit-backdrop-filter: none;
  backdrop-filter: none;

  transform: none;
}

.yap-text .inline-hashtag:hover {
  background: transparent;
  color: inherit;

  box-shadow: none;
  transform: none;

  text-decoration: underline;
}

.yap-text .inline-hashtag:active {
  transform: none;
}


/* =========================================================
   CONSISTENT UI ROUNDNESS SYSTEM
   Keeps top-level surfaces equally rounded, inner panels on
   the same smaller radius, and controls/badges fully pill-shaped.
   ========================================================= */

:root {
  --ui-radius-surface: 30px;
  --ui-radius-panel: 24px;
  --ui-radius-inner: 24px;
  --ui-radius-item: 20px;
  --ui-radius-field: 22px;
  --ui-radius-pill: 9999px;
}

/* Main app surfaces: cards, yaps, settings, and every modal. */
.card:not(.account-bar),
.yap,
.modal-surface,
.delete-modal,
.search-modal,
.profile-modal {
  border-radius: var(--ui-radius-surface) !important;
  background-clip: padding-box;
}

/* The logged-in account bar remains a true capsule. */
.card.account-bar {
  border-radius: var(--ui-radius-pill) !important;
}

/* Matching rounded inner sections. */
.settings-section,
.profile-stats,
.profile-connections-panel,
.profile-picture-editor {
  border-radius: var(--ui-radius-panel) !important;
  background-clip: padding-box;
}

/* Matching rows and selectable tiles. */
.search-result,
.connection-item {
  border-radius: var(--ui-radius-item) !important;
}

/* Stats fit the curved profile-stats container cleanly. */
.profile-stat {
  border-radius: 18px !important;
}

/* Text areas and multiline bubbles share one radius. */
textarea,
.yap-text.multiline,
.reply.multiline {
  border-radius: var(--ui-radius-field) !important;
}

/* Single-line bubbles, fields, buttons, badges, and controls stay pills. */
input,
button,
.file-picker-label,
.relationship-badge,
.yap-text:not(.multiline),
.reply:not(.multiline),
.profile-connections-list::-webkit-scrollbar-track,
.profile-connections-list::-webkit-scrollbar-thumb {
  border-radius: var(--ui-radius-pill);
}

/* Circular controls and avatars must remain perfectly round. */
.profile-avatar,
.avatar-profile-button,
.modal-close-button {
  border-radius: 50% !important;
}

/* Text-like buttons must not gain a pill background or forced radius. */
.profile-link,
.reply-text-action,
.reply-control,
.text-button,
.inline-hashtag,
.yap-text .inline-hashtag {
  border-radius: 0 !important;
}

@media (max-width: 540px) {
  :root {
    --ui-radius-surface: 28px;
    --ui-radius-panel: 22px;
    --ui-radius-inner: 22px;
    --ui-radius-item: 19px;
    --ui-radius-field: 20px;
  }

  /* Once the account bar stacks vertically, a large rounded card is
     visually cleaner than forcing a distorted capsule around it. */
  .card.account-bar {
    border-radius: var(--ui-radius-surface) !important;
  }
}

/* =========================================================
   MOBILE YAP ACTIONS — ONE CLEAN ROW
   Like / Reply / Delete stay on the same line.
   Posts without Delete automatically use two equal columns.
   ========================================================= */

@media (max-width: 540px) {
  .post-actions {
    display: grid !important;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);

    width: 100%;
    gap: 8px;

    flex-wrap: nowrap;
  }

  .post-actions button {
    width: 100% !important;
    min-width: 0 !important;

    height: 46px;
    min-height: 46px;
    padding: 0 7px;

    font-size: clamp(11px, 3.4vw, 14px);
  }

  .post-actions .heart-icon {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
  }

  .post-actions .like-button span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* ONLINE BACKEND STATUS */
.backend-notice {
  margin-top: 16px;
  padding: 15px 18px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 12px 34px var(--shadow-soft, rgba(0,0,0,.12));
  line-height: 1.5;
}

.backend-notice code {
  padding: 2px 7px;
  background: var(--bubble);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.account-identity {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.online-badge {
  padding: 5px 9px;
  border: 1px solid var(--glass-border, var(--border));
  border-radius: 999px;
  background: var(--glass-control, var(--button));
  color: var(--secondary-text);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.online-badge.offline {
  opacity: .58;
}

.load-more-row {
  display: flex;
  justify-content: center;
  margin: 18px 0 4px;
}

.load-more-row button {
  min-width: 180px;
}

.feed-loading {
  margin: 14px 4px;
  color: var(--secondary-text);
  font-size: 13px;
}

#profileEditSection.is-closing {
  pointer-events: none;
  animation: sectionClose 220ms var(--ease-out, ease) both;
}

/* Guarantee compact clickable hashtags in short yaps. */
.yap-text .inline-hashtag {
  display: inline;
  width: auto;
  min-width: 0;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  position: static;
  overflow: visible;
  background: transparent;
  color: inherit;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font: inherit;
  font-weight: 800;
  line-height: inherit;
  white-space: normal;
  vertical-align: baseline;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  transform: none;
}

.yap-text .inline-hashtag:hover {
  background: transparent;
  color: inherit;
  box-shadow: none;
  transform: none;
  text-decoration: underline;
}

@media (max-width: 540px) {
  .account-identity {
    width: 100%;
    justify-content: space-between;
  }

  .post-actions {
    display: grid !important;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    width: 100%;
    gap: 8px;
    flex-wrap: nowrap;
  }

  .post-actions button {
    width: 100% !important;
    min-width: 0 !important;
    height: 46px;
    padding: 0 7px;
    font-size: clamp(11px, 3.4vw, 14px);
  }
}

/* =========================================================
   RESPONSIVE DESKTOP SCALE + CONSISTENT CONTROL PLACEMENT
   Keeps mobile compact, but stops the whole app from looking
   tiny in the middle of a large desktop screen.
   ========================================================= */

/* Yap actions always use one balanced row: 2 buttons become two
   equal columns, and 3 buttons become three equal columns. */
.post-actions {
  display: grid !important;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  width: 100%;
  gap: 10px;
  flex-wrap: nowrap;
}

.post-actions button {
  width: 100% !important;
  min-width: 0 !important;
}

@media (min-width: 900px) {
  body {
    width: min(clamp(760px, 52vw, 900px), calc(100% - 64px));
    padding-top: clamp(34px, 4vh, 54px);
    padding-bottom: 84px;
  }

  .site-header {
    margin-bottom: 22px;
  }

  .site-header h1 {
    font-size: clamp(44px, 3vw, 52px);
    letter-spacing: -1.8px;
  }

  .site-header p {
    margin-top: 7px;
    font-size: 16px;
  }

  .card:not(.account-bar),
  .yap {
    padding: 26px;
  }

  .auth-card h2,
  .settings-card h2,
  .composer-card h2 {
    font-size: 28px;
  }

  .card.account-bar {
    display: grid;
    grid-template-columns: minmax(190px, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 16px 18px 16px 24px;
  }

  .account-identity {
    min-width: 0;
  }

  .card.account-bar .account-buttons {
    display: grid;
    grid-template-columns: repeat(4, minmax(108px, 1fr));
    gap: 10px;
    width: auto;
    margin: 0;
  }

  .account-buttons button {
    width: 100%;
    min-width: 0;
  }

  input {
    height: 50px;
    padding-inline: 18px;
  }

  textarea {
    min-height: 138px;
    padding: 17px 18px;
  }

  .auth-buttons button,
  .account-buttons button,
  .theme-buttons button,
  .password-button,
  .close-settings-button,
  #postButton,
  .post-actions button,
  .modal-buttons button,
  .profile-main-actions button,
  .profile-edit-actions button,
  .search-input-row button,
  #removeProfilePictureButton,
  .file-picker-label {
    height: 46px;
    min-height: 46px;
  }

  .auth-buttons {
    gap: 11px;
    margin-top: 15px;
  }

  .auth-buttons button {
    width: 190px;
  }

  .settings-section {
    padding: 21px;
  }

  .theme-buttons button {
    width: 180px;
  }

  .password-button {
    width: 220px;
    min-width: 220px;
  }

  .close-settings-button {
    width: 190px;
  }

  #postButton {
    width: 170px;
    min-width: 170px;
  }

  .composer-bottom {
    margin-top: 11px;
  }

  .feed-heading {
    margin-top: 34px;
    font-size: 30px;
  }

  .post-actions {
    gap: 12px;
    margin-top: 17px;
  }

  .delete-modal {
    width: min(520px, calc(100vw - 64px));
    padding: 30px;
  }

  .search-modal {
    width: min(720px, calc(100vw - 64px));
    padding: 30px;
  }

  .profile-modal {
    width: min(780px, calc(100vw - 64px));
    padding: 30px;
  }

  .modal-close-button {
    top: 16px;
    right: 16px;
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
  }
}

@media (min-width: 1500px) {
  body {
    width: min(940px, calc(100% - 96px));
  }
}

@media (max-width: 540px) {
  .post-actions {
    gap: 8px;
  }
}


/* Account-specific theme save status */
.theme-status {
  min-height: 1.35em;
  margin: 10px 0 0;
}

.theme-buttons button:disabled {
  cursor: wait;
  opacity: 0.72;
}


/* =========================================================
   PASSWORD VISIBILITY + USERNAME LOGIN UI
   ========================================================= */

.auth-helper {
  margin: 2px 4px 7px;
  color: var(--secondary-text);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
}

.password-input-wrap {
  position: relative;
  width: 100%;
  margin: 6px 0;
}

.password-input-wrap > input {
  display: block;
  width: 100%;
  margin: 0;
  padding-right: 82px;
}

.password-toggle-button {
  position: absolute;
  z-index: 3;
  top: 50%;
  right: 6px;
  width: auto;
  min-width: 64px;
  height: 32px;
  min-height: 32px;
  padding: 0 12px;
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  transform: translateY(-50%);
}

.password-toggle-button:hover {
  transform: translateY(calc(-50% - 1px)) scale(1.01);
}

.password-toggle-button:active {
  transform: translateY(-50%) scale(0.95);
}

.password-toggle-button[aria-pressed="true"] {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.18) 0%, transparent 48%),
    var(--primary);
  color: var(--primary-text);
  border-color: var(--glass-highlight, var(--border));
}

@media (min-width: 900px) {
  .password-input-wrap > input {
    height: 50px;
    padding-right: 92px;
  }

  .password-toggle-button {
    right: 7px;
    min-width: 70px;
    height: 36px;
    min-height: 36px;
    font-size: 13px;
  }
}

@media (max-width: 540px) {
  .password-input-wrap > input {
    padding-right: 76px;
  }

  .password-toggle-button {
    right: 5px;
    min-width: 60px;
    height: 32px;
    min-height: 32px;
    padding-inline: 10px;
  }
}


/* =========================================================
   PROFILE LOCK + FIVE-STATS LAYOUT + COMPACT YAP DELETE
   ========================================================= */

/* Replies are no longer shown as a profile statistic. */
.profile-stats {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}

/* The owner-only delete control sits on the far right beside
   Replies / Hide replies instead of taking a giant action slot. */
.replies-controls {
  width: 100%;
  min-width: 0;
}

.delete-yap-inline {
  margin-left: auto !important;
  padding: 2px 0 !important;
  color: var(--secondary-text) !important;
  font-size: 12px !important;
  font-weight: 750 !important;
  white-space: nowrap;
}

.delete-yap-inline:hover {
  color: var(--text) !important;
}

@media (max-width: 540px) {
  .profile-stats {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 3px;
    padding-inline: 4px;
  }

  .profile-stat {
    min-height: 52px;
    padding-inline: 1px;
  }

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

  .profile-stat span {
    font-size: 8px;
    letter-spacing: -0.12px;
  }

  .delete-yap-inline {
    font-size: 11px !important;
  }
}


/* SIGNUP USERNAME: REAL USER-CHOSEN HANDLE, NEVER A BROWSER AUTOFILL FIELD */
.signup-username-editor {
  width: 100%;
  height: 44px;
  margin: 6px 0;
  padding: 10px 16px;

  display: block;
  overflow: hidden;
  white-space: nowrap;

  background:
    linear-gradient(
      145deg,
      var(--glass-highlight-soft) 0%,
      transparent 42%
    ),
    var(--glass-control);
  color: var(--text);
  caret-color: var(--text);

  border: 1px solid var(--glass-border);
  border-radius: var(--ui-radius-pill);
  outline: none;

  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    inset 0 2px 8px rgba(0, 0, 0, 0.055),
    0 5px 16px rgba(0, 0, 0, 0.045);

  -webkit-backdrop-filter:
    blur(var(--glass-control-blur))
    contrast(1.02);
  backdrop-filter:
    blur(var(--glass-control-blur))
    contrast(1.02);

  font: inherit;
  line-height: 22px;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.signup-username-editor:empty::before,
.signup-username-editor[data-empty="true"]::before {
  content: attr(data-placeholder);
  color: var(--muted-text);
  opacity: 1;
  pointer-events: none;
}

.signup-username-editor:hover {
  border-color: var(--glass-highlight);
}

.signup-username-editor:focus,
.signup-username-editor:focus-visible {
  border-color: var(--text);
  outline: 1px solid rgba(255, 255, 255, 0.78);
  outline-offset: 4px;

  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    inset 0 2px 8px rgba(0, 0, 0, 0.055),
    0 9px 24px var(--glass-shadow);

  transform: translateY(-1px);
}

.signup-username-editor::selection {
  background: var(--text);
  color: var(--background);
}


/* =========================================================
   YAPPER AUTHENTICATION — VERIFIED ACCOUNT FLOW
   ========================================================= */

.settings-description,
.authentication-copy {
  margin: 2px 0 12px;
  color: var(--secondary-text);
  font-size: 13px;
  line-height: 1.45;
}

.authentication-entry-button,
.authentication-action-button {
  width: 100%;
}

.verification-panel {
  text-align: center;
  animation: sectionIn 0.24s ease both;
}

.verification-mark,
.authentication-shield {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  background: var(--glass-control);
  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    0 10px 28px var(--glass-shadow);
  font-size: 24px;
  font-weight: 900;
}

.verification-panel h2 {
  margin: 0 0 9px;
}

.verification-panel > p {
  margin: 7px 0;
  line-height: 1.45;
}

.verification-actions {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.authentication-overlay {
  align-items: center;
}

.authentication-modal {
  width: min(620px, calc(100vw - 24px));
  max-height: min(88vh, 820px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 28px;
}

.authentication-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 44px;
  margin-bottom: 18px;
}

.authentication-heading .authentication-shield {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  margin: 0;
  font-size: 20px;
}

.authentication-heading h2,
.authentication-heading p {
  margin: 0;
}

.authentication-heading p {
  margin-top: 4px;
  color: var(--secondary-text);
  font-size: 13px;
}

.authentication-account-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 16px 18px;
  border: 1px solid var(--glass-border);
  border-radius: var(--ui-radius-inner, var(--ui-radius-panel, 24px)) !important;
  background: var(--glass-control);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
}

.authentication-account-card > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.authentication-label {
  color: var(--muted-text);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.authentication-account-card strong {
  font-size: 18px;
  overflow-wrap: anywhere;
}


.verification-badge {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--glass-border);
  border-radius: 9999px;
  background: var(--primary);
  color: var(--primary-text);
  font-size: 12px;
  font-weight: 850;
}

.verification-badge.is-unverified {
  background: var(--button);
  color: var(--text);
}

.authentication-section {
  margin-top: 12px;
  padding: 18px;
  border: 1px solid var(--glass-border);
  border-radius: var(--ui-radius-inner, var(--ui-radius-panel, 24px)) !important;
  background: var(--glass-panel);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
}

.authentication-section h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.authentication-section > input,
.authentication-section .password-input-wrap {
  margin-block: 7px;
}

.authentication-sessions-section > button {
  width: 100%;
}

@media (max-width: 540px) {
  .authentication-modal {
    width: calc(100vw - 12px);
    max-height: calc(100dvh - 18px);
    padding: 20px 14px 18px;
    border-radius: 26px;
  }

  .authentication-heading {
    gap: 10px;
    padding-right: 36px;
  }

  .authentication-heading .authentication-shield {
    width: 42px;
    height: 42px;
  }

  .authentication-heading h2 {
    font-size: 24px;
    letter-spacing: -0.7px;
  }

  .authentication-account-card {
    align-items: flex-start;
    padding: 14px;
  }

  .verification-badge {
    min-height: 30px;
    padding-inline: 10px;
    font-size: 10px;
  }

  .authentication-section {
    padding: 14px;
  }
}



/* AUTHENTICATION ROUNDNESS + CONTENTEDITABLE PLACEHOLDER HARDENING */
.authentication-modal {
  border-radius: var(--ui-radius-surface, 30px) !important;
  overflow-x: hidden;
}

.authentication-account-card,
.authentication-section {
  border-radius: var(--ui-radius-inner, var(--ui-radius-panel, 24px)) !important;
  overflow: hidden;
  background-clip: padding-box;
}

@media (max-width: 540px) {
  .authentication-account-card,
  .authentication-section {
    border-radius: var(--ui-radius-inner, var(--ui-radius-panel, 22px)) !important;
  }
}


/* =========================================================
   AUTHENTICATION MODAL OUTER SURFACE
   Gives Yapper Authentication the same visible rounded card
   container as Settings, Search, Profile, and other menus.
   ========================================================= */
.authentication-modal {
  position: relative;
  background:
    linear-gradient(
      145deg,
      var(--glass-highlight-soft) 0%,
      transparent 32%,
      transparent 70%,
      rgba(0, 0, 0, 0.025) 100%
    ),
    var(--glass-card);
  border: 1px solid var(--glass-border);
  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    inset 0 -1px 0 var(--glass-border-soft),
    0 24px 70px var(--glass-shadow-deep),
    0 3px 10px rgba(0, 0, 0, 0.055);
  -webkit-backdrop-filter:
    blur(var(--glass-blur))
    contrast(1.03)
    brightness(1.03);
  backdrop-filter:
    blur(var(--glass-blur))
    contrast(1.03)
    brightness(1.03);
}

body[data-theme="dark"] .authentication-modal {
  -webkit-backdrop-filter:
    blur(var(--glass-blur))
    contrast(1.06)
    brightness(0.92);
  backdrop-filter:
    blur(var(--glass-blur))
    contrast(1.06)
    brightness(0.92);
}

/* YAPPER AUTHENTICATION — single-column account card. */
.authentication-account-card {
  justify-content: flex-start;
}


/* =========================================================
   STABLE ACTION BUTTONS — NO FLASHING OR REPLAYED ANIMATIONS
   Feed refreshes rebuild these controls. Keeping background/color
   transitions or permanent animation classes made them flash and
   replay under the pointer. These controls now change state cleanly.
   ========================================================= */

#postButton,
.post-actions button,
.reply-composer button,
.replies-controls button {
  animation: none !important;
  transform: none !important;
  transition: opacity 100ms linear !important;
}

#postButton:hover,
#postButton:active,
.post-actions button:hover,
.post-actions button:active,
.reply-composer button:hover,
.reply-composer button:active,
.replies-controls button:hover,
.replies-controls button:active {
  transform: none !important;
}

#postButton.posted-state,
#postButton.returning-state,
.send-reply-button.sent-state,
.send-reply-button.returning-state,
.reply-toggle-button.is-morphing {
  animation: none !important;
  transform: none !important;
}

/* Cancel and Sent are label changes, not dramatic color flashes. */
.reply-toggle-button.cancel-state,
.send-reply-button.sent-state {
  background:
    linear-gradient(
      145deg,
      var(--glass-highlight-soft) 0%,
      transparent 48%
    ),
    var(--glass-control) !important;
  color: var(--text) !important;
  border-color: var(--glass-border) !important;
  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    inset 0 -1px 0 var(--glass-border-soft),
    0 7px 18px rgba(0, 0, 0, 0.08) !important;
  filter: none !important;
}

.reply-toggle-button.cancel-state:hover,
.send-reply-button.sent-state:hover {
  background:
    linear-gradient(
      145deg,
      var(--glass-highlight) 0%,
      transparent 50%
    ),
    var(--glass-control-hover) !important;
  color: var(--text) !important;
  border-color: var(--glass-highlight) !important;
}

/* Busy/success text stays readable without dimming or color blinking. */
#postButton.is-busy,
#postButton:disabled,
.send-reply-button.is-busy,
.send-reply-button:disabled,
.reply-toggle-button:disabled {
  opacity: 0.88 !important;
}

#postButton.posted-state:disabled,
.send-reply-button.sent-state:disabled {
  opacity: 1 !important;
}

/* The composer animation runs only when JS explicitly marks the one
   opening/closing transition; normal feed renders remain motionless. */
.reply-composer:not(.is-opening):not(.is-closing) {
  animation: none !important;
  opacity: 1;
  transform: none;
}

/* =========================================================
   TEXT FIELD FOCUS — THICKER BORDER, NO DETACHED OUTLINE
   The field itself becomes thicker when focused. No second ring.
   ========================================================= */
button:focus-visible,
label:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

input:focus,
input:focus-visible,
textarea:focus,
textarea:focus-visible,
.signup-username-editor:focus,
.signup-username-editor:focus-visible {
  outline: none !important;
  border-width: 2px !important;
  border-color: var(--text) !important;
  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    inset 0 2px 8px rgba(0, 0, 0, 0.055),
    0 9px 24px var(--glass-shadow) !important;
  transform: none !important;
}



/* =========================================================
   VERIFIED BADGES
   @xevyyx is always verified. Other accounts become verified
   after reaching 10,000 followers.
   ========================================================= */
.verified-username-line,
.post-author-username,
.reply-author-username,
.search-result-username,
.connection-item-username {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin-left: 1px;
  border-radius: 50%;
  background: #1d9bf0;
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 1px 3px rgba(0, 0, 0, 0.22);
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
  text-decoration: none;
  vertical-align: middle;
}

.verified-badge.hidden {
  display: none !important;
}

.profile-handle.verified-username-line {
  justify-content: center;
}

.authentication-account-card .verified-username-line {
  justify-content: flex-start;
}
