/* Base layout */
:root {
  color-scheme: light;
  font-family: "SF Pro Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-soft: 0 16px 40px rgba(13, 30, 57, 0.16);
  --shadow-card: 0 10px 30px rgba(20, 41, 82, 0.15);
  --shadow-elevated: 0 18px 40px rgba(6, 12, 24, 0.45);
  --shadow-glow: 0 0 32px rgba(74, 168, 255, 0.25);
  --glass: rgba(255, 255, 255, 0.2);
  --glass-border: rgba(255, 255, 255, 0.35);
  --neon-glow: 0 0 30px rgba(74, 168, 255, 0.35);
  --neon-glow-strong: 0 0 60px rgba(74, 168, 255, 0.55);
  --bg-spot: #1f3561;

  /* Theme palette defaults (Ocean) */
  --accent: #4aa8ff;
  --accent-strong: #1a70f2;
  --background: #0f1a2b;
  --background-secondary: #142648;
  --surface: rgba(255, 255, 255, 0.12);
  --surface-muted: rgba(255, 255, 255, 0.08);
  --surface-strong: rgba(10, 16, 30, 0.8);
  --surface-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(10, 16, 30, 0.7));
  --border-soft: rgba(255, 255, 255, 0.12);
  --text-primary: #f8fbff;
  --text-secondary: rgba(248, 251, 255, 0.7);
  --success: #2cc36b;
  --warning: #f4b740;
  --danger: #ff5c5c;
}

body {
  margin: 0;
  background: radial-gradient(circle at top, var(--bg-spot) 0%, var(--background) 55%);
  color: var(--text-primary);
  min-height: 100vh;
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  z-index: 1;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(14px, 2vw, 20px) clamp(16px, 3vw, 28px) 10px;
}

.menu-toggle {
  display: none !important;
}

.menu-toggle .icon {
  width: 18px;
  height: 12px;
  border-radius: 0;
  border: none;
  box-shadow: none;
  background: linear-gradient(
    to bottom,
    var(--text-primary) 2px,
    transparent 2px,
    transparent 5px,
    var(--text-primary) 5px,
    var(--text-primary) 7px,
    transparent 7px,
    transparent 10px,
    var(--text-primary) 10px
  );
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand__icon {
  font-size: 30px;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
  border: 1px solid var(--glass-border);
  overflow: hidden;
}

.brand__mascot {
  width: 100%;
  height: 100%;
  display: block;
}

.brand__title {
  font-weight: 700;
  font-size: clamp(16px, 1.6vw, 18px);
}

.brand__subtitle {
  font-size: clamp(11px, 1.2vw, 12px);
  color: var(--text-secondary);
}

.header-actions {
  display: flex;
  gap: 10px;
}

.icon-button {
  border: 1px solid var(--glass-border);
  background: var(--surface);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  position: relative;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.icon-button .icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 60%, rgba(255, 255, 255, 0.4));
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 35%, transparent);
  background: transparent;
  position: relative;
}

#notifications-btn .icon {
  border-radius: 6px;
}

#notifications-btn .icon::before {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  top: -4px;
  right: -4px;
  box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 60%, transparent);
}

#notifications-btn .icon::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: 2px;
  height: 2px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 80%, rgba(255, 255, 255, 0.4));
}

#settings-btn .icon {
  border-radius: 4px;
}

#settings-btn .icon::before,
#settings-btn .icon::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  height: 2px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 70%, rgba(255, 255, 255, 0.4));
}

#settings-btn .icon::before {
  top: 4px;
}

#settings-btn .icon::after {
  bottom: 4px;
}

.icon-button:hover {
  transform: translateY(-1px);
  background: var(--surface-muted);
}

.badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger);
  color: #fff;
  border-radius: 999px;
  font-size: 10px;
  padding: 2px 6px;
}

.view-root {
  flex: 1;
  padding: 0 clamp(16px, 3vw, 28px) 80px;
}

.tab-bar {
  position: fixed;
  top: 92px;
  left: clamp(12px, 2vw, 20px);
  width: clamp(160px, 20vw, 200px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  background: rgba(14, 23, 40, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  backdrop-filter: blur(18px);
  z-index: 2;
}

.tab-button {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: clamp(12px, 1.4vw, 14px);
  border-radius: 12px;
}

.tab-button .icon {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.15);
}

.tab-button.active .icon {
  background: var(--accent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 50%, transparent);
}

.tab-button.active {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--accent) 25%, rgba(255, 255, 255, 0.08));
  box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 25%, transparent);
}

