:root {
  color-scheme: dark;
  --bg-page: oklch(9% 0.028 235);
  --bg-shell: oklch(12% 0.032 235);
  --bg-panel: oklch(16% 0.035 235);
  --bg-raised: oklch(20% 0.038 235);
  --bg-input: oklch(11% 0.028 235);
  --text: oklch(94% 0.018 285);
  --text-strong: oklch(99% 0.012 285);
  --text-muted: oklch(73% 0.05 305);
  --text-subtle: oklch(61% 0.045 305);
  --line: oklch(30% 0.06 230);
  --line-strong: oklch(44% 0.1 220);
  --primary: oklch(83% 0.2 205);
  --primary-bright: oklch(88% 0.22 205);
  --primary-wash: oklch(24% 0.09 220);
  --primary-ink: oklch(10% 0.04 235);
  --secondary: oklch(80% 0.21 345);
  --secondary-bright: oklch(85% 0.23 345);
  --secondary-wash: oklch(24% 0.08 345);
  --secondary-line: oklch(56% 0.18 345);
  --success: oklch(82% 0.2 145);
  --warning: oklch(82% 0.16 80);
  --danger: oklch(69% 0.21 28);
  --danger-ink: oklch(12% 0.03 28);
  --focus: 0 0 0 3px oklch(83% 0.2 205 / 0.32);
  --glow: 0 0 22px oklch(83% 0.2 205 / 0.28);
  --glow-pink: 0 0 22px oklch(80% 0.21 345 / 0.3);
  --radius: 8px;
  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--font);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg-page);
}

.brand,
.topnav a,
.tab,
button,
.button,
.pill,
.locked,
.state-on,
.text-link,
.empty-state,
.muted-label,
.compose-heading,
.section-divider,
.side-card-quiet h2,
.profile-handle,
.page-header h1,
.page-header h2,
h1,
h2,
h3,
label,
select,
option,
.check-row,
input::placeholder,
textarea::placeholder {
  text-transform: lowercase;
}

.status-meta a:first-child,
.status-body,
.profile-bio,
.profile-identity h1,
.reply-target,
.notification .status-meta a,
.account-row a,
.account-row .status-body,
.notification-display-name {
  text-transform: none;
}

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
}

body,
button,
input,
textarea,
select {
  font-family: var(--font);
}

a {
  color: var(--primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--primary-bright);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 0;
  box-shadow: var(--focus), var(--glow);
  border-color: var(--primary-bright);
}

::selection {
  background: color-mix(in oklch, var(--secondary) 60%, transparent);
  color: var(--text-strong);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in oklch, var(--bg-shell) 92%, black);
  border-bottom: 1px solid color-mix(in oklch, var(--primary) 32%, var(--line));
  box-shadow: 0 1px 0 0 color-mix(in oklch, var(--secondary) 22%, transparent);
}

.topnav {
  width: min(1200px, 100%);
  min-height: 56px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 16px;
}

.topnav a,
.topnav button {
  flex: 0 0 auto;
}

.brand {
  color: var(--primary-bright);
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
  margin-right: 8px;
  text-shadow: 0 0 18px color-mix(in oklch, var(--primary) 50%, transparent);
}

.brand:hover {
  color: var(--primary-bright);
  filter: brightness(1.1);
}

.topnav a:not(.brand) {
  color: var(--text-muted);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 7px 11px;
  text-decoration: none;
}

.topnav a:not(.brand):hover,
.topnav a:not(.brand):focus {
  color: var(--primary-bright);
  background: color-mix(in oklch, var(--primary-wash) 55%, transparent);
}

.topnav a.is-active {
  color: var(--primary-bright);
  background: color-mix(in oklch, var(--primary-wash) 70%, transparent);
  box-shadow: inset 0 -2px 0 var(--primary);
}

.topnav a.is-active:hover,
.topnav a.is-active:focus {
  color: var(--primary-bright);
  background: color-mix(in oklch, var(--primary-wash) 90%, transparent);
}

.nav-form {
  margin-left: auto;
}

.nav-form button.secondary {
  color: var(--text-muted);
  background: transparent;
  border-color: transparent;
  font-weight: 600;
}

