:root {
  --bg: #f3f5f9;
  --bg-soft: #eef2f7;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-muted: #f1f5f9;
  --line: #d9e2ec;
  --line-strong: #c8d4e3;
  --ink: #16202b;
  --muted: #637489;
  --blue: #1877f2;
  --blue-deep: #0f62d6;
  --blue-soft: rgba(24, 119, 242, 0.12);
  --green: #1f9d63;
  --green-soft: rgba(31, 157, 99, 0.12);
  --copper: #c9773b;
  --copper-soft: rgba(201, 119, 59, 0.14);
  --warning: #d99b2a;
  --warning-soft: rgba(217, 155, 42, 0.12);
  --danger: #d6455d;
  --danger-soft: rgba(214, 69, 93, 0.12);
  --shadow-sm: 0 12px 26px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 18px 40px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 28px 60px rgba(15, 23, 42, 0.12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --max-width: 1360px;
  --font-body: "Aptos", "Segoe UI Variable Text", "Segoe UI", Tahoma, sans-serif;
  --font-display: "Aptos Display", "Segoe UI Variable Display", "Segoe UI", Tahoma, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  text-align: start;
}

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

.inline-form {
  margin: 0;
}

img {
  max-width: 100%;
}

summary {
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

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

.portal-shell {
  min-height: 100vh;
}

.portal-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(200, 212, 227, 0.9);
}

.portal-topbar-inner {
  width: min(var(--max-width), calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0;
  display: grid;
  grid-template-columns: auto minmax(280px, 1fr) auto;
  align-items: center;
  gap: 1rem;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.brand-mark {
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, #ff8a55 0%, #1877f2 100%);
  box-shadow: 0 16px 32px rgba(24, 119, 242, 0.2);
  position: relative;
  flex: none;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
}

.brand-mark::before {
  inset: 0.6rem 1rem;
}

.brand-mark::after {
  inset: 1rem 0.6rem;
}

.brand-copy {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 800;
  line-height: 1;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.social-search {
  width: 100%;
}

.social-search input {
  width: 100%;
  min-height: 3rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  padding: 0.85rem 1.15rem;
  font: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.social-search input::placeholder {
  color: #8b99aa;
}

.social-search input:focus {
  border-color: rgba(24, 119, 242, 0.28);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(24, 119, 242, 0.12);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: flex-end;
}

.notification-button {
  position: relative;
}

.notification-count {
  position: absolute;
  top: -0.35rem;
  inset-inline-end: -0.2rem;
  min-width: 1.3rem;
  height: 1.3rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--danger);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  box-shadow: 0 10px 20px rgba(214, 69, 93, 0.22);
}

.header-pill,
.icon-button,
.interaction-button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 2.8rem;
  padding: 0.72rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.header-pill,
.icon-button,
.interaction-button,
.button.ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.header-pill:hover,
.icon-button:hover,
.interaction-button:hover,
.button.ghost:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.header-pill.primary,
.button.primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-deep) 100%);
  border-color: transparent;
  box-shadow: 0 18px 34px rgba(24, 119, 242, 0.28);
}

.button.primary:hover,
.header-pill.primary:hover {
  box-shadow: 0 22px 40px rgba(24, 119, 242, 0.32);
}

.button[disabled] {
  opacity: 0.58;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.text-link {
  color: var(--blue);
  font-weight: 700;
}

.menu-dropdown {
  position: relative;
}

.dropdown-panel {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 0.7rem);
  min-width: 14rem;
  padding: 0.8rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: 0.4rem;
}

.dropdown-title {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.dropdown-empty {
  margin: 0;
  padding: 0.75rem 0.95rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  padding: 0.2rem 0;
}

.notification-panel {
  min-width: 20rem;
  max-width: min(24rem, calc(100vw - 2rem));
}

.notification-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.notification-list {
  display: grid;
  gap: 0.35rem;
}

.notification-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  align-items: start;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-md);
  color: var(--ink);
  background: transparent;
}

.notification-item:hover,
.notification-item.unread {
  background: var(--surface-muted);
}

.notification-copy {
  min-width: 0;
  display: grid;
  gap: 0.18rem;
}

.notification-copy strong,
.notification-copy small {
  overflow-wrap: anywhere;
}