.tab-button .label {
  text-align: left;
}

.card {
  background: var(--surface-glass);
  border-radius: var(--radius-lg);
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, rgba(255, 255, 255, 0.12));
  box-shadow: var(--shadow-elevated), var(--shadow-glow);
  backdrop-filter: blur(20px);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-elevated), 0 0 38px rgba(74, 168, 255, 0.3);
}

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

.friends-viral-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, rgba(74, 168, 255, 0.2), rgba(255, 255, 255, 0.05));
  border: 1px solid color-mix(in srgb, var(--accent) 40%, rgba(255, 255, 255, 0.2));
}

.friends-viral-title {
  font-weight: 800;
  font-size: 16px;
  margin-bottom: 4px;
}

.friends-viral-proof {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--warning);
}

.friends-viral-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.friends-search-card {
  margin-bottom: 10px;
}

.friends-section-title {
  margin: 16px 0 10px;
  font-weight: 700;
}

.friends-list .card {
  padding: 14px;
}

.friend-row .row {
  gap: 12px;
}

[data-open-profile] {
  cursor: pointer;
}

.chevron {
  font-size: 20px;
  color: var(--text-secondary);
}

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

.input-icon {
  font-size: 16px;
  color: var(--text-secondary);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 40;
}

.modal-card {
  width: min(640px, 100%);
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow-card), var(--neon-glow);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
}

.modal-search {
  margin-bottom: 12px;
}

.settings-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-card .input {
  padding: 9px 12px;
  font-size: 13px;
  border-radius: 10px;
}

.settings-card .button {
  padding: 8px 14px;
  font-size: 13px;
}

.settings-section-title {
  font-weight: 800;
  font-size: 15px;
}

.settings-avatar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.settings-avatar__preview {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid color-mix(in srgb, var(--accent) 70%, transparent);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
}

.settings-avatar__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.settings-avatar__fallback {
  font-size: 28px;
  font-weight: 800;
}

.settings-avatar__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-link {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}

.settings-link.danger {
  color: var(--danger);
}

.profile-card {
  margin-top: 12px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(74, 168, 255, 0.18), rgba(0, 0, 0, 0.6));
  border: 1.5px solid color-mix(in srgb, var(--accent) 55%, rgba(255, 255, 255, 0.15));
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.45);
}

.profile-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.15), transparent 60%);
  pointer-events: none;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
}

.profile-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-avatar .avatar {
  width: 68px;
  height: 68px;
  border: 3px solid color-mix(in srgb, var(--accent) 70%, transparent);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.35);
}

.profile-meta h2 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 800;
  text-align: left;
}

/* profile header uses .profile-meta h2 */

.profile-header .muted {
  font-size: 12px;
}

.profile-stats {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.profile-stat {
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.profile-actions {
  position: relative;
}

.profile-menu-btn {
  font-size: 20px;
}

.profile-menu {
  position: absolute;
  right: 0;
  top: 44px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  min-width: 180px;
  padding: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  z-index: 10;
}

.profile-menu__item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: #fff;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.profile-menu__item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.profile-menu__danger {
  color: var(--danger);
}

.profile-posts {
  margin-top: 16px;
}

.profile-posts__title {
  font-weight: 700;
  margin: 8px 0 12px;
}

.profile-posts__stack .feed-card {
  background: rgba(16, 20, 40, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.feed-menu-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
}

.profile-loading,
.profile-error {
  font-weight: 700;
}

.challenge-card {
  padding: 25px;
  border: 1px solid rgba(74, 168, 255, 0.55);
  border-radius: 20px;
  box-shadow: 0 0 18px rgba(74, 168, 255, 0.2);
}

.card.glow-strong {
  box-shadow: var(--shadow-card), var(--neon-glow-strong);
}

.card + .card {
  margin-top: 16px;
}

.section-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin: 12px 0 16px;
}

.challenge-hero {
  margin-top: 8px;
  text-align: center;
}

.challenge-title {
  font-size: 32px;
  font-weight: 800;
  margin: 12px 0 6px;
}

.challenge-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 10px;
}

.challenge-stack {
  margin-top: 16px;
}