.nav-form button.secondary:hover,
.nav-form button.secondary:focus-visible {
  color: var(--text);
  background: var(--bg-panel);
  border-color: var(--line);
}

.app-shell {
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 18px 16px 56px;
}

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

.page-grid > .panel {
  margin-bottom: 0;
}

.main-column {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 10px;
}

.main-column > .panel {
  margin-bottom: 0;
}

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

.side-panel,
.compose-panel,
.profile-panel {
  align-self: start;
}

.panel,
.status-card,
.notification,
.account-row,
.compat-row {
  background: var(--bg-panel);
  border: 1px solid color-mix(in oklch, var(--primary) 14%, var(--line));
  border-radius: var(--radius);
}

.compose-panel {
  border-color: color-mix(in oklch, var(--primary) 32%, var(--line));
  background: linear-gradient(
    180deg,
    color-mix(in oklch, var(--primary-wash) 28%, var(--bg-panel)),
    var(--bg-panel) 70%
  );
}

.compose-panel:focus-within {
  border-color: color-mix(in oklch, var(--primary) 55%, var(--line));
  box-shadow: 0 0 36px color-mix(in oklch, var(--primary) 18%, transparent);
}

.status-card:hover {
  border-color: color-mix(in oklch, var(--primary) 28%, var(--line));
}

.side-card {
  border-color: color-mix(in oklch, var(--secondary) 18%, var(--line));
}

.panel {
  padding: 14px;
  margin: 0 0 14px;
}

.status-card {
  padding: 12px;
  margin: 0 0 10px;
}

.notification {
  padding: 12px;
  margin-bottom: 10px;
}

.account-row,
.compat-row {
  padding: 12px;
  margin-bottom: 10px;
}

.section-heading,
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.page-header {
  margin: 2px 0 14px;
  align-items: center;
}

.page-header h1 {
  margin: 0;
}

.section-divider {
  margin: 24px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid color-mix(in oklch, var(--primary) 22%, var(--line));
}

.profile-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 4px 0 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid color-mix(in oklch, var(--secondary) 22%, var(--line));
}


.profile-identity h1 {
  margin: 0;
  font-size: 1.6rem;
}

.profile-handle {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.94rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-bio {
  margin: 0 0 18px;
  color: var(--text);
  max-width: 65ch;
}

.check-hint {
  display: block;
  color: var(--text-subtle);
  font-size: 0.86rem;
  font-weight: 400;
  margin-top: 2px;
}

h1,
h2 {
  color: var(--text-strong);
  line-height: 1.2;
  letter-spacing: 0;
  text-wrap: balance;
}

h1 {
  font-size: 1.45rem;
  margin: 0 0 6px;
}

h2 {
  font-size: 1.05rem;
  margin: 0 0 10px;
}

.compose-heading {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  font-weight: 700;
  margin: 0 0 10px;
}

.muted-label {
  font-size: 0.86rem;
  color: var(--text-muted);
  font-weight: 600;
  margin: 12px 0 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.side-panel {
  display: grid;
  gap: 10px;
  align-content: start;
}

.side-card-quiet {
  padding: 12px 14px;
}

.side-card-quiet h2 {
  font-size: 0.98rem;
  margin: 0 0 4px;
}

.side-card-quiet p {
  margin: 0;
  font-size: 0.92rem;
}

p {
  max-width: 72ch;
}

.muted {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.text-link {
  font-size: 0.92rem;
}

.error {
  background: oklch(20% 0.08 28);
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  color: oklch(93% 0.04 28);
  padding: 9px 10px;
  margin-bottom: 12px;
}

.empty-state {
  color: var(--text-muted);
  padding: 14px 2px;
  font-size: 0.94rem;
  line-height: 1.5;
}

.empty-state .empty-state-hint {
  display: block;
  margin-top: 4px;
  color: var(--text-subtle);
  font-size: 0.88rem;
}

.empty-state.is-quiet {
  padding: 6px 2px;
  font-size: 0.9rem;
}

label {
  display: block;
  color: var(--text);
  font-weight: 700;
  margin: 12px 0 5px;
}

input[type="text"],
input[type="password"],
input[type="file"],
textarea,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 8px 10px;
  font: inherit;
  background: var(--bg-input);
  color: var(--text);
}

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

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

input[type="checkbox"] {
  accent-color: var(--primary);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-weight: 600;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 10px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 0;
}

.profile-media-grid,
.profile-field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 12px;
}

.profile-media-grid {
  margin-bottom: 12px;
}

.settings-avatar,
.settings-header-image {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-input);
  object-fit: cover;
  margin-bottom: 8px;
}