.notification-copy strong {
  font-size: 0.92rem;
}

.notification-copy small {
  color: var(--muted);
  line-height: 1.45;
}

.notification-dot {
  width: 0.62rem;
  height: 0.62rem;
  margin-top: 0.35rem;
  border-radius: 999px;
  background: var(--blue);
}

.notification-dot.success {
  background: var(--green);
}

.notification-dot.warning {
  background: var(--warning);
}

.notification-dot.error {
  background: var(--danger);
}

.dropdown-form {
  margin: 0;
}

.dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2.8rem;
  padding: 0.75rem 0.95rem;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-align: start;
  cursor: pointer;
}

.dropdown-item:hover,
.dropdown-item.is-current {
  background: var(--surface-muted);
}

.dropdown-item small {
  color: var(--muted);
  font-weight: 700;
}

.dropdown-item.danger {
  color: var(--danger);
}

.profile-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.4rem;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.profile-copy {
  display: grid;
  gap: 0.05rem;
}

.profile-copy strong {
  font-size: 0.96rem;
}

.profile-copy small {
  color: var(--muted);
}

.profile-avatar {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: var(--blue-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  flex: none;
}

.profile-avatar.accent {
  background: linear-gradient(135deg, #fde68a 0%, #fdba74 100%);
  color: #9a3412;
}

.profile-avatar.subtle {
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  color: #334155;
}

.portal-main {
  width: min(var(--max-width), calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

.message-stack {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.message {
  padding: 0.95rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.message.success {
  border-color: rgba(31, 157, 99, 0.18);
  color: var(--green);
}

.message.error {
  border-color: rgba(214, 69, 93, 0.18);
  color: var(--danger);
}

.message.warning {
  border-color: rgba(217, 155, 42, 0.18);
  color: #9a6700;
}

.social-card,
.language-modal {
  background: var(--surface);
  border: 1px solid rgba(217, 226, 236, 0.9);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.social-card {
  padding: 1.35rem;
}

.landing-hero,
.intro-card,
.welcome-card,
.composer-card,
.workspace-panel,
.post-card,
.mini-post-card {
  animation: rise-in 280ms ease both;
}

.landing-grid,
.dashboard-layout,
.auth-layout,
.welcome-body,
.field-grid,
.section-stack,
.feature-grid,
.metric-column,
.feed-list {
  display: grid;
  gap: 1rem;
}

.landing-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.95fr);
  align-items: start;
}

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

.metric-tile,
.feature-card {
  background: var(--surface-soft);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(217, 226, 236, 0.9);
  padding: 1.15rem;
}

.metric-tile strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.55rem;
  color: var(--blue-deep);
  margin-bottom: 0.4rem;
}

.metric-tile h2,
.feature-card h3,
.section-heading h2,
.section-heading h3,
.auth-card h2 {
  margin: 0;
  font-family: var(--font-display);
}

.metric-tile p,
.feature-card p,
.timeline-copy,
.hero-copy,
.section-heading p,
.post-meta,
.field-help,
.panel-footer p,
.modal-copy,
.modal-hint,
.muted,
.intro-card p,
.welcome-strip p,
.post-text {
  color: var(--muted);
  line-height: 1.7;
}

.feature-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.section-space {
  margin-top: 1.25rem;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.search-state-card {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.section-heading p {
  margin: 0.2rem 0 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-pill);
  background: var(--blue-soft);
  color: var(--blue-deep);
  font-size: 0.86rem;
  font-weight: 800;
}

.hero-title,
.timeline-title,
.auth-card h2,
.intro-card h1 {
  margin: 0;
  font-family: var(--font-display);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.hero-title,
.timeline-title,
.intro-card h1 {
  font-size: clamp(2rem, 4vw, 3.6rem);
}

.hero-actions,
.badge-row,
.welcome-strip,
.intro-header,
.post-head,
.post-tags,
.post-actions,
.simple-actions,
.panel-footer,
.header-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2rem;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.9rem;
}

.badge.support {
  background: var(--blue-soft);
  color: var(--blue-deep);
}

.badge.accent {
  background: var(--copper-soft);
  color: #9a4e1f;
}

.badge.success {
  background: var(--green-soft);
  color: var(--green);
}

.badge.warning {
  background: var(--warning-soft);
  color: #9a6700;
}

.badge.muted {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
}

.badge.copper {
  background: var(--copper-soft);
  color: #9a4e1f;
}

.dashboard-layout {
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.82fr);
  align-items: start;
}

.timeline-main,
.composer-sidebar,
.detail-sidebar {
  display: grid;
  gap: 1rem;
}

.feed-list {
  gap: 1rem;
}

.feed-section {
  display: grid;
  gap: 1rem;
}

.welcome-card {
  display: grid;
  gap: 1.15rem;
}

.welcome-strip {
  justify-content: space-between;
  align-items: center;
}

.welcome-body {
  grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1.2fr);
  align-items: start;
}

.story-strip {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.story-card {
  min-width: 116px;
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  text-align: center;
}

.story-card.compact {
  min-width: 104px;
}

.story-card strong {
  font-family: var(--font-display);
  font-size: 1.5rem;
}

.story-card p {
  margin: 0;
  font-size: 0.88rem;
}

.story-ring {
  width: 5rem;
  height: 5rem;
  padding: 0.22rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f97316 0%, #ec4899 50%, #1877f2 100%);
}

.story-ring.blue {
  background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
}

.story-ring.green {
  background: linear-gradient(135deg, #34d399 0%, #059669 100%);
}

.story-ring.copper {
  background: linear-gradient(135deg, #f6ad55 0%, #c9773b 100%);
}

.story-icon {
  width: 4.35rem;
  height: 4.35rem;
  border-radius: 50%;
  background: var(--surface);
  display: grid;
  place-items: center;
  position: relative;
  color: var(--ink);
}

.story-icon::before,
.story-icon::after,
.icon-bell::before,
.icon-globe::before,
.share-icon::before,
.interaction-icon::before {
  content: "";
  position: absolute;
}

.total-icon::before,
.workspace-icon::before {
  width: 1.2rem;
  height: 0.92rem;
  border-radius: 0.32rem;
  border: 2px solid currentColor;
  top: 1.5rem;
  left: 1.2rem;
}

.total-icon::after,
.workspace-icon::after {
  width: 1.2rem;
  height: 0.92rem;
  border-radius: 0.32rem;
  border: 2px solid currentColor;
  top: 1.95rem;
  left: 1.85rem;
  background: var(--surface);
}

.active-icon::before {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  border: 2px solid currentColor;
}

.active-icon::after {
  width: 0.8rem;
  height: 0.45rem;
  border-inline-start: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
}

.update-icon::before {
  width: 1.7rem;
  height: 0.14rem;
  background: currentColor;
  box-shadow: 0 -0.45rem 0 currentColor, 0 0.45rem 0 currentColor;
}

.update-icon::after {
  width: 0.28rem;
  height: 1.45rem;
  background: currentColor;
  border-radius: 999px;
}

.lock-icon::before {
  width: 1rem;
  height: 0.95rem;
  border: 2px solid currentColor;
  border-radius: 0.26rem;
  top: 1.95rem;
}

.lock-icon::after {
  width: 0.72rem;
  height: 0.6rem;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 0.7rem 0.7rem 0 0;
  top: 1.3rem;
}

.pulse-icon::before {
  width: 1.8rem;
  height: 0.2rem;
  background: transparent;
  border-top: 2px solid currentColor;
  top: 2rem;
}

.pulse-icon::after {
  width: 1.6rem;
  height: 1rem;
  border-inline-start: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: skew(-32deg);
  top: 1.5rem;
}

.ticket-icon::before {
  width: 1.55rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-radius: 0.36rem;
}

.ticket-icon::after {
  width: 0.2rem;
  height: 1rem;
  background: currentColor;
  box-shadow: -0.45rem 0 0 currentColor, 0.45rem 0 0 currentColor;
}

.icon-bell,
.icon-globe,
.share-icon,
.interaction-icon {
  width: 1.2rem;
  height: 1.2rem;
  position: relative;
  display: inline-block;
}

.icon-bell::before {
  inset: 0.08rem 0.18rem 0.24rem;
  border: 2px solid currentColor;
  border-radius: 0.6rem 0.6rem 0.42rem 0.42rem;
}

.icon-globe::before {
  inset: 0.06rem;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow: inset 0 0 0 0 transparent;
}

.icon-globe::after {
  content: "";
  position: absolute;
  inset: 0.22rem 0.48rem;
  border-inline: 2px solid currentColor;
  border-radius: 999px;
}

.share-icon::before {
  width: 0.95rem;
  height: 0.95rem;
  border-top: 2px solid currentColor;
  border-inline-end: 2px solid currentColor;
  transform: rotate(45deg);
  top: 0.08rem;
  inset-inline-start: 0.12rem;
}

.like-icon::before {
  content: "♡";
  inset: auto;
  position: static;
  font-size: 1.15rem;
}

.comment-icon::before {
  content: "◌";
  inset: auto;
  position: static;
  font-size: 1rem;
}

.share-outline-icon::before {
  content: "↗";
  inset: auto;
  position: static;
  font-size: 1rem;
}

.post-card,
.mini-post-card {
  display: grid;
  gap: 0.9rem;
}

.post-card:hover,
.mini-post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.post-head {
  align-items: center;
  justify-content: space-between;
}

.intro-header {
  align-items: center;
}

.intro-header strong,
.post-head strong {
  display: block;
}

.intro-header p,
.post-head p,
.welcome-strip p {
  margin: 0.1rem 0 0;
  font-size: 0.9rem;
}

.post-body h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
}

.post-meta {
  margin: 0 0 0.8rem;
}

.post-actions {
  justify-content: space-between;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.interaction-button {
  flex: 1 1 0;
  min-height: 2.65rem;
  background: transparent;
  box-shadow: none;
  border-color: transparent;
}

.interaction-button.danger {
  color: var(--danger);
}

.composer-card {
  display: grid;
  gap: 1rem;
}

.sticky-composer {
  position: sticky;
  top: 6.4rem;
}

.composer-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.composer-header h2 {
  margin: 0 0 0.18rem;
}

.composer-header p {
  margin: 0;
  color: var(--muted);
}

.panel-footer {
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
}

.panel-footer p {
  margin: 0;
}

.submit-button {
  width: 100%;
  min-height: 3rem;
}

.portal-form {
  display: grid;
  gap: 1rem;
}

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

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

.field {
  display: grid;
  gap: 0.48rem;
}

.field label {
  font-weight: 800;
  font-size: 0.94rem;
}

.portal-input,
.portal-select,
.portal-textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  font: inherit;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.portal-input::placeholder,
.portal-textarea::placeholder {
  color: #98a6b7;
}

.portal-input:focus,
.portal-select:focus,
.portal-textarea:focus {
  outline: none;
  background: var(--surface);
  border-color: rgba(24, 119, 242, 0.3);
  box-shadow: 0 0 0 4px rgba(24, 119, 242, 0.12);
}

.portal-textarea {
  min-height: 7.5rem;
  resize: vertical;
}

.portal-checkbox {
  width: 1rem;
  height: 1rem;
}

.checkbox-group {
  align-content: start;
}

.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.2rem;
  font-weight: 700;
}

.field-help {
  font-size: 0.88rem;
}

.form-errors,
.errorlist {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.35rem;
  color: var(--danger);
  font-size: 0.9rem;
}

input[type="date"] {
  position: relative;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.72;
  cursor: pointer;
}

.empty-state-card {
  text-align: center;
}

.empty-state-card h3,
.empty-state-card p {
  margin: 0;
}

.auth-layout {
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.92fr);
  align-items: start;
}

.auth-feed-preview {
  display: grid;
  gap: 1rem;
}

.intro-card h1 {
  margin-top: 0.2rem;
}

.auth-card {
  max-width: 100%;
}

.language-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.36);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.language-modal,
.install-modal {
  width: min(46rem, 100%);
  padding: 1.5rem;
  display: grid;
  gap: 1rem;
}

.language-modal h2,
.install-modal h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2rem;
}

.install-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 23, 42, 0.32);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  padding: 1rem;
}

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