.fab {
  position: fixed;
  right: 20px;
  bottom: 84px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #0f1a2b;
  font-size: 32px;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 0 18px rgba(74, 168, 255, 0.5);
  cursor: pointer;
  z-index: 20;
}

.create-panel {
  margin-top: 12px;
}

.muted {
  color: var(--text-secondary);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
}

.button {
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: 0 10px 24px rgba(74, 168, 255, 0.25);
}

.button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.button.secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-soft);
  color: var(--text-primary);
  box-shadow: inset 0 0 18px rgba(74, 168, 255, 0.12);
}

.button.danger {
  background: rgba(255, 92, 92, 0.2);
  border: 1px solid rgba(255, 92, 92, 0.5);
  color: #ff5c5c;
  box-shadow: none;
}

.challenge-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 12px;
}

.challenge-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.challenge-header h3 {
  font-size: 26px;
  font-weight: 800;
  margin: 0;
}

.challenge-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.challenge-info {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #2cc36b;
  color: #0f1a2b;
  font-weight: 800;
  font-size: 16px;
  display: grid;
  place-items: center;
  box-shadow: 0 0 12px rgba(44, 195, 107, 0.6);
  cursor: pointer;
}

.challenge-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
  margin: 12px 0;
}

.meta-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
}

.member-list {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.invite-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.member-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.member-info {
  flex: 1;
}

.member-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.member-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.member-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.member-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.member-badge.streak {
  color: #f4b740;
}

.member-badge.fails {
  color: #ff5c5c;
}

.member-badge.pending {
  color: #7cdfff;
}

.member-badge.completed {
  color: #f4d35e;
}

.member-badge.blocked {
  color: #ff5c5c;
}

.member-meta {
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.member-percent {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.member-subline {
  font-size: 12px;
  font-weight: 700;
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.member-subline.streak {
  color: #f4b740;
}

.member-subline.fails {
  color: #ff5c5c;
}

.member-subline.pending {
  color: #7cdfff;
}

.member-subline.completed {
  color: #f4d35e;
}

.member-subline.blocked {
  color: #ff5c5c;
}

.member-fail-icon,
.member-subline-icon {
  font-size: 16px;
}

.member-progress {
  position: relative;
  margin: 12px 0 6px;
  height: 35px;
}

.member-progress__bar {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 12px;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  overflow: hidden;
}

.member-progress__fill {
  height: 100%;
  width: var(--progress);
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
}

.member-progress__fill.hidden {
  width: 0;
}

.member-progress.status-pending .member-progress__bar {
  background: rgba(124, 223, 255, 0.15);
}

.member-progress.status-not_started .member-progress__bar {
  background: rgba(255, 255, 255, 0.1);
}
.member-progress.status-completed .member-progress__fill {
  background: linear-gradient(90deg, #f4d35e, #f08c00);
}

.member-progress.status-blocked .member-progress__fill {
  background: linear-gradient(90deg, #ff5c5c, #ff3b3b);
}

.member-progress.status-pending .member-progress__fill,
.member-progress.status-not_started .member-progress__fill {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.2));
}

.member-progress__avatar {
  position: absolute;
  top: 50%;
  left: var(--progress);
  transform: translate(-50%, -50%);
}

.member-progress__avatar .avatar {
  width: 35px;
  height: 35px;
  border: 4px solid rgba(14, 23, 40, 0.8);
}

.member-progress__avatar.ring-done .avatar {
  border-color: #2cc36b;
  box-shadow: 0 0 8px rgba(44, 195, 107, 0.7);
}

.member-progress__avatar.ring-pending .avatar {
  border-color: #ff5c5c;
  box-shadow: 0 0 8px rgba(255, 92, 92, 0.6);
}

.member-progress__avatar.ring-default .avatar {
  border-color: rgba(74, 168, 255, 0.8);
  box-shadow: 0 0 6px rgba(74, 168, 255, 0.5);
}

.member-progress__status-icon {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 16px;
}

.info-card {
  margin-top: 12px;
}

.info-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.info-header h2 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 800;
}

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

.info-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.info-grid {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.info-label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.info-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.info-members-title {
  font-weight: 700;
  margin-bottom: 12px;
}

.info-loading,
.info-error {
  font-weight: 700;
  margin-bottom: 8px;
}

.member-meta.status-completed {
  color: #f4d35e;
}

.member-meta.status-blocked {
  color: #ff5c5c;
}

.member-meta.status-pending,
.member-meta.status-not_started {
  color: #7cdfff;
}

.member-subline.status-completed {
  color: #f4d35e;
}

.member-subline.status-blocked {
  color: #ff5c5c;
}

.member-subline.status-pending,
.member-subline.status-not_started {
  color: #7cdfff;
}

.raw-details {
  margin-top: 12px;
}

.raw-details__content {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-secondary);
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(12, 18, 34, 0.75);
  color: var(--text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(74, 168, 255, 0.35);
}

.input::placeholder {
  color: rgba(248, 251, 255, 0.5);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.space-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  font-weight: 700;
  overflow: hidden;
}

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

.avatar-stack {
  display: flex;
}

.avatar-stack .avatar {
  width: 32px;
  height: 32px;
  margin-left: -8px;
  border: 2px solid rgba(14, 23, 40, 0.8);
}

.progress {
  height: 8px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
}

.tag {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-weight: 700;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.notification-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}

.notification-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  font-size: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.notification-title {
  font-weight: 800;
  margin-bottom: 4px;
}

.notification-time {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
}

/* Views */
.auth-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  max-width: 420px;
  margin: 40px auto;
}

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

.banner {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(244, 183, 64, 0.2);
  border: 1px solid rgba(244, 183, 64, 0.35);
  color: #fce7b5;
}

.feed-card__image {
  width: 100%;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  height: 160px;
  display: grid;
  place-items: center;
  color: var(--text-secondary);
}

.feed-card__image--placeholder {
  border: 1px dashed rgba(255, 255, 255, 0.25);
}

.feed-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feed-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card), var(--neon-glow-strong);
}

.feed-card__header {
  margin-bottom: 8px;
}

.feed-card__title {
  margin: 10px 0 6px;
  font-size: 20px;
}

.feed-card__content {
  color: var(--text-secondary);
  line-height: 1.5;
}

.feed-card__stats {
  margin-top: 12px;
}

.feed-card__actions .button {
  min-width: 140px;
}

.feed-card__comments {
  background: rgba(15, 26, 43, 0.45);
  border-radius: var(--radius-md);
  padding: 12px;
}

.feed-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.feed-hero h2 {
  margin: 0 0 4px;
  font-size: 26px;
  letter-spacing: 0.4px;
}

.feed-stack {
  gap: 20px;
}

.feed-loading,
.feed-error {
  margin: 12px 0 18px;
  text-align: center;
}

.feed-error {
  border: 1px solid rgba(255, 92, 92, 0.5);
  box-shadow: 0 0 24px rgba(255, 92, 92, 0.35);
}

.optimistic {
  opacity: 0.7;
}

.ambient-orb {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.5;
  z-index: 0;
  pointer-events: none;
}

.ambient-orb.orb-1 {
  top: -80px;
  left: -60px;
  background: radial-gradient(circle, rgba(74, 168, 255, 0.6), transparent 70%);
}

.ambient-orb.orb-2 {
  top: 240px;
  right: -120px;
  background: radial-gradient(circle, rgba(140, 123, 255, 0.55), transparent 70%);
}

.ambient-orb.orb-3 {
  bottom: -120px;
  left: 20%;
  background: radial-gradient(circle, rgba(255, 124, 201, 0.45), transparent 70%);
}

img.feed-card__image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: contain;
}