.settings-avatar {
  max-width: 112px;
  aspect-ratio: 1;
}

.settings-header-image {
  aspect-ratio: 3 / 1;
}

.profile-fields {
  margin-top: 14px;
}

.profile-fields h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.compose-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0 0;
  justify-content: space-between;
}

.compose-actions .compose-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1 1 auto;
}

.compose-actions .compose-controls > div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.compose-actions .compose-controls label {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-muted);
  font-weight: 600;
}

.compose-actions .compose-controls select {
  width: auto;
  min-height: 34px;
  padding: 4px 8px;
  font-size: 0.94rem;
}

.compose-submit {
  min-height: 40px;
  padding: 9px 22px;
  font-size: 1rem;
  letter-spacing: 0.02em;
  box-shadow: var(--glow), 0 1px 0 color-mix(in oklch, var(--primary) 40%, transparent) inset;
}

.compose-submit:hover {
  box-shadow:
    0 0 28px color-mix(in oklch, var(--primary) 60%, transparent),
    0 1px 0 color-mix(in oklch, var(--primary) 40%, transparent) inset;
}

.file-field {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.file-field input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.file-field .file-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
}

.file-field:hover .file-trigger,
.file-field:focus-within .file-trigger {
  color: var(--text-strong);
  border-color: var(--line-strong);
}

button,
.button {
  min-height: 36px;
  border: 1px solid color-mix(in oklch, var(--primary) 60%, black);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--primary-bright), var(--primary));
  color: var(--primary-ink);
  padding: 7px 11px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 0 0 0 transparent, 0 1px 0 color-mix(in oklch, var(--primary) 30%, transparent) inset;
}

button:hover,
.button:hover {
  filter: brightness(1.08);
  box-shadow: var(--glow), 0 1px 0 color-mix(in oklch, var(--primary) 30%, transparent) inset;
}

button.secondary,
.button.secondary {
  background: var(--bg-raised);
  color: var(--primary);
  border-color: color-mix(in oklch, var(--primary) 35%, var(--line));
  font-weight: 700;
  box-shadow: none;
}

button.secondary:hover,
.button.secondary:hover {
  color: var(--primary-bright);
  border-color: var(--primary);
  background: color-mix(in oklch, var(--primary-wash) 50%, var(--bg-raised));
  filter: none;
  box-shadow: 0 0 16px color-mix(in oklch, var(--primary) 28%, transparent);
}

button.tertiary,
.button.tertiary {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
  font-weight: 600;
  min-height: 32px;
  padding: 5px 9px;
}

button.tertiary:hover,
.button.tertiary:hover {
  color: var(--text);
  background: var(--bg-raised);
  border-color: var(--line);
  filter: none;
}

button.danger,
.button.danger {
  background: transparent;
  color: var(--danger);
  border-color: color-mix(in oklch, var(--danger) 40%, transparent);
  font-weight: 600;
}

button.danger:hover,
.button.danger:hover {
  background: var(--danger);
  color: var(--danger-ink);
  border-color: var(--danger);
  filter: none;
}

button.danger-solid,
.button.danger-solid {
  background: var(--danger);
  color: var(--danger-ink);
  border-color: color-mix(in oklch, var(--danger) 70%, white);
  font-weight: 800;
}

.active-action {
  background: color-mix(in oklch, var(--secondary-wash) 78%, var(--bg-raised)) !important;
  color: var(--secondary-bright) !important;
  border-color: var(--secondary-line) !important;
  box-shadow: 0 0 14px color-mix(in oklch, var(--secondary) 28%, transparent) !important;
}