.install-modal {
  background: var(--surface);
  border: 1px solid rgba(217, 226, 236, 0.9);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.modal-copy,
.modal-hint {
  margin: 0;
}

.language-option-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.language-option-form {
  margin: 0;
}

.language-card {
  width: 100%;
  min-height: 8.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
  padding: 1rem;
  display: grid;
  gap: 0.35rem;
  align-content: center;
  text-align: start;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.language-card:hover,
.language-card.is-current {
  transform: translateY(-2px);
  border-color: rgba(24, 119, 242, 0.28);
  box-shadow: var(--shadow-md);
}

.language-card-native {
  font-size: 1.22rem;
  font-weight: 800;
}

.language-card-meta,
.language-card-code {
  color: var(--muted);
}

.inline-note {
  padding: 0.95rem 1rem;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--muted);
}

.score-card {
  min-height: 100%;
}

.score-pill {
  width: 6rem;
  height: 6rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(24, 119, 242, 0.12), rgba(201, 119, 59, 0.14));
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
}

.workspace-feed,
.mini-feed {
  display: grid;
  gap: 1rem;
}

.activity-card,
.activity-post-card {
  animation: rise-in 280ms ease both;
}

.settings-layout {
  align-items: start;
}

.token-feed {
  max-height: 28rem;
  overflow: auto;
  padding-inline-end: 0.2rem;
}