.chat-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: calc(100vh - 200px);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 4px 10px;
  background: rgba(10, 14, 24, 0.7);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-back {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.chat-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  overflow-y: auto;
  padding-bottom: 90px;
}

.chat-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.chat-row.me {
  justify-content: flex-end;
}

.chat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  border: 2.5px solid var(--warning);
  box-shadow: 0 0 12px color-mix(in srgb, var(--warning) 60%, transparent);
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
}

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

.chat-avatar__fallback {
  font-weight: 700;
  color: #fff;
}

.chat-bubble {
  padding: 10px 14px;
  border-radius: 18px;
  max-width: 72%;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
  position: relative;
}

.chat-bubble::after {
  content: "";
  position: absolute;
  bottom: 6px;
  width: 10px;
  height: 10px;
  background: inherit;
  border-radius: 2px;
  opacity: 0.9;
}

.chat-bubble.me {
  margin-left: auto;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 16px rgba(26, 112, 242, 0.25);
}

.chat-bubble.me::after {
  right: -4px;
  border-radius: 0 0 8px 0;
}

.chat-bubble.other {
  background: linear-gradient(135deg, var(--background-secondary), var(--surface));
  border-color: var(--warning);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25), 0 0 10px color-mix(in srgb, var(--warning) 45%, transparent);
}