button.tertiary.active-action,
.button.tertiary.active-action {
  background: color-mix(in oklch, var(--secondary-wash) 55%, transparent) !important;
  color: var(--secondary-bright) !important;
  border-color: color-mix(in oklch, var(--secondary) 40%, transparent) !important;
  box-shadow: 0 0 12px color-mix(in oklch, var(--secondary) 22%, transparent) !important;
}

.tabs {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  border-bottom: 1px solid var(--line);
}

.tab {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  color: var(--text-muted);
  padding: 7px 12px;
  text-decoration: none;
  position: relative;
}

.tab:hover {
  color: var(--primary-bright);
}

.tab.active {
  color: var(--primary-bright);
  background: color-mix(in oklch, var(--primary-wash) 55%, transparent);
  box-shadow: inset 0 -2px 0 var(--primary);
}

.status-meta,
.status-counts,
.status-actions,
.row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.status-meta {
  margin-bottom: 8px;
  color: var(--text-subtle);
  font-size: 0.92rem;
  gap: 0;
  column-gap: 8px;
  row-gap: 4px;
}

.status-meta > * + *::before {
  content: "·";
  color: color-mix(in oklch, var(--primary) 32%, var(--line-strong));
  margin-right: 8px;
}

.status-meta a:first-child {
  color: var(--text-strong);
  font-weight: 750;
  text-decoration: none;
}

.status-meta time {
  color: var(--text-subtle);
}

.status-visibility {
  color: var(--text-muted);
  font-size: 0.92rem;
  text-transform: lowercase;
}

.status-visibility.is-public { color: var(--text-subtle); }
.status-visibility.is-unlisted { color: var(--text-muted); }
.status-visibility.is-followers,
.status-visibility.is-private { color: var(--warning); }
.status-visibility.is-direct { color: var(--secondary); }

.status-boosted {
  color: var(--secondary-bright);
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 7px;
  letter-spacing: 0.01em;
  text-shadow: 0 0 14px color-mix(in oklch, var(--secondary) 30%, transparent);
}

.status-body {
  line-height: 1.56;
  overflow-wrap: anywhere;
}

.status-body p:first-child {
  margin-top: 0;
}

.status-media {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 8px;
  margin-top: 10px;
}

.status-media figure {
  margin: 0;
}

.status-media a {
  display: block;
  line-height: 0;
}