.token-card {
  gap: 0.8rem;
}

.token-card.is-revoked {
  background: var(--surface-soft);
}

.token-codebox {
  padding: 1rem 1.1rem;
  border-radius: var(--radius-lg);
  background: #0f172a;
  color: #e2e8f0;
  font-family: Consolas, "SFMono-Regular", "Cascadia Code", monospace;
  font-size: 0.95rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.token-revoke-button {
  width: 100%;
  justify-content: center;
}

.token-reveal-card {
  border-color: rgba(24, 119, 242, 0.18);
}

.section-spaced {
  margin-top: 0.25rem;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1120px) {
  .portal-topbar-inner,
  .landing-grid,
  .dashboard-layout,
  .auth-layout,
  .welcome-body {
    grid-template-columns: 1fr;
  }

  .sticky-composer {
    position: static;
  }

  .social-search {
    order: 3;
  }
}

@media (max-width: 820px) {
  .portal-topbar-inner,
  .portal-main {
    width: min(var(--max-width), calc(100% - 1.2rem));
  }

  .portal-topbar-inner {
    padding: 0.85rem 0;
  }

  .metric-column,
  .field-grid,
  .field-grid.three,
  .language-option-grid {
    grid-template-columns: 1fr;
  }

  .brand-subtitle {
    white-space: normal;
  }

  .post-actions,
  .welcome-strip,
  .section-heading {
    align-items: stretch;
  }

  .interaction-button {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .header-actions {
    width: 100%;
    justify-content: stretch;
  }

  .header-pill,
  .profile-summary,
  .icon-button {
    flex: 1 1 auto;
  }

  .story-strip {
    justify-content: space-between;
  }

  .story-card {
    min-width: 96px;
    flex: 1 1 calc(50% - 0.5rem);
  }

  .social-card,
  .language-modal {
    padding: 1rem;
  }
}

/* Custom styles for interactive charts & streak features */
.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #ff7b00 0%, #ffae00 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.85rem;
  box-shadow: 0 4px 10px rgba(255, 123, 0, 0.25);
  animation: flamePulse 2s infinite alternate;
  cursor: default;
  user-select: none;
}

.streak-badge .flame-icon {
  font-size: 1.1rem;
  display: inline-block;
  transform-origin: center bottom;
  animation: flameWiggle 1.5s infinite ease-in-out;
}

@keyframes flamePulse {
  0% {
    box-shadow: 0 4px 8px rgba(255, 123, 0, 0.25);
    transform: scale(1);
  }
  100% {
    box-shadow: 0 4px 16px rgba(255, 123, 0, 0.45);
    transform: scale(1.03);
  }
}

@keyframes flameWiggle {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}

.analytics-chart-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 1rem;
}

@media (min-width: 900px) {
  .analytics-chart-container {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

.analytics-chart-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.chart-wrapper {
  position: relative;
  width: 100%;
  height: 250px;
  margin-top: 1rem;
}

.profile-avatar-wrapper {
  position: relative;
  display: inline-flex;
}

.profile-avatar-wrapper .streak-badge {
  position: absolute;
  bottom: -6px;
  right: -6px;
  z-index: 10;
  padding: 0.15rem 0.4rem;
  font-size: 0.75rem;
}

