:root {
  color-scheme: dark;
  font-family:
    "IBM Plex Sans",
    system-ui,
    -apple-system,
    sans-serif;
  --dialog-bg: rgba(19, 8, 31, 0.96);
  --dialog-text: #f4edff;
  --input-bg: rgba(9, 3, 16, 0.96);
  --input-border: rgba(182, 109, 255, 0.45);
  --label-color: rgba(244, 237, 255, 0.78);
  --button-primary-bg: #b66dff;
  --button-primary-text: #1b052c;
  --button-secondary-bg: rgba(255, 255, 255, 0.08);
  --button-secondary-text: #f4edff;
  --text-scale: 1rem;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #3d1364, #12061d 60%);
  color: #f4edff;
}

#loginDialog,
#forgotPasswordDialog {
  background: var(--dialog-bg);
  color: var(--dialog-text);
  border: 1px solid rgba(207, 161, 255, 0.3);
}

#loginDialog::backdrop,
#forgotPasswordDialog::backdrop {
  background: rgba(3, 1, 7, 0.66);
  backdrop-filter: blur(2px);
}

.social {
  max-width: 980px;
  margin: 0 auto;
  padding: 3rem 1rem 4rem;
}

.social-view {
  display: grid;
  gap: 1rem;
}

.hero,
.setup,
.feed {
  background: rgba(19, 8, 31, 0.8);
  border: 1px solid rgba(207, 161, 255, 0.2);
  border-radius: 18px;
  padding: 2rem;
  backdrop-filter: blur(8px);
}

.hero {
  position: relative;
  overflow: hidden;
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.9fr);
  gap: 1.5rem;
  align-items: stretch;
  position: relative;
  z-index: 1;
}

.hero-copy {
  display: flex;
  flex-direction: column;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -8% -24% auto;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(182, 109, 255, 0.26), rgba(182, 109, 255, 0));
  pointer-events: none;
}

.setup,
.feed {
  margin-top: 1rem;
}

.social-app-header {
  margin-top: 0;
}

.social-app-actions {
  justify-content: flex-end;
}

.hidden {
  display: none;
}

h1,
h2 {
  margin: 0.6rem 0;
}

.hero-support {
  max-width: 60ch;
}

.hero-lead {
  max-width: 62ch;
  font-size: 1.05rem;
}

.hero-support {
  margin: 0;
  color: rgba(244, 237, 255, 0.78);
}

.actions,
.setup-actions,
.post-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.hero-actions {
  margin-top: 1.2rem;
}

.hero-cta-primary,
.hero-cta-secondary,
.hero-inline-link {
  text-decoration: none;
}

.hero-cta-primary,
.hero-cta-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  font-weight: 700;
}

.hero-cta-primary {
  background: #b66dff;
  color: #1b052c;
}

.hero-cta-secondary {
  border: 1px solid rgba(207, 161, 255, 0.48);
  color: #f4edff;
  background: rgba(255, 255, 255, 0.04);
}

.hero-inline-link {
  min-height: 44px;
  padding-inline: 0.9rem;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.hero-point {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.45rem 0.75rem;
  border: 1px solid rgba(207, 161, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(244, 237, 255, 0.9);
  font-size: 0.94rem;
}

.hero-preview {
  display: flex;
  align-items: stretch;
}

.hero-preview-card {
  width: 100%;
  border: 1px solid rgba(207, 161, 255, 0.18);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(46, 17, 74, 0.85), rgba(17, 6, 29, 0.94));
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.22);
  padding: 1rem;
  display: grid;
  gap: 0.9rem;
}

.hero-preview-topline,
.hero-preview-profile,
.hero-preview-entry {
  display: flex;
  align-items: center;
}

.hero-preview-topline {
  justify-content: space-between;
  gap: 0.75rem;
}

.hero-preview-label {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(244, 237, 255, 0.62);
}

.hero-preview-pill {
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(182, 109, 255, 0.18);
  color: #f0c8ff;
  font-size: 0.8rem;
  font-weight: 700;
}

.hero-preview-profile {
  gap: 0.8rem;
}

.hero-preview-profile p,
.hero-preview-entry p {
  margin: 0.2rem 0 0;
  color: rgba(244, 237, 255, 0.72);
  font-size: 0.92rem;
}

.hero-preview-avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(182, 109, 255, 0.95), rgba(121, 72, 205, 0.95));
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
}

