/* =========================================================
   ENTERPRISE SOCIAL UI — CLEAN PRODUCTION BASE
   Mobile-first / Dark-aware / Instagram-like App Shell
   ========================================================= */

/* =========================
   1) RESET / FOUNDATION
   ========================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body,
h1, h2, h3, h4, h5, h6,
p, ul, ol, li,
figure, blockquote, dl, dd {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
}

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

button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

:root {
  color-scheme: light dark;

  /* Layout */
  --shell-max-width: 430px;
  --radius-xs: 10px;
  --radius-sm: 14px;
  --radius-md: 18px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 1.75rem;
  --space-8: 2rem;

  /* Typography */
  --font-ui: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --text-xs: 0.72rem;
  --text-sm: 0.84rem;
  --text-md: 0.96rem;
  --text-lg: 1.08rem;
  --text-xl: 1.24rem;
  --text-2xl: 1.5rem;

  /* Brand */
  --color-primary: #ff5a1f;
  --color-primary-2: #d946ef;
  --color-accent: #7c3aed;
  --color-success: #16a34a;
  --color-warning: #d97706;
  --color-danger: #dc2626;
  --color-info: #2563eb;

  /* Light theme */
  --bg-body: #f5f7fb;
  --bg-shell: #ffffff;
  --bg-elevated: rgba(255, 255, 255, 0.92);
  --bg-soft: #f8fafc;
  --bg-muted: #f1f5f9;
  --bg-nav: rgba(255, 255, 255, 0.92);

  --text-main: #111827;
  --text-soft: #374151;
  --text-muted: #6b7280;
  --text-faint: #94a3b8;

  --border-light: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.14);

  --shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 14px 36px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 22px 54px rgba(15, 23, 42, 0.14);

  --story-ring: linear-gradient(135deg, #ff7a18, #ff0069 45%, #7c3aed);
  --brand-gradient: linear-gradient(135deg, var(--color-primary), var(--color-primary-2));
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-body: #0b1220;
    --bg-shell: #0f172a;
    --bg-elevated: rgba(15, 23, 42, 0.9);
    --bg-soft: #111c31;
    --bg-muted: #172338;
    --bg-nav: rgba(15, 23, 42, 0.9);

    --text-main: #f8fafc;
    --text-soft: #dbe4f0;
    --text-muted: #94a3b8;
    --text-faint: #64748b;

    --border-light: rgba(148, 163, 184, 0.16);
    --border-strong: rgba(148, 163, 184, 0.24);

    --shadow-sm: 0 10px 28px rgba(0, 0, 0, 0.22);
    --shadow-md: 0 16px 42px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.4);
  }
}

html,
body {
  min-height: 100%;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(255, 90, 31, 0.08), transparent 28%),
    linear-gradient(180deg, var(--bg-body), var(--bg-body));
  color: var(--text-main);
  font-family: var(--font-ui), serif;
  line-height: 1.5;
}

/* =========================
   2) APP SHELL
   ========================= */
.app-shell {
  position: relative;
  width: 100%;
  max-width: var(--shell-max-width);
  min-height: 100dvh;
  margin-inline: auto;
  background: var(--bg-shell);
  box-shadow: var(--shadow-lg);
  overflow-x: hidden;
  overflow-y: visible;
}

.app-main {
  width: 100%;
  flex: 1 1 auto;
  padding: 0 0 calc(88px + env(safe-area-inset-bottom) + 10px);
}

.app-main--guest {
  padding-top: 16px;
}

.app-main--feed {
  padding-inline: 0;
}

.container-page {
  padding: 1rem;
}

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