.chat-bubble.other::after {
  left: -4px;
  border-radius: 0 0 0 8px;
}

.chat-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 6px;
  background: linear-gradient(135deg, var(--warning), color-mix(in srgb, var(--warning) 70%, #000));
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
}

.chat-text {
  font-size: 14px;
  line-height: 1.45;
}

.chat-time {
  margin-top: 6px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  text-align: right;
}

.chat-row.other .chat-time {
  text-align: left;
}

.chat-confirm {
  display: grid;
  gap: 8px;
}

.chat-confirm__title {
  font-size: 12px;
  font-weight: 700;
  color: #2cc36b;
}

.chat-confirm__image {
  width: 100%;
  max-width: 270px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}

.chat-confirm__caption {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
}

.chat-input {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 8px;
  border-radius: 26px;
  background: rgba(10, 14, 24, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.35);
  position: sticky;
  bottom: 12px;
}

.chat-confirm-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 18px;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(74, 168, 255, 0.2);
}

.chat-camera-card {
  max-width: 520px;
}

.chat-camera {
  border-radius: 16px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-camera video {
  width: 100%;
  height: auto;
  display: block;
}

.chat-camera-actions {
  margin-top: 12px;
  justify-content: flex-end;
}

.chat-input__field {
  flex: 1;
}

.chat-input__text {
  width: 100%;
  min-height: 44px;
  max-height: 140px;
  resize: none;
  border-radius: 22px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border: 1px solid rgba(74, 168, 255, 0.25);
  box-shadow: 0 0 12px rgba(74, 168, 255, 0.25);
  font-family: inherit;
  font-size: 14px;
}

.chat-input__text:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 60%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, rgba(255, 255, 255, 0.04));
}

.chat-send {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 0 16px rgba(74, 168, 255, 0.7);
  cursor: pointer;
}

.chat-send:disabled {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
  box-shadow: none;
  cursor: not-allowed;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.theme-swatch {
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: var(--surface);
  cursor: pointer;
}

.theme-swatch strong {
  display: block;
  font-size: 13px;
}

.theme-preview {
  height: 46px;
  border-radius: 10px;
  margin-top: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, var(--accent), var(--background-secondary));
}

.empty-state {
  text-align: center;
  color: var(--text-secondary);
  padding: 24px 12px;
}

/* Themes */
.theme-ocean {
  --accent: #4aa8ff;
  --accent-strong: #1a70f2;
  --background: #0f1a2b;
  --background-secondary: #142648;
  --bg-spot: #1f3561;
  --surface: rgba(255, 255, 255, 0.12);
  --surface-muted: rgba(255, 255, 255, 0.08);
  --text-primary: #f8fbff;
  --text-secondary: rgba(248, 251, 255, 0.7);
  --success: #2cc36b;
  --warning: #f4b740;
  --danger: #ff5c5c;
}

.theme-forest {
  --accent: #36c57f;
  --accent-strong: #0e8f5a;
  --background: #0d241c;
  --background-secondary: #13352b;
  --bg-spot: #1e3d2e;
  --surface: rgba(255, 255, 255, 0.1);
  --surface-muted: rgba(255, 255, 255, 0.08);
  --text-primary: #f3fff9;
  --text-secondary: rgba(243, 255, 249, 0.7);
  --success: #36c57f;
  --warning: #f4b740;
  --danger: #ff6b6b;
}

.theme-sunset {
  --accent: #ff8b5c;
  --accent-strong: #f05a2b;
  --background: #2b1310;
  --background-secondary: #3b1911;
  --bg-spot: #4a2317;
  --surface: rgba(255, 255, 255, 0.12);
  --surface-muted: rgba(255, 255, 255, 0.08);
  --text-primary: #fff5ef;
  --text-secondary: rgba(255, 245, 239, 0.7);
  --success: #ffb25c;
  --warning: #ffd166;
  --danger: #ff5c5c;
}