.hero-preview-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.hero-preview-stats div {
  border: 1px solid rgba(207, 161, 255, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.75rem;
}

.hero-preview-stats strong,
.hero-preview-entry strong {
  display: block;
}

.hero-preview-stats span {
  display: block;
  margin-top: 0.25rem;
  color: rgba(244, 237, 255, 0.72);
  font-size: 0.86rem;
}

.hero-preview-feed {
  display: grid;
  gap: 0.7rem;
}

.hero-preview-entry {
  align-items: flex-start;
  gap: 0.7rem;
  border: 1px solid rgba(207, 161, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  padding: 0.75rem;
}

.hero-preview-entry-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 0.3rem;
  background: #66e1b1;
  flex: 0 0 auto;
}

.hero-preview-entry-dot--accent {
  background: #b66dff;
}

button {
  border: 0;
  border-radius: 10px;
  padding: 0.65rem 1rem;
  font-size: 1rem;
  cursor: pointer;
  background: #b66dff;
  color: #1b052c;
  font-weight: 700;
}

.ghost {
  background: transparent;
  border: 1px solid #b66dff;
  border-radius: 10px;
  color: #f4edff;
}

a.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-action-link,
.icon-action-button {
  width: 44px;
  height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 1.2rem;
  line-height: 1;
  text-decoration: none;
}

.icon-action-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.timeline-entry-actions {
  margin-top: 0;
  display: flex;
  justify-content: flex-end;
  position: absolute;
  top: 0.45rem;
  right: 0.6rem;
  z-index: 2;
}

.timeline-interact-btn {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 9px;
  border-color: rgba(182, 109, 255, 0.6);
  color: rgba(244, 237, 255, 0.9);
}

.timeline-interact-btn:hover {
  border-color: rgba(207, 161, 255, 0.95);
  color: #ffffff;
  background: rgba(182, 109, 255, 0.14);
}

.timeline-interact-icon {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.setup-header p,
.feed-header p {
  margin-top: 0;
  opacity: 0.9;
}

form,
.post-form {
  display: grid;
  gap: 0.65rem;
}

label,
legend {
  font-weight: 600;
}

input,
textarea,
select {
  border: 1px solid rgba(182, 109, 255, 0.45);
  border-radius: 10px;
  background: rgba(9, 3, 16, 0.95);
  color: #f4edff;
  font: inherit;
  padding: 0.65rem 0.75rem;
}

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

fieldset {
  margin: 0.3rem 0;
  border: 1px solid rgba(182, 109, 255, 0.45);
  border-radius: 10px;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.inline-control {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.inline-control input {
  margin: 0;
}

.feedback {
  margin: 0;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
}

.feedback.error {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.5);
}

.feedback.success {
  background: rgba(52, 211, 153, 0.18);
  border: 1px solid rgba(52, 211, 153, 0.5);
}

.feed-empty {
  margin-top: 1rem;
  padding: 0.9rem;
  border-radius: 12px;
  border: 1px dashed rgba(207, 161, 255, 0.4);
  color: rgba(244, 237, 255, 0.85);
}

.feed-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.feed-item {
  border: 1px solid rgba(182, 109, 255, 0.35);
  border-radius: 12px;
  background: rgba(13, 5, 22, 0.9);
  padding: 0.9rem;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 0.9rem;
  align-items: center;
}

.timeline-code-preview {
  width: 72px;
  height: 72px;
  border-radius: 0;
  background: #fff;
  object-fit: contain;
}

.feed-item-content {
  min-width: 0;
  margin: 0;
  padding: 0;
}

.feed-item-content>* {
  margin-top: 0;
  margin-bottom: 0;
}

@media (max-width: 700px) {
  .social {
    padding-top: 1.5rem;
  }

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

  .hero,
  .feed {
    padding: 1.25rem;
  }

  .hero-actions {
    align-items: stretch;
  }

  .hero-cta-primary,
  .hero-cta-secondary,
  .hero-inline-link {
    width: 100%;
  }

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

.feed-item-header {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: rgba(244, 237, 255, 0.8);
}

.feed-item p {
  margin: 0.6rem 0 0;
  white-space: pre-wrap;
}

.grid {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

article {
  border: 1px solid rgba(207, 161, 255, 0.2);
  border-radius: 14px;
  background: rgba(13, 5, 22, 0.85);
  padding: 1rem;
}

.event-connect {
  border: 1px solid rgba(182, 109, 255, 0.35);
  border-radius: 12px;
  padding: 0.8rem;
  background: rgba(13, 5, 22, 0.7);
}

.event-connect-title {
  margin: 0;
  font-weight: 700;
}

.event-connect-hint {
  margin: 0.35rem 0 0.7rem;
  opacity: 0.9;
}

.event-search-label {
  margin: 0 0 0.3rem;
  font-weight: 600;
}

.event-search-input {
  margin-bottom: 0.7rem;
}

.event-options {
  display: grid;
  gap: 0.55rem;
}

.event-option {
  width: fit-content;
}

.feed-event-link {
  display: inline-block;
  margin-top: 0.7rem;
  font-size: 0.85rem;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  background: rgba(182, 109, 255, 0.2);
  border: 1px solid rgba(182, 109, 255, 0.4);
}

.timeline {
  margin-top: 1rem;
  background: rgba(19, 8, 31, 0.8);
  border: 1px solid rgba(207, 161, 255, 0.2);
  border-radius: 18px;
  padding: 2rem;
  backdrop-filter: blur(8px);
}

.timeline-toolbar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.timeline-toolbar input {
  flex: 1 1 280px;
}

.timeline-actions {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
}

.scanner-profile-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

#timeline-list a,
#timeline-list a:visited,
#timeline-list a:active,
#own-profile-timeline-list a,
#own-profile-timeline-list a:visited,
#own-profile-timeline-list a:active {
  color: inherit;
}

.scanner-profile-link:hover {
  opacity: 0.85;
}

.scan-meta {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  opacity: 0.85;
}

#timeline-list,
#own-profile-timeline-list {
  gap: 0;
}

#timeline-list .feed-item,
#own-profile-timeline-list .feed-item {
  border: none;
  padding: 0;
  align-items: stretch;
  overflow: hidden;
  border-radius: 0;
  grid-template-columns: 120px minmax(0, 1fr);
  grid-template-rows: 120px;
  opacity: 80%;
}

#timeline-list .feed-item.timeline-entry-new,
#own-profile-timeline-list .feed-item.timeline-entry-new {
  opacity: 100%;
}

#timeline-list .timeline-code-preview,
#own-profile-timeline-list .timeline-code-preview {
  width: 120px;
  height: 120px;
  display: block;
  object-fit: cover;
  object-position: center center;
}