.surface {
  background: var(--bg-shell);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.surface-soft {
  background: var(--bg-soft);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
}

/* =========================
   3) GLOBAL TOPBAR
   ========================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
}

.topbar-inner {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
}

.topbar-brand {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.brand-mark {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 0.92rem;
  font-weight: 800;
  color: #fff;
  background: var(--brand-gradient);
  box-shadow: 0 8px 18px rgba(255, 90, 31, 0.24);
}

.brand-copy {
  min-width: 0;
}

.brand-title {
  font-size: 0.96rem;
  font-weight: 820;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  margin-top: 0.12rem;
  font-size: 0.7rem;
  line-height: 1.2;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 0 0 auto;
}

.notif-badge {
  min-width: 2.1rem;
  height: 2.1rem;
  padding-inline: 0.65rem;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: var(--brand-gradient);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(255, 90, 31, 0.22);
}

/* =========================
   4) BOTTOM NAV
   ========================= */
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--shell-max-width);
  z-index: 80;
  background: color-mix(in srgb, var(--bg-nav) 88%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--border-light);
  box-shadow: 0 -10px 30px rgba(17, 24, 39, 0.12);
}

.safe-bottom {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bottom-nav-grid {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  align-items: stretch !important;
  justify-items: stretch !important;
  width: 100% !important;
  min-height: 78px;
  margin: 0 !important;
  padding: 0 !important;
  gap: 0 !important;
}

.bottom-nav-grid > .bottom-nav-item,
.bottom-nav-grid > a.bottom-nav-item {
  position: relative;
  min-width: 0 !important;
  min-height: 78px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.25rem !important;
  margin: 0 !important;
  padding: 0.72rem 0.2rem 0.56rem !important;
  color: var(--text-muted);
  text-align: center !important;
  text-decoration: none !important;
}

.bottom-nav a,
.bottom-nav a:link,
.bottom-nav a:visited {
  text-decoration: none !important;
}

.bottom-nav-icon {
  width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-svg {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
}

.bottom-nav-label {
  display: block;
  font-size: 0.68rem;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bottom-nav-item.nav-active,
.bottom-nav-item.nav-active .bottom-nav-label,
.bottom-nav-item.nav-active .bottom-nav-icon {
  color: var(--text-main) !important;
}

.bottom-nav-item.nav-active::before {
  content: "";
  position: absolute;
  top: 0.38rem;
  left: 50%;
  transform: translateX(-50%);
  width: 1.7rem;
  height: 0.18rem;
  border-radius: 999px;
  background: var(--brand-gradient);
}

/* =========================
   5) TYPOGRAPHY / PAGE HEADERS
   ========================= */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.page-head-copy {
  min-width: 0;
}

.page-kicker {
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.page-title {
  margin-top: 0.2rem;
  font-size: 1.25rem;
  line-height: 1.15;
  font-weight: 850;
  letter-spacing: -0.03em;
}

.page-subtitle {
  margin-top: 0.35rem;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* =========================
   6) BUTTONS / BADGES
   ========================= */
.btn,
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-danger {
  min-height: 44px;
  padding: 0.78rem 1rem;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-size: 0.92rem;
  font-weight: 750;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease,
    border-color 0.18s ease,
    opacity 0.18s ease;
}

.btn:hover,
.btn-primary:hover,
.btn-secondary:hover,
.btn-ghost:hover,
.btn-danger:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: #fff;
  background: var(--brand-gradient);
  box-shadow: 0 14px 28px rgba(255, 90, 31, 0.24);
}

.btn-secondary {
  color: var(--text-main);
  background: var(--bg-soft);
  border: 1px solid var(--border-light);
}

.btn-ghost {
  color: var(--text-soft);
  background: transparent;
  border: 1px solid var(--border-light);
}

.btn-danger {
  color: #fff;
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.btn-block {
  width: 100%;
}

.badge,
.badge-success,
.badge-warning,
.badge-danger,
.badge-soft {
  min-height: 28px;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  font-weight: 800;
}

.badge-success {
  color: #166534;
  background: rgba(22, 163, 74, 0.14);
}

.badge-warning {
  color: #92400e;
  background: rgba(217, 119, 6, 0.14);
}

.badge-danger {
  color: #991b1b;
  background: rgba(220, 38, 38, 0.14);
}

.badge-soft {
  color: var(--text-soft);
  background: var(--bg-soft);
  border: 1px solid var(--border-light);
}

/* =========================
   7) CARDS / LISTS / EMPTY STATES
   ========================= */
.card {
  background: var(--bg-shell);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-body {
  padding: 1rem;
}

.card-head {
  padding: 1rem 1rem 0;
}

.card-foot {
  padding: 0 1rem 1rem;
}

.stack-sm {
  display: grid;
  gap: 0.75rem;
}

.stack-md {
  display: grid;
  gap: 1rem;
}

.stack-lg {
  display: grid;
  gap: 1.25rem;
}

.inline-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem 0.6rem;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.empty-state {
  padding: 1.4rem;
  text-align: center;
  background: linear-gradient(180deg, var(--bg-soft), transparent);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}

.empty-state-icon {
  width: 3.4rem;
  height: 3.4rem;
  margin: 0 auto 0.85rem;
  border-radius: 1rem;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--brand-gradient);
  box-shadow: 0 14px 28px rgba(255, 90, 31, 0.22);
}

.empty-state-title {
  font-size: 1rem;
  font-weight: 800;
}

.empty-state-copy {
  margin-top: 0.35rem;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* =========================
   8) STORY RAIL
   ========================= */
.story-rail {
  padding: 0.9rem 1rem 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.story-rail::-webkit-scrollbar {
  display: none;
}

.story-list {
  display: flex;
  gap: 0.9rem;
  width: max-content;
}

.story-item {
  width: 72px;
  text-align: center;
  flex: 0 0 auto;
}

.story-ring {
  width: 68px;
  height: 68px;
  padding: 2px;
  margin-inline: auto;
  border-radius: 999px;
  background: var(--story-ring);
  box-shadow: 0 12px 22px rgba(124, 58, 237, 0.14);
}

.story-inner {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  padding: 3px;
  background: var(--bg-shell);
}

.story-avatar {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  object-fit: cover;
  background: var(--bg-muted);
}

.story-label {
  margin-top: 0.45rem;
  font-size: 0.72rem;
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================
   9) HERO / GUEST CTA
   ========================= */
.hero-cta {
  margin: 1rem;
  padding: 1.15rem;
  border-radius: 24px;
  color: #fff;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 30%),
    linear-gradient(135deg, #111827, #1f2937 45%, #7c3aed 100%);
  box-shadow: var(--shadow-md);
}

.hero-cta-title {
  font-size: 1.18rem;
  line-height: 1.15;
  font-weight: 850;
  letter-spacing: -0.03em;
}

.hero-cta-copy {
  margin-top: 0.45rem;
  color: rgba(255, 255, 255, 0.82);
  font-size: var(--text-sm);
}

.hero-cta-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.hero-cta .btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
}

/* =========================
   10) FEED TOPBAR / FEED SHELL
   ========================= */
.feed-shell {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 12px 12px calc(110px + env(safe-area-inset-bottom));
}

.feed-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(15, 18, 24, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.18);
}

html.light .feed-topbar {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.08);
}

.feed-topbar__brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.feed-topbar__logo {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 0.92rem;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, #fd5949 0%, #d6249f 50%, #285aeb 100%);
  box-shadow: 0 8px 18px rgba(214, 36, 159, 0.28);
}

.feed-topbar__brand-copy {
  min-width: 0;
}

.feed-topbar__title {
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.feed-topbar__subtitle {
  margin-top: 2px;
  font-size: 0.7rem;
  line-height: 1.2;
  color: var(--text-muted);
}

.feed-topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar-btn {
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  transition: 0.2s ease;
  white-space: nowrap;
}

.topbar-btn--ghost {
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

html.light .topbar-btn--ghost {
  border-color: rgba(15, 23, 42, 0.08);
  background: rgba(15, 23, 42, 0.03);
}

.topbar-btn--primary {
  color: #fff;
  background: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.24);
}

/* =========================
   11) STORIES PANEL
   ========================= */
.stories-panel {
  padding: 16px;
  margin-bottom: 16px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.025));
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.18);
}

html.light .stories-panel {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(15, 23, 42, 0.06);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.07);
}

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