.status-media img {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.status-media figcaption {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.status-counts {
  margin-top: 11px;
  color: var(--text-subtle);
  font-size: 0.9rem;
  gap: 14px;
  row-gap: 4px;
}

.status-counts > a,
.status-counts > span {
  color: var(--text-subtle);
}

.status-counts > .is-nonzero {
  color: var(--text-strong);
  font-weight: 600;
}

.status-counts > .is-nonzero.meast-count {
  color: var(--primary-bright);
}

.status-counts > .is-nonzero.mop-count {
  color: var(--secondary-bright);
  text-shadow: 0 0 12px color-mix(in oklch, var(--secondary) 40%, transparent);
}

.status-counts > .is-nonzero.bwat-count {
  color: var(--secondary);
}

.status-counts > a:not(.is-nonzero) {
  text-decoration: none;
}

.status-counts > a:not(.is-nonzero):hover {
  color: var(--text);
}

.status-actions {
  margin-top: 12px;
  gap: 4px;
  row-gap: 6px;
  border-top: 1px solid color-mix(in oklch, var(--line) 60%, transparent);
  padding-top: 10px;
}

.status-actions form,
.notification form {
  margin: 0;
}

.status-actions .action-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.status-actions .action-group + .action-group {
  margin-left: auto;
}

.reply-target {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 9px;
  color: var(--text-muted);
  background: var(--bg-shell);
}

.pill,
.locked,
.state-on {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--text-muted);
  padding: 1px 9px;
  font-size: 0.82rem;
  font-weight: 700;
}

.locked {
  color: var(--warning);
  border-color: color-mix(in oklch, var(--warning) 60%, var(--line));
  background: color-mix(in oklch, var(--warning) 14%, transparent);
}

.state-on {
  color: var(--secondary-bright);
  border-color: var(--secondary-line);
  background: color-mix(in oklch, var(--secondary-wash) 55%, transparent);
  box-shadow: 0 0 10px color-mix(in oklch, var(--secondary) 22%, transparent);
}

.pill {
  background: color-mix(in oklch, var(--primary-wash) 38%, transparent);
  border-color: color-mix(in oklch, var(--primary) 30%, var(--line));
  color: var(--primary);
}

.metric-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.metric-list div,
.metric-list a.metric-link {
  background: var(--bg-shell);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
}

.metric-list a.metric-link {
  display: block;
  text-decoration: none;
}

.metric-list a.metric-link:hover,
.metric-list a.metric-link:focus-visible {
  border-color: color-mix(in oklch, var(--primary) 40%, var(--line));
  background: color-mix(in oklch, var(--primary-wash) 30%, var(--bg-shell));
}

.metric-list a.metric-link:hover dd {
  color: var(--primary-bright);
}

.metric-list dt {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.metric-list dd {
  color: var(--text-strong);
  font-weight: 800;
  margin: 2px 0 0;
}

.compat-list,
.account-list {
  display: grid;
  gap: 8px;
}

.compat-row p,
.account-row p {
  margin-bottom: 0;
}

.htmx-request {
  opacity: 0.72;
}

@media (max-width: 720px) {
  .topnav {
    min-height: 0;
    flex-wrap: wrap;
    gap: 6px;
    overflow-x: visible;
    padding: 8px 12px 10px;
  }

  .brand {
    margin-right: 4px;
  }

  .topnav a:not(.brand) {
    padding: 6px 7px;
  }

  .nav-form {
    margin-left: 0;
  }

  .nav-form button {
    padding: 6px 8px;
  }

  .app-shell {
    padding: 14px 12px 48px;
  }

  .compose-panel textarea {
    min-height: 72px;
  }

  .compose-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .compose-actions .compose-submit {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .topnav {
    font-size: 0.94rem;
  }

  .topnav a:not(.brand) {
    padding: 5px 6px;
  }
}

@media (min-width: 860px) {
  .page-grid {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    align-items: start;
  }

  .main-column {
    grid-column: 1;
  }

  .timeline-column {
    grid-column: 1;
  }

  .compose-panel,
  .profile-panel {
    grid-column: 1;
  }

  .compose-panel {
    padding-bottom: 12px;
  }

  .compose-panel textarea {
    min-height: 84px;
  }

  .compose-panel label {
    margin-top: 9px;
  }

  .side-panel {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: 74px;
  }
}


@media (prefers-reduced-motion: no-preference) {
  a,
  button,
  .button,
  input,
  textarea,
  select,
  .status-card,
  .panel {
    transition:
      background-color 160ms ease-out,
      border-color 160ms ease-out,
      color 160ms ease-out,
      box-shadow 160ms ease-out,
      opacity 160ms ease-out;
  }
}

/* ===== Avatars ===== */
.avatar {
  display: block;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg-input);
  border: 1px solid var(--line);
  flex: 0 0 auto;
}

.avatar-xs { width: 24px; height: 24px; border-radius: 5px; }
.avatar-sm { width: 40px; height: 40px; }
.avatar-lg { width: 80px; height: 80px; border-radius: var(--radius); }

.avatar-link {
  display: inline-flex;
  flex: 0 0 auto;
  border-radius: 6px;
}

.avatar-link:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

/* Status card header: avatar beside the meta block */
.status-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.status-head .status-meta {
  flex: 1 1 auto;
  min-width: 0;
}

.status-permalink {
  text-decoration: none;
}

.status-permalink:hover {
  color: var(--primary-bright);
}

/* Topbar profile link with avatar */
.nav-profile {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-profile .avatar-xs {
  margin: -2px 0;
}

/* ===== Profile page ===== */
.profile-cover {
  margin: -14px -14px 0;
  aspect-ratio: 3 / 1;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--bg-shell);
  border-bottom: 1px solid var(--line);
}

.profile-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-head {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin: -36px 0 12px;
}

.profile-avatar {
  border: 3px solid var(--bg-panel);
  box-shadow: 0 2px 10px color-mix(in oklch, black 40%, transparent);
}

.profile-identity {
  padding-bottom: 4px;
  min-width: 0;
}

.profile-identity h1 {
  margin: 0;
  font-size: 1.5rem;
  overflow-wrap: anywhere;
}

.profile-fields {
  display: grid;
  gap: 1px;
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--line);
}

.profile-field {
  display: grid;
  grid-template-columns: minmax(80px, 30%) 1fr;
  gap: 12px;
  padding: 8px 12px;
  background: var(--bg-shell);
}

.profile-field dt {
  color: var(--text-muted);
  font-weight: 700;
}

.profile-field dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* ===== Account rows (followers/following/interaction lists) ===== */
.account-row.account-row-flex {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-row .account-row-id {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.account-row .account-row-id a {
  text-decoration: none;
}

.account-row .account-row-id a:first-child {
  color: var(--text-strong);
  font-weight: 700;
}

.account-row .account-row-id .acct {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.account-row .account-row-action {
  flex: 0 0 auto;
}

/* ===== Thread / reply view ===== */
.thread-ancestors,
.thread-replies {
  list-style: none;
  margin: 0;
  padding: 0;
}

.thread-ancestors {
  margin-bottom: 10px;
  position: relative;
}

.thread-ancestors > li {
  position: relative;
}

/* Vertical connector linking ancestors down to the focused snorf */
.thread-ancestors > li::after {
  content: "";
  position: absolute;
  left: 33px;
  bottom: -10px;
  width: 2px;
  height: 10px;
  background: color-mix(in oklch, var(--primary) 30%, var(--line));
}

.thread-focused .status-card {
  border-color: color-mix(in oklch, var(--primary) 45%, var(--line));
  box-shadow: 0 0 0 1px color-mix(in oklch, var(--primary) 22%, transparent);
}

.thread-note {
  margin: 10px 0;
  font-size: 0.9rem;
}

.thread-replies {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.thread-reply {
  margin-left: calc(var(--depth, 0) * clamp(8px, 2.4vw, 22px));
  position: relative;
}

/* Subtle rail showing reply nesting */
.thread-reply[style*="--depth"]::before {
  content: "";
  position: absolute;
  left: -11px;
  top: 0;
  bottom: 10px;
  width: 2px;
  background: color-mix(in oklch, var(--secondary) 26%, var(--line));
  border-radius: 2px;
}

/* ===== Who measted / bwatted ===== */
.interaction-panel:not(:empty) {
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-shell);
}

.interaction-heading {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.interaction-list .account-row {
  background: var(--bg-panel);
}

.mop-count.is-nonzero,
.bwat-count.is-nonzero,
.meast-count.is-nonzero {
  cursor: pointer;
}

/* ===== Compact grouped notifications ===== */
.notif-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 6px;
  background: var(--bg-panel);
  border: 1px solid color-mix(in oklch, var(--primary) 12%, var(--line));
  border-radius: var(--radius);
}

.notif-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--primary-ink);
  background: var(--primary);
}

.notif-meast .notif-icon,
.notif-bwat .notif-icon {
  background: var(--secondary);
}

.notif-follow .notif-icon {
  background: var(--success);
}

.notif-avatars {
  display: inline-flex;
  align-items: center;
}

.notif-avatars a:not(:first-child) .avatar {
  margin-left: -8px;
}

.notif-avatars .avatar {
  box-shadow: 0 0 0 2px var(--bg-panel);
}

.notif-text {
  min-width: 0;
  font-size: 0.92rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notif-text strong {
  color: var(--text-strong);
  font-weight: 700;
}

.notif-snippet {
  color: var(--text-muted);
  text-decoration: none;
}

.notif-snippet:hover {
  color: var(--primary-bright);
}

.notif-time {
  font-size: 0.82rem;
  white-space: nowrap;
}

.notif-dismiss button {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 0.82rem;
}

@media (max-width: 720px) {
  .notif-row {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    gap: 8px;
  }
  .notif-time {
    display: none;
  }
}