#timeline-list .feed-item-content,
#own-profile-timeline-list .feed-item-content {
  padding: 0.6rem 3rem 0.6rem 0.9rem;
  border-left: 1px solid rgba(182, 109, 255, 0.35);
  border-right: 1px solid rgba(182, 109, 255, 0.35);
  border-bottom: 1px solid rgba(182, 109, 255, 0.35);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
  overflow: hidden;
  position: relative;
}

#timeline-list .feed-item-header,
#own-profile-timeline-list .feed-item-header {
  padding-right: 0.2rem;
}

#timeline-list .feed-item,
#own-profile-timeline-list .feed-item {
  gap: 0;
}

#timeline-list .feed-item p,
#timeline-list .feed-item .timeline-entry-badge,
#own-profile-timeline-list .feed-item p,
#own-profile-timeline-list .feed-item .timeline-entry-badge {
  margin: 0;
}

#timeline-list .feed-item:hover,
#own-profile-timeline-list .feed-item:hover {
  opacity: 100%;
}

#timeline-list .timeline-entry-new .feed-item-content,
#own-profile-timeline-list .timeline-entry-new .feed-item-content {
  border-left-color: rgba(148, 255, 205, 0.75);
  border-right-color: rgba(148, 255, 205, 0.75);
  border-bottom-color: rgba(148, 255, 205, 0.75);
  background: linear-gradient(180deg, rgba(148, 255, 205, 0.16) 0%, rgba(148, 255, 205, 0.04) 100%);
}

.timeline-entry-badge {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0.45rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(20, 60, 45, 0.95);
  background: rgba(148, 255, 205, 0.95);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
}

#timeline-list .feed-item:first-child .feed-item-content,
#own-profile-timeline-list .feed-item:first-child .feed-item-content {
  border-top: 1px solid rgba(182, 109, 255, 0.35);
}

@media (max-width: 720px) {

  .social {
    padding-left: 0;
    padding-right: 0;
  }

  .hero,
  .setup,
  .feed,
  .timeline {
    margin-left: 0;
    margin-right: 0;
    padding: 1rem;
  }

  #timeline-list .feed-item,
  #own-profile-timeline-list .feed-item {
    grid-template-columns: 1fr;
    border: none !important;
    gap: 0;
  }

  #timeline-list .timeline-code-preview,
  #own-profile-timeline-list .timeline-code-preview {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
  }

  #timeline-list .feed-item-content,
  #own-profile-timeline-list .feed-item-content {
    border: none !important;
  }
}

.public-profile-card,
.profile-shell {
  display: grid;
  gap: 1rem;
}

.public-profile-header {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.profile-avatar,
.public-profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.4rem;
  background: linear-gradient(135deg, rgba(182, 109, 255, 0.95), rgba(83, 42, 127, 0.95));
  color: #fff;
  overflow: hidden;
}

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

.public-profile-meta p,
.public-profile-bio {
  margin: 0;
}

.public-profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
}

.public-profile-stat {
  border: 1px solid rgba(182, 109, 255, 0.35);
  border-radius: 12px;
  padding: 0.8rem;
  background: rgba(13, 5, 22, 0.85);
}

.public-profile-stat strong {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 0.2rem;
}

.profile-header-card {
  display: grid;
  gap: 0.75rem;
}

.profile-header-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.profile-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.profile-tab {
  background: transparent;
  border: 1px solid rgba(182, 109, 255, 0.5);
  color: #f4edff;
}

.profile-tab.active {
  background: #b66dff;
  color: #1b052c;
}

.profile-panel {
  border: 1px solid rgba(182, 109, 255, 0.35);
  border-radius: 12px;
  padding: 1rem;
  background: rgba(13, 5, 22, 0.85);
}

.profile-inline-form {
  display: grid;
  gap: 0.7rem;
  max-width: 560px;
}

.profile-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.danger-btn {
  background: #ef4444;
  color: #fff;
}

.profile-meta {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.profile-passkey-item {
  border: 1px solid rgba(182, 109, 255, 0.35);
  border-radius: 10px;
  padding: 0.7rem;
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: center;
}