.section-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8b5cf6;
}

.section-title {
  margin: 4px 0 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-link {
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
  color: #7c3aed;
}

.stories-rail {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.stories-rail::-webkit-scrollbar {
  display: none;
}

.story-chip {
  flex: 0 0 auto;
  width: 76px;
  text-align: center;
  text-decoration: none;
  color: inherit;
}

.story-chip__ring {
  width: 72px;
  height: 72px;
  margin: 0 auto;
  padding: 3px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f58529 0%, #feda77 22%, #dd2a7b 58%, #8134af 80%, #515bd4 100%);
  box-shadow: 0 10px 22px rgba(221, 42, 123, 0.24);
}

.story-chip__inner {
  width: 100%;
  height: 100%;
  padding: 3px;
  border-radius: 999px;
  background: var(--bg-shell);
}

html.light .story-chip__inner {
  background: #fff;
}

.story-chip__inner--create {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(37, 99, 235, 0.12));
}

.story-chip__plus {
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1;
  color: #7c3aed;
}

.story-chip__avatar {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  object-fit: cover;
  display: block;
}

.story-chip__label {
  margin-top: 8px;
  font-size: 0.72rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-muted);
}

.stories-empty {
  min-height: 84px;
  width: 100%;
  display: grid;
  place-items: center;
  border-radius: 22px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

/* =========================
   12) FEED HERO
   ========================= */
.feed-hero {
  position: relative;
  overflow: hidden;
  padding: 22px 18px;
  margin-bottom: 18px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top right, rgba(124, 58, 237, 0.24), transparent 32%),
    radial-gradient(circle at bottom left, rgba(37, 99, 235, 0.18), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
}

html.light .feed-hero {
  background:
    radial-gradient(circle at top right, rgba(124, 58, 237, 0.12), transparent 32%),
    radial-gradient(circle at bottom left, rgba(37, 99, 235, 0.1), transparent 30%),
    #ffffff;
  border-color: rgba(15, 23, 42, 0.06);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.feed-hero__kicker {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8b5cf6;
}

.feed-hero__title {
  margin: 8px 0 10px;
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.feed-hero__copy {
  margin: 0;
  max-width: 52ch;
  color: var(--text-muted);
  line-height: 1.8;
}

.feed-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

/* =========================
   13) POST CARDS
   ========================= */
.feed {
  display: grid;
  gap: 1rem;
  padding: 0 1rem 1rem;
}

.feed-stack {
  display: grid;
  gap: 18px;
}

.post-card {
  overflow: hidden;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.025));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.2);
}