.theme-graphite {
  --accent: #9da9ff;
  --accent-strong: #5f6bff;
  --background: #11131b;
  --background-secondary: #1b1f2b;
  --bg-spot: #24293b;
  --surface: rgba(255, 255, 255, 0.1);
  --surface-muted: rgba(255, 255, 255, 0.08);
  --text-primary: #f2f4ff;
  --text-secondary: rgba(242, 244, 255, 0.7);
  --success: #4dd3a0;
  --warning: #f0b85f;
  --danger: #ff6b6b;
}

.theme-blossom {
  --accent: #ff7cc9;
  --accent-strong: #ff4fa8;
  --background: #2b1222;
  --background-secondary: #3d1732;
  --bg-spot: #4a2240;
  --surface: rgba(255, 255, 255, 0.12);
  --surface-muted: rgba(255, 255, 255, 0.08);
  --text-primary: #fff1f8;
  --text-secondary: rgba(255, 241, 248, 0.7);
  --success: #ff9ad5;
  --warning: #ffd166;
  --danger: #ff5c5c;
}

.theme-amethyst {
  --accent: #8c7bff;
  --accent-strong: #5d4bff;
  --background: #1a1430;
  --background-secondary: #241a3f;
  --bg-spot: #2f2750;
  --surface: rgba(255, 255, 255, 0.12);
  --surface-muted: rgba(255, 255, 255, 0.08);
  --text-primary: #f5f1ff;
  --text-secondary: rgba(245, 241, 255, 0.7);
  --success: #67d2ff;
  --warning: #f4b740;
  --danger: #ff5c8a;
}

.theme-turtley {
  --accent: #41d8c8;
  --accent-strong: #1aa68d;
  --background: #0b1f21;
  --background-secondary: #0f2b2e;
  --bg-spot: #1b3b3a;
  --surface: rgba(255, 255, 255, 0.12);
  --surface-muted: rgba(255, 255, 255, 0.08);
  --text-primary: #e9fffb;
  --text-secondary: rgba(233, 255, 251, 0.7);
  --success: #6be28f;
  --warning: #f6c453;
  --danger: #ff6b6b;
}

@media (min-width: 900px) {
  .view-root {
    padding: 0 80px 110px 260px;
  }
}

@media (max-width: 899px) {
  .tab-bar {
    position: static;
    width: auto;
    flex-direction: row;
    justify-content: space-around;
    border-radius: 14px;
    margin: 0 16px 18px;
  }

  .tab-button {
    justify-content: center;
  }
}

@media (max-width: 720px) {
  body {
    background: linear-gradient(180deg, rgba(11, 20, 34, 0.96), rgba(10, 14, 24, 1));
  }

  .ambient-orb {
    width: 180px;
    height: 180px;
    opacity: 0.35;
  }

  .menu-toggle {
    display: none !important;
  }

  .app-header {
    position: sticky;
    top: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    padding: 12px 14px 8px;
    background: rgba(9, 15, 26, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
  }

  .brand {
    justify-self: center;
  }

  .header-actions {
    justify-self: end;
  }

  .brand__icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .brand__title {
    font-size: 15px;
  }

  .brand__subtitle {
    font-size: 10px;
  }

  .header-actions .icon-button {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }

  .view-root {
    order: 3;
    padding: 12px 16px 80px;
  }

  .card {
    padding: 16px;
    border-radius: 16px;
    box-shadow: 0 10px 22px rgba(7, 13, 24, 0.35);
  }

  .section-title {
    font-size: 18px;
  }

  .feed-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .feed-card__actions .button {
    min-width: 0;
    width: 100%;
  }

  .tab-bar {
    order: 2;
    position: sticky;
    top: 64px;
    left: 0;
    right: 0;
    margin: 0 16px 12px;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(10, 16, 30, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(18px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
    z-index: 4;
  }

  .tab-button {
    flex: 1;
    justify-content: center;
    flex-direction: row;
    gap: 8px;
    padding: 8px 6px;
    font-size: 11px;
    color: rgba(248, 251, 255, 0.75);
  }

  .tab-button .icon {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(248, 251, 255, 0.7);
    background: transparent;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.12);
  }

  .tab-button .label {
    text-align: center;
  }

  .tab-button.active {
    color: var(--text-primary);
  }

  .tab-button.active .icon {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 60%, transparent);
  }

  .fab {
    right: 18px;
    bottom: 24px;
    width: 54px;
    height: 54px;
    font-size: 28px;
  }

  .chat-view {
    height: calc(100vh - 220px);
  }

  .chat-bubble {
    max-width: 86%;
  }

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