html.light .post-card {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(15, 23, 42, 0.06);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

.post-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 14px;
}

.post-card__author {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.post-card__avatar-wrap {
  width: 46px;
  height: 46px;
  padding: 2px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fd5949 0%, #d6249f 55%, #285aeb 100%);
}

.post-card__avatar {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  object-fit: cover;
  display: block;
  background: #cbd5e1;
}

.post-card__author-meta {
  min-width: 0;
}

.post-card__author-name {
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.post-card__author-subtitle {
  margin-top: 3px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.post-card__more {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.post-card__media-link {
  display: block;
  text-decoration: none;
}

.post-card__media-shell {
  position: relative;
  overflow: hidden;
  background: #0b1120;
  aspect-ratio: 1 / 1;
}

.post-card__media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-card__body {
  padding: 14px 16px 16px;
}

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

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

/* =========================
   14) ICON BUTTONS / ACTIONS
   ========================= */
.icon-btn {
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  padding: 0;
  border-radius: 0.9rem;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  cursor: pointer;
  color: var(--text-soft);
  background: var(--bg-soft);
  border: 1px solid var(--border-light);
  transition:
    transform 0.18s ease,
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}

.icon-btn:hover {
  transform: translateY(-1px);
}

.icon-btn.is-active {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.22);
}

.icon-btn.is-copied {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.25);
}

.icon-svg {
  width: 1.2rem;
  height: 1.2rem;
  display: block;
  flex: 0 0 auto;
}

.action-chip {
  min-height: 38px;
  padding: 0.55rem 0.78rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  background: var(--bg-soft);
  border: 1px solid var(--border-light);
  color: var(--text-soft);
  font-size: var(--text-sm);
  font-weight: 700;
}

/* =========================
   15) REELS
   ========================= */
.reel-card {
  overflow: hidden;
  background: var(--bg-shell);
  border: 1px solid var(--border-light);
  border-radius: 24px;
  box-shadow: var(--shadow-sm);
}

.reel-media {
  position: relative;
  aspect-ratio: 9 / 13;
  background: linear-gradient(180deg, #dbe4f0, #cbd5e1);
  overflow: hidden;
}

.reel-media img,
.reel-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reel-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(15, 23, 42, 0.74) 100%);
  pointer-events: none;
}

.reel-pill {
  position: absolute;
  top: 0.85rem;
  inset-inline-start: 0.85rem;
  z-index: 1;
  min-height: 30px;
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 800;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
}

.reel-content {
  padding: 0.95rem 1rem 1rem;
}

.reel-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.reel-avatar {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 999px;
  background: var(--bg-muted);
  object-fit: cover;
  flex: 0 0 auto;
}

.reel-author {
  min-width: 0;
}

.reel-author-name {
  font-size: 0.95rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reel-author-meta {
  margin-top: 0.12rem;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.reel-title {
  margin-top: 0.9rem;
  font-size: 1rem;
  line-height: 1.35;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.reel-caption {
  margin-top: 0.45rem;
  color: var(--text-soft);
  font-size: var(--text-sm);
}

.reel-actions {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* =========================
   16) USER ROW / LIKES LIST
   ========================= */
.user-list {
  display: grid;
  gap: 0.8rem;
}

.user-row {
  padding: 0.85rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--bg-shell);
  border: 1px solid var(--border-light);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

.user-row-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  object-fit: cover;
  background: var(--bg-muted);
  flex: 0 0 auto;
}

.user-row-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.user-row-title {
  font-size: 0.95rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-row-subtitle {
  margin-top: 0.2rem;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

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

/* =========================
   17) ADMIN TOOLBAR / GRID
   ========================= */
.admin-toolbar {
  margin: 1rem;
  padding: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  background: var(--bg-shell);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}

.admin-toolbar-title {
  font-size: 1rem;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.admin-toolbar-copy {
  margin-top: 0.18rem;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.admin-grid {
  display: grid;
  gap: 1rem;
  padding: 0 1rem 1rem;
}

.admin-card {
  overflow: hidden;
  background: var(--bg-shell);
  border: 1px solid var(--border-light);
  border-radius: 22px;
  box-shadow: var(--shadow-sm);
}

.admin-card-media {
  aspect-ratio: 16 / 10;
  background: var(--bg-muted);
  overflow: hidden;
}

.admin-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-card-body {
  padding: 1rem;
}

.admin-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.admin-card-title {
  font-size: 1rem;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.admin-card-copy {
  margin-top: 0.4rem;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.admin-card-meta {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.5rem;
}

.admin-card-actions {
  margin-top: 0.95rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* =========================
   18) FORMS
   ========================= */
.form-stack {
  display: grid;
  gap: 0.9rem;
}

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

.field-label {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-soft);
}

.input,
textarea,
select {
  width: 100%;
  min-height: 46px;
  padding: 0.82rem 0.95rem;
  color: var(--text-main);
  background: var(--bg-shell);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  outline: none;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background-color 0.16s ease;
}

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

.input:focus,
textarea:focus,
select:focus {
  border-color: rgba(217, 70, 239, 0.38);
  box-shadow: 0 0 0 4px rgba(217, 70, 239, 0.12);
}

/* =========================
   19) HELPERS
   ========================= */
.muted {
  color: var(--text-muted);
}

.soft {
  color: var(--text-soft);
}

.text-center {
  text-align: center;
}

.hidden {
  display: none !important;
}

.w-full {
  width: 100%;
}

.mt-1 {
  margin-top: 0.25rem;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-3 {
  margin-top: 0.75rem;
}

.mt-4 {
  margin-top: 1rem;
}

.mb-3 {
  margin-bottom: 0.75rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

/* =========================
   20) LARGE SCREENS
   ========================= */
@media (min-width: 768px) {
  body {
    padding: 20px 0;
  }

  .app-shell {
    border-radius: 28px;
    border: 1px solid var(--border-light);
  }
}

/* =========================
   21) SMALL SCREEN POLISH
   ========================= */
@media (max-width: 380px) {
  .topbar-inner {
    min-height: 56px;
    padding: 0.58rem 0.75rem;
  }

  .brand-mark {
    width: 1.95rem;
    height: 1.95rem;
    border-radius: 0.72rem;
  }

  .brand-title {
    font-size: 0.9rem;
  }

  .brand-subtitle {
    font-size: 0.66rem;
  }

  .feed-topbar {
    padding: 9px 10px;
    border-radius: 16px;
  }

  .feed-topbar__logo {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    font-size: 0.85rem;
  }

  .topbar-btn {
    height: 34px;
    padding: 0 10px;
    font-size: 0.74rem;
  }
}

/* =========================
   22) DARK POLISH
   ========================= */
@media (prefers-color-scheme: dark) {
  .bottom-nav {
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.35);
  }

  .hero-cta {
    background:
      radial-gradient(circle at top right, rgba(255, 255, 255, 0.12), transparent 30%),
      linear-gradient(135deg, #111827, #1e293b 45%, #6d28d9 100%);
  }

  .reel-media {
    background: linear-gradient(180deg, #1e293b, #0f172a);
  }
}
/* =========================================
   FEED PAGE
========================================= */

.feed-page{
  width:100%;
  max-width:1400px;
  margin:0 auto;
  padding:24px 16px 60px;
}

.feed-layout{
  display:grid;
  grid-template-columns: minmax(0,1fr) 320px;
  gap:28px;
  align-items:start;
}

/* =========================================
   MAIN COLUMN
========================================= */

.feed-main{
  display:flex;
  flex-direction:column;
  gap:24px;
}

/* =========================================
   HERO
========================================= */

.feed-hero{
  padding:22px 24px;
}

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

.feed-hero__actions{
  display:flex;
  gap:10px;
}

/* =========================================
   CARD SURFACE
========================================= */

.card-surface{
  background:#fff;
  border:1px solid #e6e8ee;
  border-radius:14px;
  padding:18px;
  box-shadow:0 4px 18px rgba(0,0,0,0.04);
}

/* =========================================
   SECTION HEAD
========================================= */

.section-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:14px;
}

.section-kicker{
  font-size:12px;
  font-weight:600;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#8c92a4;
  margin-bottom:4px;
}

.section-title{
  font-size:22px;
  font-weight:700;
  color:#1c2230;
}

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

.section-subtitle{
  font-size:14px;
  color:#6f7687;
  margin-top:6px;
}

/* =========================================
   STORIES
========================================= */

.feed-stories{
  overflow:hidden;
}

.stories-rail{
  display:flex;
  gap:14px;
  overflow-x:auto;
  padding-top:8px;
  padding-bottom:4px;
}

.stories-rail::-webkit-scrollbar{
  height:6px;
}

.stories-rail::-webkit-scrollbar-thumb{
  background:#d8dbe5;
  border-radius:20px;
}

.stories-rail__item{
  flex:0 0 auto;
}

/* =========================================
   POSTS
========================================= */

.feed-posts{
  display:flex;
  flex-direction:column;
}

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

.post-wrap{
  width:100%;
}

/* =========================================
   SIDEBAR
========================================= */

.feed-sidebar{
  display:flex;
  flex-direction:column;
  gap:20px;
}

.sidebar-card{
  display:flex;
  flex-direction:column;
  gap:16px;
}

/* =========================================
   STATS
========================================= */

.stats-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

.stat-box{
  border:1px solid #eceef4;
  border-radius:10px;
  padding:14px;
  background:#fafbfe;
}

.stat-box__label{
  display:block;
  font-size:12px;
  color:#7a8093;
  margin-bottom:4px;
}

.stat-box__value{
  font-size:18px;
  font-weight:700;
  color:#1e2433;
}

/* =========================================
   QUICK ACTIONS
========================================= */

.quick-actions{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.quick-actions__item{
  display:block;
  padding:10px 12px;
  border-radius:8px;
  background:#f4f6fb;
  color:#2b3142;
  font-size:14px;
  text-decoration:none;
  transition:all .18s ease;
}

.quick-actions__item:hover{
  background:#e9edf8;
}

/* =========================================
   EMPTY STATE
========================================= */

.empty-state{
  padding:22px;
  text-align:center;
  color:#7a8093;
  font-size:14px;
}

/* =========================================
   BUTTONS
========================================= */

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 16px;
  border-radius:8px;
  font-size:14px;
  font-weight:600;
  text-decoration:none;
  border:1px solid transparent;
  cursor:pointer;
}

.btn-primary{
  background:#4f6df5;
  color:#fff;
}

.btn-primary:hover{
  background:#3e59d6;
}

/* =========================================
   RESPONSIVE
========================================= */

@media (max-width:1100px){

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

  .feed-sidebar{
    order:-1;
  }

}

@media (max-width:640px){

  .feed-hero__content{
    flex-direction:column;
    align-items:flex-start;
  }

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

}
/* Instagram Polishing Patch */
.top-bar {
    position: sticky; top: 0; height: 60px; background: #fff;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 15px; border-bottom: 1px solid #efefef; z-index: 100;
}
.top-bar__brand { font-family: 'Billabong', cursive; font-size: 24px; font-weight: bold; }

.bottom-nav {
    position: fixed; bottom: 0; height: 65px; background: #fff;
    display: flex; justify-content: space-around; align-items: center;
    border-top: 1px solid #efefef; z-index: 100; width: 100%;
}
.nav-item--plus .plus-box {
    background: #000; border-radius: 8px; padding: 4px 10px;
}

.stories-wrapper { padding: 10px 0; border-bottom: 1px solid #efefef; overflow-x: auto; }
.stories-scroll { display: flex; gap: 15px; padding: 0 15px; }
.story-item { display: flex; flex-direction: column; align-items: center; text-decoration: none; font-size: 11px; color: #262626; }
.story-ring {
    width: 66px; height: 66px; border-radius: 50%;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    display: flex; align-items: center; justify-content: center; margin-bottom: 5px;
}
.story-avatar { width: 60px; height: 60px; border-radius: 50%; border: 2px solid #fff; overflow: hidden; position: relative; }
.story-avatar img { width: 100%; height: 100%; object-fit: cover; }

.post-card { margin-bottom: 20px; background: #fff; border-bottom: 1px solid #efefef; }
.post-header { display: flex; align-items: center; justify-content: space-between; padding: 10px; }
.post-author { display: flex; align-items: center; gap: 10px; }
.avatar-small { width: 32px; height: 32px; background: #eee; border-radius: 50%; }
.username { font-weight: 600; font-size: 14px; }

.post-media-area { position: relative; background: #000; min-height: 300px; display: flex; align-items: center; }
.post-media { width: 100%; display: block; }

.like-btn.is-active svg { fill: #ed4956; stroke: #ed4956; animation: pop 0.3s ease; }
@keyframes pop { 50% { transform: scale(1.2); } }

.heart-overlay {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0);
    font-size: 80px; opacity: 0; pointer-events: none; transition: 0.3s;
}
.animate-heart { animation: heartFade 0.8s ease-in-out; }
@keyframes heartFade {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.9; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}


/* Footer position hotfix */
.bottom-nav{
  position:fixed !important;
  left:0 !important;
  right:0 !important;
  bottom:35px !important;
  width:100% !important;
  max-width:none !important;
  transform:none !important;
  display:block !important;
  padding:10px 12px calc(env(safe-area-inset-bottom,0px) + 10px) !important;
  background:transparent !important;
  border-top:0 !important;
  box-shadow:none !important;
  z-index:80 !important;
  pointer-events:none;
}
.bottom-nav.safe-bottom{padding-bottom:calc(env(safe-area-inset-bottom,0px) + 10px) !important;}
.bottom-nav-grid{
  max-width:760px !important;
  margin:0 auto !important;
  display:grid !important;
  grid-template-columns:repeat(5,minmax(0,1fr)) !important;
  gap:8px !important;
  padding:8px !important;
  width:100% !important;
  background:var(--nav-bg) !important;
  border:1px solid var(--nav-border) !important;
  border-radius:26px !important;
  box-shadow:var(--nav-shadow) !important;
  pointer-events:auto !important;
}
@media (max-width:640px){
  .bottom-nav{padding:8px 10px calc(env(safe-area-inset-bottom,0px) + 8px) !important;}
  .bottom-nav-grid{gap:6px !important;padding:7px !important;}
}
